:root {
    --primary: #2357d8;
    --primary-deep: #163a8f;
    --primary-soft: #eff4ff;
    --success: #0f9f6e;
    --danger: #c63d53;
    --warning: #d48a13;
    --info: #2f80ed;
    --text: #132238;
    --text-soft: #5f6f86;
    --bg: #f3f6fb;
    --surface: #ffffff;
    --surface-soft: #f8fbff;
    --border: #dbe4f1;
    --border-strong: #c7d5ea;
    --shadow: 0 20px 40px rgba(18, 41, 76, 0.08);
    --shadow-soft: 0 12px 28px rgba(20, 42, 87, 0.06);
    --radius: 20px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top right, rgba(35, 87, 216, 0.08), transparent 26%),
        radial-gradient(circle at top left, rgba(15, 159, 110, 0.06), transparent 20%),
        var(--bg);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: none; }
.container { width: min(1280px, calc(100% - 32px)); margin: 0 auto; }
main { padding: 26px 0 44px; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    padding: 18px 0;
    backdrop-filter: blur(14px);
    background: rgba(248, 251, 255, 0.84);
    border-bottom: 1px solid rgba(199, 213, 234, 0.8);
}
.topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
}
.brand-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}
.brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: linear-gradient(145deg, var(--primary-deep), var(--primary));
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
    box-shadow: 0 16px 32px rgba(35, 87, 216, 0.22);
}
.brand h1 { margin: 0; font-size: 1.2rem; color: var(--text); }
.brand small { color: var(--text-soft); display: block; margin-top: 4px; }
.user-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(35, 87, 216, 0.08);
    color: var(--primary-deep);
    font-size: 0.84rem;
    font-weight: 700;
}
.nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.nav a {
    color: var(--text);
    padding: 11px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid transparent;
    font-weight: 600;
    transition: 0.2s ease;
}
.nav a:hover {
    background: #fff;
    border-color: rgba(35, 87, 216, 0.14);
    box-shadow: var(--shadow-soft);
    transform: translateY(-1px);
}
.nav a.nav-primary {
    background: linear-gradient(135deg, var(--primary-deep), var(--primary));
    color: #fff;
    box-shadow: 0 12px 24px rgba(35, 87, 216, 0.18);
}

.card,
.soft-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-soft);
}
.soft-card { background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,251,255,0.98)); }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.section-title,
.block-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}
.section-title h2,
.block-header h3,
.page-hero h2,
.dashboard-hero h2 { margin: 0; }
.muted { color: var(--text-soft); }
.hero,
.dashboard-hero,
.page-hero {
    position: relative;
    overflow: hidden;
    padding: 30px;
    border-radius: 28px;
    background: linear-gradient(135deg, #13294b 0%, #1f53c5 55%, #4a87ff 100%);
    color: #fff;
    box-shadow: 0 26px 54px rgba(19, 41, 75, 0.22);
}
.page-hero::before,
.dashboard-hero::before {
    content: '';
    position: absolute;
    width: 220px;
    height: 220px;
    right: -60px;
    top: -70px;
    border-radius: 50%;
    background: rgba(255,255,255,0.09);
}
.page-hero::after,
.dashboard-hero::after {
    content: '';
    position: absolute;
    width: 180px;
    height: 180px;
    left: -50px;
    bottom: -90px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
}
.page-hero > *,
.dashboard-hero > * { position: relative; z-index: 1; }
.dashboard-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 22px; }
.dashboard-hero h2,
.page-hero h2 { font-size: clamp(1.75rem, 2vw + 1rem, 2.35rem); line-height: 1.18; max-width: 760px; }
.dashboard-hero p,
.page-hero p { margin: 10px 0 0; max-width: 760px; color: rgba(255,255,255,0.9); line-height: 1.7; }
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.14);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-mini-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 22px;
}
.hero-mini-card {
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.14);
}
.hero-mini-card strong { display: block; font-size: 1.3rem; margin-bottom: 4px; }
.hero-mini-card span { color: rgba(255,255,255,0.84); font-size: 0.9rem; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    padding: 11px 16px;
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
    text-decoration: none;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, var(--primary-deep), var(--primary)); color: #fff; box-shadow: 0 12px 24px rgba(35,87,216,0.18); }
