/* itovijat — cyberpunk theme. Single global stylesheet; no page adds its own CSS. */

:root {
    --bg-void: #0a0d12;
    --bg-panel: #121824;
    --bg-panel-2: #161d2b;
    --bg-hover: #1c2436;
    --border: #232c3d;
    --border-bright: #2f3b52;

    --neon-green: #00ff66;
    --neon-green-dim: #00ff6622;
    --neon-red: #ff0055;
    --neon-red-dim: #ff005522;
    --neon-amber: #ffb300;
    --neon-amber-dim: #ffb30022;
    --neon-cyan: #00d9ff;
    --neon-cyan-dim: #00d9ff22;

    --slate: #8a99ad;
    --slate-dim: #5a6b81;
    --text: #e8edf4;
    --text-bright: #ffffff;

    --radius: 10px;
    --radius-sm: 6px;
    --sidebar-w: 236px;
    --sidebar-w-collapsed: 68px;
    --topbar-h: 60px;
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.35);
    --font: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
    --mono: 'Consolas', 'SFMono-Regular', Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg-void);
    background-image:
        radial-gradient(circle at 15% 0%, rgba(0, 255, 102, 0.06), transparent 40%),
        radial-gradient(circle at 85% 20%, rgba(255, 0, 85, 0.05), transparent 40%);
    background-attachment: fixed;
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--neon-cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 4px; font-weight: 600; color: var(--text-bright); }
p { margin: 0 0 8px; }
code, .mono { font-family: var(--mono); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-panel); }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 10px; }
::selection { background: var(--neon-green-dim); color: var(--text-bright); }

/* ─── Auth pages ─────────────────────────────────────────────────────────── */

.auth-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Animated cyber-grid floor + sweeping scanline, sitting behind everything. Pure CSS, no
   external assets — a moving grid reads as "system booting" without being distracting once
   the eye adjusts to it (it's slow and low-opacity by design). */
.auth-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.auth-bg .grid {
    position: absolute; inset: -2px;
    background-image:
        linear-gradient(rgba(0, 255, 102, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 102, 0.07) 1px, transparent 1px);
    background-size: 46px 46px;
    animation: auth-grid-drift 14s linear infinite;
    -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 42%, black 20%, transparent 85%);
    mask-image: radial-gradient(ellipse 70% 55% at 50% 42%, black 20%, transparent 85%);
}
.auth-bg .scanline {
    position: absolute; left: 0; right: 0; height: 160px; top: -160px;
    background: linear-gradient(to bottom, transparent, rgba(0, 255, 102, 0.05), transparent);
    animation: auth-scan-sweep 6s ease-in-out infinite;
}
@keyframes auth-grid-drift { from { background-position: 0 0, 0 0; } to { background-position: 46px 46px, 46px 46px; } }
@keyframes auth-scan-sweep { 0% { top: -160px; } 55%, 100% { top: 110%; } }

.auth-wrap { position: relative; z-index: 1; width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: stretch; }

/* Terminal-style boot readout, typed in by JS on load. Static markup with no JS is just blank —
   the login form itself never depends on it, so a disabled/slow browser degrades gracefully. */
.boot-log {
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--neon-green);
    text-shadow: 0 0 8px rgba(0, 255, 102, 0.45);
    min-height: 78px;
    line-height: 1.75;
    white-space: pre-wrap;
    margin: 0 4px 14px;
    opacity: 0.92;
}
.boot-log .cursor {
    display: inline-block; width: 7px; height: 13px; margin-left: 2px; vertical-align: -2px;
    background: var(--neon-green); box-shadow: 0 0 6px rgba(0, 255, 102, 0.8);
    animation: boot-cursor-blink 0.9s step-end infinite;
}
@keyframes boot-cursor-blink { 50% { opacity: 0; } }

