:root {
    --navy-950: #071127;
    --navy-900: #0b1739;
    --navy-800: #132552;
    --signal: #2f6bff;
    --cyan: #48d7ff;
    --amber: #f7b84b;
    --red: #dc4c64;
    --ink: #17213a;
    --muted: #6d7892;
    --line: #dce3f0;
    --surface: #ffffff;
    --paper: #f3f6fb;
    --shadow: 0 14px 42px rgba(25, 45, 86, .08);
    --radius: 14px;
    --sidebar: 252px;
    font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
    color: var(--ink);
    background: var(--paper);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid rgba(72, 215, 255, .7); outline-offset: 2px; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--sidebar); padding: 22px 16px; color: #fff; background: linear-gradient(168deg, var(--navy-950) 0%, var(--navy-900) 57%, #102657 100%); display: flex; flex-direction: column; box-shadow: 14px 0 40px rgba(7, 17, 39, .14); }
.sidebar::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .18; background-image: linear-gradient(rgba(72,215,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(72,215,255,.08) 1px, transparent 1px); background-size: 28px 28px; mask-image: linear-gradient(to bottom, #000, transparent 76%); }
.brand { position: relative; display: flex; align-items: center; gap: 12px; min-height: 48px; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 42px; border-radius: 11px; color: #071127; background: linear-gradient(135deg, #fff 0%, var(--cyan) 100%); font: 800 14px/1 "Arial Narrow", sans-serif; letter-spacing: -.04em; box-shadow: 0 0 28px rgba(72,215,255,.28); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: .06em; }
.brand small { margin-top: 3px; color: #8ea7d7; font: 700 9px/1 "Consolas", monospace; letter-spacing: .18em; }
.nav { position: relative; margin-top: 32px; overflow-x: hidden; overflow-y: auto; }
.nav-label { margin: 20px 12px 8px; color: #6480b6; font: 700 10px/1 "Consolas", monospace; letter-spacing: .16em; }
.nav a { display: flex; align-items: center; justify-content: space-between; min-height: 43px; margin: 4px 0; padding: 0 12px; border: 1px solid transparent; border-radius: 9px; color: #b8c6e4; font-size: 14px; transition: background .18s ease, color .18s ease, transform .18s ease; }
.nav a:hover, .nav a[aria-current="page"] { color: #fff; background: rgba(72, 215, 255, .10); border-color: rgba(72, 215, 255, .16); transform: translateX(2px); }
.nav kbd { border: 0; color: #536d9f; background: transparent; font: 10px/1 "Consolas", monospace; }
.sidebar-foot { position: relative; display: flex; gap: 10px; align-items: center; margin-top: auto; padding: 14px 12px; border: 1px solid rgba(255,255,255,.09); border-radius: 10px; background: rgba(255,255,255,.04); }
.sidebar-foot strong, .sidebar-foot small { display: block; }
.sidebar-foot strong { font-size: 12px; }
.sidebar-foot small { margin-top: 4px; color: #7690c1; font: 10px/1 "Consolas", monospace; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #43d1a0; box-shadow: 0 0 0 5px rgba(67,209,160,.12); }
.muted-dot { background: #8190ad; box-shadow: 0 0 0 5px rgba(129,144,173,.12); }

.workspace { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { position: sticky; top: 0; z-index: 20; height: 68px; padding: 0 34px; display: flex; align-items: center; gap: 20px; border-bottom: 1px solid rgba(220,227,240,.85); background: rgba(243,246,251,.88); backdrop-filter: blur(16px); }
.breadcrumb { color: var(--muted); font-size: 13px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.topbar-actions form { margin: 0; }
.user-chip { padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--navy-800); background: #fff; font-size: 12px; font-weight: 700; }
.link-button { border: 0; color: var(--muted); background: none; cursor: pointer; font-size: 12px; }
.icon-button { border: 0; background: none; cursor: pointer; }
.mobile-menu { display: none; }
.sidebar-close { display: none; }
.main-content { max-width: 1600px; margin: 0 auto; padding: 34px; }
.toast-region { position: fixed; top: 84px; right: 24px; z-index: 60; max-width: min(420px, calc(100vw - 32px)); padding: 12px 16px; border: 1px solid #b8dfd2; border-left: 4px solid #2a8069; border-radius: 8px; color: #185f4d; background: #f1fbf7; box-shadow: 0 12px 32px rgba(23, 69, 58, .16); opacity: 0; visibility: hidden; transform: translateY(-8px); overflow-wrap: anywhere; pointer-events: none; transition: opacity .16s ease, transform .16s ease, visibility .16s ease; }
.toast-region.visible { opacity: 1; visibility: visible; transform: translateY(0); }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.page-heading.compact { margin-bottom: 18px; }
.page-heading h1 { margin: 5px 0 6px; color: var(--navy-950); font-size: clamp(27px, 3vw, 38px); line-height: 1.12; letter-spacing: -.04em; }
.page-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.eyebrow { color: var(--signal); font: 800 10px/1 "Consolas", monospace; letter-spacing: .17em; text-transform: uppercase; }
.mono { font-family: "Consolas", "SFMono-Regular", monospace; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-weight: 700; font-size: 13px; transition: transform .16s ease, box-shadow .16s ease, background .16s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: #fff; background: var(--signal); box-shadow: 0 8px 20px rgba(47,107,255,.23); }
.button.secondary { color: var(--navy-800); background: #e9efff; border-color: #cfdaff; }
.button.ghost { color: var(--navy-800); background: #fff; border-color: var(--line); }
.button.text { min-height: 32px; padding: 0 8px; color: var(--signal); background: transparent; }
.button.wide { width: 100%; }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.alert-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric { position: relative; overflow: hidden; min-height: 142px; padding: 20px; border: 1px solid #e1e7f1; border-radius: var(--radius); background: var(--surface); box-shadow: 0 8px 26px rgba(25,45,86,.05); }
.metric::after { content: ""; position: absolute; top: 0; right: 0; width: 54px; height: 3px; background: #c7d2e7; }
.metric.signal::after { width: 84px; background: linear-gradient(90deg, var(--signal), var(--cyan)); }
.metric span, .metric small { display: block; color: var(--muted); font-size: 12px; }
.metric strong { display: block; margin: 14px 0 10px; color: var(--navy-950); font: 700 36px/1 "DIN Alternate", "Arial Narrow", sans-serif; font-variant-numeric: tabular-nums; }
.metric.signal strong { color: var(--signal); }
.work-queues { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.work-queues .panel { min-width: 0; margin-bottom: 0; padding: 16px; }
.work-queues .panel-head { margin-bottom: 12px; }
.queue-item { display: flex; align-items: start; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid #edf0f6; color: var(--navy-800); }
.queue-item span { min-width: 0; display: grid; gap: 3px; }
.queue-item strong, .queue-item small, .queue-item time { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-item strong { font-size: 12px; }
.queue-item small, .queue-item time { color: var(--muted); font-size: 11px; }
.queue-item.danger time { color: #b53742; font-weight: 700; }
.content-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.content-grid > * { min-width: 0; }
.content-grid.two-thirds { grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); }
.panel { margin-bottom: 18px; padding: 22px; border: 1px solid #e0e6f0; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-head h2, .panel h2 { margin: 0 0 5px; color: var(--navy-950); font-size: 17px; }
.panel-head p, .panel > p { margin: 0; color: var(--muted); font-size: 12px; }
.panel-head a { color: var(--signal); font-size: 12px; font-weight: 700; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 11px 12px; color: #71809c; background: #f7f9fc; border-bottom: 1px solid var(--line); text-align: left; font-size: 11px; font-weight: 800; letter-spacing: .04em; white-space: nowrap; }
td { padding: 14px 12px; border-bottom: 1px solid #edf0f6; color: #34405b; }
tbody tr:hover td { background: #fafcff; }
td a { color: var(--navy-800); font-weight: 700; }
.table-action { color: var(--signal); }
.tag, .state-badge { display: inline-flex; align-items: center; min-height: 25px; padding: 0 9px; border: 1px solid #cfdaef; border-radius: 999px; color: #42567d; background: #f0f4fb; font-size: 11px; font-weight: 700; white-space: nowrap; }
.state-badge { color: #fff; background: var(--navy-800); border-color: var(--navy-800); }
.status-list { list-style: none; margin: 0 0 18px; padding: 0; }
.status-list li { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid #edf0f6; font-size: 12px; }
.status-list li span { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.status-list strong { color: var(--navy-800); }

.filter-bar, .upload-row { display: flex; align-items: end; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.filter-bar label { flex: 1 1 170px; }
label { display: grid; gap: 7px; color: #42506c; font-size: 12px; font-weight: 700; }
input, select, textarea { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #ced7e7; border-radius: 8px; color: var(--ink); background: #fff; transition: border-color .16s ease, box-shadow .16s ease; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--signal); box-shadow: 0 0 0 3px rgba(47,107,255,.1); outline: 0; }
.form-panel fieldset { margin: 0 0 22px; padding: 0; border: 0; }
.form-panel legend { margin-bottom: 14px; color: var(--navy-950); font-size: 15px; font-weight: 800; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.span-full { grid-column: 1 / -1; }
.compact-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.compact-form > input { width: auto; min-width: 140px; flex: 1 1 140px; }
.compact-form .check-inline { flex: 0 0 auto; }
.check-inline { display: inline-flex; align-items: center; gap: 6px; margin: 4px 14px 4px 0; font-weight: 500; }
.check-inline input { width: 16px; min-height: 16px; margin: 0; }
.form-grid fieldset { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.span-2 { grid-column: span 2; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); margin: 0; gap: 0; }
.detail-list div { padding: 15px 0; border-bottom: 1px solid #edf0f6; }
.detail-list dt { color: var(--muted); font-size: 11px; }
.detail-list dd { margin: 7px 0 0; font-size: 13px; font-weight: 700; }
.tabs { display: flex; gap: 3px; margin-bottom: 18px; padding: 5px; overflow-x: auto; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.tabs a { padding: 9px 14px; border-radius: 7px; color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.tabs a:hover, .tabs a.active { color: var(--navy-800); background: #edf3ff; }
.project-summary { display: grid; grid-template-columns: minmax(180px, .9fr) minmax(0, 2.1fr) minmax(250px, 1.35fr); gap: 18px; align-items: stretch; margin-bottom: 18px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 8px 26px rgba(25,45,86,.05); }
.project-summary-main h2 { margin: 8px 0 6px; color: var(--navy-950); font-size: 22px; }
.project-summary-main p { margin: 0; color: var(--muted); font-size: 12px; }
.project-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 18px; margin: 0; }
.project-summary-grid div { min-width: 0; padding: 10px 0; border-bottom: 1px solid #edf0f6; }
.project-summary-grid dt { color: var(--muted); font-size: 11px; }
.project-summary-grid dd { margin: 5px 0 0; overflow-wrap: anywhere; color: var(--navy-800); font-size: 14px; font-weight: 700; }
.project-summary-grid dd small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 500; }
.project-summary-activity { min-width: 0; }
.project-summary-activity h3 { margin: 0 0 8px; color: var(--navy-800); font-size: 13px; }
.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-list li { border-bottom: 1px solid #edf0f6; }
.activity-list a { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; padding: 8px 0; color: inherit; }
.activity-list strong, .activity-list small { display: block; }
.activity-list strong { color: var(--navy-800); font-size: 12px; }
.activity-list small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.activity-list time { flex: 0 0 auto; color: var(--muted); font: 11px/1.3 "DIN Alternate", "Arial Narrow", sans-serif; }

.workflow-rail { display: flex; align-items: start; list-style: none; margin: 8px 0 0; padding: 12px 0; overflow-x: auto; }
.workflow-rail li { position: relative; min-width: 150px; flex: 1 0 150px; padding: 34px 12px 0 0; }
.workflow-rail li::before { content: ""; position: absolute; top: 12px; left: 10px; right: -10px; height: 2px; background: #d9e1ef; }
.workflow-rail li:last-child::before { right: calc(100% - 12px); }
.rail-node { position: absolute; top: 6px; left: 4px; z-index: 1; width: 14px; height: 14px; border: 3px solid #fff; border-radius: 50%; background: #aab7cc; box-shadow: 0 0 0 2px #aab7cc; }
.stage-completed::before { background: var(--signal) !important; }
.stage-completed .rail-node { background: var(--signal); box-shadow: 0 0 0 2px var(--signal); }
.stage-current .rail-node { background: var(--cyan); box-shadow: 0 0 0 2px var(--signal), 0 0 18px 5px rgba(72,215,255,.38); }
.workflow-rail strong, .workflow-rail small { display: block; }
.workflow-rail strong { color: var(--navy-950); font-size: 12px; }
.workflow-rail small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.workflow-actions { display: grid; gap: 16px; }
.workflow-actions form + form { padding-top: 16px; border-top: 1px solid #edf0f6; }
.workflow-actions .stack-form { display: grid; gap: 12px; margin-top: 14px; }
.workflow-meta { display: grid; gap: 5px; margin-top: 7px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.workflow-history { margin-top: 20px; padding-top: 18px; border-top: 1px solid #edf0f6; }
.workflow-history h3 { margin: 0 0 12px; color: var(--navy-950); font-size: 13px; }
.deadline-state-overdue { color: #b84a42 !important; }
.deadline-state-due { color: #a56a13 !important; }
.deadline-state-normal { color: #2a8069 !important; }
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; color: var(--ink); background: #f3f6fb; }
.error-shell { width: min(100%, 520px); padding: 42px; border: 1px solid #e0e6f0; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.error-shell h1 { margin: 14px 0 10px; color: var(--navy-950); font-size: 28px; }
.error-message { margin: 0 0 24px; color: var(--muted); line-height: 1.7; }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.role-card { padding: 22px; border: 1px solid #e0e6f0; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.role-top { display: flex; justify-content: space-between; align-items: center; }
.role-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: #fff; background: var(--navy-800); font: 800 12px/1 "Consolas", monospace; }
.role-card h2 { margin: 18px 0 7px; font-size: 18px; }
.role-card p { min-height: 38px; color: var(--muted); font-size: 12px; }
.role-card dl { display: flex; gap: 26px; padding: 14px 0; border-top: 1px solid #edf0f6; border-bottom: 1px solid #edf0f6; }
.role-card dl div { display: grid; gap: 5px; }
.role-card dt { color: var(--muted); font-size: 10px; }
.role-card dd { margin: 0; font: 700 20px/1 "Consolas", monospace; }
.role-card .button-row { margin-top: 16px; }
.permission-toolbar { display: flex; justify-content: space-between; padding: 12px 14px; margin-bottom: 10px; border-radius: 9px; background: #f5f8fc; font-size: 12px; }
.permission-node { position: relative; grid-template-columns: 20px minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 11px 12px; border-bottom: 1px solid #edf0f6; cursor: pointer; }
.permission-node input { width: 17px; min-height: 17px; accent-color: var(--signal); }
.permission-node span strong, .permission-node span small { display: block; }
.permission-node small { margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 400; }
.permission-node em { color: var(--muted); font: normal 10px/1 "Consolas", monospace; }
.permission-node.level-page { padding-left: 34px; }
.permission-node.level-action { padding-left: 58px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); min-width: 0; gap: 6px; }
.calendar-panel { min-width: 0; overflow-x: hidden; }
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.calendar-switch, .calendar-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.calendar-switch { padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: #f7f9fc; }
.calendar-switch a { min-width: 42px; padding: 8px 12px; border-radius: 6px; color: var(--muted); text-align: center; font-size: 12px; font-weight: 800; }
.calendar-switch a.active { color: var(--navy-800); background: #fff; box-shadow: 0 2px 7px rgba(25,45,86,.08); }
.calendar-period { color: var(--navy-950); font-size: 16px; }
.calendar-filter { display: flex; align-items: end; gap: 8px; margin: 0; flex-wrap: wrap; }
.calendar-filter label { min-width: 160px; }
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); min-width: 0; gap: 6px; margin-bottom: 6px; color: var(--muted); font-size: 10px; text-align: center; }
.calendar-grid.calendar-month, .calendar-grid.calendar-week, .calendar-weekdays { min-width: 0; }
.calendar-day { min-width: 0; min-height: 132px; padding: 9px; border-radius: 8px; background: #f5f8fc; }
.calendar-day.is-adjacent { opacity: .48; }
.calendar-day.holiday { background: #fff4f2; }
.calendar-day-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.calendar-day strong, .calendar-day span { display: block; }
.calendar-day strong { font: 11px/1 "Consolas", monospace; }
.calendar-day span { margin-top: 10px; color: var(--muted); font-size: 10px; }
.calendar-events { display: grid; min-width: 0; gap: 4px; margin-top: 12px; }
.calendar-event { display: block; min-width: 0; overflow-wrap: anywhere; padding: 5px 6px; border-left: 3px solid var(--signal); border-radius: 5px; color: var(--navy-800); background: #fff; font-size: 10px; line-height: 1.35; white-space: normal; }
.calendar-event.type-transition, .agenda-item.type-transition { border-color: var(--signal); }
.calendar-event.type-deadline, .agenda-item.type-deadline { border-color: #2a8069; }
.calendar-event.type-delivery, .agenda-item.type-delivery { border-color: var(--cyan); }
.calendar-event.event-due { border-color: #d79b35; background: #fffaf0; }
.calendar-event.event-overdue { border-color: #c95b51; background: #fff4f2; }
.calendar-more { color: var(--muted); font-size: 10px; }
.calendar-agenda { display: grid; gap: 8px; }
.calendar-agenda h2 { margin: 0 0 8px; color: var(--navy-950); font-size: 16px; }
.agenda-item { display: grid; grid-template-columns: 110px minmax(0,1fr); gap: 14px; padding: 13px 14px; border-left: 3px solid var(--signal); border-radius: 8px; color: var(--navy-800); background: #f7f9fc; }
.agenda-item.event-due { border-color: #d79b35; background: #fffaf0; }
.agenda-item.event-overdue { border-color: #c95b51; background: #fff4f2; }
.agenda-item time { color: var(--muted); font: 11px/1.4 "Consolas", monospace; }
.agenda-item > span { min-width: 0; overflow-wrap: anywhere; }
.agenda-item strong, .agenda-item small { display: block; }
.agenda-item small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.calendar-task-list { display: grid; min-width: 0; gap: 18px; }
.calendar-empty { margin: 0; padding: 26px 0; text-align: center; }
.calendar-task-day { min-width: 0; padding-top: 16px; border-top: 1px solid var(--line); }
.calendar-task-day:first-child { padding-top: 0; border-top: 0; }
.calendar-task-day > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.calendar-task-day h2 { margin: 0; color: var(--navy-950); font-size: 15px; }
.calendar-task-day > header span { color: var(--muted); font-size: 11px; }
.calendar-task-items { display: grid; min-width: 0; gap: 7px; }
.calendar-task-row { display: grid; grid-template-columns: 96px minmax(0,1fr) auto; align-items: center; min-width: 0; gap: 14px; padding: 12px 14px; border-left: 3px solid var(--signal); border-radius: 7px; color: var(--navy-800); background: #f7f9fc; }
.calendar-task-row.type-deadline { border-color: #2a8069; }
.calendar-task-row.type-delivery { border-color: var(--cyan); }
.calendar-task-row.event-due { border-color: #d79b35; background: #fffaf0; }
.calendar-task-row.event-overdue { border-color: #c95b51; background: #fff4f2; }
.calendar-task-row time { color: var(--muted); font: 11px/1.4 "Consolas", monospace; }
.calendar-task-main { min-width: 0; overflow-wrap: anywhere; }
.calendar-task-main strong, .calendar-task-main small { display: block; }
.calendar-task-main small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.calendar-task-meta { display: flex; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.calendar-task-meta em { padding: 4px 6px; border: 1px solid #dfe5f0; border-radius: 5px; color: var(--muted); background: #fff; font-size: 10px; font-style: normal; white-space: nowrap; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.choice-card { grid-template-columns: 20px 1fr; align-items: start; padding: 18px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.choice-card:has(input:checked) { border-color: var(--signal); background: #f3f7ff; box-shadow: 0 0 0 3px rgba(47,107,255,.08); }
.choice-card input { width: 17px; min-height: 17px; accent-color: var(--signal); }
.choice-card strong, .choice-card small { display: block; }
.choice-card small { margin-top: 7px; color: var(--muted); line-height: 1.55; font-weight: 400; }
.selection-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; padding: 10px 12px; border-radius: 8px; background: #f5f8fc; }
.export-project-list { display: grid; gap: 6px; max-height: 520px; overflow-y: auto; }
.export-project-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid #edf0f6; border-radius: 8px; cursor: pointer; }
.export-project-row:hover { background: #f7f9fc; border-color: #cfdaef; }
.export-project-row input { width: 17px; min-height: 17px; }
.export-project-row strong, .export-project-row small { display: block; }
.export-project-row small, .export-project-row time { color: var(--muted); font-size: 11px; }
.overview-list { display: grid; gap: 8px; }
.overview-item, .overview-group a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border: 1px solid #edf0f6; border-radius: 8px; color: var(--navy-800); }
.overview-item small, .overview-group small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.overview-group { display: grid; gap: 7px; padding: 11px 0; }
.overview-group > strong { color: var(--navy-950); font-size: 12px; }
.empty-state.compact { padding: 18px 10px; }
.drop-zone { display: grid; place-items: center; min-height: 310px; padding: 34px; border: 1px dashed #aebbd2; border-radius: 12px; background: linear-gradient(135deg, #fbfcff, #f1f5fc); text-align: center; }
.drop-zone input { max-width: 420px; }
.drop-zone strong { margin-top: 8px; }
.drop-zone span { color: var(--muted); font-size: 12px; }
.empty-state { padding: 60px 20px; text-align: center; }

.auth-page { min-height: 100vh; color: #fff; background: var(--navy-950); }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0,1.25fr) minmax(400px,.75fr); }
.auth-shell.single { grid-template-columns: minmax(320px,520px); place-content: center; padding: 24px; }
.auth-context { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: clamp(42px, 8vw, 120px); background: radial-gradient(circle at 30% 34%, rgba(47,107,255,.30), transparent 34%), linear-gradient(145deg, #071127, #0f2450); }
.auth-context::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(72,215,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(72,215,255,.07) 1px, transparent 1px); background-size: 38px 38px; mask-image: radial-gradient(circle at 35% 45%, black, transparent 62%); }
.auth-context > * { position: relative; z-index: 1; }
.auth-context h1 { margin: 18px 0; max-width: 650px; font-size: clamp(42px, 6vw, 82px); line-height: .98; letter-spacing: -.065em; }
.auth-context p { max-width: 520px; color: #a8badc; line-height: 1.8; }
.auth-signal { display: flex; align-items: center; gap: 10px; margin-top: 48px; color: #7893c4; font: 11px/1 "Consolas", monospace; }
.auth-signal span { width: 42px; height: 2px; background: var(--cyan); box-shadow: 0 0 14px var(--cyan); }
.auth-card { align-self: stretch; display: flex; flex-direction: column; justify-content: center; padding: clamp(34px, 6vw, 90px); color: var(--ink); background: #fff; }
.auth-shell.single .auth-card { border-radius: 18px; box-shadow: 0 24px 70px rgba(0,0,0,.35); }
.auth-brand { margin-bottom: 70px; color: var(--navy-950); }
.auth-card h2 { margin: 0 0 8px; font-size: 28px; letter-spacing: -.03em; }
.form-stack { display: grid; gap: 17px; margin-top: 30px; }
.security-note { display: block; margin-top: 22px; color: #8994a9; line-height: 1.6; }

@media (max-width: 1120px) {
    .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .work-queues { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .card-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 820px) {
    .sidebar { transform: translateX(-105%); transition: transform .22s ease; }
    .sidebar.open { transform: translateX(0); }
    .sidebar-close { position: absolute; top: 24px; right: 16px; z-index: 1; display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid rgba(255,255,255,.16); border-radius: 6px; color: #fff; background: rgba(255,255,255,.08); font-size: 24px; line-height: 1; }
    .workspace { margin-left: 0; }
    .mobile-menu { display: inline-grid; }
    .topbar { padding: 0 18px; }
    .main-content { padding: 22px 16px; }
    .content-grid, .content-grid.two-thirds, .auth-shell { grid-template-columns: 1fr; }
    .auth-context { display: none; }
    .auth-card { min-height: 100vh; padding: 34px 24px; }
    .auth-brand { margin-bottom: 48px; }
}
@media (max-width: 600px) {
    .page-heading { align-items: flex-start; flex-direction: column; }
    .metric-grid, .work-queues, .card-grid, .form-grid, .detail-list, .choice-grid, .project-summary { grid-template-columns: 1fr; }
    .project-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .span-2 { grid-column: auto; }
    .metric { min-height: 120px; }
    .calendar-grid, .calendar-grid.calendar-month, .calendar-grid.calendar-week, .calendar-weekdays { grid-template-columns: repeat(7, minmax(0,1fr)); }
    .calendar-day { padding: 5px; }
    .calendar-day-head { align-items: flex-start; flex-direction: column; gap: 0; }
    .calendar-toolbar { align-items: flex-start; }
    .calendar-period { order: -1; width: 100%; }
    .agenda-item { grid-template-columns: 1fr; gap: 5px; }
    .calendar-filter { width: 100%; align-items: stretch; }
    .calendar-filter label { flex: 1 1 140px; min-width: 0; }
    .calendar-task-row { grid-template-columns: 1fr; gap: 6px; }
    .calendar-task-meta { justify-content: flex-start; }
    .topbar .breadcrumb { display: none; }
    .toast-region { top: 78px; right: 16px; left: 16px; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
