:root {
  --bg: #0a0a0d;
  --bg-2: #0f0f13;
  --surface: #15151a;
  --surface-2: #1a191f;
  --surface-3: #201f25;
  --line: rgba(255,255,255,.105);
  --line-strong: rgba(205,169,96,.34);
  --text: #f2f0eb;
  --muted: #a4a2a9;
  --dim: #74727a;
  --gold: #cda960;
  --gold-2: #a77f35;
  --gold-soft: rgba(205,169,96,.11);
  --green: #64c98c;
  --blue: #6ca5e8;
  --orange: #e2a45f;
  --red: #e87878;
  --purple: #9b8bc5;
  --radius: 10px;
  --shadow: 0 28px 80px rgba(0,0,0,.52);
  --sans: "Inter", "Segoe UI", Arial, sans-serif;
  --serif: "Cormorant Garamond", Georgia, serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 65% -15%, rgba(205,169,96,.08), transparent 36%),
    linear-gradient(180deg, rgba(5,5,7,.78), rgba(8,8,11,.97)),
    url("../assets/bg-showroom.svg") center top / cover fixed;
  font-family: var(--sans);
  font-size: 14px;
}
body.modal-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
[hidden] { display: none !important; }

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(0,0,0,.42), transparent 22%, transparent 78%, rgba(0,0,0,.5));
  z-index: -1;
}
.eyebrow {
  margin: 0 0 5px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .22em;
}
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: var(--serif); }
.muted-copy { color: var(--muted); line-height: 1.6; }

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 48px 20px;
}
.back-link {
  position: fixed;
  top: 24px;
  left: 28px;
  color: var(--muted);
  text-decoration: none;
}
.back-link:hover { color: var(--gold); }
.auth-card {
  width: min(100%, 430px);
  padding: 42px;
  text-align: center;
  background: linear-gradient(160deg, rgba(27,26,32,.97), rgba(15,15,19,.98));
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.brand-logo {
  width: 132px;
  max-height: 58px;
  object-fit: contain;
  filter: invert(1) grayscale(1) brightness(1.7);
  margin-bottom: 20px;
}
.auth-card h1 {
  font-size: 46px;
  line-height: 1;
  margin: 4px 0 12px;
}
.auth-copy { color: var(--muted); line-height: 1.55; margin-bottom: 28px; }
.secure-note { color: var(--dim); font-size: 11px; margin: 22px 0 0; }
.service-state {
  display: grid;
  gap: 10px;
  padding: 16px;
  text-align: left;
  color: #d7cbb2;
  border: 1px solid rgba(226,164,95,.25);
  background: rgba(226,164,95,.08);
  border-radius: var(--radius);
}
.service-state span { color: var(--muted); font-size: 12px; }

.stack-form, .modal-body { display: grid; gap: 16px; }
label {
  display: grid;
  gap: 7px;
  color: #c4c1c7;
  font-size: 12px;
  font-weight: 600;
}
label small { color: var(--dim); font-weight: 400; }
input, select, textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  color: var(--text);
  background: #101014;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: rgba(205,169,96,.62);
  box-shadow: 0 0 0 3px rgba(205,169,96,.09);
}
input::placeholder, textarea::placeholder { color: #65636a; }
.password-wrap, .input-action { display: flex; align-items: center; }
.password-wrap input, .input-action input { border-radius: 7px 0 0 7px; }
.password-wrap .icon-button, .input-action button {
  height: 42px;
  border-left: 0;
  border-radius: 0 7px 7px 0;
}
.input-action button {
  min-width: 64px;
  color: var(--gold);
  background: var(--gold-soft);
  border: 1px solid var(--line);
  cursor: pointer;
}
.form-error { min-height: 17px; margin: 0; color: var(--red); font-size: 12px; line-height: 1.4; }

.button {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: #d7d4d9;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 12px;
  transition: transform .15s, border-color .15s, background .15s;
}
.button:hover:not(:disabled) { transform: translateY(-1px); border-color: rgba(205,169,96,.42); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button.primary {
  color: #17130c;
  background: linear-gradient(180deg, #d8b76f, #ba9044);
  border-color: #d4b06a;
  box-shadow: 0 8px 24px rgba(205,169,96,.14);
}
.button.ghost { background: transparent; }
.button.danger { color: #ffdada; border-color: rgba(232,120,120,.35); background: rgba(232,120,120,.08); }
.button.wide { width: 100%; min-height: 44px; }
.button-row { display: flex; gap: 9px; flex-wrap: wrap; }
.icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
}
.icon-button:hover { border-color: rgba(205,169,96,.42); color: var(--gold); }
.text-button {
  border: 0;
  padding: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.text-button:hover { color: var(--gold); }

.app-shell { width: min(100%, 1540px); margin: 0 auto; padding: 0 34px 72px; }
.topbar {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}
.brand-block { display: flex; align-items: center; gap: 13px; }
.brand-block img {
  width: 73px;
  height: 34px;
  object-fit: contain;
  filter: invert(1) grayscale(1) brightness(1.65);
  opacity: .9;
}
.brand-block h1 { margin: 0; font-size: 27px; line-height: .9; }
.back-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 50%;
  text-decoration: none;
}
.top-actions { position: relative; display: flex; align-items: center; gap: 8px; }
.session-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 11px;
}
.session-pill i { width: 7px; height: 7px; background: var(--green); border-radius: 50%; box-shadow: 0 0 10px rgba(100,201,140,.55); }
.count-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
  color: #18130b;
  background: var(--gold);
  font-size: 10px;
}
.dropdown {
  position: absolute;
  z-index: 50;
  top: calc(100% + 8px);
  right: 0;
  width: 255px;
  padding: 7px;
  background: #17171c;
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: var(--shadow);
}
.dropdown button {
  width: 100%;
  padding: 11px 12px;
  text-align: left;
  color: #d2d0d5;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.dropdown button:hover { background: var(--gold-soft); color: var(--gold); }
.dropdown span { display: block; height: 1px; margin: 6px; background: var(--line); }

main { padding-top: 23px; }
.year-strip { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.year-tabs { display: flex; align-items: center; gap: 5px; overflow-x: auto; scrollbar-width: none; }
.year-tab, .year-add {
  min-height: 34px;
  padding: 7px 13px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
}
.year-tab:hover, .year-add:hover { color: var(--text); border-color: var(--line); }
.year-tab.active { color: #17130b; background: var(--gold); font-weight: 700; }
.year-tab .lock { margin-left: 5px; font-size: 10px; }
.year-add { border-color: var(--line); }

.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin-bottom: 18px; }
.summary-card {
  min-height: 116px;
  padding: 19px 20px;
  text-align: left;
  color: var(--text);
  background: linear-gradient(155deg, rgba(30,29,35,.97), rgba(20,20,25,.97));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.summary-card::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent 75%);
  opacity: .5;
}
.summary-card:hover { border-color: rgba(205,169,96,.32); }
.summary-kicker { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.summary-card strong { display: block; margin: 10px 0 5px; font-family: var(--serif); font-size: 27px; font-variant-numeric: tabular-nums; }
.summary-card small { color: var(--dim); }

.register-panel {
  background: rgba(16,16,20,.96);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: visible;
  box-shadow: 0 24px 65px rgba(0,0,0,.28);
}
.panel-head { display: flex; align-items: end; justify-content: space-between; padding: 20px 22px 15px; }
.panel-head h2 { margin: 0; font-size: 28px; }
.panel-head h2 span { color: var(--gold); }
.filters {
  min-height: 64px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #121217;
}
.search-field { min-width: 250px; flex: 1; position: relative; }
.search-field span { position: absolute; z-index: 1; left: 12px; top: 10px; color: var(--dim); font-size: 19px; }
.search-field input { padding-left: 36px; }
.select-label { display: block; }
.select-label > span { position: absolute; width: 1px; height: 1px; overflow: hidden; }
.select-label select { min-width: 150px; }
.more-filters { position: relative; }
.more-filters summary {
  min-height: 42px;
  padding: 11px 13px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
  list-style: none;
}
.filter-popover {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  width: 230px;
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.results-count { color: var(--dim); font-size: 11px; white-space: nowrap; }
.loading-bar { height: 2px; overflow: hidden; background: rgba(205,169,96,.12); }
.loading-bar::after {
  content: ""; display: block; width: 35%; height: 100%;
  background: var(--gold); animation: loading 1s infinite ease-in-out;
}
@keyframes loading { from { transform: translateX(-110%); } to { transform: translateX(350%); } }

.table-wrap { min-height: 260px; overflow: auto; }
.cases-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cases-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 42px;
  padding: 0 14px;
  text-align: left;
  color: var(--dim);
  background: #111116;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.cases-table th:nth-child(1) { width: 135px; }
.cases-table th:nth-child(2) { width: 19%; }
.cases-table th:nth-child(3) { width: 17%; }
.cases-table th:nth-child(4),
.cases-table th:nth-child(5),
.cases-table th:nth-child(6) { width: 115px; }
.cases-table th:nth-child(7) { width: 185px; }
.cases-table th:nth-child(8) { width: 105px; }
.cases-table td {
  height: 60px;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(255,255,255,.065);
  color: #d6d3d8;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cases-table tbody tr { cursor: pointer; transition: background .14s; }
.cases-table tbody tr:hover { background: rgba(205,169,96,.055); }
.cases-table .case-no { color: var(--gold); font-weight: 700; font-size: 12px; }
.cases-table .client-name { display: block; font-weight: 600; color: #ebe8e3; overflow: hidden; text-overflow: ellipsis; }
.cases-table .client-sub { display: block; margin-top: 3px; color: var(--dim); font-size: 10px; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.money-primary { color: #eeeae1; font-weight: 600; }
.money-muted { color: var(--muted); }
.status-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid currentColor;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.status-initiere { color: #8fa0b3; background: rgba(143,160,179,.08); }
.status-in_desfasurare { color: var(--blue); background: rgba(108,165,232,.08); }
.status-aprobat_asteptare_plata { color: var(--gold); background: var(--gold-soft); }
.status-plata_partiala { color: var(--orange); background: rgba(226,164,95,.08); }
.status-incasat_integral { color: var(--green); background: rgba(100,201,140,.08); }
.status-anulat { color: #d05f65; background: rgba(208,95,101,.09); }
.status-reportat, .status-inchis_final_an { color: var(--purple); background: rgba(155,139,197,.08); }
.pagination {
  min-height: 52px;
  margin: 0;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.pagination > div { display: flex; align-items: center; gap: 10px; }
.pagination .icon-button { width: 32px; height: 32px; }
.empty-state { min-height: 260px; display: grid; place-content: center; text-align: center; color: var(--muted); }
.empty-state > span { color: var(--gold); font-size: 25px; }
.empty-state strong { color: #d9d6da; margin-top: 8px; }
.empty-state p { margin: 5px 0 0; font-size: 12px; }
.mobile-case-list { display: none; }

.scrim { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.58); backdrop-filter: blur(2px); }
.drawer {
  position: fixed;
  z-index: 80;
  top: 0; right: 0; bottom: 0;
  width: min(540px, 100%);
  display: flex;
  flex-direction: column;
  background: #121217;
  border-left: 1px solid var(--line);
  box-shadow: -28px 0 90px rgba(0,0,0,.6);
  transform: translateX(104%);
  transition: transform .22s ease;
}
.drawer.open { transform: translateX(0); }
.drawer-head { padding: 23px 24px 17px; display: flex; align-items: flex-start; justify-content: space-between; }
.drawer-head h2 { margin: 0 0 9px; font-size: 32px; }
.drawer-metrics { padding: 0 24px 18px; display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.drawer-metric { padding: 11px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; }
.drawer-metric span { display: block; color: var(--dim); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.drawer-metric strong { display: block; margin-top: 7px; font-size: 13px; }
.drawer-tabs { display: flex; padding: 0 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.drawer-tabs button {
  flex: 1;
  padding: 12px 6px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 11px;
}
.drawer-tabs button.active { color: var(--gold); border-color: var(--gold); }
.drawer-content { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 24px; }
.drawer-actions {
  min-height: 62px;
  padding: 11px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: #101014;
  border-top: 1px solid var(--line);
}
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.detail-block { min-width: 0; }
.detail-block.full { grid-column: 1 / -1; }
.detail-block span { display: block; color: var(--dim); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; }
.detail-block strong { display: block; margin-top: 5px; color: #e2dfe3; line-height: 1.45; overflow-wrap: anywhere; }
.section-title { margin: 23px 0 12px; font-family: var(--sans); font-size: 11px; color: var(--gold); letter-spacing: .1em; text-transform: uppercase; }
.payment-list, .timeline, .inline-list { display: grid; gap: 9px; }
.payment-item, .request-item, .timeline-item {
  padding: 13px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.payment-item { display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; align-items: center; }
.payment-item strong { color: var(--green); font-size: 15px; }
.payment-item small, .request-item small { color: var(--dim); }
.payment-item p { grid-column: 1 / -1; margin: 0; color: var(--muted); }
.timeline-item { position: relative; padding-left: 28px; }
.timeline-item::before { content: ""; position: absolute; left: 13px; top: 18px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.timeline-item strong { display: block; }
.timeline-item small { display: block; margin-top: 4px; color: var(--dim); }
.note-form { display: flex; gap: 8px; margin-top: 14px; }
.note-form input { min-width: 0; }

dialog {
  color: var(--text);
}
.modal {
  width: min(850px, calc(100vw - 32px));
  max-height: calc(100vh - 36px);
  padding: 0;
  overflow: hidden;
  background: #15151a;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.modal.compact { width: min(500px, calc(100vw - 32px)); }
.modal.wide-modal { width: min(1040px, calc(100vw - 32px)); }
.modal.import-modal { width: min(1320px, calc(100vw - 24px)); }
.modal::backdrop { background: rgba(0,0,0,.68); backdrop-filter: blur(3px); }
.modal > form, .modal-static { max-height: calc(100vh - 38px); display: flex; flex-direction: column; }
.modal-head {
  min-height: 74px;
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 { margin: 0; font-size: 28px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot {
  min-height: 62px;
  padding: 10px 20px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 9px;
  background: #111116;
  border-top: 1px solid var(--line);
}
.modal-foot > span { margin-right: auto; color: var(--muted); font-size: 11px; }
.form-sections { gap: 0; padding: 0 20px; }
.form-sections section { padding: 20px 0; border-bottom: 1px solid var(--line); }
.form-sections section:last-of-type { border-bottom: 0; }
.form-sections h3 { display: flex; align-items: center; gap: 9px; color: #e8e4df; font-family: var(--sans); font-size: 13px; }
.form-sections h3 span { color: var(--gold); font-size: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-grid > label:last-child:nth-child(odd) { grid-column: 1 / -1; }
.segmented { display: inline-flex; padding: 3px; gap: 3px; background: #0f0f13; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 14px; }
.segmented label { display: block; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label span, .segmented button {
  min-height: 32px;
  padding: 8px 12px;
  display: block;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
  font-size: 11px;
}
.segmented input:checked + span, .segmented button.active { color: var(--text); background: var(--surface-3); }
.segmented.small { margin: 0; }
.check-line { display: flex; grid-auto-flow: column; justify-content: start; align-items: center; margin-bottom: 13px; }
.check-line input { width: 16px; min-height: 16px; accent-color: var(--gold); }
.master-toggle {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101014;
  cursor: pointer;
}
.master-toggle input { position: absolute; width: 1px; min-height: 1px; opacity: 0; }
.master-toggle .toggle-track { position: relative; flex: 0 0 38px; width: 38px; height: 22px; border: 1px solid #57545c; border-radius: 999px; background: #29282e; transition: background .15s, border-color .15s; }
.master-toggle .toggle-track > span { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #b8b5bc; transition: transform .15s, background .15s; }
.master-toggle input:checked + .toggle-track { border-color: var(--gold); background: rgba(205,169,96,.25); }
.master-toggle input:checked + .toggle-track > span { transform: translateX(16px); background: var(--gold); }
.master-toggle input:focus-visible + .toggle-track { box-shadow: 0 0 0 3px rgba(205,169,96,.16); }
.master-toggle strong, .master-toggle small { display: block; }
.master-toggle small { margin-top: 3px; color: var(--dim); line-height: 1.35; }
.warning-box, .result-preview, .balance-preview {
  padding: 12px 13px;
  border-radius: 7px;
  border: 1px solid var(--line);
  line-height: 1.5;
}
.warning-box { color: #d8c5a3; background: rgba(226,164,95,.07); border-color: rgba(226,164,95,.22); font-size: 11px; }
.balance-preview { display: flex; justify-content: space-between; background: var(--surface-2); }
.result-preview { color: var(--muted); background: #101014; }

.modal-toolbar {
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.modal-toolbar > span { color: var(--dim); font-size: 11px; }
.request-list { min-height: 280px; }
.request-item { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; }
.request-item h3 { margin: 0; font-family: var(--sans); font-size: 13px; }
.request-item p { grid-column: 1 / -1; margin: 0; color: var(--muted); line-height: 1.5; }
.request-item .button-row { grid-column: 1 / -1; justify-content: flex-end; }
.request-item pre { grid-column: 1 / -1; padding: 10px; overflow: auto; color: #c7c3cb; background: #0e0e12; border-radius: 6px; font-size: 10px; }

.calculator-filters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  align-items: end;
}
.calculator-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.calc-card { min-height: 110px; padding: 16px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; }
.calc-card span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.calc-card strong { display: block; margin-top: 12px; font-family: var(--serif); font-size: 25px; }
.calc-card small { color: var(--dim); }
.metric-note { margin: 0; color: var(--dim); font-size: 11px; line-height: 1.6; }

.import-stepper { display: flex; gap: 8px; color: var(--dim); font-size: 10px; }
.import-stepper span { flex: 1; padding: 9px; border-bottom: 2px solid var(--line); }
.import-stepper span.active { color: var(--gold); border-color: var(--gold); }
.drop-zone {
  min-height: 190px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  text-align: center;
  border: 1px dashed rgba(205,169,96,.35);
  border-radius: 10px;
  background: rgba(205,169,96,.035);
}
.drop-zone.dragover { background: rgba(205,169,96,.09); border-color: var(--gold); }
.drop-zone p { color: var(--muted); margin: 0 0 8px; }
.import-summary { padding: 12px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; }
.import-actions { display: flex; align-items: center; gap: 8px; }
.import-grid-wrap { max-height: 51vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.import-grid { width: 100%; min-width: 1050px; border-collapse: collapse; }
.import-grid th {
  position: sticky; top: 0; z-index: 2;
  padding: 9px; text-align: left; background: #101014; color: var(--dim);
  border-bottom: 1px solid var(--line); font-size: 10px; text-transform: uppercase;
}
.import-grid td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.import-grid td input, .import-grid td select { min-height: 34px; padding: 6px 8px; font-size: 11px; }
.import-grid td:first-child input { width: 15px; min-height: 15px; accent-color: var(--gold); }
.row-state { display: inline-flex; padding: 4px 7px; border-radius: 10px; font-size: 9px; }
.row-state.ok { color: var(--green); background: rgba(100,201,140,.08); }
.row-state.review { color: var(--orange); background: rgba(226,164,95,.08); }
.row-state.ignored { color: var(--dim); background: rgba(255,255,255,.04); }
.import-api-result { padding: 13px; background: #101014; border: 1px solid var(--line); border-radius: 8px; }
.import-api-result.success { border-color: rgba(100,201,140,.3); color: #bfe5ce; }
.import-api-result.error { border-color: rgba(232,120,120,.3); color: #efb5b5; }

.year-decision-list { display: grid; gap: 8px; }
.year-decision {
  padding: 13px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.year-decision p { grid-column: 1 / -1; color: var(--muted); margin: 0; }
.year-decision select { min-width: 190px; }

.toast-region { position: fixed; z-index: 200; right: 18px; bottom: 18px; display: grid; gap: 8px; pointer-events: none; }
.toast {
  width: min(380px, calc(100vw - 36px));
  padding: 13px 15px;
  color: #dedbe0;
  background: #1b1a20;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  box-shadow: var(--shadow);
  animation: toast-in .2s ease;
}
.toast.error { border-left-color: var(--red); }
.toast.success { border-left-color: var(--green); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.mobile-only, .mobile-new-case { display: none; }

@media (max-width: 1120px) {
  .app-shell { padding-left: 20px; padding-right: 20px; }
  .desktop-only, .session-pill { display: none; }
  .filters { flex-wrap: wrap; }
  .search-field { min-width: 100%; }
  .cases-table th:nth-child(3), .cases-table td:nth-child(3) { display: none; }
}

@media (max-width: 760px) {
  body { background-attachment: scroll; }
  .app-shell { padding: 0 12px 90px; }
  .topbar { min-height: 70px; }
  .brand-block img { display: none; }
  .brand-block .eyebrow { display: none; }
  .brand-block h1 { font-size: 24px; }
  .top-actions .button:not(#requestsBtn):not(#newCaseBtn) { display: none; }
  #newCaseBtn { display: none; }
  .menu-trigger { width: 34px; height: 34px; }
  .year-strip { margin-top: 4px; }
  .year-add { display: none; }
  .summary-grid {
    grid-template-columns: repeat(3, minmax(210px, 75vw));
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 5px;
    scrollbar-width: none;
  }
  .summary-card { min-height: 104px; scroll-snap-align: start; }
  .panel-head { padding: 16px; }
  .mobile-only { display: inline-flex; }
  .filters { display: none; padding: 12px; }
  .filters.mobile-open { display: flex; }
  .search-field { min-width: 100%; }
  .select-label, .select-label select, .more-filters { width: 100%; }
  .results-count { margin-left: auto; }
  .cases-table { display: none; }
  .mobile-case-list { display: grid; gap: 8px; padding: 10px; }
  .case-card {
    padding: 13px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 12px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 8px;
  }
  .case-card .case-no { color: var(--gold); font-weight: 700; }
  .case-card h3 { grid-column: 1 / -1; margin: 0; font-family: var(--sans); font-size: 14px; }
  .case-card .card-service { color: var(--muted); }
  .case-card .card-money { text-align: right; }
  .case-card .status-badge { grid-column: 1 / -1; justify-self: start; }
  .pagination { padding: 10px; }
  .drawer { width: 100%; }
  .drawer-head { padding: 18px; }
  .drawer-content { padding: 18px; }
  .drawer-metrics { padding: 0 18px 14px; }
  .drawer-actions { overflow-x: auto; justify-content: flex-start; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-block.full { grid-column: auto; }
  .mobile-new-case {
    position: fixed;
    z-index: 40;
    left: 50%;
    bottom: max(16px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    min-height: 46px;
    padding: 10px 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #17130b;
    background: linear-gradient(180deg, #d8b76f, #ba9044);
    border: 0;
    border-radius: 24px;
    box-shadow: 0 12px 35px rgba(0,0,0,.5);
    font-weight: 700;
  }
  .modal {
    width: 100vw !important;
    max-height: 100vh;
    height: 100vh;
    max-width: none;
    border: 0;
    border-radius: 0;
  }
  .modal > form, .modal-static { max-height: 100vh; height: 100%; }
  .modal-head { min-height: 66px; }
  .modal-body { padding: 16px; }
  .modal-foot { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .form-grid, .calculator-filters, .calculator-grid { grid-template-columns: 1fr; }
  .segmented { width: 100%; overflow-x: auto; }
  .segmented label { flex: 1; }
  .segmented label span { text-align: center; white-space: nowrap; }
  .request-item { grid-template-columns: 1fr; }
  .request-item > * { grid-column: 1 !important; }
  .year-decision { grid-template-columns: 1fr; }
  .year-decision p { grid-column: 1; }
  .import-stepper span { padding: 7px 3px; font-size: 8px; }
  .auth-card { padding: 32px 22px; }
  .auth-card h1 { font-size: 40px; }
  .back-link { top: 18px; left: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
