:root {
    --bg: #f3f6fa;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --surface-blue: #eef5fb;
    --ink: #142033;
    --ink-soft: #344054;
    --muted: #667085;
    --line: #dfe5ec;
    --line-strong: #c8d2df;
    --primary: #145b8f;
    --primary-strong: #0f456d;
    --primary-soft: #e8f2f8;
    --navy: #0d2033;
    --navy-soft: #173650;
    --success: #18794e;
    --success-soft: #eaf7f0;
    --warning: #a15c00;
    --warning-soft: #fff6e6;
    --danger: #b42318;
    --danger-soft: #fff0ee;
    --purple: #6941c6;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow-md: 0 10px 28px rgba(16, 36, 56, .08);
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    --sidebar-width: 272px;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
    min-height: 100vh;
    margin: 0;
    font: 14px/1.5 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--bg);
    text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

/* Application shell */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    padding: 24px 18px 20px;
    color: #fff;
    background: linear-gradient(180deg, var(--navy) 0%, #102b43 70%, #0b1c2c 100%);
    border-right: 1px solid rgba(255,255,255,.08);
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 24px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,.11);
}
.brand-mark {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    color: #fff;
    background: #1f6f9f;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
    font-weight: 900;
    letter-spacing: -.02em;
}
.brand-copy { display: grid; line-height: 1.05; }
.brand-copy strong { font-size: 19px; }
.brand-copy small { margin-top: 4px; color: #a9c0d1; font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.sidebar-label { padding: 11px 12px 7px; color: #7fa0b7; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.sidebar-nav { display: grid; gap: 5px; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 10px 12px;
    color: #c7d6e1;
    border-radius: 11px;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}
