:root {
  --navy: #0F2739;
  --ink: #0F2739;
  --muted: #4A5D72;
  --faint: #7A8A9B;
  --paper: #FAF7F2;
  --card: #FFFFFF;
  --line: rgba(15, 39, 57, .08);
  --line-strong: rgba(15, 39, 57, .14);
  --accent: #D9466F;
  --accent-dark: #B8345A;
  --accent-soft: rgba(217, 70, 111, .10);
  --accent-softer: rgba(217, 70, 111, .06);
  --green: #1F7A50; --green-bg: #E4F3EA;
  --amber: #9A5B00; --amber-bg: #FCEFD6;
  --red: #B83A33; --red-bg: #FBE6E4;
  --blue: #2A639C; --blue-bg: #E4EEF8;
  --gray: #4A5D72; --gray-bg: #EEF1F4;
  --violet: #6A4BB0; --violet-bg: #EEE9F8;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(15, 39, 57, .05);
  --shadow-lg: 0 24px 48px rgba(15, 39, 57, .18);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --side: 248px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 15px; line-height: 24px; color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; }
p { margin: 0; }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 16px; height: 16px; }
svg.i.lg { width: 24px; height: 24px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---------- Login ---------- */
.login {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr;
}
.login-brand {
  background: var(--navy); color: #fff; padding: 48px 64px;
  display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.login-brand .glow { position: absolute; right: -160px; bottom: -160px; width: 480px; height: 480px; border-radius: 50%;
  background: radial-gradient(circle, rgba(217,70,111,.35), rgba(217,70,111,0) 70%); pointer-events: none; }
.brand-row { display: flex; align-items: center; gap: 12px; }
.logo-mark { width: 40px; height: 40px; border-radius: 12px; background: var(--accent); display: grid; place-items: center; color: #fff; flex: none; }
.logo-mark svg { width: 24px; height: 24px; }
.brand-name { font-weight: 700; font-size: 16px; line-height: 20px; }
.brand-sub { font-size: 12px; line-height: 16px; color: rgba(255,255,255,.64); }
.login-brand h1 { font-size: 40px; line-height: 48px; max-width: 480px; letter-spacing: -.01em; }
.login-brand h1 span { color: #F3A3B9; }
.login-brand .lead { color: rgba(255,255,255,.72); max-width: 440px; margin-top: 16px; font-size: 16px; line-height: 26px; }
.login-points { display: grid; gap: 12px; margin-top: 32px; }
.login-points div { display: flex; gap: 12px; align-items: center; color: rgba(255,255,255,.86); }
.login-points svg { color: #F3A3B9; }
.login-foot { color: rgba(255,255,255,.5); font-size: 13px; }
.login-panel { display: grid; place-items: center; padding: 48px 24px; }
.login-card { width: 100%; max-width: 420px; }
.login-card h2 { font-size: 24px; line-height: 32px; }
.login-card .sub { color: var(--muted); margin-top: 4px; }
.btn-hero { width: 100%; margin-top: 24px; height: 56px; font-size: 16px; border-radius: 14px; }
.role-label { margin: 24px 0 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
.role-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.role-card {
  border: 1px solid var(--line-strong); background: #fff; border-radius: 12px; padding: 12px; text-align: left; cursor: pointer;
  display: flex; flex-direction: column; gap: 8px; min-height: 88px;
  transition: transform .2s var(--ease), border-color .2s, box-shadow .2s;
}
.role-card:hover { border-color: var(--accent); box-shadow: 0 6px 16px rgba(15,39,57,.08); transform: translateY(-1px); }
.role-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.role-card .ic { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.role-card b { font-size: 13px; line-height: 16px; }
.role-card small { font-size: 12px; line-height: 16px; color: var(--muted); }
.toggle-link { margin-top: 24px; background: none; border: 0; color: var(--ink); font-weight: 600; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 8px 0; min-height: 44px; }
.toggle-link svg { transition: transform .25s var(--ease); }
.toggle-link[aria-expanded="true"] svg { transform: rotate(180deg); }
.signin-form { display: none; gap: 12px; margin-top: 8px; }
.signin-form.open { display: grid; }
.demo-accounts { font-size: 13px; color: var(--muted); line-height: 20px; background: var(--accent-softer); border-radius: 12px; padding: 12px 16px; }
.demo-accounts code { font-family: inherit; font-weight: 600; color: var(--ink); }
.form-error { color: var(--red); font-size: 13px; font-weight: 600; min-height: 20px; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
.side {
  width: var(--side); background: var(--navy); color: #fff; position: fixed; inset: 0 auto 0 0; z-index: 40;
  display: flex; flex-direction: column; padding: 24px 16px 16px;
}
.side .brand-row { padding: 0 8px 24px; }
.nav { display: grid; gap: 4px; flex: 1; overflow-y: auto; align-content: start; }
.nav-group { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.42); padding: 16px 12px 4px; font-weight: 600; }
.nav a {
  display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,.76); padding: 10px 12px; border-radius: 10px; font-weight: 500;
  min-height: 44px; transition: background .2s, color .2s;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav a.active { background: var(--accent); color: #fff; font-weight: 600; }
.nav a .badge { margin-left: auto; background: rgba(255,255,255,.16); color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; padding: 0 8px; border-radius: 999px; }
.nav a.active .badge { background: rgba(255,255,255,.24); }
.side-foot { border-top: 1px solid rgba(255,255,255,.08); padding: 12px 8px 0; font-size: 12px; color: rgba(255,255,255,.5); display: flex; justify-content: space-between; align-items: center; }
.main { flex: 1; margin-left: var(--side); min-width: 0; display: flex; flex-direction: column; }
.strip {
  background: var(--accent-soft); color: var(--ink); font-size: 13px; line-height: 20px; padding: 8px 24px;
  display: flex; align-items: center; gap: 12px;
}
.strip .grow { flex: 1; }
.strip button.link { background: none; border: 0; color: var(--accent-dark); font-weight: 700; cursor: pointer; padding: 4px; }
.strip .x { background: none; border: 0; cursor: pointer; padding: 4px; color: var(--muted); display: grid; place-items: center; border-radius: 6px; min-width: 32px; min-height: 32px; }
.strip .x:hover { background: rgba(15,39,57,.06); }
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 16px 32px; background: var(--paper);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 24px; line-height: 32px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .hamburger { display: none; }
.user-chip { display: flex; align-items: center; gap: 12px; position: relative; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px 16px 4px 4px; cursor: pointer; min-height: 44px; }
.user-chip:hover { border-color: var(--line-strong); }
.user-chip .who { display: flex; flex-direction: column; line-height: 16px; text-align: left; }
.user-chip .who b { font-size: 13px; }
.user-chip .who small { font-size: 12px; color: var(--muted); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff; flex: none; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-lg); min-width: 220px; padding: 8px; display: none; z-index: 60;
}
.menu.open { display: block; animation: pop .18s var(--ease); }
.menu button, .menu a { display: flex; width: 100%; gap: 12px; align-items: center; background: none; border: 0; padding: 10px 12px; border-radius: 8px; cursor: pointer; color: var(--ink); text-align: left; min-height: 44px; }
.menu button:hover, .menu a:hover { background: var(--paper); text-decoration: none; }
.content { padding: 32px; max-width: 1360px; width: 100%; }
.scrim { display: none; }

/* ---------- Generic ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 24px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 20px 24px 0; }
.card-head h3 { font-size: 16px; line-height: 24px; flex: 1; }
.card-head .sub { font-size: 13px; color: var(--muted); font-weight: 500; }
.card-body { padding: 16px 24px 24px; }
.grid { display: grid; gap: 24px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stack { display: grid; gap: 24px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink); font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: transform .15s var(--ease), background .2s, border-color .2s, box-shadow .2s;
}
.btn:hover { border-color: rgba(15,39,57,.28); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(184,52,90,.3); }
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn.danger { color: var(--red); }
.btn.danger:hover { border-color: var(--red); }
.btn.danger.solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: rgba(15,39,57,.05); }
.btn.sm { height: 36px; padding: 0 12px; font-size: 14px; border-radius: 8px; }
.btn.icon { width: 44px; padding: 0; }
.btn.sm.icon { width: 36px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.field { display: grid; gap: 4px; }
.field label, .label { font-size: 13px; font-weight: 600; color: var(--muted); line-height: 20px; }
.input, select.input, textarea.input {
  height: 44px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 0 12px; background: #fff; width: 100%;
  transition: border-color .2s, box-shadow .2s;
}
textarea.input { height: auto; min-height: 96px; padding: 12px; resize: vertical; line-height: 22px; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select.input { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234A5D72' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 48px; }
.pw-eye { position: absolute; right: 2px; top: 0; height: 44px; width: 44px; display: grid; place-items: center; background: none; border: 0; cursor: pointer; color: var(--muted); border-radius: 8px; }
.pw-eye:hover { color: var(--ink); }
.search { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.search svg { position: absolute; left: 12px; top: 12px; color: var(--faint); }
.search .input { padding-left: 40px; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters select.input { width: auto; min-width: 150px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.hint { font-size: 13px; color: var(--muted); line-height: 20px; }

.pill { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 24px; }
.pill.green { background: var(--green-bg); color: var(--green); }
.pill.amber { background: var(--amber-bg); color: var(--amber); }
.pill.red { background: var(--red-bg); color: var(--red); }
.pill.blue { background: var(--blue-bg); color: var(--blue); }
.pill.gray { background: var(--gray-bg); color: var(--gray); }
.pill.violet { background: var(--violet-bg); color: var(--violet); }
.pill.accent { background: var(--accent-soft); color: var(--accent-dark); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button { padding: 12px 16px; border: 0; background: none; color: var(--muted); font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; gap: 8px; }
.tabs a:hover, .tabs button:hover { color: var(--ink); text-decoration: none; }
.tabs .active { color: var(--accent-dark); border-bottom-color: var(--accent); }
.tabs .count { font-size: 12px; background: var(--gray-bg); color: var(--muted); padding: 0 8px; border-radius: 999px; line-height: 20px; }
.tabs .active .count { background: var(--accent-soft); color: var(--accent-dark); }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.kpi { padding: 20px; display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit; transition: transform .2s var(--ease), box-shadow .2s; }
a.kpi:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(15,39,57,.07); }
.kpi .k-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 13px; font-weight: 600; line-height: 20px; }
.kpi .k-ic { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.kpi .k-val { font-size: 32px; line-height: 40px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: 13px; color: var(--muted); line-height: 20px; }

.ic-tile { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.report-card { display: flex; flex-direction: column; gap: 0; }
.report-card > p.hint { margin-bottom: 16px; }
.report-card .grow { flex: 1; }

/* Tables */
.table-wrap { overflow: auto; max-height: 640px; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; }
.t th { position: sticky; top: 0; background: #fff; text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; z-index: 1; }
.t td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr { transition: background .15s; }
.t tbody tr:hover { background: #FCFAF7; }
.t tbody tr.click { cursor: pointer; }
.t th.right, .t td.right { text-align: right; }
.t .actions { text-align: right; white-space: nowrap; }
.t .actions .btn + .btn { margin-left: 4px; }
.person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person .nm { font-weight: 600; line-height: 20px; }
.person .sb { font-size: 13px; color: var(--muted); line-height: 18px; }

/* Lists */
.list { display: grid; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); min-height: 56px; }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .t1 { font-weight: 600; line-height: 20px; }
.list-row .t2 { font-size: 13px; color: var(--muted); line-height: 20px; }
.list-row .val { font-weight: 700; font-variant-numeric: tabular-nums; }
.rank { width: 28px; height: 28px; border-radius: 8px; background: var(--paper); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--muted); flex: none; }
a.list-row { color: inherit; text-decoration: none; }
a.list-row:hover .t1 { color: var(--accent-dark); }

.empty { padding: 40px 24px; text-align: center; color: var(--muted); display: grid; place-items: center; gap: 12px; }
.empty .e-ic { width: 48px; height: 48px; border-radius: 14px; background: var(--paper); display: grid; place-items: center; color: var(--faint); }

/* Chart */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid-l { stroke: rgba(15,39,57,.08); stroke-width: 1; }
.chart .ax { fill: var(--muted); font-size: 12px; font-family: inherit; }
.chart .ln { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.chart .ar { fill: url(#hcFill); }
.chart .dot { fill: #fff; stroke: var(--accent); stroke-width: 2; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit:hover + .dot, .chart g.pt:hover .dot { r: 6; }
.chart-tip { font-size: 13px; color: var(--muted); min-height: 24px; margin-top: 8px; }
.chart-tip b { color: var(--ink); }

/* Board */
.board { display: grid; grid-template-columns: repeat(6, minmax(168px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.col { background: rgba(15,39,57,.03); border-radius: 14px; padding: 12px; min-height: 240px; transition: background .2s, box-shadow .2s; }
.col.drop { background: var(--accent-softer); box-shadow: inset 0 0 0 2px var(--accent-soft); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 4px 4px 12px; font-weight: 700; font-size: 14px; }
.col-head .dot { width: 8px; height: 8px; border-radius: 50%; }
.col-head .ct { margin-left: auto; font-size: 12px; color: var(--muted); background: #fff; border-radius: 999px; padding: 0 8px; line-height: 20px; border: 1px solid var(--line); }
.acard { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 8px; cursor: pointer; box-shadow: var(--shadow); transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; display: block; color: inherit; }
.acard:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(15,39,57,.08); border-color: var(--line-strong); text-decoration: none; }
.acard.dragging { opacity: .5; }
.acard .nm { font-weight: 700; line-height: 20px; }
.acard .jb { font-size: 13px; color: var(--muted); line-height: 18px; margin-top: 2px; }
.acard .mt { display: flex; align-items: center; justify-content: space-between; gap: 4px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: var(--muted); }
.stars { display: inline-flex; gap: 2px; color: #E3B341; }
.stars svg { width: 14px; height: 14px; }
.stars .off { color: rgba(15,39,57,.16); }
.star-input { display: inline-flex; gap: 4px; }
.star-input button { background: none; border: 0; cursor: pointer; padding: 6px; color: rgba(15,39,57,.2); border-radius: 8px; min-width: 40px; min-height: 40px; display: grid; place-items: center; }
.star-input button.on { color: #E3B341; }
.star-input button:hover { background: var(--paper); }
.star-input svg { width: 24px; height: 24px; }
.stage-select { display: none; }

/* Profile */
.profile-head { display: flex; gap: 24px; align-items: center; padding: 24px; }
.profile-head .info { flex: 1; min-width: 0; }
.profile-head h2 { font-size: 22px; line-height: 30px; }
.profile-head .meta { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); font-size: 14px; margin-top: 4px; }
.profile-head .meta span { display: inline-flex; align-items: center; gap: 6px; }
.dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; }
.dl div { min-width: 0; }
.dl dt { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; line-height: 18px; }
.dl dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.back { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; margin-bottom: 16px; min-height: 36px; }
.back:hover { color: var(--ink); text-decoration: none; }
.doc-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.doc-row:last-child { border-bottom: 0; }
.doc-row .d-ic { width: 40px; height: 40px; border-radius: 10px; background: var(--paper); display: grid; place-items: center; color: var(--muted); flex: none; }
.doc-row .grow { flex: 1; min-width: 160px; }
.notes { display: grid; gap: 12px; }
.note { background: var(--paper); border-radius: 12px; padding: 12px 16px; }
.note .n-meta { font-size: 12px; color: var(--muted); line-height: 18px; }
.balances { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.bal { padding: 20px; }
.bal .b-type { font-size: 13px; color: var(--muted); font-weight: 600; }
.bal .b-val { font-size: 28px; line-height: 36px; font-weight: 700; color: var(--accent); margin-top: 4px; font-variant-numeric: tabular-nums; }
.bal .b-val small { font-size: 14px; color: var(--muted); font-weight: 600; }
.bal .b-sub { font-size: 13px; color: var(--muted); }

/* Calendar */
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.cal-head h3 { font-size: 18px; min-width: 160px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.cal .dow { padding: 8px 12px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; background: var(--paper); border-bottom: 1px solid var(--line); }
.cal .day { min-height: 112px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 8px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal .day:nth-child(7n) { border-right: 0; }
.cal .day.out { background: #FCFBF9; }
.cal .day.out .dn { color: var(--faint); }
.cal .day.sun { background: #FBF9F6; }
.cal .dn { font-size: 13px; font-weight: 600; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; }
.cal .day.today .dn { background: var(--accent); color: #fff; }
.cal .ev { font-size: 12px; line-height: 18px; padding: 1px 8px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; cursor: default; }
.cal .ev.VL { background: var(--blue-bg); color: var(--blue); }
.cal .ev.SL { background: var(--amber-bg); color: var(--amber); }
.cal .ev.EL { background: var(--red-bg); color: var(--red); }
.cal .ev.other { background: var(--violet-bg); color: var(--violet); }
.cal .ev.pending { background: #fff; border: 1px dashed currentColor; }
.cal .more { font-size: 12px; color: var(--muted); padding-left: 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--muted); margin-top: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.cal-list { display: none; }

/* Modal and toast */
.modal-back { position: fixed; inset: 0; background: rgba(15,39,57,.42); z-index: 100; display: grid; place-items: center; padding: 24px; animation: fade .2s var(--ease); }
.modal { background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: calc(100vh - 48px); display: flex; flex-direction: column; animation: pop .25s var(--ease); }
.modal.wide { max-width: 760px; }
.modal-h { display: flex; align-items: center; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.modal-h h3 { font-size: 18px; line-height: 28px; flex: 1; }
.modal-b { padding: 24px; overflow-y: auto; }
.modal-f { display: flex; gap: 8px; justify-content: flex-end; padding: 16px 24px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.toasts { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: grid; gap: 8px; }
.toast { background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 12px; font-weight: 500; max-width: 380px; animation: up .3s var(--ease); }
.toast svg { color: #7FD3A6; }
.toast.err svg { color: #F3A3B9; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Payslip */
.slip { border: 1px solid var(--line); border-radius: 12px; padding: 24px; }
.slip-h { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.slip-line { display: flex; justify-content: space-between; padding: 8px 0; gap: 16px; }
.slip-line.total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; font-weight: 700; }
.slip-line.net { font-size: 18px; color: var(--accent-dark); font-weight: 700; }
.slip-sec { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-top: 16px; }

.banner { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: 12px; background: var(--amber-bg); color: #6B4100; font-size: 14px; line-height: 22px; }
.banner.info { background: var(--blue-bg); color: #1D4A75; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .login { grid-template-columns: 1fr; }
  .login-brand { padding: 32px 24px; }
  .login-brand h1 { font-size: 28px; line-height: 36px; }
  .login-points, .login-brand .glow { display: none; }
  .login-brand .lead { font-size: 15px; line-height: 24px; margin-top: 8px; }
  .login-foot { display: none; }
  .login-brand .brand-row { margin-bottom: 24px; }
  .login-panel { padding: 32px 16px 48px; place-items: start center; }

  .side { transform: translateX(-100%); transition: transform .3s var(--ease); width: 280px; }
  .side.open { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(15,39,57,.42); z-index: 35; opacity: 0; pointer-events: none; transition: opacity .3s var(--ease); }
  .scrim.open { opacity: 1; pointer-events: auto; }
  .main { margin-left: 0; }
  .topbar .hamburger { display: inline-flex; }
  .topbar { padding: 12px 16px; gap: 8px; }
  .topbar h1 { font-size: 20px; line-height: 28px; }
  .user-chip { padding: 4px; }
  .user-chip .who { display: none; }
  .strip { padding: 8px 16px; }
  .content { padding: 16px; }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .grid, .stack { gap: 16px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .kpi { padding: 16px; }
  .kpis > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .chart .ax { font-size: 20px; }
  .chart .ln { stroke-width: 3.5; }
  .kpi .k-val { font-size: 28px; line-height: 36px; }
  .card-head { padding: 16px 16px 0; }
  .card-body { padding: 12px 16px 16px; }
  .card-pad { padding: 16px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .dl { grid-template-columns: minmax(0, 1fr); }
  .balances { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .profile-head { flex-wrap: wrap; padding: 16px; gap: 16px; }
  .search { max-width: none; min-width: 0; flex-basis: 100%; }
  .filters select.input { flex: 1 1 calc(50% - 6px); min-width: 0; }
  .filters .spacer { display: none; }
  .filters .btn { flex: 1; }

  /* tables to stacked cards */
  .table-wrap { max-height: none; overflow: visible; }
  table.t thead { display: none; }
  table.t, .t tbody, .t tr, .t td { display: block; width: 100%; }
  .t tbody tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .t tbody tr:last-child { border-bottom: 0; }
  .t td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 16px; text-align: right; }
  .t td::before { content: attr(data-l); font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; text-align: left; flex: none; }
  .t td.lead-cell { text-align: left; padding-bottom: 8px; }
  .t td.lead-cell::before { display: none; }
  .t td.actions { justify-content: flex-end; padding-top: 8px; }
  .t td.actions::before { display: none; }
  .t td.right { text-align: right; }

  .board { grid-template-columns: repeat(6, 82%); scroll-snap-type: x mandatory; gap: 12px; }
  .col { scroll-snap-align: start; }
  .cal { display: none; }
  .cal-list { display: grid; }
  .modal-back { padding: 0; place-items: end stretch; }
  .modal { max-width: none; border-radius: 20px 20px 0 0; max-height: 92vh; }
  .modal-b { padding: 16px; }
  .modal-h, .modal-f { padding: 16px; }
  .modal-f .btn { flex: 1; }
  .toasts { left: 16px; right: 16px; bottom: 16px; }
  .toast { max-width: none; }
}

@media print {
  .side, .topbar, .strip, .no-print, .toasts, .scrim { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; }
  body { background: #fff; }
  .modal-back { position: static; background: none; padding: 0; }
  .modal { box-shadow: none; max-height: none; }
  .modal-h .btn, .modal-f { display: none; }
  body.printing-modal .shell { display: none; }
  .table-wrap { max-height: none; overflow: visible; }
  .report-card, .grid.g3 { display: none !important; }
}
.t .actions .btn { vertical-align: middle; }

/* Shared demo strip colours: identical on every EulClavie demo */
.strip { background: #FFF6E5; color: #6B4A00; border-bottom: 1px solid rgba(183, 121, 31, .22); font-size: 13px; line-height: 20px; font-weight: 500; }
.strip .ic, .strip > svg { color: #6B4A00; }
.strip button.link { color: #6B4A00; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; background: none; }
.strip button.link:hover { background: rgba(183, 121, 31, .12); }
.strip .x { color: #6B4A00; text-decoration: none; background: none; }
.strip .x:hover { background: rgba(183, 121, 31, .14); color: #6B4A00; }