.auth-card {
    width: 100%;
    background: var(--bg-panel);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius);
    padding: 36px 32px;
    box-shadow: var(--shadow-card), 0 0 60px rgba(0, 255, 102, 0.04);
    animation: auth-card-in 0.5s ease-out, auth-card-pulse 3.2s ease-in-out 0.5s infinite;
}
@keyframes auth-card-in {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes auth-card-pulse {
    0%, 100% { box-shadow: var(--shadow-card), 0 0 30px rgba(0, 255, 102, 0.07); border-color: var(--border-bright); }
    50% { box-shadow: var(--shadow-card), 0 0 46px rgba(0, 255, 102, 0.2); border-color: rgba(0, 255, 102, 0.35); }
}
.auth-logo { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 22px; }
.auth-logo img { height: 42px; width: auto; filter: drop-shadow(0 0 10px rgba(0, 255, 102, 0.25)); }
.auth-logo .brand { font-size: 20px; font-weight: 700; color: var(--text-bright); letter-spacing: 0.5px; }
.auth-logo .brand span { color: var(--neon-green); }
.auth-sub { text-align: center; color: var(--slate); font-size: 12.5px; margin-bottom: 24px; text-transform: uppercase; letter-spacing: 1.5px; }

@media (prefers-reduced-motion: reduce) {
    .auth-bg .grid, .auth-bg .scanline, .auth-card, .boot-log .cursor { animation: none; }
}

/* ─── Forms ──────────────────────────────────────────────────────────────── */

label { display: block; font-size: 12px; font-weight: 600; color: var(--slate); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.4px; }
.field { margin-bottom: 16px; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=datetime-local], input[type=search], input[type=file],
input[type=url], input[type=tel], select, textarea {
    width: 100%;
    background: var(--bg-void);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    color: var(--text);
    font-size: 14px;
    font-family: var(--font);
    transition: border-color 0.15s, box-shadow 0.15s;
}
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238a99ad' stroke-width='1.6' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--neon-green);
    box-shadow: 0 0 0 3px var(--neon-green-dim);
}
input::placeholder, textarea::placeholder { color: var(--slate-dim); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.hint { font-size: 11.5px; color: var(--slate-dim); margin-top: 4px; text-transform: none; letter-spacing: 0; }
.error-text { font-size: 12px; color: var(--neon-red); margin-top: 4px; }
input[readonly] { opacity: .6; cursor: not-allowed; }

/* ─── Buttons ────────────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1.5px solid var(--border-bright);
    background: var(--bg-panel-2);
    color: var(--text);
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { background: var(--bg-hover); border-color: var(--slate); text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--neon-green); border-color: var(--neon-green); color: #06110a; }
.btn-primary:hover { background: #22ff7d; box-shadow: 0 0 16px rgba(0, 255, 102, 0.4); }
.btn-danger { background: transparent; border-color: var(--neon-red); color: var(--neon-red); }
.btn-danger:hover { background: var(--neon-red-dim); }
.btn-danger-solid { background: var(--neon-red); border-color: var(--neon-red); color: #fff; }
.btn-danger-solid:hover { box-shadow: 0 0 16px rgba(255, 0, 85, 0.4); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--slate); }
.btn-ghost:hover { color: var(--text); background: var(--bg-hover); }
.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; width: 34px; height: 34px; }

/* ─── Layout: sidebar + topbar ──────────────────────────────────────────── */

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-panel);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width 0.2s, transform 0.2s;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    height: var(--topbar-h);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    overflow: hidden;
}
.sidebar-brand img { height: 30px; width: 30px; object-fit: contain; flex-shrink: 0; }
.sidebar-brand .brand-text { font-weight: 700; font-size: 16px; color: var(--text-bright); white-space: nowrap; }
.sidebar-brand .brand-text span { color: var(--neon-green); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.nav-section { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--slate-dim); padding: 14px 10px 6px; white-space: nowrap; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--slate);
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--neon-green-dim); color: var(--neon-green); }
.nav-item .ic { width: 18px; text-align: center; flex-shrink: 0; font-size: 15px; }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--border); flex-shrink: 0; }

body.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
body.sidebar-collapsed .sidebar-brand .brand-text,
body.sidebar-collapsed .nav-item span:not(.ic),
body.sidebar-collapsed .nav-section { display: none; }
body.sidebar-collapsed .main { margin-left: var(--sidebar-w-collapsed); }
body.sidebar-collapsed .topbar { left: var(--sidebar-w-collapsed); }

/* min-width: 0 overrides the flex-item default of min-width:auto, which otherwise sizes .main
   to its widest descendant's intrinsic content (e.g. a 640px-min-width table) and pushes the
   whole page wider than the viewport instead of letting .table-wrap's own overflow-x scroll it. */
/* flex: 1 makes .main actually stretch to fill .app-shell's row (it's the only real flex item —
   .sidebar and .sidebar-backdrop are position:fixed, so they don't participate in flex sizing).
   Without it, a flex item's default flex-grow:0 leaves it shrink-wrapped to its own content width,
   which is what was quietly capping the whole app narrower than the viewport on wide screens. */
