:root {
  --bg: #f1f6fc;
  --paper: #ffffff;
  --paper-soft: #fbfcfe;
  --ink: #17253d;
  --muted: #71829c;
  --line: #e6edf6;
  --accent: #16a18f;
  --accent-strong: #0e7b6f;
  --accent-soft: #e8faf6;
  --warning: #f5b84b;
  --warning-soft: #fff6df;
  --violet: #8f7ef5;
  --violet-soft: #f2efff;
  --sky: #66b3ff;
  --sky-soft: #edf6ff;
  --success-soft: #ebf8ef;
  --navy: #0e1f3a;
  --shadow: 0 22px 54px rgba(17, 35, 67, 0.1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(34, 160, 145, 0.08), transparent 20%),
    radial-gradient(circle at top right, rgba(143, 126, 245, 0.08), transparent 18%),
    linear-gradient(180deg, #f8fbff 0%, #eef5fb 100%);
  color: var(--ink);
  font-family: "Source Sans 3", sans-serif;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  backdrop-filter: blur(14px);
  background: rgba(14, 22, 38, 0.28);
}

.evidence-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 18, 32, 0.48);
  backdrop-filter: blur(8px);
}

.evidence-dialog {
  width: min(760px, 100%);
  max-height: 88vh;
  overflow: auto;
  border-radius: 24px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 18px;
}

.evidence-dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.evidence-dialog-body {
  margin-top: 14px;
  display: grid;
  gap: 14px;
}

.auth-card {
  width: min(460px, 100%);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.auth-switch,
.topbar,
.topnav,
.topbar-actions,
.panel-head,
.controls-row,
.action-row,
.tabs,
.feed-top,
.feed-meta,
.brand-lockup,
.officer-card {
  display: flex;
  gap: 12px;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.auth-subtitle,
.auth-message {
  color: var(--muted);
}

.auth-message[data-state="error"] {
  color: #d85a3d;
}

.app-frame {
  width: min(1420px, calc(100% - 22px));
  margin: 14px auto;
  display: grid;
  grid-template-columns: 160px 1fr;
  border: 1px solid #dbe8f3;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.sidebar {
  background: linear-gradient(180deg, #11233f 0%, #0f1f39 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  min-height: 92vh;
}

.dashboard-sidebar {
  color: rgba(255, 255, 255, 0.92);
}

.brand-lockup {
  align-items: center;
  margin-bottom: 18px;
}

.brand-mark,
.mini-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #113d76, #d8b568);
  color: white;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
}

.brand-lockup strong,
.topbar-brand strong,
.officer-card strong {
  font-family: "Space Grotesk", sans-serif;
}

.crest-mark {
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.sidebar-label {
  margin: 10px 8px 8px;
  color: rgba(220, 231, 247, 0.5);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
}

.brand-lockup p,
.officer-card p,
.panel-subcopy,
.hero-copy,
.feed-item p,
.accordion-copy,
.workflow-notes,
.auth-subtitle,
.auth-message {
  margin: 0;
  color: var(--muted);
}

.sidebar-nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  color: rgba(222, 233, 248, 0.76);
  text-decoration: none;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 600;
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(22, 161, 143, 0.18), rgba(22, 161, 143, 0.32));
  color: #f2fffb;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

.system-status {
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  padding: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1ac67a;
  box-shadow: 0 0 0 5px rgba(26, 198, 122, 0.12);
}

.main-shell {
  padding: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.58) 0%, rgba(249, 252, 255, 0.92) 100%);
}

.topbar {
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  padding: 10px 14px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-brand-compact {
  flex: 1;
  min-width: 0;
}

.menu-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #f3f7fb;
  color: #5f718a;
  padding: 0;
}

.search-shell {
  min-width: 280px;
  width: min(420px, 100%);
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
  padding: 0 12px;
}

.search-shell input {
  border: 0;
  padding: 10px 0;
  background: transparent;
}

.search-shell input:focus {
  outline: none;
}

.search-icon {
  color: #8aa0bb;
  font-size: 0.9rem;
}

.mini-badge,
.online-pill,
.status-pill,
.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.72rem;
}

.mini-badge {
  padding: 5px 10px;
  background: #edf7f5;
  color: var(--accent-strong);
}

.topnav {
  align-items: center;
}

.language-pill {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9rem;
}

.topnav-link {
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
  padding: 10px 6px;
  border-bottom: 2px solid transparent;
}

.topnav-link.active {
  color: var(--accent-strong);
  border-color: var(--accent);
}

.topbar-actions {
  align-items: center;
}

.online-pill {
  padding: 8px 12px;
  background: #effcf7;
  color: #169460;
  border: 1px solid #daf5e7;
}

.officer-card {
  align-items: center;
  border-left: 1px solid var(--line);
  padding-left: 12px;
}

