/* =====================================================================
   Workora — design system
   Modern SaaS look: tokens, layout, components, dark mode, responsive.
   ===================================================================== */

/* ---------------------------------------------------------------- tokens */
:root {
    --bg: #f6f7f9;
    --bg-elevated: #ffffff;
    --surface: #ffffff;
    --surface-2: #f1f3f7;
    --surface-3: #e9ecf2;
    --border: #e3e7ee;
    --border-strong: #d2d8e2;
    --text: #0f172a;
    --text-muted: #64748b;
    --text-subtle: #94a3b8;

    --primary: #1e40af;
    --primary-hover: #1e3a8a;
    --primary-soft: #e8efff;
    --primary-contrast: #ffffff;
    --success: #16a34a;
    --success-soft: #e7f7ee;
    --warning: #d97706;
    --warning-soft: #fdf3e3;
    --danger: #dc2626;
    --danger-soft: #fdeceb;
    --info: #0284c7;
    --info-soft: #e5f4fd;
    --neutral: #64748b;
    --neutral-soft: #eef1f5;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;

    --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .04);
    --shadow: 0 6px 18px rgba(15, 23, 42, .07), 0 2px 6px rgba(15, 23, 42, .04);
    --shadow-lg: 0 18px 45px rgba(15, 23, 42, .14);

    --sidebar-w: 260px;
    --topbar-h: 64px;
    --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --transition: .18s cubic-bezier(.4, 0, .2, 1);
}

[data-theme="dark"] {
    --bg: #0b1020;
    --bg-elevated: #111830;
    --surface: #141b33;
    --surface-2: #1b2440;
    --surface-3: #232e4d;
    --border: #26304d;
    --border-strong: #33405f;
    --text: #e8edf7;
    --text-muted: #9aa7c2;
    --text-subtle: #6b7899;

    --primary: #60a5fa;
    --primary-hover: #93c5fd;
    --primary-soft: #1e2a4a;
    --primary-contrast: #0b1020;
    --success: #4ade80;
    --success-soft: #14301f;
    --warning: #fbbf24;
    --warning-soft: #33280e;
    --danger: #f87171;
    --danger-soft: #3a1c1c;
    --info: #38bdf8;
    --info-soft: #0e2a3a;
    --neutral: #94a3b8;
    --neutral-soft: #232e4d;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .5);
    --shadow: 0 8px 24px rgba(0, 0, 0, .45);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, .6);
}

/* ---------------------------------------------------------------- reset */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, h5 { margin: 0 0 .4em; font-weight: 650; letter-spacing: -.01em; line-height: 1.25; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
img { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.2rem 0; }
::selection { background: var(--primary); color: var(--primary-contrast); }

/* ---------------------------------------------------------------- layout */
.app { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background: var(--bg-elevated);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
    z-index: 40;
}
.sidebar__brand {
    display: flex; align-items: center; gap: 10px;
    padding: 18px 20px; height: var(--topbar-h);
    border-bottom: 1px solid var(--border);
}
.brand-mark {
    width: 34px; height: 34px; border-radius: 10px; flex: 0 0 34px;
    background: linear-gradient(135deg, var(--primary), #22d3ee);
    display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 17px;
}
.brand-logo {
    width: 34px; height: 34px; flex: 0 0 34px; object-fit: contain; border-radius: 8px;
}
.brand-logo-full {
    width: 200px; max-width: 100%; height: auto; display: block;
}
.brand-logo--dark { display: none; }
[data-theme="dark"] .brand-logo--light { display: none; }
[data-theme="dark"] .brand-logo--dark { display: block; }
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.brand-sub { font-size: 11px; color: var(--text-subtle); }

.sidebar__nav { padding: 12px 12px 30px; overflow-y: auto; flex: 1; }
.nav-section { margin-top: 14px; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-subtle); padding: 8px 12px 4px; font-weight: 700; }
.nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 12px; border-radius: 10px; color: var(--text-muted);
    font-weight: 550; font-size: 14px; margin-bottom: 2px;
    transition: background var(--transition), color var(--transition);
}
.nav-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-item.is-active { background: var(--primary-soft); color: var(--primary); font-weight: 650; }
[data-theme="dark"] .nav-item.is-active { color: var(--primary); }
.nav-item .icon { width: 18px; height: 18px; flex: 0 0 18px; stroke-width: 1.8; }
.nav-item .nav-badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; }
.nav-item.is-active .nav-badge { background: var(--primary); color: var(--primary-contrast); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    height: var(--topbar-h); display: flex; align-items: center; gap: 14px;
    padding: 0 22px; background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 30;
}
.topbar__title { font-size: 16px; font-weight: 700; margin: 0; }
.topbar__spacer { flex: 1; }
.content { padding: 24px 22px 60px; max-width: 1400px; width: 100%; }
.page-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head__titles { flex: 1; min-width: 220px; }
.page-head h1 { margin: 0; font-size: 1.45rem; }
.page-head p { margin: 2px 0 0; color: var(--text-muted); font-size: 13.5px; }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- grid */
.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row--between { justify-content: space-between; }
.col { flex: 1; min-width: 0; }

