/* ============ Demo tu van admin – design tokens ============ */
:root {
  --navy-950: #061a3d; --navy-900: #0a2350; --navy-800: #0b2d63; --navy-700: #123a7a;
  --blue-700: #0f47a8; --blue-600: #1356c9; --blue-500: #1e6ae0; --blue-100: #dce8fd; --blue-50: #eef4ff;
  --bg: #f3f6fb; --surface: #ffffff; --surface-2: #f8fafd; --border: #e3e8f2; --border-strong: #cfd7e6;
  --text: #0e1b33; --text-2: #4a5672; --muted: #8590a8; --grid: #edf1f7;
  --good: #14804a; --good-bg: #e6f6ed; --warn: #a86b00; --warn-bg: #fff4dc; --bad: #c62828; --bad-bg: #fdecec; --info-bg: #eaf2ff;
  --d-advisory: #2a78d6; --d-tech: #eb6834; --d-legal: #1baf7a; --d-admin: #4a3aa7;
  --radius: 14px; --radius-sm: 10px; --shadow: 0 1px 2px rgba(14, 27, 51, .05), 0 4px 16px rgba(14, 27, 51, .05);
  --shadow-lg: 0 18px 48px rgba(6, 26, 61, .18);
  --font: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif; --serif: 'Source Serif 4', Georgia, serif;
  --sidebar-w: 256px;
  color-scheme: light;
}
* { 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(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
.serif { font-family: var(--serif); }
.icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: middle; }
.icon.sm { width: 15px; height: 15px; } .icon.lg { width: 22px; height: 22px; }
[v-cloak] { display: none; }

/* ============ Boot / login ============ */
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--navy-900); color: #fff; z-index: 999; transition: opacity .4s; }
.boot svg { width: 72px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; transform: scale(.96); } }
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { position: relative; background: linear-gradient(160deg, rgba(10, 35, 80, .92), rgba(19, 86, 201, .78)), url(../assets/img/skyline.jpg) center/cover; color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.login-art h1 { font-family: var(--serif); font-size: clamp(32px, 3.4vw, 50px); font-weight: 700; max-width: 520px; }
.login-art p { opacity: .85; max-width: 460px; font-size: 16px; }
.login-art .stats { display: flex; gap: 36px; flex-wrap: wrap; }
.login-art .stats b { display: block; font-family: var(--serif); font-size: 30px; }
.login-form { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.login-card { width: 100%; max-width: 400px; }
.login-card h2 { font-family: var(--serif); font-size: 30px; margin: 22px 0 6px; }
.demo-accounts { margin-top: 22px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13px; }
.demo-accounts button { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 8px; border: 0; background: none; padding: 7px 6px; border-radius: 8px; cursor: pointer; text-align: left; }
.demo-accounts button:hover { background: var(--blue-50); }
.demo-accounts small { color: var(--muted); }

/* ============ Shell ============ */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); flex: none; background: linear-gradient(180deg, var(--navy-900), var(--navy-950)); color: #c9d4ea; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 40; }
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 20px 18px; color: #fff; text-decoration: none !important; }
.brand svg { width: 38px; height: 38px; }
.brand b { font-family: var(--serif); font-size: 22px; letter-spacing: .5px; display: block; line-height: 1; }
.brand small { font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase; opacity: .7; }
.nav { flex: 1; overflow-y: auto; padding: 6px 12px 16px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.nav-group { font-size: 10.5px; letter-spacing: 1.4px; text-transform: uppercase; color: #7f8fb3; margin: 18px 10px 6px; font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: #c9d4ea; font-weight: 500; text-decoration: none; position: relative; transition: background .15s, color .15s; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.active { background: linear-gradient(90deg, rgba(30, 106, 224, .9), rgba(30, 106, 224, .55)); color: #fff; box-shadow: 0 6px 18px rgba(19, 86, 201, .35); }
.nav .count { margin-left: auto; background: rgba(255, 255, 255, .14); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.nav .count.hot { background: #e34948; }
.sidebar-foot { padding: 14px 16px; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; align-items: center; gap: 10px; }
.sidebar-foot .who { min-width: 0; flex: 1; } .sidebar-foot .who b { display: block; color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot .who small { font-size: 11.5px; color: #8fa0c4; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: rgba(243, 246, 251, .86); backdrop-filter: blur(12px); border-bottom: 1px solid transparent; }
.topbar.scrolled { border-bottom-color: var(--border); }
.topbar .burger { display: none; }
.search-trigger { flex: 1; max-width: 460px; display: flex; align-items: center; gap: 10px; padding: 9px 14px; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; color: var(--muted); cursor: pointer; }
.search-trigger kbd { margin-left: auto; font-size: 11px; border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; background: var(--surface-2); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.content { padding: 8px 28px 48px; max-width: 1560px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 14px 0 20px; }
.page-head h1 { font-family: var(--serif); font-size: 30px; font-weight: 700; letter-spacing: -.2px; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 4px; display: flex; gap: 6px; align-items: center; }
.backdrop { position: fixed; inset: 0; background: rgba(6, 26, 61, .45); z-index: 35; }

/* ============ Primitives ============ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 15px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; transition: all .15s; text-decoration: none !important; color: var(--text); }
.btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--blue-600); border-color: var(--blue-600); color: #fff; box-shadow: 0 4px 12px rgba(19, 86, 201, .25); }
.btn.primary:hover { background: var(--blue-700); }
.btn.navy { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.btn.good { background: var(--good); border-color: var(--good); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: rgba(14, 27, 51, .05); }
.btn.sm { padding: 6px 10px; font-size: 12.5px; border-radius: 8px; }
.btn.icon-only { padding: 8px; }
.btn .dot { position: absolute; }
.icon-btn { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; color: var(--text-2); }
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn .badge-dot { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; border-radius: 9px; background: #e34948; color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--bg); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 6px; flex-wrap: wrap; }
.card-h h3 { font-size: 15px; font-weight: 700; }
.card-h .sub { color: var(--muted); font-size: 12.5px; font-weight: 400; display: block; margin-top: 2px; }
.card-b { padding: 12px 18px 18px; }
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.span-2 { grid-column: span 2; }
.row { display: flex; align-items: center; gap: 10px; } .wrap { flex-wrap: wrap; } .between { justify-content: space-between; } .grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.muted { color: var(--muted); } .t2 { color: var(--text-2); } .small { font-size: 12.5px; } .bold { font-weight: 700; } .nowrap { white-space: nowrap; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; } .center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mb-2 { margin-bottom: 16px; }
hr.sep { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }

/* Pills & badges – status always icon/dot + label, never color alone */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.pill.plain::before { display: none; }
.pill.blue { background: var(--info-bg); color: var(--blue-700); border-color: #cfe0fb; }
.pill.good { background: var(--good-bg); color: var(--good); border-color: #c4e8d3; }
.pill.warn { background: var(--warn-bg); color: var(--warn); border-color: #f5dfac; }
.pill.bad { background: var(--bad-bg); color: var(--bad); border-color: #f6c9c9; }
.pill.violet { background: #efedfb; color: #4a3aa7; border-color: #d9d4f5; }
.pill.gray { color: var(--muted); }
.dept { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.dept i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.prio { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; }
.prio.urgent { color: var(--bad); } .prio.high { color: #c2410c; } .prio.medium { color: var(--text-2); } .prio.low { color: var(--muted); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: 11.5px; font-weight: 700; flex: none; letter-spacing: .3px; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; } .avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.avatars { display: inline-flex; } .avatars .avatar { border: 2px solid var(--surface); margin-left: -7px; } .avatars .avatar:first-child { margin-left: 0; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; color: var(--text-2); }
.code { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 12px; color: var(--muted); }
.overdue { color: var(--bad); font-weight: 600; }
.progress { height: 6px; border-radius: 99px; background: var(--grid); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 99px; background: var(--blue-500); }
.progress.good > i { background: var(--good); }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field > label .req { color: var(--bad); }
.input, select.input, textarea.input { width: 100%; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; min-height: 40px; }
textarea.input { min-height: 90px; resize: vertical; }
.input:focus { border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(30, 106, 224, .15); }
.input.sm { padding: 6px 10px; min-height: 34px; font-size: 13px; border-radius: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-section { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.1px; color: var(--blue-600); grid-column: 1/-1; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.form-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.checks { display: flex; gap: 8px; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: 10px; cursor: pointer; user-select: none; font-weight: 500; }
.check.on { border-color: var(--blue-500); background: var(--blue-50); color: var(--blue-700); }
.check input { accent-color: var(--blue-600); }
.error-text { color: var(--bad); font-size: 13px; }

/* Segmented, tabs, filters */
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--text-2); font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.seg button.on { background: var(--navy-800); color: #fff; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: none; padding: 10px 14px; cursor: pointer; font-weight: 600; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; }
.tabs button.on { color: var(--blue-600); border-bottom-color: var(--blue-600); }
.tabs .n { font-size: 11px; background: var(--surface-2); border: 1px solid var(--border); padding: 0 6px; border-radius: 99px; color: var(--text-2); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters .input { width: auto; min-width: 150px; }
.filters .search { position: relative; flex: 1; min-width: 200px; max-width: 340px; }
.filters .search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.filters .search .input { padding-left: 36px; width: 100%; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 600; padding: 11px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover { background: #f6f9ff; }
.tbl .title { font-weight: 600; color: var(--text); }
.tbl th.sortable { cursor: pointer; }
.empty { text-align: center; padding: 42px 16px; color: var(--muted); }
.empty .icon { width: 36px; height: 36px; color: var(--border-strong); margin-bottom: 8px; }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-2); }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { position: relative; padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); cursor: pointer; transition: transform .2s, box-shadow .2s; overflow: hidden; text-decoration: none !important; color: inherit; display: block; }
.kpi:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(14, 27, 51, .09); }
.kpi .lbl { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.kpi .lbl .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--blue-50); color: var(--blue-600); }
.kpi .val { font-size: 25px; font-weight: 700; margin-top: 10px; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
.kpi .foot { font-size: 12px; color: var(--muted); margin-top: 3px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.delta { font-weight: 700; display: inline-flex; align-items: center; gap: 2px; }
.delta.up { color: var(--good); } .delta.down { color: var(--bad); }
.kpi.hero { background: linear-gradient(135deg, var(--navy-800), var(--blue-600)); color: #fff; border: 0; }
.kpi.hero .lbl { color: rgba(255, 255, 255, .8); } .kpi.hero .lbl .ic { background: rgba(255, 255, 255, .15); color: #fff; }
.kpi.hero .foot { color: rgba(255, 255, 255, .75); } .kpi.hero .delta.up { color: #8ff0b8; } .kpi.hero .delta.down { color: #ffb4b4; }

/* Charts */
.chart { position: relative; width: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend i.line { height: 3px; width: 14px; border-radius: 2px; }
.funnel { display: flex; flex-direction: column; gap: 8px; }
.funnel-row { display: grid; grid-template-columns: 150px 1fr 40px; gap: 10px; align-items: center; cursor: pointer; padding: 3px 4px; border-radius: 8px; }
.funnel-row:hover { background: var(--surface-2); }
.funnel-row .bar { height: 22px; border-radius: 4px; min-width: 4px; transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.funnel-row .lab { font-size: 12.5px; color: var(--text-2); }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list li.click { cursor: pointer; border-radius: 8px; }
.list li.click:hover { background: var(--surface-2); }
.list .t { font-weight: 600; font-size: 13.5px; }
.list .s { font-size: 12.5px; color: var(--muted); }
.timeline { position: relative; }
.timeline .item { display: flex; gap: 12px; padding: 8px 0; position: relative; }
.timeline .item::before { content: ''; position: absolute; left: 14px; top: 38px; bottom: -8px; width: 1px; background: var(--border); }
.timeline .item:last-child::before { display: none; }
.timeline .when { font-size: 12px; color: var(--muted); }
.action-block { border: 1px solid var(--border); border-radius: 12px; padding: 4px 12px; margin-bottom: 12px; }
.action-block h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .8px; color: var(--text-2); padding: 10px 0 2px; display: flex; gap: 8px; align-items: center; }

/* Kanban */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: start; scroll-snap-type: x proximity; }
.col { background: #eaeff7; border-radius: 14px; padding: 10px; min-height: 200px; scroll-snap-align: start; }
.col-h { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; font-weight: 700; font-size: 13.5px; }
.col-h .n { margin-left: auto; font-size: 12px; color: var(--text-2); background: var(--surface); padding: 1px 8px; border-radius: 99px; }
.col-list { min-height: 120px; display: flex; flex-direction: column; gap: 9px; }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; cursor: grab; box-shadow: 0 1px 2px rgba(14, 27, 51, .05); transition: box-shadow .15s, transform .15s; }
.kcard:hover { box-shadow: 0 6px 18px rgba(14, 27, 51, .1); }
.kcard .ttl { font-weight: 600; font-size: 13.5px; margin: 6px 0 8px; line-height: 1.4; }
.kcard .meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.kcard .meta span { display: inline-flex; align-items: center; gap: 4px; }
.sortable-ghost { opacity: .35; }
.sortable-drag { transform: rotate(2deg); box-shadow: var(--shadow-lg) !important; }
.kcard.locked { cursor: pointer; }

/* Stepper (client stage) */
.stepper { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.step { flex: 1; min-width: 118px; padding: 10px 12px 10px 18px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; font-weight: 600; color: var(--text-2); cursor: pointer; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%); text-align: center; transition: background .2s; }
.step:first-child { clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); border-radius: 10px 0 0 10px; }
.step.done { background: var(--blue-100); color: var(--blue-700); }
.step.cur { background: var(--blue-600); color: #fff; }
.step.lost.cur { background: var(--bad); }

/* Modal & drawer */
.overlay { position: fixed; inset: 0; background: rgba(6, 26, 61, .5); backdrop-filter: blur(3px); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto; }
.modal { width: 100%; max-width: 640px; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); animation: pop .22s cubic-bezier(.2, .9, .3, 1.2); }
.modal.lg { max-width: 860px; } .modal.sm { max-width: 440px; }
.modal-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-h h3 { font-family: var(--serif); font-size: 21px; }
.modal-b { padding: 20px 22px; }
.modal-f { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 18px 18px; flex-wrap: wrap; }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.drawer-wrap { position: fixed; inset: 0; z-index: 90; background: rgba(6, 26, 61, .35); }
.drawer { position: absolute; right: 0; top: 0; bottom: 0; width: min(680px, 100%); background: var(--bg); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .26s cubic-bezier(.2, .8, .2, 1); }
.drawer-h { padding: 16px 22px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; gap: 12px; }
.drawer-b { flex: 1; overflow-y: auto; padding: 18px 22px 40px; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 9px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 500; word-break: break-word; }

/* Comments / files */
.comments .c { display: flex; gap: 10px; margin-bottom: 14px; }
.comments .bubble { background: var(--surface); border: 1px solid var(--border); border-radius: 4px 12px 12px 12px; padding: 9px 12px; flex: 1; }
.comments .bubble .h { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.comments .bubble .h b { color: var(--text); }
.comments .bubble p { margin: 4px 0 0; white-space: pre-wrap; }
.composer { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { min-height: 44px; }
.files .f { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); margin-bottom: 8px; }
.files .ext { width: 36px; height: 40px; border-radius: 6px; background: var(--blue-50); color: var(--blue-700); font-size: 10px; font-weight: 800; display: grid; place-items: center; text-transform: uppercase; flex: none; }
.dropzone { border: 2px dashed var(--border-strong); border-radius: 12px; padding: 18px; text-align: center; color: var(--muted); cursor: pointer; transition: all .2s; }
.dropzone.over, .dropzone:hover { border-color: var(--blue-500); background: var(--blue-50); color: var(--blue-700); }
.checklist .ci { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; }
.checklist .ci:hover { background: var(--surface); }
.checklist .ci input { width: 17px; height: 17px; accent-color: var(--good); }
.checklist .ci.done span { text-decoration: line-through; color: var(--muted); }

/* Popovers, toasts, search */
.pop { position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); z-index: 60; width: 380px; max-width: calc(100vw - 24px); animation: pop .18s ease; }
.pop-h { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.pop-list { max-height: 420px; overflow-y: auto; }
.notif { display: flex; gap: 10px; padding: 11px 16px; cursor: pointer; border-bottom: 1px solid var(--border); }
.notif:hover { background: var(--surface-2); }
.notif.unread { background: #f3f7ff; }
.notif .ic { width: 32px; height: 32px; border-radius: 9px; background: var(--blue-50); color: var(--blue-600); display: grid; place-items: center; flex: none; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 60; min-width: 220px; padding: 6px; animation: pop .15s ease; }
.menu button, .menu a { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 12px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; color: var(--text); font-weight: 500; text-decoration: none !important; }
.menu button:hover, .menu a:hover { background: var(--surface-2); }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--navy-900); color: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); min-width: 260px; max-width: 420px; animation: pop .25s ease; font-weight: 500; }
.toast.err { background: #8e1c1c; } .toast.ok .icon { color: #8ff0b8; }
.spotlight { max-width: 620px; }
.spotlight .input { border: 0; box-shadow: none !important; font-size: 17px; padding: 18px 20px; }
.spot-item { display: flex; gap: 12px; align-items: center; padding: 10px 20px; cursor: pointer; }
.spot-item.on, .spot-item:hover { background: var(--blue-50); }
.spot-item .ic { width: 34px; height: 34px; border-radius: 9px; background: var(--surface-2); display: grid; place-items: center; color: var(--blue-600); flex: none; }
.banner { display: flex; gap: 14px; align-items: center; padding: 14px 18px; border-radius: 14px; border: 1px solid; margin-bottom: 18px; flex-wrap: wrap; }
.banner.warn { background: var(--warn-bg); border-color: #f5dfac; color: #6b4600; }
.banner.info { background: var(--info-bg); border-color: #cfe0fb; color: var(--blue-700); }
.banner.bad { background: var(--bad-bg); border-color: #f6c9c9; color: var(--bad); }
.banner.good { background: var(--good-bg); border-color: #c4e8d3; color: var(--good); }
.banner .grow { color: var(--text); }

/* Calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.cal .dow { padding: 8px 10px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; color: var(--muted); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.cal .day { min-height: 118px; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s; overflow: hidden; }
.cal .day:hover { background: #f6f9ff; }
.cal .day.out { background: #fafbfd; color: var(--muted); }
.cal .day.sel { background: var(--blue-50); box-shadow: inset 0 0 0 2px var(--blue-500); }
.cal .dnum { font-size: 12.5px; font-weight: 700; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cal .day.today .dnum { background: var(--blue-600); color: #fff; }
.ev { display: block; font-size: 11.5px; padding: 2px 6px; border-radius: 5px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.ev.m { background: var(--blue-100); color: var(--blue-700); }
.ev.m.done { background: #edf0f5; color: var(--muted); text-decoration: line-through; }
.ev.t { background: #fff1e8; color: #b0450f; } .ev.t.done { background: #edf0f5; color: var(--muted); }
.ev.p { background: var(--good-bg); color: var(--good); }
.ev.more { color: var(--muted); background: none; }

@media (max-width: 1200px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 980px) {
  .sidebar { position: fixed; left: 0; transform: translateX(-100%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .topbar .burger { display: grid; }
  .g-2, .g-3 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .login { grid-template-columns: 1fr; }
  .login-art { padding: 32px 24px; min-height: 280px; }
  .login-art .stats { display: none; }
}
@media (max-width: 640px) {
  .topbar { padding: 10px 14px; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .search-trigger { flex: none; }
  .content { padding: 4px 14px 40px; }
  .page-head h1 { font-size: 24px; }
  .g-4 { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 13px; } .kpi .val { font-size: 19px; } .kpi .lbl .ic { display: none; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: 1fr; gap: 2px; } .kv dd { margin-bottom: 8px; }
  .filters .input, .filters .search { min-width: 0; max-width: none; flex: 1 1 140px; }
  .modal-b, .modal-h, .modal-f { padding-left: 16px; padding-right: 16px; }
  .cal .day { min-height: 64px; padding: 3px; } .ev { font-size: 0; padding: 0; height: 6px; border-radius: 3px; }
  .ev.more { font-size: 10px; height: auto; }
  .funnel-row { grid-template-columns: 110px 1fr 32px; }
  .tbl.cards thead { display: none; }
  .tbl.cards tr { display: block; padding: 12px 14px; border-bottom: 1px solid var(--border); }
  .tbl.cards td { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border: 0; text-align: right; }
  .tbl.cards td::before { content: attr(data-l); color: var(--muted); font-size: 12px; text-align: left; flex: none; }
  .tbl.cards td.first { display: block; text-align: left; font-size: 15px; }
  .tbl.cards td.first::before { display: none; }
  .toasts { left: 12px; right: 12px; } .toast { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 640px) { .hide-sm { display: none; } }
.warn-text { color: var(--warn); font-weight: 600; }
/* ============ Office-rental: brand & clickable office-unit cells ============ */
.office-logo { height: 34px; display: block; margin-bottom: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.office-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 12px; margin-bottom: 18px; }
.office-cell { position: relative; text-align: left; display: flex; flex-direction: column; gap: 6px; padding: 14px 14px 12px 17px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); cursor: pointer; transition: transform .15s, box-shadow .15s; font: inherit; color: inherit; overflow: hidden; }
.office-cell:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(14, 27, 51, .12); border-color: var(--border-strong); }
.office-cell::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--dot); }
.office-cell.occupied { background: linear-gradient(180deg, var(--surface), #f3f7ff); }
.office-cell.maintenance { background: linear-gradient(180deg, var(--surface), #fffaf0); }
.office-cell.reserved { background: linear-gradient(180deg, var(--surface), #f6f3fd); }
.oc-top { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--muted); font-weight: 700; letter-spacing: .4px; text-transform: uppercase; }
.oc-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--dot); flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--dot) 18%, transparent); }
.oc-name { font-weight: 700; font-size: 14.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oc-meta { font-size: 12px; color: var(--muted); }
.oc-status { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--dot); margin-top: 2px; }
.oc-tenant { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) { .office-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 9px; } .office-cell { padding: 11px 11px 10px 14px; } }

/* Demo credit */
.credit-line { margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--border); text-align: center; font-size: 12.5px; color: var(--muted); }
.credit-line a { color: var(--blue-600); font-weight: 600; }
.side-credit { display: block; margin: 0 16px 10px; padding: 8px 12px; border-radius: 10px; background: rgba(255, 255, 255, .06); color: #9cc2ff !important; font-size: 12px; font-weight: 600; text-align: center; text-decoration: none !important; }
.side-credit:hover { background: rgba(255, 255, 255, .12); color: #fff !important; }
/* Mobile containment: grid/flex children may shrink below their content width; never scroll the page sideways */
html, body { overflow-x: hidden; }
@supports (overflow: clip) { html, body { overflow-x: clip; } }
.main, .content, .grid > *, .card, .card-b, .kpis > * { min-width: 0; }
.chart canvas { max-width: 100%; }
.page-head > div { min-width: 0; }
.page-head h1, .kv dd, .list .t { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .page-head { margin: 10px 0 16px; }
  .page-head > .row { width: 100%; }
  .page-head > .row > .btn.primary { flex: 1; }
  .card-h .legend { width: 100%; }
  .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .filters .input[type=date] { flex: 1 1 120px; }
  .stepper .step { min-width: 104px; }
  .modal .row > .input[type=time] { min-width: 0; }
  .cal .dow { padding: 6px 2px; text-align: center; font-size: 10.5px; }
  .cal .dnum { margin: 0 auto; width: 22px; height: 22px; font-size: 11.5px; }
  .tabs button { padding: 10px 10px; }
  .kv { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) { .card-h > .row { flex-wrap: wrap; row-gap: 8px; } .card-h h3[style*='min-width'] { min-width: 0 !important; flex: 1; } }
@media (max-width: 640px) {
  .tbl.cards, .tbl.cards tbody { display: block; width: 100%; }
  .tbl.cards td { white-space: normal !important; min-width: 0 !important; align-items: flex-start; flex-wrap: wrap; overflow-wrap: anywhere; }
  .tbl.cards td > * { min-width: 0; max-width: 100%; }
  .tbl.cards td::before { margin-right: auto; padding-right: 8px; }
  .tbl.cards td.right:not([data-l]) { justify-content: flex-end; padding-top: 8px; }
  .tbl.cards td:not([data-l]):not(.first)::before { display: none; }
  .table-wrap:has(.tbl.cards) { overflow-x: visible; }
}
