/* HSE Fatigue Management · Dark Mode UI */
:root {
    --primary: #000B58;
    --secondary: #003161;
    --accent: #006A67;
    --highlight: #FFF4B7;
    --surface: #06132D;
    --text: #F8FAFC;
    --bg: #020817;
    --surface-2: color-mix(in srgb, var(--surface) 88%, #102142);
    --surface-3: color-mix(in srgb, var(--surface) 70%, var(--secondary));
    --muted: #94A3B8;
    --line: rgba(148, 163, 184, .16);
    --success: #34D399;
    --warning: #FBBF24;
    --danger: #FB7185;
    --info: #60A5FA;
    --shadow: 0 24px 70px rgba(0, 0, 0, .32);
    --radius: 20px;
    --radius-sm: 12px;
    --sidebar-width: 286px;
    color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 80% -10%, color-mix(in srgb, var(--accent) 25%, transparent), transparent 34%),
        radial-gradient(circle at 15% 100%, color-mix(in srgb, var(--secondary) 30%, transparent), transparent 35%),
        var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.55;
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .18;
    background-image:
        linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: linear-gradient(to bottom, black, transparent 85%);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, .btn { -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }
h1,h2,h3,h4,p { margin-top: 0; }
h1,h2,h3,h4 { line-height: 1.2; }
h1 { margin-bottom: 0; font-size: clamp(1.35rem, 2vw, 1.85rem); }
h2 { font-size: clamp(1.6rem, 2.6vw, 2.35rem); }
h3 { margin-bottom: 0; font-size: 1.08rem; }
small { color: var(--muted); }
.text-muted { color: var(--muted); }
.text-danger { color: var(--danger) !important; }
.wide-cell { min-width: 260px; }

.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed;
    z-index: 60;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    padding: 18px 14px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--primary) 82%, #030712), color-mix(in srgb, var(--surface) 95%, #000));
    border-right: 1px solid rgba(255,255,255,.08);
    box-shadow: 18px 0 50px rgba(0,0,0,.22);
    overflow-y: auto;
    transition: transform .28s ease;
}
.sidebar-brand { padding: 5px 8px 22px; }
.sidebar-brand > a { display: flex; gap: 13px; align-items: center; }
.sidebar-brand img { width: 48px; height: 48px; object-fit: contain; }
.brand-mark {
    width: 48px; height: 48px; flex: 0 0 48px;
    display: grid; place-items: center;
    border-radius: 15px;
    font-size: 1.35rem;
    color: var(--primary);
    background: linear-gradient(145deg, var(--highlight), #fff);
    box-shadow: 0 10px 30px color-mix(in srgb, var(--highlight) 24%, transparent);
    animation: breathe 3s ease-in-out infinite;
}
.sidebar-brand strong { display: block; font-size: .95rem; letter-spacing: -.01em; }
.sidebar-brand small { display: block; margin-top: 2px; font-size: .72rem; line-height: 1.35; }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-label {
    margin: 18px 12px 6px;
    color: color-mix(in srgb, var(--muted) 78%, transparent);
    font-size: .65rem; text-transform: uppercase; letter-spacing: .16em; font-weight: 800;
}
.sidebar-nav a, .sidebar-footer a {
    position: relative;
    display: flex; align-items: center; gap: 12px;
    min-height: 45px;
    padding: 10px 12px;
    border-radius: 13px;
    color: #cbd5e1;
    font-weight: 650;
    transition: .2s ease;
}
.sidebar-nav a::before {
    content: "";
    position: absolute; left: 0; top: 50%;
    width: 3px; height: 0;
    border-radius: 10px;
    background: var(--highlight);
    transform: translateY(-50%);
    transition: height .2s ease;
}
.sidebar-nav a i, .sidebar-footer a i {
    width: 22px; text-align: center; font-size: .98rem;
    color: color-mix(in srgb, var(--highlight) 74%, var(--muted));
}
.sidebar-nav a:hover, .sidebar-nav a.active {
    color: #fff;
    background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 36%, transparent), rgba(255,255,255,.04));
    transform: translateX(2px);
}
.sidebar-nav a.active::before { height: 24px; }
.sidebar-footer {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}
.sidebar-footer a:hover { color: #fff; background: rgba(255,255,255,.05); }
.sidebar-backdrop { display: none; }

.main-area { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar {
    position: sticky;
    z-index: 40;
    top: 0;
    min-height: 86px;
    display: flex; align-items: center; gap: 16px;
    padding: 15px clamp(18px, 3vw, 38px);
    background: rgba(2,8,23,.76);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
}
.topbar > div:nth-child(2) { flex: 1; }
.eyebrow {
    display: block;
    margin-bottom: 5px;
    color: color-mix(in srgb, var(--highlight) 82%, #fff);
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .14em;
    font-weight: 850;
}
.topbar-user { display: flex; align-items: center; gap: 10px; }
.avatar {
    width: 40px; height: 40px; flex: 0 0 40px;
    display: grid; place-items: center;
    border-radius: 13px;
    overflow: hidden;
    color: var(--primary); font-weight: 900;
    background: var(--highlight);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.topbar-user-copy strong, .topbar-user-copy span { display: block; }
.topbar-user-copy span { color: var(--muted); font-size: .74rem; }
.icon-button {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    padding: 0;
    color: var(--text);
    background: rgba(255,255,255,.05);
    border: 1px solid var(--line);
    border-radius: 12px;
    cursor: pointer;
    transition: .2s ease;
}
.icon-button:hover { border-color: color-mix(in srgb, var(--accent) 65%, transparent); background: color-mix(in srgb, var(--accent) 22%, transparent); }
.mobile-menu-toggle { display: none; }

.page-content {
    width: min(1600px, 100%);
    min-height: calc(100vh - 135px);
    margin: 0 auto;
    padding: clamp(18px, 3vw, 38px);
}
.app-footer {
    display: flex; justify-content: space-between; gap: 20px;
    padding: 18px clamp(18px, 3vw, 38px) 28px;
    color: var(--muted);
    font-size: .75rem;
}

.alert {
    position: relative;
    display: flex; align-items: flex-start; gap: 11px;
    margin-bottom: 18px;
    padding: 14px 45px 14px 16px;
    border: 1px solid;
    border-radius: 14px;
    animation: slideDown .32s ease both;
}
.alert-success { color: #d1fae5; border-color: rgba(52,211,153,.35); background: rgba(6,78,59,.52); }
.alert-warning { color: #fef3c7; border-color: rgba(251,191,36,.35); background: rgba(120,53,15,.45); }
.alert-danger { color: #ffe4e6; border-color: rgba(251,113,133,.38); background: rgba(127,29,29,.48); }
.alert-info { color: #dbeafe; border-color: rgba(96,165,250,.38); background: rgba(30,64,175,.38); }
.alert-close {
    position: absolute; right: 12px; top: 7px;
    color: inherit; background: none; border: 0; font-size: 1.35rem; cursor: pointer;
}

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    min-height: 42px;
    padding: 10px 17px;
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 800;
    transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); }
.btn:disabled { opacity: .48; cursor: not-allowed; }
.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 25%, transparent);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 16px 34px color-mix(in srgb, var(--accent) 34%, transparent); }
.btn-secondary { color: var(--text); border-color: var(--line); background: rgba(255,255,255,.055); }
.btn-secondary:hover { background: rgba(255,255,255,.095); }
.btn-highlight { color: #07102f; background: linear-gradient(135deg, var(--highlight), color-mix(in srgb, var(--highlight) 76%, white)); box-shadow: 0 12px 30px color-mix(in srgb, var(--highlight) 17%, transparent); }
.btn-outline { color: #fff; border-color: rgba(255,255,255,.24); background: rgba(255,255,255,.04); }
.btn-block { width: 100%; }
.btn-small { min-height: 34px; padding: 7px 11px; border-radius: 9px; font-size: .76rem; }
.page-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }

.hero-banner {
    position: relative;
    min-height: 260px;
    display: grid; grid-template-columns: minmax(0, 1fr) 260px;
    align-items: center; gap: 30px;
    padding: clamp(25px, 4vw, 48px);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 26px;
    background:
        linear-gradient(125deg, color-mix(in srgb, var(--primary) 96%, #020617), color-mix(in srgb, var(--accent) 68%, var(--secondary)));
    box-shadow: var(--shadow);
}
.hero-banner::after {
    content: "";
    position: absolute; inset: auto -8% -65% auto;
    width: 420px; height: 420px; border-radius: 50%;
    border: 1px solid rgba(255,255,255,.1);
    box-shadow: inset 0 0 80px rgba(255,255,255,.035);
}
.hero-copy { position: relative; z-index: 2; }
.hero-copy h2 { max-width: 720px; margin-bottom: 12px; }
.hero-copy p { max-width: 720px; margin-bottom: 24px; color: #cbd5e1; font-size: 1rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.safety-orbit { position: relative; width: 210px; height: 210px; justify-self: center; }
.orbit-ring { position: absolute; inset: 16px; border: 1px dashed rgba(255,255,255,.34); border-radius: 50%; animation: rotate 14s linear infinite; }
.orbit-core {
    position: absolute; inset: 58px;
    display: grid; place-items: center;
    border-radius: 50%;
    color: var(--primary); font-size: 2.2rem;
    background: var(--highlight);
    box-shadow: 0 0 0 12px rgba(255,255,255,.06), 0 0 60px color-mix(in srgb, var(--highlight) 30%, transparent);
    animation: breathe 3s ease-in-out infinite;
}
.orbit-dot { position: absolute; width: 16px; height: 16px; border-radius: 50%; background: var(--highlight); box-shadow: 0 0 20px var(--highlight); }
.dot-a { top: 14px; left: 98px; }
.dot-b { right: 19px; bottom: 47px; }
.dot-c { left: 24px; bottom: 52px; }

.stats-grid {
    display: grid; grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 15px; margin: 20px 0;
}
.stat-card {
    display: flex; align-items: center; gap: 14px;
    min-height: 130px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.025));
    box-shadow: 0 15px 45px rgba(0,0,0,.13);
    transition: .22s ease;
}
.stat-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 52%, transparent); }
.stat-icon {
    width: 50px; height: 50px; flex: 0 0 50px;
    display: grid; place-items: center;
    border-radius: 15px;
    color: var(--highlight);
    background: color-mix(in srgb, var(--accent) 28%, transparent);
    font-size: 1.15rem;
}
.stat-danger .stat-icon { color: #fecdd3; background: rgba(190,18,60,.35); }
.stat-card span, .stat-card strong, .stat-card small { display: block; }
.stat-card span { color: #cbd5e1; font-size: .76rem; }
.stat-card strong { margin: 2px 0; font-size: 2rem; line-height: 1; }

.content-grid { display: grid; gap: 20px; margin-bottom: 20px; }
.content-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.content-grid-profile { grid-template-columns: 330px minmax(0,1fr); }
.content-grid-form { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.content-card {
    position: relative;
    padding: clamp(18px, 2.3vw, 27px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(145deg, rgba(255,255,255,.052), rgba(255,255,255,.022)),
        color-mix(in srgb, var(--surface) 90%, transparent);
    box-shadow: 0 18px 55px rgba(0,0,0,.17);
    backdrop-filter: blur(12px);
    animation: fadeUp .36s ease both;
}
.section-heading {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
    margin-bottom: 20px;
}
.section-heading .eyebrow { margin-bottom: 7px; }
.section-icon { color: color-mix(in srgb, var(--highlight) 72%, var(--accent)); font-size: 1.35rem; }
.section-spaced { margin-top: 30px; }
.page-section-heading { margin: 4px 0 17px; }
.text-link { color: var(--highlight); font-size: .77rem; font-weight: 800; white-space: nowrap; }
.text-link:hover { text-decoration: underline; }

.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 13px 14px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
th { color: #94a3b8; background: rgba(255,255,255,.035); font-size: .67rem; text-transform: uppercase; letter-spacing: .09em; }
td { color: #e2e8f0; font-size: .82rem; }
td strong, td small { display: block; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: rgba(255,255,255,.032); }
tbody tr:last-child td { border-bottom: 0; }
.row-overdue { background: rgba(127,29,29,.18); }

.badge, .severity-pill, .priority-pill {
    display: inline-flex; align-items: center; justify-content: center;
    width: fit-content;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: .65rem;
    font-weight: 850;
    white-space: nowrap;
    letter-spacing: .02em;
}
.badge-success { color: #a7f3d0; background: rgba(5,150,105,.23); border: 1px solid rgba(52,211,153,.22); }
.badge-warning { color: #fde68a; background: rgba(217,119,6,.22); border: 1px solid rgba(251,191,36,.22); }
.badge-danger { color: #fecdd3; background: rgba(225,29,72,.22); border: 1px solid rgba(251,113,133,.25); }
.badge-muted { color: #cbd5e1; background: rgba(100,116,139,.2); border: 1px solid rgba(148,163,184,.18); }
.severity-low { color: #a7f3d0; background: rgba(16,185,129,.18); }
.severity-medium { color: #fde68a; background: rgba(245,158,11,.2); }
.severity-high { color: #fdba74; background: rgba(234,88,12,.22); }
.severity-critical { color: #fecdd3; background: rgba(225,29,72,.27); animation: pulseBorder 1.8s infinite; }
.priority-low { color: #bfdbfe; background: rgba(37,99,235,.18); }
.priority-medium { color: #fde68a; background: rgba(217,119,6,.18); }
.priority-high { color: #fdba74; background: rgba(234,88,12,.2); }
.priority-urgent { color: #fecdd3; background: rgba(225,29,72,.25); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 17px; }
.form-grid.single-column, .single-column { grid-template-columns: 1fr; }
.form-span-2 { grid-column: span 2; }
.form-group { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.form-group > span, .filter-bar label > span, .color-field > span {
    color: #cbd5e1;
    font-size: .75rem;
    font-weight: 750;
}
.form-group small { font-size: .7rem; }
input, select, textarea {
    width: 100%;
    color: var(--text);
    background: rgba(2,8,23,.62);
    border: 1px solid rgba(148,163,184,.21);
    border-radius: 11px;
    outline: 0;
    transition: .18s ease;
}
input, select { min-height: 44px; padding: 10px 12px; }
textarea { padding: 12px; resize: vertical; }
input:focus, select:focus, textarea:focus {
    border-color: color-mix(in srgb, var(--accent) 78%, #fff);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
input:disabled { opacity: .65; cursor: not-allowed; }
input[type="file"] { padding: 7px; }
input[type="color"] { padding: 3px; min-height: 42px; cursor: pointer; }
input::file-selector-button {
    margin-right: 10px; padding: 7px 11px;
    color: var(--text); background: rgba(255,255,255,.08);
    border: 0; border-radius: 8px; cursor: pointer;
}
.form-actions {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
    margin-top: 5px;
}
.form-actions.align-right { justify-content: flex-end; }
.form-divider {
    position: relative; margin: 9px 0 2px;
    color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 800;
}
.form-divider::before { content:""; position:absolute; left:0; right:0; top:50%; height:1px; background:var(--line); }
.form-divider span { position:relative; padding-right:12px; background: color-mix(in srgb, var(--surface) 92%, #020617); }
.input-icon { position: relative; }
.input-icon > i { position: absolute; z-index:2; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-icon input { padding-left: 42px; padding-right: 42px; }
.password-toggle { position:absolute; right:7px; top:50%; transform:translateY(-50%); width:34px; height:34px; border:0; color:var(--muted); background:transparent; cursor:pointer; }

.filter-bar { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; }
.filter-bar label { min-width: 175px; display:flex; flex-direction:column; gap:6px; }

.calculation-panel, .info-panel {
    display: flex; align-items: center; gap: 14px;
    margin-top: 20px; padding: 16px;
    border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
    border-radius: 14px;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.calculation-panel span { color: #cbd5e1; }
.calculation-panel strong { margin-left: auto; color: var(--highlight); font-size: 1.15rem; }
.info-panel > i { width: 34px; height:34px; flex:0 0 34px; display:grid; place-items:center; border-radius:10px; color:var(--highlight); background:rgba(255,255,255,.07); }
.info-panel strong, .info-panel p { display:block; margin:0; }
.info-panel p { margin-top:3px; color:var(--muted); font-size:.77rem; }

.question-card {
    display: flex; gap: 13px;
    margin-bottom: 12px; padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255,255,255,.025);
}
.question-number, .observation-step-number {
    width: 32px; height: 32px; flex: 0 0 32px;
    display: grid; place-items:center;
    border-radius:10px;
    color: var(--highlight);
    background: color-mix(in srgb, var(--accent) 25%, transparent);
    font-weight: 900;
}
.question-copy { flex:1; display:flex; align-items:center; justify-content:space-between; gap:15px; }
.question-copy > strong { font-size:.8rem; font-weight:650; }
.segmented-control, .result-options { display:flex; flex-wrap:wrap; gap:6px; }
.segmented-control label, .result-options label { cursor:pointer; }
.segmented-control input, .result-options input { position:absolute; opacity:0; pointer-events:none; }
.segmented-control span, .result-options span {
    display:inline-flex; align-items:center; gap:6px;
    min-height:34px; padding:7px 12px;
    color:#cbd5e1; background:rgba(255,255,255,.04);
    border:1px solid var(--line); border-radius:9px;
    font-size:.72rem; font-weight:800;
    transition:.18s ease;
}
.segmented-control input:checked + span, .result-options input:checked + span {
    color:#07102f; background:var(--highlight); border-color:var(--highlight);
    box-shadow:0 6px 20px color-mix(in srgb, var(--highlight) 18%, transparent);
}
.sticky-summary { position: sticky; top: 105px; }
.fatigue-preview, .take5-preview {
    min-height: 92px;
    display:grid; place-items:center;
    margin: 5px 0 16px;
    border-radius:16px;
    font-size:1.45rem; font-weight:950; letter-spacing:.04em;
    transition:.25s ease;
}
.fatigue-preview[data-status="success"], .take5-preview[data-status="success"] { color:#a7f3d0; background:rgba(5,150,105,.23); border:1px solid rgba(52,211,153,.28); }
.fatigue-preview[data-status="warning"], .take5-preview[data-status="warning"] { color:#fde68a; background:rgba(217,119,6,.2); border:1px solid rgba(251,191,36,.28); }
.fatigue-preview[data-status="danger"], .take5-preview[data-status="danger"] { color:#fecdd3; background:rgba(225,29,72,.23); border:1px solid rgba(251,113,133,.3); animation:pulseBorder 1.8s infinite; }
.sticky-summary > p { color:var(--muted); font-size:.79rem; }
.summary-checks { list-style:none; padding:0; margin:18px 0; display:grid; gap:9px; color:#cbd5e1; font-size:.76rem; }
.summary-checks i { color:var(--success); margin-right:8px; }
.risk-score { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; padding:14px; border-radius:13px; background:rgba(255,255,255,.035); }
.risk-score strong { color:var(--highlight); font-size:1.5rem; }
.pto-score { margin: 8px 0 12px; text-align:center; color:var(--highlight); font-size:3rem; font-weight:950; }

.result-card { display:flex; align-items:center; gap:16px; margin-bottom:20px; }
.result-icon { width:56px; height:56px; flex:0 0 56px; display:grid; place-items:center; border-radius:17px; background:rgba(255,255,255,.07); font-size:1.25rem; }
.result-card p { margin:9px 0 0; color:var(--muted); }
.result-not_fit { border-color:rgba(251,113,133,.35); }
.result-fit_with_caution { border-color:rgba(251,191,36,.3); }
.result-fit { border-color:rgba(52,211,153,.3); }

.activity-list { display:grid; }
.activity-list > a {
    display:flex; align-items:center; gap:12px;
    padding:12px 0; border-bottom:1px solid var(--line);
}
.activity-list > a:last-child { border-bottom:0; }
.activity-list > a:hover .activity-copy strong { color:var(--highlight); }
.activity-icon { width:38px; height:38px; flex:0 0 38px; display:grid; place-items:center; border-radius:11px; background:rgba(255,255,255,.05); }
.activity-copy { flex:1; min-width:0; }
.activity-copy strong, .activity-copy small { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.empty-state { min-height:250px; display:grid; place-items:center; align-content:center; text-align:center; color:var(--muted); padding:30px; }
.empty-state.compact { min-height:180px; }
.empty-state > i { margin-bottom:14px; color:color-mix(in srgb, var(--accent) 80%, white); font-size:2.2rem; }
.empty-state h3 { margin-bottom:7px; color:var(--text); }
.empty-state p { margin:0; }

.stepper {
    display:grid; grid-template-columns:repeat(3, minmax(0,1fr));
    gap:10px; margin-bottom:18px;
}
.stepper > div {
    position:relative;
    display:flex; align-items:center; gap:10px;
    padding:12px 15px;
    color:var(--muted);
    border:1px solid var(--line);
    border-radius:13px;
    background:rgba(255,255,255,.025);
}
.stepper > div span { width:28px; height:28px; display:grid; place-items:center; border-radius:9px; background:rgba(255,255,255,.06); font-weight:900; }
.stepper > div strong { font-size:.75rem; }
.stepper > div.active { color:#fff; border-color:color-mix(in srgb, var(--accent) 70%, transparent); background:color-mix(in srgb, var(--accent) 17%, transparent); }
.stepper > div.active span, .stepper > div.completed span { color:var(--primary); background:var(--highlight); }
.multi-step-form { max-width:980px; margin-inline:auto; }
.hazard-photo { display:block; margin-bottom:20px; overflow:hidden; border-radius:16px; border:1px solid var(--line); }
.hazard-photo img { width:100%; max-height:420px; object-fit:cover; transition:transform .4s ease; }
.hazard-photo:hover img { transform:scale(1.02); }

.detail-list { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:1px; margin-bottom:22px; overflow:hidden; border:1px solid var(--line); border-radius:14px; background:var(--line); }
.detail-list > div { min-height:70px; padding:13px; background:color-mix(in srgb, var(--surface) 93%, #020617); }
.detail-list span, .detail-list strong { display:block; }
.detail-list span { margin-bottom:5px; color:var(--muted); font-size:.68rem; text-transform:uppercase; letter-spacing:.06em; }
.detail-list strong { font-size:.8rem; }
.text-section { padding:17px 0; border-top:1px solid var(--line); }
.text-section h4 { margin-bottom:8px; font-size:.82rem; color:var(--highlight); }
.text-section p { margin:0; color:#cbd5e1; }
.success-section { margin-top:10px; padding:16px; border:1px solid rgba(52,211,153,.24); border-radius:13px; background:rgba(5,150,105,.12); }
.note-box, .reason-panel { margin-top:18px; padding:16px; border:1px solid var(--line); border-radius:13px; background:rgba(255,255,255,.025); }
.note-box p { margin:7px 0 0; color:#cbd5e1; }
.reason-panel h4 { margin-bottom:8px; }
.reason-panel ul { margin:0; padding-left:20px; color:#cbd5e1; }
.linked-task-card { display:grid; gap:1px; margin-bottom:20px; overflow:hidden; border-radius:13px; background:var(--line); }
.linked-task-card > div { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:12px; background:color-mix(in srgb, var(--surface) 93%, #020617); }
.linked-task-card span { color:var(--muted); font-size:.72rem; }

.status-tabs { display:flex; gap:8px; margin-bottom:18px; overflow-x:auto; padding-bottom:2px; }
.status-tabs a {
    display:flex; align-items:center; gap:8px;
    min-width:max-content;
    padding:10px 14px;
    color:#cbd5e1; border:1px solid var(--line); border-radius:12px; background:rgba(255,255,255,.03); font-weight:800;
}
.status-tabs a span { min-width:23px; height:23px; display:grid; place-items:center; padding:0 6px; border-radius:999px; background:rgba(255,255,255,.08); font-size:.68rem; }
.status-tabs a.active { color:var(--primary); background:var(--highlight); border-color:var(--highlight); }
.status-tabs a.active span { color:#fff; background:var(--primary); }

.module-card-grid { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:16px; margin-bottom:22px; }
.module-card {
    display:flex; flex-direction:column; gap:15px;
    min-height:280px;
    padding:22px;
    border:1px solid var(--line);
    border-radius:var(--radius);
    background:linear-gradient(145deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
    box-shadow:0 16px 45px rgba(0,0,0,.15);
    transition:.22s ease;
}
.module-card:hover { transform:translateY(-5px); border-color:color-mix(in srgb, var(--accent) 55%, transparent); }
.module-card > div:nth-child(2) { flex:1; }
.module-card h3 { margin-bottom:9px; }
.module-card p { color:var(--muted); font-size:.78rem; }
.module-card-icon { width:50px; height:50px; display:grid; place-items:center; border-radius:15px; color:var(--highlight); background:color-mix(in srgb, var(--accent) 25%, transparent); font-size:1.2rem; }
.module-card-icon.small { width:38px; height:38px; flex:0 0 38px; border-radius:11px; font-size:.9rem; }
.module-card-meta { display:flex; flex-wrap:wrap; gap:10px; color:#cbd5e1; font-size:.7rem; }
.module-card-meta i { margin-right:5px; color:var(--highlight); }

.procedure-heading { display:flex; justify-content:space-between; align-items:center; gap:20px; margin-bottom:20px; }
.procedure-heading h2 { margin-bottom:8px; }
.procedure-heading p { margin:0; color:var(--muted); }
.procedure-heading > span { display:inline-flex; align-items:center; gap:8px; min-width:max-content; padding:9px 12px; border-radius:10px; background:rgba(255,255,255,.05); color:#cbd5e1; font-size:.74rem; }

.observation-list { display:grid; gap:10px; margin-bottom:22px; }
.observation-row { display:flex; gap:12px; padding:15px; border:1px solid var(--line); border-radius:14px; background:rgba(255,255,255,.025); }
.observation-step-copy { flex:1; min-width:0; }
.observation-step-copy > strong { display:block; margin-bottom:11px; font-size:.8rem; }
.observation-step-copy > input { margin-top:10px; }
.critical-tag { display:inline-flex; margin-left:8px; padding:3px 7px; border-radius:999px; color:#fecdd3; background:rgba(225,29,72,.23); font-size:.58rem; text-transform:uppercase; letter-spacing:.06em; }
.checklist-section-title { margin:24px 0 10px; display:flex; align-items:center; gap:10px; color:var(--highlight); font-size:.72rem; font-weight:900; text-transform:uppercase; letter-spacing:.09em; }
.checklist-section-title::after { content:""; height:1px; flex:1; background:var(--line); }

.stack-list { display:grid; gap:9px; }
.stack-list article { display:flex; align-items:center; gap:11px; padding:12px; border:1px solid var(--line); border-radius:13px; background:rgba(255,255,255,.025); }
.stack-list article > div { flex:1; min-width:0; }
.stack-list strong, .stack-list small { display:block; }
.stack-list small { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.profile-summary { text-align:center; }
.profile-avatar-large { width:120px; height:120px; margin:0 auto 17px; display:grid; place-items:center; overflow:hidden; border-radius:34px; color:var(--primary); background:var(--highlight); font-size:2.2rem; font-weight:950; box-shadow:0 18px 45px color-mix(in srgb, var(--highlight) 15%, transparent); }
.profile-avatar-large img { width:100%; height:100%; object-fit:cover; }
.profile-summary h2 { margin-bottom:5px; font-size:1.3rem; }
.profile-summary > p { color:var(--muted); }
.profile-meta { display:grid; gap:10px; margin-top:20px; text-align:left; }
.profile-meta span { display:flex; align-items:center; gap:9px; padding:10px; border-radius:11px; background:rgba(255,255,255,.035); color:#cbd5e1; font-size:.75rem; }
.profile-meta i { width:20px; color:var(--highlight); text-align:center; }

.branding-preview { display:flex; align-items:center; gap:14px; margin-bottom:20px; padding:16px; border-radius:14px; border:1px solid var(--line); background:linear-gradient(135deg, var(--primary), var(--accent)); }
.brand-preview-logo { width:58px; height:58px; display:grid; place-items:center; flex:0 0 58px; border-radius:16px; background:rgba(255,255,255,.92); color:var(--primary); font-size:1.4rem; overflow:hidden; }
.brand-preview-logo img { width:100%; height:100%; object-fit:contain; padding:5px; }
.brand-preview-copy strong, .brand-preview-copy span { display:block; }
.brand-preview-copy span { color:#dbeafe; font-size:.74rem; }
.palette-strip { display:flex; gap:5px; }
.palette-strip span { width:28px; height:28px; border-radius:8px; border:1px solid rgba(255,255,255,.18); }
.color-setting-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin-bottom:18px; }
.color-field { display:flex; flex-direction:column; gap:7px; }
.color-field > div { display:grid; grid-template-columns:52px 1fr; gap:8px; }
.floating-save-bar {
    position:sticky; z-index:30; bottom:14px;
    display:flex; align-items:center; justify-content:space-between; gap:15px;
    margin-top:20px; padding:13px 16px;
    border:1px solid rgba(255,255,255,.13);
    border-radius:15px;
    background:rgba(0,11,88,.88);
    box-shadow:0 18px 60px rgba(0,0,0,.4);
    backdrop-filter:blur(16px);
}
.floating-save-bar span { color:#cbd5e1; font-size:.75rem; }

.auth-body { background:#020617; overflow-x:hidden; }
.auth-shell { min-height:100vh; display:grid; grid-template-columns:minmax(0,1.25fr) minmax(420px,.75fr); }
.auth-visual {
    position:relative;
    display:flex; align-items:center;
    min-height:100vh;
    padding:clamp(35px,7vw,105px);
    overflow:hidden;
    background:
        linear-gradient(135deg, rgba(0,11,88,.98), rgba(0,106,103,.78)),
        radial-gradient(circle at 25% 20%, #164e63, transparent 42%);
    background-size:cover;
    background-position:center;
}
.auth-visual::after {
    content:""; position:absolute; inset:0;
    background:linear-gradient(to top, rgba(2,6,23,.52), transparent 50%);
}
.auth-visual-content { position:relative; z-index:2; max-width:760px; }
.auth-logo { width:72px; height:72px; display:grid; place-items:center; margin-bottom:26px; border-radius:21px; overflow:hidden; color:var(--primary); background:var(--highlight); font-size:1.8rem; box-shadow:0 20px 50px rgba(0,0,0,.25); animation:breathe 3s ease-in-out infinite; }
.auth-logo img { width:100%; height:100%; object-fit:contain; padding:7px; background:#fff; }
.auth-kicker { display:inline-flex; margin-bottom:16px; padding:7px 10px; border:1px solid rgba(255,255,255,.2); border-radius:999px; color:var(--highlight); background:rgba(255,255,255,.06); font-size:.66rem; text-transform:uppercase; letter-spacing:.15em; font-weight:900; }
.auth-visual h1 { max-width:800px; margin-bottom:18px; font-size:clamp(2.2rem,5.2vw,5rem); letter-spacing:-.045em; }
.auth-visual p { max-width:670px; color:#dbeafe; font-size:clamp(.95rem,1.4vw,1.15rem); }
.auth-feature-grid { display:flex; flex-wrap:wrap; gap:10px; margin-top:28px; }
.auth-feature-grid div { display:flex; align-items:center; gap:8px; padding:10px 13px; border:1px solid rgba(255,255,255,.14); border-radius:12px; background:rgba(255,255,255,.07); font-size:.74rem; font-weight:800; }
.auth-feature-grid i { color:var(--highlight); }
.auth-visual-orb { position:absolute; border-radius:50%; border:1px solid rgba(255,255,255,.12); animation:float 7s ease-in-out infinite; }
.orb-one { width:340px; height:340px; right:-100px; top:-80px; }
.orb-two { width:190px; height:190px; left:8%; bottom:-80px; animation-delay:-2s; }
.auth-panel { display:grid; place-items:center; min-height:100vh; padding:30px; background:rgba(2,8,23,.95); }
.auth-card { width:min(450px,100%); padding:clamp(24px,4vw,42px); border:1px solid var(--line); border-radius:25px; background:linear-gradient(145deg, rgba(255,255,255,.06), rgba(255,255,255,.025)); box-shadow:var(--shadow); animation:fadeUp .5s ease both; }
.auth-card-heading { margin-bottom:25px; }
.auth-card-heading h2 { margin-bottom:8px; font-size:1.75rem; }
.auth-card-heading p { color:var(--muted); }
.auth-card .form-group { margin-bottom:17px; }
.demo-credential { margin-top:17px; padding:11px; border-radius:10px; color:var(--muted); background:rgba(255,255,255,.035); font-size:.7rem; text-align:center; }

@keyframes fadeUp { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:none; } }
@keyframes slideDown { from { opacity:0; transform:translateY(-10px); } to { opacity:1; transform:none; } }
@keyframes rotate { to { transform:rotate(360deg); } }
@keyframes breathe { 0%,100% { transform:scale(1); } 50% { transform:scale(1.05); } }
@keyframes float { 0%,100% { transform:translateY(0) rotate(0); } 50% { transform:translateY(-18px) rotate(6deg); } }
@keyframes pulseBorder { 0%,100% { box-shadow:0 0 0 0 rgba(251,113,133,0); } 50% { box-shadow:0 0 0 5px rgba(251,113,133,.08); } }

@media (max-width: 1250px) {
    .stats-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .module-card-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .color-setting-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 1050px) {
    .sidebar { transform:translateX(-102%); }
    body.sidebar-open .sidebar { transform:translateX(0); }
    .sidebar-backdrop { position:fixed; z-index:55; inset:0; display:block; background:rgba(0,0,0,.62); opacity:0; visibility:hidden; transition:.22s ease; }
    body.sidebar-open .sidebar-backdrop { opacity:1; visibility:visible; }
    .main-area { margin-left:0; }
    .mobile-menu-toggle { display:grid; }
    .auth-shell { grid-template-columns:1fr; }
    .auth-visual { min-height:48vh; }
    .auth-panel { min-height:52vh; }
    .auth-visual h1 { font-size:clamp(2.2rem,7vw,4rem); }
}
@media (max-width: 860px) {
    .content-grid-2, .content-grid-profile, .content-grid-form { grid-template-columns:1fr; }
    .sticky-summary { position:relative; top:auto; }
    .hero-banner { grid-template-columns:1fr; min-height:auto; }
    .safety-orbit { display:none; }
    .topbar-user-copy { display:none; }
    .module-card-grid { grid-template-columns:1fr; }
    .module-card { min-height:0; }
    .procedure-heading { align-items:flex-start; flex-direction:column; }
}
@media (max-width: 640px) {
    body { font-size:13px; }
    .page-content { padding:15px; }
    .topbar { min-height:72px; padding:11px 15px; }
    .topbar .eyebrow { display:none; }
    .topbar h1 { font-size:1.1rem; }
    .topbar-user .avatar { width:36px; height:36px; flex-basis:36px; }
    .stats-grid { grid-template-columns:1fr 1fr; gap:10px; }
    .stat-card { min-height:110px; padding:14px; align-items:flex-start; flex-direction:column; gap:9px; }
    .stat-icon { width:40px; height:40px; flex-basis:40px; border-radius:12px; }
    .stat-card strong { font-size:1.55rem; }
    .hero-banner { padding:24px 20px; border-radius:20px; }
    .hero-actions .btn { width:100%; }
    .content-card { padding:17px; border-radius:17px; }
    .form-grid, .color-setting-grid { grid-template-columns:1fr; }
    .form-span-2 { grid-column:span 1; }
    .question-copy { align-items:flex-start; flex-direction:column; }
    .segmented-control { width:100%; }
    .segmented-control label { flex:1; }
    .segmented-control span { justify-content:center; width:100%; }
    .stepper > div { justify-content:center; padding:10px; }
    .stepper > div strong { display:none; }
    .detail-list { grid-template-columns:1fr; }
    .status-tabs a { padding:9px 11px; }
    .observation-row { padding:12px; }
    .result-options { display:grid; grid-template-columns:repeat(3,1fr); width:100%; }
    .result-options span { justify-content:center; width:100%; padding-inline:7px; }
    .floating-save-bar { flex-direction:column; align-items:stretch; bottom:8px; }
    .floating-save-bar .btn { width:100%; }
    .auth-visual { min-height:42vh; padding:30px 22px; }
    .auth-visual p, .auth-feature-grid { display:none; }
    .auth-logo { width:58px; height:58px; margin-bottom:18px; }
    .auth-panel { min-height:58vh; padding:18px; }
    .auth-card { padding:24px 19px; border-radius:20px; }
    .app-footer { flex-direction:column; gap:4px; padding:16px; }
}
@media (max-width: 430px) {
    .stats-grid { grid-template-columns:1fr; }
    .stat-card { flex-direction:row; align-items:center; min-height:100px; }
    .page-actions .btn { flex:1; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration:.01ms !important; animation-iteration-count:1 !important; scroll-behavior:auto !important; transition-duration:.01ms !important; }
}