.main { flex: 1; margin-left: var(--sidebar-w); min-height: 100vh; min-width: 0; transition: margin-left 0.2s; display: flex; flex-direction: column; }

.topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-h);
    background: rgba(18, 24, 36, 0.85);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 50;
    gap: 16px;
}
.topbar-title { font-size: 16px; font-weight: 700; color: var(--text-bright); }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.sidebar-toggle { background: none; border: none; color: var(--slate); font-size: 20px; cursor: pointer; padding: 4px 8px; }
.sidebar-toggle:hover { color: var(--text); }

.avatar {
    width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 700; color: #06110a;
    background: var(--neon-green); flex-shrink: 0;
}
/* Role-coded background, matching the same admin=red / management=amber / executive=cyan
   scheme as .badge-role-* elsewhere, so the avatar communicates who someone is at a glance. */
.avatar-admin { background: var(--neon-red); }
.avatar-management { background: var(--neon-amber); }
.avatar-executive { background: var(--neon-cyan); }
.user-menu { position: relative; }
.user-menu-btn { display: flex; align-items: center; gap: 8px; background: none; border: none; cursor: pointer; color: var(--text); padding: 4px; border-radius: var(--radius-sm); }
.user-menu-btn:hover { background: var(--bg-hover); }
.user-name-role { text-align: left; display: none; }
.user-name-role .un { font-size: 13px; font-weight: 600; display: block; }
.user-name-role .ur { font-size: 10.5px; color: var(--slate); text-transform: uppercase; }
@media (min-width: 640px) { .user-name-role { display: block; } }
.dropdown-menu {
    position: absolute; right: 0; top: calc(100% + 8px);
    background: var(--bg-panel-2); border: 1px solid var(--border-bright); border-radius: var(--radius);
    min-width: 180px; box-shadow: var(--shadow-card); overflow: hidden; z-index: 200;
    display: none;
}
.dropdown-menu.open { display: block; }
.dropdown-menu a, .dropdown-menu button {
    display: block; width: 100%; text-align: left; padding: 10px 14px; color: var(--text);
    background: none; border: none; font-size: 13px; cursor: pointer; font-family: var(--font);
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--bg-hover); text-decoration: none; }
.dropdown-menu .divider { height: 1px; background: var(--border); margin: 4px 0; }

/* Bottom padding reserves room for the fixed FAB (56px + 24px offset) so it never sits on top
   of the last row of real content — it would otherwise both obscure it and steal its taps. */
.content { padding: 22px 28px 100px; flex: 1; min-width: 0; width: 100%; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 21px; }
.page-head .sub { color: var(--slate); font-size: 13px; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 90; }

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); width: var(--sidebar-w); }
    body.sidebar-mobile-open .sidebar { transform: translateX(0); }
    body.sidebar-mobile-open .sidebar-backdrop { display: block; }
    .main, body.sidebar-collapsed .main { margin-left: 0; }
    .topbar, body.sidebar-collapsed .topbar { left: 0; }
    .content { padding: 14px 14px 110px; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }

    /* ── Touch targets: Apple/Google both recommend >=44px for anything tappable.
       Desktop keeps tighter, mouse-friendly density; mobile gets more finger room. ── */
    .btn { min-height: 46px; padding: 12px 18px; font-size: 14px; }
    .btn-sm { min-height: 40px; padding: 9px 14px; }
    .btn-icon { width: 42px; height: 42px; }
    .sidebar-toggle { min-width: 44px; min-height: 44px; font-size: 22px; }
    .user-menu-btn { padding: 8px; }
    .modal-close { min-width: 40px; min-height: 40px; font-size: 26px; }

    /* 16px stops iOS Safari auto-zooming the page when a field is focused. */
    input[type=text], input[type=email], input[type=password], input[type=number],
    input[type=date], input[type=datetime-local], input[type=search], input[type=file],
    input[type=url], input[type=tel], select, textarea {
        padding: 13px 14px; font-size: 16px;
    }

    .nav-item { padding: 14px 12px; font-size: 15px; }
    .dropdown-menu { min-width: 200px; }
    .dropdown-menu a, .dropdown-menu button { padding: 14px; font-size: 14.5px; }
    .tab-btn { padding: 14px 16px; font-size: 13.5px; }
    .kanban-card { padding: 14px; margin-bottom: 10px; }
    .kanban-card .kc-title { font-size: 14px; }
    thead th { padding: 12px; }
    tbody td { padding: 15px 12px; }
    .row-actions { gap: 10px; }
    .row-actions .btn { min-width: 40px; }
    .vault-secret .reveal-btn { min-width: 40px; min-height: 40px; font-size: 18px; }
    .pagination a, .pagination span { min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
    .tl-reply-link { padding: 8px 0; font-size: 13px; }

    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-bar select, .filter-bar input, .filter-bar .search-box { width: 100%; min-width: 0; }

    /* Primary action ends up on top (column-reverse) since that's the one a thumb reaches for. */
    .modal-foot { flex-direction: column-reverse; }
    .modal-foot .btn { width: 100%; }
    .head-actions { width: 100%; }
    .head-actions .btn { flex: 1 1 auto; }

    .fab { width: 60px; height: 60px; font-size: 28px; }
}

