:root {
  --glass: rgba(7, 16, 34, 0.68);
  --glass-strong: rgba(7, 16, 34, 0.84);
  --line: rgba(255,255,255,0.12);
  --text: #f4f7fb;
  --muted: rgba(244,247,251,0.72);
  --accent: #7dc6ff;
  --pill-bg: rgba(255,255,255,0.08);
  --pill-focus: rgba(125, 198, 255, 0.16);
  --pill-border: rgba(255,255,255,0.08);
  --header-bg: rgba(2, 9, 22, 0.74);
  --bg-dim-start: rgba(1, 6, 18, 0.42);
  --bg-dim-end: rgba(1, 6, 18, 0.58);
  --popup-bg: #1a1a1a;
}

body.light-mode {
  --glass: rgba(45, 45, 45, 0.75);
  --glass-strong: rgba(35, 35, 35, 0.9);
  --line: rgba(255, 255, 255, 0.15);
  --text: #e0e0e0;
  --muted: rgba(255, 255, 255, 0.65);
  --accent: #b0b0b0;
  --pill-bg: rgba(255, 255, 255, 0.08);
  --pill-focus: rgba(255, 255, 255, 0.12);
  --pill-border: rgba(255, 255, 255, 0.1);
  --header-bg: rgba(30, 30, 30, 0.9);
  --bg-dim-start: rgba(20, 20, 20, 0.52);
  --bg-dim-end: rgba(20, 20, 20, 0.68);
  --popup-bg: #2a2a2a;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    linear-gradient(var(--bg-dim-start), var(--bg-dim-end)),
    url('assets/us-night.jpg') center center / cover fixed no-repeat;
}

.site-shell {
  min-height: 100%;
  backdrop-filter: blur(2px);
}

header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.nav-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  flex-wrap: nowrap;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
}

.nav-wrap > div:first-child {
  flex: 0 0 33.333%;
}

nav {
  flex: 0 0 66.666%;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.brand {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

nav a {
  text-decoration: none;
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.08);
  position: relative;
  transition: all 0.5s ease;
}

nav a:hover,
nav a.active {
  background: rgba(125, 198, 255, 0.16);
  border-color: rgba(125, 198, 255, 0.35);
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px 40px;
}

@media (max-width: 600px) {
  main {
    max-width: none;
    padding: 10px 0;
  }
}

.hero {
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--glass);
  box-shadow: 0 18px 48px rgba(0,0,0,0.26);
  margin-bottom: 20px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 2vw, 2.4rem);
}

.hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.table-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--glass-strong);
  box-shadow: 0 20px 50px rgba(0,0,0,0.28);
  overflow-x: auto;
}

.table-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.95rem;
}

button {
  border-radius: 999px;
}

.clear-btn {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.07);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.clear-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

.clear-btn.save-feedback-loading,
.popup-btn.save-feedback-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: wait;
  opacity: 0.95;
}

.clear-btn.save-feedback-success,
.popup-btn.save-feedback-success {
  background: #2f9e44 !important;
  border-color: #2f9e44 !important;
  color: #ffffff !important;
}

.save-feedback-spinner {
  width: 1em;
  height: 1em;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  display: inline-block;
  animation: save-feedback-spin 0.75s linear infinite;
}

@keyframes save-feedback-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.grid-table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 14px 12px;
}

.grid-table th {
  text-align: left;
  font-weight: 700;
  color: var(--text);
  opacity: 0.9;
  padding: 0 10px 4px;
}

.grid-table td {
  padding: 0;
}

.pill-cell {
  position: relative;
  min-height: 46px;
  width: 100%;
  border-radius: 999px;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  padding: 12px 16px;
  color: var(--text);
  outline: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: text;
  z-index: 1;
}

.progress-fill-bg {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  background: var(--accent);
  opacity: 0.2;
  z-index: -1;
  pointer-events: none;
}

.progress-fill-bg.animate-progress {
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.6s ease;
}

.progress-fill-bg.filling {
  opacity: 0.5;
}

.progress-fill-bg.finished {
  opacity: 0.2;
}

.progress-fill-bg.completed-green {
  background: #28a745 !important;
  opacity: 0.3 !important;
}

.progress-fill-bg.fade-out {
  opacity: 0 !important;
  transition: opacity 1s ease, width 0s linear 1s !important;
}

.pill-cell:focus {
  background: var(--pill-focus);
  border-color: rgba(125, 198, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(125, 198, 255, 0.16);
  white-space: normal;
}

.pill-cell-container {
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  z-index: 1;
}

.pill-cell-container.stacked {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.row-delete-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--pill-border);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.row-delete-btn:hover {
  background: rgba(235, 87, 87, 0.28);
  border-color: rgba(235, 87, 87, 0.45);
}

/* Delete Mode Toggle */
.password-style {
  -webkit-text-security: disc;
}

.pill-cell.password-style:focus {
  -webkit-text-security: none;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
  flex-shrink: 0;
}

.header-toggle {
  position: absolute;
  right: 32px;
  top: 50%;
  transform: translateY(-50%) scale(0.65);
  z-index: 2;
}

.col-delete-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  z-index: 3;
  line-height: 1;
}

.col-delete-btn:hover {
  color: #eb5757;
}

.header-pill {
  padding-right: 76px !important;
}

.add-col-btn-inline {
  background: rgba(125, 198, 255, 0.16);
  border: 1px solid rgba(125, 198, 255, 0.35);
  color: var(--accent);
  border-radius: 4px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-right: 8px;
  vertical-align: middle;
  font-size: 16px;
  line-height: 1;
  transition: all 0.2s;
}

