:root {
    --app-font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
    --app-bg: #f4f7fb;
    --app-bg-soft: #fbfcff;
    --app-panel: rgba(255, 255, 255, 0.92);
    --app-panel-solid: #ffffff;
    --app-panel-border: rgba(17, 56, 109, 0.10);
    --app-text: #1b2f4a;
    --app-muted: #677991;
    --app-title: #11386d;
    --app-primary: #11386d;
    --app-primary-soft: #e8eef8;
    --app-accent: #e27d68;
    --app-success: #1aa36c;
    --app-danger: #d46b66;
    --app-shadow: 0 24px 56px rgba(17, 56, 109, 0.08);
}

html, body {
    margin: 0;
    min-height: 100%;
    font-family: var(--app-font-stack);
    background:
        radial-gradient(circle at 0% 0%, rgba(17, 56, 109, 0.08), transparent 28%),
        radial-gradient(circle at 100% 0%, rgba(85, 127, 191, 0.08), transparent 22%),
        linear-gradient(180deg, #f7f9fd 0%, var(--app-bg) 100%);
    color: var(--app-text);
}

a {
    color: inherit;
}

.app-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(244, 247, 251, 0.66);
    backdrop-filter: blur(10px);
}

.app-loading-card {
    width: min(420px, calc(100vw - 32px));
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    padding: 18px 20px;
    border-radius: 24px;
    border: 1px solid rgba(20, 37, 56, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 250, 255, 0.98) 100%);
    box-shadow: 0 24px 54px rgba(17, 56, 109, 0.12);
}

.app-loading-spinner {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    border: 3px solid rgba(17, 56, 109, 0.14);
    border-top-color: var(--app-primary);
    border-right-color: rgba(226, 125, 104, 0.72);
    animation: app-loading-spin 0.9s linear infinite;
}

.app-loading-copy {
    display: grid;
    gap: 4px;
}

