:root {
  --bg: #0c0c0e;
  --bg-2: #111114;
  --surface: #17171b;
  --surface-2: #1d1d22;
  --surface-3: #25252b;
  --border: #2a2a31;
  --border-2: #34343c;
  --text: #f4f4f6;
  --text-2: #b4b4bd;
  --muted: #7d7d88;
  --accent: #7b61ff;
  --accent-2: #9580ff;
  --accent-bg: rgba(123, 97, 255, .14);
  --green: #3ecf8e;
  --green-bg: rgba(62, 207, 142, .12);
  --red: #ff6464;
  --red-bg: rgba(255, 100, 100, .12);
  --amber: #ffb547;
  --amber-bg: rgba(255, 181, 71, .12);
  --blue: #5aa9ff;
  --blue-bg: rgba(90, 169, 255, .12);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 12px 40px rgba(0, 0, 0, .5);
  --sidebar: 256px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
:where(svg:not([width]):not(.chart)) { width: 18px; height: 18px; flex: none; vertical-align: middle; }
.kpi .label svg { width: 15px; height: 15px; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.5 Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased; font-feature-settings: 'tnum' 1, 'cv11' 1;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2c2c33; border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--bg-2);
  border-right: 1px solid var(--border); padding: 16px 12px 24px; display: flex; flex-direction: column; gap: 2px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; font-weight: 700; font-size: 17px; }