/* ─── Cards / stat tiles ─────────────────────────────────────────────────── */

.card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 18px;
    /* Cards sit as grid items inside .chart-grid on several pages. Grid/flex items default to
       min-width:auto, which lets a card's own content (e.g. a nested .detail-grid with
       minmax(180px,...) tracks) force the card wider than its column — even after .chart-grid
       itself has correctly collapsed to one column on mobile. min-width:0 lets it actually shrink
       to fit instead of pushing the whole page into horizontal overflow. */
    min-width: 0;
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
.card-head h2 { font-size: 15px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-tile {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-left: 3px solid var(--neon-green);
    border-radius: var(--radius);
    padding: 16px 18px;
}
.stat-tile.warn { border-left-color: var(--neon-amber); }
.stat-tile.danger { border-left-color: var(--neon-red); }
.stat-tile.info { border-left-color: var(--neon-cyan); }
.stat-tile .label { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--slate); margin-bottom: 8px; }
.stat-tile .value { font-size: 26px; font-weight: 700; color: var(--text-bright); }
.stat-tile .value.green { color: var(--neon-green); }
.stat-tile .value.red { color: var(--neon-red); }
.stat-tile .value.amber { color: var(--neon-amber); }
.stat-tile .delta { font-size: 12px; color: var(--slate); margin-top: 4px; }

.chart-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
/* !important is deliberate here: several detail pages set a per-page column ratio via an inline
   style="grid-template-columns:..." (e.g. "1.3fr 1fr"), and a plain media-query class rule can
   never beat an inline style on specificity — only !important does. Without it these pages were
   stuck in their 2-column ratio at every width, including mobile, which is what was pushing their
   whole layout wider than the viewport instead of collapsing to a single column. */
@media (max-width: 1100px) { .chart-grid { grid-template-columns: 1fr !important; } }
.chart-box { position: relative; height: 280px; }

/* ─── Badges / pills ─────────────────────────────────────────────────────── */

.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 999px;
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
    border: 1px solid transparent; white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--neon-green-dim); color: var(--neon-green); border-color: rgba(0,255,102,0.3); }
.badge-danger { background: var(--neon-red-dim); color: var(--neon-red); border-color: rgba(255,0,85,0.3); }
.badge-warn { background: var(--neon-amber-dim); color: var(--neon-amber); border-color: rgba(255,179,0,0.3); }
.badge-info { background: var(--neon-cyan-dim); color: var(--neon-cyan); border-color: rgba(0,217,255,0.3); }
.badge-role-admin { background: var(--neon-red-dim); color: var(--neon-red); }
.badge-role-management { background: var(--neon-amber-dim); color: var(--neon-amber); }
.badge-role-executive { background: var(--neon-cyan-dim); color: var(--neon-cyan); }
.priority-Urgent { color: var(--neon-red); font-weight: 700; }
.priority-High { color: var(--neon-amber); font-weight: 700; }
.priority-Medium { color: var(--neon-cyan); }
.priority-Low { color: var(--slate); }

