/* Orgif ServiceDesk — design system */
:root {
  --brand: #4f46e5; --brand-2: #06b6d4; --brand-soft: #eef2ff; --brand-ink: #3730a3;
  --bg: #f4f6fb; --panel: #ffffff; --panel-2: #f8fafc; --line: #e6e8f0; --line-2: #eef0f6;
  --ink: #0f172a; --ink-2: #334155; --muted: #64748b; --faint: #94a3b8;
  --ok: #10b981; --ok-soft: #ecfdf5; --warn: #f59e0b; --warn-soft: #fffbeb; --bad: #ef4444; --bad-soft: #fef2f2; --info: #3b82f6; --info-soft: #eff6ff;
  --side: #0b1020; --side-2: #121a33; --side-ink: #c7cde0; --side-muted: #7b84a3;
  --r: 14px; --r-sm: 9px; --sh: 0 1px 2px rgba(15,23,42,.04), 0 4px 18px rgba(15,23,42,.06); --sh-lg: 0 24px 60px rgba(15,23,42,.18);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}
[data-theme="dark"] {
  --bg: #0b1020; --panel: #121a2e; --panel-2: #0f1628; --line: #222c47; --line-2: #1a2340; --ink: #e8ecf8; --ink-2: #c3cbe0; --muted: #8b95b3; --faint: #5e6886;
  --brand-soft: #1e1b4b; --ok-soft: #052e22; --warn-soft: #2e2205; --bad-soft: #2d0f12; --info-soft: #0c1d3d; --side: #070b17; --side-2: #0e1428;
  --sh: 0 1px 2px rgba(0,0,0,.3), 0 4px 18px rgba(0,0,0,.25);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; line-height: 1.45; }
a { color: var(--brand); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; color: var(--ink); }
h1 { font-size: 24px; font-weight: 700; } h2 { font-size: 18px; font-weight: 650; } h3 { font-size: 15px; font-weight: 650; }
small, .muted { color: var(--muted); } .faint { color: var(--faint); }
code, pre { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12.5px; }
pre { white-space: pre-wrap; background: var(--panel-2); padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); margin: 0; }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.sm { width: 15px; height: 15px; } svg.i.lg { width: 22px; height: 22px; } svg.i.xl { width: 28px; height: 28px; }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.side { background: linear-gradient(180deg, var(--side) 0%, var(--side-2) 100%); color: var(--side-ink); position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; z-index: 30; scrollbar-width: thin; scrollbar-color: #2a3352 transparent; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.brand .logo { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); display: grid; place-items: center; box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 45%, transparent); overflow: hidden; }
.brand .logo img { width: 100%; height: 100%; object-fit: cover; }
.brand small { display: block; color: var(--side-muted); font-weight: 500; font-size: 11px; }
.nav { padding: 6px 10px 18px; flex: 1; }
.nav .sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--side-muted); padding: 14px 10px 6px; font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; color: var(--side-ink); font-weight: 500; text-decoration: none; margin: 1px 0; transition: background .15s, color .15s; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.on { background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 55%, transparent), color-mix(in srgb, var(--brand) 18%, transparent)); color: #fff; box-shadow: inset 3px 0 0 var(--brand-2); }
.nav a .cnt { margin-left: auto; font-size: 11px; background: rgba(255,255,255,.12); padding: 1px 7px; border-radius: 20px; color: #fff; }
.nav a .cnt.hot { background: var(--bad); }
.side-foot { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.06); font-size: 11.5px; color: var(--side-muted); }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { height: 62px; background: color-mix(in srgb, var(--panel) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 22px; position: sticky; top: 0; z-index: 20; }
.top .search { flex: 1; max-width: 560px; position: relative; }
.top .search input { width: 100%; height: 40px; border-radius: 11px; border: 1px solid var(--line); background: var(--panel-2); padding: 0 14px 0 40px; font-size: 14px; color: var(--ink); outline: none; transition: border .15s, box-shadow .15s; }
.top .search input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 15%, transparent); background: var(--panel); }
.top .search > svg { position: absolute; left: 13px; top: 11px; color: var(--faint); }
.top .search kbd { position: absolute; right: 10px; top: 10px; font-size: 11px; color: var(--faint); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; background: var(--panel); }
.search-pop { position: absolute; top: 46px; left: 0; right: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh-lg); max-height: 70vh; overflow: auto; padding: 6px; }
.search-pop .grp { font-size: 11px; text-transform: uppercase; color: var(--faint); padding: 8px 10px 4px; letter-spacing: .06em; font-weight: 600; }
.search-pop a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.search-pop a:hover, .search-pop a.act { background: var(--brand-soft); }
.top .sp { flex: 1; }
.iconbtn { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer; position: relative; }
.iconbtn:hover { background: var(--panel-2); border-color: var(--line); }
.iconbtn .dot { position: absolute; top: 6px; right: 6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 10.5px; display: grid; place-items: center; font-weight: 700; border: 2px solid var(--panel); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 13px; flex: none; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; } .avatar.lg { width: 48px; height: 48px; font-size: 17px; }
.content { padding: 24px 28px 60px; max-width: 1500px; width: 100%; margin: 0 auto; }
.menu-btn { display: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }

/* ---------- Components ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); }
.card > .hd { padding: 14px 18px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 10px; }
.card > .hd h3 { flex: 1; display: flex; align-items: center; gap: 8px; }
.card > .bd { padding: 16px 18px; }
.card.pad { padding: 18px; }
.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)); }
.g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; } .row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; } .col { display: flex; flex-direction: column; gap: 10px; }
.stack > * + * { margin-top: 16px; }
.btn { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; transition: all .15s; font-family: inherit; text-decoration: none !important; }
.btn:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); background: var(--panel-2); }
.btn.primary { background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 75%, var(--brand-2))); color: #fff; border-color: transparent; box-shadow: 0 6px 16px color-mix(in srgb, var(--brand) 30%, transparent); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--bad); } .btn.danger.solid { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn.ghost { border-color: transparent; background: transparent; } .btn.ghost:hover { background: var(--panel-2); }
.btn.sm { height: 31px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn.xs { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 7px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ai { background: linear-gradient(135deg, #7c3aed, #db2777); color: #fff; border: 0; }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--panel-2); color: var(--ink-2); border: 1px solid var(--line); }
.badge .d { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.b-red { background: var(--bad-soft); color: #dc2626; border-color: transparent; } .b-amber { background: var(--warn-soft); color: #b45309; border-color: transparent; }
.b-green { background: var(--ok-soft); color: #047857; border-color: transparent; } .b-blue { background: var(--info-soft); color: #1d4ed8; border-color: transparent; }
.b-violet { background: #f5f3ff; color: #6d28d9; border-color: transparent; } .b-gray { background: var(--panel-2); color: var(--muted); }
[data-theme="dark"] .b-red { color: #fca5a5; } [data-theme="dark"] .b-amber { color: #fcd34d; } [data-theme="dark"] .b-green { color: #6ee7b7; } [data-theme="dark"] .b-blue { color: #93c5fd; } [data-theme="dark"] .b-violet { background: #2e1065; color: #c4b5fd; }
.pill-type { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px 3px 4px; border-radius: 20px; background: var(--panel-2); border: 1px solid var(--line); }
.pill-type .ic { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.pill-type .ic svg { width: 12px; height: 12px; }
.prio { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 12.5px; }
.prio i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

/* Forms */
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
label.f .req { color: var(--bad); }
label.f .help { font-weight: 400; color: var(--muted); font-size: 12px; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--ink); }
.inp, input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=time], input[type=search], input[type=url], select, textarea {
  width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: var(--panel); outline: none; transition: border .15s, box-shadow .15s; }
textarea { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 13%, transparent); }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; accent-color: var(--brand); }
input[type=color] { width: 54px; height: 38px; border: 1px solid var(--line); border-radius: 10px; padding: 3px; background: var(--panel); }
.check { display: flex; align-items: center; gap: 9px; font-weight: 500; font-size: 13.5px; cursor: pointer; }
.switch { position: relative; width: 40px; height: 23px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cbd5e1; border-radius: 20px; transition: .2s; cursor: pointer; }
.switch span:before { content: ""; position: absolute; width: 17px; height: 17px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px #0003; }
.switch input:checked + span { background: var(--brand); } .switch input:checked + span:before { transform: translateX(17px); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.rows-ed { border: 1px dashed var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; background: var(--panel-2); }
.rows-ed .r { display: grid; gap: 8px; align-items: end; background: var(--panel); padding: 10px; border-radius: 9px; border: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; background: var(--brand-soft); color: var(--brand-ink); font-size: 12.5px; font-weight: 600; cursor: pointer; border: 1px solid transparent; }
.chip.off { background: var(--panel-2); color: var(--muted); border-color: var(--line); }
[data-theme="dark"] .chip { color: #c7d2fe; }

/* Tables */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--panel-2); position: sticky; top: 0; white-space: nowrap; cursor: default; }
.tbl th.sort { cursor: pointer; } .tbl th.sort:hover { color: var(--ink); }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: color-mix(in srgb, var(--brand) 4%, var(--panel)); }
.tbl tr.sel td { background: var(--brand-soft); }
.tbl td.num { font-weight: 650; color: var(--brand); white-space: nowrap; }
.tbl td { white-space: nowrap; } .tbl td .ttl + small, .tbl td small { white-space: nowrap; }
.tbl .ttl { font-weight: 550; color: var(--ink); max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty svg { width: 46px; height: 46px; color: var(--faint); margin-bottom: 8px; }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--line-2); color: var(--muted); font-size: 13px; }