.brand-logo { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; }
.org-switch { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); margin-bottom: 14px; }
.org-switch .avatar { width: 28px; height: 28px; font-size: 12px; }
.org-switch b { display: block; font-size: 13px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.org-switch small { color: var(--muted); font-size: 11px; }
.nav-group { margin-top: 14px; padding: 0 10px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: var(--text-2);
  cursor: pointer; font-weight: 500; font-size: 13.5px; text-decoration: none !important; position: relative;
}
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active { background: var(--surface-2); color: var(--text); }
.nav-item.active::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-item .count { margin-left: auto; font-size: 11px; background: var(--accent-bg); color: var(--accent-2); padding: 1px 7px; border-radius: 20px; font-weight: 600; }
.nav-item .count.warn { background: var(--amber-bg); color: var(--amber); }
.nav-sub { display: none; flex-direction: column; gap: 1px; margin: 2px 0 4px 20px; padding-left: 10px; border-left: 1px solid var(--border); }
.nav-sub.open { display: flex; }
.nav-sub .nav-item { padding: 6px 10px; font-size: 13px; }
.nav-sub .nav-item.active::before { display: none; }
.sidebar-foot { margin-top: auto; padding-top: 20px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 32px;
  background: rgba(12, 12, 14, .82); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border);
}
.search { flex: 1; max-width: 460px; position: relative; }
.search input { width: 100%; padding: 9px 12px 9px 36px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; outline: none; }
.search input:focus { border-color: var(--accent); }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; color: var(--muted); }
.search-results { position: absolute; top: 44px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--border-2); border-radius: 12px; box-shadow: var(--shadow); max-height: 420px; overflow: auto; padding: 6px; }
.search-results a { display: flex; justify-content: space-between; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--text); }
.search-results a:hover { background: var(--surface-2); text-decoration: none; }
.search-results small { color: var(--muted); }
.live { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); padding: 5px 10px; border: 1px solid var(--border); border-radius: 20px; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.live.on i { background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px transparent; } }
.topbar .spacer { flex: 1; }
.content { padding: 28px 32px 64px; max-width: 1360px; width: 100%; }
.menu-toggle { display: none; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 10px 14px; color: var(--muted); font-weight: 500; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none !important; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-color: var(--accent); }
.tab .count { font-size: 11px; color: var(--muted); margin-left: 5px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: 9px; border: 1px solid var(--border-2);
  background: var(--surface-2); color: var(--text); font-weight: 500; cursor: pointer; white-space: nowrap; font-size: 13.5px; text-decoration: none !important;
  transition: background .12s, border-color .12s, transform .06s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.white { background: #fff; color: #111; border-color: #fff; }
.btn.white:hover { background: #e8e8ec; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-bg); border-color: var(--red); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn.icon { padding: 7px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-group { display: inline-flex; }
.dropdown { position: relative; display: inline-block; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; background: var(--surface); border: 1px solid var(--border-2); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 50; display: none; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; border: 0; background: none; color: var(--text); cursor: pointer; font-size: 13.5px; text-decoration: none !important; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-2); }
.dropdown-menu svg { width: 16px; height: 16px; color: var(--muted); }
.dropdown-menu hr { border: 0; border-top: 1px solid var(--border); margin: 5px 0; }

/* ---------- Cards / KPIs ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); gap: 10px; }
.card-head h3 { font-size: 15px; }
.card-head .sub { color: var(--muted); font-size: 12.5px; }
.grid { display: grid; gap: 16px; }
.grid.k4 { grid-template-columns: repeat(4, 1fr); }
.grid.k3 { grid-template-columns: repeat(3, 1fr); }
.grid.k2 { grid-template-columns: repeat(2, 1fr); }
.grid.main-side { grid-template-columns: 1.7fr 1fr; }
.kpi { padding: 18px 20px; }
.kpi .label { color: var(--muted); font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 26px; font-weight: 650; letter-spacing: -.02em; margin-top: 6px; }
.kpi .hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.balance-hero { padding: 24px; background: linear-gradient(135deg, #1d1832 0%, #17171b 55%); position: relative; overflow: hidden; }
.balance-hero::after { content: ''; position: absolute; right: -80px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(123,97,255,.35), transparent 70%); }
.balance-hero .value { font-size: 36px; }
.up { color: var(--green); } .down { color: var(--red); } .muted { color: var(--muted); } .warn { color: var(--amber); }
.mt { margin-top: 16px; } .mt2 { margin-top: 24px; } .mb { margin-bottom: 16px; }
.row { display: flex; align-items: center; gap: 10px; } .row.between { justify-content: space-between; } .row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.right { text-align: right; } .nowrap { white-space: nowrap; } .small { font-size: 12.5px; } .strong { font-weight: 600; }
.divider { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.t td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr.click { cursor: pointer; }
table.t tbody tr.click:hover td { background: var(--surface-2); }
table.t td.num, table.t th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.t tfoot td { font-weight: 600; border-top: 1px solid var(--border-2); padding: 12px 16px; }
.cell-main { font-weight: 500; }
.cell-sub { color: var(--muted); font-size: 12.5px; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 36px; height: 36px; opacity: .5; margin-bottom: 8px; }
.empty h4 { color: var(--text); margin-bottom: 4px; font-size: 15px; }
.tx-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); font-weight: 600; font-size: 13px; flex: none; color: var(--text-2); }
.tx-icon.in { background: var(--green-bg); color: var(--green); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 500; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.blue { background: var(--blue-bg); color: var(--blue); }
.badge.violet { background: var(--accent-bg); color: var(--accent-2); }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 16px; }
.form-grid.c3 { grid-template-columns: repeat(3, 1fr); }
.form-grid.c4 { grid-template-columns: repeat(4, 1fr); }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.field > small { color: var(--muted); font-size: 12px; }
.input, .field input, .field select, .field textarea {
  width: 100%; padding: 9px 12px; background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 9px; outline: none; transition: border-color .12s, box-shadow .12s;
}
.field textarea { min-height: 80px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
select { 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='%237d7d88' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px !important; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); margin-top: 2px; }
.radio-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.radio-card { border: 1px solid var(--border-2); border-radius: 10px; padding: 12px 14px; cursor: pointer; display: flex; gap: 10px; align-items: flex-start; background: var(--bg-2); }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-bg); }
.radio-card input { accent-color: var(--accent); margin-top: 3px; }
.radio-card b { display: block; font-weight: 500; }
.radio-card small { color: var(--muted); }
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--surface-3); border-radius: 22px; cursor: pointer; transition: .15s; }
.switch span::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::before { transform: translateX(16px); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.setting-row:last-child { border-bottom: 0; }
.setting-row b { font-weight: 500; display: block; }
.setting-row small { color: var(--muted); }
.section-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.section-desc { color: var(--muted); margin: 0 0 16px; font-size: 13px; }

/* ---------- Settings layout ---------- */
.settings { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: start; }
.settings-nav { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 2px; }
.settings-nav .h { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 14px 10px 6px; }
.settings-nav a { padding: 7px 10px; border-radius: 8px; color: var(--text-2); font-weight: 500; text-decoration: none; }
.settings-nav a:hover { background: var(--surface); color: var(--text); }
.settings-nav a.active { background: var(--surface-2); color: var(--text); }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); backdrop-filter: blur(3px); z-index: 100; display: grid; place-items: center; padding: 20px; animation: fade .12s; }
.modal { background: var(--surface); border: 1px solid var(--border-2); border-radius: 16px; width: 100%; max-width: 560px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: var(--shadow); animation: pop .15s; }
.modal.wide { max-width: 860px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 17px; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border); }
.drawer-bg { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 90; animation: fade .12s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--surface); border-left: 1px solid var(--border-2); z-index: 91; display: flex; flex-direction: column; animation: slide .18s; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(6px); } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }

