/* SmartRecruiting Elite – design system */
:root {
  --brand: #4f46e5; --brand-2: #06b6d4; --brand-soft: color-mix(in srgb, var(--brand) 12%, transparent);
  --bg: #f4f6fb; --bg-2: #eef1f8; --surface: #ffffff; --surface-2: #f8fafc; --border: #e3e8f0; --border-strong: #cfd7e3;
  --text: #0f172a; --text-2: #475569; --muted: #7b8798; --sidebar: #0f172a; --sidebar-text: #cbd5e1; --sidebar-active: #ffffff;
  --success: #10b981; --warning: #f59e0b; --danger: #ef4444; --info: #3b82f6;
  --c1: #4f46e5; --c2: #06b6d4; --c3: #10b981; --c4: #f59e0b; --c5: #ec4899; --c6: #8b5cf6; --c7: #14b8a6; --c8: #f97316;
  --radius: 14px; --radius-sm: 9px; --shadow: 0 1px 2px rgba(15,23,42,.04), 0 6px 24px rgba(15,23,42,.06); --shadow-lg: 0 20px 60px rgba(15,23,42,.22);
  --font: "Segoe UI Variable", "Segoe UI", Inter, system-ui, -apple-system, Roboto, sans-serif; --mono: "Cascadia Code", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #0b1120; --bg-2: #111a2e; --surface: #131c31; --surface-2: #17213a; --border: #22304d; --border-strong: #2e3f63; --text: #e5edf8; --text-2: #a9b6cc; --muted: #7d8aa5; --sidebar: #0a0f1d; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 30px rgba(0,0,0,.25); color-scheme: dark; } }
:root[data-theme="dark"] { --bg: #0b1120; --bg-2: #111a2e; --surface: #131c31; --surface-2: #17213a; --border: #22304d; --border-strong: #2e3f63; --text: #e5edf8; --text-2: #a9b6cc; --muted: #7d8aa5; --sidebar: #0a0f1d; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 30px rgba(0,0,0,.25); color-scheme: dark; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 24px; } h2 { font-size: 18px; } h3 { font-size: 15px; } h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
p { margin: 0 0 .8em; } small, .muted { color: var(--muted); } code, .mono { font-family: var(--mono); font-size: 12.5px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
svg.ico { flex: none; vertical-align: -0.15em; }
img.brand-img { object-fit: contain; background: #fff; padding: 3px; }
.md h2 { font-size: 22px; margin-top: 28px; } .md h3 { font-size: 17px; margin-top: 22px; } .md h4 { font-size: 15px; text-transform: none; letter-spacing: 0; color: var(--text); }
.md p, .md li { color: var(--text-2); line-height: 1.7; } .md ul, .md ol { padding-left: 22px; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 20; }
.brand { display: flex; align-items: center; gap: 11px; padding: 20px 20px 18px; color: #fff; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; font-size: 15px; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 45%, transparent); flex: none; }
.brand-name { font-weight: 700; font-size: 15px; line-height: 1.15; } .brand-sub { font-size: 11px; color: #8ea0bf; letter-spacing: .06em; text-transform: uppercase; }
.nav { padding: 6px 12px 20px; display: flex; flex-direction: column; gap: 2px; }
.nav-section { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: #64748b; padding: 16px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 9px; color: var(--sidebar-text); font-weight: 500; text-decoration: none; transition: background .15s, color .15s; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 55%, transparent), color-mix(in srgb, var(--brand) 18%, transparent)); color: var(--sidebar-active); }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav .badge { margin-left: auto; }
.sidebar-foot { margin-top: auto; padding: 14px 20px; font-size: 11px; color: #64748b; border-top: 1px solid rgba(255,255,255,.06); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 64px; display: flex; align-items: center; gap: 14px; padding: 0 28px; background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 15; }
.topbar .title { font-weight: 650; font-size: 16px; } .topbar .crumb { color: var(--muted); font-size: 13px; }
.topbar .spacer { flex: 1; }
.menu-btn { display: none; }
.content { padding: 26px 28px 60px; max-width: 1480px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { color: var(--text-2); margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Components ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; }
.card-head h3 { margin: 0; } .card-body { padding: 16px 20px 20px; } .card-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }
.grid { display: grid; gap: 18px; } .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)); }
.span2 { grid-column: span 2; } .span3 { grid-column: span 3; } .span-all { grid-column: 1 / -1; }
.stack { display: flex; flex-direction: column; gap: 12px; } .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .between { justify-content: space-between; } .grow { flex: 1; }
.stat { padding: 18px 20px; display: flex; gap: 14px; align-items: flex-start; position: relative; overflow: hidden; }
.stat .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.stat .ic svg { width: 21px; height: 21px; }
.stat .v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; } .stat .l { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.stat .t { font-size: 12px; margin-top: 4px; } .up { color: var(--success); } .down { color: var(--danger); }
.stat::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: var(--brand-soft); opacity: .5; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { background: var(--surface-2); text-decoration: none; } .btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; } .btn.primary:hover { background: color-mix(in srgb, var(--brand) 88%, #000); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; } .btn.ghost { background: transparent; border-color: transparent; } .btn.ghost:hover { background: var(--bg-2); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; } .btn.icon { width: 36px; padding: 0; } .btn.sm.icon { width: 30px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--bg-2); color: var(--text-2); white-space: nowrap; }
.badge.success { background: color-mix(in srgb, var(--success) 15%, transparent); color: color-mix(in srgb, var(--success) 80%, var(--text)); }
.badge.warning { background: color-mix(in srgb, var(--warning) 18%, transparent); color: color-mix(in srgb, var(--warning) 70%, var(--text)); }
.badge.danger { background: color-mix(in srgb, var(--danger) 15%, transparent); color: color-mix(in srgb, var(--danger) 80%, var(--text)); }
.badge.info, .badge.brand { background: var(--brand-soft); color: var(--brand); }
.badge.count { background: var(--danger); color: #fff; min-width: 20px; justify-content: center; padding: 1px 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--border); font-size: 12.5px; }
.chip button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0; font-size: 15px; line-height: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* forms */
.form { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px 16px; }
.field { grid-column: span 12; display: flex; flex-direction: column; gap: 6px; } .field.c6 { grid-column: span 6; } .field.c4 { grid-column: span 4; } .field.c3 { grid-column: span 3; } .field.c8 { grid-column: span 8; }
.field label { font-weight: 600; font-size: 12.5px; color: var(--text-2); } .field .help { font-size: 12px; color: var(--muted); }
.field label .req { color: var(--danger); }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 9px; padding: 8px 11px; min-height: 38px; width: 100%; transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; min-height: 0; accent-color: var(--brand); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); cursor: pointer; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--border-strong); border-radius: 22px; transition: .2s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--brand); } .switch input:checked + span::before { transform: translateX(18px); }
.search-input { position: relative; } .search-input svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.search-input input { padding-left: 34px; }

/* tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; user-select: none; }
.table th.sortable { cursor: pointer; } .table th.sortable:hover { color: var(--text); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; } .table tbody tr { transition: background .1s; } .table tbody tr:hover { background: var(--surface-2); }
.table tr.clickable { cursor: pointer; } .table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-tools { display: flex; gap: 10px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--border); }
.empty { text-align: center; padding: 44px 20px; color: var(--muted); } .empty svg { width: 42px; height: 42px; opacity: .45; margin-bottom: 8px; }

/* avatar & people */
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; background: linear-gradient(135deg, var(--c1), var(--c6)); flex: none; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; } .avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; } .person .n { font-weight: 600; } .person .s { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.level { display: inline-flex; gap: 3px; } .level i { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); } .level i.on { background: var(--brand); }
.score { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; font-weight: 700; font-size: 13px; position: relative; }
.progress { height: 8px; background: var(--bg-2); border-radius: 99px; overflow: hidden; } .progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 99px; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 14px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); } .tabs button:hover { color: var(--text); }