/* ---------------------------------------------------------------- card */
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-xs);
}
.card__head { padding: 16px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.card__head h2, .card__head h3 { margin: 0; font-size: 15px; }
.card__head .card__actions { margin-left: auto; display: flex; gap: 8px; }
.card__body { padding: 18px; }
.card__body--flush { padding: 0; }
.card__foot { padding: 14px 18px; border-top: 1px solid var(--border); }

.kpi { display: flex; flex-direction: column; gap: 6px; padding: 18px; }
.kpi__label { font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.kpi__value { font-size: 1.7rem; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; }
.kpi__meta { font-size: 12.5px; color: var(--text-subtle); }
.kpi__icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }

/* ---------------------------------------------------------------- buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 15px; border-radius: 10px; font-size: 14px; font-weight: 600;
    border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
    cursor: pointer; transition: all var(--transition); text-decoration: none; white-space: nowrap;
    line-height: 1.2;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn .icon { width: 16px; height: 16px; }
.btn--primary { background: var(--primary); border-color: var(--primary); color: var(--primary-contrast); box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn--success { background: var(--success); border-color: var(--success); color: #fff; }
.btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn--lg { padding: 12px 20px; font-size: 15px; }
.btn--block { width: 100%; }
.btn:disabled, .btn[disabled] { opacity: .55; cursor: not-allowed; }

.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; border-right-width: 0; }
.btn-group .btn:first-child { border-radius: 10px 0 0 10px; }
.btn-group .btn:last-child { border-radius: 0 10px 10px 0; border-right-width: 1px; }

/* ---------------------------------------------------------------- badges */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 650;
    background: var(--neutral-soft); color: var(--neutral); white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--success { background: var(--success-soft); color: var(--success); }
.badge--warning { background: var(--warning-soft); color: var(--warning); }
.badge--danger  { background: var(--danger-soft); color: var(--danger); }
.badge--info    { background: var(--info-soft); color: var(--info); }
.badge--primary { background: var(--primary-soft); color: var(--primary); }
.badge--neutral { background: var(--neutral-soft); color: var(--neutral); }
.badge--lg { padding: 5px 12px; font-size: 13px; }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.8px; }
.tbl th {
    text-align: left; font-weight: 650; color: var(--text-muted); font-size: 12px;
    text-transform: uppercase; letter-spacing: .04em; padding: 11px 14px;
    border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap;
}
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .muted { color: var(--text-muted); }

/* ---------------------------------------------------------------- avatars */
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--surface-3); flex: 0 0 auto; }
.avatar--sm { width: 28px; height: 28px; }
.avatar--lg { width: 52px; height: 52px; }
.avatar--xl { width: 84px; height: 84px; }
.avatar-init { display: grid; place-items: center; font-weight: 700; color: var(--text-muted); background: var(--surface-3); border-radius: 50%; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell__name { font-weight: 600; }
.user-cell__meta { font-size: 12px; color: var(--text-subtle); }

/* ---------------------------------------------------------------- forms */
.field { margin-bottom: 16px; }
.label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.label .req { color: var(--danger); }
.hint { font-size: 12px; color: var(--text-subtle); margin-top: 5px; }
.input, .select, .textarea {
    width: 100%; padding: 10px 13px; border-radius: 10px; font-size: 14px; font-family: inherit;
    border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
    transition: border var(--transition), box-shadow var(--transition);
}
.input:focus, .select:focus, .textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
.textarea { min-height: 110px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.input:disabled, .select:disabled { background: var(--surface-2); color: var(--text-muted); }
.input.is-error, .select.is-error { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 12.5px; margin-top: 5px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-grid .field--full { grid-column: 1 / -1; }

.checkbox, .radio { display: flex; align-items: flex-start; gap: 9px; font-size: 14px; cursor: pointer; }
.checkbox input, .radio input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--primary); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { display: none; }
.switch__track { width: 42px; height: 24px; border-radius: 999px; background: var(--surface-3); position: relative; transition: background var(--transition); }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-xs); transition: transform var(--transition); }
.switch input:checked + .switch__track { background: var(--primary); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }

