﻿:root {
    /* Design tokens sourced from the UX4G "SevaSankalp" theme
       (wwwroot/css/theme-sevasankalp.css) — change the palette there, not here. */
    --ink: var(--ux4g-color-neutral-900, #1f2933);
    --ink-soft: var(--ux4g-color-neutral-600, #52606d);
    --line: var(--ux4g-color-neutral-300, #d9dee4);
    --bg: var(--ux4g-color-neutral-50, #f7f8fa);
    --card: var(--ux4g-color-neutral-0, #ffffff);
    --accent: var(--ux4g-color-primary-600, #bc5200);
    --accent-dark: var(--ux4g-color-primary-700, #883a00);
    --accent-soft: var(--ux4g-color-primary-50, #fff4ef);
    --gold: var(--ux4g-color-secondary-500, #ac8500);
    --gold-soft: var(--ux4g-color-secondary-100, #ffedc3);
    --danger: var(--ux4g-color-tertiary-700, #792922);
    --danger-soft: var(--ux4g-color-tertiary-100, #ffe7e4);
    --info: #1d5f91;
    --info-soft: #e6eff6;
    --success: #2d6a3e;
    --success-soft: #e7f3e9;
    --purple: #5b4a8a;
    --purple-soft: #ece9f5;
    --teal: #146b64;
    --teal-soft: #e2f2f0;
    --radius: 6px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 1rem/1.6 var(--ux4g-font-family-base, "Segoe UI", system-ui, -apple-system, sans-serif);
    overflow-x: hidden;
}

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 20px; }

/* Skip link — hidden until keyboard-focused, standard GIGW/UX4G pattern. */
.skip-link {
    position: absolute; left: -999px; top: -999px; z-index: 1000;
    background: var(--accent); color: #fff; padding: 10px 16px; border-radius: var(--radius);
    text-decoration: none; font-weight: 600;
}
.skip-link:focus { left: 12px; top: 12px; }

/* Utility bar: national identity strip + accessibility controls. */
.access-bar { background: var(--ux4g-color-neutral-900, #171717); color: #fff; font-size: 0.8125rem; }
.access-bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 6px; flex-wrap: wrap; }
.access-bar-left { display: flex; align-items: center; gap: 8px; }
.flag-icon { width: 22px; height: auto; border-radius: 2px; flex-shrink: 0; }
.access-bar-right { display: flex; align-items: center; gap: 16px; }

.text-size-group { display: flex; gap: 2px; }
.text-size-group button {
    background: rgba(255, 255, 255, .14); color: #fff; border: 0; border-radius: 4px;
    width: 26px; height: 24px; font-size: 0.75rem; font-weight: 700; cursor: pointer;
}
.text-size-group button:hover, .text-size-group button:focus-visible { background: var(--accent); }

.a11y-menu { position: relative; }
.a11y-menu > button {
    display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .14); color: #fff;
    border: 0; border-radius: 4px; padding: 4px 10px; font-size: 0.75rem; font-weight: 600; cursor: pointer;
}
.a11y-menu > button:hover, .a11y-menu > button:focus-visible { background: var(--accent); }
.a11y-panel {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 230px;
    background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18); padding: 8px;
}
.a11y-panel button {
    display: flex; align-items: center; justify-content: space-between; width: 100%; text-align: left;
    background: none; border: 0; padding: 9px 10px; font-size: 0.875rem; font-weight: 400; color: var(--ink);
    border-radius: 4px; cursor: pointer; margin: 0;
}
.a11y-panel button:hover, .a11y-panel button:focus-visible { background: var(--bg); }
.a11y-panel button[aria-pressed="true"]::after { content: "On"; font-size: 0.6875rem; font-weight: 700; color: var(--accent); }
.a11y-panel hr { border: 0; border-top: 1px solid var(--line); margin: 6px 2px; }

.site-header { background: var(--card); border-bottom: 3px solid; border-image: linear-gradient(90deg, var(--accent), var(--gold)) 1; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; padding-block: 14px; gap: 16px; flex-wrap: wrap; }
.brand { text-decoration: none; color: inherit; display: flex; align-items: center; gap: 12px; }
.emblem { height: 46px; width: auto; flex-shrink: 0; }
.brand-text { display: block; }
.brand-name { display: block; font-family: var(--ux4g-font-family-display, inherit); font-size: 1.1875rem; font-weight: 700; line-height: 1.25; color: var(--accent); }
.brand-sub { display: block; font-size: 0.8125rem; color: var(--ink-soft); }
.site-header nav { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; font-size: 0.9375rem; }
.site-header nav a { color: var(--ink); text-decoration: none; }
.site-header nav a:hover { text-decoration: underline; }
.who { color: var(--ink-soft); }
.inline { display: inline; margin: 0; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); cursor: pointer; text-decoration: underline; }

main { padding-block: 28px 48px; min-height: 60vh; }
main:focus { outline: none; }

h1 { font-family: var(--ux4g-font-family-display, inherit); font-size: 1.75rem; font-weight: 700; margin: 0 0 6px; }
h2 { font-family: var(--ux4g-font-family-display, inherit); font-size: 1.25rem; font-weight: 700; margin: 0 0 10px; }
h3 { font-family: var(--ux4g-font-family-display, inherit); font-size: 1rem; font-weight: 700; margin: 22px 0 8px; }
.lead { color: var(--ink-soft); margin-top: 0; }
code { background: var(--bg); padding: 2px 8px; border-radius: 4px; font-size: 0.9375rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 22px; }
.card.narrow { max-width: 460px; }

.hero-badge {
    display: inline-block; background: var(--accent); color: #fff; font-size: 0.75rem; font-weight: 700;
    letter-spacing: .04em; text-transform: uppercase; padding: 4px 12px; border-radius: 999px; margin-bottom: 14px;
}
.hero-badge.on-dark { background: rgba(255,255,255,.22); backdrop-filter: blur(2px); }

.hero-stats {
    display: flex; flex-wrap: wrap; gap: 14px; margin-block: 18px 22px;
}
.hero-stat {
    flex: 1 1 150px; background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 14px 16px;
}
.hero-stat .n { display: block; font-size: 1.625rem; font-weight: 700; color: var(--accent); line-height: 1.2; }
.hero-stat .l { display: block; font-size: 0.75rem; color: var(--ink-soft); margin-top: 2px; }
html[data-a11y-contrast] .hero-stat { background: #fff; }

/* ---- Homepage carousel ---- */

.carousel {
    position: relative; width: var(--vw, 100vw); margin-left: calc(50% - (var(--vw, 100vw) / 2)); margin-block: 0 22px; overflow: hidden;
}
.carousel-viewport { overflow: hidden; }
.carousel-track { display: flex; transition: transform .6s cubic-bezier(.65,0,.35,1); }
.carousel-slide {
    position: relative; flex: 0 0 100%; min-height: 420px; display: flex; overflow: hidden;
    color: #fff;
}
.carousel-slide-inner {
    max-width: 1180px; margin: 0 auto; padding: 0 20px; width: 100%;
    display: flex; align-items: stretch; justify-content: space-between; gap: 32px;
}
.carousel-text {
    flex: 1 1 480px; min-width: 0; display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
    padding-block: 48px; position: relative; z-index: 1;
}
.carousel-slide h1 { font-size: 2.5rem; max-width: 780px; color: #fff; margin: 0 0 10px; }
.carousel-slide .lead { font-size: 1.0625rem; max-width: 620px; color: rgba(255,255,255,.9); margin: 0 0 8px; }
.carousel-slide p:last-child { margin-bottom: 0; }

.carousel-media {
    position: absolute; top: 0; right: 0; bottom: 0; z-index: 0;
    width: 44%; max-width: 680px; overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 12%);
    mask-image: linear-gradient(to right, transparent 0%, #000 12%);
}
.carousel-media img {
    width: 100%; height: 100%; object-fit: cover; object-position: center; display: block;
}
.carousel-slide-inner.no-media .carousel-media { display: none; }

.carousel-slide.grad-1 { background: linear-gradient(135deg, var(--ux4g-color-primary-500, #fa8c51), var(--ux4g-color-primary-700, #883a00)); }
.carousel-slide.grad-2 { background: linear-gradient(135deg, var(--ux4g-color-secondary-500, #ac8500), var(--ux4g-color-secondary-700, #664e00)); }
.carousel-slide.grad-3 { background: linear-gradient(135deg, var(--ux4g-color-neutral-900, #171717), var(--ux4g-color-primary-700, #883a00)); }
.carousel-slide.grad-4 { background: linear-gradient(135deg, var(--ux4g-color-tertiary-600, #9c443b), var(--ux4g-color-tertiary-800, #570c0a)); }
.carousel-slide.grad-5 { background: linear-gradient(120deg, var(--ux4g-color-primary-600, #bc5200), var(--ux4g-color-secondary-500, #ac8500)); }

.button.on-dark { background: #fff; color: var(--accent-dark); }
.button.on-dark:hover { background: rgba(255,255,255,.88); }
.button.secondary.on-dark { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.5); }
.button.secondary.on-dark:hover { background: rgba(255,255,255,.2); }

.carousel-arrow {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
    width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
    background: rgba(0,0,0,.28); color: #fff; display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.carousel-arrow:hover, .carousel-arrow:focus-visible { background: rgba(0,0,0,.5); }
.carousel-arrow svg { width: 20px; height: 20px; }
.carousel-arrow.prev { left: 16px; }
.carousel-arrow.next { right: 16px; }

.carousel-dots { position: absolute; left: 0; right: 0; bottom: 16px; z-index: 2; display: flex; justify-content: center; gap: 8px; }
.carousel-dot {
    width: 9px; height: 9px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
    background: rgba(255,255,255,.45); transition: background .15s, transform .15s;
}
.carousel-dot:hover { background: rgba(255,255,255,.7); }
.carousel-dot[aria-selected="true"] { background: #fff; transform: scale(1.25); }

html[data-a11y-contrast] .carousel-slide { background: #000 !important; }

@media (max-width: 768px) {
    .carousel-media { display: none; }
}

@media (max-width: 640px) {
    .carousel-slide { min-height: 320px; }
    .carousel-slide-inner { padding: 32px 24px 44px; }
    .carousel-slide h1 { font-size: 1.75rem; }
    .carousel-arrow { display: none; }
}

.about-section { margin-block: 36px; }
.about-grid { display: flex; align-items: center; gap: 44px; }
.about-text { flex: 1 1 480px; min-width: 0; }
.about-text h2 { margin-top: 6px; }
.about-text .lead { margin-bottom: 12px; }
.about-pillars { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; }
.about-pillars li { border-left: 3px solid var(--accent); padding-left: 12px; }
.about-pillars strong { display: block; font-size: 0.9375rem; }
.about-pillars span { display: block; font-size: 0.8125rem; color: var(--ink-soft); }
.about-media { flex: 1 1 420px; min-width: 0; }
.about-media img { width: 100%; height: auto; display: block; border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.12); }

@media (max-width: 768px) {
    .about-grid { flex-direction: column; }
    .about-pillars { grid-template-columns: 1fr; }
}

.latest-posts { margin-block: 22px; }

.notice { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 0; padding: 22px; }

/* Accessibility toolbar effects, toggled via wwwroot/js/accessibility.js */
html[data-a11y-contrast] { --ink: #000; --ink-soft: #1a1a1a; --line: #000; }
html[data-a11y-contrast] body { background: #fff; }
html[data-a11y-underline] a { text-decoration: underline !important; }
html[data-a11y-dyslexia] body { font-family: "Comic Sans MS", "Comic Sans", cursive, var(--ux4g-font-family-base); letter-spacing: .02em; line-height: 1.8; }
html[data-a11y-motion] *, html[data-a11y-motion] *::before, html[data-a11y-motion] *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important;
}

.stats { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 22px; }
.stat-box { flex: 1 1 150px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-align: center; }
.stat-box .n { display: block; font-size: 1.875rem; font-weight: 600; color: var(--accent); }
.stat-box .l { display: block; font-size: 0.8125rem; color: var(--ink-soft); }
.stat { font-size: 1.0625rem; }

form label { display: block; margin-top: 14px; margin-bottom: 4px; font-size: 0.875rem; font-weight: 600; }
form input[type=text], form input[type=email], form input[type=password], form select, form textarea {
    width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--radius);
    font: inherit; background: #fff; color: var(--ink);
}
form input:focus, form select:focus, form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

button[type=submit], .button {
    display: inline-block; margin-top: 18px; padding: 10px 20px; border: 0; border-radius: var(--radius);
    background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
button[type=submit]:hover, .button:hover { background: var(--accent-dark); }

.error { color: var(--danger); font-size: 0.875rem; }
.hint { margin-top: 20px; font-size: 0.875rem; color: var(--ink-soft); }
.perms { columns: 2; font-size: 0.875rem; color: var(--ink-soft); padding-left: 20px; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.page-head h1 { margin: 0; }

.filter-chip { display: flex; align-items: center; gap: 10px; font-size: 0.875rem; color: var(--ink-soft); margin: -8px 0 18px; }
.filter-chip a { color: var(--accent); font-weight: 600; text-decoration: none; }
.filter-chip a:hover { text-decoration: underline; }

.button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--line); }
.button.secondary:hover { background: var(--bg); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }
fieldset.attendance { border: 1px solid var(--line); border-radius: var(--radius); margin-top: 18px; padding: 6px 14px 14px; }
fieldset.attendance legend { padding: 0 6px; font-size: 0.875rem; font-weight: 600; }

label.checkbox { display: flex; align-items: flex-start; gap: 8px; margin-top: 18px; font-size: 0.875rem; font-weight: 400; }
label.checkbox input { margin-top: 3px; }

.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.data-table th, .data-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: 0.9375rem; }
.data-table th { background: var(--bg); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.data-table tbody tr:last-child td { border-bottom: 0; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.8125rem; font-weight: 600; background: var(--line); color: var(--ink); }
.badge.status-draft { background: var(--ux4g-color-neutral-200, #e4e7eb); color: var(--ink-soft); }
.badge.status-submitted { background: var(--gold-soft); color: var(--gold); }
.badge.status-returned { background: var(--danger-soft); color: var(--danger); }
.badge.status-approved { background: var(--accent-soft); color: var(--accent-dark); }
.badge.status-published { background: var(--accent); color: var(--ux4g-color-neutral-0, #fff); }
.badge.status-unpublished { background: var(--ux4g-color-neutral-200, #e4e7eb); color: var(--ink-soft); }
.badge.status-archived { background: var(--ux4g-color-neutral-200, #e4e7eb); color: var(--ink-soft); }

.detail-list { display: grid; grid-template-columns: 160px 1fr; row-gap: 10px; column-gap: 12px; margin: 0 0 20px; }
.detail-list dt { font-size: 0.8125rem; font-weight: 600; color: var(--ink-soft); }
.detail-list dd { margin: 0; }

@media (max-width: 640px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .detail-list { grid-template-columns: 1fr; }
    .detail-list dt { margin-top: 8px; }
}

.workflow-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.workflow-actions form { margin: 0; }
.workflow-actions button { margin-top: 0; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-top: 14px; }
.media-tile { position: relative; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg); }
.media-tile img { display: block; width: 100%; height: 150px; object-fit: cover; }
.media-tile.is-cover { outline: 3px solid var(--accent); outline-offset: -3px; }
.media-cover-badge { position: absolute; top: 6px; left: 6px; background: var(--accent); color: #fff; font-size: 0.6875rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.media-caption { margin: 0; padding: 6px 8px; font-size: 0.75rem; color: var(--ink-soft); }
.media-video { display: block; position: relative; }
.media-video-placeholder { display: flex; align-items: center; justify-content: center; height: 150px; background: var(--ink); color: #fff; font-weight: 600; }
.media-tile form { margin: 0; padding: 6px 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.media-tile form button, .media-tile form .link-button { font-size: 0.75rem; margin: 0; }

.upload-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.upload-row > div { flex: 1 1 220px; }

.filter-row { display: flex; align-items: center; gap: 10px; margin: 18px 0; }
.filter-row label { font-size: 0.875rem; font-weight: 600; margin: 0; }
.filter-row select { width: auto; min-width: 220px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); font: inherit; }

.filter-row-wrap { flex-wrap: wrap; align-items: flex-end; gap: 14px 16px; }
.filter-field { display: flex; flex-direction: column; gap: 4px; }
.filter-field label { font-size: 0.75rem; }
.filter-field select { min-width: 180px; }
.filter-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.filter-actions .button { display: inline-flex; align-items: center; gap: 6px; }

.event-feed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.event-feed-grid[hidden] { display: none; }
.event-card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; transition: box-shadow .15s; }
.event-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.event-card img { display: block; width: 100%; height: 160px; object-fit: cover; }
.event-card-noimage { height: 160px; background: linear-gradient(135deg, var(--accent-soft), var(--bg)); }
.event-card-body { padding: 14px 16px; }
.event-card-dept { display: block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); margin-bottom: 4px; }
.event-card-body h2 { font-size: 1.0625rem; margin: 0 0 6px; }
.event-card-date { font-size: 0.8125rem; color: var(--ink-soft); }

/* Skeleton loading placeholders for the homepage "latest posts" section. */
.skeleton-card { pointer-events: none; }
.skeleton-img, .skeleton-line {
    background: linear-gradient(90deg, var(--line) 25%, var(--accent-soft) 50%, var(--line) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s ease-in-out infinite;
    border-radius: 4px;
}
.skeleton-img { height: 160px; border-radius: 0; }
.skeleton-line { height: 12px; margin: 10px 0; }
.skeleton-line-sm { width: 40%; }
.skeleton-line-lg { width: 80%; height: 16px; }
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.fade-in-up { animation: fadeInUp .5s ease-out both; }
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.event-hero-image { display: block; width: 100%; max-height: 420px; object-fit: cover; border-radius: var(--radius); margin-bottom: 16px; }

.site-footer { background: var(--ux4g-color-neutral-900, #171717); border-top: 3px solid; border-image: linear-gradient(90deg, var(--accent), var(--gold)) 1; padding-block: 28px 16px; font-size: 0.875rem; color: rgba(255,255,255,.72); }
.site-footer p { margin: 4px 0; }
.site-footer a { color: rgba(255,255,255,.85); }
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.footer-title { font-weight: 700; color: #fff; margin-bottom: 8px !important; }
.footer-bottom { margin-top: 20px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.15); }

@media (max-width: 640px) {
    .footer-grid { grid-template-columns: 1fr; gap: 18px; }
}

/* ---- Dashboard ---- */

.dash-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.dash-head h1 { margin: 0; }
.role-chip {
    display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft); color: var(--accent-dark);
    font-size: 0.8125rem; font-weight: 700; padding: 4px 12px; border-radius: 999px;
}
.role-chip.is-superadmin { background: var(--ink); color: #fff; }

.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
    display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 16px 18px; text-decoration: none; color: inherit;
    transition: box-shadow .15s, transform .15s;
}
.stat-card:hover { box-shadow: 0 8px 20px rgba(0,0,0,.08); transform: translateY(-2px); }
.stat-card .n { display: block; font-size: 1.625rem; font-weight: 700; line-height: 1.1; }
.stat-card .l { display: block; font-size: 0.8125rem; color: var(--ink-soft); margin-top: 2px; }

.icon-chip {
    flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.icon-chip svg { width: 22px; height: 22px; }
.icon-chip-gray { background: var(--ux4g-color-neutral-200, #e4e7eb); color: var(--ink-soft); }
.icon-chip-gold { background: var(--gold-soft); color: var(--gold); }
.icon-chip-red { background: var(--danger-soft); color: var(--danger); }
.icon-chip-orange { background: var(--accent-soft); color: var(--accent); }

.dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 22px; align-items: start; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 22px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.panel-head h2 { margin: 0; }
.panel-head a { font-size: 0.8125rem; font-weight: 600; color: var(--accent); text-decoration: none; }
.panel-head a:hover { text-decoration: underline; }
.panel-head-note { font-size: 0.8125rem; color: var(--ink-soft); }

.review-status-panel .badge { font-size: 0.875rem; padding: 5px 12px; text-decoration: none; transition: filter .15s; }
.review-status-panel .badge strong { margin-left: 4px; }
.review-status-panel a.badge:hover { filter: brightness(0.94); }
.panel-empty { color: var(--ink-soft); font-size: 0.875rem; margin: 0; }

.panel.attention { border-color: var(--gold); background: linear-gradient(180deg, var(--gold-soft) 0%, var(--card) 90px); }

.pending-list, .activity-list { list-style: none; margin: 0; padding: 0; }
.pending-list li, .activity-list li {
    display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line);
}
.pending-list li:first-child, .activity-list li:first-child { border-top: 0; padding-top: 0; }
.pending-item-body, .activity-item-body { flex: 1; min-width: 0; }
.pending-item-body .title, .activity-item-body .title { font-weight: 600; }
.pending-item-body .meta, .activity-item-body .meta { font-size: 0.8125rem; color: var(--ink-soft); margin-top: 2px; }
.pending-item-body a.review-link { font-size: 0.8125rem; font-weight: 600; color: var(--accent); text-decoration: none; }
.pending-item-body a.review-link:hover { text-decoration: underline; }
.activity-icon {
    flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; margin-top: 2px;
}
.activity-icon svg { width: 15px; height: 15px; }

.dept-bar-list { list-style: none; margin: 0; padding: 0; }
.dept-bar-item { padding: 10px 0; border-top: 1px solid var(--line); }
.dept-bar-item:first-child { border-top: 0; padding-top: 0; }
.dept-bar-item-head { display: flex; justify-content: space-between; gap: 10px; font-size: 0.875rem; margin-bottom: 6px; }
.dept-bar-item-head .name { font-weight: 600; }
.dept-bar-item-head .count { color: var(--ink-soft); }
.dept-bar-track { height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; display: flex; }
.dept-bar-fill { height: 100%; background: var(--accent); }
.dept-bar-fill.is-pending { background: var(--gold); }

.quick-actions { display: grid; gap: 10px; }
.quick-action {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius);
    background: var(--bg); border: 1px solid var(--line); text-decoration: none; color: var(--ink);
    font-weight: 600; font-size: 0.875rem; transition: background .15s;
}
.quick-action:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); }
.quick-action svg { width: 17px; height: 17px; flex-shrink: 0; color: var(--accent); }

.campaign-panel { border-color: var(--accent); background: linear-gradient(180deg, var(--accent-soft) 0%, var(--card) 110px); }
.campaign-panel .dates { font-size: 0.8125rem; color: var(--ink-soft); margin: 2px 0 10px; }
.campaign-panel .stat-line { font-size: 0.875rem; }
.campaign-panel .stat-line strong { color: var(--accent); font-size: 1.25rem; }

.perm-groups { display: flex; flex-direction: column; gap: 14px; }
.perm-group-title { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); margin-bottom: 6px; }
.perm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.perm-chip { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 0.8125rem; }

@media (max-width: 900px) {
    .dash-grid { grid-template-columns: 1fr; }
    .stat-cards { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Help / user manuals ---- */

.help-head { margin-bottom: 26px; }
.help-head h1 { margin: 0 0 14px; }
.role-tabs { display: flex; flex-wrap: wrap; gap: 8px; border-bottom: 1px solid var(--line); }
.role-tab {
    font: inherit; font-size: 0.9375rem; font-weight: 600; color: var(--ink-soft);
    background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 4px; margin-right: 18px; cursor: pointer;
}
.role-tab:hover { color: var(--ink); }
.role-tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }

.help-manual { display: none; }
.help-manual.active { display: block; }

.help-lede { color: var(--ink-soft); font-size: 1rem; max-width: 62ch; margin: 14px 0 0; }

.scope-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 20px 0 34px; }
.scope-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.scope-card .k { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }
.scope-card .v { font-size: 0.9375rem; margin-top: 4px; }

.step-block { margin: 0 0 38px; scroll-margin-top: 16px; }
.step-block > h2 { display: flex; align-items: baseline; gap: 10px; margin: 0 0 4px; }
.step-block > h2 .n { color: var(--accent); }
.step-block > .lede { color: var(--ink-soft); font-size: 0.9375rem; margin: 0 0 16px; max-width: 62ch; }

ol.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); }
ol.steps > li { counter-increment: step; display: grid; grid-template-columns: 34px 1fr; gap: 14px; padding: 15px 18px; border-top: 1px solid var(--line); }
ol.steps > li:first-child { border-top: 0; }
ol.steps > li::before {
    content: counter(step); font-weight: 700; color: var(--accent-dark); background: var(--accent-soft);
    width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.8125rem;
}
ol.steps .step-body p { margin: 0 0 6px; font-size: 0.9375rem; }
ol.steps .step-body p:last-child { margin-bottom: 0; }
ol.steps .field { font-size: 0.875rem; color: var(--ink-soft); }
ol.steps .field code { background: var(--bg); border-radius: 4px; padding: 1px 6px; font-size: 0.8125rem; }

.ui-btn { display: inline-block; background: var(--accent); color: #fff; font-weight: 600; font-size: 0.8125rem; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.ui-btn.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.ui-link { font-weight: 600; font-size: 0.8125rem; color: var(--accent); }
.ui-path { background: var(--bg); border-radius: 5px; padding: 2px 7px; font-size: 0.8125rem; color: var(--ink-soft); }

.help-callout { border-radius: var(--radius); padding: 14px 16px; font-size: 0.9375rem; margin: 0 0 38px; border-left: 3px solid var(--danger); background: var(--danger-soft); }
.help-callout .label { display: block; font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--danger); margin-bottom: 4px; }
.help-callout p { margin: 0; }

.shared-ref { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 36px; }
.ref-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }

@media (max-width: 640px) {
    .ref-grid { grid-template-columns: 1fr; }
    ol.steps > li { grid-template-columns: 26px 1fr; padding: 12px; }
}

@media (max-width: 640px) {
    .site-header .wrap { flex-direction: column; align-items: flex-start; gap: 10px; }
    .perms { columns: 1; }
    .access-bar-inner { justify-content: center; text-align: center; }
    .access-bar-left span { display: none; }
    .emblem { height: 36px; }
    .brand-name { font-size: 1rem; }
    .stat-cards { grid-template-columns: 1fr; }
}

/* ---- Impact / insights dashboard ---- */

.insights-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.insights-head h1 { margin: 0 0 4px; }
.insights-head .lead { margin: 0; }
.insights-period { text-align: right; }
.insights-period .dates { font-weight: 700; font-size: 1.0625rem; color: var(--accent); display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.insights-period .tags { font-size: 0.8125rem; color: var(--ink-soft); margin-top: 2px; }

.kpi-cards { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 24px; }
.kpi-card { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi-card .n { display: block; font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.kpi-card .l { display: block; font-size: 0.75rem; color: var(--ink-soft); margin-top: 2px; }
.kpi-card-link { color: inherit; text-decoration: none; transition: box-shadow .15s, border-color .15s; }
.kpi-card-link:hover { box-shadow: 0 6px 16px rgba(0,0,0,.08); border-color: var(--accent); }
.kpi-card .sub { display: block; font-size: 0.6875rem; color: var(--ink-soft); }

.icon-chip-blue { background: var(--info-soft); color: var(--info); }
.icon-chip-green { background: var(--success-soft); color: var(--success); }
.icon-chip-purple { background: var(--purple-soft); color: var(--purple); }
.icon-chip-teal { background: var(--teal-soft); color: var(--teal); }

.insights-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: start; margin-bottom: 22px; }
.insights-grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; align-items: start; margin-bottom: 22px; }

.mini-bar-cell { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.mini-bar-track { flex: 1; height: 6px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.mini-bar-fill { height: 100%; background: var(--accent); border-radius: 999px; }
.mini-bar-pct { font-size: 0.8125rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; width: 3.2em; text-align: right; }

.coverage-list { list-style: none; margin: 0; padding: 0; }
.coverage-item { padding: 9px 0; border-top: 1px solid var(--line); }
.coverage-item:first-child { border-top: 0; padding-top: 0; }
.coverage-item-head { display: flex; justify-content: space-between; gap: 10px; font-size: 0.875rem; margin-bottom: 5px; }
.coverage-item-head .name { font-weight: 600; }
.coverage-item-head .count { color: var(--ink-soft); font-size: 0.8125rem; }
.coverage-item .mini-bar-track { height: 7px; }

.chart-card h2 { display: flex; align-items: center; justify-content: space-between; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 0.8125rem; color: var(--ink-soft); margin-top: 10px; }
.chart-legend .swatch { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }

.funnel { display: flex; flex-direction: column; align-items: center; gap: 3px; margin-top: 6px; }
.funnel-stage {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-width: 108px; height: 46px; padding: 2px 10px; color: #fff; text-align: center;
}
.funnel-stage .value { font-weight: 700; font-size: 1rem; line-height: 1.15; }
.funnel-stage .label { font-size: 0.6875rem; font-weight: 600; line-height: 1.15; color: rgba(255,255,255,.85); white-space: nowrap; }

.donut-wrap { display: flex; flex-direction: column; align-items: center; }
.donut-total { font-size: 1.375rem; font-weight: 700; }
.donut-total-label { font-size: 0.6875rem; color: var(--ink-soft); }

.attention-list { list-style: none; margin: 0; padding: 0; }
.attention-list li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 0.875rem; }
.attention-list li:first-child { border-top: 0; padding-top: 0; }
.attention-dot { flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; }
.attention-dot.danger { background: var(--danger); }
.attention-dot.warning { background: var(--gold); }
.attention-dot.info { background: var(--info); }
.attention-empty { color: var(--ink-soft); font-size: 0.875rem; }

@media (max-width: 1000px) {
    .kpi-cards { grid-template-columns: repeat(3, 1fr); }
    .insights-grid-3 { grid-template-columns: 1fr; }
    .insights-grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .kpi-cards { grid-template-columns: 1fr 1fr; }
    .insights-head { flex-direction: column; }
    .insights-period { text-align: left; }
    .insights-period .dates { justify-content: flex-start; }
}

/* ---- Manage area: sidebar shell ---- */

.app-shell { display: flex; align-items: stretch; min-height: calc(100vh - 33px); }

.sidebar {
    width: 252px; flex-shrink: 0; background: var(--ux4g-color-neutral-900, #171717);
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-brand {
    display: flex; align-items: center; gap: 10px; padding: 20px 18px; text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,.1);
}
/* Both emblem SVGs are unfilled paths (default to solid black) — fine on the
   public header's white background, invisible on this dark sidebar, so invert
   them to white here specifically. */
.sidebar-emblem { height: 34px; width: auto; flex-shrink: 0; filter: invert(1); }
.sidebar-brand-name { display: block; font-family: var(--ux4g-font-family-display, inherit); font-size: 0.875rem; font-weight: 700; line-height: 1.25; color: #fff; }
.sidebar-brand-sub { display: block; font-size: 0.75rem; color: rgba(255,255,255,.6); margin-top: 1px; }

.sidebar-nav { flex: 1; padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-link {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius);
    color: rgba(255,255,255,.75); text-decoration: none; font-size: 0.9375rem; font-weight: 500;
    border-left: 3px solid transparent;
}
.sidebar-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-link.active { background: rgba(255,255,255,.1); color: #fff; border-left-color: var(--accent); font-weight: 700; }

.sidebar-foot { padding: 14px 10px 18px; border-top: 1px solid rgba(255,255,255,.1); display: flex; flex-direction: column; gap: 2px; }
.sidebar-foot .sidebar-link { font-size: 0.875rem; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }

.topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    padding: 14px 28px; background: var(--card); border-bottom: 1px solid var(--line);
}
.topbar-title { font-size: 0.8125rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }
.topbar-right { display: flex; align-items: center; gap: 16px; font-size: 0.9375rem; }
.topbar-right a { color: var(--ink); text-decoration: none; }
.topbar-right a:hover { text-decoration: underline; }
.topbar-right .who { color: var(--ink-soft); }
.topbar-right form { margin: 0; }
.topbar-right button { margin: 0; padding: 7px 16px; font-size: 0.875rem; }

.app-content { flex: 1; padding: 26px 28px 60px; }

@media (max-width: 900px) {
    .app-shell { flex-direction: column; min-height: 0; }
    .sidebar { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; }
    .sidebar-brand { border-bottom: 0; padding: 12px 14px; }
    .sidebar-nav { flex-direction: row; flex-wrap: wrap; padding: 8px 10px 12px; }
    .sidebar-link { border-left: 0; border-bottom: 2px solid transparent; padding: 6px 10px; }
    .sidebar-link.active { border-left-color: transparent; border-bottom-color: var(--accent); }
    .sidebar-foot { flex-direction: row; flex-wrap: wrap; border-top: 0; padding: 0 10px 12px; }
    .topbar { padding: 12px 16px; }
    .app-content { padding: 18px 16px 40px; }
}