.add-col-btn-inline:hover {
  background: rgba(125, 198, 255, 0.25);
  transform: scale(1.1);
}

#sort-label {
  user-select: none;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255,255,255,0.12);
  transition: .4s;
  border-radius: 34px;
  border: 1px solid var(--pill-border);
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #2196F3;
}

input:focus + .slider {
  box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
  transform: translateX(24px);
}

/* Delete Highlight */
tr.delete-highlight .pill-cell {
  background: rgba(235, 87, 87, 0.4) !important;
  border-color: rgba(235, 87, 87, 0.8) !important;
}

/* Unfinished Task Row Highlight */
tr.unfinished-row {
  position: relative;
  z-index: 1;
}

.reset-pill-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  margin-right: 6px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.reset-pill-btn:hover {
  background: var(--pill-focus);
  border-color: var(--accent);
}

tr.unfinished-row::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(128, 128, 128, 0.25);
    border-radius: 12px;
  z-index: -1;
  pointer-events: none;
  margin: -8px -10px; /* Offset to cover the spacing and rounded cells */
}

/* Progress Bar for Current Assignment */
.progress-container {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}
.progress-bar {
  height: 100%;
  background: var(--accent);
  width: 0;
  transition: width 0.3s ease;
}

.add-row-container {
  margin-top: -4px;
  padding: 0 14px 20px;
}

.add-row-btn {
  appearance: none;
  background: rgba(255, 255, 255, 0.06);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  color: var(--muted);
  border-radius: 999px;
  padding: 10px 20px;
  cursor: pointer;
  width: 100%;
  transition: 160ms ease;
  font-size: 0.95rem;
}

.add-row-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.3);
}

.segment-select {
  appearance: none;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid var(--pill-border);
  border-radius: 999px;
  padding: 8px 16px;
  outline: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.segment-select:focus {
  border-color: var(--pill-focus);
  background: rgba(255, 255, 255, 0.08);
}

.segment-select option {
  background: var(--popup-bg);
  color: var(--text);
}

.personnel-select {
  appearance: none;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid var(--pill-border);
  border-radius: 999px;
  padding: 8px 16px;
  outline: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.15s ease, background 0.15s ease;
  width: 100%;
}

.personnel-select:focus {
  border-color: var(--pill-focus);
  background: rgba(255, 255, 255, 0.08);
}

.personnel-select option {
  background: var(--popup-bg);
  color: var(--text);
}

.pill-checkbox {
  appearance: none;
  width: 20px;
  height: 20px;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
  border-radius: 999px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.pill-checkbox:checked {
  background: var(--pill-focus);
  border-color: rgba(125, 198, 255, 0.65);
}

.pill-checkbox:checked::after {
  content: '✓';
  color: var(--accent);
  font-size: 16px;
  font-weight: bold;
}

.pill-checkbox:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(125, 198, 255, 0.16);
}

.status {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 28px;
  color: rgba(244,247,251,0.72);
  font-size: 0.88rem;
  text-align: center;
}

@media (max-width: 600px) {
  footer {
    max-width: none;
    padding: 0 10px 20px;
  }
}

@media (max-width: 860px) {
  .nav-wrap { flex-wrap: wrap; justify-content: center; }
  .nav-wrap > div:first-child { flex: 0 0 100%; }
  .brand { width: 100%; text-align: center; }
  nav { flex: 0 0 100%; justify-content: center; }
}


.tool-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.header-pill {
  min-height: 42px;
  font-weight: 700;
}

.fixed-header {
  padding: 0 10px 4px;
}

.readonly-pill {
  background: rgba(125, 198, 255, 0.08);
  border-color: rgba(125, 198, 255, 0.22);
  cursor: default;
  color: var(--muted);
}

.readonly-pill:focus {
  box-shadow: none;
  background: rgba(125, 198, 255, 0.08);
}

.clickable-pill {
  cursor: pointer;
  transition: all 0.2s ease;
}
.clickable-pill:hover {
  background: var(--pill-focus);
  border-color: var(--accent);
}

.file-badge {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.home-card {
  max-width: 1200px;
}

.home-grid,
.dashboard-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 860px) {
  .home-grid {
    grid-template-columns: 1fr;
  }
}

.dashboard-grid {
  grid-template-columns: 1fr 1fr 1.5fr;
}

.home-panel.full-width {
  grid-column: span 3;
}

@media (max-width: 860px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .home-panel.full-width {
    grid-column: span 1;
  }
  .home-panel {
    grid-row: auto !important;
    grid-column: auto !important;
  }
  .home-card {
    padding: 10px;
    border-radius: 12px;
  }
  .home-panel {
    border-radius: 12px;
    padding: 15px;
  }
}

@media (max-width: 600px) {
  .hero, .table-card {
    border-left: none;
    border-right: none;
    border-radius: 0;
  }
  .home-card {
    padding: 0;
  }
  .dashboard-grid {
    gap: 15px;
  }
  .home-panel {
    border-left: none;
    border-right: none;
    border-radius: 0;
    padding: 20px 15px;
  }
}

.home-panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,0.04);
  padding: 18px;
}

.home-panel h2 {
  margin: 0 0 12px;
  font-size: 1.05rem;
}

.home-row,
.home-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.pill-input {
  min-height: 46px;
  min-width: min(100%, 360px);
  border-radius: 999px;
  border: 1px solid var(--pill-border);
  background: var(--pill-bg);
  color: var(--text);
  padding: 12px 16px;
  outline: none;
}