.app-loading-kicker {
    color: var(--app-accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.app-loading-copy strong {
    color: var(--app-title);
    font-size: 1rem;
}

.app-loading-copy span:last-child {
    color: var(--app-muted);
    line-height: 1.45;
}

@keyframes app-loading-spin {
    to {
        transform: rotate(360deg);
    }
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 10% 12%, rgba(17, 56, 109, 0.10), transparent 30%),
        radial-gradient(circle at 88% 10%, rgba(92, 133, 196, 0.12), transparent 30%),
        linear-gradient(165deg, #f8fafe 0%, #eef3fa 100%);
}

.login-shell {
    width: min(1280px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(420px, 0.9fr);
    gap: 18px;
    align-items: stretch;
}

.login-shell-compact {
    width: min(560px, 100%);
    grid-template-columns: 1fr;
}

.login-hero {
    display: grid;
    align-content: start;
    gap: 16px;
    padding: 26px;
    border-radius: 32px;
    border: 1px solid rgba(20, 37, 56, 0.10);
    background:
        radial-gradient(circle at 0% 0%, rgba(93, 134, 197, 0.18), transparent 26%),
        linear-gradient(180deg, rgba(17, 56, 109, 0.98) 0%, rgba(13, 44, 85, 0.97) 100%);
    color: #f8fbff;
    box-shadow: 0 28px 58px rgba(13, 44, 85, 0.24);
}

.login-hero-title {
    margin: 0;
    font-size: clamp(34px, 3.6vw, 56px);
    line-height: 1;
    letter-spacing: -0.04em;
}

.login-hero-copy {
    margin: 0;
    max-width: 640px;
    color: rgba(248, 251, 255, 0.82);
    font-size: 15px;
    line-height: 1.6;
}

.login-feature-list {
    display: grid;
    gap: 12px;
    margin-top: 8px;
}

.login-feature-card {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 14px;
    border-radius: 20px;
    border: 1px solid rgba(248, 251, 255, 0.10);
    background: rgba(255, 255, 255, 0.06);
}

.login-feature-card .mud-icon-root {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(232, 238, 248, 0.18);
    color: #dce9fb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.login-feature-card strong {
    display: block;
    margin-bottom: 4px;
    color: #ffffff;
    font-size: 16px;
}

.login-feature-card span:last-child {
    color: rgba(232, 240, 251, 0.74);
    line-height: 1.55;
}

.login-card {
    width: 100%;
    border-radius: 32px;
    padding: 24px;
    border: 1px solid var(--app-panel-border);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--app-shadow);
    backdrop-filter: blur(10px);
    align-self: stretch;
}

.login-card-compact {
    align-self: center;
}

.login-card-header {
    display: grid;
    gap: 8px;
}

.login-title {
    margin: 0;
    color: var(--app-title);
    letter-spacing: -0.04em;
    line-height: 1.02;
}

.login-subtitle {
    margin: 8px 0 6px;
    color: var(--app-muted);
    line-height: 1.5;
}

.login-tabs {
    margin-top: 6px;
}

.login-tabs .mud-tabs-toolbar {
    padding: 4px;
    border-radius: 18px;
    background: rgba(223, 234, 246, 0.62);
}

.login-tabs .mud-tab {
    min-height: 46px;
    font-weight: 800;
}

.login-form-stack {
    display: grid;
    gap: 12px;
}

.login-password-section {
    display: grid;
    gap: 12px;
}

.login-password-rules {
    display: grid;
    gap: 10px;
    padding: 16px 18px;
    border-radius: 20px;
    border: 1px solid rgba(20, 37, 56, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(247, 250, 255, 0.88) 100%);
}

.login-password-rules-header {
    display: grid;
    gap: 4px;
}

.login-password-rules-header strong {
    color: var(--app-title);
    font-size: 15px;
}

.login-password-rules-header span {
    color: var(--app-muted);
    font-size: 13px;
    line-height: 1.5;
}

.login-password-rule {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
}

.login-password-rule .mud-icon-root {
    font-size: 18px;
}

.login-password-rule-ok {
    color: var(--app-success);
}

.login-password-rule-missing {
    color: var(--app-danger);
}

.login-step-copy {
    margin: 0;
    color: var(--app-muted);
}

.logout-progress {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
    color: var(--app-muted);
    font-weight: 700;
}

.page-stack {
    display: grid;
    gap: 16px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    padding: 16px 18px;
    border-radius: 26px;
    border: 1px solid var(--app-panel-border);
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 18px 42px rgba(17, 56, 109, 0.05);
}

.page-title {
    margin: 0;
    color: var(--app-title);
    font-size: clamp(28px, 3.2vw, 40px);
    letter-spacing: -0.03em;
    line-height: 1.04;
}

.page-subtitle {
    margin: 6px 0 0;
    color: var(--app-muted);
    max-width: 780px;
    font-size: 15px;
    line-height: 1.45;
}

.page-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.page-action-btn {
    min-width: 160px;
}

.surface-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.surface-header-copy {
    display: grid;
    gap: 6px;
}

.surface-eyebrow {
    color: #6f84a4;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.surface-meta {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(20, 37, 56, 0.08);
    background: rgba(232, 238, 248, 0.88);
    color: var(--app-primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.meta-chip-soft {
    background: rgba(255, 255, 255, 0.90);
    color: var(--app-muted);
}

.meta-chip-warm {
    background: rgba(255, 235, 231, 0.92);
    color: #c96b58;
}

.project-workspace-shell {
    gap: 18px;
}

.project-program-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.project-program-card {
    display: grid;
    gap: 8px;
    padding: 16px;
    border-radius: 20px;
    border: 1px solid var(--app-panel-border);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 250, 255, 0.90) 100%);
}

.project-program-card strong {
    color: var(--app-title);
    font-size: 16px;
    letter-spacing: -0.02em;
}

.project-program-card p {
    margin: 0;
    color: var(--app-muted);
    line-height: 1.6;
}

.project-program-card-warm {
    background: linear-gradient(180deg, rgba(255, 242, 238, 0.96) 0%, rgba(255, 255, 255, 0.94) 100%);
    border-color: rgba(226, 125, 104, 0.18);
}

.toolbar-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.toolbar-inline .mud-input-control {
    flex: 1 1 280px;
}

.toolbar-inline .mud-button-root,
.toolbar-inline .meta-chip {
    flex: 0 0 auto;
}

.inline-loading {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--app-muted);
}

.empty-state-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 18px;
    border-radius: 24px;
    border: 1px dashed rgba(17, 56, 109, 0.20);
    background: linear-gradient(180deg, rgba(232, 238, 248, 0.58) 0%, rgba(255, 255, 255, 0.92) 100%);
}

