:root {
  color-scheme: light;
  --bg:#f6f7fb; --surface:#fff; --surface-muted:#fafbfe; --ink:#182036;
  --muted:#58647a; --line:#dfe4ee; --accent:#4a3ed0; --accent-hover:#3a2fb5;
  --accent-soft:#eeedff; --radius:14px; --shadow:0 1px 2px #18203609;
  font: 15px/1.6 system-ui, "Segoe UI", Tahoma, sans-serif;
  color:var(--ink); background:var(--bg);
}
*,*::before,*::after { box-sizing:border-box }
body { margin:0 }
a { color:var(--accent); text-underline-offset:.2em }
a,button,input,select,textarea,summary { transition:background-color .2s,color .2s,border-color .2s,box-shadow .2s }
:focus-visible { outline:3px solid #7568eb; outline-offset:3px }
h1,h2,p { margin:0 }
h1 { font-size:clamp(1.7rem,3vw,2.55rem); font-weight:680; line-height:1.23 }
h2 { font-size:1.12rem; font-weight:680; line-height:1.4 }
p { margin-block:.55rem }
bdi,td { overflow-wrap:anywhere }
.layout { display:grid; grid-template-columns:15.25rem minmax(0,1fr); min-height:100vh; align-items:start }
.sidebar { position:sticky; top:0; display:flex; flex-direction:column; gap:1.7rem; min-height:100vh; max-height:100vh; overflow:auto; padding:1.4rem 1rem; background:var(--surface); border-inline-end:1px solid var(--line) }
.identity { display:flex; align-items:center; gap:.7rem; padding:.35rem .5rem }
.identity strong,.identity small,.account-chip strong,.account-chip small { display:block; overflow-wrap:anywhere }
.identity small,.account-chip small { color:var(--muted); font-size:.8rem }
.mark { display:grid; place-items:center; flex:none; width:2.5rem; height:2.5rem; background:var(--accent); color:#fff; border-radius:.68rem; font-weight:700 }
.sidebar nav { display:grid; gap:.3rem }
.sidebar nav a { display:flex; align-items:center; gap:.63rem; min-height:2.68rem; padding:.5rem .7rem; border-radius:.58rem; text-decoration:none; color:var(--muted); font-weight:560 }
.sidebar nav a span { display:grid; place-items:center; width:1.25rem; height:1.25rem; flex:none }
.sidebar nav a:hover,.sidebar nav a[aria-current] { background:var(--accent-soft); color:var(--accent-hover) }
.sidebar nav a[aria-current] { font-weight:680 }
.sidebar-tools { display:flex; flex-wrap:wrap; gap:.5rem; margin-block-start:auto; padding-block-start:.85rem; border-block-start:1px solid var(--line) }
.account-chip { flex-basis:100%; padding:.15rem .55rem .4rem }
.sidebar-tools button { color:var(--ink); background:var(--surface-muted); border-color:var(--line); font-size:.85rem }
.sidebar-tools button:hover { background:var(--accent-soft); color:var(--accent-hover) }
main { width:100%; max-width:1520px; margin-inline:auto; padding:2.55rem clamp(1.25rem,4vw,3.5rem) }
.heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:.85rem; margin-block-end:1.4rem; padding-block-end:1.03rem; border-block-end:1px solid var(--line) }
.auth-layout { grid-template-columns:minmax(13rem,30%) minmax(0,1fr) }
.auth-layout .sidebar { background:var(--accent-soft) }
.sign-in { max-width:520px; margin-block-start:10vh }
.sign-in .heading { border:0; padding:0 }
button,.action-link { display:inline-flex; justify-content:center; align-items:center; gap:.38rem; border:1px solid transparent; border-radius:.58rem; padding:.5rem .85rem; min-height:2.55rem; font:inherit; font-weight:630; line-height:1.25; text-decoration:none; cursor:pointer }
button,.quick-actions .action-link:last-child { color:#fff; background:var(--accent) }
button:hover,.quick-actions .action-link:last-child:hover { background:var(--accent-hover) }
.action-link { color:var(--accent-hover); border-color:#deddf5; background:#f4f3fe }
.action-link:hover { background:#e9e6ff; border-color:#c5bdf8 }
button:active,.action-link:active { transform:translateY(1px) }
td .action-link { min-height:2rem; padding:.3rem .58rem; font-size:.88rem }
.overview,.record-toolbar,.quick-actions,.panel-head,.brand,.filters { display:flex; flex-wrap:wrap; align-items:center; gap:.7rem }
.overview,.panel-head { justify-content:space-between }
.overview { color:#fff; background:linear-gradient(115deg,#25224a,#4135aa); border-radius:var(--radius); padding:clamp(1rem,3vw,1.8rem); margin-block-end:1.4rem }
.overview h2 { font-size:clamp(1.3rem,2.5vw,1.85rem) }
.overview p { color:#e0ddff; margin-block-end:0 }
.overview .quick-actions .action-link:last-child { background:#fff; color:var(--accent-hover) }
.overview .quick-actions .action-link:last-child:hover { background:var(--accent-soft) }
.record-toolbar,.panel-head { margin-block-end:.9rem }
.dashboard-grid,.field-grid,.account-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1rem }
.dashboard-grid { grid-template-columns:minmax(0,1.2fr) minmax(0,1fr); margin-block:1rem }
.account-grid { max-width:1080px }
.cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,10.75rem),1fr)); gap:.75rem; margin-block:.85rem }
.card,.panel,.editor,.overflow,.list-toolbar { min-width:0; background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow) }
.card,.panel { padding:1rem 1.12rem }
.card { color:var(--ink); text-decoration:none }
.card:is(a):hover { border-color:#b7adfa; background:#faf9ff }
.card span,dt { color:var(--muted); font-size:.88rem }
.card strong,dd { display:block; margin:0; font-weight:650; overflow-wrap:anywhere }
.card strong { font-size:1.32rem; font-variant-numeric:tabular-nums }
.finance .cards { grid-template-columns:repeat(2,minmax(0,1fr)); margin:0; gap:.55rem }
.finance .card { padding:.65rem; background:var(--surface-muted) }
.finance .card strong { font-size:1.04rem }
.inventory-list { list-style:none; margin:0; padding:0 }
.inventory-list li { display:grid; grid-template-columns:minmax(0,1fr) auto auto; align-items:center; gap:.55rem; padding:.65rem 0; border-block-end:1px solid var(--line) }
.inventory-list li:last-child { border:0 }
.inventory-list small { display:block; margin-block-start:.25rem; color:var(--muted); overflow-wrap:anywhere }
.editor { display:grid; gap:.92rem; max-width:760px; margin-block:.8rem; padding:clamp(1rem,3vw,1.45rem) }
.editor button { justify-self:start }
label { display:grid; gap:.34rem; min-width:0; font-weight:600 }
label.check { display:flex; align-items:center }
input,textarea,select { min-width:0; width:100%; padding:.55rem .65rem; font:inherit; color:var(--ink); border:1px solid #cbd3e2; border-radius:.52rem; background:var(--surface) }
input,select { min-height:2.65rem }
input[type=checkbox] { width:1.08rem; min-height:0; height:1.08rem; margin:0; accent-color:var(--accent) }
textarea { min-height:6rem }
.status-controls { display:flex; flex-wrap:wrap; gap:.85rem; background:var(--surface-muted); padding:.75rem; border:1px solid var(--line); border-radius:.65rem }
.filters { align-items:end }
.filters label { flex:0 1 10rem }
.list-toolbar { display:flex; align-items:end; justify-content:space-between; flex-wrap:wrap; gap:.75rem; padding:.85rem; margin-block:1rem }
.list-toolbar.filters { justify-content:flex-start }
.sale-detail { max-width:900px; margin-block-end:.9rem }
.sale-detail summary { cursor:pointer; font-weight:650 }
.error,.notice,.empty { padding:.8rem 1rem; border:1px solid var(--line); border-radius:.65rem }
.error { color:#8b2030; background:#fff2f4; border-color:#f1c4ce }
.notice { color:#15533d; background:#e9f8ef; border-color:#bde2cb }
.empty { color:var(--muted); background:var(--surface); margin-block:.9rem }
.chart { margin-block:1rem }
.chart > div { display:grid; grid-template-columns:4.5rem minmax(0,1fr) minmax(5.5rem,auto); gap:.55rem; align-items:center }
meter { width:100%; accent-color:var(--accent) }
.overflow { overflow-x:auto; margin-block:.7rem 1.25rem }
table { border-collapse:collapse; width:100%; min-width:440px }
th,td { text-align:start; padding:.77rem .85rem; border-block-end:1px solid var(--line); vertical-align:middle }
th { color:#414e65; font-size:.84rem; background:#f0f2f9 }
tr:last-child td { border:0 }
tbody tr:nth-child(even) { background:var(--surface-muted) }
tbody tr:hover { background:#f5f4ff }
.country,.badge { display:inline-flex; align-items:center; gap:.36rem; vertical-align:middle }
.country img { object-fit:cover; border-radius:3px; box-shadow:0 0 0 1px #27314228 }
.badge { border-radius:999px; padding:.17rem .51rem; background:#edf0f8; color:#384b70; font-size:.78rem; font-weight:670 }
.badge-done { background:#ddf5e8; color:#14523a }
.badge-pending { background:#ffebe5; color:#872e1c }
.brand img,.logo { max-height:3.6rem; max-width:9rem; object-fit:contain }
.contact-line { color:var(--muted) }
@media(max-width:985px) { .dashboard-grid { grid-template-columns:1fr } }
@media(max-width:760px) {
  .layout,.auth-layout { display:block }
  .sidebar { position:relative; min-height:0; max-height:none; gap:.65rem; padding:.7rem .9rem; border-inline-end:0; border-block-end:1px solid var(--line) }
  .sidebar nav { display:flex; flex-wrap:wrap }
  .sidebar nav a { min-height:2.2rem; padding:.35rem .55rem; font-size:.85rem }
  .sidebar-tools { padding-block-start:.48rem }
  .account-chip { display:none }
  main { padding:1.25rem 1rem }
  .sign-in { margin-block-start:4vh }
  .account-grid { grid-template-columns:1fr }
  .cards { grid-template-columns:repeat(2,minmax(0,1fr)) }
}
@media(max-width:420px) { .field-grid { grid-template-columns:1fr } .filters label { flex:1 1 8rem } .overview .quick-actions { width:100% } }
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { transition:none!important } }
@page { size:A4 portrait; margin:11mm }
@media print {
  :root,body { background:#fff; color:#111; font-size:10pt }
  .screen { display:none!important }
  .layout { display:block; min-height:0 }
  main { padding:0; max-width:none }
  .heading { margin-block-end:.5rem }
  .overflow { overflow:visible; border:0; box-shadow:none }
  table { min-width:0; table-layout:fixed; font-size:8pt }
  thead { display:table-header-group }
  th,td { padding:1.6mm 1mm; overflow-wrap:anywhere }
  tr,.brand,.card { break-inside:avoid }
  h1,h2 { break-after:avoid }
  .cards { grid-template-columns:repeat(3,minmax(0,1fr)) }
  .card { padding:.35rem; box-shadow:none }
  .action-link { display:inline; padding:0; border:0; background:none!important; color:inherit; font-weight:inherit }
  .country,.badge { display:inline; print-color-adjust:exact }
  .country img { width:15px; height:11px; vertical-align:middle; margin-inline-end:2px }
}
.sale-layout{display:grid;grid-template-columns:minmax(0,3fr) minmax(13rem,1.2fr);align-items:start;gap:1.15rem}
.sale-layout .editor{max-width:none;margin:0}
.sale-context dl{margin:0}
.sale-context dd{margin-top:.4rem}
.sale-context .sale-detail{margin-top:1rem;margin-bottom:0;border-top:1px solid var(--line);padding-top:.6rem}
.sale-context .cards{grid-template-columns:repeat(auto-fit,minmax(min(100%,8rem),1fr))}
.sale-context .card{padding:.55rem}
.sale-footer{display:flex;justify-content:flex-end;border-block-start:1px solid var(--line);padding-block-start:.8rem}
.status-controls{margin:0;min-inline-size:0}
.status-controls legend{padding-inline:.3rem;font-weight:650}
.field-error{color:#8b2030;font-size:.84rem}
select[aria-invalid=true]{border-color:#b8495a;background:#fff6f7}
@media(max-width:990px){.sale-layout{grid-template-columns:minmax(0,1fr)}.sale-context{grid-row:1}}
@media(max-width:420px){.sale-footer button{width:100%}}
