:root {
    --navy-950: #081629;
    --navy-900: #10243e;
    --navy-800: #173354;
    --blue-700: #245bdb;
    --blue-600: #3478f6;
    --blue-100: #eaf1ff;
    --teal-600: #0d9488;
    --teal-100: #dff8f4;
    --amber-600: #d97706;
    --amber-100: #fff3d9;
    --red-600: #dc3545;
    --red-100: #ffeaec;
    --green-600: #15803d;
    --green-100: #e5f7eb;
    --ink: #142033;
    --muted: #64748b;
    --line: #e2e8f0;
    --canvas: #f4f7fb;
    --white: #ffffff;
    --shadow: 0 12px 36px rgba(15, 35, 64, .08);
    --radius: 16px;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--canvas); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.app-body { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: 260px; padding: 28px 18px 20px; color: #d9e5f4; background: linear-gradient(180deg, var(--navy-950), var(--navy-900)); display: flex; flex-direction: column; box-shadow: 10px 0 40px rgba(8, 22, 41, .09); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 30px; color: white; }
.brand-mark { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 11px 4px 11px 4px; color: white; font-weight: 900; font-size: .78rem; letter-spacing: -.04em; background: linear-gradient(145deg, var(--blue-600), #64d8ce); box-shadow: 0 8px 22px rgba(52, 120, 246, .3); }
.brand-mark.large { width: 50px; height: 50px; flex-basis: 50px; font-size: 1rem; }
.brand strong, .login-brand strong { display: block; font-size: 1.1rem; letter-spacing: .02em; }
.brand small, .login-brand small { display: block; margin-top: 2px; color: #8fa6c2; font-size: .76rem; }
.nav-list { display: grid; gap: 7px; }
.nav-list a { min-height: 47px; padding: 0 13px; border-radius: 11px; display: flex; align-items: center; gap: 13px; color: #adc0d7; font-weight: 650; font-size: .92rem; transition: .18s ease; }
.nav-list a:hover { color: white; background: rgba(255,255,255,.06); }
.nav-list a.active { color: white; background: linear-gradient(90deg, rgba(52,120,246,.34), rgba(52,120,246,.12)); box-shadow: inset 3px 0 var(--blue-600); }
.nav-icon { width: 24px; text-align: center; font-size: 1.16rem; }
.sidebar-user { margin-top: auto; padding: 16px 10px 0; border-top: 1px solid rgba(255,255,255,.09); display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #284668; color: white; font-weight: 800; }
.user-copy { min-width: 0; flex: 1; }
.user-copy strong, .user-copy small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-copy strong { color: white; font-size: .84rem; }
.user-copy small { color: #7f98b5; font-size: .72rem; margin-top: 2px; }
.logout-button { border: 0; color: #9eb2ca; background: transparent; cursor: pointer; font-size: 1.25rem; }
.logout-button:hover { color: white; }

.app-main { min-height: 100vh; margin-left: 260px; }
.topbar { height: 88px; padding: 0 clamp(22px, 4vw, 52px); background: rgba(255,255,255,.93); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px); }
.topbar h1 { margin: 2px 0 0; font-size: 1.36rem; letter-spacing: -.02em; }
.eyebrow { margin: 0; color: var(--blue-700); font-size: .68rem; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.today { margin-left: auto; color: var(--muted); display: flex; align-items: center; gap: 9px; font-size: .87rem; font-weight: 650; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px #dcfce7; }
.menu-button { display: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: white; cursor: pointer; }
.page-content { width: min(1460px, 100%); margin: 0 auto; padding: 34px clamp(22px, 4vw, 52px) 60px; }
.narrow-page { max-width: 1120px; }
.page-intro { margin-bottom: 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.page-intro h2 { margin: 0; font-size: clamp(1.38rem, 2vw, 1.85rem); letter-spacing: -.035em; }
.page-intro p { margin: 6px 0 0; color: var(--muted); }

.button { min-height: 43px; padding: 0 17px; border: 1px solid transparent; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 760; font-size: .89rem; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: white; background: var(--blue-700); box-shadow: 0 7px 18px rgba(36,91,219,.2); }
.button.primary:hover { background: #1e4fc3; }
.button.secondary { color: var(--navy-900); background: white; border-color: #cbd5e1; }
.button.ghost { color: var(--muted); background: transparent; border-color: var(--line); }
.button.danger-button { color: #b91c1c; background: var(--red-100); border-color: #fecdd3; }
.button.success-button { color: var(--green-600); background: var(--green-100); border-color: #bbf7d0; }
.button.wide { width: 100%; }
.button.compact { min-height: 35px; padding: 0 12px; font-size: .77rem; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.metric-card { min-height: 144px; padding: 23px; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow); display: flex; gap: 17px; align-items: flex-start; position: relative; overflow: hidden; }
.metric-card::after { content: ""; position: absolute; width: 80px; height: 80px; right: -30px; top: -30px; border-radius: 50%; background: currentColor; opacity: .05; }
.metric-icon { width: 43px; height: 43px; flex: 0 0 43px; display: grid; place-items: center; border-radius: 12px; background: var(--blue-100); color: var(--blue-700); font-weight: 900; font-size: 1.12rem; }
.metric-card span, .metric-card strong, .metric-card small { display: block; }
.metric-card span { color: var(--muted); font-size: .78rem; font-weight: 780; text-transform: uppercase; letter-spacing: .04em; }
.metric-card strong { margin: 4px 0 1px; color: var(--ink); font-size: 2rem; letter-spacing: -.05em; }
.metric-card small { color: #8a98aa; font-size: .75rem; }
.warning-metric .metric-icon { color: var(--amber-600); background: var(--amber-100); }
.danger-metric .metric-icon { color: var(--red-600); background: var(--red-100); }
.success-metric .metric-icon { color: var(--green-600); background: var(--green-100); }
.priority-panel { margin-bottom: 22px; border-color: #cddcfa; }
.count-pill { min-width: 25px; height: 25px; margin-left: 6px; padding: 0 8px; border-radius: 99px; display: inline-flex; align-items: center; justify-content: center; color: var(--blue-700); background: var(--blue-100); font-size: .72rem; }

.panel, .form-panel { border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow); }
.panel-header { min-height: 78px; padding: 19px 23px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.panel-header h3 { margin: 0; font-size: 1rem; }
.panel-header p { margin: 4px 0 0; color: var(--muted); font-size: .79rem; }
.text-link, .back-link { color: var(--blue-700); font-weight: 750; font-size: .84rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th { padding: 13px 18px; color: #718096; background: #f8fafc; border-bottom: 1px solid var(--line); text-align: left; font-size: .69rem; text-transform: uppercase; letter-spacing: .055em; }
td { padding: 16px 18px; border-bottom: 1px solid #edf1f6; color: #475569; font-size: .84rem; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfdff; }
td strong, td small { display: block; }
td strong { color: var(--ink); font-size: .86rem; }
td small { max-width: 290px; margin-top: 3px; color: #8290a3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.code-link { color: var(--blue-700); font-weight: 850; letter-spacing: .01em; white-space: nowrap; }
.sla-badge, .percentage-pill { display: inline-flex; align-items: center; min-height: 27px; padding: 0 10px; border-radius: 99px; font-size: .72rem; font-weight: 820; white-space: nowrap; }
.sla-badge.on-time { color: var(--blue-700); background: var(--blue-100); }
.sla-badge.warning { color: #a65b00; background: var(--amber-100); }
.sla-badge.overdue { color: #b91c1c; background: var(--red-100); }
.sla-badge.delivered, .percentage-pill { color: var(--green-600); background: var(--green-100); }
.stage-chip { display: inline-block; max-width: 270px; color: #334155; font-weight: 650; }
.role-badge, .status-badge { display: inline-flex; align-items: center; min-height: 27px; padding: 0 10px; border-radius: 99px; font-size: .72rem; font-weight: 820; white-space: nowrap; }
.role-badge { color: #28528c; background: #edf4ff; }
.status-badge.active { color: var(--green-600); background: var(--green-100); }
.status-badge.inactive { color: #64748b; background: #eef2f6; }
.inline-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.inline-actions form { margin: 0; }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--blue-700); background: white; font-weight: 900; }
.empty-state { min-height: 120px; display: grid; place-content: center; text-align: center; color: var(--muted); gap: 4px; }
.empty-state strong, .empty-state span { display: block; }
.table-action { width: 1%; white-space: nowrap; }

.filter-tabs { margin-bottom: 13px; padding: 5px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: white; display: flex; gap: 4px; box-shadow: 0 6px 22px rgba(15,35,64,.04); }
.filter-tabs a { min-height: 38px; padding: 0 15px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); font-size: .82rem; font-weight: 740; white-space: nowrap; }
.filter-tabs a:hover { color: var(--blue-700); background: #f4f7fc; }
.filter-tabs a.active { color: white; background: var(--blue-700); box-shadow: 0 5px 14px rgba(36,91,219,.2); }
.filter-bar { margin-bottom: 16px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: white; display: grid; grid-template-columns: minmax(240px, 1fr) minmax(180px, 230px) auto; gap: 10px; box-shadow: 0 6px 22px rgba(15,35,64,.04); }
.search-box { height: 43px; padding: 0 13px; border: 1px solid #cbd5e1; border-radius: 9px; display: flex; align-items: center; gap: 10px; color: #8794a7; }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; }
select, input, textarea { width: 100%; border: 1px solid #cbd5e1; border-radius: 9px; color: var(--ink); background: white; outline: none; transition: border .15s, box-shadow .15s; }
input, select { height: 43px; padding: 0 12px; }
textarea { padding: 11px 12px; resize: vertical; min-height: 96px; }
input:focus, select:focus, textarea:focus { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(52,120,246,.12); }

.form-panel { overflow: hidden; }
.form-section { padding: 27px 29px 30px; border-bottom: 1px solid var(--line); }
.form-section-title { display: flex; gap: 14px; margin-bottom: 23px; }
.form-section-title > span { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px; display: grid; place-items: center; color: var(--blue-700); background: var(--blue-100); font-size: .75rem; font-weight: 900; }
.form-section-title h3 { margin: 0; font-size: 1rem; }
.form-section-title p { margin: 4px 0 0; color: var(--muted); font-size: .8rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 19px 20px; }
.span-2 { grid-column: span 2; }
.field { display: grid; gap: 7px; color: #334155; font-size: .81rem; font-weight: 720; }
.field > small:not(.field-error) { color: var(--muted); font-size: .7rem; font-weight: 500; }
.field-error { color: var(--red-600); font-weight: 650; }
.checkbox-field { min-height: 58px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; display: flex; align-items: center; gap: 12px; color: #334155; }
.checkbox-field input { width: 19px; height: 19px; flex: 0 0 19px; accent-color: var(--blue-700); }
.checkbox-field strong, .checkbox-field small { display: block; }
.checkbox-field strong { font-size: .82rem; }
.checkbox-field small { margin-top: 3px; color: var(--muted); font-size: .71rem; }
.form-actions { padding: 20px 29px; display: flex; align-items: center; justify-content: space-between; gap: 18px; background: #f9fbfd; }
.form-actions > span { color: var(--muted); font-size: .76rem; }
.form-actions > div { display: flex; gap: 10px; }

.alert { margin-bottom: 18px; padding: 13px 15px; border-radius: 10px; font-size: .84rem; font-weight: 650; }
.alert.success { color: #166534; background: #e9f8ee; border: 1px solid #b8e8c7; }
.alert.danger { color: #b4232f; background: #fff0f1; border: 1px solid #f5c8cd; }
.alert.dismissible { display: flex; justify-content: space-between; align-items: center; }
.alert.dismissible button { border: 0; color: inherit; background: transparent; cursor: pointer; font-size: 1.2rem; }

.detail-heading { margin-bottom: 23px; display: flex; justify-content: space-between; align-items: end; gap: 24px; }
.title-line { margin-top: 9px; display: flex; align-items: center; gap: 12px; }
.title-line h2 { margin: 0; font-size: 1.8rem; letter-spacing: -.04em; }
.detail-heading p { margin: 6px 0 0; color: var(--muted); }
.deadline-card { min-width: 220px; padding: 15px 17px; border-left: 4px solid var(--blue-600); border-radius: 10px; background: white; box-shadow: var(--shadow); }
.deadline-card.warning { border-color: var(--amber-600); }
.deadline-card.overdue { border-color: var(--red-600); }
.deadline-card.delivered { border-color: var(--green-600); }
.deadline-card small, .deadline-card strong, .deadline-card span { display: block; }
.deadline-card small { color: var(--muted); font-size: .66rem; font-weight: 850; letter-spacing: .055em; }
.deadline-card strong { margin: 5px 0 2px; font-size: 1rem; text-transform: capitalize; }
.deadline-card span { color: var(--muted); font-size: .76rem; }
.progress-panel { margin-bottom: 18px; padding: 17px 20px; border: 1px solid #ccdbf8; border-radius: 13px; background: linear-gradient(90deg, white, #f4f8ff); box-shadow: 0 7px 24px rgba(36,91,219,.06); }
.progress-copy { margin-bottom: 9px; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.progress-copy span { color: #44556d; font-size: .82rem; font-weight: 780; }
.progress-copy strong { color: var(--blue-700); font-size: .9rem; }
.progress-track { height: 10px; overflow: hidden; border-radius: 99px; background: #dfe8f6; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue-700), #42b9b0); transition: width .35s ease; }
.progress-panel p { margin: 8px 0 0; color: var(--muted); font-size: .74rem; }
.detail-grid { display: grid; grid-template-columns: 1.6fr .9fr; gap: 18px; margin-bottom: 18px; }
.action-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(360px, 1.1fr); gap: 18px; margin-bottom: 18px; align-items: stretch; }
.detail-section { margin-bottom: 18px; }
.sample-summary { min-width: 0; }
.info-grid { margin: 0; padding: 23px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.info-grid div { min-width: 0; }
.info-grid div.full { grid-column: 1 / -1; }
.info-grid dt { margin-bottom: 5px; color: var(--muted); font-size: .69rem; font-weight: 800; text-transform: uppercase; letter-spacing: .045em; }
.info-grid dd { margin: 0; color: var(--ink); font-size: .86rem; font-weight: 680; overflow-wrap: anywhere; }
.current-stage { padding: 24px; color: white; border: 0; background: linear-gradient(145deg, #153355, #1e4f83); }
.current-stage-label { color: #9fd3ff; font-size: .68rem; font-weight: 900; letter-spacing: .08em; display: flex; align-items: center; gap: 9px; }
.mine-badge { margin-left: auto; padding: 5px 8px; border: 1px solid rgba(94,234,212,.35); border-radius: 99px; color: #a7f3e7; background: rgba(13,148,136,.16); font-size: .6rem; white-space: nowrap; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #56e5cf; box-shadow: 0 0 0 5px rgba(86,229,207,.13); }
.current-stage h3 { margin: 17px 0 21px; font-size: 1.22rem; line-height: 1.35; }
.stage-meta { padding: 10px 0; border-top: 1px solid rgba(255,255,255,.11); display: flex; justify-content: space-between; gap: 10px; font-size: .76rem; }
.stage-meta span { color: #abc0d8; }
.assign-form { margin-top: 13px; display: grid; gap: 9px; }
.current-stage .field { color: #dcecff; }
.current-stage select { color: var(--ink); }
.current-stage .button.secondary { border: 0; }
.workflow-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); gap: 18px; align-items: start; }
.timeline { list-style: none; margin: 0; padding: 24px; }
.timeline li { position: relative; display: grid; grid-template-columns: 38px 1fr; gap: 14px; padding-bottom: 22px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:not(:last-child)::before { content: ""; position: absolute; left: 18px; top: 36px; bottom: 0; width: 2px; background: var(--line); }
.timeline-marker { width: 38px; height: 38px; z-index: 1; display: grid; place-items: center; border: 2px solid #ccd7e5; border-radius: 50%; color: #77869a; background: white; font-size: .73rem; font-weight: 850; }
.timeline li.complete .timeline-marker { color: var(--green-600); border-color: #8bd0a2; background: var(--green-100); }
.timeline li.active .timeline-marker { color: white; border-color: var(--blue-600); background: var(--blue-600); box-shadow: 0 0 0 5px var(--blue-100); }
.timeline-content { min-width: 0; padding-top: 2px; }
.timeline-title { display: flex; justify-content: space-between; gap: 12px; }
.timeline-title strong { font-size: .87rem; }
.timeline-title > span { color: var(--muted); font-size: .7rem; font-weight: 750; }
.timeline-content p { margin: 5px 0; color: var(--muted); font-size: .76rem; }
.timeline-content small { display: block; color: #8b98a9; font-size: .7rem; margin-top: 3px; }
.advance-panel { min-width: 0; }
.advance-panel form { padding: 22px; display: grid; gap: 17px; }
.access-note { min-height: 240px; padding: 28px; display: flex; align-items: center; justify-content: center; gap: 17px; text-align: left; }
.access-note-icon { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 13px; display: grid; place-items: center; background: #eef3f9; font-size: 1.25rem; }
.access-note h3 { margin: 0 0 7px; font-size: 1rem; }
.access-note p { max-width: 430px; margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.55; }

.report-block { margin-bottom: 18px; }
.score { min-width: 160px; display: grid; grid-template-columns: 1fr 42px; gap: 9px; align-items: center; }
.score-track { height: 7px; overflow: hidden; border-radius: 99px; background: #e8edf4; }
.score-track span { display: block; height: 100%; border-radius: inherit; background: var(--blue-600); }
.score-track.teal span { background: var(--teal-600); }
.score strong { font-size: .73rem; }
.report-note { color: var(--muted); font-size: .76rem; }

.login-body { min-height: 100vh; background: var(--navy-950); }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; position: relative; overflow: hidden; }
.login-aside { min-height: 100vh; padding: clamp(34px, 5vw, 72px); color: white; background: radial-gradient(circle at 70% 55%, rgba(52,120,246,.25), transparent 32%), linear-gradient(145deg, #081629, #102b49); position: relative; overflow: hidden; }
.login-brand { display: flex; align-items: center; gap: 13px; }
.login-message { max-width: 590px; position: absolute; left: clamp(34px, 5vw, 72px); top: 43%; transform: translateY(-50%); z-index: 2; }
.section-kicker { color: #75b5ff; font-size: .69rem; font-weight: 900; letter-spacing: .13em; }
.section-kicker.dark { color: var(--blue-700); }
.login-message h1 { margin: 15px 0; font-size: clamp(2.8rem, 5vw, 5.1rem); line-height: .98; letter-spacing: -.06em; }
.login-message p { max-width: 470px; margin: 0; color: #a9bdd5; font-size: 1rem; line-height: 1.65; }
.login-orbit { position: absolute; width: 510px; height: 510px; right: -220px; bottom: -240px; border: 1px solid rgba(117,181,255,.16); border-radius: 50%; }
.login-orbit::before, .login-orbit::after { content: ""; position: absolute; inset: 52px; border: 1px solid rgba(117,181,255,.13); border-radius: 50%; }
.login-orbit::after { inset: 118px; }
.login-orbit span { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: #5eead4; box-shadow: 0 0 22px #5eead4; }
.login-orbit span:nth-child(1) { left: 72px; top: 85px; }
.login-orbit span:nth-child(2) { right: 85px; top: 190px; }
.login-orbit span:nth-child(3) { left: 170px; bottom: 45px; }
.login-panel { min-height: 100vh; padding: 50px; display: grid; place-items: center; background: #f6f8fc; }
.login-card { width: min(430px, 100%); padding: clamp(28px, 5vw, 48px); border: 1px solid var(--line); border-radius: 22px; background: white; box-shadow: 0 25px 80px rgba(8,22,41,.12); display: grid; gap: 21px; }
.login-card h2 { margin: 8px 0 4px; font-size: 2rem; letter-spacing: -.04em; }
.login-card p { margin: 0; color: var(--muted); }
.demo-access { padding: 13px; border-radius: 10px; color: #526174; background: #f1f5f9; font-size: .73rem; text-align: center; }
.demo-access strong, .demo-access span { display: block; }
.demo-access span { margin-top: 3px; }
.login-footer { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); color: #8492a5; font-size: .7rem; }

.error-body { min-height: 100vh; padding: 24px; display: grid; place-items: center; background: var(--canvas); }
.error-card { width: min(540px, 100%); padding: 44px; border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: var(--shadow); text-align: center; }
.error-card .brand-mark { margin: 0 auto 20px; }
.error-card h1 { margin: 10px 0; font-size: 1.65rem; }
.error-card p { margin: 0 0 24px; color: var(--muted); }

@media (max-width: 1180px) {
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .detail-grid { grid-template-columns: 1fr; }
    .current-stage { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
    .current-stage .current-stage-label, .current-stage h3, .current-stage .assign-form { grid-column: 1 / -1; }
    .action-grid { grid-template-columns: 1fr; }
}

@media (max-width: 920px) {
    .sidebar { transform: translateX(-105%); transition: transform .22s ease; }
    .sidebar.open { transform: translateX(0); }
    .sidebar.open::after { content: ""; position: fixed; inset: 0 0 0 260px; background: rgba(8,22,41,.42); }
    .app-main { margin-left: 0; }
    .menu-button { display: grid; place-items: center; }
    .workflow-grid { grid-template-columns: 1fr; }
    .advance-panel { position: static; }
    .login-shell { grid-template-columns: 1fr; }
    .login-aside { min-height: 330px; padding: 30px; }
    .login-message { position: static; transform: none; margin-top: 72px; }
    .login-message h1 { font-size: 2.7rem; }
    .login-panel { min-height: auto; padding: 38px 20px 70px; }
    .login-footer { color: #76869a; }
}

@media (max-width: 680px) {
    .topbar { height: 76px; padding: 0 16px; }
    .topbar .eyebrow, .today { display: none; }
    .topbar h1 { font-size: 1.15rem; }
    .page-content { padding: 24px 15px 50px; }
    .page-intro, .detail-heading { align-items: stretch; flex-direction: column; }
    .page-intro .button { width: 100%; }
    .metric-grid { grid-template-columns: 1fr; gap: 11px; }
    .metric-card { min-height: 110px; padding: 18px; align-items: center; }
    .metric-card strong { font-size: 1.7rem; }
    .filter-bar { grid-template-columns: 1fr; }
    .filter-tabs { margin-inline: -2px; }
    .responsive-table { min-width: 0; }
    .responsive-table thead { display: none; }
    .responsive-table, .responsive-table tbody, .responsive-table tr, .responsive-table td { display: block; width: 100%; }
    .responsive-table tbody { padding: 10px; }
    .responsive-table tr { margin-bottom: 11px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: white; }
    .responsive-table tr:last-child { margin-bottom: 0; }
    .responsive-table td { min-height: 46px; padding: 11px 13px; border-bottom: 1px solid #edf1f6; display: grid; grid-template-columns: 102px minmax(0, 1fr); align-items: center; gap: 10px; text-align: right; }
    .responsive-table td::before { content: attr(data-label); grid-column: 1; grid-row: 1 / span 4; align-self: center; color: #8390a2; font-size: .65rem; font-weight: 820; letter-spacing: .04em; text-align: left; text-transform: uppercase; }
    .responsive-table td > * { grid-column: 2; justify-self: end; min-width: 0; }
    .responsive-table td strong, .responsive-table td small { max-width: 100%; text-align: right; }
    .responsive-table td.table-action { display: block; padding: 12px 13px; }
    .responsive-table td.table-action::before { display: none; }
    .responsive-table td.table-action .button, .responsive-table td.table-action .icon-button { width: 100%; }
    .responsive-table td.table-action .inline-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
    .responsive-table td.table-action .inline-actions form { width: 100%; }
    .responsive-table td.table-action .inline-actions > :only-child { grid-column: 1 / -1; }
    .responsive-table td.empty-cell { display: block; border: 0; text-align: center; }
    .responsive-table td.empty-cell::before { display: none; }
    .responsive-table td.empty-cell .empty-state { justify-self: stretch; }
    .form-section { padding: 22px 17px; }
    .form-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .form-actions { padding: 18px 17px; align-items: stretch; flex-direction: column; }
    .form-actions > div { flex-direction: column-reverse; }
    .detail-heading { align-items: stretch; }
    .deadline-card { min-width: 0; }
    .info-grid { grid-template-columns: 1fr 1fr; padding: 19px; }
    .current-stage { display: block; }
    .action-grid { grid-template-columns: 1fr; }
    .progress-panel { padding: 15px; }
    .timeline { padding: 20px 15px; }
    .timeline-title { flex-direction: column; gap: 2px; }
    .login-aside { min-height: 290px; }
    .login-message { margin-top: 55px; }
    .login-message h1 { font-size: 2.25rem; }
    .login-message p { font-size: .88rem; }
    .login-card { padding: 27px 21px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