.empty-state-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: var(--app-primary-soft);
    color: var(--app-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.empty-state-icon .mud-icon-root {
    font-size: 28px;
}

.empty-state-title {
    margin: 0 0 6px;
    color: var(--app-title);
    font-size: 21px;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.empty-state-copy {
    margin: 0;
    color: var(--app-muted);
    line-height: 1.55;
}

.empty-state-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.filter-row {
    display: grid;
    grid-template-columns: 1fr 220px 220px;
    gap: 8px;
    margin: 0 0 16px;
    padding: 14px;
    border-radius: 22px;
    border: 1px solid var(--app-panel-border);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 14px 32px rgba(17, 56, 109, 0.04);
}

.dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) auto;
    gap: 16px;
    align-items: end;
    margin-bottom: 18px;
    padding: 22px;
    border-radius: 32px;
    border: 1px solid var(--app-panel-border);
    background:
        radial-gradient(circle at 100% 0%, rgba(92, 133, 196, 0.14), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(247, 250, 255, 0.94) 100%);
    box-shadow: var(--app-shadow);
}

.dashboard-hero-copy {
    display: grid;
    gap: 10px;
    max-width: 860px;
}

.dashboard-kicker {
    color: #6f84a4;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.dashboard-title {
    margin: 0;
    color: var(--app-title);
    font-size: clamp(30px, 3.5vw, 50px);
    line-height: 1.04;
    letter-spacing: -0.04em;
}

.dashboard-subtitle {
    margin: 0;
    color: var(--app-muted);
    max-width: 720px;
    font-size: 15px;
    line-height: 1.5;
}

.dashboard-hero-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.dashboard-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.dashboard-metric-card {
    display: grid;
    gap: 16px;
    padding: 18px;
    border-radius: 24px;
    border: 1px solid var(--app-panel-border);
    background: rgba(255, 253, 249, 0.86);
    box-shadow: 0 16px 36px rgba(20, 37, 56, 0.05);
}

.dashboard-metric-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    color: #7b8da1;
    font-size: 13px;
    font-weight: 700;
}

.dashboard-metric-head .mud-icon-root {
    color: var(--app-primary);
    font-size: 20px;
}

.dashboard-metric-card strong {
    color: var(--app-title);
    font-size: clamp(24px, 2.4vw, 34px);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.dashboard-metric-card p {
    margin: 0;
    color: var(--app-muted);
    line-height: 1.5;
}

.dashboard-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.8fr);
    gap: 14px;
}

.dashboard-panel {
    display: grid;
    gap: 16px;
    padding: 20px;
    border-radius: 28px;
    border: 1px solid var(--app-panel-border);
    background: rgba(255, 253, 249, 0.86);
    box-shadow: 0 18px 40px rgba(20, 37, 56, 0.06);
}

.dashboard-panel-wide {
    align-content: start;
}