.pill-input:focus {
  background: var(--pill-focus);
  border-color: rgba(125, 198, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(125, 198, 255, 0.16);
}

.psr-cell-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  width: 100%;
}

.psr-cell-container .pill-cell {
  transition: all 0.2s ease;
}

.psr-cell-container:hover .pill-cell {
  /* Keep standard formatting, maybe a slight shift if needed, but the prompt says "formatted exactly like other cells" */
}

.psr-cell-container .row-search-btn {
  display: none;
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 11px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  z-index: 10;
  transition: color 0.4s ease;
}

.psr-cell-container .row-search-btn.log-sweeps-active {
  color: #ff4d4d;
}

.psr-cell-container:hover .row-search-btn {
  display: block;
}

.blank-highlight {
  background: rgba(235, 87, 87, 0.2) !important;
  border-color: rgba(235, 87, 87, 0.45) !important;
}

.sub-nav {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.sub-nav-btn {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.5s ease;
  font-size: 0.9rem;
  outline: none;
}

.sub-nav-btn svg, .mini-pill svg, .update-pill svg {
  fill: none !important;
  stroke: currentColor !important;
}

.sub-nav-btn:hover {
  background: var(--pill-focus);
}

.sub-nav-btn.active {
  background: var(--pill-focus);
  color: var(--text);
  border-color: var(--accent);
  font-weight: 700;
}

.activity-log-entry {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  line-height: 1.4;
}
.activity-log-entry:last-child {
  border-bottom: none;
}
#log-search {
  border-radius: 8px !important;
  padding: 8px 16px !important;
  background: var(--pill-bg) !important;
  border: 1px solid var(--pill-border) !important;
  color: var(--text) !important;
  outline: none !important;
  transition: all 0.2s ease !important;
}

#log-search:focus {
  background: var(--pill-focus) !important;
  border-color: rgba(125, 198, 255, 0.65) !important;
  box-shadow: 0 0 0 3px rgba(125, 198, 255, 0.16) !important;
}

.pill-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
}

.mini-pill {
  position: relative;
  overflow: hidden;
  z-index: 1;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.mini-pill:hover {
  background: var(--pill-focus);
}

.mini-pill[contenteditable="true"]:focus,
.mini-pill.personnel-select:focus {
  background: var(--pill-focus);
  border-color: rgba(125, 198, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(125, 198, 255, 0.16);
  outline: none;
  white-space: normal;
}

.mini-pill.active {
  background: rgba(125, 198, 255, 0.25) !important;
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}

.update-pill {
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  color: var(--text);
  font-weight: 700;
  text-align: center;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.update-pill:hover {
  background: rgba(33, 150, 243, 0.28);
  border-color: rgba(33, 150, 243, 0.45);
}

.profile-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  margin-left: 10px;
}

.profile-nav-btn:hover {
  background: var(--pill-focus);
  border-color: var(--accent);
}

.profile-nav-btn.active {
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(125, 198, 255, 0.3);
}

.profile-nav-btn.active:not([class*="profile-highlight-"]) {
  background: rgba(125, 198, 255, 0.2);
  color: var(--accent);
}

.profile-nav-btn svg {
  width: 20px;
  height: 20px;
}

/* Animations for popups */
@keyframes popupExpand {
  from {
    transform: scale(0.1);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.popup-content.expanding {
    animation: popupExpand 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.popup-close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 5px;
  line-height: 1;
  transition: color 0.2s ease;
  z-index: 10;
}

.popup-close-btn:hover {
  color: var(--text);
}

.popup-overlay.fade-out {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.popup-overlay.fade-out-slow {
  opacity: 0;
  transition: opacity 1s ease;
}

@keyframes popupFadeOut {
  from { transform: scale(1); opacity: 1; }
  to { transform: scale(0.9); opacity: 0; }
}

@keyframes popupFadeOutSlow {
  from { opacity: 1; }
  to { opacity: 0; }
}

.popup-overlay.fade-out .popup-content {
  animation: popupFadeOut 0.2s ease forwards;
}

.popup-overlay.fade-out-slow .popup-content {
  animation: popupFadeOutSlow 1s ease forwards;
}

@keyframes slideInFromTop {
  from {
    transform: translateY(-100vh);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.popup-content.slide-in-top {
  animation: slideInFromTop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  margin-top: 15px;
}

@keyframes blurWipeIn {
  from {
    filter: blur(12px);
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    filter: blur(0);
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.new-row-animation {
  /* Removed table animation as per request */
}

/* Page transitions */
.page-transition-blur {
  transform: translateX(0);
  transition: transform 0.4s ease;
}

/* Animations removed */

/* Notification Fade-in */
@keyframes notifFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes notifFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

.notif-toast {
  position: fixed;
  top: 20px !important;
  right: 20px !important;
  left: auto !important;
  bottom: auto !important;
  background: var(--glass-strong);
  border: 1px solid var(--accent);
  padding: 15px 20px;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  z-index: 2000 !important;
  cursor: pointer;
  max-width: 300px;
  animation: notifFadeIn 0.3s ease-out forwards;
  display: flex;
  align-items: center;
  gap: 12px;
}

.notif-toast.dismissing {
  animation: notifFadeOut 0.4s ease-in forwards !important;
}

.notif-toast:hover {
  background: var(--pill-focus);
}

.toast-close-btn:hover {
  opacity: 1 !important;
  color: #ff4444 !important;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.9rem;
  border: 1px solid transparent;
}

.calendar-day:hover {
  background: var(--pill-focus);
  border-color: var(--accent);
}

.calendar-day.selected {
  background: var(--accent);
  color: var(--popup-bg);
}

.calendar-day.today {
  border-color: var(--accent);
  font-weight: 700;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
}

.chart-dot {
  fill: var(--accent);
  cursor: pointer;
}

.chart-dot:hover {
  opacity: 1;
}

.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup-content {
  position: relative;
  background: var(--glass-strong);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
}

.popup-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 20px;
  text-align: center;
}

.popup-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.popup-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--pill-border);
  color: var(--text);
  padding: 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.popup-btn:hover {
  background: rgba(125, 198, 255, 0.16);
  border-color: var(--accent);
}

.popup-btn.primary {
  background: var(--accent);
  color: var(--popup-bg);
  border-color: var(--accent);
}

.popup-input-container {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.popup-textarea {
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--pill-border);
  border-radius: 32px;
  color: var(--text);
  padding: 12px;
  min-height: 100px;
  resize: vertical;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
}

.popup-textarea:focus {
  border-color: var(--accent);
}

.upload-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  cursor: pointer;
}

.upload-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.par-check-due {
  background: transparent !important;
  color: #ff8c00 !important;
  border: 2px solid #ff8c00 !important;
  position: relative;
  cursor: pointer !important;
}

.par-due-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ff8c00;
  color: #fff;
  border: 2px solid #fff;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  z-index: 5;
}

.popup-select {
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--pill-border);
  border-radius: 999px;
  color: var(--text);
  padding: 12px 16px;
  font-size: 1rem;
  outline: none;
  cursor: pointer;
  appearance: none;
  width: 100%;
}

.popup-select:focus {
  border-color: var(--accent);
}

.popup-select option {
  background: var(--popup-bg);
  color: var(--text);
}

#base-teams-container h2 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: var(--muted);
}

#base-teams-container .grid-table {
  min-width: unset;
  width: auto;
  border-spacing: 14px 8px;
}

#base-teams-container .grid-table th,
#base-teams-container .grid-table td {
  width: 200px;
}

#nav-personnel.par-check-due {
  background-color: transparent !important;
  color: #ff8c00 !important;
  border: 2px solid #ff8c00 !important;
  border-radius: 999px;
  padding: 8px 14px;
}

