body {
    background: #f3f6fc;
}

.workspace-theme {
    --workspace-accent: #1d4ed8;
    --workspace-accent-soft: #eff6ff;
    --workspace-sidebar: #334155;
    --workspace-focus-rgb: 29 78 216;
    --workspace-select-rgb: 29 78 216;
}

.workspace-shell {
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
}

.workspace-shell .grid > * {
    min-width: 0;
}

.workspace-card {
    background: #ffffff;
    border: 1px solid #e6edf6;
    border-radius: 20px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
    min-width: 0;
    overflow: hidden;
}

.workspace-head {
    background: transparent;
    border: none;
    box-shadow: none;
    color: #0b2a44;
    position: relative;
    overflow: hidden;
    min-height: 0;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #0f172a;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.toolbar-input:focus {
    outline: none;
    border-color: rgb(var(--workspace-focus-rgb, 14 165 233) / 0.45);
    box-shadow: 0 0 0 4px rgb(var(--workspace-focus-rgb, 14 165 233) / 0.12);
}

.table-shell {
    overflow: hidden;
    border-radius: 1.5rem;
    border: 1px solid #e2e8f0;
    background: white;
    min-width: 0;
}

.table-shell table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.table-shell th {
    background: #f8fafc;
    color: #334155;
    font-size: 0.82rem;
    font-weight: 800;
    text-align: left;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.table-shell td {
    padding: 0.95rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.92rem;
    color: #334155;
    vertical-align: top;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.proposal-row {
    cursor: pointer;
}

.select-card.is-active {
    border-color: rgb(var(--workspace-select-rgb, 14 165 233) / 0.55);
    box-shadow: 0 16px 32px rgb(var(--workspace-select-rgb, 14 165 233) / 0.12);
}

.proposal-row.is-active {
    background: #f8fafc;
}

.proposal-row:hover {
    background: #f8fafc;
}

.metric-box {
    border: 1px solid #e2e8f0;
    border-radius: 1.25rem;
    background: #f8fafc;
    padding: 1rem 1.1rem;
    min-width: 0;
}

.workspace-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    background: var(--workspace-accent-soft, #f0f9ff);
    color: var(--workspace-accent, #0369a1);
    font-size: 0.78rem;
    font-weight: 700;
}

.workspace-head .workspace-label {
    background: rgba(255, 255, 255, 0.12);
    color: #dbeafe;
}

.workspace-head h1,
.workspace-head .text-slate-900 {
    color: #0b2a44 !important;
}

.workspace-head .text-slate-500 {
    color: #64748b !important;
}

.sidebar-title {
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    color: var(--workspace-sidebar, #075985);
}

.workspace-empty {
    border: 1px dashed #cbd5e1;
    border-radius: 1rem;
    padding: 2.5rem 1.25rem;
    text-align: center;
    font-size: 0.875rem;
    background: #fff;
    min-width: 0;
}

.oa-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 0;
    max-width: 100%;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

.oa-shell.is-sidebar-collapsed {
    grid-template-columns: 68px minmax(0, 1fr);
}

.oa-sidebar {
    display: flex;
    flex-direction: column;
    background: #0b2a44;
    color: #e0edf9;
    border-radius: 0;
    box-shadow: 2px 0 12px rgba(0,0,0,0.06);
    padding: 1.2rem 0.8rem;
    position: sticky;
    top: 0;
    align-self: start;
    min-height: 100vh;
}

.oa-shell.is-sidebar-collapsed .oa-sidebar {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.oa-shell.is-sidebar-collapsed .oa-brand-subtitle,
.oa-shell.is-sidebar-collapsed .oa-nav-link span,
.oa-shell.is-sidebar-collapsed .oa-sidebar-note,
.oa-shell.is-sidebar-collapsed .oa-sidebar-toggle span {
    display: none;
}

.oa-shell.is-sidebar-collapsed .oa-brand {
    padding-bottom: 0.75rem;
}

.oa-shell.is-sidebar-collapsed .oa-nav-link {
    justify-content: center;
    padding-left: 0.7rem;
    padding-right: 0.7rem;
}

.oa-shell.is-sidebar-collapsed .oa-nav-link i {
    margin: 0;
}

.oa-brand {
    padding: 0.8rem 1rem 1.2rem;
    border-bottom: 1px solid #1e4a6e;
}

.oa-brand-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #ffffff;
}

.oa-brand-subtitle {
    margin-top: 0.45rem;
    font-size: 0.72rem;
    line-height: 1.55;
    color: rgba(226, 232, 240, 0.7);
}

.oa-nav {
    margin-top: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.oa-sidebar-toggle {
    width: 100%;
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.72rem 0.8rem;
    border-radius: 0.9rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    font-size: 0.8rem;
    font-weight: 700;
}

.oa-sidebar-toggle:hover {
    background: rgba(59, 130, 246, 0.18);
    color: #ffffff;
}

.oa-sidebar-toggle i {
    color: #93c5fd;
}

.oa-nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    color: #bfd6ec;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: 0.15s;
    margin-bottom: 6px;
}

.oa-nav-link:hover {
    background: #1a3e5c;
    color: #e5f0ff;
}

.oa-nav-link.is-active {
    background: #1e4a7a;
    color: #ffffff;
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.oa-nav-link i {
    width: 24px;
    text-align: center;
    font-size: 1.3rem;
}

.oa-sidebar-note {
    margin-top: 0.8rem;
    padding: 0.78rem 0.82rem;
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.16);
    font-size: 0.7rem;
    line-height: 1.6;
    color: rgba(226, 232, 240, 0.78);
}

.oa-main {
    min-width: 0;
}

.oa-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.4rem;
    padding: 0 0.25rem;
}

.oa-crumb {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #475569;
    font-size: 0.76rem;
    font-weight: 700;
}

.oa-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.oa-action-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.58rem 0.78rem;
    border-radius: 999px;
    border: 1px solid rgba(203, 213, 225, 0.9);
    background: rgba(255, 255, 255, 0.88);
    color: #334155;
    font-size: 0.76rem;
    font-weight: 700;
}

.stage-distribution-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    text-decoration: none;
    border-radius: 1rem;
    padding: 0.62rem 0.78rem;
    border: 1px solid rgba(203, 213, 225, 0.78);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    min-height: 62px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.stage-distribution-card:hover {
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.10);
    transform: translateY(-1px);
}

.stage-distribution-card.is-active {
    border-color: rgba(37, 99, 235, 0.55);
    background: linear-gradient(180deg, #eff6ff 0%, #f8fbff 100%);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.12);
}

.stage-distribution-card .count {
    flex-shrink: 0;
    font-size: 1.42rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
}

.stage-distribution-card .label {
    margin-top: 0;
    font-size: 0.8rem;
    font-weight: 700;
    color: #475569;
    line-height: 1.2;
    white-space: nowrap;
}

.ledger-pagination-btn {
    min-width: 2.35rem;
    height: 2.1rem;
    border-radius: 0.85rem;
    border: 1px solid rgba(203, 213, 225, 0.95);
    background: #fff;
    color: #334155;
    font-size: 0.8rem;
    font-weight: 700;
}

.ledger-pagination-btn.is-active {
    background: #0f172a;
    border-color: #0f172a;
    color: #fff;
}

.ledger-pagination-btn.is-nav {
    min-width: auto;
    padding: 0 0.7rem;
}

.ledger-pagination-btn.is-disabled {
    color: #94a3b8;
    background: #f8fafc;
    cursor: default;
}

.ledger-year-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 4.25rem;
    height: 2rem;
    padding: 0 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(203, 213, 225, 0.95);
    background: #fff;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 700;
}

.ledger-year-chip:hover {
    border-color: rgba(59, 130, 246, 0.42);
    color: #1d4ed8;
    background: #eff6ff;
}

.ledger-year-chip.is-active {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
}

.card-fixed {
    min-height: 190px;
    max-height: 190px;
    display: flex;
    flex-direction: column;
}

.card-fixed-lg {
    min-height: 252px;
    max-height: 252px;
    display: flex;
    flex-direction: column;
}

.card-scroll-area {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}


.line-clamp-2,
.line-clamp-3,
.line-clamp-4 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 { -webkit-line-clamp: 2; line-clamp: 2; }
.line-clamp-3 { -webkit-line-clamp: 3; line-clamp: 3; }
.line-clamp-4 { -webkit-line-clamp: 4; line-clamp: 4; }

.compact-detail-card {
    border: 1px solid #dbe3ee;
    border-radius: 1.25rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    padding: 1rem 1.1rem;
}

.detail-page-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #2563eb;
    font-size: 0.82rem;
    font-weight: 800;
}

