/* ═══════════ VIRUS Dashboard ═══════════ */
:root {
  --bg: #f3f4f7; --surface: #ffffff; --surface-2: #f7f8fa; --surface-3: #eef0f4;
  --ink: #0f1115; --ink-2: #394050; --muted: #7b8293; --line: #e6e8ee; --line-2: #d7dbe3;
  --brand: #0b0b0d; --brand-ink: #ffffff; --gold: #a88147; --gold-2: #c9a46a; --gold-soft: #f6efe3;
  --blue: #2563eb; --blue-s: #e9f0ff; --green: #15924a; --green-s: #e5f5eb; --red: #d92d2d; --red-s: #fdeceb;
  --amber: #c27207; --amber-s: #fdf3e1; --purple: #7444e0; --purple-s: #f1ebfd; --teal: #0d8a80; --teal-s: #e1f4f2;
  --orange: #d9590b; --orange-s: #fdeee3; --gray: #677085; --gray-s: #eef0f3;
  --r: 14px; --r-sm: 10px;
  --sh: 0 1px 2px rgba(15, 17, 21, .04), 0 6px 20px rgba(15, 17, 21, .045);
  --sh-lg: 0 20px 60px rgba(15, 17, 21, .18);
  --side: 262px;
  --font: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0c0f; --surface: #14161b; --surface-2: #191c22; --surface-3: #20232b;
    --ink: #eef0f4; --ink-2: #c4c9d3; --muted: #8b92a1; --line: #23262e; --line-2: #2f333c;
    --brand: #000; --gold: #d0ab70; --gold-2: #e0c08a; --gold-soft: rgba(208, 171, 112, .12);
    --blue: #6b9bff; --blue-s: rgba(107, 155, 255, .13); --green: #3fca7c; --green-s: rgba(63, 202, 124, .13);
    --red: #ff6b6b; --red-s: rgba(255, 107, 107, .13); --amber: #f2b13c; --amber-s: rgba(242, 177, 60, .13);
    --purple: #a98bff; --purple-s: rgba(169, 139, 255, .14); --teal: #3cc9bc; --teal-s: rgba(60, 201, 188, .13);
    --orange: #ff9a52; --orange-s: rgba(255, 154, 82, .13); --gray: #a1a8b6; --gray-s: rgba(161, 168, 182, .12);
    --sh: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0c0f; --surface: #14161b; --surface-2: #191c22; --surface-3: #20232b;
  --ink: #eef0f4; --ink-2: #c4c9d3; --muted: #8b92a1; --line: #23262e; --line-2: #2f333c;
  --brand: #000; --gold: #d0ab70; --gold-2: #e0c08a; --gold-soft: rgba(208, 171, 112, .12);
  --blue: #6b9bff; --blue-s: rgba(107, 155, 255, .13); --green: #3fca7c; --green-s: rgba(63, 202, 124, .13);
  --red: #ff6b6b; --red-s: rgba(255, 107, 107, .13); --amber: #f2b13c; --amber-s: rgba(242, 177, 60, .13);
  --purple: #a98bff; --purple-s: rgba(169, 139, 255, .14); --teal: #3cc9bc; --teal-s: rgba(60, 201, 188, .13);
  --orange: #ff9a52; --orange-s: rgba(255, 154, 82, .13); --gray: #a1a8b6; --gray-s: rgba(161, 168, 182, .12);
  --sh: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
small, .muted { color: var(--muted); }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
.num, td.n, .tnum { font-variant-numeric: tabular-nums; }
.ltr { direction: ltr; unicode-bidi: embed; }
.cur { font-size: .78em; color: var(--muted); font-weight: 500; }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.grow { flex: 1; }
[hidden] { display: none !important; }
::selection { background: var(--gold-soft); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 2px solid var(--bg); }

/* boot */
.boot { height: 100vh; display: grid; place-items: center; align-content: center; gap: 18px; }
.boot img { width: 64px; opacity: .9; }
:root[data-theme="dark"] .boot img { filter: invert(1); }
.spin { width: 22px; height: 22px; border: 2.5px solid var(--line-2); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; margin: auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════ auth ═══════════ */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1.1fr; }
.auth-art { background: #070708; color: #fff; display: flex; flex-direction: column; justify-content: space-between; padding: 48px; position: relative; overflow: hidden; }
.auth-art::before { content: ''; position: absolute; inset: -30%; background: radial-gradient(circle at 70% 30%, rgba(201, 164, 106, .18), transparent 45%), radial-gradient(circle at 20% 80%, rgba(255, 255, 255, .06), transparent 40%); }
.auth-art > * { position: relative; }
.auth-art .big { width: min(300px, 70%); margin: auto; }
.auth-art p { color: #9a9ca3; margin: 0; font-size: 13px; }
.auth-form { display: grid; place-items: center; padding: 32px 20px; }
.auth-box { width: min(400px, 100%); }
.auth-box h1 { font-size: 26px; margin-bottom: 6px; }
.auth-box .sub { color: var(--muted); margin-bottom: 28px; }
.auth-box .field { margin-bottom: 14px; }
.auth-box .btn { width: 100%; justify-content: center; height: 46px; font-size: 15px; }
.auth-err { background: var(--red-s); color: var(--red); padding: 10px 14px; border-radius: var(--r-sm); margin-bottom: 14px; font-weight: 500; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth-art { min-height: 220px; padding: 28px; } .auth-art .big { width: 150px; } }

/* ═══════════ shell ═══════════ */
.app { display: flex; min-height: 100vh; }
.side { width: var(--side); flex: none; background: var(--brand); color: #c9cbd1; position: fixed; inset-block: 0; inset-inline-start: 0; display: flex; flex-direction: column; z-index: 40; transition: transform .25s ease; }
.side-logo { padding: 22px 22px 14px; display: flex; align-items: center; gap: 12px; }
.side-logo img { height: 40px; }
.side-logo .tag { font-size: 11px; color: #7f828b; line-height: 1.3; border-inline-start: 1px solid #26272c; padding-inline-start: 12px; }
.nav { flex: 1; overflow-y: auto; padding: 6px 12px 18px; scrollbar-width: thin; scrollbar-color: #2a2b30 transparent; }
.nav::-webkit-scrollbar-thumb { background: #2a2b30; border-color: var(--brand); }
.nav-g { font-size: 11px; color: #6c6f78; font-weight: 600; padding: 16px 12px 6px; letter-spacing: .02em; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 10px; color: #b9bcc4; font-weight: 500; font-size: 13.5px; position: relative; transition: background .15s, color .15s; }
.nav a:hover { background: #17181c; color: #fff; }
.nav a.on { background: #1c1d22; color: #fff; }
.nav a.on::before { content: ''; position: absolute; inset-inline-start: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--gold-2); }
.nav a.on svg { color: var(--gold-2); }
.nav a .cnt { margin-inline-start: auto; background: #26272d; color: #e6e7ea; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 20px; min-width: 24px; text-align: center; }
.nav a .cnt.hot { background: var(--gold-2); color: #1a1408; }
.side-user { margin: 10px 12px 14px; padding: 10px; border-radius: 12px; background: #141518; display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #2a2b31, #3a3b42); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.side-user .who { min-width: 0; flex: 1; }
.side-user .who b { display: block; color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .who small { color: #7f828b; font-size: 11.5px; }
.side-user button { background: none; border: 0; color: #8d9099; cursor: pointer; padding: 6px; border-radius: 8px; display: grid; }
.side-user button:hover { color: #fff; background: #222328; }

.main { flex: 1; margin-inline-start: var(--side); min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; height: 64px; display: flex; align-items: center; gap: 14px; padding: 0 28px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.top h1 { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .crumb { font-size: 12px; color: var(--muted); display: block; font-weight: 500; }
.top .gsearch { margin-inline-start: auto; position: relative; width: min(340px, 34vw); }
.top .gsearch input { width: 100%; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); padding: 0 40px 0 14px; outline: none; transition: border-color .15s, box-shadow .15s; }
.top .gsearch input:focus { border-color: var(--ink-2); box-shadow: 0 0 0 4px var(--surface-3); }
.top .gsearch svg { position: absolute; right: 12px; top: 11px; color: var(--muted); }
.menu-btn { display: none !important; }
#view { padding: 24px 28px 60px; flex: 1; width: 100%; max-width: 1680px; margin-inline: auto; }
.scrim { display: none; }
@media (max-width: 1100px) {
  .side { transform: translateX(100%); }
  .app.nav-open .side { transform: none; box-shadow: var(--sh-lg); }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 35; }
  .main { margin-inline-start: 0; }
  .menu-btn { display: inline-flex !important; }
  .top { padding: 0 16px; }
  #view { padding: 16px 16px 60px; }
  .top .gsearch { width: auto; flex: 1; max-width: 300px; }
}
@media (max-width: 560px) { .top .gsearch { display: none; } .hide-sm { display: none; } .top { gap: 8px; } }

/* ═══════════ primitives ═══════════ */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 15px; border-radius: 11px; border: 1px solid transparent; background: var(--surface-3); color: var(--ink); cursor: pointer; font-weight: 600; font-size: 13.5px; white-space: nowrap; transition: transform .08s, background .15s, border-color .15s, opacity .15s; user-select: none; }
.btn:hover { background: var(--line); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.primary { background: var(--ink); color: var(--bg); }
.btn.primary:hover { opacity: .88; }
.btn.gold { background: var(--gold); color: #fff; }
.btn.gold:hover { background: var(--gold-2); }
.btn.ghost { background: var(--surface); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--line-2); background: var(--surface-2); }
.btn.danger { background: var(--red-s); color: var(--red); }
.btn.danger:hover { background: var(--red); color: #fff; }
.btn.success { background: var(--green); color: #fff; }
.btn.blue { background: var(--blue); color: #fff; }
.btn.sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; gap: 6px; }
.btn.sm svg.i { width: 16px; height: 16px; }
.btn.icon { width: 38px; padding: 0; justify-content: center; }
.btn.icon.sm { width: 32px; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 15px; }
.btn.block { width: 100%; justify-content: center; }
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after { content: ''; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; border: 2px solid currentColor; border-color: var(--muted) var(--muted) var(--muted) transparent; border-radius: 50%; animation: spin .7s linear infinite; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); }
.card.pad { padding: 20px; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-h h3 { font-size: 15px; }
.card-h .sub { font-size: 12px; color: var(--muted); }
.card-b { padding: 18px 20px; }
.sec-title { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; margin: 0 0 14px; }
.sec-title svg { color: var(--gold); }

.ph { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.ph h2 { font-size: 22px; }
.ph p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.ph .acts { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1280px) { .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-2-1, .g3 { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .g2, .g4, .g5 { grid-template-columns: 1fr; } }
.mt { margin-top: 16px; }
.mt2 { margin-top: 24px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-amber { background: var(--amber-s); color: var(--amber); } .b-purple { background: var(--purple-s); color: var(--purple); }
.b-blue { background: var(--blue-s); color: var(--blue); } .b-green { background: var(--green-s); color: var(--green); }
.b-red { background: var(--red-s); color: var(--red); } .b-teal { background: var(--teal-s); color: var(--teal); }
.b-gray { background: var(--gray-s); color: var(--gray); } .b-orange { background: var(--orange-s); color: var(--orange); }
.b-gold { background: var(--gold-soft); color: var(--gold); }
.tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 6px; background: var(--surface-3); color: var(--ink-2); font-weight: 600; }
.tag.g { background: var(--green-s); color: var(--green); } .tag.r { background: var(--red-s); color: var(--red); } .tag.b { background: var(--blue-s); color: var(--blue); } .tag.o { background: var(--gold-soft); color: var(--gold); }

/* form */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field small { font-size: 11.5px; }
.req { color: var(--red); margin-inline-start: 3px; }
:where(input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea) {
  height: 40px; border: 1px solid var(--line-2); background: var(--surface); border-radius: 10px; padding: 0 12px; outline: none; width: 100%; min-width: 0; transition: border-color .15s, box-shadow .15s; }
:where(textarea) { height: auto; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--ink-2) !important; box-shadow: 0 0 0 4px var(--surface-3); }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--ink); cursor: pointer; }
select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237b8293' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 12px center; padding-left: 32px !important; }
input[type=date] { direction: ltr; text-align: right; }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.fgrid .full { grid-column: 1 / -1; }
.fgrid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fgrid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 720px) { .fgrid, .fgrid.c3, .fgrid.c4 { grid-template-columns: 1fr; } }
.fsec { grid-column: 1 / -1; font-weight: 700; font-size: 13px; padding-top: 8px; border-top: 1px dashed var(--line-2); margin-top: 4px; color: var(--gold); }
.fsec:first-child { border: 0; padding-top: 0; margin-top: 0; }
.fcheck { display: flex; align-items: center; gap: 9px; cursor: pointer; font-weight: 500; min-height: 40px; }
.imgup { display: flex; align-items: center; gap: 12px; }
.imgprev { width: 64px; height: 64px; border-radius: 12px; background: var(--surface-3); display: grid; place-items: center; overflow: hidden; color: var(--muted); flex: none; }
.imgprev img { width: 100%; height: 100%; object-fit: cover; }

/* toast */
.toasts { position: fixed; bottom: 20px; left: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 12px; box-shadow: var(--sh-lg); font-weight: 500; display: flex; gap: 10px; align-items: center; max-width: 380px; animation: tin .25s ease; }
.toast.err { background: var(--red); color: #fff; }
.toast.ok svg { color: var(--green); }
@keyframes tin { from { transform: translateY(10px); opacity: 0; } }

/* modal */
.mwrap { position: fixed; inset: 0; background: rgba(10, 11, 14, .5); z-index: 100; display: grid; place-items: center; padding: 20px; opacity: 0; transition: opacity .18s; backdrop-filter: blur(2px); }
.mwrap.in { opacity: 1; }
.modal { background: var(--surface); border-radius: 18px; width: min(640px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: var(--sh-lg); transform: translateY(8px) scale(.99); transition: transform .18s; border: 1px solid var(--line); }
.mwrap.in .modal { transform: none; }
.modal.sm { width: min(420px, 100%); }
.modal.lg { width: min(920px, 100%); }
.modal.xl { width: min(1180px, 100%); }
.mh { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.mh h3 { font-size: 16px; flex: 1; }
.mb { padding: 20px; overflow-y: auto; }
.mf { display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 18px 18px; flex-direction: row; }
.lead { font-size: 15px; margin: 0; }

/* tables */
.tcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); overflow: hidden; }
.tbar { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tbar select, .tbar input[type=date] { height: 36px; width: auto; min-width: 120px; font-size: 13px; }
.search { position: relative; flex: 0 1 280px; min-width: 180px; }
.search input { height: 36px !important; padding-right: 36px !important; font-size: 13px; }
.search svg { position: absolute; right: 11px; top: 9px; color: var(--muted); width: 17px; height: 17px; }
.twrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl th { text-align: right; font-weight: 600; font-size: 12px; color: var(--muted); padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; user-select: none; }
.tbl th.s { cursor: pointer; }
.tbl th.s:hover { color: var(--ink); }
.tbl th .ar { opacity: .7; font-size: 10px; margin-inline-start: 4px; }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr { transition: background .1s; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr.sel { background: var(--gold-soft); }
.tbl tbody tr.click { cursor: pointer; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tfoot td { background: var(--surface-2); font-weight: 700; border-top: 1px solid var(--line); border-bottom: 0; }
.tbl .ck { width: 38px; text-align: center; }
.tbl .acts { white-space: nowrap; text-align: left; width: 1%; }
.tbl .acts .btn { opacity: .85; }
.tbl td.n, .tbl th.n { text-align: left; white-space: nowrap; }
.tbl .strong { font-weight: 700; }
.tbl .t2 { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.tbl .thumb { width: 38px; height: 38px; border-radius: 9px; object-fit: cover; background: var(--surface-3); display: block; }
.tbl .thumb.ph { display: grid; place-items: center; color: var(--muted); }
.tbl .items { max-width: 240px; font-size: 12.5px; line-height: 1.45; }
.tbl.compact td { padding: 8px 10px; }
.tsel { display: flex; align-items: center; gap: 8px; background: var(--gold-soft); padding: 4px 6px 4px 12px; border-radius: 10px; font-weight: 600; font-size: 13px; color: var(--gold); flex-wrap: wrap; }
.pager { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.pager .pg { display: flex; gap: 4px; margin-inline-start: auto; align-items: center; }
.pager button { height: 30px; min-width: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; padding: 0 9px; font-weight: 600; font-size: 12px; }
.pager button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pager button:disabled { opacity: .4; cursor: default; }
.pager select { height: 30px; width: auto; font-size: 12px; padding: 0 8px; }
.tsum { display: flex; gap: 22px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface-2); flex-wrap: wrap; font-size: 13px; }
.tsum b { font-size: 14px; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty svg { width: 42px; height: 42px; stroke-width: 1.3; margin-bottom: 8px; opacity: .6; }
.empty b { display: block; color: var(--ink-2); font-size: 15px; margin-bottom: 4px; }

/* tabs */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; margin-bottom: 14px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 13px; white-space: nowrap; color: var(--ink-2); transition: all .15s; }
.tab:hover { border-color: var(--line-2); }
.tab.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tab .c { font-size: 11.5px; padding: 0 7px; border-radius: 10px; background: var(--surface-3); color: var(--ink-2); min-width: 22px; text-align: center; }
.tab.on .c { background: rgba(255, 255, 255, .18); color: inherit; }
.tab .dot { width: 8px; height: 8px; border-radius: 50%; }
.seg { display: inline-flex; background: var(--surface-3); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; height: 32px; padding: 0 13px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 12.5px; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }

/* KPI */
.kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; position: relative; overflow: hidden; }
.kpi .kh { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 600; font-size: 13px; }
.kpi .ico { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.kpi .v { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi .v small { font-size: 13px; font-weight: 500; }
.kpi .ft { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.up { color: var(--green); font-weight: 600; } .down { color: var(--red); font-weight: 600; }
.ico.amber { background: var(--amber-s); color: var(--amber); } .ico.blue { background: var(--blue-s); color: var(--blue); }
.ico.green { background: var(--green-s); color: var(--green); } .ico.red { background: var(--red-s); color: var(--red); }
.ico.purple { background: var(--purple-s); color: var(--purple); } .ico.teal { background: var(--teal-s); color: var(--teal); }
.ico.gold { background: var(--gold-soft); color: var(--gold); } .ico.gray { background: var(--gray-s); color: var(--gray); }
.ico.orange { background: var(--orange-s); color: var(--orange); } .ico.ink { background: var(--ink); color: var(--bg); }

/* hero */
.hero { background: #08080a; color: #fff; border-radius: 18px; padding: 22px 26px; display: flex; align-items: center; gap: 22px; position: relative; overflow: hidden; margin-bottom: 18px; flex-wrap: wrap; }
.hero::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 15% 50%, rgba(201, 164, 106, .22), transparent 40%); pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.hero img { height: 54px; }
.hero h2 { font-size: 20px; }
.hero p { color: #a1a3aa; margin: 2px 0 0; font-size: 13px; }
.hero .acts { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.hero .btn.ghost { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .12); color: #fff; }
.hero .btn.ghost:hover { background: rgba(255, 255, 255, .14); }

/* pipeline */
.pipe { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }

@media (max-width: 640px) { .pipe { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pipe a { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; display: flex; flex-direction: column; gap: 6px; transition: transform .15s, box-shadow .15s, border-color .15s; position: relative; overflow: hidden; }
.pipe a:hover { transform: translateY(-2px); box-shadow: var(--sh); border-color: var(--line-2); }
.pipe a::before { content: ''; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 3px; background: var(--c); }
.pipe .pt { font-size: 12px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.pipe .pt svg { width: 15px; height: 15px; color: var(--c); }
.pipe .pv { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* charts */
.chart { position: relative; direction: ltr; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); padding: 8px 11px; border-radius: 10px; font-size: 12px; white-space: nowrap; transform: translate(-50%, -110%); opacity: 0; transition: opacity .1s; direction: rtl; box-shadow: var(--sh-lg); z-index: 3; }
.chart .tip b { display: block; margin-bottom: 2px; }
.chart .tip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-left: 6px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); font-weight: 500; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 6px; vertical-align: -1px; }
.donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; justify-content: center; }
.donut-legend { display: grid; gap: 7px; font-size: 12.5px; flex: 1; min-width: 160px; }
.donut-legend div { display: flex; align-items: center; gap: 8px; }
.donut-legend i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.donut-legend b { margin-inline-start: auto; font-variant-numeric: tabular-nums; }
.hbars { display: grid; gap: 12px; }
.hbar .hl { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 5px; }
.hbar .hl span { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .hl b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbar .tr { height: 7px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.hbar .tr i { display: block; height: 100%; border-radius: 6px; background: var(--c, var(--ink)); }
.ring { position: relative; display: inline-grid; place-items: center; }
.ring b { position: absolute; font-size: 15px; }

/* lists */
.list { display: grid; }
.li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.li:last-child { border: 0; }
.li .grow { min-width: 0; }
.li .t1 { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .t2 { font-size: 12px; color: var(--muted); }

/* orders filters */
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; padding: 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.filters .field > span { font-size: 11.5px; }
.filters input, .filters select { height: 36px !important; font-size: 13px; }
.bulk { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--gold-soft); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.bulk b { color: var(--gold); margin-inline-end: 6px; }
.bulk select { height: 32px; width: auto; font-size: 12.5px; }

/* order form */
.oform { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
@media (max-width: 1150px) { .oform { grid-template-columns: 1fr; } }
.oform .card + .card { margin-top: 16px; }
.oform h4 { display: flex; align-items: center; gap: 9px; font-size: 14.5px; margin-bottom: 16px; }
.oform h4 svg { color: var(--gold); }
.osum { position: sticky; top: 82px; }
.osum .ln { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; font-size: 13.5px; gap: 10px; }
.osum .ln input { width: 130px; height: 34px; text-align: left; }
.osum .tot { border-top: 1px dashed var(--line-2); margin-top: 8px; padding-top: 14px; }
.osum .tot b { font-size: 26px; font-variant-numeric: tabular-nums; }
.osum .acts { display: grid; gap: 8px; margin-top: 16px; }
.cinfo { margin-top: 12px; padding: 12px 14px; border-radius: 12px; font-size: 13px; display: flex; gap: 10px; align-items: flex-start; }
.cinfo.warn { background: var(--amber-s); color: var(--amber); }
.cinfo.bad { background: var(--red-s); color: var(--red); }
.cinfo.ok { background: var(--blue-s); color: var(--blue); }
.cinfo .btn { margin-inline-start: auto; }
.psearch { position: relative; }
.psearch input { height: 46px !important; padding-right: 42px !important; font-size: 14px; border-radius: 12px !important; }
.psearch > svg { position: absolute; right: 13px; top: 14px; color: var(--muted); }
.pdrop { position: absolute; inset-inline: 0; top: 52px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--sh-lg); z-index: 20; max-height: 360px; overflow-y: auto; padding: 6px; }
.pdrop .po { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.pdrop .po:hover, .pdrop .po.on { background: var(--surface-3); }
.pdrop img, .pdrop .noimg, .oline img, .oline .noimg { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; background: var(--surface-3); flex: none; display: grid; place-items: center; color: var(--muted); }
.pdrop .po .grow { min-width: 0; }
.olines { margin-top: 14px; display: grid; gap: 8px; }
.oline { display: grid; grid-template-columns: 42px minmax(0, 1fr) 120px 120px 110px 34px; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.oline .nm { font-weight: 600; min-width: 0; }
.oline .nm small { display: block; font-weight: 500; }
.oline input { height: 36px; text-align: center; }
.oline .lt { font-weight: 700; text-align: left; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .oline { grid-template-columns: 42px 1fr 90px 34px; } .oline .pr, .oline .lt { display: none; } }
.stepper { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: var(--surface); height: 36px; }
.stepper button { width: 32px; height: 100%; border: 0; background: none; cursor: pointer; font-size: 16px; color: var(--ink-2); }
.stepper button:hover { background: var(--surface-3); }
.stepper input { border: 0 !important; height: 100% !important; border-radius: 0 !important; padding: 0 !important; text-align: center; box-shadow: none !important; }

/* order detail */
.od-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.od-head .bc svg { height: 46px; width: auto; }
:root[data-theme="dark"] .od-head .bc, :root[data-theme="dark"] .bcwrap { background: #fff; padding: 4px 6px; border-radius: 6px; }
.od-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
@media (max-width: 700px) { .od-grid { grid-template-columns: 1fr 1fr; } }
.od-grid div { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.od-grid small { display: block; font-size: 11.5px; }
.od-grid b { font-weight: 600; font-size: 13.5px; word-break: break-word; }
.timeline { display: grid; gap: 0; }
.tl { display: flex; gap: 12px; position: relative; padding-bottom: 14px; }
.tl::before { content: ''; position: absolute; right: 7px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.tl:last-child::before { display: none; }
.tl i { width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 3px solid var(--c, var(--line-2)); flex: none; margin-top: 2px; }
.tl .tt { font-weight: 600; font-size: 13px; }
.tl .ts { font-size: 12px; color: var(--muted); }

/* scan */
.scanbox { padding: 26px; text-align: center; }
.scanbox input { height: 64px !important; font-size: 26px; text-align: center; letter-spacing: .08em; font-weight: 700; border-radius: 16px !important; border-width: 2px !important; direction: ltr; }
.scanbox .hint { color: var(--muted); margin-top: 10px; font-size: 13px; }
.scanlog .li { padding: 12px 16px; }
.scanlog .li.err { background: var(--red-s); }
.scanlog .li.ok:first-child { background: var(--green-s); }
.scanlog .li.wait { background: var(--gold-soft); }
.flash-ok { animation: fok .6s; } .flash-err { animation: ferr .6s; }
@keyframes fok { 0% { box-shadow: 0 0 0 0 var(--green); } 100% { box-shadow: 0 0 0 18px transparent; } }
@keyframes ferr { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* drop zone */
.drop { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; border: 2px dashed var(--line-2); border-radius: 16px; padding: 40px 20px; text-align: center; cursor: pointer; transition: all .15s; background: var(--surface); }
.drop:hover, .drop.over { border-color: var(--gold); background: var(--gold-soft); }
.drop svg { width: 40px; height: 40px; color: var(--gold); stroke-width: 1.4; }
.drop b { display: block; font-size: 16px; margin: 8px 0 4px; }
.steps { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.steps span { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; color: var(--muted); }
.steps span i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font-style: normal; font-size: 12px; }
.steps span.on { color: var(--ink); } .steps span.on i { background: var(--ink); color: var(--bg); }
.steps span + span::before { content: ''; width: 28px; height: 2px; background: var(--line-2); }

/* courier cards */
.ccard { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.ccard .top2 { display: flex; align-items: center; gap: 12px; }
.ccard .logo { width: 46px; height: 46px; border-radius: 13px; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-weight: 700; font-size: 18px; flex: none; }
.ccard .st { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ccard .st div { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.ccard .st small { display: block; font-size: 11px; }
.ccard .st b { font-size: 15px; font-variant-numeric: tabular-nums; }
.ccard .conn { font-size: 12.5px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); }
.ccard .row .btn { flex: 1; justify-content: center; }
.code { font-family: Consolas, monospace; font-size: 12px; direction: ltr; text-align: left; background: var(--surface-3); padding: 8px 10px; border-radius: 8px; word-break: break-all; display: block; }
textarea.code-in { font-family: Consolas, monospace; font-size: 12px; direction: ltr; text-align: left; }

/* rep cards */
.rcard { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.rcard .top2 { display: flex; align-items: center; gap: 12px; }
.rcard .avatar { width: 44px; height: 44px; border-radius: 13px; font-size: 17px; background: var(--gold-soft); color: var(--gold); }
.rcard .due { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; }
.rcard .due b { font-size: 22px; font-variant-numeric: tabular-nums; }
.rcard .mini { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.rcard .mini b { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
.rcard .mini small { font-size: 11px; }

/* report layout */
.rep-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .rep-layout { grid-template-columns: 1fr; } }
.rep-nav { padding: 8px; position: sticky; top: 82px; }
.rep-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; font-weight: 500; font-size: 13.5px; color: var(--ink-2); }
.rep-nav a:hover { background: var(--surface-2); }
.rep-nav a.on { background: var(--ink); color: var(--bg); }
.presets { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* misc */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.note { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: 13px; color: var(--ink-2); display: flex; gap: 10px; }
.note svg { color: var(--gold); flex: none; margin-top: 2px; }
.note.warn { background: var(--amber-s); color: var(--amber); } .note.warn svg { color: inherit; }
.pill-sum { display: flex; gap: 10px; flex-wrap: wrap; }
.pill-sum div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; min-width: 140px; }
.pill-sum small { display: block; font-size: 11.5px; }
.pill-sum b { font-size: 17px; font-variant-numeric: tabular-nums; }
.neg { color: var(--red); } .pos { color: var(--green); }
.loader { padding: 80px; display: grid; place-items: center; }
.dropdown { position: relative; }
.menu { position: absolute; top: calc(100% + 6px); inset-inline-end: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh-lg); padding: 6px; min-width: 200px; z-index: 50; }
.menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; font-weight: 500; text-align: right; font-size: 13px; }
.menu button:hover { background: var(--surface-2); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.bcwrap svg { height: 40px; width: auto; display: block; }
.prod-cell { display: flex; align-items: center; gap: 10px; }
.prod-cell .grow { min-width: 0; }
.low { color: var(--red); font-weight: 700; }