.btn-success { background: linear-gradient(135deg, #0d7f59, var(--success)); color: #fff; }
.btn-secondary { background: #edf3ff; color: var(--primary-deep); border: 1px solid #d8e4ff; }
.btn-danger { background: linear-gradient(135deg, #a52d43, var(--danger)); color: #fff; }
.btn-warning { background: #fff0d7; color: #7a4a05; border: 1px solid #f4d7a1; }
.btn-light { background: rgba(255,255,255,0.95); color: var(--text); }
.btn-sm { padding: 9px 12px; border-radius: 12px; font-size: 0.9rem; }
.btn + .btn { margin-left: 8px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

.flash-list { display: grid; gap: 12px; margin-bottom: 18px; }
.flash { padding: 14px 16px; border-radius: 14px; border: 1px solid transparent; }
.flash-success { background: #ddf6ea; color: #146145; border-color: #b7ebd1; }
.flash-error { background: #fde6ea; color: #922c42; border-color: #f5c0ca; }

label { display: block; margin-bottom: 7px; font-weight: 700; color: var(--text); }
form .field { margin-bottom: 16px; }
.inline-check { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.inline-check input { width: auto; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="datetime-local"], select, textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    font-size: 0.98rem;
    background: #fff;
    color: var(--text);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #7fa6ff;
    box-shadow: 0 0 0 4px rgba(35,87,216,0.1);
}
textarea { min-height: 120px; resize: vertical; }
input[type="file"] { width: 100%; padding: 8px 0; }

.stat,
.metric-card,
.kpi-card {
    position: relative;
    overflow: hidden;
    background: rgba(255,255,255,0.98);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 20px;
    box-shadow: var(--shadow-soft);
}
.stat::before,
.metric-card::before,
.kpi-card::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: var(--primary);
}
.stat .num,
.metric-card .metric-value,
.kpi-card strong {
    display: block;
    font-size: 1.95rem;
    font-weight: 800;
    color: var(--text);
    margin: 10px 0 6px;
}
.stat .label,
.metric-label,
.kpi-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 800;
    color: #475569;
}
.metric-caption,
.kpi-card small,
.stat small { color: var(--text-soft); line-height: 1.55; display: block; }
.dashboard-kpis,
.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}
.accent-blue::before { background: #2357d8; }
.accent-indigo::before { background: #5b4bdb; }
.accent-amber::before { background: #d48a13; }
.accent-green::before { background: #0f9f6e; }
.accent-cyan::before { background: #0ea5a8; }
.accent-red::before { background: #c63d53; }
.accent-violet::before { background: #7c3aed; }
.accent-slate::before { background: #475569; }

.dashboard-main-grid,
.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr);
    gap: 22px;
}
.dashboard-side-stack { display: grid; gap: 18px; }
.stack-list { display: grid; gap: 10px; }
.stack-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 16px;
    background: var(--surface-soft);
    border: 1px solid #e5edf7;
}
.stack-row strong { color: var(--text); }
.status-chip-wrap { display: flex; flex-wrap: wrap; gap: 10px; }
.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 16px;
    background: var(--surface-soft);
    border: 1px solid #e6edf8;
}
.mini-notes { display: grid; gap: 10px; }
.mini-notes div {
    padding: 14px 15px;
    border-radius: 16px;
    background: linear-gradient(180deg, #f9fbff, #f3f7ff);
    border: 1px solid #e2eaf7;
    line-height: 1.55;
}
.priority-list,
.item-list,
.timeline-list,
.quick-list {
    display: grid;
    gap: 14px;
}
.priority-item,
.list-item,
.timeline-item,
.quick-item {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    border: 1px solid #e0e8f4;
}
.priority-main,
.list-main,
.timeline-main,
.quick-main { min-width: 0; }
.priority-main strong,
.list-main strong,
.timeline-main strong,
.quick-main strong { font-size: 1rem; color: var(--text); }
.priority-meta,
.list-meta,
.timeline-meta,
.quick-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
    color: var(--text-soft);
    font-size: 0.92rem;
}
.priority-side,
.list-side,
.timeline-side,
.quick-side {
    min-width: 140px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}
.priority-score,
.info-chip,
.risk-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: #edf3ff;
    color: var(--primary-deep);
    font-size: 0.84rem;
    font-weight: 800;
}
.risk-chip.risk-high { background: #fde6ea; color: #9f2f45; }
.risk-chip.risk-medium { background: #fff1da; color: #8a5b07; }
.risk-chip.risk-low { background: #def5ea; color: #0f7b57; }

.dashboard-split,
.analytics-split {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.95fr);
    gap: 22px;
    margin-bottom: 22px;
}
.analytics-mini-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}
.insight-card {
    padding: 18px;
    border-radius: 18px;
    border: 1px solid #e2eaf6;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
}
.insight-card strong { display: block; font-size: 1.15rem; margin-bottom: 8px; }
.insight-card p { margin: 0; color: var(--text-soft); line-height: 1.6; }
.notice-card {
    padding: 16px 18px;
    border-radius: 18px;
    background: linear-gradient(180deg, #fff7e6, #fffdf7);
    border: 1px solid #f0dbab;
    color: #724d06;
}
.notice-card.notice-danger {
    background: linear-gradient(180deg, #fff0f2, #fff9fa);
    border-color: #f2c4ce;
    color: #8d2840;
}
.notice-card.notice-success {
    background: linear-gradient(180deg, #e9fff4, #f8fffb);
    border-color: #bfe8d2;
    color: #116847;
}
.notice-card h4 { margin: 0 0 8px; }
.notice-card p { margin: 0; line-height: 1.6; }
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.badge-submitted, .badge-under_review { background: #fff3d8; color: #8d5d06; }
.badge-reviewed, .badge-ready, .badge-completed { background: #dff7eb; color: #126947; }
.badge-revision_requested, .badge-rejected, .badge-overdue { background: #fde7ec; color: #9d2f47; }
.badge-approved, .badge-scheduled, .badge-open { background: #e4eefc; color: #1f4cb8; }
.badge-published, .badge-finalized { background: #ebe5ff; color: #5a39c7; }
.badge-draft, .badge-pending { background: #eef2f7; color: #526173; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; background: transparent; }
th, td {
    padding: 15px 14px;
    border-bottom: 1px solid #e5ebf4;
    vertical-align: top;
    color: var(--text);
}
thead th {
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f7faff;
    font-size: 0.84rem;
    color: #4f6075;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
tbody tr { background: rgba(255,255,255,0.92); }
tbody tr:hover { background: #f9fbff; }
.enhanced-table table tbody tr td:first-child,
.modern-table table tbody tr td:first-child { border-left: 1px solid transparent; }
.table-card { padding: 0; overflow: hidden; }
.table-card .block-header { padding: 22px 24px 0; }
.table-card .table-wrap { padding: 0 12px 12px; }
.table-title-cell strong { display: block; font-size: 1rem; }
.table-title-cell .muted { margin-top: 5px; }

.comment-box,
.info-box {
    padding: 16px;
    border-left: 4px solid var(--primary);
    background: #f8fbff;
    border-radius: 16px;
    margin-bottom: 12px;
}
.meeting-link { margin-top: 8px; display: inline-flex; font-weight: 700; }
.progress {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: #e7edf7;
    overflow: hidden;
}
.progress span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #2c6cff, #1bbd89);
    border-radius: 999px;
}
.progress-label { margin-top: 8px; color: var(--text-soft); font-size: 0.88rem; font-weight: 700; }
.code-note { background: #111827; color: #f3f4f6; padding: 14px; border-radius: 12px; overflow: auto; }
hr.soft { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
.rendered-content {
    padding: 14px;
    border-radius: 14px;
    background: #fcfdff;
    border: 1px solid var(--border);
}
.rendered-content p:first-child,
.rendered-content h1:first-child,
.rendered-content h2:first-child,
.rendered-content h3:first-child,
.rendered-content blockquote:first-child { margin-top: 0; }
.rendered-content blockquote {
    border-left: 4px solid var(--primary);
    margin: 12px 0;
    padding: 6px 0 6px 14px;
    color: #344054;
    background: #f8fbff;
}
code { background: #eef3ff; padding: 2px 6px; border-radius: 8px; }
.editor-shell {
    border: 1px solid #cdd7e7;
    border-radius: 14px;
    overflow: hidden;
    background: white;
}
.editor-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px;
    border-bottom: 1px solid var(--border);
    background: #f8fbff;
}
.editor-toolbar button {
    border: 1px solid var(--border);
    background: white;
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;
}
.rich-editor {
    min-height: 320px;
    padding: 16px;
    outline: none;
    line-height: 1.6;
}
.editor-embed {
    width: 100%;
    min-height: 760px;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

@media (max-width: 1024px) {
    .dashboard-main-grid,
    .dashboard-grid,
    .dashboard-split,
    .analytics-split {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .topbar-inner,
    .dashboard-hero,
    .section-title,
    .block-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .nav { justify-content: flex-start; }
    .hero-actions,
    .actions { width: 100%; }
    .priority-item,
    .list-item,
    .timeline-item,
    .quick-item {
        flex-direction: column;
    }
    .priority-side,
    .list-side,
    .timeline-side,
    .quick-side {
        min-width: 0;
        align-items: flex-start;
    }
}

@media (max-width: 700px) {
    main { padding-top: 20px; }
    .container { width: min(100%, calc(100% - 22px)); }
    .btn + .btn { margin-left: 0; }
    .dashboard-kpis,
    .metric-grid,
    .hero-mini-grid,
    .analytics-mini-grid { grid-template-columns: 1fr; }
    .card,
    .soft-card,
    .page-hero,
    .dashboard-hero { padding: 20px; }
    th, td { padding: 12px 10px; }
}


/* 2026-04-21 reliability patch: ensure dashboard cards render even when browser cache is stale */
.dashboard-kpis > *,
.metric-grid > * { min-width: 0; }
.kpi-card,
.metric-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 168px;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}
.kpi-card strong,
.metric-card .metric-value {
    font-size: 2.15rem;
    line-height: 1;
}
.kpi-card small,
.metric-caption {
    margin-top: auto;
    padding-top: 10px;
}
.dashboard-hero,
.page-hero {
    min-height: 220px;
}
@media (max-width: 900px) {
    .dashboard-main-grid,
    .dashboard-grid,
    .dashboard-split,
    .analytics-split {
        grid-template-columns: 1fr;
    }
}