.sidebar-nav a:hover { color: #fff; background: rgba(255,255,255,.07); transform: translateX(2px); }
.sidebar-nav a.active { color: #fff; background: rgba(74, 160, 211, .2); box-shadow: inset 3px 0 0 #68b8e5; }
.nav-icon {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    color: #9bb6c8;
    background: rgba(255,255,255,.06);
    font-size: 10px;
    font-weight: 800;
}
.sidebar-nav a.active .nav-icon { color: #fff; background: rgba(104,184,229,.22); }
.sidebar-info { margin-top: auto; padding: 15px; border: 1px solid rgba(255,255,255,.1); border-radius: 13px; background: rgba(255,255,255,.04); }
.sidebar-info strong, .sidebar-info span { display: block; }
.sidebar-info strong { font-size: 12px; }
.sidebar-info span { margin-top: 5px; color: #9db4c5; font-size: 11px; line-height: 1.55; }
.sidebar-logout { margin-top: 12px; }
.link-btn { width: 100%; padding: 10px 12px; color: #a9c0d1; background: transparent; border: 0; border-radius: 9px; text-align: left; cursor: pointer; }
.link-btn:hover { color: #fff; background: rgba(255,255,255,.06); }
.content { min-height: 100vh; margin-left: var(--sidebar-width); padding: 32px clamp(22px, 3vw, 46px) 60px; }
.mobile-topbar, .sidebar-overlay { display: none; }

/* Global components */
.page-head, .workflow-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 24px;
}
.page-head h1, .workflow-head h1 { margin: 3px 0 6px; font-size: clamp(27px, 3vw, 36px); line-height: 1.12; letter-spacing: -.035em; }
.page-head p, .workflow-head p { margin: 0; color: var(--muted); max-width: 760px; }
.eyebrow { color: var(--primary); font-size: 10px; font-weight: 850; letter-spacing: .15em; text-transform: uppercase; }
.card, .panel {
    margin-bottom: 20px;
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 22px;
    border-bottom: 1px solid var(--line);
}
.panel-heading.compact { padding-bottom: 15px; }
.panel-heading h2 { margin: 0 0 4px; font-size: 18px; }
.panel-heading p { margin: 0; color: var(--muted); }
.panel-heading > a { color: var(--primary); font-weight: 750; font-size: 12px; }
.btn, button:not(.link-btn):not(.menu-toggle) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 15px;
    color: var(--ink-soft);
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    font-weight: 750;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
}
.btn:hover, button:not(.link-btn):not(.menu-toggle):hover { border-color: #9db2c5; box-shadow: 0 4px 12px rgba(16,36,56,.08); transform: translateY(-1px); }
.btn.primary, button.primary { color: #fff; background: var(--primary); border-color: var(--primary); }
.btn.primary:hover, button.primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); }
.btn.secondary, button.secondary { color: var(--primary-strong); background: var(--primary-soft); border-color: #c8dfed; }
.btn.danger, button.danger { color: var(--danger); background: #fff; border-color: #f2c6c2; }
.btn.small { min-height: 33px; padding: 6px 10px; font-size: 12px; }
.btn.wide { width: 100%; }
.success-btn { color: #fff !important; background: var(--success) !important; border-color: var(--success) !important; }
.actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.actions form { margin: 0; }
.badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 4px 9px;
    color: #1e5b82;
    background: #e8f2f8;
    border: 1px solid #d1e3ed;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 780;
    line-height: 1.2;
}
.status-approved { color: #136c45; background: #e7f6ee; border-color: #bfe5d0; }
.status-review { color: #935000; background: #fff4dc; border-color: #f4d7a4; }
.status-in_progress { color: #245d85; background: #edf5fa; border-color: #c9e0ed; }
.status-draft { color: #475467; background: #f2f4f7; border-color: #e4e7ec; }
.status-planned { color: #6941c6; background: #f4f0ff; border-color: #d9cef8; }
.status-completed { color: #136c45; background: #e7f6ee; border-color: #bfe5d0; }
.alert, .notice, .success, .validation-list, .global-alert {
    padding: 14px 16px;
    border-radius: 11px;
    border: 1px solid;
}
.alert { color: #8c3f00; background: var(--warning-soft); border-color: #f0d09d; }
.notice { color: #214d6a; background: #edf6fb; border-color: #c8dfed; }
.success { color: #126640; background: var(--success-soft); border-color: #b9e0cb; }
.global-alert {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: #8c3f00;
    background: var(--warning-soft);
    border-color: #f0d09d;
    box-shadow: var(--shadow-sm);
}
.global-alert button { min-height: auto !important; padding: 0 4px !important; background: transparent !important; border: 0 !important; box-shadow: none !important; font-size: 22px; }
.muted { color: var(--muted); }
.empty-state, .empty-table {
    display: grid;
    place-items: center;
    min-height: 150px;
    padding: 26px;
    color: var(--muted);
    text-align: center;
}
.empty-state strong { color: var(--ink); font-size: 15px; }
.empty-state span { margin-top: 4px; }

/* Forms */
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
label { display: flex; flex-direction: column; gap: 7px; color: var(--ink-soft); font-size: 12px; font-weight: 760; }
label > span:first-child { color: var(--ink-soft); }
label small, .field-help { color: var(--muted); font-weight: 450; line-height: 1.45; }
input, select, textarea {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
textarea { min-height: 105px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #4a93c2; box-shadow: 0 0 0 3px rgba(20,91,143,.12); }
input:disabled, select:disabled, textarea:disabled { color: #98a2b3; background: #f2f4f7; cursor: not-allowed; }
input[type="checkbox"], input[type="radio"] { width: 17px; min-height: 17px; height: 17px; padding: 0; accent-color: var(--primary); }
.check, .check-card { flex-direction: row !important; align-items: flex-start; gap: 10px; }
.check-card {
    min-height: 54px;
    padding: 13px 14px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 11px;
    cursor: pointer;
}
.check-card:has(input:checked) { background: var(--primary-soft); border-color: #a8cde2; }
.check-card input { flex: 0 0 auto; margin-top: 1px; }
.section-intro {
    padding: 15px 17px;
    color: #254b64;
    background: linear-gradient(90deg, #edf6fb, #f8fbfd);
    border: 1px solid #d1e4ef;
    border-left: 4px solid var(--primary);
    border-radius: 11px;
    line-height: 1.6;
}
.form-section {
    padding: 20px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
}
.form-section + .form-section { margin-top: 16px; }
.form-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.form-section-head h3 { margin: 0 0 4px; font-size: 17px; }
.form-section-head p { margin: 0; color: var(--muted); font-size: 12px; }
.conditional[hidden] { display: none !important; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
th { color: var(--muted); background: #fbfcfd; font-size: 10px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; white-space: nowrap; }
td small { display: block; margin-top: 4px; color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfdff; }
tfoot th, tfoot td { color: var(--ink); background: #f7fafc; font-weight: 800; }

/* Login */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at 15% 20%, rgba(63,139,182,.18), transparent 34%), linear-gradient(135deg, #0d2033, #143a57 60%, #0c2438); }
.login-shell { width: min(980px, 100%); display: grid; grid-template-columns: 1.15fr .85fr; overflow: hidden; border: 1px solid rgba(255,255,255,.18); border-radius: 24px; box-shadow: 0 34px 90px rgba(0,0,0,.25); }
.login-intro { display: flex; flex-direction: column; justify-content: center; min-height: 560px; padding: clamp(34px, 6vw, 72px); color: #fff; background: linear-gradient(145deg, rgba(20,91,143,.92), rgba(13,32,51,.95)); }
.login-kicker { color: #a8d1e8; font-size: 10px; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.login-intro h1 { max-width: 550px; margin: 14px 0 16px; font-size: clamp(38px, 5vw, 56px); line-height: 1.02; letter-spacing: -.05em; }
.login-intro p { max-width: 600px; margin: 0; color: #d2e2ec; font-size: 15px; line-height: 1.75; }
.login-features { display: grid; gap: 9px; margin-top: 34px; }
.login-features div { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid rgba(255,255,255,.1); }
.login-features strong { color: #8bc7e8; font-size: 11px; }
.login-features span { font-weight: 700; }
.login-card { display: flex; flex-direction: column; justify-content: center; min-height: 560px; padding: clamp(30px, 5vw, 56px); background: #fff; }
.logo-block { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 26px; color: #fff; background: var(--primary); border-radius: 16px; font-size: 17px; font-weight: 900; }
.login-card h2 { margin: 6px 0 6px; font-size: 27px; letter-spacing: -.03em; }
.login-card p { margin: 0 0 24px; color: var(--muted); }
.login-card form { display: grid; gap: 12px; }
.login-card input { font-size: 22px; letter-spacing: .28em; text-align: center; }
.login-card small { margin-top: 18px; color: var(--muted); line-height: 1.6; }
.login-card code { padding: 2px 5px; background: #f2f4f7; border-radius: 5px; }

/* Dashboard */
.dashboard-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; padding: 30px; margin-bottom: 20px; color: #fff; background: linear-gradient(125deg, #0d2033, #143a57 64%, #145b8f); border-radius: 20px; box-shadow: var(--shadow-md); }
.dashboard-hero h1 { margin: 5px 0 7px; font-size: 34px; line-height: 1.1; letter-spacing: -.04em; }
.dashboard-hero p { margin: 0; color: #c5d7e3; }
.hero-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.hero-actions form { margin: 0; }
.hero-actions .btn:not(.primary) { color: #fff; background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.22); }
.dashboard-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.dashboard-kpi { position: relative; overflow: hidden; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.dashboard-kpi::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--primary); }
.dashboard-kpi.attention::before { background: #db7a00; }
.dashboard-kpi.success-tone::before { background: var(--success); }
.dashboard-kpi.value-tone::before { background: var(--purple); }
.dashboard-kpi span, .dashboard-kpi small { display: block; color: var(--muted); }
.dashboard-kpi strong { display: block; margin: 7px 0 2px; font-size: 28px; letter-spacing: -.035em; }
.dashboard-grid { display: grid; gap: 20px; }
.dashboard-grid-main { grid-template-columns: minmax(0, 1.65fr) minmax(300px, .8fr); align-items: start; }
.dashboard-grid-lower { grid-template-columns: 1fr 1fr; }
.dashboard-side-stack { display: grid; gap: 20px; }
.dashboard-panel { padding: 0; overflow: hidden; }
.work-list, .timeline-list, .activity-list { display: grid; }
.work-item, .timeline-item, .activity-item { border-bottom: 1px solid var(--line); }
.work-item:last-child, .timeline-item:last-child, .activity-item:last-child { border-bottom: 0; }
.work-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 17px 22px; }
.work-item:hover { background: #fbfdff; }
.work-title { display: flex; align-items: center; gap: 9px; justify-content: space-between; }
.work-main > span { display: block; margin: 5px 0 9px; color: var(--muted); font-size: 12px; }
.work-next { color: var(--primary); font-weight: 800; }
.progress-track, .mini-progress, .status-track { height: 6px; overflow: hidden; background: #e8edf2; border-radius: 999px; }
.progress-track i, .mini-progress i, .status-track i { display: block; height: 100%; background: var(--primary); border-radius: inherit; }
.status-overview { padding: 11px 22px 20px; }
.status-row { padding: 10px 0; }
.status-row > div:first-child { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.status-row span { color: var(--muted); }
.quick-panel { padding-bottom: 10px; }
.quick-panel form { margin: 0; }
.quick-action { display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 12px; width: 100%; padding: 13px 22px; text-align: left; border: 0 !important; border-top: 1px solid var(--line) !important; border-radius: 0 !important; box-shadow: none !important; background: #fff !important; }
.quick-action > span { display: grid; place-items: center; width: 34px; height: 34px; color: var(--primary); background: var(--primary-soft); border-radius: 9px; font-size: 10px; font-weight: 850; }
.quick-action div { display: grid; }
.quick-action small { color: var(--muted); }
.timeline-item { display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 14px; padding: 14px 20px; }
.timeline-item time { display: grid; place-items: center; min-height: 55px; color: #fff; background: var(--navy); border-radius: 11px; line-height: 1; }
.timeline-item time strong { font-size: 20px; }
.timeline-item time span { margin-top: 4px; font-size: 9px; letter-spacing: .1em; }
.timeline-item > div { display: grid; }
.timeline-item > div span, .timeline-item > div small { color: var(--muted); }
.activity-item { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 12px; padding: 13px 20px; }
.activity-item > i { width: 8px; height: 8px; background: var(--primary); border-radius: 50%; }
.activity-item div { display: grid; }
.activity-item span, .activity-item time { color: var(--muted); font-size: 11px; }
.system-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 20px; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); }
.system-strip > div { display: grid; gap: 3px; padding: 17px; background: #fff; }
.system-strip span, .system-strip small { color: var(--muted); font-size: 11px; }

/* Workflow list */
.program-list-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.search-box { position: relative; width: min(420px, 100%); }
.search-box input { padding-left: 38px; }
.search-box::before { content: "⌕"; position: absolute; left: 13px; top: 7px; color: var(--muted); font-size: 21px; }
.program-table-card { padding: 0; overflow: hidden; }
.program-title-cell { min-width: 230px; }
.program-title-cell strong { display: block; }
.status-label { text-transform: capitalize; }

/* Workflow shell */
.workflow-shell { display: grid; grid-template-columns: 286px minmax(0, 1fr); gap: 20px; align-items: start; }
.wizard-nav { position: sticky; top: 22px; display: grid; gap: 7px; }
.wizard-progress { height: 7px; margin: 0 4px 9px; overflow: hidden; background: #dfe6ec; border-radius: 999px; }
.wizard-progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #4aa0d3); border-radius: inherit; }
.wizard-step { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 11px; padding: 12px; color: var(--ink-soft); background: #fff; border: 1px solid var(--line); border-radius: 11px; }
.wizard-step > span { display: grid; place-items: center; width: 34px; height: 34px; color: var(--muted); background: #edf1f5; border-radius: 10px; font-size: 11px; font-weight: 850; }
.wizard-step strong, .wizard-step small { display: block; }
.wizard-step strong { font-size: 12px; }
.wizard-step small { margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.wizard-step.active { border-color: #8dbbd5; background: #f5fafd; box-shadow: 0 7px 18px rgba(20,91,143,.09); }
.wizard-step.active > span { color: #fff; background: var(--primary); }
.wizard-step.done > span { color: #fff; background: var(--success); }
.wizard-step.done { border-color: #c5dfd2; }
.wizard-step.locked { opacity: .47; pointer-events: none; }
.workflow-summary-card { margin-top: 10px; padding: 15px; background: var(--navy); color: #fff; border-radius: 13px; }
.workflow-summary-card > span { color: #8fb5cd; font-size: 9px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.workflow-summary-card h3 { margin: 7px 0 10px; font-size: 14px; }
.workflow-summary-list { display: grid; gap: 7px; }
.workflow-summary-list div { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; }
.workflow-summary-list span { color: #9eb9ca; }
.workflow-summary-list strong { text-align: right; }
.wizard-card { overflow: hidden; padding: 0; background: #fff; border: 1px solid var(--line); border-radius: 17px; box-shadow: var(--shadow-md); }
.wizard-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 22px 24px; background: linear-gradient(180deg, #fff, #fbfcfd); border-bottom: 1px solid var(--line); }
.wizard-title > div > span { color: var(--primary); font-size: 10px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.wizard-title h2 { margin: 4px 0 4px; font-size: 23px; letter-spacing: -.025em; }
.wizard-title p { margin: 0; color: var(--muted); }
.workflow-form { display: grid; gap: 18px; padding: 24px; }
.wizard-actions { position: sticky; bottom: 0; z-index: 4; display: flex; justify-content: flex-end; gap: 9px; margin: 6px -24px -24px; padding: 16px 24px; background: rgba(255,255,255,.95); border-top: 1px solid var(--line); backdrop-filter: blur(8px); }
.approve-form { display: grid; gap: 16px; padding: 22px 24px 24px; background: #f8fbf9; border-top: 1px solid #c9e2d5; }
.unsaved-indicator { display: none; align-items: center; gap: 7px; margin-right: auto; color: var(--warning); font-size: 11px; font-weight: 750; }
.unsaved-indicator.visible { display: inline-flex; }
.unsaved-indicator::before { content: ""; width: 7px; height: 7px; background: #d97706; border-radius: 50%; }

/* Norm selector and routes */
.norm-selection-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.norm-selection-count { display: inline-flex; align-items: center; gap: 7px; color: var(--primary-strong); font-weight: 800; }
.norm-selection-count strong { display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0 7px; color: #fff; background: var(--primary); border-radius: 9px; }
.norm-selector-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.norm-select-card { position: relative; min-height: 142px; padding: 17px; background: #fff; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.norm-select-card:hover { transform: translateY(-2px); border-color: #9bbdd1; box-shadow: var(--shadow-sm); }
.norm-select-card input { position: absolute; top: 14px; right: 14px; }
.norm-select-card.selected { background: #f4f9fc; border-color: #75aaca; box-shadow: inset 0 0 0 1px #75aaca; }
.norm-select-card.selected::after { content: "Geselecteerd"; position: absolute; right: 13px; bottom: 12px; color: var(--success); font-size: 9px; font-weight: 850; text-transform: uppercase; }
.norm-select-card .norm-code { display: block; margin-bottom: 12px; color: var(--primary); font-size: 11px; font-weight: 900; letter-spacing: .08em; }
.norm-select-card strong, .norm-select-card small, .norm-select-card em { display: block; padding-right: 22px; }
.norm-select-card strong { font-size: 14px; line-height: 1.3; }
.norm-select-card small, .norm-select-card em { margin-top: 4px; color: var(--muted); font-size: 10px; font-style: normal; }
.selected-norm-configs { display: grid; gap: 14px; }
.norm-config-panel, .questionnaire-card, .phase-config-card, .factor-card, .pair-credit-card { padding: 19px; background: #fff; border: 1px solid var(--line); border-radius: 15px; }
.norm-config-panel.primary-panel { background: #f8fbfd; border-color: #8fb9d1; box-shadow: inset 3px 0 0 var(--primary); }
.norm-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.norm-panel-head span { color: var(--primary); font-size: 10px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.norm-panel-head h3 { margin: 3px 0; font-size: 18px; }
.norm-panel-head small { color: var(--muted); }
.primary-choice { flex-direction: row !important; align-items: center; gap: 8px; white-space: nowrap; }
.route-detail { margin-top: 15px; padding: 17px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 13px; }
.route-summary { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 13px; }
.route-summary strong { font-size: 15px; }
.route-summary p { margin: 4px 0 0; color: var(--muted); }
.route-summary > span { padding: 6px 9px; color: #245d85; background: #e7f1f7; border-radius: 999px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.route-question-grid { align-items: start; }
.route-question textarea, .smart-question textarea { min-height: 82px; }
.route-pill { display: inline-flex; align-items: center; margin: 2px; padding: 5px 8px; color: #2a5877; background: #e9f2f7; border-radius: 999px; font-size: 10px; font-weight: 750; }

/* Dynamic questions and complexity */
.questionnaire-card { overflow: hidden; padding: 0; }
.questionnaire-card .norm-panel-head { padding: 18px 20px; margin: 0; background: #fbfcfd; border-bottom: 1px solid var(--line); }
.questionnaire-card > .grid { padding: 18px 20px; }
.smart-question { min-height: 74px; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 11px; }
.smart-question > span { display: block; line-height: 1.45; }
.complexity-panel { margin: 0 20px 20px; padding: 16px; background: #f7fafc; border: 1px solid var(--line); border-radius: 12px; }
.complexity-summary { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; margin-bottom: 13px; }
.complexity-summary strong { font-size: 16px; }
.complexity-summary span { color: var(--muted); font-size: 11px; }
.complexity-meter { height: 8px; overflow: hidden; background: #e5ebf0; border-radius: 999px; }
.complexity-meter i { display: block; height: 100%; background: linear-gradient(90deg, #4fa36f, #d29a2d, #c45445); border-radius: inherit; }
.complexity-manual-fields { margin-top: 14px; }

/* Integration and correction */
.integration-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.integration-score { display: grid; grid-template-columns: 190px 1fr; align-items: center; gap: 18px; padding: 16px; background: #f2f7fb; border: 1px solid #cbdfea; border-radius: 13px; }
.integration-score strong { display: block; font-size: 26px; }
.integration-score span, .integration-score small { color: var(--muted); }
.score-bar { height: 9px; overflow: hidden; background: #dce8ef; border-radius: 999px; }
.score-bar i { display: block; height: 100%; background: var(--primary); }
.pair-credit-list { display: grid; gap: 12px; }
.pair-credit-card { display: grid; grid-template-columns: minmax(220px,.85fr) minmax(300px,1.15fr); gap: 20px; }
.pair-credit-card p { color: var(--muted); }
.factor-card h3 { margin: 0 0 14px; }
.credit-summary { padding: 17px; background: #fff8eb; border: 1px solid #ecd3a7; border-radius: 13px; }
.credit-summary h3 { margin-top: 0; }
.credit-summary > div { display: grid; grid-template-columns: 1fr auto; gap: 3px 16px; padding: 10px 0; border-top: 1px solid #ecd3a7; }
.credit-summary > div:first-of-type { border-top: 0; }
.credit-summary small { grid-column: 1 / -1; color: #7d4c16; }

/* Phases, calculation and quote */
.phase-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 11px; }
.phase-choice { padding: 14px; background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; }
.phase-choice > span { display: block; margin-bottom: 5px; }
.phase-choice strong, .phase-choice small { display: block; }
.phase-choice small { margin-top: 3px; color: var(--muted); }
.delivery-control { padding: 18px; background: #f8fafc; border: 1px solid var(--line); border-radius: 13px; }
.delivery-total { margin-top: 12px; padding: 10px 12px; background: #f2f4f7; border-radius: 9px; font-weight: 800; }
.delivery-total.valid { color: var(--success); background: var(--success-soft); }
.delivery-total.invalid { color: var(--danger); background: var(--danger-soft); }
.metrics, .review-grid, .program-summary-grid, .calculation-explain, .quote-preview { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px,1fr)); gap: 11px; margin: 15px 0; }
.metrics > div, .review-grid > div, .program-summary-grid > div, .calculation-explain > div, .quote-preview > div { display: grid; gap: 4px; min-height: 88px; padding: 15px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.metrics small, .review-grid span, .calculation-explain span, .quote-preview span { color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.metrics strong, .review-grid strong, .calculation-explain strong, .quote-preview strong { font-size: 20px; letter-spacing: -.025em; }
.summary-box { color: #fff; background: var(--navy) !important; border-color: var(--navy) !important; }
.calculation-table .primary-row td { background: #f6fafc; }
.calculation-table .primary-row td:first-child::after { content: "Primair"; display: inline-flex; margin-left: 6px; padding: 2px 6px; color: #245d85; background: #dfeef6; border-radius: 999px; font-size: 8px; font-weight: 850; }
.phase-row td { background: #fbfcfd; }
.phase-result-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(230px,1fr)); gap: 7px; }
.phase-result-list span { padding: 9px 10px; background: #f3f6f8; border-radius: 8px; font-size: 11px; }
.calculation-flow { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; }
.calculation-flow > div { min-width: 130px; display: grid; gap: 4px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.calculation-flow > span { align-self: center; color: var(--muted); font-weight: 850; }
.norm-rate-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(170px,1fr)); gap: 11px; }
.custom-cycle-grid { display: grid; gap: 12px; }
.custom-cycle-grid section { padding: 15px; background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; }
.custom-cycle-grid h3 { margin: 0 0 12px; }
.validation-list { color: #8c3f00; background: var(--warning-soft); border-color: #f0d09d; }
.validation-list h3 { margin-top: 0; }
.validation-list div { padding: 5px 0; }

/* Approved dossier */
.metrics { margin-bottom: 20px; }
.document-copy { max-width: 1050px; color: var(--ink-soft); font-size: 14px; line-height: 1.75; }
.norm-detail-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(310px,1fr)); gap: 13px; }
.norm-detail-card { overflow: hidden; background: #fbfcfd; border: 1px solid var(--line); border-radius: 13px; }
.norm-detail-card summary { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 15px 17px; background: #fff; cursor: pointer; }
.norm-detail-card[open] summary { border-bottom: 1px solid var(--line); }
.norm-detail-card > dl, .norm-detail-card > p, .norm-detail-card > div { margin: 0; padding: 16px 17px; }
.norm-detail-card > p, .norm-detail-card > div { color: var(--muted); border-top: 1px solid var(--line); }
.detail-list { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 14px; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; text-align: right; }
.event { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.event span { color: var(--muted); }

/* Auditor and reports */
.auditor-filter { padding: 15px; }
.auditor-mobile-list { display: grid; gap: 11px; }
.auditor-task { display: grid; grid-template-columns: 70px 1fr auto; gap: 16px; align-items: center; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 15px; }
.auditor-date { display: grid; place-items: center; min-height: 68px; color: #fff; background: var(--navy); border-radius: 12px; line-height: 1; }
.auditor-date strong { font-size: 23px; }
.auditor-date span { margin-top: 4px; font-size: 9px; letter-spacing: .1em; }
.auditor-task-main h2 { margin: 5px 0 3px; font-size: 18px; }
.auditor-task-main p, .auditor-task-main small { margin: 0; color: var(--muted); }
.auditor-task-side { display: flex; flex-direction: column; align-items: flex-end; gap: 9px; }

/* Norm management */
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.form-grid > .span-2 { grid-column: 1 / -1; }
.form-grid textarea[name$="_json"], .form-grid textarea[name="bands"], .form-grid textarea[name="relations"] { min-height: 190px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.55; }

/* Responsive */
@media (max-width: 1180px) {
    .dashboard-kpis { grid-template-columns: repeat(2,1fr); }
    .dashboard-grid-main { grid-template-columns: 1fr; }
    .dashboard-side-stack { grid-template-columns: repeat(2,1fr); }
    .workflow-shell { grid-template-columns: 248px minmax(0,1fr); }
    .pair-credit-card { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
    .mobile-topbar { position: sticky; top: 0; z-index: 45; display: flex; align-items: center; gap: 13px; height: 60px; padding: 0 17px; color: #fff; background: var(--navy); }
    .menu-toggle { display: grid; gap: 4px; width: 38px; height: 38px; padding: 10px !important; background: rgba(255,255,255,.06) !important; border: 1px solid rgba(255,255,255,.15) !important; box-shadow: none !important; }
    .menu-toggle span { display: block; height: 2px; background: #fff; border-radius: 999px; }
    .mobile-brand { font-size: 13px; }
    .mobile-brand strong { margin-left: 3px; }
    .sidebar { transform: translateX(-105%); transition: transform .22s ease; }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay { position: fixed; inset: 0; z-index: 49; display: block; background: rgba(7,20,32,.48); opacity: 0; pointer-events: none; transition: opacity .22s ease; }
    .sidebar-overlay.open { opacity: 1; pointer-events: auto; }
    .content { margin-left: 0; padding: 24px 18px 48px; }
    .workflow-shell { grid-template-columns: 1fr; }
    .wizard-nav { position: static; display: flex; overflow-x: auto; padding-bottom: 5px; }
    .wizard-progress, .workflow-summary-card { display: none; }
    .wizard-step { min-width: 205px; }
    .dashboard-grid-lower { grid-template-columns: 1fr; }
    .system-strip { grid-template-columns: repeat(2,1fr); }
    .login-shell { grid-template-columns: 1fr; }
    .login-intro { min-height: auto; padding: 38px; }
    .login-features { display: none; }
    .login-card { min-height: auto; }
}
@media (max-width: 740px) {
    .page-head, .workflow-head, .dashboard-hero, .wizard-title, .norm-panel-head, .route-summary, .form-section-head { flex-direction: column; align-items: stretch; }
    .dashboard-kpis, .dashboard-side-stack, .grid.two, .grid.three, .form-grid, .integration-grid { grid-template-columns: 1fr; }
    .span-2, .span-3, .form-grid > .span-2 { grid-column: auto; }
    .workflow-form { padding: 18px; }
    .wizard-actions { margin: 4px -18px -18px; padding: 14px 18px; flex-wrap: wrap; }
    .wizard-actions button { flex: 1 1 auto; }
    .timeline-item { grid-template-columns: 52px 1fr; }
    .timeline-item > .badge { grid-column: 2; }
    .auditor-task { grid-template-columns: 58px 1fr; }
    .auditor-task-side { grid-column: 2; flex-direction: row; align-items: center; }
    .system-strip { grid-template-columns: 1fr; }
    .login-intro { display: none; }
    .auth-wrap { padding: 16px; }
    .login-card { padding: 32px 25px; }
    .program-list-tools { align-items: stretch; flex-direction: column; }
    .search-box { width: 100%; }
}
@media print {
    body { background: #fff; }
    .sidebar, .mobile-topbar, .sidebar-overlay, .no-print, .page-head .btn, .page-head button, .wizard-actions, .approve-form { display: none !important; }
    .content { margin: 0; padding: 0; }
    .card, .panel, .wizard-card { box-shadow: none; break-inside: avoid; }
    a { color: #000; }
}

.norm-editor { display: grid; gap: 18px; }
.norm-editor .form-section { margin: 0; }
.norm-editor textarea[name$="_json"],
.norm-editor textarea[name="bands"],
.norm-editor textarea[name="relations"] {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    line-height: 1.55;
    tab-size: 2;
}
