:root {
    --ink: #0f1117;
    --ink-2: #374151;
    --muted: #6b7280;
    --muted-2: #9ca3af;
    --line: #e5e7eb;
    --line-2: #f3f4f6;
    --panel: #ffffff;
    --page: #f5f6f8;
    --blue: #2563eb;
    --blue-hover: #1d4ed8;
    --blue-light: #eff6ff;
    --cyan: #0891b2;
    --green: #059669;
    --red: #dc2626;
    --amber: #d97706;
    --navy: #0c0e14;
    --navy-2: #13161f;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,.07), 0 2px 6px rgba(0,0,0,.04);
    --shadow-lg: 0 12px 40px rgba(0,0,0,.11), 0 4px 14px rgba(0,0,0,.06);
    --shadow-xl: 0 24px 64px rgba(0,0,0,.15), 0 8px 24px rgba(0,0,0,.08);
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 14px;
    --t-fast: .12s ease;
    --t-base: .18s ease;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    color: var(--ink);
    background: var(--page);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -.01em;
}

button, input, select, textarea {
    font: inherit;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: var(--navy);
    background-image:
        radial-gradient(ellipse 80% 60% at 20% 50%, rgba(37,99,235,.18) 0%, transparent 60%),
        radial-gradient(ellipse 60% 80% at 80% 20%, rgba(8,145,178,.12) 0%, transparent 55%);
}

.login-panel {
    width: min(900px, calc(100vw - 32px));
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 20px;
    align-items: stretch;
}

.brand-block, .login-card, .panel, .kpi, .playbooks article, .phase-card, .profile-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.brand-block {
    padding: 42px 44px;
    color: #fff;
    background: linear-gradient(135deg, rgba(13,17,30,.9) 0%, rgba(20,30,55,.85) 100%);
    border-color: rgba(255,255,255,.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.brand-block h1 {
    margin: 14px 0 16px;
    font-size: clamp(38px, 5.5vw, 64px);
    line-height: 1;
    font-weight: 800;
    letter-spacing: -.03em;
}

.brand-block p { max-width: 560px; color: rgba(255, 255, 255, .86); }

.logo-mark {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    color: white;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: .02em;
    flex-shrink: 0;
}

.login-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.login-facts span {
    padding: 7px 12px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    color: rgba(255,255,255,.72);
    background: rgba(255,255,255,.05);
}

.login-card {
    padding: 36px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
    background: #fff;
    border-radius: 16px;
}

label { display: grid; gap: 6px; color: var(--ink-2); font-size: 13px; font-weight: 500; }
input, select, textarea {
    width: 100%;
    border: 1.5px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    background: #fff;
    color: var(--ink);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
    outline: none;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
textarea { min-height: 94px; resize: vertical; }

button, .primary-button {
    border: 0;
    border-radius: 8px;
    padding: 10px 16px;
    background: var(--blue);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
button:hover, .primary-button:hover { background: var(--blue-hover); }
button:active, .primary-button:active { transform: scale(.98); }

.hint, .alert { margin: 0; font-size: 13px; }
.alert { color: var(--red); }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 260px;
    padding: 18px 14px;
    background: var(--navy);
    color: white;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    border-right: 1px solid rgba(255,255,255,.06);
}

.sidebar-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 8px 14px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    margin-bottom: 4px;
}
.sidebar-brand span { display: block; color: rgba(255,255,255,.45); font-size: 11px; margin-top: 2px; letter-spacing: .02em; }
.sidebar-brand strong { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }

.sidebar nav { display: grid; gap: 2px; }
.sidebar a, .logout-form button {
    color: rgba(255,255,255,.62);
    text-decoration: none;
    padding: 9px 11px;
    border-radius: 8px;
    background: transparent;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background var(--t-fast), color var(--t-fast);
}
.sidebar a:hover { background: rgba(255,255,255,.07); color: rgba(255,255,255,.9); }
.sidebar a.active {
    background: rgba(255,255,255,.1);
    color: #fff;
    font-weight: 600;
}
.logout-form { margin-top: auto; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.07); }
.logout-form button {
    width: 100%;
    background: transparent;
    border: 1px solid rgba(255,255,255,.12);
    color: rgba(255,255,255,.5);
    font-size: 13px;
}
.logout-form button:hover { background: rgba(255,255,255,.07); color: rgba(255,255,255,.8); }

.app-main {
    margin-left: 260px;
    padding: 28px 32px;
    display: grid;
    gap: 20px;
}

.topbar, .panel-head, .requirement-top, .table-row, .client-row, .task-row, .incident-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
h2 { margin-bottom: 0; font-size: 19px; font-weight: 700; letter-spacing: -.015em; }
h3 { margin-bottom: 8px; font-size: 15px; font-weight: 600; }
p { color: var(--muted); line-height: 1.6; font-size: 14px; }
.eyebrow { margin-bottom: 4px; color: var(--blue); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }

.user-pill {
    display: flex; align-items: center; gap: 10px;
    background: #fff; border: 1px solid var(--line);
    border-radius: 999px; padding: 7px 14px;
    font-size: 13px; font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.client-context {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}
.client-context strong, .client-context span { display: block; }
.client-context span { color: var(--muted); font-size: 13px; margin-top: 2px; }
.context-switcher { display: flex; gap: 10px; align-items: center; min-width: min(420px, 100%); }
.text-button {
    color: var(--blue);
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.workflow-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 170px auto;
    gap: 18px;
    align-items: center;
    padding: 18px;
    border-radius: 8px;
    border: 1px solid rgba(15, 111, 183, .22);
    background: linear-gradient(135deg, #ffffff, #eef7fb);
    box-shadow: 0 18px 42px rgba(16, 36, 55, .1);
}
.workflow-hero h2 { margin-bottom: 4px; }
.workflow-hero p { margin-bottom: 0; }
.workflow-meter strong {
    display: block;
    font-size: 30px;
}
.workflow-meter span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 8px;
    text-transform: uppercase;
    font-weight: 850;
}
.workflow-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}
.workflow-actions a {
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--blue);
    color: #fff;
    font-weight: 850;
    text-decoration: none;
}