/* ─── Tables ─────────────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; min-width: 640px; display: table; }
thead { display: table-header-group; }
tbody { display: table-row-group; }
thead th {
    display: table-cell;
    text-align: left; padding: 12px 14px; background: var(--bg-panel-2);
    color: var(--slate); font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px;
    border-bottom: 1px solid var(--border-bright); white-space: nowrap;
}
tbody td { display: table-cell; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
tbody tr { display: table-row; }
tbody tr td { background: var(--bg-panel); transition: background 0.1s; }
tbody tr:hover td { background: var(--bg-hover); }
tbody tr:last-child td { border-bottom: none; }
tbody tr.clickable { cursor: pointer; }
.table-empty { text-align: center; padding: 40px 20px; color: var(--slate-dim); }
.row-actions { display: flex; gap: 6px; }
.text-muted { color: var(--slate); }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ─── Filters bar ────────────────────────────────────────────────────────── */

.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filter-bar select, .filter-bar input { width: auto; min-width: 140px; }
.filter-bar .search-box { flex: 1; min-width: 200px; position: relative; }
.filter-bar .search-box input { width: 100%; padding-left: 34px; }
.filter-bar .search-box::before { content: '🔍'; position: absolute; left: 11px; top: 50%; transform: translateY(-50%); font-size: 12px; opacity: 0.5; }

/* ─── Tabs ───────────────────────────────────────────────────────────────── */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tab-btn { background: none; border: none; color: var(--slate); padding: 10px 16px; font-size: 13px; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; font-family: var(--font); }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--neon-green); border-bottom-color: var(--neon-green); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.tab-count { background: var(--bg-panel-2); color: var(--slate); font-size: 11px; padding: 1px 8px; border-radius: 999px; margin-left: 4px; }
.tab-btn.active .tab-count { color: var(--neon-green); }

/* ─── Modal ──────────────────────────────────────────────────────────────── */

.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(5, 7, 10, 0.75);
    backdrop-filter: blur(2px); z-index: 300; align-items: flex-start; justify-content: center;
    padding: 40px 16px; overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal {
    background: var(--bg-panel); border: 1px solid var(--border-bright); border-radius: var(--radius);
    width: 100%; max-width: 560px; box-shadow: var(--shadow-card); animation: modal-in 0.15s ease-out;
}
.modal.modal-lg { max-width: 820px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 16px; }
.modal-close { background: none; border: none; color: var(--slate); font-size: 22px; cursor: pointer; line-height: 1; padding: 0 4px; }
.modal-close:hover { color: var(--neon-red); }
.modal-body { padding: 20px; max-height: 70vh; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }

/* ─── Toasts ─────────────────────────────────────────────────────────────── */

.toast-stack { position: fixed; top: 18px; right: 18px; z-index: 999; display: flex; flex-direction: column; gap: 10px; max-width: 340px; }
.toast {
    background: var(--bg-panel-2); border: 1px solid var(--border-bright); border-left: 4px solid var(--neon-green);
    border-radius: var(--radius-sm); padding: 12px 16px; box-shadow: var(--shadow-card);
    font-size: 13px; animation: toast-in 0.2s ease-out; display: flex; align-items: flex-start; gap: 8px;
}
.toast.error { border-left-color: var(--neon-red); }
.toast.warn { border-left-color: var(--neon-amber); }
@keyframes toast-in { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(30px); } }

/* ─── Loading / spinner ──────────────────────────────────────────────────── */