#nav-search-log.log-sweeps-due {
  background-color: transparent !important;
  color: #ff4d4d !important;
  border: 2px solid #ff4d4d !important;
  border-radius: 999px;
  padding: 8px 14px;
  transition: all 0.4s ease;
}

#nav-profile.profile-incomplete {
  background-color: transparent !important;
  color: #ffa500 !important;
  border: 2px solid #ffa500 !important;
  border-radius: 999px;
  padding: 8px 14px;
}

/* Notification Sidebar */
.notif-toast.par-check-due {
  border: 2px solid #ff8c00;
  color: #ff8c00;
}

.notif-toast.par-check-due svg {
  color: #ff8c00 !important;
}

.notif-toast.log-sweeps-due {
  border: 2px solid #ff4d4d;
  color: #ff4d4d;
}

.notif-toast.log-sweeps-due svg {
  color: #ff4d4d !important;
}

.notif-toast.profile-incomplete {
  border: 2px solid #ffa500;
  color: #ffa500;
}

.notif-toast.profile-incomplete svg {
  color: #ffa500 !important;
}

.notification-sidebar {
  position: fixed;
  top: 0;
  right: -350px;
  width: 350px;
  height: 100%;
  background: var(--glass-strong);
  backdrop-filter: blur(10px);
  border-left: 1px solid var(--line);
  z-index: 1100;
  transition: right 0.3s ease;
  padding: 20px;
  box-shadow: -8px 0 30px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
}

.notification-sidebar.open {
  right: 0;
}

.notification-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.notification-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notification-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--pill-border);
  border-radius: 999px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.notification-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.notification-item-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.notification-item-text {
  font-size: 0.9rem;
  color: var(--muted);
}

.notification-bell {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.16s ease;
  position: relative;
  font-size: 1.2rem;
  margin-left: 10px;
}

.notification-bell:hover {
  background: rgba(125, 198, 255, 0.16);
  border-color: rgba(125, 198, 255, 0.35);
}

.notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 10px;
  height: 10px;
  background: #ff4d4d;
  border-radius: 50%;
  border: 2px solid var(--header-bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.notification-dot.active {
  opacity: 1;
  pointer-events: auto;
}

.par-check-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 10px;
  height: 10px;
  background: #ffa500;
  border-radius: 50%;
  border: 2px solid var(--header-bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.par-check-dot.active {
  opacity: 1;
  pointer-events: auto;
}

tr.log-sweeps-due {
  position: relative;
  z-index: 1;
  transition: all 0.4s ease;
}
tr.log-sweeps-due::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(235, 87, 87, 0.28);
    border-radius: 12px;
  z-index: -1;
  pointer-events: none;
  margin: -8px -10px;
  transition: background 0.4s ease;
}

.notification-item.par-check-due {
  border-color: #ff8c00;
}

.notification-item.par-check-due .notification-item-title {
  color: #ff8c00;
}

.notification-item.par-check-due svg {
  color: #ff8c00 !important;
}

.notification-item.log-sweeps-due {
  border-color: #ff4d4d;
}

.notification-item.log-sweeps-due .notification-item-title {
  color: #ff4d4d;
}

.notification-item.log-sweeps-due svg {
  color: #ff4d4d !important;
}

.notification-item.profile-incomplete {
  border-color: #ffa500;
}

.notification-item.profile-incomplete .notification-item-title {
  color: #ffa500;
}

.notification-item.profile-incomplete svg {
  color: #ffa500 !important;
}

.hero-columns {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: start;
}

.personnel-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 30px;
  align-items: start;
}