.dashboard-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.dashboard-panel-header h2 {
    margin: 3px 0 0;
    color: var(--app-title);
    font-size: 24px;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.dashboard-panel-kicker {
    color: #6f84a4;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.dashboard-loading {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--app-muted);
}

.dashboard-empty-state {
    display: grid;
    gap: 14px;
    justify-items: start;
    padding: 18px;
    border-radius: 22px;
    border: 1px dashed rgba(17, 56, 109, 0.22);
    background: linear-gradient(180deg, rgba(232, 238, 248, 0.58) 0%, rgba(255, 255, 255, 0.90) 100%);
}

.dashboard-empty-icon {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: var(--app-primary-soft);
    color: var(--app-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dashboard-empty-icon .mud-icon-root {
    font-size: 28px;
}

.dashboard-empty-state h3 {
    margin: 0 0 6px;
    color: var(--app-title);
    font-size: 21px;
}

.dashboard-empty-state p {
    margin: 0;
    color: var(--app-muted);
    max-width: 560px;
}

.dashboard-project-list {
    display: grid;
    gap: 12px;
}

.dashboard-project-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 16px;
    border-radius: 22px;
    border: 1px solid rgba(20, 37, 56, 0.08);
    background: rgba(255, 255, 255, 0.58);
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.dashboard-project-card:hover {
    transform: translateY(-2px);
    border-color: rgba(28, 79, 122, 0.18);
    box-shadow: 0 14px 30px rgba(20, 37, 56, 0.08);
}

.dashboard-project-main {
    display: grid;
    gap: 8px;
}

.dashboard-project-topline {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.dashboard-project-main h3 {
    margin: 0;
    color: var(--app-title);
    font-size: 26px;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.dashboard-project-main p {
    margin: 0;
    color: var(--app-muted);
    line-height: 1.5;
}

.dashboard-project-side {
    display: grid;
    gap: 6px;
    justify-items: end;
    text-align: right;
}

.dashboard-project-side strong {
    color: var(--app-title);
    font-size: 22px;
    letter-spacing: -0.03em;
}

.dashboard-project-side span,
.dashboard-project-date {
    color: #7b8da1;
    font-size: 13px;
    font-weight: 700;
}

.dashboard-action-list {
    display: grid;
    gap: 10px;
}

.dashboard-action-card {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(20, 37, 56, 0.08);
    background: rgba(255, 255, 255, 0.58);
    text-decoration: none;
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.dashboard-action-card:hover {
    transform: translateY(-2px);
    border-color: rgba(28, 79, 122, 0.18);
    box-shadow: 0 12px 26px rgba(20, 37, 56, 0.07);
}

.dashboard-action-card .mud-icon-root {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: var(--app-primary-soft);
    color: var(--app-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.dashboard-action-card strong {
    display: block;
    color: var(--app-title);
    font-size: 16px;
    margin-bottom: 4px;
}

.dashboard-action-card span:last-child {
    color: var(--app-muted);
    line-height: 1.45;
    font-size: 14px;
}

.dashboard-insight-card {
    display: grid;
    gap: 14px;
    padding: 18px;
    border-radius: 22px;
    border: 1px solid rgba(179, 112, 55, 0.16);
    background: linear-gradient(180deg, rgba(255, 248, 239, 0.94) 0%, rgba(255, 253, 249, 0.90) 100%);
}

.dashboard-insight-card h3 {
    margin: 0;
    color: var(--app-title);
    font-size: 24px;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.dashboard-insight-card p {
    margin: 0;
    color: var(--app-muted);
    line-height: 1.55;
}

.dashboard-insight-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.dashboard-insight-metrics div {
    display: grid;
    gap: 6px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(20, 37, 56, 0.06);
}

.dashboard-insight-metrics span {
    color: #7b8da1;
    font-size: 12px;
    font-weight: 700;
}

.dashboard-insight-metrics strong {
    color: var(--app-title);
    font-size: 18px;
    letter-spacing: -0.03em;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 14px 0;
}

.stat-card {
    border: 1px solid var(--app-panel-border);
    border-radius: 20px;
    background: rgba(255, 253, 249, 0.78);
    padding: 16px 18px;
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 12px;
    align-items: center;
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--app-primary-soft);
    color: var(--app-primary);
}

.stat-copy {
    display: grid;
    gap: 4px;
}

.stat-copy span {
    font-size: 13px;
    color: #7a8a9d;
    font-weight: 700;
}

.stat-copy strong {
    color: var(--app-title);
    font-size: clamp(24px, 3vw, 32px);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.kpi-green {
    color: var(--app-success) !important;
}

.kpi-red {
    color: var(--app-danger) !important;
}

.kpi-olive {
    color: #788651 !important;
}

.surface-card {
    border: 1px solid var(--app-panel-border);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.86);
    padding: 18px;
    box-shadow: 0 14px 32px rgba(17, 56, 109, 0.05);
}

.surface-title {
    font-size: clamp(20px, 1.8vw, 26px);
    color: var(--app-title);
    margin-bottom: 10px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.project-list {
    display: grid;
    gap: 12px;
}

.project-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    border: 1px solid rgba(20, 37, 56, 0.08);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.62);
    padding: 16px;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.project-row:hover {
    transform: translateY(-1px);
    border-color: rgba(28, 79, 122, 0.18);
    box-shadow: 0 12px 26px rgba(20, 37, 56, 0.06);
}

.project-row h3 {
    margin: 0 0 4px;
    color: var(--app-title);
    font-size: clamp(18px, 1.8vw, 22px);
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.project-row p {
    margin: 0;
    color: var(--app-muted);
    line-height: 1.5;
}

.project-row-main {
    display: grid;
    gap: 4px;
    min-width: 0;
    cursor: pointer;
}

.project-row-right {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.project-date {
    color: #7b8da1;
    font-weight: 600;
}

.small-filter {
    min-width: 180px;
}

.scenario-toolbar {
    display: grid;
    gap: 14px;
}

.scenario-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.scenario-actions {
    display: inline-flex;
    gap: 10px;
    margin-top: 10px;
}

.glossary-shell {
    display: grid;
    gap: 16px;
}

.glossary-title {
    margin: 0;
    color: var(--app-title);
    font-size: clamp(26px, 2.6vw, 34px);
    letter-spacing: -0.03em;
}

.glossary-subtitle {
    margin: 8px 0 0;
    color: #667d9c;
    max-width: 1200px;
    font-size: 15px;
}

.glossary-typography {
    display: grid;
    gap: 10px;
}

.glossary-typography-title {
    color: var(--app-title);
    font-size: 22px;
    font-weight: 800;
}

.glossary-typography-subtitle {
    margin: 0;
    color: #667d9c;
}

.glossary-typography-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.glossary-typography-item {
    border: 1px solid var(--app-panel-border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.58);
    padding: 12px;
    display: grid;
    gap: 10px;
}

.glossary-typography-meta {
    display: grid;
    gap: 3px;
}

.glossary-typography-label {
    color: var(--app-title);
    font-weight: 800;
}

.glossary-typography-details {
    color: #667d9c;
    font-size: 14px;
}

.glossary-typography-selector {
    display: inline-block;
    width: fit-content;
    background: #e8eef8;
    color: #3d5c87;
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 13px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.type-sample-page-title {
    margin: 0;
    color: var(--app-title);
    font-size: 42px;
    font-weight: 700;
    line-height: 1.05;
}

.type-sample-glossary-title {
    margin: 0;
    color: var(--app-title);
    font-size: 32px;
    font-weight: 700;
    line-height: 1.1;
}

.type-sample-surface-title {
    margin: 0;
    color: var(--app-title);
    font-size: 30px;
    font-weight: 800;
    line-height: 1.1;
}

.type-sample-chapter-title {
    margin: 0;
    color: var(--app-title);
    font-size: 20px;
    font-weight: 800;
}

.type-sample-term-title {
    margin: 0;
    color: var(--app-title);
    font-size: 16px;
    font-weight: 800;
}

.type-sample-body {
    margin: 0;
    color: #587091;
    font-size: 14px;
    line-height: 1.55;
}

.type-sample-subtitle {
    margin: 0;
    color: #667d9c;
    font-size: 15px;
}

.glossary-accordion {
    display: grid;
    gap: 12px;
}

.glossary-accordion-panel {
    border: 1px solid var(--app-panel-border);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.88);
    overflow: hidden;
    box-shadow: 0 12px 28px rgba(17, 56, 109, 0.05);
}

.glossary-accordion-panel .mud-expand-panel-header {
    padding: 16px;
}

.glossary-accordion-panel .mud-expand-panel-content {
    padding: 0 16px 16px;
}

.glossary-accordion-panel .mud-expand-panel-text {
    color: var(--app-title);
    font-size: 20px;
    font-weight: 800;
}

.glossary-item-list {
    display: grid;
    gap: 18px;
}

.glossary-item {
    display: grid;
    gap: 6px;
}

.glossary-term {
    margin: 0;
    color: #11396f;
    font-size: 16px;
    font-weight: 800;
}

.glossary-description {
    margin: 0;
    color: #4f6b95;
    line-height: 1.55;
    font-size: 14px;
}

.settings-loading {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--app-muted);
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.settings-card {
    display: grid;
    gap: 12px;
}

.settings-card-title {
    color: var(--app-title);
    font-size: 26px;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.03em;
}

.settings-profile-hero {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 18px;
    border-radius: 24px;
    border: 1px solid rgba(20, 37, 56, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.84) 0%, rgba(247, 250, 255, 0.72) 100%);
}

.settings-avatar-preview {
    width: 110px;
    height: 110px;
    border-radius: 28px;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, rgba(223, 234, 246, 0.98) 0%, rgba(242, 209, 174, 0.88) 100%);
    color: var(--app-title);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.58);
}

.settings-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.settings-avatar-fallback {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.settings-profile-summary {
    display: grid;
    gap: 8px;
}

.settings-profile-summary .empty-copy {
    margin: 0;
}

.settings-profile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.settings-profile-actions {
    display: grid;
    gap: 10px;
    justify-items: start;
}

.settings-avatar-upload {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 14px;
    border: 1px solid rgba(20, 37, 56, 0.10);
    background: rgba(223, 234, 246, 0.74);
    color: var(--app-primary);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    overflow: hidden;
}

.settings-avatar-upload input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.settings-avatar-hint {
    max-width: 260px;
    color: var(--app-muted);
    font-size: 12px;
    line-height: 1.45;
}

.settings-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.settings-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.settings-kpi-grid div {
    border: 1px solid var(--app-panel-border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.62);
    padding: 12px;
    display: grid;
    gap: 4px;
}

.settings-kpi-grid span {
    color: #7a8a9d;
    font-size: 13px;
    font-weight: 700;
}

.settings-kpi-grid strong {
    color: var(--app-title);
    font-size: 18px;
}

.settings-feature-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.settings-subscription-banner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    border-radius: 20px;
    border: 1px solid rgba(20, 37, 56, 0.08);
}

.settings-subscription-banner-ok {
    background: linear-gradient(180deg, rgba(218, 245, 234, 0.72) 0%, rgba(255, 253, 249, 0.92) 100%);
    border-color: rgba(26, 122, 99, 0.18);
}

.settings-subscription-banner-warn {
    background: linear-gradient(180deg, rgba(255, 241, 219, 0.84) 0%, rgba(255, 253, 249, 0.94) 100%);
    border-color: rgba(179, 112, 55, 0.22);
}

.settings-subscription-banner-danger {
    background: linear-gradient(180deg, rgba(255, 232, 235, 0.86) 0%, rgba(255, 253, 249, 0.94) 100%);
    border-color: rgba(186, 74, 87, 0.20);
}

.settings-subscription-copy {
    display: grid;
    gap: 6px;
}

.settings-subscription-title {
    margin: 0;
    color: var(--app-title);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.settings-seat-copy {
    margin: 0;
    color: #5f6f82;
    font-size: 0.95rem;
}

.settings-subscription-badges {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.settings-plan-row {
    padding: 8px 0;
    border-bottom: 1px solid #e0e8f4;
}

.settings-plan-row:last-child {
    border-bottom: none;
}

.settings-plan-row p {
    margin: 4px 0 0;
    color: #5f7ca7;
}

.settings-plan-features {
    color: #4f6485;
    font-size: 0.92rem;
}

.settings-actions {
    display: inline-flex;
    gap: 10px;
    flex-wrap: wrap;
}

.settings-twofa-setup {
    display: grid;
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.settings-twofa-panel {
    display: grid;
    gap: 12px;
    padding: 18px;
    border-radius: 22px;
    border: 1px solid rgba(20, 37, 56, 0.08);
    background: rgba(255, 255, 255, 0.62);
}

.settings-twofa-fields {
    display: grid;
    gap: 12px;
}

.settings-qr-code {
    width: min(100%, 240px);
    padding: 14px;
    border-radius: 20px;
    border: 1px solid rgba(20, 37, 56, 0.08);
    background: #fffdf9;
    box-shadow: 0 12px 30px rgba(20, 37, 56, 0.05);
}

.settings-qr-code svg {
    display: block;
    width: 100%;
    height: auto;
}

.settings-twofa {
    margin-top: 12px;
}

.status-pill {
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    padding: 5px 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.status-pill-active {
    color: #0f6c58;
    background: #daf5ea;
}

.status-pill-draft {
    color: #3d5f91;
    background: #dfe9fb;
}

.status-pill-info {
    color: #335e91;
    background: #e4eefc;
}

.icon-btn {
    border: none;
    background: transparent;
    color: var(--app-primary);
    cursor: pointer;
    border-radius: 12px;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: var(--app-primary-soft);
}

.empty-copy {
    color: var(--app-muted);
}

#blazor-error-ui {
    background: #ffe5e5;
    bottom: 0;
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.7rem 1.2rem;
    position: fixed;
    width: 100%;
    z-index: 2000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.8rem;
    top: 0.55rem;
}

@media (max-width: 1400px) {
    .login-shell {
        grid-template-columns: 1fr;
    }

    .dashboard-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-content-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-row {
        grid-template-columns: 1fr 200px 200px;
    }

    .project-program-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .login-page {
        padding: 18px;
    }

    .login-hero,
    .login-card {
        padding: 22px;
    }

    .login-hero-title {
        font-size: 42px;
    }

    .dashboard-hero {
        grid-template-columns: 1fr;
        padding: 22px;
    }

    .dashboard-hero-actions {
        justify-content: flex-start;
    }

    .dashboard-metric-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-project-card {
        grid-template-columns: 1fr;
    }

    .dashboard-project-side {
        justify-items: start;
        text-align: left;
    }

    .dashboard-insight-metrics {
        grid-template-columns: 1fr;
    }

    .page-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 18px;
    }

    .page-title {
        font-size: 36px;
    }

    .surface-header,
    .empty-state-card,
    .toolbar-inline {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .filter-row {
        grid-template-columns: 1fr;
    }

    .project-program-grid {
        grid-template-columns: 1fr;
    }

    .scenario-grid {
        grid-template-columns: 1fr;
    }

    .glossary-title {
        font-size: 32px;
    }

    .glossary-typography-grid {
        grid-template-columns: 1fr;
    }

    .type-sample-page-title {
        font-size: 40px;
    }

    .type-sample-glossary-title {
        font-size: 32px;
    }

    .type-sample-chapter-title {
        font-size: 20px;
    }

    .type-sample-term-title {
        font-size: 17px;
    }

    .glossary-accordion-panel .mud-expand-panel-text {
        font-size: 20px;
    }

    .glossary-term {
        font-size: 17px;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .settings-profile-hero {
        grid-template-columns: 1fr;
        justify-items: start;
    }

    .settings-form-grid {
        grid-template-columns: 1fr;
    }

    .settings-kpi-grid {
        grid-template-columns: 1fr;
    }

    .settings-twofa-setup {
        grid-template-columns: 1fr;
    }

    .settings-subscription-banner {
        flex-direction: column;
    }

    .settings-subscription-badges {
        justify-content: flex-start;
    }

    .project-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .project-row-main {
        width: 100%;
    }
}
