/* Commissions presentation only. Financial rules and shared dossier styles stay intact. */
:root {
  color-scheme: dark;
  --bg: #081322; --bg-2: #0c1b2d;
  --surface: #101f32; --surface-2: #14263c; --surface-3: #1b3048;
  --text: #edf4fc; --muted: #b4c4d7; --dim: #91a5bc;
  --line: #293d53; --line-strong: #476b91;
  /* Legacy presentation tokens now follow the application's cool accent. */
  --gold: #7dbdff; --gold-2: #b5dcff; --gold-soft: rgb(125 189 255 / 10%);
  --blue: #7dbdff; --orange: #e8b774; --green: #79d3a5;
  --red: #f08f99; --radius: 12px;
  --shadow: 0 20px 65px rgb(0 7 18 / 35%);
  --serif: var(--sans);
}
body { background: radial-gradient(ellipse at 70% 0, #142c462e, transparent 55%), var(--bg); }
.ambient { background: none; }
h1, h2 { letter-spacing: -.035em; }
.app-shell { width: min(100%, 1600px); padding-inline: 32px; }
.topbar { min-height: 90px; }
.brand-block h1 { font-size: 27px; line-height: 1.2; }
.eyebrow { letter-spacing: .16em; }
.top-actions { flex-wrap: wrap; justify-content: flex-end; }
.back-icon, .icon-button { border-radius: 9px; background: #101f3280; color: var(--muted); }
.button { color: var(--text); border-radius: 9px; background: var(--surface-2); }
.button.primary, .mobile-new-case { background: #7dbdff; border-color: #7dbdff; color: #081322; box-shadow: none; }
.button:hover:not(:disabled), .icon-button:hover { border-color: var(--gold); transform: none; background: var(--surface-3); color: var(--text); }
.button.primary:hover:not(:disabled) { background: #a3d0ff; color: #081322; }
.button.danger { color: var(--red); background: rgb(240 143 153 / 6%); border-color: rgb(240 143 153 / 25%); }
.button:focus-visible, .icon-button:focus-visible, a:focus-visible, summary:focus-visible, .year-tab:focus-visible, .summary-card:focus-visible, .case-open:focus-visible, .case-card:focus-visible, .text-button:focus-visible, .drawer-tabs button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
input, select, textarea, .master-toggle, .result-preview, .import-api-result { background: #0b192a; color: var(--text); }
input::placeholder, textarea::placeholder { color: var(--dim); }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
label { color: var(--muted); }
.dropdown, .auth-card { background: #101f32; }
.dropdown button { color: var(--text); }
.count-badge { color: var(--text); background: #244364; }
main { padding-top: 18px; }
.commission-pending-list { display: block; margin: 0 0 18px; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: #101f327d; }
.commission-pending-list summary { padding: 13px 16px; cursor: pointer; font-size: 13px; font-weight: 600; }
.commission-pending-list summary strong { color: var(--gold); margin-left: 6px; }
.commission-pending-list .commission-hint { margin: 0 16px 10px; color: var(--muted); font-size: 11px; }
#caseCommissionQueueList { padding: 0 12px 12px; display: grid; gap: 7px; }
.commission-pending-list a { padding: 11px 13px; border-color: var(--line); background: #14263c70; color: var(--text); font-size: 13px; }
.commission-pending-list a:hover { border-color: var(--gold); }
.commission-pending-list small { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.year-strip { margin-bottom: 12px; }
.year-tab { border-radius: 9px; }
.year-tab.active { background: #1b3652; color: #b5dcff; border-color: #476b91; }
.year-tab .lock { font-size: 11px; }
.summary-grid { gap: 12px; }
.summary-card { min-height: 98px; padding: 15px 18px; background: linear-gradient(130deg, #14263cb0, #101f3290); backdrop-filter: blur(12px); }
.summary-card::after { display: none; }
.summary-card:hover { border-color: var(--line-strong); background: var(--surface-2); }
.summary-card strong { font-size: 26px; letter-spacing: -.035em; margin: 9px 0 4px; }
.summary-card small { color: var(--dim); font-size: 11px; }
.register-panel { background: #101f32c9; box-shadow: none; }
.panel-head { padding: 18px 20px 15px; }
.panel-head h2 { font-size: 23px; }
.filters { background: #0c1b2d; flex-wrap: wrap; }
.search-field { min-width: 220px; }
.table-wrap { max-height: min(72vh, 960px); overscroll-behavior: contain; scrollbar-color: #476b91 #0c1b2d; }
.cases-table { min-width: 1100px; }
.cases-table th { background: #14263c; color: var(--muted); font-size: 10px; box-shadow: 0 1px var(--line); }
.cases-table th:nth-child(2) { width: 24%; }
.cases-table th:nth-child(3) { width: 11%; }
.cases-table th:nth-child(7) { width: 185px; }
.cases-table td { color: var(--text); border-bottom-color: #293d5375; height: 62px; }
.cases-table tbody tr:hover, .cases-table tbody tr:focus-within { background: #1b304870; }
.cases-table .client-name { color: var(--text); }
.cases-table .client-sub { font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.case-open { display: inline-flex; gap: 8px; align-items: center; padding: 7px 0; background: none; border: 0; cursor: pointer; color: var(--gold); }
.case-open > span:last-child { opacity: .45; transition: opacity .15s; }
tr:hover .case-open > span:last-child, .case-open:focus-visible > span:last-child { opacity: 1; }
.amount-pending { display: inline-block; font-size: 11px; font-weight: 500; padding: 5px 7px; border-radius: 6px; color: var(--muted); background: #91a5bc10; }
.status-badge { border-color: transparent; border-radius: 6px; font-size: 10px; padding: 5px 7px; }
.status-initiere, .status-in_desfasurare { color: var(--blue); background: #7dbdff12; }
.status-aprobat_asteptare_plata, .status-plata_partiala { color: var(--orange); background: #e8b77412; }
.status-anulat { color: var(--red); background: #f08f9912; }
.empty-state { gap: 8px; padding: 28px 16px; }
.empty-state strong { color: var(--text); }
.empty-state .button { justify-self: center; margin-top: 10px; }
.drawer { width: min(660px, 100%); background: #101f32f5; backdrop-filter: blur(18px); box-shadow: var(--shadow); }
.drawer-head { padding-bottom: 12px; gap: 16px; }
.drawer-head > div { min-width: 0; }
.drawer-head h2 { font-size: 25px; line-height: 1.25; overflow-wrap: anywhere; }
.drawer-context { padding: 0 24px; }
.drawer-context:empty { display: none; }
.drawer-context .client-sub { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.drawer-context .commission-actions { margin: 10px 0 16px; }
.drawer-metric { padding: 13px 12px; background: #14263c; }
.drawer-metric span { font-size: 10px; }
.drawer-metric strong { font-size: 16px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.drawer-tabs button { font-size: 12px; padding-block: 14px; }
.detail-block strong { color: var(--text); }
.drawer-actions { background: #0c1b2d; flex-wrap: wrap; gap: 8px; padding: 14px 20px; }
.drawer-actions .drawer-cancel { margin-right: auto; order: -1; }
.drawer-actions .primary { order: 2; }
.drawer-actions .button { flex-shrink: 0; }
.modal { background: #101f32f7; backdrop-filter: blur(16px); border-color: var(--line-strong); }
.modal::backdrop { background: #020b16a6; backdrop-filter: blur(5px); }
.modal-head h2 { font-size: 23px; }
.modal-body { min-height: 0; }
.modal-foot { flex-shrink: 0; background: #0c1b2d; }
.modal-head { flex-shrink: 0; }
.edit-section { padding: 0 0 18px; border-bottom: 1px solid var(--line); }
.edit-section:last-of-type { border-bottom: 0; padding-bottom: 0; }
.edit-section h3, .form-sections h3 { color: var(--text); font-size: 13px; font-weight: 650; }
.form-sections section { padding-block: 16px; }
.segmented { background: #0b192a; }
.segmented input:checked + span, .segmented button.active { background: #244364; color: var(--text); }
.segmented input:focus-visible + span { outline: 2px solid var(--gold); }
.balance-preview { align-items: center; color: var(--muted); }
.balance-preview strong { color: var(--text); font-size: 23px; font-variant-numeric: tabular-nums; }
.result-preview { border-color: var(--line-strong); color: var(--gold-2); }
.warning-box { color: #e8c590; font-size: 12px; }
.request-changes { grid-column: 1 / -1; display: grid; gap: 8px; margin: 0; padding: 12px; background: #0b192a; border-radius: 8px; }
.request-changes > div { display: flex; gap: 14px; flex-wrap: wrap; justify-content: space-between; }
.request-changes dt { color: var(--muted); font-size: 12px; }
.request-changes dd { margin: 0; overflow-wrap: anywhere; }
.request-changes dd span { color: var(--dim); }
.request-changes strong { color: var(--gold-2); }
.calc-group-title { grid-column: 1 / -1; margin: 7px 0 0; color: var(--muted); font-size: 12px; font-weight: 600; }
.calc-card { min-height: 92px; padding: 14px; }
.calc-card strong { font-size: 25px; font-variant-numeric: tabular-nums; letter-spacing: -.035em; margin-top: 10px; }
.calc-secondary { background: transparent; }
.calculator-filters #runCalculatorBtn { justify-self: start; }
.import-grid th, .request-item pre, .toast { background: #0c1b2d; color: var(--text); }
.drop-zone { border-color: var(--line-strong); background: #7dbdff05; }
.drop-zone.dragover { background: var(--gold-soft); }
@keyframes modal-appear { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.modal[open] { animation: modal-appear .16s ease-out; }
@media (max-width: 1120px) {
  .app-shell { padding-inline: 20px; }
  .topbar { flex-wrap: wrap; padding-block: 16px; }
  .top-actions { margin-left: auto; }
  #calculatorBtn { display: inline-flex; }
  .cases-table { min-width: 1000px; }
}
@media (max-width: 760px) {
  .app-shell { padding-inline: 12px; }
  .topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 8px; }
  .topbar > .gls-account { grid-column: 2; grid-row: 1; }
  .top-actions { grid-column: 1 / -1; grid-row: 2; width: 100%; margin-left: 0; justify-content: flex-start; }
  .top-actions #calculatorBtn, .top-actions #newCaseBtn { display: inline-flex; }
  .top-actions .button { font-size: 11px; padding-inline: 9px; }
  .brand-block h1 { font-size: 25px; }
  .summary-grid { grid-template-columns: 1fr; overflow: visible; gap: 8px; }
  .summary-card { min-height: 82px; padding: 12px 16px; }
  .summary-card strong { font-size: 24px; }
  .table-wrap { max-height: none; }
  .drawer { width: 100%; }
  .drawer-context { padding-inline: 18px; }
  .drawer-actions { overflow: visible; padding: 12px; }
  .drawer-actions .button { flex: 1 1 auto; }
  .drawer-metric strong { font-size: 14px; }
  .mobile-new-case { display: none; }
  .case-card { text-align: left; color: var(--text); }
  .case-card .client-sub { grid-column: 1 / -1; font-size: 11px; color: var(--muted); }
  .modal-head h2 { font-size: 22px; }
  .form-grid > label:last-child:nth-child(odd) { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) { .modal[open] { animation: none; } }
