/* ==========================================================================
   Ketpy All-in-One ERP — Theme
   Dark-blue base + Ketpy ember accent (#FF5A36). Light + dark modes.
   Fonts: Bricolage Grotesque (display) + Hanken Grotesk (body).
   ========================================================================== */

:root {
    /* Ketpy brand */
    --ember: #FF5A36;
    --ember-600: #F0431F;
    --ember-soft: rgba(255, 90, 54, 0.12);

    /* Dark-blue palette (primary chrome) */
    --navy-900: #0B1220;
    --navy-800: #111A2E;
    --navy-700: #1A2540;
    --navy-600: #24314F;
    --navy-500: #33426A;

    /* Light surface */
    --paper: #F6F8FC;
    --card: #FFFFFF;
    --border: #E4E9F2;
    --ink: #1A2540;
    --muted: #64748B;
    --muted-2: #94A3B8;

    --green: #16A34A;
    --amber: #D97706;
    --red: #DC2626;
    --sky: #0284C7;

    --radius: 14px;
    --radius-sm: 9px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .04);
    --shadow: 0 4px 16px rgba(16, 24, 40, .08);
    --shadow-lg: 0 12px 40px rgba(11, 18, 32, .16);

    --sidebar-w: 262px;
    --font-body: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Bricolage Grotesque', var(--font-body);

    --bg: var(--paper);
    --fg: var(--ink);
    --surface: var(--card);
    --surface-2: #FBFCFE;
}