/* KPI tiles */
.kpi { padding: 16px 18px; position: relative; overflow: hidden; }
.kpi .lbl { padding-right: 46px; font-size: 12.5px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.kpi .val { font-size: 28px; font-weight: 750; letter-spacing: -.02em; margin-top: 6px; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi .ic { position: absolute; right: 14px; top: 14px; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; }
.kpi.clickable { cursor: pointer; transition: transform .15s, box-shadow .15s; } .kpi.clickable:hover { transform: translateY(-2px); box-shadow: var(--sh-lg); }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; text-decoration: none; white-space: nowrap; display: flex; gap: 7px; align-items: center; cursor: pointer; }
.tabs a.on { color: var(--brand); border-color: var(--brand); }
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg a { padding: 6px 12px; border-radius: 7px; color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.seg a.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px #0001; }

/* Ticket detail */
.t-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.t-head { padding: 18px 20px; }
.t-head .num { font-weight: 700; color: var(--brand); font-size: 13px; letter-spacing: .02em; }
.t-head h1 { font-size: 21px; margin: 6px 0 10px; }
.props { display: flex; flex-direction: column; gap: 12px; }
.props label.f { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.timeline { position: relative; }
.ev { display: flex; gap: 12px; padding: 12px 0; position: relative; }
.ev:before { content: ""; position: absolute; left: 16px; top: 46px; bottom: -6px; width: 2px; background: var(--line-2); }
.ev:last-child:before { display: none; }
.ev .who { flex: none; }
.ev .bub { flex: 1; min-width: 0; }
.ev .meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ev .meta b { color: var(--ink); }
.ev .txt { margin-top: 6px; padding: 11px 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); white-space: pre-wrap; word-break: break-word; }
.ev.note .txt { background: #fffbeb; border-color: #fde68a; } [data-theme="dark"] .ev.note .txt { background: #2a2108; border-color: #4a3a0b; }
.ev.pub-agent .txt { background: color-mix(in srgb, var(--brand) 6%, var(--panel)); border-color: color-mix(in srgb, var(--brand) 22%, var(--line)); }
.ev.sys { padding: 6px 0 6px 6px; } .ev.sys .ico { width: 22px; height: 22px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); }
.ev.sys .ico svg { width: 12px; height: 12px; } .ev.sys:before { left: 16px; top: 30px; }
.composer { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: hidden; }
.composer textarea { border: 0; border-radius: 0; min-height: 110px; box-shadow: none !important; }
.composer .bar { display: flex; gap: 8px; align-items: center; padding: 8px 10px; background: var(--panel-2); border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.composer.note { border-color: #fcd34d; } .composer.note textarea { background: #fffdf3; } [data-theme="dark"] .composer.note textarea { background: #1f1a0a; }
.sla-bar { height: 7px; border-radius: 6px; background: var(--line-2); overflow: hidden; } .sla-bar > i { display: block; height: 100%; border-radius: 6px; }
.attach { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.attach .ext { width: 34px; height: 34px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 14px; text-align: center; color: var(--muted); cursor: pointer; transition: .15s; font-size: 13px; }
.drop.over, .drop:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.collide { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; padding: 8px 12px; border-radius: 10px; font-size: 13px; display: flex; gap: 8px; align-items: center; }

/* Portal */
.hero { border-radius: 22px; padding: 42px 40px; color: #fff; position: relative; overflow: hidden; background: radial-gradient(1200px 400px at 10% -20%, color-mix(in srgb, var(--brand-2) 70%, transparent), transparent), linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #0b1020)); box-shadow: 0 20px 50px color-mix(in srgb, var(--brand) 25%, transparent); }
.hero h1 { color: #fff; font-size: 30px; } .hero p { opacity: .85; margin: 6px 0 22px; font-size: 15px; }
.hero .big-search { position: relative; max-width: 680px; }
.hero .big-search input { height: 54px; border-radius: 14px; border: 0; padding-left: 50px; font-size: 16px; box-shadow: 0 10px 30px #0003; }
.hero .big-search svg { position: absolute; left: 17px; top: 17px; color: var(--muted); }
.hero:after { content: ""; position: absolute; right: -60px; bottom: -80px; width: 320px; height: 320px; border-radius: 50%; background: rgba(255,255,255,.08); }
.action-card { padding: 20px; display: flex; gap: 14px; align-items: flex-start; cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; text-decoration: none !important; color: inherit; }
.action-card:hover { transform: translateY(-3px); box-shadow: var(--sh-lg); border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.action-card .ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; flex: none; color: #fff; }
.action-card h3 { margin-bottom: 4px; } .action-card p { margin: 0; color: var(--muted); font-size: 13px; }
.cat-item { padding: 16px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; transition: .15s; }
.cat-item:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--sh-lg); }
.cat-item .ic { width: 42px; height: 42px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 18%, transparent); }

/* Modal / toast / drawer */
.overlay { position: fixed; inset: 0; background: rgba(15,23,42,.45); backdrop-filter: blur(3px); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; animation: fade .15s; }
.modal { background: var(--panel); border-radius: 18px; box-shadow: var(--sh-lg); width: 100%; max-width: 640px; animation: pop .18s; border: 1px solid var(--line); }
.modal.wide { max-width: 940px; } .modal.xwide { max-width: 1180px; }
.modal .mh { padding: 18px 22px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 10px; }
.modal .mh h2 { flex: 1; }
.modal .mb { padding: 20px 22px; max-height: 70vh; overflow-y: auto; }
.modal .mf { padding: 14px 22px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 10px; background: var(--panel-2); border-radius: 0 0 18px 18px; }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.toasts { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { background: #0f172a; color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--sh-lg); display: flex; gap: 10px; align-items: center; max-width: 420px; animation: pop .2s; font-weight: 500; }
.toast.err { background: #b91c1c; } .toast.ok { background: #047857; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 400px; max-width: 100%; background: var(--panel); box-shadow: var(--sh-lg); z-index: 120; display: flex; flex-direction: column; animation: slide .2s; border-left: 1px solid var(--line); }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.drawer .dh { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; } .drawer .dh h3 { flex: 1; }
.drawer .db { flex: 1; overflow-y: auto; }
.notif { padding: 12px 18px; border-bottom: 1px solid var(--line-2); cursor: pointer; display: flex; gap: 10px; } .notif:hover { background: var(--panel-2); }
.notif.unread { background: color-mix(in srgb, var(--brand) 5%, var(--panel)); } .notif.unread b:before { content: "● "; color: var(--brand); }
.menu { position: absolute; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh-lg); padding: 6px; min-width: 210px; z-index: 150; }
.menu a { display: flex; gap: 10px; align-items: center; padding: 9px 11px; border-radius: 8px; color: var(--ink); text-decoration: none; cursor: pointer; font-weight: 500; }
.menu a:hover { background: var(--panel-2); } .menu hr { border: 0; border-top: 1px solid var(--line-2); margin: 5px 0; }

/* Chat (virtual agent) */
.va-fab { position: fixed; right: 24px; bottom: 24px; width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer; z-index: 90; color: #fff; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 12px 30px color-mix(in srgb, var(--brand) 45%, transparent); }
.va { position: fixed; right: 24px; bottom: 94px; width: 380px; max-width: calc(100vw - 32px); height: 540px; max-height: calc(100vh - 120px); background: var(--panel); border-radius: 20px; box-shadow: var(--sh-lg); z-index: 91; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); animation: pop .2s; }
.va .vh { padding: 16px 18px; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); display: flex; gap: 10px; align-items: center; }
.va .vb { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--panel-2); }
.msg { max-width: 85%; padding: 10px 13px; border-radius: 16px; white-space: pre-wrap; word-break: break-word; font-size: 13.5px; }
.msg.bot { background: var(--panel); border: 1px solid var(--line); border-bottom-left-radius: 4px; align-self: flex-start; }
.msg.me { background: var(--brand); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.va .vf { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: var(--panel); }

/* Login */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth .art { background: radial-gradient(900px 500px at 0% 0%, color-mix(in srgb, var(--brand-2) 55%, transparent), transparent), linear-gradient(145deg, var(--brand) 0%, #0b1020 85%); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth .art h1 { color: #fff; font-size: 38px; line-height: 1.12; max-width: 520px; }
.auth .art p { opacity: .8; font-size: 16px; max-width: 480px; }
.auth .feat { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 520px; }
.auth .feat div { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); padding: 12px 14px; border-radius: 12px; display: flex; gap: 10px; align-items: center; font-size: 13.5px; backdrop-filter: blur(4px); }
.auth .form { display: grid; place-items: center; padding: 40px 24px; background: var(--panel); }
.auth .box { width: 100%; max-width: 380px; }
.auth .box h2 { font-size: 26px; margin-bottom: 6px; }
.sso { display: flex; gap: 10px; align-items: center; justify-content: center; width: 100%; height: 44px; border-radius: 11px; border: 1px solid var(--line); background: var(--panel); font-weight: 600; cursor: pointer; color: var(--ink); font-family: inherit; font-size: 14px; }
.sso:hover { background: var(--panel-2); }
.divider { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12px; margin: 18px 0; } .divider:before, .divider:after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* Misc */
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: 13.5px; } .kv > div:nth-child(odd) { color: var(--muted); }
.bar-row { display: flex; align-items: center; gap: 10px; font-size: 13px; margin: 7px 0; }
.bar-row .lab { width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.bar-row .track { flex: 1; height: 9px; background: var(--line-2); border-radius: 6px; overflow: hidden; }
.bar-row .track i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.bar-row .v { width: 36px; text-align: right; font-weight: 650; }
.md h2 { font-size: 16px; margin: 18px 0 8px; } .md h3 { margin: 14px 0 6px; } .md p { margin: 8px 0; } .md ul, .md ol { padding-left: 22px; } .md code { background: var(--panel-2); padding: 1px 5px; border-radius: 5px; border: 1px solid var(--line); }
.banner { padding: 12px 16px; border-radius: 12px; display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; font-size: 13.5px; }
.banner.info { background: var(--info-soft); color: #1e40af; } .banner.warning { background: var(--warn-soft); color: #92400e; } .banner.critical { background: var(--bad-soft); color: #991b1b; }
[data-theme="dark"] .banner.info { color: #bfdbfe; } [data-theme="dark"] .banner.warning { color: #fde68a; } [data-theme="dark"] .banner.critical { color: #fecaca; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: grid; place-items: center; padding: 70px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--line); border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.cal > div { background: var(--panel); min-height: 104px; padding: 6px; font-size: 12px; }
.cal .dh { min-height: auto; font-weight: 700; text-align: center; color: var(--muted); background: var(--panel-2); text-transform: uppercase; font-size: 11px; padding: 8px; }
.cal .d { font-weight: 700; color: var(--muted); margin-bottom: 4px; } .cal .today .d { color: var(--brand); }
.cal .ev-c { display: block; padding: 3px 6px; border-radius: 6px; margin-bottom: 3px; font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cal .blk { background: repeating-linear-gradient(45deg, var(--bad-soft), var(--bad-soft) 6px, var(--panel) 6px, var(--panel) 12px); }
.wall { background: #070b17; color: #e2e8f0; min-height: 100vh; padding: 28px; }
.wall .bar-row .lab, .wall .bar-row .v { color: #cbd5e1; } .wall .bar-row .track { background: #1f2a4d; }
.wall .card { background: #111833; border-color: #1f2a4d; color: #e2e8f0; } .wall .kpi .val { font-size: 46px; }
.lb-rank { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 12px; background: var(--panel-2); }
.lb-rank.r1 { background: #fde68a; color: #92400e; } .lb-rank.r2 { background: #e2e8f0; color: #334155; } .lb-rank.r3 { background: #fed7aa; color: #9a3412; }
.hide-m { } .show-m { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .t-layout { grid-template-columns: minmax(0, 1fr) 300px; } }
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-105%); transition: transform .22s; box-shadow: var(--sh-lg); }
  .side.open { transform: none; }
  .menu-btn { display: grid; }
  .t-layout, .g3, .g2, .grid[style] { grid-template-columns: 1fr !important; }
  .top .search { min-width: 0; }
  .auth { grid-template-columns: 1fr; } .auth .art { display: none; }
  .content { padding: 16px 14px 90px; }
  .top { padding: 0 12px; gap: 6px; } .top .search kbd { display: none; }
  .hide-m { display: none !important; } .show-m { display: initial; }
  .hero { padding: 28px 22px; } .hero h1 { font-size: 23px; }
  .form-grid { grid-template-columns: 1fr; }
  .tbl .ttl { max-width: 220px; }
  .kv { grid-template-columns: 110px 1fr; }
  .scrim { position: fixed; inset: 0; background: #0006; z-index: 25; }
}
@media (max-width: 600px) { .g4, .g6 { grid-template-columns: 1fr 1fr; } .kpi .val { font-size: 22px; } .page-head h1 { font-size: 20px; } .modal .mb { padding: 16px; } }
@media print { .side, .top, .va-fab, .composer, .btn { display: none !important; } .shell { display: block; } .card { box-shadow: none; } }