/* modal & toast */
.modal-backdrop { position: fixed; inset: 0; background: rgba(2,6,23,.55); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 100; padding: 20px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; animation: pop .18s; border: 1px solid var(--border); }
.modal.wide { width: min(920px, 100%); } .modal.xl { width: min(1200px, 100%); }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; } .modal-head h2 { margin: 0; font-size: 17px; }
.modal-body { padding: 20px 22px; overflow-y: auto; } .modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast { min-width: 280px; max-width: 420px; padding: 12px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--info); box-shadow: var(--shadow-lg); animation: slide .2s; }
.toast.success { border-left-color: var(--success); } .toast.error { border-left-color: var(--danger); } .toast.warning { border-left-color: var(--warning); }
.toast .tt { font-weight: 650; } .toast .tb { color: var(--text-2); font-size: 13px; white-space: pre-line; }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } } @keyframes slide { from { opacity: 0; transform: translateX(20px); } }

/* dropdown / notifications */
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); min-width: 220px; padding: 6px; z-index: 50; display: none; }
.dropdown.open .dropdown-menu { display: block; animation: pop .15s; }
.dropdown-menu a, .dropdown-menu button.item { display: flex; gap: 10px; align-items: center; width: 100%; padding: 9px 11px; border-radius: 8px; color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.dropdown-menu a:hover, .dropdown-menu button.item:hover { background: var(--bg-2); text-decoration: none; }
.dropdown-menu svg { width: 16px; height: 16px; color: var(--muted); }
.notif-panel { width: 380px; max-height: 480px; overflow-y: auto; padding: 0; }
.notif { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); cursor: pointer; } .notif:hover { background: var(--surface-2); }
.notif.unread { background: color-mix(in srgb, var(--brand) 5%, transparent); } .notif .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-top: 6px; flex: none; }
.notif .nt { font-weight: 600; font-size: 13px; } .notif .nb { font-size: 12.5px; color: var(--text-2); white-space: pre-line; } .notif .nd { font-size: 11px; color: var(--muted); }
.bell { position: relative; } .bell .badge.count { position: absolute; top: -3px; right: -3px; font-size: 10px; padding: 0 5px; min-width: 18px; height: 18px; }