.page-is-detail-mode [data-overview-only] {
    display: none;
}

[data-detail-only] {
    display: none;
}

body:not(.page-is-detail-mode) [data-detail-only] {
    display: none !important;
}

.page-is-detail-mode [data-detail-only] {
    display: block;
}

.page-is-detail-mode .detail-focus-grid {
    grid-template-columns: minmax(0, 1.18fr) 420px;
}

body.page-is-embedded-mode {
    background: transparent;
}

.page-is-embedded-mode .oa-shell,
.page-is-embedded-mode .oa-main,
.page-is-embedded-mode .workspace-shell {
    max-width: 100%;
    width: 100%;
    padding: 0;
    margin: 0;
}

.page-is-embedded-mode .oa-sidebar,
.page-is-embedded-mode .oa-topbar,
.page-is-embedded-mode .workspace-head,
.page-is-embedded-mode [data-overview-only],
.page-is-embedded-mode .trace-mask {
    display: none !important;
}

.page-is-embedded-mode .detail-focus-grid {
    grid-template-columns: minmax(0, 1fr);
}

.page-is-embedded-mode .workspace-card {
    border-radius: 1.35rem;
    box-shadow: none;
}

.review-topbar {
    background: transparent;
    padding: 0;
    align-items: flex-start;
}