.workflow-runner {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 18px 0;
}
.runner-step {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #f8fafc;
}
.runner-step span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #d9e2ec;
    font-weight: 900;
}
.runner-step strong, .runner-step small { display: block; }
.runner-step small {
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.runner-step.active {
    background: #eef7fb;
    border-color: rgba(26, 166, 183, .38);
}
.runner-step.active span {
    background: var(--cyan);
    color: #fff;
}

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { padding: 20px; transition: box-shadow var(--t-base), transform var(--t-base); }
.kpi:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.kpi span, .kpi small { display: block; color: var(--muted); font-size: 13px; }
.kpi strong { display: block; font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0; }
.kpi.danger strong { color: var(--red); }

.split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 20px; }
.panel { padding: 22px; overflow: hidden; }

.client-list, .task-list { display: grid; gap: 12px; margin-top: 18px; }
.client-row, .task-row, .incident-row {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px 16px;
    background: #fff;
    transition: box-shadow var(--t-base), border-color var(--t-base);
}
.task-row:hover, .incident-row:hover { box-shadow: var(--shadow-md); border-color: rgba(37,99,235,.2); }
.client-row { display: grid; }
.client-row span, .task-row small { color: var(--muted); font-size: 13px; }
.row-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.risk { padding: 4px 8px; border-radius: 999px; background: #eef2f6; font-size: 12px; font-weight: 750; }
.progress { height: 7px; border-radius: 999px; background: #e8eef4; overflow: hidden; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--cyan)); }

.tenant-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}
.tenant-card {
    display: grid;
    gap: 12px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: inherit;
    text-decoration: none;
}
.tenant-card:hover {
    border-color: rgba(37,99,235,.3);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}
.tenant-card { transition: box-shadow var(--t-base), border-color var(--t-base), transform var(--t-base); }
.tenant-head, .tenant-actions, .metric-bubbles {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.tenant-head { justify-content: space-between; }
.tenant-card > span { color: var(--muted); font-size: 13px; }
.metric-bubbles b {
    padding: 6px 9px;
    border-radius: 999px;
    background: #eef2f6;
    font-size: 12px;
}
.tenant-actions a {
    padding: 8px 10px;
    border-radius: 8px;
    background: #e7f1fb;
    color: var(--blue);
    font-size: 13px;
    font-weight: 850;
    text-decoration: none;
}
.tenant-row .metric-bubbles, .tenant-row .tenant-actions { margin-top: 8px; }

.badge {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    background: var(--line-2);
    color: var(--ink-2);
    letter-spacing: .01em;
}
.badge-critical, .badge-high, .badge-early_warning_due { background: #fee2e2; color: #b91c1c; }
.badge-medium, .badge-planned, .badge-requested, .badge-followup_due { background: #fef3c7; color: #92400e; }
.badge-low, .badge-done, .badge-approved, .badge-registered, .badge-closed { background: #d1fae5; color: #065f46; }
.badge-in_progress, .badge-reported_72h, .badge-uploaded { background: #dbeafe; color: #1e40af; }

.requirements-grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.requirement-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 15px;
    background: #fff;
    display: grid;
    gap: 10px;
}
.requirement-card p, .requirement-card small { margin: 0; color: var(--muted); }
.requirement-top span { color: var(--blue); font-weight: 800; font-size: 12px; }
.inline-form, .stack-form { display: grid; gap: 8px; }
.inline-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.inline-form button { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; }

.onboarding-layout {
    margin-top: 18px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 18px;
    align-items: start;
}
.phase-board, .phase-steps, .onboarding-side, .program-groups { display: grid; gap: 12px; }
.phase-card, .profile-card { padding: 16px; box-shadow: none; }
.phase-head {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    margin-bottom: 12px;
}
.phase-head span {
    display: block;
    color: var(--blue);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}
.phase-head strong { font-size: 22px; }
.progress.small { height: 9px; }
.step-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 140px minmax(150px, .7fr) 54px;
    gap: 8px;
    align-items: start;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}
.workflow-step-form {
    grid-template-columns: minmax(260px, 1fr) 150px minmax(180px, .7fr) minmax(180px, .7fr) minmax(160px, .7fr) minmax(180px, .7fr) 150px 110px;
}
.workflow-step-form textarea {
    min-height: 44px;
}
.step-row select[name="client_id"] { grid-column: 1 / -1; }
.step-row p, .program-row p { margin: 3px 0 4px; font-size: 13px; }
.step-row small, .program-row small { color: var(--muted); font-size: 12px; }
.compact-form {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #fff;
}
.compact-form h3 { margin: 0 0 4px; }
.compact-form textarea { min-height: 70px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.profile-card dl { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; margin: 12px 0; }
.profile-card dt { color: var(--muted); font-size: 13px; }
.profile-card dd { margin: 0; font-weight: 750; }
.timeline {
    display: grid;
    gap: 10px;
}
.timeline article {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: #fff;
}
.timeline strong, .timeline span {
    display: block;
}
.timeline span {
    color: var(--muted);
    font-size: 12px;
    margin-top: 3px;
}
.timeline p {
    margin: 8px 0 0;
    font-size: 13px;
}
.document-row {
    display: grid;
    grid-template-columns: minmax(150px, .7fr) minmax(220px, 1fr) minmax(130px, .6fr) 150px 120px;
}
.program-groups { margin-top: 18px; }
.program-group {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.program-group summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    cursor: pointer;
    background: var(--page);
}
.program-group summary > span { color: var(--muted); font-size: 13px; }
.program-table { display: grid; }
.program-row {
    display: grid;
    grid-template-columns: minmax(260px, 1.3fr) 90px minmax(160px, .7fr) 135px minmax(130px, .6fr) 132px minmax(140px, .7fr) 92px;
    gap: 8px;
    align-items: start;
    padding: 12px 14px;
    border-top: 1px solid var(--line);
}

.deadline-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.deadline-grid span { padding: 8px; background: #f5f8fb; border-radius: 8px; font-size: 12px; color: var(--muted); }
.deadline-grid b { display: block; color: var(--ink); }

.table { display: grid; gap: 8px; margin-top: 18px; }
.table-row { align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.table-row span { color: var(--muted); }

.playbooks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.playbooks article { padding: 18px; }

/* ===== CLIENT HERO BAR ===== */
.client-hero-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px auto;
    gap: 20px;
    align-items: center;
    padding: 22px 24px;
    background: linear-gradient(135deg, var(--navy) 0%, #1a4a6e 100%);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 12px 40px rgba(16,36,55,.22);
    color: white;
}
.client-hero-info { display: flex; align-items: center; gap: 16px; }
.client-avatar {
    flex-shrink: 0;
    width: 52px; height: 52px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    display: grid; place-items: center;
    font-size: 17px; font-weight: 900; color: #fff;
}
.client-hero-name { margin: 0 0 4px; color: #fff; font-size: 22px; }
.client-hero-sector { margin: 0 0 8px; color: rgba(255,255,255,.68); font-size: 13px; }
.client-hero-badges { display: flex; flex-wrap: wrap; gap: 6px; }

.compliance-score-ring { position: relative; width: 100px; height: 100px; flex-shrink: 0; }
.score-svg { transform: rotate(-90deg); display: block; }
.score-inner {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
}
.score-inner strong { font-size: 20px; font-weight: 900; color: #fff; line-height: 1; }
.score-inner small { font-size: 10px; color: rgba(255,255,255,.65); text-transform: uppercase; font-weight: 800; }

.client-hero-right { display: flex; flex-direction: column; gap: 14px; align-items: flex-end; }
.client-hero-risk { text-align: right; }
.client-hero-risk .eyebrow { margin-bottom: 2px; color: rgba(255,255,255,.6); }
.risk-number { display: block; font-size: 28px; font-weight: 900; line-height: 1; }
.risk-number small { display: block; font-size: 11px; font-weight: 600; margin-top: 2px; }
.risk-high { color: #ff7070; }
.risk-medium { color: #fbbf24; }
.risk-ok { color: #6ee7b7; }
.client-hero-actions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
.client-hero-actions a {
    padding: 8px 11px; border-radius: 8px;
    background: rgba(255,255,255,.12); color: rgba(255,255,255,.9);
    font-size: 12px; font-weight: 800; text-decoration: none;
    border: 1px solid rgba(255,255,255,.14);
    transition: background .15s;
}
.client-hero-actions a:hover { background: rgba(255,255,255,.22); }
.print-btn { background: rgba(26,166,183,.3) !important; }

/* ===== KPI STRIP ===== */
.client-kpi-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}
.kpi-strip-item {
    padding: 16px 18px;
    border-radius: 10px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--line);
    background: #fff;
    transition: box-shadow var(--t-base), transform var(--t-base);
}
.kpi-strip-item:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kpi-strip-item strong { display: block; font-size: 24px; font-weight: 800; line-height: 1; margin-bottom: 4px; letter-spacing: -.02em; }
.kpi-strip-item span { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi-strip-item.kpi-ok { border-left-color: var(--green); }
.kpi-strip-item.kpi-ok strong { color: var(--green); }
.kpi-strip-item.kpi-warn { border-left-color: var(--amber); }
.kpi-strip-item.kpi-warn strong { color: var(--amber); }
.kpi-strip-item.kpi-gap { border-left-color: var(--red); }
.kpi-strip-item.kpi-gap strong { color: var(--red); }
.kpi-strip-item.kpi-neutral { border-left-color: var(--blue); }
.kpi-strip-item.kpi-neutral strong { color: var(--blue); }
.kpi-strip-bar { height: 5px; border-radius: 999px; background: #e8eef4; overflow: hidden; margin-top: 8px; }
.kpi-strip-bar div { height: 100%; background: var(--green); border-radius: 999px; }
.kpi-warn .kpi-strip-bar div { background: var(--amber); }
.kpi-gap .kpi-strip-bar div { background: var(--red); }
.overdue-dot { display: inline-block; margin-left: 4px; width: 18px; height: 18px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 900; text-align: center; line-height: 18px; vertical-align: middle; }

/* ===== COMPLIANCE PANEL ===== */
.compliance-panel { }
.compliance-panel-meta { display: flex; align-items: center; gap: 14px; }
.compliance-summary-text { font-size: 13px; color: var(--muted); font-weight: 750; }
.compliance-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}
.compliance-area {
    display: grid; gap: 9px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--line);
    border-radius: 10px;
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: box-shadow .15s, border-color .15s;
}
.compliance-area:hover { box-shadow: var(--shadow-md); border-color: rgba(37,99,235,.25); transform: translateY(-1px); }
.compliance-area { transition: box-shadow var(--t-base), border-color var(--t-base), transform var(--t-base); }
.compliance-area.area-ok { border-left-color: var(--green); }
.compliance-area.area-warn { border-left-color: var(--amber); }
.compliance-area.area-gap { border-left-color: var(--red); }

.area-header { display: flex; align-items: flex-start; gap: 9px; }
.area-icon-badge {
    flex-shrink: 0; width: 30px; height: 30px;
    border-radius: 6px; background: #e8eef4;
    display: grid; place-items: center;
    font-size: 10px; font-weight: 900; color: var(--ink);
}
.area-ok .area-icon-badge { background: #e7f6f0; color: var(--green); }
.area-warn .area-icon-badge { background: #fff4db; color: var(--amber); }
.area-gap .area-icon-badge { background: #fdecea; color: var(--red); }
.area-title-col { flex: 1; min-width: 0; }
.area-title-col strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crit-mini { font-size: 10px; padding: 2px 6px; margin-top: 3px; }
.area-pct { font-size: 18px; font-weight: 900; flex-shrink: 0; }
.area-pct.area-ok { color: var(--green); }
.area-pct.area-warn { color: var(--amber); }
.area-pct.area-gap { color: var(--red); }

.area-progress-wrap { }
.area-progress-bar { height: 6px; border-radius: 999px; background: #e8eef4; overflow: hidden; }
.area-progress-fill { height: 100%; border-radius: 999px; transition: width .3s; }
.area-progress-fill.area-ok { background: var(--green); }
.area-progress-fill.area-warn { background: var(--amber); }
.area-progress-fill.area-gap { background: var(--red); }

.area-footer { display: flex; justify-content: space-between; align-items: center; }
.area-count { font-size: 12px; color: var(--muted); font-weight: 750; }
.area-mini-badges { display: flex; align-items: center; gap: 5px; }
.area-mini { font-size: 10px; padding: 2px 5px; border-radius: 999px; font-weight: 800; }
.area-mini.in-prog { background: #e7f1fb; color: var(--blue); }
.area-mini.planned { background: #fff4db; color: var(--amber); }
.area-check-icon { font-size: 13px; font-weight: 900; }
.area-check-icon.area-ok { color: var(--green); }
.area-check-icon.area-warn { color: var(--amber); }
.area-check-icon.area-gap { color: var(--red); }

/* ===== TASK STATUS ===== */
.task-main { flex: 1; min-width: 0; }
.task-right { display: flex; align-items: flex-start; gap: 8px; flex-shrink: 0; }
.task-status-form select { font-size: 12px; padding: 5px 7px; border-radius: 6px; }
.task-overdue { border-left: 3px solid var(--red) !important; background: #fffafa; }
.task-due-soon { border-left: 3px solid var(--amber) !important; }
.overdue-text { color: var(--red); font-weight: 800; }
.due-soon-text { color: var(--amber); font-weight: 750; }
.empty-hint { color: var(--muted); font-style: italic; margin-top: 10px; }

/* ===== INCIDENT ALERT PANEL ===== */
.incident-alert-panel { border: 1px solid rgba(194,65,47,.3) !important; background: #fffbfb !important; }
.panel-stack { display: grid; gap: 14px; align-content: start; }

/* ===== AUDIT MODULE ===== */
.audit-list { display: grid; gap: 10px; margin-top: 12px; }
.audit-card {
    display: grid; gap: 8px; padding: 16px;
    border: 1px solid var(--line); border-radius: 10px;
    background: #fff; text-decoration: none; color: inherit;
    transition: box-shadow var(--t-base), border-color var(--t-base), transform var(--t-base);
}
.audit-card:hover { box-shadow: var(--shadow-md); border-color: rgba(37,99,235,.25); transform: translateY(-1px); }
.audit-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.audit-card-head strong { font-size: 15px; }
.audit-date-text { font-size: 12px; color: var(--muted); }
.audit-counts { display: flex; gap: 10px; margin-top: 4px; }
.audit-counts b { font-size: 12px; padding: 3px 8px; border-radius: 999px; background: #eef2f6; font-weight: 750; }
.count-open { background: #fdecea !important; color: var(--red); }
.audit-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 12px; }
.audit-detail-head h3 { margin: 0 0 3px; }
.audit-detail-head p { margin: 0; font-size: 13px; color: var(--muted); }
.audit-scope-text { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.audit-summary-box { padding: 12px; background: #f5f8fb; border-radius: 8px; margin-bottom: 14px; }
.audit-summary-box p { margin: 0; font-size: 13px; }
.audit-summary-card { display: grid; gap: 7px; margin-top: 12px; padding: 12px; background: #f8fafc; border-radius: 8px; border: 1px solid var(--line); }
.audit-summary-card strong { font-size: 14px; }
.audit-summary-card span { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }

/* Findings */
.finding-list { display: grid; gap: 10px; margin-top: 14px; }
.finding-card {
    border: 1px solid var(--line);
    border-left: 4px solid var(--line);
    border-radius: 8px; padding: 13px;
    background: #fff;
}
.finding-critical { border-left-color: var(--red); background: #fffafa; }
.finding-high { border-left-color: #e07b35; }
.finding-medium { border-left-color: var(--amber); }
.finding-low { border-left-color: var(--blue); }
.finding-observation { border-left-color: var(--muted); }
.finding-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.finding-head strong { font-size: 14px; }
.finding-area-label { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.finding-badges { display: flex; flex-wrap: wrap; gap: 5px; flex-shrink: 0; }
.finding-card p { font-size: 13px; margin: 0 0 8px; }
.finding-reco { font-size: 12px; padding: 8px 10px; background: #f0f7ff; border-radius: 6px; }
.finding-status-form { margin-top: 8px; }
.finding-status-form select { font-size: 12px; padding: 4px 8px; }

/* Maturity Badges */
.maturity-badge {
    display: inline-flex; align-items: center;
    padding: 3px 9px; border-radius: 999px;
    font-size: 12px; font-weight: 800;
}
.mat-1 { background: #fdecea; color: var(--red); }
.mat-2 { background: #fff4db; color: var(--amber); }
.mat-3 { background: #e7f1fb; color: var(--blue); }
.mat-4 { background: #e7f6f0; color: var(--green); }
.mat-5 { background: var(--navy); color: #6ee7b7; }

.maturity-scale-list { display: grid; gap: 8px; margin-top: 10px; }
.maturity-row { display: flex; align-items: center; gap: 10px; }
.maturity-row span { font-size: 13px; color: var(--muted); }

/* ===== FILE UPLOAD ===== */
.evidence-ref-group { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: stretch; }
.file-upload-label {
    display: flex; align-items: center; gap: 6px;
    padding: 9px 11px; border: 1px solid var(--line);
    border-radius: 8px; background: #f8fafc;
    font-size: 13px; cursor: pointer; white-space: nowrap;
}
.file-upload-label:hover { background: #eef7fb; border-color: var(--cyan); }
.file-upload-label span { font-weight: 750; color: var(--blue); }
.file-upload-label input[type="file"] { display: none; }
.file-upload-label.compact { padding: 7px 10px; font-size: 12px; }
.document-row { grid-template-columns: minmax(120px, .6fr) minmax(180px, 1fr) minmax(100px, .5fr) 130px auto 110px; }

/* ===== CTA / DANGER BUTTONS ===== */
.cta-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 16px; border-radius: 8px;
    background: var(--blue); color: #fff;
    font-weight: 600; text-decoration: none; font-size: 13px;
    white-space: nowrap;
    transition: background var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
    box-shadow: 0 1px 3px rgba(37,99,235,.3), 0 1px 2px rgba(37,99,235,.2);
}
.cta-btn:hover { background: var(--blue-hover); box-shadow: 0 4px 12px rgba(37,99,235,.35); }
.cta-btn:active { transform: scale(.97); }
.btn-danger {
    background: var(--red) !important; color: #fff !important;
    border: 0; border-radius: 6px; padding: 8px 14px;
    font-size: 13px; font-weight: 800; cursor: pointer;
}

/* ===== WIZARD (client_new) ===== */
.wizard-intro {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 18px;
    background: #fff; border: 1px solid var(--line); border-radius: 8px;
}
.wizard-back-link { color: var(--blue); font-weight: 750; text-decoration: none; font-size: 14px; }
.wizard-form { display: grid; gap: 22px; }
.wizard-section {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 20px;
    align-items: start;
}
.wizard-section-num {
    width: 56px; height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    display: grid; place-items: center;
    font-size: 24px; font-weight: 900; color: #fff;
    flex-shrink: 0;
    margin-top: 4px;
}
.wizard-section-body {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 22px 24px;
    box-shadow: 0 2px 14px rgba(16,36,55,.05);
}
.wizard-section-body h2 { font-size: 19px; margin-bottom: 3px; }
.wizard-section-body > p { margin-bottom: 18px; font-size: 13px; }
.wizard-fields { display: grid; gap: 14px; }
.wizard-fields-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.wizard-fields-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.wizard-field { display: grid; gap: 5px; }
.wizard-field label { color: var(--muted); font-size: 13px; font-weight: 600; }
.wizard-field input, .wizard-field select, .wizard-field textarea { margin: 0; }
.wizard-field textarea { min-height: 80px; }
.wizard-submit { display: flex; justify-content: flex-end; padding: 4px 0 8px; }
.wizard-btn {
    padding: 14px 30px;
    font-size: 16px; font-weight: 900;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    border-radius: 10px; border: 0; color: #fff; cursor: pointer;
}
.wizard-btn:hover { opacity: .92; }

/* ===== PHASE TABS (onboarding) ===== */
.phase-tabs {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin: 16px 0 20px;
}
.phase-tab {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 14px;
    border: 1px solid var(--line); border-radius: 8px;
    background: #fff; color: var(--ink-2); text-decoration: none;
    font-size: 13px; font-weight: 600;
    transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
}
.phase-tab:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }
.phase-tab.active { background: var(--blue); color: #fff; border-color: var(--blue); box-shadow: 0 2px 8px rgba(37,99,235,.25); }
.phase-tab-pct {
    padding: 2px 7px; border-radius: 999px;
    font-size: 11px; font-weight: 800;
    background: #eef2f6; color: var(--muted);
}
.phase-tab.active .phase-tab-pct { background: rgba(255,255,255,.2); color: rgba(255,255,255,.9); }
.phase-tab.phase-ok { border-left: 3px solid var(--green); }

/* ===== ONBOARDING STEP CARDS ===== */
.onb-step-list { display: grid; gap: 8px; }
.onb-step-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    overflow: hidden;
    transition: box-shadow var(--t-base), border-color var(--t-base);
}
.onb-step-card[open] {
    border-color: rgba(37,99,235,.25);
    box-shadow: var(--shadow-md);
}
.onb-step-card > summary {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 14px;
    cursor: pointer; list-style: none; user-select: none;
}
.onb-step-card > summary::-webkit-details-marker { display: none; }
.step-status-dot {
    flex-shrink: 0; width: 10px; height: 10px;
    border-radius: 999px; background: var(--muted);
}
.step-status-dot.done { background: var(--green); }
.step-status-dot.in_progress { background: var(--blue); }
.step-status-dot.blocked { background: var(--red); }
.step-status-dot.not_needed { background: #ccc; }
.step-summary-main { flex: 1; min-width: 0; }
.step-summary-main strong { display: block; font-size: 14px; line-height: 1.3; }
.step-summary-main small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.step-expand-icon {
    flex-shrink: 0; font-size: 20px; color: var(--muted);
    transition: transform .15s; line-height: 1;
}
.onb-step-card[open] .step-expand-icon { transform: rotate(90deg); }
.step-card-body {
    padding: 16px 16px 12px;
    border-top: 1px solid var(--line);
    background: #f8fafc;
}
.step-card-desc { font-size: 13px; color: var(--muted); margin: 0 0 14px; line-height: 1.5; }
.step-card-form { display: grid; gap: 12px; }
.step-card-form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

/* ===== PHASE NAV ===== */
.phase-nav {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 0 4px;
}
.phase-nav a {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 16px; border-radius: 8px;
    background: #fff; border: 1px solid var(--line);
    color: var(--blue); font-weight: 750; font-size: 13px;
    text-decoration: none;
}
.phase-nav a:hover { border-color: var(--blue); }

/* ===== DELETE CONFIRM ===== */
.delete-confirm summary {
    list-style: none; cursor: pointer;
    padding: 6px 10px; border-radius: 6px;
    background: #fdecea; color: var(--red);
    font-size: 12px; font-weight: 800;
    display: inline-flex; align-items: center;
    border: 1px solid rgba(194,65,47,.2);
    white-space: nowrap;
}
.delete-confirm summary::-webkit-details-marker { display: none; }
.delete-confirm[open] summary { background: var(--red); color: #fff; border-color: var(--red); }
.delete-confirm-panel {
    margin-top: 8px;
    padding: 12px 14px;
    background: #fffbfb;
    border: 1px solid rgba(194,65,47,.2);
    border-radius: 8px;
    position: relative; z-index: 10;
}
.delete-confirm-panel p { font-size: 13px; color: var(--muted); margin: 0 0 10px; }

/* ===== CLIENTS EMPTY STATE ===== */
.clients-empty-state {
    text-align: center; padding: 48px 24px;
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.clients-empty-state h3 { font-size: 20px; margin-bottom: 8px; }

/* ===== PRINT STYLES ===== */
@media print {
    .sidebar, .sidebar-client, .logout-form,
    .client-hero-actions, .task-right, .finding-status-form,
    .finding-list form, button, select, input, textarea,
    .delete-confirm, .wizard-form, .phase-nav, .cta-btn { display: none !important; }
    .app-main { margin-left: 0 !important; padding: 16px !important; }
    body { background: #fff !important; font-size: 12px; }
    .client-hero-bar { background: var(--navy) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .compliance-grid { grid-template-columns: repeat(3, 1fr) !important; }
    .client-kpi-strip { grid-template-columns: repeat(5, 1fr) !important; }
    .split { grid-template-columns: 1fr !important; }
    .panel { box-shadow: none !important; border: 1px solid #ccc !important; }
    .area-progress-fill { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (max-width: 1100px) {
    .kpi-grid, .requirements-grid, .playbooks, .tenant-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .split { grid-template-columns: 1fr; }
    .onboarding-layout { grid-template-columns: 1fr; }
    .program-row, .workflow-step-form { grid-template-columns: 1fr 110px 1fr 1fr; }
    .workflow-hero { grid-template-columns: 1fr; }
    .workflow-actions { justify-content: flex-start; }
    .workflow-runner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .compliance-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .client-kpi-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .client-hero-bar { grid-template-columns: 1fr 100px; }
    .client-hero-right { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; }
    .document-row { grid-template-columns: 1fr 1fr auto; }
    .wizard-fields-grid-3 { grid-template-columns: repeat(2, 1fr); }
    .step-card-form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .login-panel { grid-template-columns: 1fr; }
    .brand-block { padding: 28px; }
    .sidebar { position: static; width: auto; overflow-y: visible; }
    .app-main { margin-left: 0; padding: 16px; }
    .kpi-grid, .requirements-grid, .playbooks, .deadline-grid { grid-template-columns: 1fr; }
    .topbar, .table-row, .task-row, .incident-row { display: grid; }
    .phase-head, .step-row, .program-row, .form-grid, .profile-card dl, .document-row { grid-template-columns: 1fr; }
    .client-context, .context-switcher { display: grid; }
    .tenant-grid { grid-template-columns: 1fr; }
    .workflow-runner { grid-template-columns: 1fr; }
    .compliance-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .client-kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .client-hero-bar { grid-template-columns: 1fr; }
    .compliance-score-ring { justify-self: center; }
    .client-hero-actions { justify-content: flex-start; }
    .evidence-ref-group { grid-template-columns: 1fr; }
    .audit-detail-head { display: grid; }
    .wizard-section { grid-template-columns: 1fr; }
    .wizard-section-num { display: none; }
    .wizard-fields-grid-2, .wizard-fields-grid-3 { grid-template-columns: 1fr; }
    .wizard-intro { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ===== TOAST FLASH MESSAGES ===== */
.toast {
    position: fixed;
    top: 20px;
    right: 24px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 600;
    box-shadow: 0 8px 32px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.1);
    animation: toast-in .2s cubic-bezier(.34,1.56,.64,1);
    transition: opacity .3s ease, transform .3s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.toast-success {
    background: rgba(5,150,105,.95);
    color: #fff;
    border: 1px solid rgba(255,255,255,.15);
}
.toast-error {
    background: rgba(220,38,38,.95);
    color: #fff;
    border: 1px solid rgba(255,255,255,.15);
}
.toast-hide {
    opacity: 0;
    transform: translateY(-10px) scale(.95);
    pointer-events: none;
}
@keyframes toast-in {
    from { opacity: 0; transform: translateY(-14px) scale(.92); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== SIDEBAR CLIENT CONTEXT ===== */
.sidebar-client {
    padding: 10px 12px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    display: grid;
    gap: 8px;
    margin: 4px 0;
}
.sidebar-client-head {
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-client-avatar {
    flex-shrink: 0;
    width: 36px; height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    display: grid; place-items: center;
    font-size: 12px; font-weight: 900; color: #fff;
}
.sidebar-client-info { flex: 1; min-width: 0; }
.sidebar-client-info strong {
    display: block;
    color: #fff;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-client-info span {
    display: block;
    color: rgba(255,255,255,.52);
    font-size: 11px;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-client-switch {
    display: block;
    width: 100%;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 6px;
    padding: 7px 10px;
    color: rgba(255,255,255,.75);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
    transition: background .12s;
}
.sidebar-client-switch:hover { background: rgba(255,255,255,.14); color: #fff; }
.sidebar-client-switcher {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding-top: 4px;
}
.sidebar-client-switcher.open { display: flex; }
.sidebar-client-switcher a {
    display: block;
    padding: 7px 10px;
    border-radius: 6px;
    color: rgba(255,255,255,.8);
    font-size: 12px;
    text-decoration: none;
    background: rgba(255,255,255,.05);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-client-switcher a:hover,
.sidebar-client-switcher a.active-client { background: rgba(255,255,255,.14); color: #fff; }
.sidebar-portfolio-link {
    padding: 7px 10px; border-radius: 6px;
    color: rgba(255,255,255,.6); font-size: 12px;
    text-decoration: none; font-style: italic;
    background: rgba(255,255,255,.04);
    display: block;
}
.sidebar-portfolio-link:hover { color: rgba(255,255,255,.9); background: rgba(255,255,255,.09); }

/* sidebar badge counts */
.nav-badge {
    margin-left: auto;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    background: rgba(194,65,47,.8);
    color: #fff;
}
.nav-badge-warn {
    background: rgba(183,121,31,.8);
}
.nav-badge-neutral {
    background: rgba(255,255,255,.15);
    color: rgba(255,255,255,.85);
}

/* ===== JETZT HANDELN BLOCK ===== */
.action-block {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.action-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--line);
    background: var(--page);
}
.action-block-head h2 { font-size: 15px; margin: 0; font-weight: 700; }
.action-items { display: grid; }
.action-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    color: inherit;
    transition: background var(--t-fast);
}
.action-item:last-child { border-bottom: 0; }
.action-item:hover { background: var(--blue-light); }
.action-dot {
    flex-shrink: 0;
    width: 8px; height: 8px;
    border-radius: 999px;
}
.action-dot-red { background: var(--red); box-shadow: 0 0 0 3px rgba(220,38,38,.15); }
.action-dot-amber { background: var(--amber); box-shadow: 0 0 0 3px rgba(217,119,6,.15); }
.action-dot-blue { background: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.action-item-body { flex: 1; min-width: 0; }
.action-item-body strong { display: block; font-size: 14px; font-weight: 600; line-height: 1.3; }
.action-item-body span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.action-item-arrow { color: var(--muted-2); font-size: 16px; align-self: center; flex-shrink: 0; }
.action-all-ok {
    padding: 20px;
    color: var(--muted);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.action-all-ok-icon { font-size: 18px; }

/* ===== INCIDENT DEADLINE CALCULATOR ===== */
.incident-wizard { display: grid; gap: 16px; }
.incident-step-label {
    display: block;
    color: var(--cyan);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 8px;
}
.deadline-calc {
    padding: 14px 16px;
    background: #f5f8fb;
    border: 1px solid var(--line);
    border-radius: 10px;
    display: grid;
    gap: 8px;
}
.deadline-calc-title {
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    color: var(--muted);
    letter-spacing: .05em;
    margin-bottom: 2px;
}
.deadline-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 7px;
    background: #fff;
    border: 1px solid var(--line);
}
.deadline-icon { font-size: 16px; flex-shrink: 0; }
.deadline-row-body { flex: 1; min-width: 0; }
.deadline-row-body strong { display: block; font-size: 13px; }
.deadline-row-body span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.deadline-row-time {
    font-size: 13px;
    font-weight: 800;
    color: var(--ink);
    flex-shrink: 0;
    text-align: right;
}
.deadline-placeholder { color: var(--muted); font-style: italic; font-size: 13px; text-align: center; padding: 8px 0; }

/* ===== PAGE CONTEXT STRIP (replaces workflow-hero) ===== */
.page-context-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}
.page-context-left { display: flex; align-items: center; gap: 8px; }
.context-breadcrumb-link { color: var(--blue); font-size: 13px; font-weight: 700; text-decoration: none; }
.context-breadcrumb-link:hover { text-decoration: underline; }
.context-separator { color: var(--muted); font-size: 13px; }
.context-page-name { font-size: 13px; font-weight: 700; color: var(--ink); }
.page-context-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.context-progress-label, .context-compliance-label { font-size: 12px; color: var(--muted); font-weight: 700; white-space: nowrap; }
.context-progress-bar {
    width: 80px; height: 6px;
    border-radius: 999px;
    background: #e8eef4;
    overflow: hidden;
}
.context-progress-bar div { height: 100%; background: linear-gradient(90deg, var(--green), var(--cyan)); border-radius: 999px; }
.context-compliance-bar div { }

/* ===== REQUIREMENT CARD LAYOUT ===== */
.req-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 22px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
}
.req-page-progress { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.req-overall-bar {
    width: 180px; height: 10px;
    border-radius: 999px;
    background: #e8eef4;
    overflow: hidden;
}
.req-overall-fill { height: 100%; border-radius: 999px; }
.req-fill-ok { background: var(--green); }
.req-fill-warn { background: var(--amber); }
.req-fill-gap { background: var(--red); }
.req-overall-pct { font-size: 20px; font-weight: 900; flex-shrink: 0; }
.text-ok { color: var(--green); }
.text-warn { color: var(--amber); }
.text-gap { color: var(--red); }

.req-filter-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.req-filter-tab {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 13px;
    border: 1px solid var(--line); border-radius: 8px;
    background: #fff; color: var(--ink-2);
    font-size: 13px; font-weight: 600;
    text-decoration: none;
    transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.req-filter-tab span { padding: 1px 6px; border-radius: 999px; background: var(--line-2); font-size: 11px; font-weight: 700; color: var(--muted); }
.req-filter-tab:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }
.req-filter-tab.active { background: var(--blue); color: #fff; border-color: var(--blue); box-shadow: 0 2px 8px rgba(37,99,235,.25); }
.req-filter-tab.active span { background: rgba(255,255,255,.2); color: rgba(255,255,255,.9); }
.req-filter-audit { margin-left: auto; color: var(--blue); background: #e7f1fb; border-color: #c5dcf5; }
.req-filter-audit:hover { background: var(--blue); color: #fff; border-color: var(--blue); }

.req-group-left { flex: 1; min-width: 0; }
.req-group-left strong { font-size: 14px; }
.req-group-left span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.req-group-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.req-group-bar { width: 80px; height: 6px; border-radius: 999px; background: #e8eef4; overflow: hidden; }
.req-group-fill { height: 100%; border-radius: 999px; }
.req-group-fill.area-ok { background: var(--green); }
.req-group-fill.area-warn { background: var(--amber); }
.req-group-fill.area-gap { background: var(--red); }
.req-group-pct { font-size: 13px; font-weight: 800; min-width: 36px; text-align: right; }
.req-group-pct.area-ok { color: var(--green); }
.req-group-pct.area-warn { color: var(--amber); }
.req-group-pct.area-gap { color: var(--red); }

.req-card-list { display: grid; gap: 0; }
.req-card {
    border-bottom: 1px solid var(--line);
    background: #fff;
    transition: background .1s;
}
.req-card:last-child { border-bottom: 0; }
.req-card:hover { background: #fafbfc; }
.req-card.req-done { opacity: .65; }
.req-card.req-done .req-card-title { text-decoration: line-through; }
.req-card.req-na { opacity: .45; }
.req-card.req-critical { border-left: 3px solid var(--red); }
.req-card-main {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
}
.req-card-info { flex: 1; min-width: 0; }
.req-card-title { display: block; font-size: 14px; font-weight: 700; }
.req-card-desc { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.req-card-evidence { display: block; font-size: 11px; color: var(--blue); margin-top: 3px; font-style: italic; }
.req-card-controls { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.req-card-controls select { font-size: 12px; padding: 5px 8px; border-radius: 6px; min-width: 120px; }
.req-expand-toggle {
    display: grid; place-items: center;
    width: 30px; height: 30px;
    border-radius: 6px;
    background: #f0f4f8;
    cursor: pointer;
    font-size: 14px;
    color: var(--muted);
    flex-shrink: 0;
    transition: background .12s, color .12s;
    user-select: none;
}
.req-expand-toggle:hover { background: #e7f1fb; color: var(--blue); }
.req-exp-cb { display: none; }
.req-card-expand { display: none; }
.req-exp-cb:checked ~ .req-card-main .req-expand-toggle { background: #e7f1fb; color: var(--blue); }
.req-exp-cb:checked ~ .req-card-expand { display: block; }
.req-expand-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 10px;
    align-items: end;
    padding: 12px 14px;
    background: #f8fafc;
    border-top: 1px solid var(--line);
}
.req-expand-field { display: grid; gap: 5px; }
.req-expand-field span { font-size: 12px; color: var(--muted); font-weight: 600; }
.req-expand-field input { font-size: 13px; padding: 7px 10px; }
.req-note-full { }
.req-save-btn {
    padding: 9px 14px;
    background: var(--blue); color: #fff;
    border: 0; border-radius: 8px;
    font-size: 13px; font-weight: 800;
    cursor: pointer; white-space: nowrap;
    align-self: end;
}
.req-save-btn:hover { background: #0a5a96; }

/* ===== DOCUMENT CARD LAYOUT ===== */
.doc-card-list { display: grid; gap: 0; }
.doc-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
    background: #fff;
    border-left: 3px solid var(--line);
    transition: background .1s;
}
.doc-card:last-child { border-bottom: 0; }
.doc-card:hover { background: #fafbfc; }
.doc-missing { border-left-color: var(--red); background: #fffafa; }
.doc-requested { border-left-color: var(--amber); background: #fffdf5; }
.doc-uploaded { border-left-color: var(--blue); }
.doc-approved { border-left-color: var(--green); opacity: .7; }
.doc-card-info { flex: 1; min-width: 0; }
.doc-card-info strong { display: block; font-size: 14px; font-weight: 700; }
.doc-client-name { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.doc-card-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.doc-card-actions select { font-size: 12px; padding: 5px 8px; border-radius: 6px; }
.doc-group .program-group summary { }

/* ===== CLIENT CARD GRID ===== */
.client-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}
.client-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px;
    display: grid;
    gap: 14px;
    transition: box-shadow var(--t-base), border-color var(--t-base), transform var(--t-base);
}
.client-card:hover { box-shadow: var(--shadow-lg); border-color: rgba(37,99,235,.2); transform: translateY(-2px); }
.client-card-alert { border-color: rgba(194,65,47,.35); background: #fffbfb; }
.client-card-head { display: flex; align-items: center; gap: 10px; }
.client-card-avatar {
    flex-shrink: 0;
    width: 40px; height: 40px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    display: grid; place-items: center;
    font-size: 13px; font-weight: 900; color: #fff;
}
.client-card-meta { flex: 1; min-width: 0; }
.client-card-meta strong { display: block; font-size: 14px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-card-meta span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-card-risk { font-size: 18px; font-weight: 900; flex-shrink: 0; }
.client-card-bars { display: grid; gap: 5px; }
.client-bar-row { display: flex; align-items: center; gap: 8px; }
.client-bar-row span { font-size: 11px; color: var(--muted); font-weight: 700; min-width: 28px; }
.client-bar-row b { font-size: 12px; font-weight: 800; min-width: 32px; text-align: right; }
.client-card-next { margin: 0; font-size: 12px; color: var(--muted); }
.client-card-bubbles { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.bubble { padding: 3px 8px; border-radius: 999px; background: #eef2f6; font-size: 11px; font-weight: 800; color: var(--muted); }
.bubble-red { padding: 3px 8px; border-radius: 999px; background: #fdecea; font-size: 11px; font-weight: 900; color: var(--red); }
.client-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; border-top: 1px solid var(--line); padding-top: 10px; }
.client-action-primary {
    padding: 6px 12px; border-radius: 7px;
    background: var(--blue); color: #fff;
    font-size: 12px; font-weight: 800; text-decoration: none;
}
.client-action-primary:hover { background: #0a5a96; }
.client-card-actions a:not(.client-action-primary) {
    padding: 5px 10px; border-radius: 7px;
    background: #f0f4f8; color: var(--ink);
    font-size: 12px; font-weight: 700; text-decoration: none;
}
.client-card-actions a:not(.client-action-primary):hover { background: #e7f1fb; color: var(--blue); }

/* ===== ASSESSMENT ACCORDION ===== */
.assessment-accordion {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}
.assessment-accordion > summary {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 13px 14px;
    cursor: pointer; list-style: none; user-select: none;
    background: #f8fafc;
}
.assessment-accordion > summary::-webkit-details-marker { display: none; }
.assess-summary-head { flex: 1; min-width: 0; }
.assess-summary-head strong { display: block; font-size: 14px; }
.assess-summary-head span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.assessment-accordion[open] > summary { border-bottom: 1px solid var(--line); background: #fff; }
.assessment-accordion[open] .step-expand-icon { transform: rotate(90deg); }
.assess-form { padding: 16px; }
.assess-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.assess-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.assess-form .wizard-field span { color: var(--muted); font-size: 12px; font-weight: 600; }

/* ===== RESPONSIVE UPDATES ===== */
@media (max-width: 1100px) {
    .client-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .req-expand-grid { grid-template-columns: 1fr 1fr; }
    .req-note-full { grid-column: 1 / -1; }
    .assess-grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
    .page-context-strip { flex-direction: column; align-items: flex-start; gap: 8px; }
    .page-context-right { width: 100%; }
    .req-page-header { flex-direction: column; }
    .req-overall-bar { width: 100%; }
    .req-filter-tabs { gap: 4px; }
    .req-filter-audit { margin-left: 0; }
    .req-card-main { flex-wrap: wrap; }
    .req-card-controls { flex-wrap: wrap; }
    .req-expand-grid { grid-template-columns: 1fr; }
    .client-card-grid { grid-template-columns: 1fr; }
    .assess-grid-2, .assess-grid-3 { grid-template-columns: 1fr; }
    .doc-card { flex-wrap: wrap; }
    .doc-card-actions { width: 100%; }
}

/* ===== GLOBAL POLISH ===== */
html { scroll-behavior: smooth; }
::selection { background: rgba(37,99,235,.15); color: var(--ink); }

/* Sidebar nav section label */
.sidebar-nav-label {
    padding: 10px 10px 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255,255,255,.28);
}

/* Panel header line */
.panel-head {
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}
.panel-head h2 { font-size: 15px; font-weight: 700; }

/* Table rows */
.table-row {
    background: #fff;
    border-radius: 10px;
    border: 1px solid var(--line);
    padding: 12px 16px;
    transition: box-shadow var(--t-fast), border-color var(--t-fast);
}
.table-row:hover { box-shadow: var(--shadow-sm); border-color: rgba(37,99,235,.2); }

/* Wizard button polish */
.wizard-btn {
    box-shadow: 0 4px 14px rgba(37,99,235,.35);
    transition: opacity var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
.wizard-btn:hover { opacity: 1; box-shadow: 0 6px 20px rgba(37,99,235,.45); }
.wizard-btn:active { transform: scale(.97); }

/* Progress bars rounded */
.progress span { border-radius: 999px; }

/* Step status dot animation for active */
.step-status-dot.in_progress {
    animation: dot-pulse 2s ease-in-out infinite;
}
@keyframes dot-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37,99,235,.4); }
    50% { box-shadow: 0 0 0 5px rgba(37,99,235,0); }
}

/* Req card hover */
.req-card { transition: background var(--t-fast); }
.req-card:hover { background: var(--blue-light) !important; }

/* Finding cards */
.finding-card { transition: box-shadow var(--t-base); }
.finding-card:hover { box-shadow: var(--shadow-sm); }

/* Compact form */
.compact-form {
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
}

/* Step card body bg */
.step-card-body { background: var(--page); }

/* Phase tab count badge */
.phase-tab-pct {
    background: var(--line-2);
    color: var(--muted);
}

/* Scrollbar styling (webkit) */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.25); }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); }
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.22); }
