:root {
  --bg: #f4f7f9;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #111827;
  --muted: #667085;
  --line: #d9e1e7;
  --line-soft: #edf1f4;
  --accent: #078f8b;
  --accent-strong: #04746f;
  --amber: #c47a00;
  --amber-bg: #fff2d8;
  --red: #d92d20;
  --red-bg: #fff0ee;
  --green-bg: #e6f6ed;
  --blue-bg: #eaf4ff;
  --shadow: 0 14px 34px rgba(16, 24, 40, 0.07);
  --radius: 7px;
}

/* Mockup polish layer */
.metric-card {
  grid-template-columns: 58px 1fr;
}

.metric-card small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.metric-clock::before {
  content: "";
  border-color: #f59e0b;
  background:
    linear-gradient(#f59e0b, #f59e0b) 50% 50% / 3px 18px no-repeat,
    linear-gradient(#f59e0b, #f59e0b) 58% 58% / 16px 3px no-repeat;
}

.metric-check::before {
  content: "OK";
}

.metric-x::before {
  content: "X";
  border-color: #ef6a63;
  color: #d92d20;
}

.metric-users::before {
  content: "US";
  border-color: #5aa8dc;
  color: #327eb6;
}

.video-preview {
  position: relative;
}

.play-button {
  display: grid;
  width: 82px;
  height: 82px;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  border: 2px solid rgba(255, 255, 255, 0.7);
  font-size: 0.86rem;
  letter-spacing: 0;
}

.video-controls {
  position: absolute;
  right: 14px;
  bottom: 12px;
  left: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 4px solid rgba(8, 143, 139, 0.82);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 750;
}

.preview-meta span {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  color: #344054;
}

.preview-meta strong {
  color: var(--muted);
  font-size: 0.78rem;
}

.visibility-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

.visibility-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.client-car-photo,
.client-thumb,
.media-preview {
  background:
    linear-gradient(rgba(17, 24, 39, 0.08), rgba(17, 24, 39, 0.24)),
    radial-gradient(circle at 35% 42%, #f8fafc 0 9%, transparent 10%),
    linear-gradient(150deg, #d8dde0 0 25%, #768693 26% 44%, #f3f6f7 45% 64%, #2f3b44 65% 100%);
}

.vehicle-summary {
  grid-template-columns: 178px 1fr;
  gap: 18px;
  padding: 18px;
  background: #ffffff;
  border: 1px solid var(--line);
}

.client-car-photo {
  min-height: 126px;
  border-radius: 8px;
  background-size: cover;
}

.client-summary-data {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.client-evidence-card {
  grid-template-columns: 156px 1fr 54px;
  align-items: center;
  border-radius: 12px;
}

.client-thumb {
  position: relative;
  min-height: 98px;
  overflow: hidden;
}

.client-thumb span {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.46);
  border: 2px solid rgba(255, 255, 255, 0.75);
  font-size: 0.76rem;
}

.client-thumb small {
  position: absolute;
  right: 8px;
  bottom: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.66);
}

.round-action {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: #ffffff;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 900;
}

.admin-hero {
  display: grid;
  grid-template-columns: 150px 1.1fr 180px minmax(260px, 1.4fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #ffffff;
}

.hero-stat {
  display: grid;
  align-content: center;
  gap: 5px;
  min-height: 92px;
  padding: 16px 20px;
  border-right: 1px solid var(--line);
}

.hero-stat:last-child {
  border-right: 0;
}

.hero-stat span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.hero-stat strong {
  overflow-wrap: anywhere;
  font-size: 1.12rem;
}

.hero-stat small {
  color: #327eb6;
}

.drive-stat {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.drive-stat span,
.drive-stat strong {
  grid-column: 1;
}

.drive-stat .ghost-button {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.admin-board {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 320px;
  gap: 16px;
}

.admin-stage-panel,
.admin-files-panel,
.admin-activity-panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.stage-track {
  display: grid;
  gap: 0;
  margin-top: 16px;
}

.admin-stage {
  position: relative;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: start;
  gap: 12px;
  padding: 0 0 20px;
}

.admin-stage::before {
  content: "";
  position: absolute;
  top: 36px;
  bottom: 2px;
  left: 20px;
  width: 2px;
  background: #d6dee5;
}

.admin-stage:last-child::before {
  display: none;
}

.stage-number {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: #a4b1bc;
  color: #ffffff;
  font-weight: 900;
}

.admin-stage.is-done .stage-number,
.admin-stage.is-done::before {
  background: #28a461;
}

.admin-stage.is-current .stage-number {
  background: var(--accent);
}

.admin-stage p {
  margin: 4px 0 0;
  color: #327eb6;
}

.evidence-summary {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.evidence-summary > div {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.evidence-summary span {
  color: var(--muted);
  text-align: center;
}

.evidence-summary b {
  display: block;
  color: var(--text);
  font-size: 1.3rem;
}

.admin-file-table {
  min-width: 960px;
}

.media-preview {
  display: grid;
  width: 72px;
  height: 48px;
  place-items: center;
  border-radius: 6px;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 900;
}

.drive-file {
  display: inline-grid;
  min-width: 34px;
  min-height: 22px;
  place-items: center;
  margin-right: 7px;
  border-radius: 4px;
  background: #e9f6ed;
  color: #16824d;
  font-size: 0.68rem;
  font-weight: 900;
}

.stage-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid #c8d8e8;
  border-radius: 5px;
  background: #eef7ff;
  color: #1c6fb3;
  font-size: 0.76rem;
  font-weight: 850;
}

.stage-ingreso {
  background: #e7f7ed;
  border-color: #bde4cb;
  color: #16824d;
}

.stage-autorizacion,
.stage-entrega {
  background: #f4f6f8;
  border-color: #d5dde5;
  color: #475467;
}

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

.activity-mini-row {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
}

.activity-mini-row p {
  margin: 3px 0 4px;
  color: var(--muted);
  line-height: 1.35;
}

.compact-action {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.78rem;
}

@media (max-width: 1320px) {
  .admin-board,
  .admin-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-stat,
  .hero-stat:last-child {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 780px) {
  .vehicle-summary,
  body[data-view="client"] .vehicle-summary {
    grid-template-columns: 1fr;
  }

  .client-summary-data,
  body[data-view="client"] .client-summary-data {
    grid-template-columns: 1fr 1fr;
  }

  .client-evidence-card,
  body[data-view="client"] .client-evidence-card {
    grid-template-columns: 116px minmax(0, 1fr) 42px;
  }

  .round-action {
    width: 38px;
    height: 38px;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

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

button {
  cursor: pointer;
}

body[data-entry="landing"] {
  background: #101820;
}

body[data-entry="landing"] .app-shell {
  display: none !important;
}

body[data-entry="app"] .entry-landing {
  display: none;
}

.entry-landing {
  min-height: 100vh;
  background:
    linear-gradient(115deg, rgba(16, 24, 32, 0.96) 0 48%, rgba(18, 86, 94, 0.9) 48% 69%, rgba(245, 247, 249, 0.96) 69% 100%),
    linear-gradient(0deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.08));
  color: #ffffff;
}

.entry-shell {
  display: grid;
  min-height: 100vh;
  grid-template-rows: auto 1fr;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 34px;
}

.entry-header {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 54px;
}

.entry-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: #0aa39f;
  color: #ffffff;
  font-weight: 950;
}

.entry-header strong,
.entry-header small {
  display: block;
}

.entry-header strong {
  letter-spacing: 0;
}

.entry-header small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.72);
}

.entry-main {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 52px;
  align-items: center;
  padding: 56px 0 26px;
}

.entry-copy {
  max-width: 650px;
}

.entry-copy h1 {
  margin: 12px 0 18px;
  color: #ffffff;
  font-size: clamp(2.35rem, 5vw, 5rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.entry-copy p:not(.eyebrow) {
  max-width: 560px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.12rem;
  line-height: 1.65;
}

.entry-actions {
  display: grid;
  gap: 14px;
  align-content: center;
}

.entry-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 5px 16px;
  width: 100%;
  min-height: 146px;
  padding: 24px;
  border: 1px solid rgba(16, 24, 40, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: #101828;
  text-align: left;
  box-shadow: 0 20px 48px rgba(16, 24, 40, 0.16);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.entry-card:hover,
.entry-card:focus-visible {
  border-color: #0aa39f;
  box-shadow: 0 24px 54px rgba(16, 24, 40, 0.22);
  transform: translateY(-2px);
  outline: none;
}

.entry-card span {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  grid-row: 1 / span 2;
  border-radius: 8px;
  background: #e7f7f6;
  color: #04746f;
  font-weight: 950;
}

.entry-card strong {
  align-self: end;
  font-size: 1.2rem;
}

.entry-card small {
  color: #667085;
  line-height: 1.45;
}

.entry-card-primary {
  background: #f8fbfc;
  border-color: rgba(10, 163, 159, 0.42);
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(16, 24, 32, 0.62);
}

.auth-modal.is-open {
  display: grid;
}

.auth-panel {
  display: grid;
  gap: 16px;
  width: min(100%, 420px);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 28px 70px rgba(16, 24, 40, 0.28);
}

.auth-panel h2 {
  margin: 4px 0 6px;
  font-size: 1.55rem;
}

.auth-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.auth-panel label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-weight: 800;
}

.auth-error {
  min-height: 20px;
  color: var(--red) !important;
  font-weight: 800;
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 860px) {
  .entry-landing {
    background: linear-gradient(180deg, #101820 0 54%, #12565e 54% 100%);
  }

  .entry-shell {
    width: min(100% - 28px, 640px);
    padding: 18px 0 22px;
  }

  .entry-main {
    grid-template-columns: 1fr;
    gap: 26px;
    align-content: center;
    padding: 36px 0 10px;
  }

  .entry-copy h1 {
    margin-top: 10px;
    font-size: clamp(2.1rem, 12vw, 3.35rem);
    line-height: 1.02;
  }

  .entry-copy p:not(.eyebrow) {
    font-size: 1rem;
  }

  .entry-card {
    min-height: 126px;
    padding: 20px;
  }
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 18px 12px;
  background: linear-gradient(180deg, #0b2030 0%, #0d1721 100%);
  color: #f8fbfc;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 12px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #0aa39f, #096c8d);
  color: #ffffff;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1rem;
}

.brand small,
.sidebar-note p {
  color: #9fb0bd;
}

.nav-tabs {
  display: grid;
  gap: 5px;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #d5e0e7;
  text-align: left;
}

.nav-tab:hover,
.nav-tab.is-active {
  background: linear-gradient(90deg, rgba(8, 143, 139, 0.32), rgba(255, 255, 255, 0.04));
  border-left-color: #08aaa6;
  color: #ffffff;
}

.muted-nav {
  opacity: 0.78;
}

.tab-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: #b7d7df;
  font-weight: 800;
}

.sidebar-note {
  margin-top: auto;
  padding: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.note-label,
.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sidebar-note p {
  margin: 0;
  line-height: 1.5;
}

.sidebar-logout {
  width: 100%;
  margin-top: 14px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.07);
  color: #d9e6ec;
  font-size: 0.82rem;
  font-weight: 850;
}

.sidebar-logout:hover {
  background: rgba(255, 255, 255, 0.12);
}

.workspace {
  min-width: 0;
  padding: 18px 28px 28px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(220px, auto) minmax(260px, 540px) auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.55rem, 2vw, 2.05rem);
  line-height: 1.12;
}

h2 {
  margin-bottom: 0;
  font-size: 1.12rem;
}

h3 {
  margin-bottom: 0;
  font-size: 1rem;
}

.global-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--muted);
  font-weight: 600;
}

.global-search input {
  min-height: auto;
  padding: 0;
  border: 0;
  box-shadow: none;
}

.topbar-actions,
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.primary-button,
.ghost-button,
.danger-button {
  min-height: 40px;
  padding: 0 15px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 800;
}

.primary-button {
  background: linear-gradient(180deg, #089d99, #057a76);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(8, 143, 139, 0.18);
}

.primary-button:hover {
  background: var(--accent-strong);
}

.ghost-button {
  background: #ffffff;
  border-color: var(--line);
  color: #243242;
}

.danger-button {
  background: #ffffff;
  border-color: #ffb9b2;
  color: var(--red);
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.split-grid,
.review-layout,
.client-shell {
  display: grid;
  grid-template-columns: minmax(390px, 0.82fr) minmax(520px, 1.28fr);
  gap: 16px;
  align-items: start;
}

.review-layout {
  grid-template-columns: minmax(680px, 1fr) 420px;
}

.client-shell {
  grid-template-columns: minmax(390px, 560px) minmax(300px, 1fr);
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel:not(.preview-panel) {
  padding: 18px;
}

.panel + .panel,
.metric-grid + .review-layout {
  margin-top: 16px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

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

.form-stack {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: #2f3b4a;
  font-size: 0.9rem;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--text);
  padding: 9px 11px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(8, 143, 139, 0.12);
}

.span-2 {
  grid-column: 1 / -1;
}

.drive-box,
.link-box {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--panel-soft);
  border: 1px dashed #c5d1d8;
}

.drive-box p,
.link-box p {
  margin: 4px 0 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.folder-icon,
.upload-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: var(--radius);
  background: #e4fbf8;
  color: var(--accent);
  font-weight: 900;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 8px;
  color: #2f3b4a;
  font-size: 0.9rem;
  font-weight: 800;
}

.stage-selector {
  display: grid;
  grid-template-columns: repeat(5, minmax(100px, 1fr));
  gap: 10px;
}

.stage-chip {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: #344054;
  font-weight: 700;
}

.stage-chip.is-selected {
  border-color: var(--accent);
  background: linear-gradient(180deg, #0ba8a3, #078f8b);
  color: #ffffff;
}

.drive-sync-box {
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: start;
  gap: 12px;
  min-height: 138px;
  padding: 22px;
  border: 2px dashed #c8d0d8;
  border-radius: var(--radius);
  background: #fcfdff;
}

.drive-sync-box small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.45;
}

.drive-sync-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.field-help {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.upload-progress {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7fbfc;
}

.upload-progress span {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.upload-progress progress {
  width: 100%;
  height: 12px;
  accent-color: var(--accent);
}

.status-chip,
.file-type,
.visibility-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-open,
.status-approved {
  background: var(--green-bg);
  color: #16824d;
  border: 1px solid #badfc8;
}

.status-pending {
  background: var(--amber-bg);
  color: var(--amber);
  border: 1px solid #ffd28a;
}

.status-rejected {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid #ffb9b2;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  background: #ffffff;
}

th,
td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  color: #475467;
  background: #fbfcfd;
  font-size: 0.75rem;
  font-weight: 850;
  text-transform: none;
}

tr.is-clickable {
  cursor: pointer;
}

tr.is-clickable:hover,
tr.is-selected {
  background: #effbfb;
}

.compact-search {
  max-width: 260px;
}

.file-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
}

.thumb {
  display: grid;
  width: 58px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 5px;
  background:
    linear-gradient(rgba(17, 24, 39, 0.12), rgba(17, 24, 39, 0.28)),
    linear-gradient(135deg, #dbe6ec, #8d9aa5);
  color: #ffffff;
  font-weight: 900;
}

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

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

.metric-card {
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: center;
  gap: 14px;
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric-card::before {
  content: "✓";
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 3px solid #51b981;
  border-radius: 50%;
  color: #2da76a;
  font-size: 1.6rem;
}

.metric-card span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.metric-card strong {
  display: block;
  margin-top: 4px;
  font-size: 2rem;
}

.preview-panel {
  overflow: hidden;
}

.preview-content {
  display: grid;
}

.video-preview {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  background:
    linear-gradient(rgba(17, 24, 39, 0.18), rgba(17, 24, 39, 0.4)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='520'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' x2='1'%3E%3Cstop stop-color='%23c8d3d8'/%3E%3Cstop offset='1' stop-color='%23566770'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='900' height='520' fill='url(%23g)'/%3E%3Crect y='330' width='900' height='190' fill='%233c4b52'/%3E%3Crect x='180' y='75' width='520' height='210' rx='24' fill='%23232f36' opacity='.35'/%3E%3Ccircle cx='450' cy='260' r='74' fill='%23078f8b' opacity='.8'/%3E%3C/svg%3E");
  background-size: cover;
  color: #ffffff;
  font-size: 2.4rem;
  font-weight: 900;
}

.preview-body {
  display: grid;
  gap: 13px;
  padding: 18px;
}

.preview-meta {
  display: grid;
  gap: 9px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.preview-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.preview-actions .primary-button {
  grid-column: auto;
}

.client-phone {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.phone-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.client-select {
  margin: 16px 18px 0;
}

.vehicle-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 16px 18px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.summary-item span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.summary-item strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(82px, 1fr));
  gap: 0;
  margin: 0;
  padding: 20px 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.timeline-row {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
  position: relative;
}

.timeline-dot {
  width: 30px;
  height: 30px;
  border: 3px solid #c4cbd2;
  border-radius: 50%;
  background: #ffffff;
}

.timeline-row.is-done .timeline-dot,
.timeline-row.is-active .timeline-dot {
  border-color: var(--accent);
  background: var(--accent);
}

.timeline-row.is-active .timeline-dot {
  background: #ffffff;
  border-color: #e79000;
}

.timeline-row.is-active strong {
  color: var(--amber);
}

.client-section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 20px 18px 8px;
}

.client-evidence-list {
  display: grid;
  gap: 12px;
  padding: 0 18px 16px;
}

.client-evidence-card {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.client-thumb {
  display: grid;
  min-height: 86px;
  place-items: center;
  border-radius: 6px;
  background:
    linear-gradient(rgba(17, 24, 39, 0.12), rgba(17, 24, 39, 0.26)),
    linear-gradient(135deg, #c8d3d8, #5c6b73);
  color: #ffffff;
  font-weight: 900;
}

.client-evidence-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.42;
}

.client-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 16px 18px 20px;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.client-context p {
  color: var(--muted);
  line-height: 1.55;
}

.review-layout table {
  min-width: 640px;
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.order-detail {
  display: grid;
  gap: 18px;
}

.detail-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.detail-block {
  padding: 16px 18px;
  border-right: 1px solid var(--line);
  background: #ffffff;
}

.detail-block:last-child {
  border-right: 0;
}

.detail-block span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: none;
}

.detail-block strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  font-size: 1.05rem;
}

.admin-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
}

.stage-list,
.activity-list {
  display: grid;
  gap: 10px;
}

.stage-row,
.activity-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.stage-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.activity-row {
  border-left: 4px solid #dbe4ea;
}

.activity-row p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.35;
}

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

.activity-page-row {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.activity-page-row p {
  margin: 4px 0 6px;
  color: #405063;
  line-height: 1.4;
}

.activity-dot {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #e4fbf8;
  color: var(--accent);
  font-weight: 900;
}

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

.config-row {
  display: grid;
  grid-template-columns: 112px 1fr;
  align-items: start;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.config-row p {
  margin: 4px 0 0;
  color: var(--muted);
}

.switch {
  position: relative;
  display: inline-flex;
  width: 42px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: #cbd6da;
  vertical-align: middle;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.16s ease;
}

.switch.is-on {
  background: var(--accent);
}

.switch.is-on::after {
  transform: translateX(18px);
}

.empty-state {
  padding: 22px;
  border: 1px dashed #c7d3d8;
  border-radius: var(--radius);
  background: #f8fbfc;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(360px, calc(100vw - 40px));
  padding: 12px 14px;
  border: 1px solid #bfdfd9;
  border-radius: var(--radius);
  background: #e5fbf6;
  color: #0a544f;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  font-weight: 750;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

body[data-entry="app"][data-view="client"] {
  background: #ffffff;
  overflow-x: hidden;
}

body[data-entry="app"][data-view="client"] .sidebar,
body[data-entry="app"][data-view="client"] .topbar,
body[data-entry="app"][data-view="client"] .client-context {
  display: none;
}

body[data-entry="app"][data-view="client"] .app-shell {
  display: block;
}

body[data-entry="app"][data-view="client"] .workspace {
  width: 100%;
  max-width: 100vw;
  padding: 22px;
  background: #ffffff;
  overflow-x: hidden;
}

body[data-entry="app"][data-view="client"] .client-shell {
  width: min(100%, 680px);
  margin: 0 auto;
  grid-template-columns: minmax(0, 1fr);
}

body[data-entry="app"][data-view="client"] .client-phone {
  border-radius: 8px;
}

@media (max-width: 1180px) {
  .topbar,
  .split-grid,
  .review-layout,
  .client-shell,
  .admin-grid,
  .settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .detail-summary {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .detail-block {
    border-bottom: 1px solid var(--line);
  }
}

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

  .sidebar {
    position: static;
    height: auto;
    gap: 16px;
  }

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

  .workspace {
    padding: 18px;
  }

  .panel-heading,
  .phone-top {
    display: grid;
  }

  .form-grid,
  .metric-grid,
  .detail-summary,
  .vehicle-summary,
  .client-actions,
  .stage-selector,
  .timeline {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .client-evidence-card {
    grid-template-columns: 1fr;
  }

  .client-phone {
    border-radius: var(--radius);
  }

  body[data-view="client"] {
    background: #ffffff;
    overflow-x: hidden;
  }

  body[data-view="client"] .sidebar,
  body[data-view="client"] .topbar,
  body[data-view="client"] .client-context {
    display: none;
  }

  body[data-view="client"] .app-shell,
  body[data-view="client"] .client-shell {
    display: block;
  }

  body[data-view="client"] .workspace {
    width: 100%;
    max-width: 100vw;
    padding: 0;
    background: #ffffff;
    overflow-x: hidden;
  }

  body[data-view="client"] .client-phone {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    margin: 0 auto;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  body[data-view="client"] .phone-top {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    padding: 18px 18px;
  }

  body[data-view="client"] .phone-top::before {
    content: "←";
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    color: #111827;
    font-size: 2rem;
    line-height: 1;
  }

  body[data-view="client"] .phone-top > div {
    min-width: 0;
  }

  body[data-view="client"] .phone-top .eyebrow {
    display: none;
  }

  body[data-view="client"] .phone-top h2 {
    font-size: 1.65rem;
  }

  body[data-view="client"] .phone-top .status-chip {
    grid-column: 2;
    justify-self: start;
    margin-top: 6px;
  }

  body[data-view="client"] .client-select {
    margin: 16px 18px 0;
  }

  body[data-view="client"] .client-select select {
    max-width: calc(100vw - 36px);
  }

  body[data-view="client"] .vehicle-summary {
    grid-template-columns: 1fr 1fr;
    margin: 16px 18px 22px;
    padding: 18px;
    background: #ffffff;
    border: 1px solid var(--line);
  }

  body[data-view="client"] .summary-item strong {
    font-size: 1.15rem;
  }

  body[data-view="client"] .timeline {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow: hidden;
    padding: 20px 34px 20px 8px;
  }

  body[data-view="client"] .timeline-row {
    min-width: 0;
    font-size: 0.72rem;
  }

  body[data-view="client"] .timeline-dot {
    width: 26px;
    height: 26px;
  }

  body[data-view="client"] .client-section-title span {
    display: none;
  }

  body[data-view="client"] .client-section-title {
    padding-right: 34px;
  }

  body[data-view="client"] .client-section-title h3 {
    font-size: 1.18rem;
  }

  body[data-view="client"] .client-evidence-card {
    grid-template-columns: 116px minmax(0, 1fr);
    padding: 12px;
    border-radius: 12px;
  }

  body[data-view="client"] .client-thumb {
    min-height: 84px;
  }

  body[data-view="client"] .client-evidence-card > div:last-child {
    min-width: 0;
  }

  body[data-view="client"] .client-evidence-card strong,
  body[data-view="client"] .client-evidence-card p {
    overflow-wrap: anywhere;
  }

  body[data-view="client"] .client-actions {
    position: sticky;
    bottom: 0;
    gap: 12px;
    padding-bottom: 22px;
    background: rgba(255, 255, 255, 0.97);
  }

  body[data-view="client"] .client-actions .primary-button,
  body[data-view="client"] .client-actions .ghost-button {
    min-height: 52px;
    font-size: 1rem;
  }
}

/* Final mockup overrides */
.metric-card {
  grid-template-columns: 58px 1fr;
}

.metric-card small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.metric-clock::before {
  content: "";
  border-color: #f59e0b;
  background:
    linear-gradient(#f59e0b, #f59e0b) 50% 50% / 3px 18px no-repeat,
    linear-gradient(#f59e0b, #f59e0b) 58% 58% / 16px 3px no-repeat;
}

.metric-check::before {
  content: "OK";
}

.metric-x::before {
  content: "X";
  border-color: #ef6a63;
  color: #d92d20;
}

.metric-users::before {
  content: "US";
  border-color: #5aa8dc;
  color: #327eb6;
}

.vehicle-summary,
body[data-view="client"] .vehicle-summary {
  grid-template-columns: 178px 1fr;
  gap: 18px;
  padding: 18px;
  background: #ffffff;
  border: 1px solid var(--line);
}

.client-summary-data,
body[data-view="client"] .client-summary-data {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.client-evidence-card,
body[data-view="client"] .client-evidence-card {
  grid-template-columns: 156px 1fr 54px;
  align-items: center;
  border-radius: 12px;
}

.client-thumb,
body[data-view="client"] .client-thumb {
  position: relative;
  min-height: 98px;
  overflow: hidden;
}

.admin-hero {
  display: grid;
  grid-template-columns: 150px 1.1fr 180px minmax(260px, 1.4fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #ffffff;
}

.admin-toolbar-inline {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.admin-toolbar-inline + .admin-hero {
  margin-top: 10px;
}

.admin-toolbar-inline .primary-button,
.admin-toolbar-inline .ghost-button {
  min-width: 154px;
}

.admin-board {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 320px;
  gap: 16px;
}

@media (max-width: 1320px) {
  .admin-board,
  .admin-hero {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 780px) {
  .vehicle-summary,
  body[data-view="client"] .vehicle-summary {
    grid-template-columns: 1fr;
  }

  .client-evidence-card,
  body[data-view="client"] .client-evidence-card {
    grid-template-columns: 116px minmax(0, 1fr) 42px;
  }
}

/* Screen-specific parity pass */
.nav-tab[data-view="worker"] .tab-icon,
.nav-tab[data-view="admin"] .tab-icon,
.nav-tab[data-view="supervisor"] .tab-icon,
.nav-tab[data-view="client"] .tab-icon,
.nav-tab[data-view="activity"] .tab-icon,
.nav-tab[data-view="clients"] .tab-icon,
.nav-tab[data-view="settings"] .tab-icon {
  font-size: 0;
}

.nav-tab[data-view="worker"] .tab-icon::before { content: "IN"; font-size: 0.72rem; }
.nav-tab[data-view="admin"] .tab-icon::before { content: "OT"; font-size: 0.72rem; }
.nav-tab[data-view="supervisor"] .tab-icon::before { content: "EV"; font-size: 0.72rem; }
.nav-tab[data-view="client"] .tab-icon::before { content: "CL"; font-size: 0.72rem; }
.nav-tab[data-view="activity"] .tab-icon::before { content: "AC"; font-size: 0.72rem; }
.nav-tab[data-view="clients"] .tab-icon::before { content: "US"; font-size: 0.72rem; }
.nav-tab[data-view="settings"] .tab-icon::before { content: "CF"; font-size: 0.72rem; }

body:not([data-view="client"]) .app-shell {
  grid-template-columns: 248px minmax(0, 1fr);
}

body:not([data-view="client"]) .sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
}

body:not([data-view="client"]) .nav-tabs {
  grid-template-columns: 1fr;
}

body[data-view="admin"] #adminView > .panel,
body[data-view="supervisor"] #supervisorView > .panel {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

body[data-view="admin"] #adminView > .panel > .panel-heading {
  margin-bottom: 12px;
}

body[data-view="admin"] #adminView > .panel > .panel-heading > div {
  display: none;
}

body[data-view="admin"] #adminView .toolbar {
  width: 100%;
  justify-content: flex-end;
}

body[data-view="admin"] #adminView .toolbar select {
  max-width: 260px;
  margin-right: auto;
}

body[data-view="admin"] .global-search {
  opacity: 0;
  pointer-events: none;
}

body[data-view="admin"] .topbar-actions {
  display: none;
}

body[data-view="supervisor"] .topbar {
  grid-template-columns: minmax(300px, 1fr);
}

body[data-view="supervisor"] .global-search,
body[data-view="supervisor"] .topbar-actions {
  display: none;
}

.preview-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line-soft);
}

.preview-titlebar h2 {
  font-size: 1.05rem;
}

body[data-view="supervisor"] .preview-panel {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

body[data-view="supervisor"] .preview-actions {
  grid-template-columns: 1.2fr 0.8fr 1fr;
}

body[data-view="supervisor"] .preview-actions .primary-button,
body[data-view="supervisor"] .preview-actions .ghost-button,
body[data-view="supervisor"] .preview-actions .danger-button {
  min-height: 46px;
}

.warning-button {
  border-color: #ffc46b;
  color: #c47a00;
}

.table-footer {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 16px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.pager {
  display: flex;
  gap: 8px;
}

.pager .compact-action {
  width: 36px;
  min-width: 36px;
  padding: 0;
}

.table-footer select {
  min-width: 130px;
}

body[data-view="worker"] .split-grid {
  grid-template-columns: minmax(400px, 0.62fr) minmax(640px, 1.38fr);
}

body[data-view="worker"] .drive-sync-box {
  min-height: 166px;
  grid-template-columns: 72px 1fr;
  align-items: center;
}

body[data-view="worker"] .upload-icon {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  font-size: 1rem;
}

body[data-view="worker"] .stage-selector {
  grid-template-columns: repeat(5, minmax(128px, 1fr));
}

body[data-view="worker"] .stage-chip {
  min-height: 44px;
  font-size: 0.95rem;
}

.admin-stage-panel h3,
.admin-files-panel h3,
.admin-activity-panel h3 {
  font-size: 1.08rem;
}

.admin-files-panel .table-wrap,
.admin-stage-panel,
.admin-activity-panel {
  min-height: 616px;
}

.admin-file-table th,
.admin-file-table td {
  padding-top: 10px;
  padding-bottom: 10px;
}

.admin-activity-panel .panel-heading {
  align-items: center;
}

body[data-view="client"] .phone-top {
  grid-template-columns: 52px minmax(0, 1fr) auto;
  min-height: 104px;
}

body[data-view="client"] .phone-top::before {
  grid-row: 1;
}

body[data-view="client"] .phone-top .status-chip {
  grid-column: 3;
  grid-row: 1;
  align-self: center;
  justify-self: end;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  background: #fdeccf;
  color: #d97706;
  border-color: #f6d49b;
  font-size: 0.96rem;
}

body[data-view="client"] .phone-top h2 {
  font-size: 2.05rem;
}

body[data-view="client"] .client-section-title {
  padding-top: 30px;
}

body[data-view="client"] .client-section-title h3 {
  font-size: 1.75rem;
}

body[data-view="client"] .client-section-title p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.35;
}

.client-media-kind {
  display: inline-flex;
  margin-top: 7px;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: #e7f7ed;
  color: #16824d;
  font-size: 0.74rem;
  font-weight: 850;
}

body[data-view="client"] .client-actions .primary-button,
body[data-view="client"] .client-actions .ghost-button {
  min-height: 58px;
  border-radius: 8px;
  font-size: 1.12rem;
}

@media (max-width: 900px) {
  body:not([data-view="client"]) .app-shell {
    grid-template-columns: 224px minmax(0, 1fr);
  }

  body:not([data-view="client"]) .sidebar {
    padding-inline: 10px;
  }

  body:not([data-view="client"]) .nav-tab {
    gap: 8px;
    padding-inline: 8px;
    font-size: 0.86rem;
  }
}

/* Collapsible sidebar and admin-first table layout */
.sidebar-toggle {
  margin-left: auto;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-size: 1.35rem;
  line-height: 1;
}

body.is-sidebar-collapsed:not([data-view="client"]) .app-shell {
  grid-template-columns: 76px minmax(0, 1fr);
}

body.is-sidebar-collapsed .sidebar {
  padding-inline: 10px;
}

body.is-sidebar-collapsed .brand {
  justify-content: center;
  padding-inline: 0;
}

body.is-sidebar-collapsed .brand > div,
body.is-sidebar-collapsed .sidebar-note {
  display: none;
}

body.is-sidebar-collapsed .brand-mark {
  width: 44px;
  height: 44px;
}

body.is-sidebar-collapsed .sidebar-toggle {
  position: absolute;
  top: 64px;
  left: 21px;
  width: 34px;
  height: 34px;
}

body.is-sidebar-collapsed .nav-tabs {
  margin-top: 44px;
}

body.is-sidebar-collapsed .nav-tab {
  justify-content: center;
  min-height: 48px;
  padding: 0;
  gap: 0;
  font-size: 0;
}

body.is-sidebar-collapsed .nav-tab .tab-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
}

body.is-sidebar-collapsed .nav-tab.is-active .tab-icon {
  background: rgba(8, 170, 166, 0.28);
}

body[data-view="admin"] .order-detail {
  gap: 14px;
}

body[data-view="admin"] .admin-files-primary {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
}

body[data-view="admin"] .admin-files-primary .panel-heading {
  align-items: center;
  margin-bottom: 12px;
}

body[data-view="admin"] .admin-files-primary .panel-heading p {
  margin: 5px 0 0;
}

body[data-view="admin"] .admin-files-primary .table-wrap {
  max-height: min(54vh, 620px);
  overflow: auto;
}

body[data-view="admin"] .admin-file-table {
  min-width: 900px;
}

body[data-view="admin"] .admin-file-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}

body[data-view="admin"] .admin-file-table td,
body[data-view="admin"] .admin-file-table th {
  padding: 9px 12px;
}

body[data-view="admin"] .admin-secondary-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.admin-subtabs {
  display: flex;
  gap: 0;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.admin-subtab {
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #475467;
  font-weight: 850;
}

.admin-subtab.is-active {
  border-bottom-color: var(--accent);
  color: #0a544f;
}

.admin-tab-panel {
  display: none;
  padding: 18px;
}

.admin-tab-panel.is-active {
  display: block;
}

body[data-view="admin"] .admin-tab-panel .stage-track {
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  display: grid;
  gap: 14px;
}

body[data-view="admin"] .admin-tab-panel .admin-stage {
  grid-template-columns: 42px 1fr;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 14px;
}

body[data-view="admin"] .admin-tab-panel .admin-stage::before {
  display: none;
}

body[data-view="admin"] .admin-tab-panel .admin-stage .status-chip {
  grid-column: 1 / -1;
  justify-self: start;
}

body[data-view="admin"] .admin-tab-panel .evidence-summary {
  margin-top: 18px;
}

@media (max-width: 1180px) {
  body[data-view="admin"] .admin-tab-panel .stage-track {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 700px) {
  body:not([data-view="client"]) .app-shell,
  body.is-sidebar-collapsed:not([data-view="client"]) .app-shell {
    grid-template-columns: 1fr;
  }

  body:not([data-view="client"]) .sidebar {
    position: static;
    height: auto;
  }

  body.is-sidebar-collapsed .brand > div,
  body.is-sidebar-collapsed .sidebar-note {
    display: block;
  }

  body.is-sidebar-collapsed .sidebar-toggle {
    position: static;
    margin-left: auto;
  }

  body.is-sidebar-collapsed .nav-tabs {
    margin-top: 0;
  }

  body.is-sidebar-collapsed .nav-tab {
    justify-content: flex-start;
    padding: 0 10px;
    gap: 10px;
    font-size: 0.88rem;
  }

  body:not([data-view="client"]) .nav-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-view="admin"] .admin-toolbar-inline {
    display: grid;
    grid-template-columns: 1fr;
  }

  body[data-view="admin"] .admin-hero {
    grid-template-columns: 1fr;
  }

  body[data-view="admin"] .admin-files-primary .panel-heading {
    display: grid;
    gap: 8px;
  }

  body[data-view="admin"] .admin-tab-panel .stage-track {
    grid-template-columns: 1fr;
  }
}