/* ---------------------------------------------------------------- alerts */
.alert { display: flex; gap: 11px; padding: 13px 15px; border-radius: var(--radius); font-size: 14px; border: 1px solid transparent; margin-bottom: 14px; align-items: flex-start; }
.alert__icon { flex: 0 0 18px; margin-top: 1px; }
.alert--success { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 30%, transparent); color: var(--success); }
.alert--error, .alert--danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: var(--danger); }
.alert--warning { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 30%, transparent); color: var(--warning); }
.alert--info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, transparent); color: var(--info); }

/* ---------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab { padding: 10px 14px; font-size: 14px; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; text-decoration: none; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.is-active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---------------------------------------------------------------- progress */
.progress { height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress__bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), #22d3ee); transition: width .4s ease; }
.progress--sm { height: 5px; }

/* ---------------------------------------------------------------- kanban */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.kanban__col {
    flex: 0 0 288px; width: 288px; background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius-lg); display: flex; flex-direction: column; max-height: calc(100vh - 230px);
}
.kanban__head { padding: 13px 14px; display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 13.5px; }
.kanban__count { margin-left: auto; background: var(--surface-3); color: var(--text-muted); font-size: 12px; font-weight: 700; border-radius: 999px; padding: 1px 9px; }
.kanban__drop { padding: 10px; overflow-y: auto; flex: 1; min-height: 60px; display: flex; flex-direction: column; gap: 10px; }
.kanban__drop.is-over { background: var(--primary-soft); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.kcard {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 12px; cursor: grab; box-shadow: var(--shadow-xs); transition: box-shadow var(--transition), transform var(--transition);
}
.kcard:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.kcard.is-dragging { opacity: .5; }
.kcard__title { font-weight: 620; font-size: 13.8px; margin-bottom: 7px; }
.kcard__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text-subtle); }
.kcard__foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.kcard__tags { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.priority-bar { width: 3px; border-radius: 3px; align-self: stretch; }

/* ---------------------------------------------------------------- misc */
.divider { height: 1px; background: var(--border); margin: 4px 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); font-size: 12.5px; color: var(--text-muted); font-weight: 550; }
.chip--active { background: var(--primary-soft); color: var(--primary); }
.tag { font-size: 12px; color: var(--text-muted); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; }
.flex-1 { flex: 1; }
.hidden { display: none !important; }

.empty { text-align: center; padding: 46px 20px; color: var(--text-muted); }
.empty__icon { width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-subtle); }
.empty h3 { color: var(--text); margin-bottom: 4px; }
.empty p { max-width: 380px; margin: 0 auto 16px; }

.pager { display: flex; align-items: center; gap: 12px; padding: 14px 4px 0; flex-wrap: wrap; }
.pager__info { font-size: 12.5px; color: var(--text-subtle); }
.pager__links { margin-left: auto; display: flex; gap: 4px; }
.pager__link { padding: 6px 11px; border-radius: 8px; font-size: 13px; color: var(--text-muted); border: 1px solid transparent; text-decoration: none; }
.pager__link:hover { background: var(--surface-2); text-decoration: none; }
.pager__link--active { background: var(--primary); color: var(--primary-contrast); font-weight: 700; }
.pager__gap { padding: 6px 4px; color: var(--text-subtle); }

.avatar-upload { position: relative; width: 84px; }
.avatar-upload input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.stat-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.stat-row:last-child { border-bottom: 0; }
.stat-row__label { color: var(--text-muted); font-size: 13.5px; }
.stat-row__value { margin-left: auto; font-weight: 650; }