.personnel-grid .grid-table {
  width: 100%;
  table-layout: fixed;
  min-width: 0 !important;
}

.personnel-grid > div {
  min-width: 0;
}

@media (max-width: 1100px) {
  .personnel-grid {
    grid-template-columns: 1fr;
  }
  .personnel-col-log {
    border-top: 1px solid var(--line);
    padding-top: 20px;
  }
}

#activity-log {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#activity-log::-webkit-scrollbar {
  display: none;
}

.activity-log-entry .pill-cell-container,
.report-row .pill-cell-container {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: fit-content;
}

.activity-log-entry .pill-cell-container .mini-pill,
.report-row .pill-cell-container .mini-pill {
  margin-left: 0 !important;
  white-space: nowrap;
}

.hero-col-left {
  flex: 1;
}

.hero-col-right {
  min-width: 440px;
}

.popup-btn.team-active {
  background: rgba(235, 87, 87, 0.28) !important;
  border-color: rgba(235, 87, 87, 0.45) !important;
}
.popup-btn.team-on-base {
  background: rgba(46, 204, 113, 0.28) !important;
  border-color: rgba(46, 204, 113, 0.45) !important;
}
.status-pill {
  display: inline-block;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.8rem;
  margin-left: 10px;
  font-weight: 400;
  vertical-align: middle;
}

/* Task Assignment Form Styles */
.task-form, .profile-form {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
  color: var(--text);
}

.form-group.small {
  grid-column: span 2;
}

.form-group.large {
  grid-column: span 3;
}

.form-card {
  background: var(--pill-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  grid-column: span 6;
}

.form-section {
  grid-column: span 4;
  border-bottom: 2px solid var(--accent);
  margin-bottom: 10px;
  background: rgba(125, 198, 255, 0.05);
  padding: 8px 12px;
  border-radius: 8px;
}

.form-section h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  margin-left: 2px;
}

.form-input {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  outline: none;
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  width: 100%;
}

.form-input:focus {
  border-color: var(--accent);
  background: rgba(125, 198, 255, 0.05);
}

.form-input[readonly] {
  opacity: 0.6;
  cursor: default;
}

.form-grid-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.form-grid-table th {
  text-align: left;
  padding: 8px;
  font-size: 0.85rem;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.form-grid-table td {
  padding: 6px;
  border-bottom: 1px solid var(--line);
}

.form-checkbox-group {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 10px 0;
}

.form-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.95rem;
}


.chart-stack-row {
    display: flex;
    gap: 20px;
    aspect-ratio: 4 / 1;
    margin-top: 10px;
    height: 180px;
}

/* Responsive Improvements */
@media (max-width: 1024px) {
  .hero-columns {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .hero-col-right {
    min-width: unset;
  }
}

@media (max-width: 768px) {
    .chart-stack-row {
        flex-direction: column;
        height: auto;
        aspect-ratio: auto;
    }

  .chart-stack-row > div {
    height: 200px !important;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .home-panel.full-width {
    grid-column: span 1;
  }
  .task-form, .profile-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }
  .form-group.small, .form-group.large {
    grid-column: span 1;
  }
  .form-card {
    grid-template-columns: repeat(2, 1fr);
    padding: 15px;
  }
  .form-section {
    grid-column: span 2;
  }
  .table-tools {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Personnel sub-nav mobile improvements */
  body[data-page="page3"] .sub-nav {
    flex-wrap: wrap;
    justify-content: center;
  }
  body[data-page="page3"] .sub-nav-btn {
    flex: 1 1 auto;
    min-width: 140px;
    text-align: center;
    font-size: 0.8rem;
    padding: 6px 10px;
  }
  body[data-page="page3"] #btn-call-all-to-base {
    margin-left: 0 !important;
    width: 100%;
  }

  /* Forms page mobile improvements */
  body[data-page="page5"] .sub-nav {
    flex-wrap: wrap;
  }
  body[data-page="page5"] .sub-nav-btn {
    flex: 1 1 auto;
    font-size: 0.8rem;
    padding: 6px 10px;
  }
  body[data-page="page5"] .hero > div {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 15px;
  }
  body[data-page="page5"] .hero h1 {
    margin-bottom: 5px;
  }
  #interactive-form-container {
    padding: 10px !important;
  }
  #interactive-form-container .form-group {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 5px !important;
  }
  #interactive-form-container label {
    width: 100% !important;
    min-width: unset !important;
    font-size: 0.85rem !important;
  }
  #interactive-form-container .pill-input,
  #interactive-form-container textarea {
    width: 100% !important;
  }
  #task-pills-container .mini-pill {
    flex: 1 1 100%;
    text-align: left;
    font-size: 0.85rem;
  }
}