/* charts */
.chart { width: 100%; position: relative; } .chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis text, .chart text.lbl { fill: var(--muted); font-size: 11px; } .chart .grid line { stroke: var(--border); }
.chart .tip { position: absolute; pointer-events: none; background: var(--text); color: var(--surface); padding: 5px 9px; border-radius: 7px; font-size: 12px; white-space: nowrap; transform: translate(-50%, -110%); opacity: 0; transition: opacity .1s; z-index: 5; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--text-2); margin-top: 10px; } .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* kanban (pipelines) */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 10px; }
.kcol { background: var(--bg-2); border-radius: 12px; padding: 10px; min-height: 200px; display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--border); }
.kcol.drag-over { outline: 2px dashed var(--brand); outline-offset: -4px; }
.kcol-head { display: flex; justify-content: space-between; align-items: center; font-weight: 650; padding: 4px 6px; font-size: 13px; }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; cursor: grab; box-shadow: 0 1px 2px rgba(0,0,0,.04); } .kcard:hover { border-color: var(--border-strong); } .kcard.dragging { opacity: .5; }

/* chat */
.chat { display: grid; grid-template-columns: 320px 1fr; height: calc(100vh - 64px - 110px); min-height: 460px; }
.chat-list { border-right: 1px solid var(--border); overflow-y: auto; } .chat-item { padding: 13px 16px; border-bottom: 1px solid var(--border); cursor: pointer; display: flex; gap: 10px; }
.chat-item:hover, .chat-item.active { background: var(--surface-2); } .chat-item.active { box-shadow: inset 3px 0 0 var(--brand); }
.chat-main { display: flex; flex-direction: column; min-width: 0; } .chat-msgs { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); }
.msg { max-width: 72%; padding: 9px 13px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); white-space: pre-wrap; word-break: break-word; } .msg.mine { align-self: flex-end; background: var(--brand); color: #fff; border-color: var(--brand); }
.msg .md { font-size: 10.5px; opacity: .7; margin-top: 3px; } .chat-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }

/* misc */
.map { height: 320px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); z-index: 1; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; } .kv dt { color: var(--muted); font-weight: 500; } .kv dd { margin: 0; }
.timeline { position: relative; padding-left: 22px; } .timeline::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 16px; } .tl-item::before { content: ""; position: absolute; left: -21px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--brand); }
.skeleton { background: linear-gradient(90deg, var(--bg-2), var(--surface-2), var(--bg-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; min-height: 18px; }
@keyframes sk { to { background-position: -200% 0; } }
.spinner { width: 22px; height: 22px; border: 3px solid var(--border); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; } @keyframes spin { to { transform: rotate(360deg); } }
.loading { display: grid; place-items: center; padding: 60px; }
.callout { padding: 12px 16px; border-radius: 10px; background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent); color: var(--text); }
.callout.warning { background: color-mix(in srgb, var(--warning) 12%, transparent); border-color: color-mix(in srgb, var(--warning) 35%, transparent); }
.callout.danger { background: color-mix(in srgb, var(--danger) 10%, transparent); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.callout.success { background: color-mix(in srgb, var(--success) 10%, transparent); border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); } .status-dot.ok { background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 25%, transparent); } .status-dot.bad { background: var(--danger); } .status-dot.warn { background: var(--warning); }
.matrix td, .matrix th { text-align: center; } .matrix td:first-child, .matrix th:first-child { text-align: left; }
.tri { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; } .tri button { border: 0; background: var(--surface); padding: 3px 8px; font-size: 11.5px; cursor: pointer; color: var(--muted); font-weight: 600; }
.tri button.on.allow { background: var(--success); color: #fff; } .tri button.on.deny { background: var(--danger); color: #fff; } .tri button.on.inherit { background: var(--bg-2); color: var(--text); }
.hide { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iframe-wrap { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; height: calc(100vh - 220px); min-height: 500px; } .iframe-wrap iframe { width: 100%; height: 100%; border: 0; }

/* auth / public pages */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero { background: radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--brand-2) 55%, transparent), transparent 50%), linear-gradient(135deg, #1e1b4b, var(--brand) 60%, #0e7490); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-hero h1 { font-size: 40px; line-height: 1.1; max-width: 520px; } .auth-hero p { color: rgba(255,255,255,.82); font-size: 16px; max-width: 480px; }
.auth-panel { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.auth-box { width: min(420px, 100%); }
.portal-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: var(--bg-2); padding: 5px; border-radius: 12px; margin-bottom: 22px; }
.portal-switch button { border: 0; background: none; padding: 9px; border-radius: 9px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.portal-switch button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; } .sidebar { position: fixed; left: 0; top: 0; width: 270px; transform: translateX(-100%); transition: transform .2s; } .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .menu-btn { display: inline-flex; } .content { padding: 18px 16px 50px; } .topbar { padding: 0 16px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; } .span2, .span3 { grid-column: auto; } .field.c6, .field.c4, .field.c3, .field.c8 { grid-column: span 12; }
  .auth-wrap { grid-template-columns: 1fr; } .auth-hero { display: none; } .chat { grid-template-columns: 1fr; } .chat-list { max-height: 220px; border-right: 0; border-bottom: 1px solid var(--border); }
  .notif-panel { width: calc(100vw - 32px); } .kv { grid-template-columns: 1fr; }
}