.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline__item { position: relative; padding-bottom: 16px; }
.timeline__item::before { content: ""; position: absolute; left: -20px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.timeline__time { font-size: 12px; color: var(--text-subtle); }

.comment { display: flex; gap: 11px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.comment:last-child { border-bottom: 0; }
.comment__body { flex: 1; min-width: 0; }
.comment__head { display: flex; align-items: baseline; gap: 8px; }
.comment__name { font-weight: 650; font-size: 13.5px; }
.comment__time { font-size: 12px; color: var(--text-subtle); }
.comment__text { white-space: pre-wrap; margin-top: 2px; }

.tag-input { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- dropdown */
.dropdown { position: relative; }
.dropdown__menu {
    position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; z-index: 60;
    background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); padding: 6px; display: none;
}
.dropdown.is-open .dropdown__menu { display: block; animation: pop .14s ease; }
.dropdown__item { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 8px; color: var(--text); font-size: 14px; font-weight: 550; cursor: pointer; }
.dropdown__item:hover { background: var(--surface-2); text-decoration: none; }
.dropdown__sep { height: 1px; background: var(--border); margin: 5px 0; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- modal */
.modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto; background: rgba(15,23,42,.5); backdrop-filter: blur(2px); }
.modal.is-open { display: flex; }
.modal__panel { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; animation: pop .16s ease; }
.modal__panel--wide { max-width: 760px; }
.modal__head { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.modal__head h3 { margin: 0; font-size: 16px; }
.modal__close { margin-left: auto; background: none; border: 0; cursor: pointer; color: var(--text-muted); font-size: 22px; line-height: 1; }
.modal__body { padding: 20px; }
.modal__foot { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ---------------------------------------------------------------- toast */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.toast { display: flex; gap: 10px; padding: 13px 15px; border-radius: var(--radius); background: var(--bg-elevated); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-size: 13.5px; animation: slideIn .2s ease; }
.toast--success { border-left: 3px solid var(--success); }
.toast--error { border-left: 3px solid var(--danger); }
.toast--info { border-left: 3px solid var(--info); }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- auth */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
    background: radial-gradient(1100px 520px at 50% -10%, color-mix(in srgb, var(--primary) 22%, transparent), transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 420px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); padding: 34px 30px; }
.auth-card__brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-card h1 { font-size: 1.35rem; margin-bottom: 4px; }
.auth-card .sub { color: var(--text-muted); font-size: 14px; margin-bottom: 22px; }
.auth-foot { text-align: center; margin-top: 18px; font-size: 13.5px; color: var(--text-muted); }

/* ---------------------------------------------------------------- charts */
.chart { width: 100%; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 10px; }
.bars__item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars__bar { width: 100%; max-width: 46px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, var(--primary), var(--primary-hover)); min-height: 3px; transition: height .5s ease; }
.bars__label { font-size: 11.5px; color: var(--text-subtle); }
.bars__value { font-size: 11.5px; font-weight: 700; color: var(--text-muted); }
.donut-legend { display: flex; flex-direction: column; gap: 8px; }
.legend-item { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.legend-swatch { width: 11px; height: 11px; border-radius: 3px; flex: 0 0 11px; }
.legend-item .val { margin-left: auto; font-weight: 700; }

/* ---------------------------------------------------------------- responsive */
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 39; }
.icon-btn { display: none; }

@media (max-width: 1080px) {
    .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
    .sidebar {
        position: fixed; left: 0; top: 0; height: 100vh; transform: translateX(-100%);
        transition: transform var(--transition); box-shadow: var(--shadow-lg);
    }
    body.nav-open .sidebar { transform: none; }
    body.nav-open .sidebar-backdrop { display: block; }
    .icon-btn { display: inline-flex; }
    .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .content { padding: 18px 15px 60px; }
    .topbar { padding: 0 15px; }
    .topbar__title { font-size: 15px; }
    .kanban__col { flex-basis: 82vw; width: 82vw; }
}
@media (max-width: 560px) {
    .grid--4 { grid-template-columns: 1fr 1fr; }
    .card__body { padding: 15px; }
    .page-head__actions .btn { flex: 1; }
}

/* Location capture helper */
.geo-status {
    font-size: 12.5px;
    line-height: 1.5;
    margin-top: 8px;
    min-height: 1.2em;
    color: var(--text-muted);
}
.geo-status.ok { color: var(--success); }
.geo-status.warn { color: var(--warning); }
.geo-status.error { color: var(--danger); }
.geo-hint {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 12.5px;
    color: var(--text-muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-top: 10px;
}
.geo-hint svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.geo-optin {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13.5px;
    color: var(--text);
    margin-top: 12px;
    cursor: pointer;
    user-select: none;
}
.geo-optin input { width: 16px; height: 16px; accent-color: var(--primary); flex: none; }

@media print {
    .sidebar, .topbar, .no-print, .toasts { display: none !important; }
    .content { padding: 0; max-width: none; }
    .card { box-shadow: none; border-color: #ccc; }
    body { background: #fff; }
}