/* ---------- Toast ---------- */
#toasts { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 12px; padding: 12px 16px; box-shadow: var(--shadow); max-width: 400px; display: flex; gap: 12px; align-items: flex-start; animation: pop .2s; }
.toast svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.toast.ok svg { color: var(--green); } .toast.err svg { color: var(--red); } .toast.info svg { color: var(--accent-2); }
.toast b { display: block; font-weight: 600; }
.toast small { color: var(--text-2); }

/* ---------- Editor ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.editor-side { position: sticky; top: 84px; }
.items-table { table-layout: fixed; min-width: 820px; }
.items-table th:first-child { width: 38px; }
.items-table th { padding: 8px 6px !important; }
.items-table td { padding: 6px 6px !important; vertical-align: top !important; }
.items-table select { padding-right: 22px !important; background-position: right 7px center; }
.items-table input, .items-table select, .items-table textarea { width: 100%; padding: 7px 9px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 7px; outline: none; }
.items-table textarea { min-height: 34px; font-size: 12.5px; resize: vertical; margin-top: 4px; color: var(--text-2); }
.items-table input:focus, .items-table select:focus, .items-table textarea:focus { border-color: var(--accent); }
.items-table .drag { color: var(--muted); padding-top: 12px !important; text-align: center; width: 26px; }
.totals-box { display: flex; flex-direction: column; gap: 8px; }
.totals-box .line { display: flex; justify-content: space-between; color: var(--text-2); }
.totals-box .line.grand { color: var(--text); font-weight: 650; font-size: 18px; border-top: 1px solid var(--border-2); padding-top: 10px; margin-top: 4px; }
.product-picker { position: absolute; z-index: 30; background: var(--surface); border: 1px solid var(--border-2); border-radius: 10px; box-shadow: var(--shadow); max-height: 260px; overflow: auto; width: 360px; padding: 4px; }
.product-picker div { padding: 8px 10px; border-radius: 7px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.product-picker div:hover { background: var(--surface-2); }
.timeline { display: flex; flex-direction: column; gap: 12px; }
.timeline .ev { display: flex; gap: 10px; font-size: 13px; }
.timeline .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex: none; }

/* ---------- Charts ---------- */
.chart { width: 100%; height: 240px; display: block; }
.chart text { fill: var(--muted); font-size: 11px; font-family: Inter, sans-serif; }
.chart .grid-line { stroke: var(--border); stroke-dasharray: 3 4; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.bar-list .bar-row { display: grid; grid-template-columns: 160px 1fr 110px; gap: 12px; align-items: center; padding: 7px 0; }
.bar-list .bar { height: 8px; background: var(--surface-3); border-radius: 8px; overflow: hidden; }
.bar-list .bar i { display: block; height: 100%; background: var(--accent); border-radius: 8px; }

/* ---------- Integrations ---------- */
.integ-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.integ-logo { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; font-weight: 700; font-size: 16px; color: #fff; flex: none; }
.integ-card p { color: var(--muted); margin: 0; font-size: 13px; flex: 1; }
.code { font-family: ui-monospace, 'SF Mono', Consolas, monospace; font-size: 12.5px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; word-break: break-all; color: var(--text-2); }
pre.code { white-space: pre-wrap; margin: 0; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-left { display: flex; flex-direction: column; justify-content: center; padding: 60px; max-width: 520px; margin: 0 auto; width: 100%; }
.auth-right { background: radial-gradient(circle at 30% 20%, rgba(123,97,255,.45), transparent 50%), radial-gradient(circle at 80% 80%, rgba(62,207,142,.18), transparent 45%), #121016; display: flex; flex-direction: column; justify-content: center; padding: 60px; border-left: 1px solid var(--border); }
.auth h1 { font-size: 30px; margin: 22px 0 6px; letter-spacing: -.02em; }
.auth-right h2 { font-size: 34px; line-height: 1.15; letter-spacing: -.02em; max-width: 460px; }
.auth-right ul { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-direction: column; gap: 12px; color: var(--text-2); }
.auth-right li { display: flex; gap: 10px; align-items: center; }
.auth-right li svg { color: var(--green); width: 18px; }
.mock-card { margin-top: 36px; max-width: 420px; padding: 20px; background: rgba(23,23,27,.8); border: 1px solid var(--border-2); border-radius: 16px; backdrop-filter: blur(8px); }

.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; font-weight: 600; font-size: 12.5px; color: #fff; flex: none; }
.pill-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.pill-filter button { padding: 6px 12px; border-radius: 20px; border: 1px solid var(--border-2); background: transparent; color: var(--text-2); cursor: pointer; font-size: 13px; }
.pill-filter button.active { background: var(--text); color: #111; border-color: var(--text); }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .input { max-width: 280px; }
.info-box { padding: 12px 14px; border-radius: 10px; background: var(--accent-bg); border: 1px solid rgba(123,97,255,.3); color: var(--text-2); font-size: 13px; display: flex; gap: 10px; }
.info-box svg { width: 18px; flex: none; color: var(--accent-2); }
.info-box.warn { background: var(--amber-bg); border-color: rgba(255,181,71,.3); } .info-box.warn svg { color: var(--amber); }
.dropzone { border: 1.5px dashed var(--border-2); border-radius: 12px; padding: 28px; text-align: center; color: var(--muted); cursor: pointer; transition: .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-bg); color: var(--text); }
.file-thumb { width: 38px; height: 38px; border-radius: 8px; background: var(--surface-3); display: grid; place-items: center; font-size: 10px; font-weight: 700; color: var(--text-2); flex: none; }
.qr { background: #fff; padding: 12px; border-radius: 12px; display: inline-block; }
.kbd { font-size: 11px; padding: 1px 6px; border: 1px solid var(--border-2); border-radius: 5px; color: var(--muted); }
.progress { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--green); }

@media (max-width: 1100px) {
  .grid.k4 { grid-template-columns: repeat(2, 1fr); }
  .grid.main-side, .editor { grid-template-columns: 1fr; }
  .editor-side { position: static; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 80; left: 0; width: 272px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow); }
  .menu-toggle { display: inline-flex; }
  .topbar, .content { padding-left: 16px; padding-right: 16px; }
  .grid.k3, .grid.k2, .form-grid, .form-grid.c3, .form-grid.c4, .settings, .radio-cards { grid-template-columns: 1fr; }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; }
  .settings-nav .h { display: none; }
  .auth { grid-template-columns: 1fr; } .auth-right { display: none; } .auth-left { padding: 32px 16px; }
  .bar-list .bar-row { grid-template-columns: 110px 1fr 90px; }
  .live span { display: none; }
}
@media (max-width: 560px) { .grid.k4 { grid-template-columns: 1fr; } .page-head h1 { font-size: 24px; } }
@media print { .sidebar, .topbar, .page-head .actions { display: none !important; } .shell { display: block; } }