@media (max-width: 580px) {
  .nav-wrap {
    padding: 10px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .nav-wrap > div:first-child {
    flex: 0 0 100%;
  }
  .brand {
    width: 100%;
    text-align: center;
    margin-bottom: 5px;
  }
  nav {
    flex: 0 0 100%;
    justify-content: center;
  }
  nav a {
    padding: 8px 10px;
    font-size: 0.85rem;
  }
  .task-form, .profile-form {
    grid-template-columns: 1fr;
  }
  .form-group.small, .form-group.large {
    grid-column: span 1;
  }
  .form-section {
    grid-column: span 1;
  }
  .grid-table {
    min-width: 900px;
  }

  body[data-page="index"] .grid-table,
  body[data-page="home"] .grid-table,
  body[data-page="page2"] .grid-table,
  body[data-page="page3"] .grid-table,
  body[data-page="page4"] .grid-table,
  body[data-page="page5"] .grid-table,
  body[data-page="page7"] .grid-table {
    min-width: unset !important;
    display: block;
    border-spacing: 0;
  }

  body[data-page="index"] .grid-table thead,
  body[data-page="home"] .grid-table thead,
  body[data-page="page2"] .grid-table thead,
  body[data-page="page3"] .grid-table thead,
  body[data-page="page4"] .grid-table thead,
  body[data-page="page5"] .grid-table thead,
  body[data-page="page7"] .grid-table thead {
    display: none;
  }

  body[data-page="index"] .grid-table tr,
  body[data-page="home"] .grid-table tr,
  body[data-page="page2"] .grid-table tr,
  body[data-page="page3"] .grid-table tr,
  body[data-page="page4"] .grid-table tr,
  body[data-page="page5"] .grid-table tr,
  body[data-page="page7"] .grid-table tr {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 20px;
    border: 1px solid var(--line);
    width: 100%;
  }

  body[data-page="index"] .grid-table td,
  body[data-page="home"] .grid-table td,
  body[data-page="page2"] .grid-table td,
  body[data-page="page3"] .grid-table td,
  body[data-page="page4"] .grid-table td,
  body[data-page="page5"] .grid-table td,
  body[data-page="page7"] .grid-table td {
    display: block;
    width: auto;
    flex: 1 1 150px;
    padding: 0;
  }

  body[data-page="index"] .grid-table .pill-cell,
  body[data-page="home"] .grid-table .pill-cell,
  body[data-page="page2"] .grid-table .pill-cell,
  body[data-page="page3"] .grid-table .pill-cell,
  body[data-page="page4"] .grid-table .pill-cell,
  body[data-page="page5"] .grid-table .pill-cell,
  body[data-page="page7"] .grid-table .pill-cell {
    width: 100%;
  }

  body[data-page="index"] .grid-table td[data-label]::before,
  body[data-page="home"] .grid-table td[data-label]::before,
  body[data-page="page2"] .grid-table td[data-label]::before,
  body[data-page="page3"] .grid-table td[data-label]::before,
  body[data-page="page4"] .grid-table td[data-label]::before,
  body[data-page="page5"] .grid-table td[data-label]::before,
  body[data-page="page7"] .grid-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.65rem;
    color: var(--muted);
    margin-bottom: 4px;
    margin-left: 12px;
    text-transform: uppercase;
    font-weight: 700;
  }

  body[data-page="index"] .grid-table tr.unfinished-row::after,
  body[data-page="home"] .grid-table tr.unfinished-row::after,
  body[data-page="page2"] .grid-table tr.unfinished-row::after,
  body[data-page="page3"] .grid-table tr.unfinished-row::after,
  body[data-page="page4"] .grid-table tr.unfinished-row::after,
  body[data-page="page5"] .grid-table tr.unfinished-row::after,
  body[data-page="page7"] .grid-table tr.unfinished-row::after {
    border-radius: 20px;
    margin: 0;
  }

  /* Segment Assignment Popup */
  .popup-segments-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 15px;
    max-height: 50vh;
    overflow-y: auto;
    padding: 10px;
  }

  /* Professional Form Styling */
  .form-header-main {
    grid-column: span 4;
    text-align: center;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--accent);
    color: var(--accent);
    text-transform: uppercase;
  }

  .form-section-header {
    grid-column: span 4;
    margin-top: 30px;
    margin-bottom: 10px;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-left: 4px solid var(--accent);
    border-radius: 999px;
  }

  .form-section-header h3 {
    margin: 0;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text);
  }

  .checkbox-pill-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.06);
    padding: 8px 16px;
    border-radius: 30px;
    border: 1px solid var(--line);
    transition: all 0.2s ease;
  }

  .checkbox-pill-wrap:hover {
    background: rgba(255, 255, 255, 0.1);
  }

  .form-members-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .member-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 999px;
    border: 1px solid var(--line);
  }

  .form-comm-log-list {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .form-comm-log-item {
    display: flex;
    gap: 20px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
  }

  .form-comm-log-time {
    color: var(--muted);
    font-family: monospace;
    font-weight: 600;
    min-width: 80px;
  }

}

/* Professional Print Styles for SAR Task Assignment Forms */
.accordion-container {
  margin-top: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
}

.accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.06);
  transition: background 0.2s ease;
}

.accordion-header:hover {
  background: rgba(255, 255, 255, 0.1);
}

.accordion-header h2 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--accent);
}

.accordion-icon {
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  color: var(--muted);
}

.accordion-container.collapsed .accordion-icon {
  transform: rotate(-90deg);
}

.accordion-content {
  padding: 0;
  max-height: 2000px;
  transition: max-height 0.4s ease, opacity 0.3s ease;
  opacity: 1;
  overflow: hidden;
}

.accordion-container.collapsed .accordion-content {
  max-height: 0;
  opacity: 0;
}