[data-theme="dark"] {
    --bg: #0A0F1C;
    --fg: #E6ECF6;
    --surface: #111A2E;
    --surface-2: #0E1626;
    --border: #223050;
    --card: #111A2E;
    --ink: #E6ECF6;
    --muted: #93A1BC;
    --muted-2: #6B7A99;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
    --shadow: 0 6px 20px rgba(0,0,0,.4);
    --shadow-lg: 0 16px 44px rgba(0,0,0,.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--fg);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .display { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; }

a { color: inherit; text-decoration: none; }

/* ---------- Auth screen ---------- */
.auth-wrap {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    background: var(--navy-900);
}
.auth-hero {
    position: relative;
    padding: 56px;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background:
        radial-gradient(1000px 500px at 80% -10%, rgba(255,90,54,.22), transparent 60%),
        radial-gradient(900px 600px at -10% 110%, rgba(51,66,106,.7), transparent 55%),
        linear-gradient(160deg, #0B1220, #16223E);
    overflow: hidden;
}
.auth-hero::after {
    content: "";
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: radial-gradient(700px 500px at 70% 20%, #000, transparent);
}
.auth-hero > * { position: relative; z-index: 1; }
.auth-brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.auth-hero h1 { font-size: 42px; line-height: 1.08; margin-top: auto; }
.auth-hero h1 .grad {
    background: linear-gradient(90deg, var(--ember), #FF9270);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.auth-hero p.lede { color: #AEBBD6; margin-top: 16px; max-width: 440px; font-size: 15.5px; }
.auth-pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.auth-pill { font-size: 12.5px; padding: 7px 13px; border-radius: 999px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.11); color: #C7D2E8; }
.auth-foot { color: #6B7A99; font-size: 12.5px; margin-top: 30px; }

.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--bg); }
.auth-card { width: 100%; max-width: 388px; }
.auth-card h2 { font-size: 26px; }
.auth-card .sub { color: var(--muted); margin: 6px 0 26px; }

.logo-badge {
    width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
    background: linear-gradient(150deg, var(--ember), var(--ember-600));
    color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 20px;
    box-shadow: 0 6px 16px rgba(255,90,54,.4);
}

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--fg); margin-bottom: 7px; }
.field .hint { color: var(--muted); font-weight: 400; font-size: 12px; }
.input, .select, textarea.input {
    width: 100%; padding: 11px 13px; font-size: 14.5px; font-family: inherit;
    color: var(--fg); background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, textarea.input:focus {
    outline: none; border-color: var(--ember);
    box-shadow: 0 0 0 3px var(--ember-soft);
}
.input::placeholder { color: var(--muted-2); }
.field.has-error .input { border-color: var(--red); }
.err-text { color: var(--red); font-size: 12.5px; margin-top: 6px; }
.input-group { position: relative; }
.input-group .toggle-pass {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 600;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
    padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
    transition: transform .05s, box-shadow .15s, background .15s; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(150deg, var(--ember), var(--ember-600)); color: #fff; box-shadow: 0 6px 16px rgba(255,90,54,.32); }
.btn-primary:hover { box-shadow: 0 8px 22px rgba(255,90,54,.42); }
.btn-block { width: 100%; }
.btn-ghost { background: var(--surface); color: var(--fg); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-icon { padding: 8px; width: 34px; height: 34px; }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

.sidebar {
    background: linear-gradient(180deg, var(--navy-900), var(--navy-800));
    color: #C7D2E8; padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
    border-right: 1px solid rgba(255,255,255,.05);
}
.sidebar .brand { display: flex; align-items: center; gap: 11px; padding: 8px 8px 18px; }
.sidebar .brand .name { font-family: var(--font-display); font-weight: 700; color: #fff; font-size: 16px; line-height: 1.1; }
.sidebar .brand .name small { display: block; font-size: 10.5px; color: #6B7A99; font-weight: 500; letter-spacing: .02em; }

.nav-group { margin-top: 14px; }
.nav-group .label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #5C6C8C; padding: 0 10px 8px; font-weight: 700; }
.nav-item {
    display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px;
    color: #AEBBD6; font-size: 14px; font-weight: 500; margin-bottom: 2px; transition: background .12s, color .12s;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; }
.nav-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-item.active { background: var(--ember-soft); color: #fff; box-shadow: inset 3px 0 0 var(--ember); }
.nav-item.active svg { color: var(--ember); opacity: 1; }
.nav-item .badge { margin-left: auto; font-size: 10px; background: rgba(255,255,255,.08); color: #93A1BC; padding: 2px 7px; border-radius: 999px; font-weight: 600; }
.nav-item.locked { opacity: .5; cursor: default; }
.nav-item.locked:hover { background: transparent; color: #AEBBD6; }

/* ---------- Topbar ---------- */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
    height: 62px; display: flex; align-items: center; gap: 14px; padding: 0 24px;
    background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20;
}
.topbar .page-title { font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.topbar .spacer { flex: 1; }
.icon-btn {
    width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2);
    display: grid; place-items: center; cursor: pointer; color: var(--muted);
}
.icon-btn:hover { color: var(--ember); border-color: var(--ember); }
.icon-btn svg { width: 18px; height: 18px; }

.user-chip { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 5px; border-radius: 10px; position: relative; }
.user-chip:hover { background: var(--surface-2); }
.avatar {
    width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(150deg, var(--navy-500), var(--navy-700));
    color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; font-family: var(--font-display);
}
.user-chip .who { line-height: 1.1; }
.user-chip .who b { font-size: 13.5px; }
.user-chip .who span { font-size: 11.5px; color: var(--muted); }

.dropdown { position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 210px; padding: 7px; display: none; z-index: 40; }
.dropdown.open { display: block; }
.dropdown a, .dropdown button {
    display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 11px; border-radius: 9px;
    font-size: 13.5px; color: var(--fg); background: none; border: 0; cursor: pointer; font-family: inherit;
}
.dropdown a:hover, .dropdown button:hover { background: var(--surface-2); }
.dropdown a svg, .dropdown button svg { width: 16px; height: 16px; color: var(--muted); }
.dropdown .sep { height: 1px; background: var(--border); margin: 6px 4px; }

/* Notifications */
.notif-wrap { position: relative; }
.notif-dropdown { min-width: 300px; max-width: 340px; padding: 0; max-height: 70vh; overflow-y: auto; }
.notif-dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--ember); border: 2px solid var(--surface); }

/* Mobile sidebar close (hidden on desktop) */
.sidebar-close { display: none; margin-left: auto; background: none; border: 0; color: #AEBBD6; cursor: pointer; padding: 4px; border-radius: 8px; }
.sidebar-close:hover { background: rgba(255,255,255,.08); color: #fff; }

/* ---------- Content ---------- */
.content { padding: 26px 24px 40px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; }
.page-head .desc { color: var(--muted); font-size: 14px; margin-top: 3px; }

/* ---------- Cards / grid ---------- */
.grid { display: grid; gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.card-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-head h3 { font-size: 15.5px; }

/* KPI tiles */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm);
    position: relative; overflow: hidden;
}
.kpi .kpi-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--ember-soft); color: var(--ember); margin-bottom: 14px; }
.kpi .kpi-icon svg { width: 20px; height: 20px; }
.kpi .kpi-label { color: var(--muted); font-size: 13px; }
.kpi .kpi-value { font-family: var(--font-display); font-weight: 700; font-size: 26px; margin-top: 2px; }
.kpi .kpi-delta { font-size: 12px; font-weight: 700; margin-top: 6px; display: inline-flex; align-items: center; gap: 4px; }
.kpi .kpi-delta.up { color: var(--green); }
.kpi .kpi-delta.down { color: var(--red); }

/* stat mini row */
.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.mini { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; }
.mini .v { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.mini .l { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* module cards */
.module-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.module-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); transition: transform .12s, box-shadow .12s; position: relative; }
.module-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.module-card .m-icon { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 12px; }
.module-card .m-icon svg { width: 21px; height: 21px; }
.module-card h4 { font-size: 15px; }
.module-card p { color: var(--muted); font-size: 12.5px; margin-top: 5px; line-height: 1.45; }
.module-card .phase-tag { position: absolute; top: 14px; right: 14px; font-size: 10.5px; font-weight: 700; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); padding: 3px 8px; border-radius: 999px; }
.m-blue   { background: rgba(2,132,199,.12); color: var(--sky); }
.m-green  { background: rgba(22,163,74,.12); color: var(--green); }
.m-amber  { background: rgba(217,119,6,.12); color: var(--amber); }
.m-orange { background: var(--ember-soft); color: var(--ember); }
.m-purple { background: rgba(139,92,246,.14); color: #8B5CF6; }
.m-violet { background: rgba(124,58,237,.14); color: #7C3AED; }
.m-sky    { background: rgba(14,165,233,.12); color: #0EA5E9; }
.m-slate  { background: rgba(51,66,106,.14); color: var(--navy-500); }
[data-theme="dark"] .m-slate { color: #93A1BC; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
table.data td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--surface-2); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* pills / badges */
.pill { font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; display: inline-block; }
.pill-green { background: rgba(22,163,74,.13); color: var(--green); }
.pill-red { background: rgba(220,38,38,.12); color: var(--red); }
.pill-gray { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.pill-ember { background: var(--ember-soft); color: var(--ember); }
.tag { font-size: 12px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); padding: 2px 9px; border-radius: 7px; display: inline-block; margin: 2px 2px 0 0; }

/* ---------- Flash / alerts ---------- */
.flash-stack { position: fixed; top: 74px; right: 24px; z-index: 60; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.flash { padding: 13px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start; animation: slidein .25s ease; border: 1px solid; }
.flash.success { background: #ECFDF3; border-color: #ABEFC6; color: #067647; }
.flash.error { background: #FEF3F2; border-color: #FDA29B; color: #B42318; }
[data-theme="dark"] .flash.success { background: #06281B; border-color: #16A34A; color: #6EE7A8; }
[data-theme="dark"] .flash.error { background: #2B1210; border-color: #DC2626; color: #FCA5A5; }
@keyframes slidein { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ---------- Role builder ---------- */
.perm-module { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 12px; overflow: hidden; }
.perm-module-head { display: flex; align-items: center; justify-content: space-between; padding: 11px 15px; background: var(--surface-2); cursor: pointer; }
.perm-module-head h4 { font-size: 13.5px; text-transform: capitalize; }
.perm-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 14px 15px; }
.perm-check { display: flex; align-items: center; gap: 9px; font-size: 13px; padding: 7px 9px; border-radius: 8px; cursor: pointer; }
.perm-check:hover { background: var(--surface-2); }
.perm-check input { width: 16px; height: 16px; accent-color: var(--ember); }

/* checkbox / switch */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--muted-2); border-radius: 999px; transition: .2s; }
.switch .track::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .track { background: var(--ember); }
.switch input:checked + .track::before { transform: translateX(18px); }

/* forms 2col */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form-grid .col-span-2 { grid-column: span 2; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--border); }
.checkbox-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: 14px; }

/* empty states */
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty svg { width: 44px; height: 44px; opacity: .4; margin-bottom: 12px; }

.footer-note { text-align: center; color: var(--muted-2); font-size: 12px; padding: 18px; }

/* pagination */
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 20px; }
.pager a, .pager span { padding: 7px 12px; border-radius: 8px; border: 1px solid var(--border); font-size: 13px; color: var(--fg); }
.pager .current { background: var(--ember); color: #fff; border-color: var(--ember); }
.pager .disabled { opacity: .4; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* responsive */
@media (max-width: 1100px) {
    .kpi-grid, .module-grid { grid-template-columns: repeat(2, 1fr); }
    .mini-stats { grid-template-columns: repeat(2, 1fr); }
    .perm-list { grid-template-columns: repeat(2, 1fr); }
    /* Any two-column content grid collapses on tablets */
    .grid[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
}
@media (max-width: 820px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s; width: min(86vw, 300px); box-shadow: var(--shadow-lg); }
    .sidebar.open { transform: none; }
    .sidebar-close { display: grid; place-items: center; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .col-span-2 { grid-column: span 1; }
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-hero { display: none; }
    .auth-panel { padding: 28px 20px; }
    .menu-toggle { display: grid !important; }
    /* Topbar tightens; user name hidden, only avatar */
    .topbar { padding: 0 14px; gap: 8px; }
    .topbar .page-title { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46vw; }
    .user-chip .who { display: none; }
    #pwa-install { display: none !important; }
    /* Dropdowns clamp to viewport */
    .dropdown { right: -4px; min-width: 220px; max-width: 92vw; }
    .notif-dropdown { min-width: 84vw; max-width: 92vw; }
    /* Content spacing */
    .content { padding: 18px 14px 32px; }
    .page-head { flex-direction: column; align-items: stretch; gap: 12px; }
    .page-head h1 { font-size: 21px; }
    .page-head > div:last-child { display: flex; flex-wrap: wrap; gap: 8px; }
    .page-head .btn { flex: 1; justify-content: center; }
    /* KPI + stats single column-ish */
    .kpi-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px; }
    .kpi .kpi-value { font-size: 22px; }
    .module-grid { grid-template-columns: 1fr !important; }
    /* Filters stack */
    .filters { flex-direction: column; align-items: stretch; }
    .filters .input, .filters .select, .filters .btn { width: 100%; max-width: none !important; }
    .filters label { display: none; }
    /* Form action buttons full-width */
    .form-actions { flex-direction: column-reverse; }
    .form-actions .btn { width: 100%; justify-content: center; }
    /* Cards padding */
    .card-pad { padding: 16px; }
    .card-head { padding: 14px 16px; flex-wrap: wrap; gap: 8px; }
    /* Login flashes fit */
    .flash-stack { left: 12px; right: 12px; top: 68px; max-width: none; }
}
@media (max-width: 480px) {
    .kpi-grid, .mini-stats { grid-template-columns: 1fr !important; }
    .page-head .btn { font-size: 13px; padding: 9px 12px; }
    h1 { font-size: 20px; }
    table.data th, table.data td { padding: 10px 12px; }
    .kanban { grid-auto-columns: 80vw; }
}
/* ---------- Dashboard chart rows ---------- */
.chart-row { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .chart-row { grid-template-columns: 1fr; } }

/* ---------- Kanban board ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.kan-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); min-height: 120px; }
.kan-col-head { padding: 12px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; }
.kan-col-head .t { font-weight: 700; font-size: 13.5px; }
.kan-col-head .v { font-size: 11.5px; color: var(--muted); }
.kan-col-body { padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.kan-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; box-shadow: var(--shadow-sm); }
.kan-card:hover { box-shadow: var(--shadow); }
.kan-card .k-title { font-weight: 600; font-size: 13.5px; }
.kan-card .k-party { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kan-card .k-amt { font-family: var(--font-display); font-weight: 700; font-size: 15px; margin-top: 8px; }
.kan-card .k-move { margin-top: 9px; }
.kan-card .k-move select { width: 100%; font-size: 12px; padding: 5px 8px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface-2); color: var(--fg); }
.kan-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }

.menu-toggle { display: none; }
.backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 40; }
.backdrop.show { display: block; }

/* ---------- Print (reports & in-app documents) ---------- */
@media print {
    @page { margin: 0; }
    :root, body { background: #fff !important; color: #000; }
    .sidebar, .topbar, .backdrop, .flash-stack, .footer-note,
    .filters, .pager, .page-head > div:last-child, #pwa-install { display: none !important; }
    .shell, .main { display: block; }
    .content { padding: 12mm; }
    .card { box-shadow: none !important; border: 1px solid #ddd; break-inside: avoid; }
    .card-head { border-color: #ddd; }
    table.data th { background: #111 !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    a { color: #000; text-decoration: none; }
    .pill { border: 1px solid #ccc; }
}