.workspace-page-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    max-width: 1360px;
    margin: 0 auto;
    padding: 0.35rem 0.35rem 0.4rem;
    align-items: start;
}

.workspace-page-title {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    flex-wrap: nowrap;
    white-space: nowrap;
    padding-left: 0.35rem;
    padding-top: 0.12rem;
}

.workspace-page-title .oa-crumb {
    flex-shrink: 0;
}

.workspace-page-title > div:first-child {
    white-space: nowrap;
}

.workspace-page-actions {
    justify-content: flex-end;
    padding-top: 0.05rem;
}

.page-title-block {
    min-width: 0;
}

.review-top-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    justify-content: flex-end;
}

.admin-search-bar {
    display: flex;
    align-items: center;
    gap: 0;
    background: #fff;
    border: 1px solid #dbe4ef;
    border-radius: 999px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}

.admin-search-input {
    min-width: 220px;
    border: 0;
    outline: none;
    background: transparent;
    padding: 0.72rem 0.88rem 0.72rem 1rem;
    font-size: 0.82rem;
    color: #1e293b;
}

.admin-search-btn {
    border: 0;
    background: #1e4a7a;
    color: #fff;
    padding: 0.72rem 0.95rem;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.list-section-card .table-shell {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
}

.list-section-card {
    overflow: hidden;
}

.ledger-table-head {
    overflow: hidden;
    border-bottom: 1px solid #dbe4ef;
    background: #f8fbff;
}

.ledger-table-body {
    overflow: auto;
    scrollbar-width: thin;
    max-height: 62vh;
}

.list-section-card .table-shell table,
.ledger-table-head table,
.ledger-table-body table {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
    border-collapse: separate;
    border-spacing: 0;
}

.list-section-card .ledger-table th {
    background: #f8fbff;
    color: #385e7e;
}

.ledger-table-head .ledger-table th {
    border-bottom: none;
}

.ledger-table-body .ledger-table td {
    background: #fff;
}

.list-section-card .ledger-table td {
    background: #fff;
    white-space: nowrap;
}

.list-section-card .ledger-table tr {
    height: 20px;
}

.list-section-card .ledger-table td .font-bold {
    line-height: 1rem;
}

.list-section-card .ledger-table td .text-xs,
.list-section-card .ledger-table td .text-\[11px\] {
    line-height: 0.85rem;
}

.queue-item {
    background: #fff;
    border: 1px solid #e8eef6;
    border-radius: 1rem;
    padding: 0.75rem;
}

.review-queues-panel .card-scroll-area {
    overflow-y: auto;
    overflow-x: hidden;
}

.review-queues-panel .queue-item {
    padding: 0.65rem;
}

.metric-box {
    background: #ffffff;
    border: 1px solid #e6edf6;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
    border-radius: 20px;
    padding: 22px 20px !important;
    min-height: auto;
    max-height: none;
}

.metric-box .text-sm {
    color: #54708f !important;
    font-weight: 500;
    font-size: 0.9rem !important;
    margin-bottom: 8px;
}

.metric-box .text-3xl {
    font-size: 2.5rem;
    font-weight: 700;
    color: #0b2a44 !important;
}

.workspace-card {
    border-radius: 20px !important;
}

.sidebar-title {
    font-size: 0.64rem;
}

.section-title {
    font-size: 1.55rem;
    line-height: 1.08;
}

.workspace-head .section-title {
    font-size: 1.95rem;
}

.oa-hero-meta {
    margin-top: 0.95rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.oa-hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.72rem;
    border-radius: 999px;
    background: #eef3fa;
    color: #1e4a7a;
    border: 1px solid #dce5ef;
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
}

.oa-panel-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}

@media (max-width: 1180px) {
    .oa-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .oa-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .workspace-page-head {
        grid-template-columns: minmax(0, 1fr);
    }

    .workspace-page-title {
        flex-wrap: wrap;
    }

    .oa-shell {
        padding: 1rem;
        gap: 1rem;
    }

    .oa-topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .review-top-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .admin-search-bar {
        width: 100%;
    }

    .admin-search-input {
        min-width: 0;
        width: 100%;
    }

    .section-title {
        font-size: 1.45rem;
    }
}