.avatar-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d7dde8, #f4f6fa);
}

.icon-btn {
  padding-inline: 14px;
}

.dashboard-shell {
  padding: 14px 2px 2px;
  display: grid;
  gap: 14px;
}

.page-panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  padding: 16px;
}

.hero-strip,
.metric-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
}

.hero-strip {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 18px;
  padding: 18px;
}

.dashboard-hero {
  padding-bottom: 12px;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
  color: var(--accent-strong);
  font-weight: 700;
}

h1,
h2,
h3,
summary {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

h1 {
  font-size: clamp(2.2rem, 4vw, 3.35rem);
  line-height: 1;
}

.runtime-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfcff;
  padding: 14px;
}

.runtime-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px 14px;
  margin: 12px 0 0;
}

.runtime-list dt,
.workflow-list dt {
  color: var(--muted);
  font-weight: 700;
}

.runtime-list dd,
.workflow-list dd,
dd {
  margin: 0;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric-row-reference .metric-card {
  padding: 14px 16px;
}

.metric-card {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 16px;
}

.metric-icon {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: inline-block;
}

.metric-icon.teal { background: var(--accent-soft); }
.metric-icon.amber { background: var(--warning-soft); }
.metric-icon.violet { background: var(--violet-soft); }
.metric-icon.sky { background: var(--sky-soft); }

.metric-card strong {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.1rem;
}

.metric-card p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.metric-card small {
  display: block;
  margin-top: 2px;
  color: #95a4b9;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 1.08fr 1.18fr 1fr;
  gap: 14px;
}

.reference-grid {
  grid-template-columns: 1.25fr 0.95fr 1.2fr;
  align-items: start;
}

.panel {
  padding: 14px;
}

.panel-head {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.panel-head > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-badge {
  width: 26px;
  height: 26px;
  background: #edf7f5;
  color: var(--accent-strong);
  font-weight: 700;
}

.status-pill {
  padding: 7px 12px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--muted);
}

.status-pill.accent {
  background: #eefaf7;
  color: var(--accent-strong);
  border-color: #d8f2eb;
}

.status-pill.success {
  background: var(--success-soft);
  color: #1f8a56;
  border-color: #dff3e5;
}

.controls-row {
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 12px;
  align-items: end;
}

.detected-chip-wrap {
  min-width: 148px;
  display: grid;
  gap: 8px;
}

.detected-label {
  color: #8ea0b7;
  font-size: 0.72rem;
  font-weight: 700;
}

label {
  display: grid;
  gap: 7px;
  font-weight: 700;
  color: var(--ink);
  min-width: 140px;
}

select,
textarea,
input,
button {
  font: inherit;
}

select,
textarea,
input[type="text"],
input[type="password"] {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 12px 14px;
  color: var(--ink);
}

textarea {
  min-height: 140px;
  resize: vertical;
}

.action-row {
  flex-wrap: wrap;
  margin-top: 10px;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

button:hover {
  transform: translateY(-1px);
}

.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: white;
  box-shadow: 0 14px 30px rgba(34, 160, 145, 0.22);
}

.secondary {
  background: #f0f4f8;
  color: var(--ink);
}

.ghost {
  background: #fbf6e8;
  color: #7c6731;
}

button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.upload-stack {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.upload-box {
  border: 1px dashed #d6dee8;
  border-radius: 16px;
  background: #fbfcfe;
  padding: 14px;
}

.upload-box.compact p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.upload-label {
  font-family: "Space Grotesk", sans-serif;
}

.tabs {
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.tabs button {
  padding: 10px 12px;
  background: #f3f6fa;
  color: var(--muted);
}

.tabs button.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.translation-panel {
  min-height: 300px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(circle at center, rgba(34, 160, 145, 0.04), transparent 28%),
    #ffffff;
  padding: 18px;
}

.accordion-list {
  display: grid;
  gap: 10px;
}

.accordion-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fcfdff;
  padding: 12px 14px;
}

.case-overview {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfdff;
  padding: 14px;
  margin-bottom: 12px;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}

.overview-grid span {
  display: block;
  font-size: 0.76rem;
  color: #8ea0b7;
  margin-bottom: 4px;
  font-weight: 700;
}

.overview-grid strong {
  font-size: 0.92rem;
  font-family: "Space Grotesk", sans-serif;
}

.accordion-card summary {
  cursor: pointer;
  font-size: 0.98rem;
}

.accordion-card dl,
.workflow-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 14px;
  margin: 12px 0 0;
}

.detail-list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.detail-list li + li {
  margin-top: 6px;
}

.mini-table {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.mini-table-head,
.mini-table-row {
  display: grid;
  grid-template-columns: 60px 1.1fr 1fr 1.4fr;
  gap: 10px;
}

.mini-table-head {
  font-weight: 700;
  color: var(--ink);
}

.mini-table-row {
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.workflow-editor {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.bottom-grid {
  display: grid;
  gap: 14px;
}

.dashboard-bottom-grid {
  grid-template-columns: 1.8fr 1fr;
  align-items: start;
}

.feed-table {
  display: grid;
  gap: 10px;
  min-height: 180px;
}

.feed-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.feed-filter-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7fafc;
  color: #5f718a;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 700;
}

.feed-filter-chip.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.route-list {
  display: grid;
  gap: 12px;
}

.table-shell {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
}

.table-grid {
  display: grid;
  gap: 12px;
  align-items: start;
}

.complaints-grid {
  grid-template-columns: 1.25fr 1fr 0.9fr 0.8fr 0.9fr 1fr;
}

.evidence-grid {
  grid-template-columns: 1.1fr 1.4fr 2fr 0.5fr;
}

.table-head,
.table-row {
  padding: 14px 16px;
}

.table-head {
  background: #f7fafc;
  border-bottom: 1px solid var(--line);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
}

.table-row {
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.table-row:last-child {
  border-bottom: 0;
}

.complaint-row-link {
  width: 100%;
  text-align: left;
  border-radius: 0;
  cursor: pointer;
}

.complaint-row-link:hover {
  background: #f7fcfb;
  transform: none;
}

.route-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.route-card,
.route-stat {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  padding: 14px;
}

.route-card-head,
.route-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.route-card-head {
  margin-bottom: 8px;
}

.route-card-meta {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 8px;
}

.route-stat strong {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.2rem;
}

.route-stat p,
.sub-item {
  margin: 6px 0 0;
  color: var(--muted);
}

.file-stack {
  display: grid;
  gap: 8px;
}

.file-link {
  color: var(--accent-strong);
  text-decoration: none;
  word-break: break-word;
}

.file-link:hover {
  text-decoration: underline;
}

.file-link.as-button {
  background: transparent;
  padding: 0;
  border-radius: 0;
  text-align: left;
}

.file-link.as-button:hover {
  transform: none;
}

.inline-audio {
  width: 220px;
  max-width: 100%;
  height: 34px;
}

.evidence-thumb {
  width: 140px;
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  object-fit: cover;
  cursor: pointer;
}

.modal-image {
  width: 100%;
  max-height: 62vh;
  object-fit: contain;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #f9fbfd;
}

.modal-audio {
  width: 100%;
}

.modal-actions {
  display: flex;
  gap: 10px;
}

.modal-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.mini-action {
  padding: 8px 12px;
}

.feed-empty {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  padding: 14px;
}

.feed-table-shell {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

.feed-table-head,
.feed-table-row {
  display: grid;
  grid-template-columns: 1.1fr 0.85fr 1.1fr 1fr 0.9fr 0.9fr 0.8fr 0.6fr;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
}

.feed-table-head {
  background: #f7fafc;
  color: #7b8ca4;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.78rem;
}

.feed-table-row {
  border-top: 1px solid var(--line);
  text-align: left;
  width: 100%;
  border-radius: 0;
  background: #fff;
}

.feed-table-row.selected {
  background: #f3fbf8;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.72rem;
  font-weight: 700;
}

.status-badge.draft-ready {
  background: #ebf8ef;
  color: #198b56;
}

.status-badge.pending-review {
  background: #fff4de;
  color: #c38716;
}

.status-badge.assigned {
  background: #edf5ff;
  color: #2c78c8;
}

.admin-grid,
.admin-officers {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-chip,
.admin-officer {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #f9fbfd;
  padding: 10px 14px;
}

.admin-chip strong {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.12rem;
  color: var(--ink);
}

.admin-chip span {
  color: var(--muted);
  font-size: 0.82rem;
}

.admin-officer {
  width: 100%;
  display: grid;
  gap: 8px;
}

.officer-load {
  display: flex;
  align-items: center;
  gap: 10px;
}

.load-bar {
  flex: 1;
  height: 7px;
  background: #edf3f8;
  border-radius: 999px;
  overflow: hidden;
}

.load-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #62ccb9);
}
}

small {
  color: var(--muted);
}

@media (max-width: 1200px) {
  .workspace-grid,
  .hero-strip,
  .metric-row,
  .route-grid,
  .dashboard-bottom-grid {
    grid-template-columns: 1fr;
  }

  .complaints-grid,
  .evidence-grid {
    grid-template-columns: 1fr;
  }

  .mini-table-head,
  .mini-table-row {
    grid-template-columns: 1fr;
  }

  .feed-table-head,
  .feed-table-row,
  .overview-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .app-frame {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topnav,
  .topbar-actions {
    flex-wrap: wrap;
  }
}