@media print {
  /* Basic resets for printing */
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  body {
    background: white !important;
    color: black !important;
    font-size: 11pt !important;
    font-family: 'Segoe UI', Arial, sans-serif !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  /* Hide non-printable elements */
  header, nav, footer, .hero, .sub-nav, .table-tools, #task-pills-container, 
  #save-status, .notification-sidebar, .notification-bell, .popup-overlay, 
  .popup-buttons, button, .mini-pill:not(.task-form .mini-pill), #download-all-forms-btn {
    display: none !important;
  }
  
  .site-shell { backdrop-filter: none !important; border: none !important; background: none !important; }
  main { padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .table-card { border: none !important; box-shadow: none !important; background: transparent !important; padding: 0 !important; margin: 0 !important; }

  /* Form Layout */
  #interactive-form-container { display: block !important; padding: 0 !important; background: transparent !important; }

  .task-form {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 4px 10px !important;
    color: black !important;
    padding: 0.1in 0.25in !important;
    background: white !important;
    max-width: 100% !important;
  }

  /* Form Title - Powerful Branding */
  .task-form::before {
    content: "SAR TASK ASSIGNMENT FORM";
    grid-column: span 1;
    display: block;
    text-align: center;
    font-size: 14pt;
    font-weight: 900;
    margin-bottom: 6px;
    border-bottom: 2pt solid black;
    padding-bottom: 2px;
    letter-spacing: 2px;
  }

  /* Section Headers - Very Clean and Professional */
  .form-section {
    grid-column: span 1 !important;
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    margin-top: 8px !important;
    margin-bottom: 2px !important;
    background: #eeeeee !important;
    padding: 3px 12px !important;
    border-radius: 0 !important;
    page-break-after: avoid;
    border-bottom: 2pt solid black !important;
  }

  .form-section h3 {
    margin: 0 !important;
    font-size: 13pt !important;
    color: black !important;
    text-transform: uppercase;
    font-weight: bold !important;
    border: none !important;
    letter-spacing: 0.5px;
  }

  /* Grid Logic for Groups */
  .form-group {
    grid-column: span 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 1px !important;
    margin-bottom: 0 !important;
    page-break-inside: avoid;
  }

  /* Specific Layout Spans for Cleanliness */
  .form-group[data-key="lostPersonName"],
  .form-group[data-key="briefedBy"] {
    grid-column: span 1 !important;
  }

  .form-group:has(textarea),
  .form-group:has(.form-grid-table),
  .form-personnel-list,
  .form-group[style*="grid-column: span 4"],
  .form-group[data-key="lostPersonDescription"],
  .form-group[data-key="lostPersonClothing"],
  .form-group[data-key="lostPersonPhysical"],
  .form-group[data-key="instructions"],
  .form-group[data-key="teamTypes"],
  .form-group[data-key="parChecks"] {
    grid-column: span 1 !important;
  }

  .form-personnel-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    margin-top: 5px !important;
    width: 100% !important;
  }

  .form-personnel-list .pill-cell {
    background: #fcfcfc !important;
    border: 0.75pt solid #000 !important;
    padding: 2px 12px !important;
    border-radius: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    color: black !important;
    font-size: 11pt !important;
  }

  .form-personnel-list .pill-cell span {
    flex: 1 !important;
    font-weight: 800 !important;
  }

  .form-personnel-list .pill-cell div[style*="display: flex"] {
    display: flex !important;
    gap: 10px !important;
    align-items: center !important;
  }

  .form-personnel-list .pill-cell div[style*="display: flex"] > div {
    display: flex !important;
    align-items: center !important;
    gap: 3px !important;
    border: none !important;
    background: none !important;
    padding: 0 !important;
  }

  .form-personnel-list .pill-cell label {
    margin: 0 !important;
    font-size: 8.5pt !important;
    font-weight: 700 !important;
    color: black !important;
    text-transform: none !important;
  }

  .form-personnel-list .pill-cell button {
    display: none !important; /* Hide delete button in print */
  }

  .form-group label {
    display: block !important;
    font-weight: 800 !important;
    font-size: 8.5pt !important;
    color: #444 !important;
    margin-left: 10px !important;
    margin-bottom: 0 !important;
    text-transform: uppercase;
  }

  /* Entry Cells - Pill Shaped like the rest of the website */
  .form-input {
    border: 0.75pt solid #000 !important;
    background: transparent !important;
    color: black !important;
    width: 100% !important;
    padding: 2px 12px !important;
    font-size: 11pt !important;
    border-radius: 8px !important;
    min-height: 1.3rem !important;
  }

  textarea.form-input {
    border: 0.75pt solid #000 !important;
    min-height: 2.2rem !important;
    padding: 4px 12px !important;
    font-size: 11pt !important;
    border-radius: 8px !important;
}

  /* Checkboxes and Pill containers */
  .form-checkbox-group, .form-group div[style*="display: flex"] {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin-top: 2px !important;
  }

  .pill-checkbox {
    appearance: auto !important;
    width: 10pt !important;
    height: 10pt !important;
  }

  /* Checklist items - Professional Pill look */
  .form-checkbox-group > div, 
  .form-group div[style*="display: flex"] > div {
     background: #fcfcfc !important;
     border: 0.5pt solid #ccc !important;
     padding: 1px 10px !important;
     border-radius: 999px !important;
     display: flex !important;
     align-items: center !important;
     gap: 5px !important;
     font-size: 9.5pt !important;
  }

  /* Tables - Clean Professional */
  .form-grid-table {
    grid-column: span 2 !important;
    width: 100% !important;
    border-collapse: collapse !important;
    margin-top: 4px !important;
    border: 1.2pt solid black !important;
    page-break-inside: avoid;
  }

  .form-grid-table th, .form-grid-table td {
    border: 0.75pt solid black !important;
    padding: 2px 6px !important;
    font-size: 10pt !important;
    color: black !important;
    text-align: left !important;
  }

  .form-grid-table th {
    background-color: #f2f2f2 !important;
    font-weight: 900 !important;
    text-transform: uppercase;
    font-size: 9pt !important;
  }

  /* PAR Checks / Status Updates */
  .pill-cell.clickable-pill {
    display: block !important;
    background: none !important;
    border: none !important;
    padding: 1px 0 !important;
    border-bottom: 0.5pt dotted #bbb !important;
    color: black !important;
    font-size: 9pt !important;
  }

  .mini-pill {
    background: #fff !important;
    border: 0.75pt solid #000 !important;
    color: black !important;
    padding: 0 6px !important;
    font-size: 8.5pt !important;
    margin-right: 4px !important;
    border-radius: 10pt !important;
  }

  #task-assignment-view table td .pill-cell {
     border: none !important;
     padding: 0 !important;
  }

  .form-completion-section {
    display: none !important;
  }
}