.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.2); border-top-color: currentColor; border-radius: 50%; animation: spin 0.6s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn.loading { opacity: 0.75; pointer-events: none; }
.skeleton { background: linear-gradient(90deg, var(--bg-panel-2) 25%, var(--bg-hover) 50%, var(--bg-panel-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ─── Floating action button ─────────────────────────────────────────────── */

.fab-wrap { position: fixed; bottom: 24px; right: 24px; z-index: 80; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.fab {
    width: 56px; height: 56px; border-radius: 50%; background: var(--neon-green); color: #06110a;
    border: none; font-size: 26px; cursor: pointer; box-shadow: 0 4px 20px rgba(0, 255, 102, 0.45);
    display: flex; align-items: center; justify-content: center; transition: transform 0.15s;
}
.fab:hover { transform: scale(1.07) rotate(90deg); }
.fab-menu { display: none; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.fab-menu.open { display: flex; }
.fab-menu .btn { box-shadow: var(--shadow-card); }

/* ─── Kanban (tasks/projects) ────────────────────────────────────────────── */

.kanban-card {
    background: var(--bg-panel-2); border: 1px solid var(--border); border-left: 3px solid var(--neon-cyan);
    border-radius: var(--radius-sm); padding: 12px; margin-bottom: 8px; cursor: pointer; transition: border-color 0.15s;
}
.kanban-card:hover { border-color: var(--slate); }
.kanban-card .kc-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-bright); }
.kanban-card .kc-meta { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--slate); }
.task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; align-items: start; min-width: 0; }
.task-grid .kanban-card { margin-bottom: 0; }

/* ─── Timeline / nested logs ─────────────────────────────────────────────── */

.timeline { position: relative; padding-left: 4px; }
.tl-item { position: relative; padding: 0 0 18px 26px; border-left: 2px solid var(--border); }
.tl-item:last-child { border-color: transparent; padding-bottom: 0; }
.tl-item::before { content: ''; position: absolute; left: -6px; top: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--neon-green); box-shadow: 0 0 0 3px var(--bg-panel); }
.tl-item.nested { margin-left: 26px; border-left-color: var(--border); }
.tl-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; margin-bottom: 4px; flex-wrap: wrap; }
.tl-head .who { font-weight: 700; color: var(--text-bright); }
.tl-head .when { color: var(--slate-dim); font-size: 11px; }
.tl-body { font-size: 13px; color: var(--text); background: var(--bg-panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.tl-attachment { margin-top: 6px; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.tl-reply-link { font-size: 11.5px; color: var(--slate); background: none; border: none; cursor: pointer; margin-top: 6px; padding: 0; }
.tl-reply-link:hover { color: var(--neon-green); }

/* ─── Vault ──────────────────────────────────────────────────────────────── */

.vault-secret { display: flex; align-items: center; gap: 8px; font-family: var(--mono); background: var(--bg-void); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; }
.vault-secret .reveal-btn { background: none; border: none; color: var(--slate); cursor: pointer; font-size: 14px; }
.vault-secret .reveal-btn:hover { color: var(--neon-green); }
.vault-locked { color: var(--slate-dim); font-style: italic; font-size: 12.5px; }

/* ─── Progress / stage tracker ───────────────────────────────────────────── */

.stage-tracker { display: flex; align-items: center; margin-bottom: 20px; overflow-x: auto; padding-bottom: 4px; }
.stage-step { display: flex; align-items: center; flex-shrink: 0; }
.stage-dot { width: 26px; height: 26px; border-radius: 50%; background: var(--bg-panel-2); border: 2px solid var(--border-bright); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--slate); flex-shrink: 0; }
.stage-step.done .stage-dot { background: var(--neon-green); border-color: var(--neon-green); color: #06110a; }
.stage-step.current .stage-dot { border-color: var(--neon-green); color: var(--neon-green); box-shadow: 0 0 0 4px var(--neon-green-dim); }
.stage-label { font-size: 11px; color: var(--slate); margin-left: 8px; white-space: nowrap; }
.stage-step.done .stage-label, .stage-step.current .stage-label { color: var(--text); }
.stage-line { width: 30px; height: 2px; background: var(--border-bright); margin: 0 8px; flex-shrink: 0; }
.stage-step.done + .stage-step .stage-line, .stage-line.done { background: var(--neon-green); }

/* ─── Misc ───────────────────────────────────────────────────────────────── */

.empty-state { text-align: center; padding: 60px 20px; color: var(--slate-dim); }
.empty-state .ic { font-size: 40px; margin-bottom: 12px; opacity: 0.5; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-sm { gap: 6px; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.small { font-size: 12px; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.detail-grid .dg-item .dg-label { font-size: 11px; text-transform: uppercase; color: var(--slate); letter-spacing: 0.5px; margin-bottom: 3px; }
.detail-grid .dg-item .dg-value { font-size: 14px; color: var(--text-bright); font-weight: 600; }
.pagination { display: flex; gap: 6px; justify-content: flex-end; margin-top: 14px; }
.pagination a, .pagination span { padding: 6px 11px; border-radius: var(--radius-sm); border: 1px solid var(--border); font-size: 12.5px; color: var(--slate); }
.pagination a:hover { color: var(--text); border-color: var(--slate); text-decoration: none; }
.pagination .current { background: var(--neon-green-dim); color: var(--neon-green); border-color: rgba(0,255,102,.3); }
.progress-bar { height: 6px; background: var(--bg-panel-2); border-radius: 999px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--neon-green); border-radius: 999px; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg-panel-2); border: 1px solid var(--border); padding: 5px 10px; border-radius: var(--radius-sm); font-size: 12px; }