.profile-highlight-orange { background: rgba(255, 165, 0, 0.5) !important; color: white !important; }
.profile-highlight-yellow { background: rgba(255, 255, 0, 0.5) !important; color: black !important; }
.profile-highlight-red { background: rgba(255, 0, 0, 0.5) !important; color: white !important; }
.profile-highlight-blue { background: rgba(0, 0, 255, 0.5) !important; color: white !important; }
.profile-highlight-green { background: rgba(0, 128, 0, 0.5) !important; color: white !important; }
.profile-highlight-purple { background: rgba(128, 0, 128, 0.5) !important; color: white !important; }
.profile-highlight-brown { background: rgba(165, 42, 42, 0.5) !important; color: white !important; }
.profile-highlight-black { background: rgba(0, 0, 0, 0.5) !important; color: white !important; }
.profile-highlight-white { background: rgba(255, 255, 255, 0.5) !important; color: black !important; }
.profile-highlight-grey { background: rgba(128, 128, 128, 0.5) !important; color: white !important; }
.profile-highlight-maroon { background: rgba(128, 0, 0, 0.5) !important; color: white !important; }
@keyframes greenFadeOut {
  0% {
    background: rgba(46, 204, 113, 0.4);
    border-color: rgba(46, 204, 113, 0.8);
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.4);
  }
  80% {
    background: rgba(46, 204, 113, 0.4);
    border-color: rgba(46, 204, 113, 0.8);
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.4);
  }
  100% {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--pill-border);
    box-shadow: none;
  }
}

.new-import-highlight {
  animation: greenFadeOut 7s forwards;
}

.new-row-highlight .pill-cell {
  animation: greenFadeOut 7s forwards;
}

@media (max-width: 400px) {
    header {
        display: none !important;
    }

    .chart-stack-row {
        flex-direction: column !important;
        height: auto !important;
        aspect-ratio: auto !important;
    }

    .chart-stack-row > div {
        height: 200px !important;
    }

    .nav-wrap {
        padding: 8px 5px !important;
    }

    .brand {
        font-size: 0.85rem !important;
        white-space: normal !important;
        text-align: center !important;
    }

    nav {
        gap: 2px !important;
        justify-content: center !important;
    }

    nav a {
        padding: 6px 3px !important;
        font-size: 0.7rem !important;
        gap: 2px !important;
    }

    .hero-columns {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .hero h1 {
        font-size: 1.1rem !important;
        margin-bottom: 5px !important;
    }

    .hero-col-right {
        justify-content: flex-start !important;
        width: 100% !important;
    }

    .home-panel {
        padding: 10px !important;
    }

    .dashboard-grid {
        gap: 12px !important;
    }

    .pill-input {
        min-width: 0 !important;
        width: 100% !important;
    }

    #task-pills-container .mini-pill {
        font-size: 0.75rem !important;
        padding: 6px 8px !important;
        white-space: normal !important;
        text-align: left !important;
    }

    .table-card {
        padding: 8px !important;
        border-radius: 8px !important;
    }

    .home-row {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .home-row button {
        flex: 1 1 auto !important;
        min-width: 80px !important;
    }

    .home-panel.full-width h2 {
        font-size: 1rem !important;
    }

    #dashboard-stats > div {
        font-size: 0.85rem !important;
        padding: 8px 12px !important;
    }

  .bottom-nav {
    display: flex !important;
  }

  main {
    padding-bottom: 80px !important;
  }
}

/* Bottom Nav Styles */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  z-index: 1000;
  height: 65px;
  justify-content: space-around;
  align-items: center;
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.65rem;
  gap: 4px;
  transition: all 0.3s ease;
  flex: 1;
  min-width: 0;
  height: 100%;
}

.bottom-nav a svg {
  width: 22px;
  height: 22px;
  transition: transform 0.2s ease;
}

.bottom-nav a.active {
  color: var(--accent);
}

.bottom-nav a.active svg {
  transform: translateY(-2px);
  stroke: var(--accent);
}

.bottom-nav a:active {
  background: rgba(255, 255, 255, 0.05);
}


/* Drag and Drop Styles */
.mini-pill.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.pill-container.drag-over,
.mini-pill.clickable-pill.drag-over {
  background: rgba(255, 255, 255, 0.2);
  outline: 2px dashed #007aff;
  outline-offset: 2px;
}
