.portal-page {
    display: flex;
    min-height: 100vh;
    background: #eef2f8;
}

.portal-sidebar {
    width: 280px;
    flex-shrink: 0;
    align-self: stretch;
    background: linear-gradient(180deg, #0a2f7a 0%, #061f52 100%);
    color: #fff;
    box-shadow: 2px 0 18px rgba(6, 31, 82, 0.22);
}

.portal-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.portal-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 1.5rem;
    height: 62px;
    background: #ffffff;
    border-bottom: 1px solid #d7e0ec;
    box-shadow: 0 2px 12px rgba(10, 47, 122, 0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}

.portal-topbar-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex: 1;
    min-width: 0;
}

.portal-topbar-icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
    color: #0a2f7a;
    font-size: 0.95rem;
}

.portal-topbar-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: #0a2f7a;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

html.portal-theme-dark .portal-topbar-title {
    color: #e2e8f0;
}

html.portal-theme-dark .portal-topbar-icon {
    background: linear-gradient(145deg, #1e3a5f 0%, #1e293b 100%);
    border-color: #334155;
    color: #93c5fd;
}

.portal-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Notification bell */
.portal-topbar-icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid #e2e8f2;
    background: #f8faff;
    color: #3a5080;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background 0.14s ease, border-color 0.14s ease;
}

.portal-topbar-icon-btn:hover {
    background: #eef2fb;
    border-color: #c5d0e8;
}

.portal-topbar-notif-dot {
    position: absolute;
    top: 8px;
    right: 9px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e5484d;
    border: 2px solid #fff;
}

.portal-topbar-notif-wrap {
    position: relative;
}

.portal-notif-dropdown {
    min-width: 320px;
    max-width: min(360px, 92vw);
}

.portal-notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem 0.65rem;
    border-bottom: 1px solid #edf1f7;
}

.portal-notif-header strong {
    font-size: 0.9rem;
    color: #0f2035;
}

.portal-notif-badge {
    font-size: 0.68rem;
    font-weight: 800;
    color: #1d4ed8;
    background: #dbeafe;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
}

.portal-notif-list {
    max-height: 320px;
    overflow-y: auto;
}

.portal-notif-item {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    border-bottom: 1px solid #f1f5f9;
    background: #fff;
    text-align: left;
    cursor: pointer;
    transition: background 0.14s ease;
}

.portal-notif-item:hover {
    background: #f8fbff;
}

.portal-notif-item--unread {
    background: linear-gradient(90deg, rgba(219, 234, 254, 0.35) 0%, #fff 55%);
}

.portal-notif-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 0.95rem;
}

.portal-notif-icon--danger { background: #fee2e2; color: #dc2626; }
.portal-notif-icon--blue { background: #dbeafe; color: #2563eb; }
.portal-notif-icon--amber { background: #fef3c7; color: #d97706; }

.portal-notif-copy {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 0;
}

.portal-notif-copy strong {
    font-size: 0.82rem;
    color: #0f172a;
    line-height: 1.25;
}

.portal-notif-copy span {
    font-size: 0.76rem;
    color: #64748b;
    line-height: 1.35;
}

.portal-notif-copy em {
    font-size: 0.68rem;
    color: #94a3b8;
    font-style: normal;
    margin-top: 0.15rem;
}

.portal-notif-footer {
    display: block;
    padding: 0.7rem 1rem;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 700;
    color: #1d4ed8;
    text-decoration: none;
    border-top: 1px solid #edf1f7;
}

.portal-notif-footer:hover {
    background: #f8fbff;
    color: #1e40af;
}

/* Profile button + dropdown */
.portal-topbar-profile-wrap {
    position: relative;
}

.portal-topbar-profile-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 40px;
    padding: 0 0.65rem;
    border-radius: 10px;
    border: 1px solid #e2e8f2;
    background: #f8faff;
    cursor: pointer;
    transition: background 0.14s ease;
}

.portal-topbar-profile-btn:hover {
    background: #eef2fb;
    border-color: #c5d0e8;
}

.portal-topbar-avatar {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, #1d4ed8 0%, #0a2f7a 100%);
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 800;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.portal-topbar-username {
    font-size: 0.84rem;
    font-weight: 600;
    color: #1a2d4a;
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portal-topbar-chevron {
    font-size: 0.7rem;
    color: #607089;
    transition: transform 0.18s ease;
}

.portal-topbar-profile-btn[aria-expanded="true"] .portal-topbar-chevron {
    transform: rotate(180deg);
}

.portal-topbar-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 260px;
    background: #fff;
    border: 1px solid #dde6f0;
    border-radius: 14px;
    box-shadow: 0 12px 36px rgba(10, 47, 122, 0.14), 0 2px 8px rgba(10, 47, 122, 0.06);
    overflow: hidden;
    z-index: 200;
    animation: portal-dropdown-in 0.14s ease;
}

@keyframes portal-dropdown-in {
    from { opacity: 0; transform: translateY(-6px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.portal-topbar-dropdown-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.9rem 1rem 0.75rem;
}

.portal-topbar-dropdown-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1d4ed8 0%, #0a2f7a 100%);
    color: #ffffff !important;
    font-size: 0.82rem;
    font-weight: 800;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.portal-topbar-dropdown-header strong {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f2035;
    line-height: 1.2;
}

.portal-topbar-dropdown-header span {
    font-size: 0.74rem;
    color: #607089;
}

.portal-topbar-dropdown-divider {
    height: 1px;
    background: #edf1f7;
    margin: 0;
}

.portal-topbar-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    padding: 0.62rem 1rem;
    font-size: 0.84rem;
    font-weight: 500;
    color: #1a2d4a;
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.12s ease;
}

.portal-topbar-dropdown-item:hover {
    background: #f0f5ff;
    color: #0a2f7a;
}

.portal-topbar-dropdown-item i {
    font-size: 0.9rem;
    width: 16px;
    text-align: center;
}

.portal-topbar-dropdown-item--danger {
    color: #b91c1c;
}

.portal-topbar-dropdown-item--danger:hover {
    background: #fff5f5;
    color: #991b1b;
}

.portal-theme-picker {
    padding: 0.55rem 1rem 0.75rem;
}

.portal-theme-picker-label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
}

.portal-mode-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
}

.portal-mode-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.5rem 0.55rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.portal-mode-btn:hover {
    border-color: #93c5fd;
    color: #1d4ed8;
}

.portal-mode-btn.is-active {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.portal-theme-swatches {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.4rem;
}

.portal-theme-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.28rem;
    padding: 0.35rem 0.2rem;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.portal-theme-swatch:hover,
.portal-theme-swatch.is-active {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.portal-theme-swatch.is-active {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.portal-theme-swatch-preview {
    width: 100%;
    height: 22px;
    border-radius: 7px;
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.portal-theme-swatch-preview--white {
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
}

.portal-theme-swatch-preview--sky {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
}

.portal-theme-swatch-preview--blue {
    background: linear-gradient(135deg, #dbeafe 0%, #93c5fd 100%);
}

.portal-theme-swatch-preview--mint {
    background: linear-gradient(135deg, #dcfce7 0%, #a5f3fc 100%);
}

.portal-theme-swatch span {
    font-size: 0.62rem;
    font-weight: 700;
    color: #64748b;
}

.portal-topbar-kicker,
.portal-topbar-user {
    display: none;
}

.portal-mock-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: #fff4d6;
    color: #8a5b00;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.portal-content {
    flex: 1;
    padding: 1.35rem 1.5rem 2rem;
    position: relative;
    background: linear-gradient(165deg, #ffffff 0%, #f8fafc 42%, #f1f5f9 100%);
    transition: background 0.35s ease;
}

/* Portal background themes (profile setting) */
body.portal-bg-white .portal-content {
    background: linear-gradient(165deg, #ffffff 0%, #f8fafc 42%, #f1f5f9 100%);
}

body.portal-bg-sky .portal-content {
    background: linear-gradient(165deg, #f0f9ff 0%, #e0f2fe 45%, #dbeafe 100%);
}

body.portal-bg-blue .portal-content {
    background: linear-gradient(165deg, #eff6ff 0%, #dbeafe 48%, #bfdbfe 100%);
}

body.portal-bg-mint .portal-content {
    background: linear-gradient(165deg, #f0fdf4 0%, #ecfdf5 45%, #e0f2fe 100%);
}

.portal-page-title {
    font-size: 1.45rem;
    font-weight: 600;
    color: #0a2f7a;
    margin-bottom: 0.85rem;
}

.portal-page-lead {
    color: #5f6f84;
    margin-bottom: 1.25rem;
}

.portal-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
    margin-bottom: 1.15rem;
}

.portal-kpi-sortable {
    position: relative;
    min-width: 0;
    display: flex;
}

.portal-kpi-sortable > .portal-kpi-card {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
}

body.portal-dash-edit-mode .portal-kpi-sortable {
    cursor: grab;
    outline: 2px dashed rgba(37, 99, 235, 0.35);
    outline-offset: 2px;
    border-radius: 16px;
    transition: box-shadow 0.18s ease, transform 0.18s ease, outline-color 0.18s ease;
}

body.portal-dash-edit-mode .portal-kpi-sortable.is-dragging {
    opacity: 0.55;
    cursor: grabbing;
}

body.portal-dash-edit-mode .portal-kpi-sortable.is-drag-over {
    outline-color: #2563eb;
    box-shadow: 0 18px 42px rgba(37, 99, 235, 0.22), 0 8px 18px rgba(15, 23, 42, 0.12);
    transform: translateY(-2px);
}

body.portal-dash-edit-mode .portal-kpi-sortable .portal-kpi-card--link {
    pointer-events: none;
}

body.portal-dash-edit-mode .portal-kpi-sortable .portal-dash-widget-handle {
    top: 0.55rem;
    left: 0.45rem;
}

.portal-kpi-card {
    --kpi-accent: #3b82f6;
    --kpi-accent-soft: #eff6ff;
    --kpi-accent-soft-2: #dbeafe;
    --kpi-icon-bg: #3b82f6;
    --kpi-icon-shadow: rgba(59, 130, 246, 0.35);
    --kpi-poly-1: #cfe0ff;
    --kpi-poly-2: #e8f0ff;
    --kpi-poly-3: #f4f7ff;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border-radius: 18px;
    padding: 1.15rem 1.15rem 0.95rem;
    border: 1px solid #e8eef7;
    min-height: 0;
    background: #fff;
    box-shadow:
        0 10px 28px rgba(15, 23, 42, 0.06),
        0 2px 8px rgba(15, 23, 42, 0.03);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.portal-kpi-card--premium {
    isolation: isolate;
}

.portal-kpi-card:hover,
a.portal-kpi-card:hover {
    transform: translateY(-3px);
    box-shadow:
        0 16px 36px rgba(15, 23, 42, 0.1),
        0 4px 12px rgba(15, 23, 42, 0.05);
}

a.portal-kpi-card {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

a.portal-kpi-card:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Crystalline low-poly corner — sharp facets, no radial/tire look */
.portal-kpi-card__deco {
    position: absolute;
    top: 0;
    right: 0;
    width: 168px;
    height: 134px;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    border-top-right-radius: 18px;
    -webkit-mask-image: linear-gradient(215deg, #000 12%, #000 46%, transparent 82%);
    mask-image: linear-gradient(215deg, #000 12%, #000 46%, transparent 82%);
}

.portal-kpi-card__deco svg {
    display: block;
    width: 100%;
    height: 100%;
}

.portal-kpi-poly {
    stroke: rgba(255, 255, 255, 0.35);
    stroke-width: 0.6;
    vector-effect: non-scaling-stroke;
}

.portal-kpi-poly--a { fill: var(--kpi-poly-1); }
.portal-kpi-poly--b { fill: var(--kpi-poly-2); }
.portal-kpi-poly--c { fill: var(--kpi-poly-3); }
.portal-kpi-poly--d { fill: var(--kpi-poly-1); opacity: 0.78; }
.portal-kpi-poly--e { fill: var(--kpi-poly-2); opacity: 0.88; }
.portal-kpi-poly--f { fill: var(--kpi-poly-3); opacity: 0.92; }
.portal-kpi-poly--g { fill: var(--kpi-poly-2); opacity: 0.58; }
.portal-kpi-poly--h { fill: var(--kpi-poly-3); opacity: 0.68; }
.portal-kpi-poly--i { fill: var(--kpi-poly-1); opacity: 0.48; }
.portal-kpi-poly--j { fill: var(--kpi-poly-3); opacity: 0.32; }
.portal-kpi-poly--k { fill: var(--kpi-poly-2); opacity: 0.26; }
.portal-kpi-poly--l { fill: var(--kpi-poly-1); opacity: 0.2; }
.portal-kpi-poly--m { fill: var(--kpi-poly-3); opacity: 0.28; }

.portal-kpi-card__icon {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    margin-bottom: 0.85rem;
    border-radius: 12px;
    clip-path: none;
    background: var(--kpi-icon-bg);
    color: #fff;
    font-size: 1.15rem;
    box-shadow: 0 8px 18px var(--kpi-icon-shadow);
}

.reg-kpi-card__icon {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: 0;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: var(--kpi-icon-bg);
    color: #fff;
    box-shadow: 0 8px 18px var(--kpi-icon-shadow);
}

.portal-kpi-card__body {
    position: relative;
    z-index: 2;
    min-width: 0;
    max-width: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1 1 auto;
}

.portal-kpi-card__label {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1e293b;
    margin-bottom: 0.55rem;
    padding-bottom: 0.35rem;
    border-bottom: 2px solid var(--kpi-accent);
    line-height: 1.2;
}

.portal-kpi-card__value {
    display: block;
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--kpi-accent);
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: 0.55rem;
}

.portal-kpi-spark {
    display: none;
}

.portal-kpi-spark-line {
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.portal-kpi-card--blue {
    --kpi-accent: #3b82f6;
    --kpi-accent-soft: #eff6ff;
    --kpi-accent-soft-2: #dbeafe;
    --kpi-icon-bg: #3b82f6;
    --kpi-icon-shadow: rgba(59, 130, 246, 0.38);
    --kpi-poly-1: #bfd4ff;
    --kpi-poly-2: #dde9ff;
    --kpi-poly-3: #f0f5ff;
    --kpi-hex-solid: #3b82f6;
    --kpi-hex-fade-1: rgba(59, 130, 246, 0.06);
    --kpi-hex-fade-2: rgba(59, 130, 246, 0.1);
    --kpi-hex-fade-3: rgba(59, 130, 246, 0.04);
    border-color: #e2eaf8;
}
.portal-kpi-card--blue .portal-kpi-spark-line { stroke: #6366f1; }
.portal-kpi-card--blue .portal-kpi-spark-stop-a { stop-color: rgba(99, 102, 241, 0.35); }
.portal-kpi-card--blue .portal-kpi-spark-stop-b { stop-color: rgba(99, 102, 241, 0); }

.portal-kpi-card--green {
    --kpi-accent: #16a34a;
    --kpi-accent-soft: #f0fdf4;
    --kpi-accent-soft-2: #dcfce7;
    --kpi-icon-bg: #22a06b;
    --kpi-icon-shadow: rgba(34, 160, 107, 0.38);
    --kpi-poly-1: #b8efd0;
    --kpi-poly-2: #dbf8e8;
    --kpi-poly-3: #f0fdf6;
    --kpi-hex-solid: #22a06b;
    --kpi-hex-fade-1: rgba(34, 160, 107, 0.06);
    --kpi-hex-fade-2: rgba(34, 160, 107, 0.1);
    --kpi-hex-fade-3: rgba(34, 160, 107, 0.04);
    border-color: #e3f5ea;
}
.portal-kpi-card--green .portal-kpi-spark-line { stroke: #22c55e; }
.portal-kpi-card--green .portal-kpi-spark-stop-a { stop-color: rgba(34, 197, 94, 0.35); }
.portal-kpi-card--green .portal-kpi-spark-stop-b { stop-color: rgba(34, 197, 94, 0); }

.portal-kpi-card--amber {
    --kpi-accent: #d97706;
    --kpi-accent-soft: #fffbeb;
    --kpi-accent-soft-2: #fef3c7;
    --kpi-icon-bg: #f59e0b;
    --kpi-icon-shadow: rgba(245, 158, 11, 0.38);
    --kpi-poly-1: #fde68a;
    --kpi-poly-2: #fef3c7;
    --kpi-poly-3: #fffbeb;
    --kpi-hex-solid: #f59e0b;
    --kpi-hex-fade-1: rgba(245, 158, 11, 0.06);
    --kpi-hex-fade-2: rgba(245, 158, 11, 0.1);
    --kpi-hex-fade-3: rgba(245, 158, 11, 0.04);
    border-color: #f8edd6;
}
.portal-kpi-card--amber .portal-kpi-spark-line { stroke: #f59e0b; }
.portal-kpi-card--amber .portal-kpi-spark-stop-a { stop-color: rgba(245, 158, 11, 0.35); }
.portal-kpi-card--amber .portal-kpi-spark-stop-b { stop-color: rgba(245, 158, 11, 0); }

.portal-kpi-card--rose {
    --kpi-accent: #e11d48;
    --kpi-accent-soft: #fff1f2;
    --kpi-accent-soft-2: #ffe4e6;
    --kpi-icon-bg: #e85d8a;
    --kpi-icon-shadow: rgba(232, 93, 138, 0.38);
    --kpi-poly-1: #fecdd3;
    --kpi-poly-2: #ffe4e6;
    --kpi-poly-3: #fff1f2;
    --kpi-hex-solid: #e85d8a;
    --kpi-hex-fade-1: rgba(232, 93, 138, 0.06);
    --kpi-hex-fade-2: rgba(232, 93, 138, 0.1);
    --kpi-hex-fade-3: rgba(232, 93, 138, 0.04);
    border-color: #f8e4ea;
}
.portal-kpi-card--rose .portal-kpi-spark-line { stroke: #ec4899; }
.portal-kpi-card--rose .portal-kpi-spark-stop-a { stop-color: rgba(236, 72, 153, 0.35); }
.portal-kpi-card--rose .portal-kpi-spark-stop-b { stop-color: rgba(236, 72, 153, 0); }

/* Registration KPI cards keep geometric hex décor */
.reg-kpi-card::before {
    content: "";
    position: absolute;
    top: 10px;
    right: 36px;
    width: 52px;
    height: 60px;
    pointer-events: none;
    z-index: 0;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: var(--kpi-hex-fade-1);
    box-shadow:
        -8px 22px 0 -4px var(--kpi-hex-fade-3),
        6px 42px 0 -2px var(--kpi-hex-fade-2);
}

.reg-kpi-card::after {
    content: "";
    position: absolute;
    bottom: -26px;
    right: -18px;
    width: 86px;
    height: 99px;
    pointer-events: none;
    z-index: 1;
    opacity: 0.38;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: var(--kpi-hex-solid);
}

.portal-kpi-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    margin-top: 0;
    margin-bottom: 0.95rem;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    background: var(--kpi-accent-soft);
    color: var(--kpi-accent);
    line-height: 1.2;
}

.portal-kpi-trend.up {
    color: var(--kpi-accent);
    background: var(--kpi-accent-soft);
}

.portal-kpi-trend.down {
    color: #e11d48;
    background: #fff1f2;
}

.portal-kpi-card__foot {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-top: auto;
    padding-top: 0.85rem;
    border-top: 1px solid #eef2f7;
}

.portal-kpi-card__foot-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 10px;
    background: var(--kpi-accent-soft);
    color: var(--kpi-accent);
    font-size: 0.95rem;
}

.portal-kpi-card__foot-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
}

.portal-kpi-card__foot-copy strong {
    font-size: 0.78rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.25;
}

.portal-kpi-card__foot-copy em {
    font-style: normal;
    font-size: 0.68rem;
    font-weight: 500;
    color: #94a3b8;
    line-height: 1.3;
}

/* Panel */
.portal-panel {
    background: #fff;
    border: 1px solid #e4ecf5;
    border-radius: 18px;
    padding: 1.35rem 1.4rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 2px 12px rgba(10, 47, 122, 0.05);
}

.portal-panel-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0a2f7a;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Module cards (Admin dashboard) */
.portal-placeholder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.portal-placeholder-card {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    padding: 1.4rem 1.25rem;
    text-decoration: none;
    display: block;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.portal-placeholder-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(10, 47, 122, 0.14);
    text-decoration: none;
}

.portal-placeholder-card::before {
    content: "";
    position: absolute;
    top: -22px;
    right: -22px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    opacity: 0.18;
    pointer-events: none;
}

/* Card color variants */
.portal-placeholder-card:nth-child(1) {
    background: linear-gradient(140deg, #eff6ff 0%, #dbeafe 60%, #bfdbfe 100%);
    border: 1px solid #93c5fd;
}
.portal-placeholder-card:nth-child(1)::before { background: #1d4ed8; }

.portal-placeholder-card:nth-child(2) {
    background: linear-gradient(140deg, #f0fdf4 0%, #dcfce7 60%, #bbf7d0 100%);
    border: 1px solid #86efac;
}
.portal-placeholder-card:nth-child(2)::before { background: #16a34a; }

.portal-placeholder-card:nth-child(3) {
    background: linear-gradient(140deg, #fefce8 0%, #fef9c3 60%, #fde68a 100%);
    border: 1px solid #fde047;
}
.portal-placeholder-card:nth-child(3)::before { background: #ca8a04; }

.portal-placeholder-card:nth-child(4) {
    background: linear-gradient(140deg, #fdf4ff 0%, #fae8ff 60%, #f5d0fe 100%);
    border: 1px solid #d946ef;
    border-color: #e879f9;
}
.portal-placeholder-card:nth-child(4)::before { background: #a21caf; }

.portal-placeholder-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.35rem;
}

.portal-placeholder-card p {
    margin: 0;
    font-size: 0.82rem;
    color: #475569;
    line-height: 1.4;
}

.portal-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #fff;
    border: 1px solid #d9e2ee;
    border-radius: 12px;
}

.portal-filter-bar .form-select,
.portal-filter-bar .form-control {
    max-width: 160px;
}

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

.portal-split-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
    gap: 1rem;
    align-items: start;
}

.portal-panel-table {
    margin-bottom: 0;
}

.portal-table th {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #607089;
    white-space: nowrap;
}

.portal-table td {
    font-size: 0.86rem;
    vertical-align: middle;
}

.portal-status {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.portal-status-success { background: #e8f8ee; color: #1f8f4e; }
.portal-status-info { background: #e8f0ff; color: #2563eb; }
.portal-status-danger { background: #fdecec; color: #c24141; }
.portal-status-warning { background: #fff4d6; color: #9a6700; }
.portal-status-muted { background: #eef2f7; color: #5f6f84; }

.portal-workflow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 1rem;
    padding: 0.85rem;
    background: #fff;
    border: 1px solid #d9e2ee;
    border-radius: 12px;
}

.portal-workflow-step {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    background: #f3f6fb;
    font-size: 0.8rem;
    color: #5f6f84;
}

.portal-workflow-step.active {
    background: #e8f0ff;
    color: #0a2f7a;
    font-weight: 600;
}

.portal-workflow-step.complete {
    background: #e8f8ee;
    color: #1f8f4e;
}

.portal-workflow-index {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.06);
    font-size: 0.72rem;
    font-weight: 700;
}

.portal-workflow-arrow {
    color: #9aa8bc;
    font-size: 0.9rem;
}

.portal-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.55rem;
}

.portal-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid #c5d4e8;
    border-radius: 10px;
    background: #fff;
    color: #0a2f7a;
    font-size: 0.8rem;
    font-weight: 600;
}

.portal-case-detail {
    background: #fff;
    border: 1px solid #d9e2ee;
    border-radius: 14px;
    padding: 1rem;
}

.portal-case-detail-empty {
    display: grid;
    place-items: center;
    min-height: 220px;
    color: #607089;
}

.portal-case-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.portal-case-id {
    font-family: ui-monospace, monospace;
    font-size: 0.82rem;
    color: #0a2f7a;
    font-weight: 700;
}

.portal-case-detail-list {
    display: grid;
    gap: 0.45rem;
    margin: 0 0 0.75rem;
}

.portal-case-detail-list div {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 0.5rem;
    font-size: 0.84rem;
}

.portal-case-detail-list dt {
    margin: 0;
    color: #607089;
}

.portal-case-detail-list dd {
    margin: 0;
    color: #1f2f45;
}

.portal-case-description {
    font-size: 0.86rem;
    color: #4a5c72;
    margin-bottom: 0.85rem;
}

.portal-case-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.portal-ai-panel {
    padding: 0.75rem;
    border-radius: 10px;
    background: #edf9f0;
    border: 1px solid #c9ebd2;
}

.portal-ai-panel h4 {
    font-size: 0.88rem;
    color: #1f7a3f;
    margin-bottom: 0.45rem;
}

.portal-ai-panel ul {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.8rem;
    color: #2d4a38;
}

.portal-bar-chart {
    display: grid;
    gap: 0.55rem;
}

.portal-bar-row {
    display: grid;
    grid-template-columns: 90px 1fr 36px;
    gap: 0.55rem;
    align-items: center;
    font-size: 0.82rem;
}

.portal-bar-track {
    height: 10px;
    background: #edf2f8;
    border-radius: 999px;
    overflow: hidden;
}

.portal-bar-fill {
    height: 100%;
    background: #f5a524;
    border-radius: 999px;
}

.portal-bar-fill-primary {
    background: #3b82f6;
}

.portal-donut-legend {
    display: grid;
    gap: 0.45rem;
    margin-bottom: 0.75rem;
}

.portal-donut-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.84rem;
}

.portal-donut-row strong {
    margin-left: auto;
}

.portal-donut-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.portal-donut-visual {
    display: flex;
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
}

.portal-donut-slice {
    flex: var(--pct);
    background: var(--color);
}

.portal-sla-bar {
    height: 8px;
    background: #edf2f8;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 0.2rem;
}

.portal-sla-fill {
    height: 100%;
    border-radius: 999px;
}

.portal-sla-fill.sla-good { background: #1f8f4e; }
.portal-sla-fill.sla-warn { background: #f5a524; }
.portal-sla-fill.sla-bad { background: #e5484d; }

.portal-insight-list {
    padding-left: 1.1rem;
    font-size: 0.88rem;
    color: #4a5c72;
}

.portal-insight-list li + li {
    margin-top: 0.45rem;
}

.portal-alert-warning {
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    background: #fff4d6;
    color: #8a5b00;
    font-size: 0.84rem;
}

.portal-line-chart-mock {
    min-height: 140px;
}

.portal-line-chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 0.35rem;
    height: 120px;
}

.portal-line-bar {
    flex: 1;
    background: linear-gradient(180deg, #6ea8ff 0%, #0a2f7a 100%);
    border-radius: 4px 4px 0 0;
    min-height: 8px;
}

.portal-map-mock {
    min-height: 180px;
    display: grid;
    place-items: center;
    border: 1px dashed #c5d2e3;
    border-radius: 10px;
    background: linear-gradient(135deg, #f0f6ff 0%, #e8f8ee 100%);
    color: #607089;
    font-size: 0.9rem;
}

@media (max-width: 1100px) {
    .portal-grid-2,
    .portal-split-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 960px) {
    .portal-page {
        flex-direction: column;
    }

    .portal-sidebar {
        width: 100%;
        max-height: none;
    }
}
.portal-nav {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 1.1rem 0.9rem 1rem;
    gap: 0.65rem;
}

.portal-nav-bottom {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.portal-nav-brand {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0.15rem 0.2rem 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    text-decoration: none;
    color: inherit;
}

.portal-nav-brand-logo {
    width: auto;
    height: 62px;
    max-width: 100%;
    display: block;
    flex-shrink: 0;
    object-fit: contain;
}

/* Dashboard analytics */
.portal-analytics-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: 1rem;
    margin-bottom: 1.25rem;
    align-items: start;
}

.portal-analytics-grid--map-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 1rem;
}

.portal-analytics-grid--map-actions > .portal-dash-widget[data-widget="map"] {
    flex: 1.75 1 0;
    min-width: min(100%, 420px);
}

.portal-analytics-grid--map-actions > .portal-dash-widget[data-widget="quick-actions"] {
    flex: 0.55 1 280px;
    min-width: min(100%, 280px);
    max-width: 360px;
}

.portal-analytics-grid--map-actions.is-qa-closed > .portal-dash-widget[data-widget="map"] {
    flex: 1 1 100%;
    max-width: none;
}

.portal-analytics-grid--map-actions.is-qa-closed > .portal-dash-widget[data-widget="quick-actions"] {
    display: none;
}

.portal-dash-widget {
    position: relative;
}

.portal-dash-widget-handle {
    position: absolute;
    top: 0.7rem;
    left: 0.55rem;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 8px;
    color: #64748b;
    background: rgba(248, 250, 252, 0.95);
    border: 1px solid #e2e8f0;
    cursor: grab;
    pointer-events: none;
}

body.portal-dash-edit-mode .portal-dash-widget-handle {
    display: inline-flex;
    pointer-events: auto;
}

body.portal-dash-edit-mode .portal-dash-map-panel,
body.portal-dash-edit-mode .portal-quick-actions-panel {
    padding-left: 2.15rem;
}

body.portal-dash-edit-mode .portal-dash-widget {
    cursor: grab;
    outline: 2px dashed rgba(37, 99, 235, 0.35);
    outline-offset: 2px;
    transition: box-shadow 0.18s ease, transform 0.18s ease, outline-color 0.18s ease;
}

body.portal-dash-edit-mode .portal-dash-widget.is-dragging {
    opacity: 0.55;
    cursor: grabbing;
}

body.portal-dash-edit-mode .portal-dash-widget.is-drag-over {
    outline-color: #2563eb;
    box-shadow: 0 18px 42px rgba(37, 99, 235, 0.22), 0 8px 18px rgba(15, 23, 42, 0.12);
    transform: translateY(-2px);
}

.portal-dash-drag-ghost {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.92;
    border-radius: 16px;
    box-shadow: 0 22px 48px rgba(15, 23, 42, 0.28), 0 8px 16px rgba(37, 99, 235, 0.18);
    transform: rotate(1.5deg) scale(1.02);
    background: #fff;
    border: 1px solid #dbe3ef;
}

.portal-dash-save-btn,
.portal-dash-cancel-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.42rem 0.9rem;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.portal-dash-save-btn {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.28);
}

.portal-dash-save-btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

.portal-dash-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 999px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.42rem 0.9rem;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.portal-dash-more-btn:hover {
    background: #dbeafe;
}

.portal-kpi-sortable.is-kpi-off,
.portal-kpi-sortable[hidden] {
    display: none !important;
}

.portal-dash-cards-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    background: rgba(15, 23, 42, 0.45);
}

.portal-dash-cards-modal[hidden] {
    display: none !important;
}

.portal-dash-cards-modal__dialog {
    width: min(560px, 100%);
    max-height: min(84vh, 720px);
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 28px 64px rgba(15, 23, 42, 0.28);
    overflow: hidden;
}

.portal-dash-cards-modal__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.2rem 0.85rem;
    border-bottom: 1px solid #e2e8f0;
}

.portal-dash-cards-modal__head h2 {
    margin: 0 0 0.25rem;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
}

.portal-dash-cards-modal__head p {
    margin: 0;
    font-size: 0.8rem;
    color: #64748b;
}

.portal-dash-cards-modal__close {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    cursor: pointer;
}

.portal-dash-cards-modal__body {
    padding: 0.85rem 1.1rem;
    overflow: auto;
    display: grid;
    gap: 0.55rem;
}

.portal-dash-cards-modal__divider {
    margin: 0.35rem 0 0.15rem;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
}

.portal-dash-card-pick--panel {
    background: #fff7ed;
    border-color: #fed7aa;
}

.portal-dash-card-pick:hover {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.portal-dash-card-pick input {
    accent-color: #2563eb;
    width: 1.05rem;
    height: 1.05rem;
}

.portal-dash-card-pick__icon {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex: 0 0 auto;
}

.portal-dash-card-pick__icon.portal-kpi-card--blue { background: #4f46e5; }
.portal-dash-card-pick__icon.portal-kpi-card--green { background: #16a34a; }
.portal-dash-card-pick__icon.portal-kpi-card--amber { background: #d97706; }
.portal-dash-card-pick__icon.portal-kpi-card--rose { background: #db2777; }

.portal-dash-card-pick__copy {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.portal-dash-card-pick__copy strong {
    font-size: 0.86rem;
    color: #0f172a;
}

.portal-dash-card-pick__copy em {
    font-style: normal;
    font-size: 0.75rem;
    color: #64748b;
}

.portal-dash-cards-modal__foot {
    display: flex;
    justify-content: flex-end;
    gap: 0.55rem;
    padding: 0.85rem 1.1rem 1.05rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.portal-map-show-qa-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    border: 1px solid #bfdbfe;
    background: rgba(239, 246, 255, 0.95);
    color: #1d4ed8;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.35rem 0.7rem;
    cursor: pointer;
}

.portal-map-show-qa-btn:hover {
    background: #dbeafe;
}

.portal-quick-actions-title-row {
    position: relative;
    padding-right: 2rem;
}

.portal-quick-actions-close {
    position: absolute;
    top: 0;
    right: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.portal-quick-actions-close:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.portal-map-block {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.75rem;
}

.portal-map-block .portal-map-stage-slot {
    flex: 1 1 auto;
    min-width: 0;
}

.portal-map-block--filter-outside .portal-heat-filter {
    position: relative;
    top: auto;
    right: auto;
    z-index: 5;
    flex: 0 0 240px;
    width: 240px;
    max-width: 240px;
    align-self: flex-start;
    margin: 0;
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.portal-map-block--filter-outside {
    align-items: flex-start;
}

.portal-dash-map-panel .portal-dash-panel-head--map {
    position: relative;
    z-index: 40;
}

.portal-dash-map-panel .portal-map-block {
    position: relative;
    z-index: 1;
}

.portal-map-block--filter-inside {
    display: block;
}

.portal-map-block--filter-inside .portal-map-stage-slot {
    width: 100%;
}

.portal-map-block--filter-inside .portal-heat-filter {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 450;
    flex: none;
    width: 220px;
    max-width: 220px;
}

.portal-map-block--filter-hidden .portal-heat-filter {
    display: none !important;
}

.portal-map-filter-menu {
    position: relative;
    z-index: 50;
}

.portal-map-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 10px;
    border: 1px solid #dbe3ef;
    background: #fff;
    color: #475569;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.portal-map-menu-btn:hover,
.portal-map-menu-btn[aria-expanded="true"] {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

.portal-map-filter-menu-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 80;
    min-width: 210px;
    padding: 0.35rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #fff;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
}

.portal-map-filter-menu-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    padding: 0.55rem 0.65rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #334155;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.portal-map-filter-menu-item:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.portal-map-filter-menu-item.is-active {
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
}

.portal-map-filter-menu-item i {
    width: 1rem;
    text-align: center;
    opacity: 0.9;
}

.portal-map-filter-menu-divider {
    height: 1px;
    margin: 0.3rem 0.35rem;
    background: #e2e8f0;
}

button.portal-topbar-dropdown-item {
    width: 100%;
    background: transparent;
    border: 0;
    text-align: left;
    font: inherit;
}

.portal-dash-charts-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.portal-dash-charts-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.portal-quick-actions-panel {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
    min-height: 100%;
}

.portal-quick-actions-head {
    margin-bottom: 0.9rem;
}

.portal-quick-actions-title-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.portal-quick-actions-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.portal-quick-actions-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    flex: 1;
}

.portal-quick-action {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.72rem 0.8rem;
    border-radius: 12px;
    border: 1px solid #e8eef7;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.portal-quick-action:hover {
    border-color: #bfdbfe;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.08);
    transform: translateY(-1px);
    color: inherit;
}

.portal-quick-action__icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.portal-quick-action__icon--violet { background: rgba(139, 92, 246, 0.12); color: #7c3aed; }
.portal-quick-action__icon--rose { background: rgba(244, 63, 94, 0.12); color: #e11d48; }
.portal-quick-action__icon--blue { background: rgba(37, 99, 235, 0.12); color: #2563eb; }
.portal-quick-action__icon--amber { background: rgba(245, 158, 11, 0.14); color: #d97706; }
.portal-quick-action__icon--teal { background: rgba(20, 184, 166, 0.14); color: #0d9488; }
.portal-quick-action__icon--slate { background: rgba(100, 116, 139, 0.14); color: #475569; }

.portal-quick-action__copy {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.portal-quick-action__copy strong {
    font-size: 0.84rem;
    font-weight: 750;
    color: #0f172a;
    line-height: 1.25;
}

.portal-quick-action__copy em {
    font-style: normal;
    font-size: 0.72rem;
    color: #64748b;
    line-height: 1.3;
}

.portal-quick-action__meta {
    flex-shrink: 0;
    min-width: 1.4rem;
    height: 1.4rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 0.68rem;
    font-weight: 800;
    display: grid;
    place-items: center;
}

.portal-quick-action__chevron {
    color: #94a3b8;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.portal-dash-bottom {
    margin-bottom: 0.5rem;
}

.portal-dash-bottom-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
}

.portal-dash-section-title {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0a2f7a;
}

.portal-dash-section-title i {
    color: #2563eb;
}

.portal-dash-charts-bottom {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.portal-dash-chart-panel--trend {
    margin-bottom: 0;
}

.portal-dash-charts-row--bottom {
    margin-bottom: 0;
}

.portal-dash-charts-row--bottom > .portal-panel {
    margin-bottom: 0;
}

.portal-dash-map-panel,
.portal-dash-chart-panel {
    position: relative;
}

.portal-dash-chart-panel {
    overflow: hidden;
}

.portal-dash-map-panel {
    overflow: visible;
}

.portal-dash-map-panel::before,
.portal-dash-chart-panel::before {
    display: none;
}

.portal-dash-panel-head {
    margin-bottom: 0.85rem;
}

.portal-dash-panel-head--map {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.portal-dash-panel-head--chart {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.portal-trend-state-filter {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 11rem;
    flex-shrink: 0;
}

.portal-trend-state-filter > span {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
}

.portal-trend-state-select {
    appearance: none;
    width: 100%;
    padding: 0.45rem 2rem 0.45rem 0.7rem;
    border-radius: 10px;
    border: 1px solid #dbe3ef;
    background:
        #fff
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1.2 1.2 6 6l4.8-4.8'/%3E%3C/svg%3E")
        no-repeat right 0.7rem center;
    color: #0f172a;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.portal-trend-state-select:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.portal-dash-panel-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    font-size: 0.98rem;
    font-weight: 800;
    color: #0a2f7a;
}

.portal-dash-panel-title i {
    color: #2563eb;
}

.portal-dash-panel-sub {
    margin: 0.3rem 0 0;
    font-size: 0.78rem;
    color: #64748b;
}

.portal-map-type-control {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.28rem;
    position: relative;
    z-index: 45;
}

.portal-map-area-btn {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem 0.55rem;
    margin-top: 0;
    padding: 0.42rem 0.7rem;
    border-radius: 10px;
    border: 1px solid #bfdbfe;
    background: linear-gradient(145deg, #eff6ff 0%, #dbeafe 100%);
    color: #1e3a8a;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.portal-map-type-row .portal-map-area-btn {
    margin-top: 0;
}

.portal-map-area-btn:hover {
    border-color: #93c5fd;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.16);
    transform: translateY(-1px);
}

.portal-map-area-btn i {
    color: #2563eb;
    font-size: 0.85rem;
}

.portal-map-area-btn em {
    font-style: normal;
    font-weight: 600;
    font-size: 0.72rem;
    color: #475569;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid #e2e8f0;
}

.portal-map-area-modal {
    position: fixed;
    inset: 0;
    z-index: 2400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.portal-map-area-modal[hidden] {
    display: none !important;
}

.portal-map-area-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
}

.portal-map-area-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(520px, 100%);
    max-height: min(88vh, 640px);
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
    overflow: hidden;
}

.portal-map-area-modal__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.25rem 0.9rem;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
}

.portal-map-area-modal__head h2 {
    margin: 0;
    font-size: 1.05rem;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.portal-map-area-modal__head h2 i { color: #2563eb; }

.portal-map-area-modal__head p {
    margin: 0.35rem 0 0;
    font-size: 0.82rem;
    color: #64748b;
}

.portal-map-area-close {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    cursor: pointer;
}

.portal-map-area-close:hover {
    color: #0f172a;
    border-color: #cbd5e1;
}

.portal-map-area-modal__body {
    padding: 1.15rem 1.25rem;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.portal-map-area-field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin: 0;
    border: 0;
    padding: 0;
    min-width: 0;
}

.portal-map-area-field > span,
.portal-map-area-field > legend {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #64748b;
}

.portal-map-area-select {
    appearance: none;
    width: 100%;
    padding: 0.65rem 2.2rem 0.65rem 0.85rem;
    border-radius: 10px;
    border: 1px solid #dbe3ef;
    background:
        #fff
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1.2 1.2 6 6l4.8-4.8'/%3E%3C/svg%3E")
        no-repeat right 0.85rem center;
    color: #0f172a;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
}

.portal-map-area-select:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.portal-map-area-type-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.portal-map-area-type-card {
    display: flex;
    gap: 0.55rem;
    align-items: flex-start;
    padding: 0.75rem 0.8rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.portal-map-area-type-card:hover {
    border-color: #93c5fd;
    background: #f0f9ff;
}

.portal-map-area-type-card:has(input:checked) {
    border-color: #60a5fa;
    background: linear-gradient(145deg, #eff6ff 0%, #dbeafe 100%);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.12);
}

.portal-map-area-type-card input {
    margin-top: 0.2rem;
    accent-color: #2563eb;
}

.portal-map-area-type-card strong {
    display: block;
    font-size: 0.88rem;
    color: #0f172a;
}

.portal-map-area-type-card strong i {
    color: #2563eb;
    margin-right: 0.2rem;
}

.portal-map-area-type-card em {
    display: block;
    margin-top: 0.2rem;
    font-style: normal;
    font-size: 0.74rem;
    color: #64748b;
    line-height: 1.35;
}

.portal-map-area-modal__foot {
    display: flex;
    justify-content: flex-end;
    gap: 0.55rem;
    padding: 0.9rem 1.25rem 1.1rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.portal-map-type-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.portal-map-type-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
}

.portal-map-type-select {
    appearance: none;
    min-width: 148px;
    padding: 0.48rem 2rem 0.48rem 0.75rem;
    border-radius: 10px;
    border: 1px solid #dbe3ef;
    background:
        #fff
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1.2 1.2 6 6l4.8-4.8'/%3E%3C/svg%3E")
        no-repeat right 0.7rem center;
    color: #0f172a;
    font-size: 0.82rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    cursor: pointer;
}

.portal-map-type-select:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.portal-map-expand-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.48rem 0.75rem;
    border-radius: 10px;
    border: 1px solid #dbe3ef;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    color: #0a2f7a;
    font-size: 0.78rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.portal-map-help-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.48rem 0.75rem;
    border-radius: 10px;
    border: 1px solid #dbe3ef;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    color: #0369a1;
    font-size: 0.78rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.portal-map-help-btn:hover {
    border-color: #7dd3fc;
    box-shadow: 0 8px 18px rgba(14, 165, 233, 0.14);
    transform: translateY(-1px);
    color: #0284c7;
}

.portal-map-expand-btn:hover {
    border-color: #93c5fd;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.12);
    transform: translateY(-1px);
}

.portal-map-expand-btn i {
    font-size: 0.85rem;
}

.portal-map-stage-slot {
    position: relative;
    min-height: 480px;
}

.portal-map-stage-slot.is-expanded {
    min-height: 480px;
    border-radius: 16px;
    border: 1px dashed #cbd5e1;
    background:
        linear-gradient(135deg, rgba(248, 250, 252, 0.9), rgba(239, 246, 255, 0.85));
}

.portal-map-stage-slot.is-expanded::after {
    content: "Map open in full view";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: #64748b;
}

.portal-map-stage {
    position: relative;
}

.portal-dash-map {
    height: 480px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #dbe3ef;
    background: #d4e4f0;
    z-index: 1;
}

/* Slight crispness on Voyager tiles — keep heat/icons in other panes untouched */
.portal-dash-map .leaflet-tile-pane {
    filter: contrast(1.06) saturate(1.1);
}

.portal-dash-map .leaflet-interactive {
    cursor: pointer;
}

.portal-map-expand-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.portal-map-expand-modal[hidden] {
    display: none;
}

.portal-map-expand-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
}

.portal-map-expand-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(1280px, 100%);
    height: min(92vh, 900px);
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
}

.portal-map-expand-modal__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid #e8eef7;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.portal-map-expand-modal__head h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0a2f7a;
}

.portal-map-expand-modal__head p {
    margin: 0.25rem 0 0;
    font-size: 0.78rem;
    color: #64748b;
}

.portal-map-expand-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    display: grid;
    place-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

.portal-map-expand-close:hover {
    background: #f8fafc;
    color: #0f172a;
}

.portal-map-expand-modal__body {
    flex: 1;
    min-height: 0;
    padding: 0.85rem;
    background: #f8fafc;
}

.portal-map-expand-modal__body .portal-map-stage,
.portal-map-expand-modal__body .portal-dash-map {
    height: 100%;
}

.portal-map-expand-modal__body .portal-dash-map {
    border-radius: 14px;
}

.portal-heat-filter {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 450;
    width: 220px;
    padding: 0.85rem 0.9rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(10px);
}

.portal-heat-filter h3 {
    margin: 0 0 0.65rem;
    font-size: 0.78rem;
    font-weight: 800;
    color: #0f172a;
}

.portal-heat-filter-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 0.45rem;
    font-size: 0.74rem;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
}

.portal-heat-filter-item:last-child {
    margin-bottom: 0;
}

.portal-heat-filter-item input {
    accent-color: #2563eb;
}

.portal-heat-filter-item i {
    width: 1.15rem;
    text-align: center;
}

.portal-heat-filter-item .tone-road { color: #2563eb; }
.portal-heat-filter-item .tone-flood { color: #0d9488; }
.portal-heat-filter-item .tone-sanitation { color: #16a34a; }
.portal-heat-filter-item .tone-drainage { color: #7c3aed; }
.portal-heat-filter-item .tone-lighting { color: #ca8a04; }
.portal-heat-filter-item .tone-others { color: #64748b; }
.portal-heat-filter-item .tone-icons { color: #2563eb; }
.portal-heat-filter-item--icons {
    margin-top: 0.35rem;
    padding-top: 0.55rem;
    border-top: 1px solid #e8eef7;
}
.portal-heat-filter-item .tone-density-low { color: #16a34a; }
.portal-heat-filter-item .tone-density-mid { color: #ca8a04; }
.portal-heat-filter-item .tone-density-high { color: #dc2626; }
.portal-heat-filter-item .tone-density-normal { color: #ca8a04; }

.portal-heat-density-panel {
    margin-top: 0.75rem;
    padding-top: 0.65rem;
    border-top: 1px solid #e8eef7;
}

.portal-heat-density-panel > summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.74rem;
    font-weight: 800;
    color: #0f172a;
    user-select: none;
}

.portal-heat-density-panel > summary::-webkit-details-marker {
    display: none;
}

.portal-heat-density-panel > summary i {
    font-size: 0.75rem;
    color: #94a3b8;
    transition: transform 0.18s ease;
}

.portal-heat-density-panel[open] > summary i {
    transform: rotate(180deg);
}

.portal-heat-density-body {
    margin-top: 0.55rem;
}

.portal-heat-density-hint {
    margin: 0.35rem 0 0;
    font-size: 0.66rem;
    line-height: 1.35;
    color: #94a3b8;
    font-weight: 600;
}

html.portal-theme-dark body .portal-heat-density-panel {
    border-top-color: #334155;
}

html.portal-theme-dark body .portal-heat-filter-item--icons {
    border-top-color: #334155;
}

html.portal-theme-dark body .portal-heat-density-panel > summary {
    color: #f1f5f9;
}

.portal-density-legend {
    position: absolute;
    left: 14px;
    bottom: 14px;
    z-index: 450;
    min-width: 160px;
    padding: 0.7rem 0.8rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
}

.portal-density-legend strong {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.72rem;
    font-weight: 800;
    color: #0f172a;
}

.portal-density-bar {
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, #86efac 0%, #fde047 35%, #fb923c 65%, #ef4444 100%);
}

.portal-density-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.3rem;
    font-size: 0.68rem;
    font-weight: 600;
    color: #64748b;
}

.portal-map-zoom-rail {
    position: absolute;
    left: 14px;
    top: 14px;
    z-index: 450;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.4rem 0.5rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(10px);
}

.portal-map-zoom-step {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #334155;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 0.85rem;
}

.portal-map-zoom-step:hover {
    border-color: #93c5fd;
    color: #1d4ed8;
    background: #f8fbff;
}

.portal-map-zoom-track {
    width: 30px;
    height: 120px;
    display: grid;
    place-items: center;
}

.portal-map-zoom-slider {
    width: 120px;
    height: 28px;
    margin: 0;
    transform: rotate(-90deg);
    transform-origin: center;
    cursor: pointer;
    accent-color: #2563eb;
}

.portal-map-zoom-value {
    font-size: 0.65rem;
    font-weight: 800;
    color: #64748b;
    letter-spacing: 0.02em;
}

.portal-heat-pin {
    background: transparent !important;
    border: none !important;
    margin: 0 !important;
}

.portal-heat-pin span {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    margin: 0;
    border-radius: 50%;
    color: #fff;
    font-size: 0.68rem;
    box-shadow: 0 5px 12px rgba(15, 23, 42, 0.24);
    border: 1.5px solid #fff;
    box-sizing: border-box;
}

.portal-heat-pin--pot span { background: linear-gradient(145deg, #ef4444, #b91c1c); }
.portal-heat-pin--str span { background: linear-gradient(145deg, #fbbf24, #d97706); }
.portal-heat-pin--san span { background: linear-gradient(145deg, #34d399, #059669); }
.portal-heat-pin--utl span { background: linear-gradient(145deg, #60a5fa, #2563eb); }
.portal-heat-pin--drn span { background: linear-gradient(145deg, #a78bfa, #7c3aed); }
.portal-heat-pin--hotl span { background: linear-gradient(145deg, #f472b6, #db2777); }
.portal-heat-pin--fld span { background: linear-gradient(145deg, #2dd4bf, #0d9488); }

.portal-map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 0.75rem;
    font-size: 0.74rem;
    font-weight: 600;
    color: #64748b;
}

.portal-map-legend .dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.3rem;
    vertical-align: middle;
}

.portal-map-legend .dot-pot { background: #e31e24; }
.portal-map-legend .dot-str { background: #f59e0b; }
.portal-map-legend .dot-san { background: #22c55e; }
.portal-map-legend .dot-utl { background: #3b82f6; }
.portal-map-legend .dot-drn { background: #8b5cf6; }
.portal-map-legend .dot-hotl { background: #ec4899; }
.portal-map-legend .dot-fld { background: #0d9488; }

.portal-chart-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    flex-shrink: 0;
}

.portal-chart-pill--up {
    color: #15803d;
    background: rgba(34, 197, 94, 0.12);
}

.portal-chart-pill--down {
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.12);
}

.portal-dash-chart-panel--premium {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    box-shadow:
        0 10px 28px rgba(15, 23, 42, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.portal-map-tooltip.leaflet-tooltip {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin-top: -6px;
}

.portal-map-tooltip .portal-map-tip {
    min-width: 260px;
    max-width: 340px;
    padding: 0.85rem 0.95rem;
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.96) 100%);
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow:
        0 18px 40px rgba(10, 47, 122, 0.16),
        0 4px 12px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(12px);
    color: #0f172a;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    pointer-events: none;
}

.portal-map-tip-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
}

.portal-map-tip-head strong {
    font-size: 0.88rem;
    font-weight: 800;
    color: #0a2f7a;
    line-height: 1.25;
}

.portal-map-tip-total {
    flex-shrink: 0;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #0a2f7a 0%, #2563eb 100%);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.portal-map-tip-sub {
    margin: 0 0 0.65rem;
    font-size: 0.72rem;
    color: #64748b;
    line-height: 1.35;
}

.portal-map-tip-types {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.portal-map-tip-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 100%;
    padding: 0.3rem 0.55rem;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0;
    border: 1px solid transparent;
}

.portal-map-tip-chip__name {
    min-width: 0;
    white-space: nowrap;
}

.portal-map-tip-chip em {
    font-style: normal;
    font-variant-numeric: tabular-nums;
    opacity: 0.9;
    font-weight: 600;
}

.portal-map-tip-chip--pot { background: rgba(227, 30, 36, 0.1); color: #b91c1c; border-color: rgba(227, 30, 36, 0.2); }
.portal-map-tip-chip--str { background: rgba(245, 158, 11, 0.12); color: #b45309; border-color: rgba(245, 158, 11, 0.22); }
.portal-map-tip-chip--san { background: rgba(34, 197, 94, 0.12); color: #15803d; border-color: rgba(34, 197, 94, 0.22); }
.portal-map-tip-chip--utl { background: rgba(59, 130, 246, 0.12); color: #1d4ed8; border-color: rgba(59, 130, 246, 0.22); }
.portal-map-tip-chip--drn { background: rgba(139, 92, 246, 0.12); color: #6d28d9; border-color: rgba(139, 92, 246, 0.22); }
.portal-map-tip-chip--hotl { background: rgba(236, 72, 153, 0.12); color: #be185d; border-color: rgba(236, 72, 153, 0.22); }
.portal-map-tip-chip--fld { background: rgba(13, 148, 136, 0.12); color: #0f766e; border-color: rgba(13, 148, 136, 0.22); }

.portal-map-tip-foot {
    margin-top: 0.65rem;
    padding-top: 0.55rem;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
    font-size: 0.66rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.portal-map-tip-foot i {
    color: #2563eb;
    font-size: 0.75rem;
}

/* Hotspot detail modal */
.portal-hotspot-modal {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: grid;
    place-items: center;
    padding: 1.25rem;
}

.portal-hotspot-modal[hidden] {
    display: none !important;
}

.portal-hotspot-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 31, 82, 0.55);
    backdrop-filter: blur(4px);
}

.portal-hotspot-modal__dialog {
    position: relative;
    width: min(720px, 100%);
    max-height: min(88vh, 820px);
    overflow: auto;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow:
        0 28px 60px rgba(10, 47, 122, 0.22),
        0 8px 20px rgba(15, 23, 42, 0.1);
}

.portal-hs-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.35rem 1rem;
    border-bottom: 1px solid #e2e8f2;
    background: linear-gradient(135deg, rgba(10, 47, 122, 0.04) 0%, rgba(37, 99, 235, 0.06) 100%);
}

.portal-hs-modal-head h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: #0a2f7a;
    line-height: 1.25;
}

.portal-hs-modal-head p {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    color: #64748b;
}

.portal-hs-modal-id {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.45rem;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    background: rgba(227, 30, 36, 0.1);
    color: #b91c1c;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.portal-hs-modal-close {
    width: 36px;
    height: 36px;
    border: 1px solid #dbe3ef;
    border-radius: 10px;
    background: #fff;
    color: #475569;
    cursor: pointer;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    transition: background 0.14s ease, color 0.14s ease;
}

.portal-hs-modal-close:hover {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fecaca;
}

.portal-hs-modal-body {
    padding: 1.1rem 1.35rem 1.35rem;
}

.portal-hs-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.portal-hs-kpi {
    padding: 0.7rem 0.75rem;
    border-radius: 12px;
    border: 1px solid #e2e8f2;
    background: #fff;
}

.portal-hs-kpi span {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.portal-hs-kpi strong {
    display: block;
    margin-top: 0.2rem;
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
}

.portal-hs-kpi--danger strong { color: #dc2626; }
.portal-hs-kpi--warn strong { color: #d97706; }
.portal-hs-kpi--ok strong { color: #16a34a; }

.portal-hs-section {
    margin-bottom: 1rem;
}

.portal-hs-section h3 {
    margin: 0 0 0.55rem;
    font-size: 0.82rem;
    font-weight: 800;
    color: #0a2f7a;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.portal-hs-section h3 i {
    color: #2563eb;
}

.portal-hs-type-bars {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.portal-hs-type-row {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.74rem;
}

.portal-hs-type-row__meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}

.portal-hs-type-name {
    min-width: 0;
    font-size: 0.78rem;
    font-weight: 700;
    color: #334155;
    line-height: 1.25;
}

.portal-hs-type-name--pot { color: #b91c1c; }
.portal-hs-type-name--str { color: #b45309; }
.portal-hs-type-name--san { color: #15803d; }
.portal-hs-type-name--utl { color: #1d4ed8; }
.portal-hs-type-name--drn { color: #6d28d9; }
.portal-hs-type-name--hotl { color: #be185d; }
.portal-hs-type-name--fld { color: #0f766e; }

.portal-hs-type-track {
    height: 8px;
    border-radius: 999px;
    background: #e8eef7;
    overflow: hidden;
}

.portal-hs-type-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #e31e24 0%, #ff6b6b 100%);
}

.portal-hs-type-row strong {
    flex-shrink: 0;
    text-align: right;
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    color: #0f172a;
}

.portal-hs-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.portal-hs-info-list {
    margin: 0;
    padding: 0;
    list-style: none;
    border: 1px solid #e2e8f2;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.portal-hs-info-list li {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0.75rem;
    font-size: 0.76rem;
    border-bottom: 1px solid #eef2f7;
}

.portal-hs-info-list li:last-child {
    border-bottom: none;
}

.portal-hs-info-list span {
    color: #64748b;
}

.portal-hs-info-list strong {
    color: #0f172a;
    text-align: right;
}

.portal-hs-cases-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.74rem;
    background: #fff;
    border: 1px solid #e2e8f2;
    border-radius: 12px;
    overflow: hidden;
}

.portal-hs-cases-table th,
.portal-hs-cases-table td {
    padding: 0.55rem 0.65rem;
    text-align: left;
    border-bottom: 1px solid #eef2f7;
}

.portal-hs-cases-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.portal-hs-cases-table tr:last-child td {
    border-bottom: none;
}

.portal-hs-pill {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    font-size: 0.64rem;
    font-weight: 700;
}

.portal-hs-pill--open { background: #dbeafe; color: #1d4ed8; }
.portal-hs-pill--progress { background: #fef3c7; color: #b45309; }
.portal-hs-pill--escalated { background: #fee2e2; color: #b91c1c; }
.portal-hs-pill--resolved { background: #dcfce7; color: #15803d; }

.portal-hs-modal-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.95rem 1.35rem 1.2rem;
    border-top: 1px solid #e2e8f2;
    background: #f8fafc;
}

.portal-hs-modal-foot p {
    margin: 0;
    font-size: 0.72rem;
    color: #64748b;
}

.portal-hs-modal-actions {
    display: flex;
    gap: 0.5rem;
}

.portal-hs-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.85rem;
    border-radius: 10px;
    font-size: 0.76rem;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
}

.portal-hs-btn--primary {
    background: linear-gradient(135deg, #0a2f7a 0%, #2563eb 100%);
    color: #fff;
}

.portal-hs-btn--ghost {
    background: #fff;
    color: #475569;
    border-color: #dbe3ef;
}

@media (max-width: 640px) {
    .portal-hs-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .portal-hs-two-col {
        grid-template-columns: 1fr;
    }
}

.portal-chart-wrap {
    position: relative;
    width: 100%;
    z-index: 1;
}

.portal-chart-wrap--line { height: 240px; }
.portal-chart-wrap--line-wide { height: 260px; }
.portal-chart-wrap--bar { height: 220px; }
.portal-chart-wrap--bar-premium { height: 300px; }
.portal-chart-wrap--pie { height: 240px; }
.portal-chart-wrap--pie-premium {
    height: auto;
    min-height: 300px;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(11rem, 0.95fr);
    align-items: center;
    gap: 0.85rem 1.1rem;
}

.portal-pie-stage {
    position: relative;
    width: 100%;
    height: 260px;
}

.portal-pie-stage canvas {
    filter: drop-shadow(0 14px 22px rgba(10, 47, 122, 0.18));
}

.portal-chart-center {
    position: absolute;
    inset: 18% 18%;
    display: grid;
    place-content: center;
    text-align: center;
    pointer-events: none;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 252, 0.92) 70%, rgba(241, 245, 249, 0.88) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        inset 0 -8px 18px rgba(15, 23, 42, 0.04),
        0 8px 20px rgba(15, 23, 42, 0.06);
}

.portal-chart-center strong {
    display: block;
    font-size: 1.55rem;
    font-weight: 800;
    color: #0a2f7a;
    line-height: 1;
    letter-spacing: -0.02em;
}

.portal-chart-center span {
    display: block;
    margin-top: 0.28rem;
    font-size: 0.68rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.portal-chart-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(37, 99, 235, 0.16);
    background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
    color: #1e40af;
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
}

.portal-chart-meta i {
    font-size: 0.78rem;
    opacity: 0.85;
}

.portal-pie-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.portal-pie-legend__item {
    display: grid;
    grid-template-columns: 0.55rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.65rem;
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.04);
}

.portal-pie-legend__swatch {
    width: 0.55rem;
    height: 1.55rem;
    border-radius: 999px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.portal-pie-legend__copy {
    min-width: 0;
}

.portal-pie-legend__copy strong {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.portal-pie-legend__copy span {
    display: block;
    margin-top: 0.12rem;
    font-size: 0.68rem;
    font-weight: 600;
    color: #64748b;
}

.portal-pie-legend__value {
    font-size: 0.82rem;
    font-weight: 800;
    color: #0a2f7a;
    letter-spacing: -0.01em;
}

.portal-dash-chart-panel--bar,
.portal-dash-chart-panel--pie {
    background:
        radial-gradient(120% 80% at 100% 0%, rgba(37, 99, 235, 0.06) 0%, transparent 55%),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.portal-chart-wrap--bar-premium canvas {
    filter: none;
}

@media (max-width: 900px) {
    .portal-chart-wrap--pie-premium {
        grid-template-columns: 1fr;
    }

    .portal-pie-stage {
        height: 240px;
        max-width: 280px;
        margin: 0 auto;
    }

    .portal-pie-legend {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 560px) {
    .portal-pie-legend {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1100px) {
    .portal-analytics-grid,
    .portal-analytics-grid--map-actions {
        flex-direction: column;
    }

    .portal-analytics-grid--map-actions > .portal-dash-widget[data-widget="map"],
    .portal-analytics-grid--map-actions > .portal-dash-widget[data-widget="quick-actions"] {
        flex: 1 1 auto;
        max-width: none;
        min-width: 0;
    }

    .portal-quick-actions-panel {
        min-height: 0;
    }

    .portal-map-block,
    .portal-map-block--filter-outside {
        flex-direction: column;
    }

    .portal-map-block--filter-outside .portal-heat-filter {
        flex: 1 1 auto;
        width: 100%;
        max-width: none;
        order: 2;
    }

    .portal-map-block--filter-outside .portal-map-stage-slot {
        order: 1;
        width: 100%;
    }
}

@media (max-width: 700px) {
    .portal-dash-charts-row {
        grid-template-columns: 1fr;
    }

    .portal-dash-map,
    .portal-map-stage-slot,
    .portal-map-stage-slot.is-expanded {
        height: auto;
        min-height: 320px;
    }

    .portal-dash-map {
        height: 320px;
    }

    .portal-map-expand-btn span {
        display: none;
    }

    .portal-heat-filter {
        position: static;
        width: auto;
        margin-top: 0;
    }

    .portal-map-block--filter-outside .portal-heat-filter {
        width: 100%;
        max-width: none;
    }

    .portal-density-legend {
        left: 10px;
        bottom: 10px;
        min-width: 132px;
    }
}

.portal-nav-profile {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding: 0.65rem 0.55rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
}

.portal-nav-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: #003399;
    background: linear-gradient(180deg, #ffffff 0%, #dbe7ff 100%);
    flex-shrink: 0;
}

.portal-nav-profile-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.portal-nav-profile-text strong {
    font-size: 0.88rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portal-nav-profile-text span {
    font-size: 0.72rem;
    opacity: 0.88;
}

.portal-nav-zone {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.portal-nav-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #8dffb0;
    font-weight: 600;
}

.portal-nav-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #3ddc84;
    box-shadow: 0 0 0 3px rgba(61, 220, 132, 0.2);
}

.portal-nav-section-label {
    padding: 0 0.55rem;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.72;
}

.portal-nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-height: 0;
    padding-right: 0.15rem;
}

.portal-nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.58rem 0.7rem;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.portal-nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.portal-nav-link.active {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    box-shadow: inset 3px 0 0 #6ea8ff;
}

.portal-nav-link-label {
    flex: 1;
    min-width: 0;
}

.portal-nav-icon {
    width: 1.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0.88;
}

.portal-nav-icon i {
    font-size: 1.05rem;
    line-height: 1;
}

.portal-nav-link.active .portal-nav-icon {
    opacity: 1;
}

.portal-nav-group {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.portal-nav-group-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: left;
    font: inherit;
}

.portal-nav-group-chevron {
    font-size: 0.72rem;
    opacity: 0.72;
    transition: transform 0.18s ease;
}

.portal-nav-group.is-open .portal-nav-group-chevron {
    transform: rotate(180deg);
}

.portal-nav-sub {
    display: none;
    flex-direction: column;
    gap: 0.1rem;
    margin: 0.05rem 0 0.2rem;
    padding-left: 0.35rem;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.portal-nav-group.is-open .portal-nav-sub {
    display: flex;
}

.portal-nav-sublink {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.48rem 0.65rem 0.48rem 0.8rem;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.portal-nav-sublink:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.portal-nav-sublink.active {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    box-shadow: inset 2px 0 0 #6ea8ff;
}

.portal-nav-sublink .portal-nav-icon {
    width: 1rem;
    opacity: 0.82;
}

.portal-nav-sublink .portal-nav-icon i {
    font-size: 0.92rem;
}

.portal-nav-badge {
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
}

.portal-nav-badge-danger {
    background: #e5484d;
    color: #fff;
}

.portal-nav-badge-warning {
    background: #f5a524;
    color: #1a1a1a;
}

.portal-nav-badge-primary {
    background: #4f8cff;
    color: #fff;
}

.portal-nav-summary,
.portal-nav-footer {
    padding: 0.8rem 0.75rem;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.portal-nav-summary h3,
.portal-nav-footer strong {
    font-size: 0.78rem;
    margin: 0 0 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
}

.portal-nav-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.76rem;
    padding: 0.18rem 0;
}

.portal-nav-summary-row strong {
    font-size: 0.8rem;
}

.portal-nav-summary-action {
    display: inline-block;
    margin-top: 0.55rem;
    font-size: 0.74rem;
    color: #b8d4ff;
    text-decoration: none;
}

.portal-nav-summary-action:hover {
    color: #fff;
    text-decoration: underline;
}

.portal-nav-footer p {
    margin: 0;
    font-size: 0.74rem;
    line-height: 1.45;
    opacity: 0.9;
}

.portal-nav-logout {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.58rem 0.7rem;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.86rem;
    font-weight: 500;
    text-align: left;
}

.portal-nav-logout:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}


.portal-login-body {
    margin: 0;
    font-family: "Segoe UI", "Inter", system-ui, sans-serif;
    color: #e8eef7;
    background: #000814;
    min-height: 100vh;
    min-height: 100dvh;
}

.portal-login-page {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}

.portal-login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background-color: #000814;
    pointer-events: none;
}

.portal-login-bg img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Keep flag at top-right fully visible (avoid top crop) */
    object-position: center top;
}

.portal-login-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 55% 45% at 50% 40%, rgba(0, 8, 20, 0.06) 0%, transparent 72%),
        linear-gradient(180deg, rgba(0, 8, 20, 0) 0%, rgba(0, 8, 20, 0.22) 100%);
    pointer-events: none;
}

.portal-login-network {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    opacity: 0.72;
}

.portal-login-network-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.portal-login-left {
    display: none;
}

.portal-login-logo-corner {
    position: fixed;
    top: 1.25rem;
    left: 1.5rem;
    z-index: 5;
    line-height: 0;
    text-decoration: none;
}

.portal-login-logo-corner img {
    display: block;
    width: min(200px, 42vw);
    height: auto;
    filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.45));
}

.portal-login-bottom-strip {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4;
    padding:
        0.85rem 1rem
        calc(1rem + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(
        180deg,
        rgba(0, 8, 20, 0) 0%,
        rgba(0, 8, 20, 0.55) 40%,
        rgba(0, 8, 20, 0.85) 100%
    );
    pointer-events: none;
}

.portal-login-badge-row {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.65rem;
    max-width: 1280px;
    margin: 0 auto;
    pointer-events: auto;
}

.portal-login-badge {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-height: 96px;
    padding: 1rem 0.9rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(8, 16, 36, 0.72);
    backdrop-filter: blur(16px) saturate(1.15);
    -webkit-backdrop-filter: blur(16px) saturate(1.15);
    box-shadow:
        0 8px 22px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    cursor: default;
    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease,
        border-color 0.22s ease,
        background 0.22s ease;
}

.portal-login-badge:hover {
    transform: translateY(-4px);
    background: rgba(12, 24, 48, 0.88);
}

.portal-login-badge i {
    font-size: 1.45rem;
    line-height: 1;
    flex-shrink: 0;
    transition: filter 0.22s ease, transform 0.22s ease;
}

.portal-login-badge:hover i {
    transform: scale(1.08);
}

.portal-login-badge-text {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    min-width: 0;
}

.portal-login-badge-text strong {
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.01em;
}

.portal-login-badge-text span {
    font-size: 0.68rem;
    font-weight: 500;
    line-height: 1.4;
    color: rgba(203, 213, 225, 0.88);
}

.portal-login-badge--citizen {
    border-color: rgba(34, 197, 94, 0.55);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35), 0 0 18px rgba(34, 197, 94, 0.12);
}
.portal-login-badge--citizen i,
.portal-login-badge--citizen strong { color: #4ade80; }
.portal-login-badge--citizen:hover {
    border-color: rgba(74, 222, 128, 0.95);
    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.4),
        0 0 28px rgba(34, 197, 94, 0.45),
        0 0 48px rgba(34, 197, 94, 0.22),
        inset 0 0 20px rgba(34, 197, 94, 0.08);
}
.portal-login-badge--citizen:hover i {
    filter: drop-shadow(0 0 8px rgba(74, 222, 128, 0.85));
}

.portal-login-badge--governance {
    border-color: rgba(59, 130, 246, 0.55);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35), 0 0 18px rgba(59, 130, 246, 0.12);
}
.portal-login-badge--governance i,
.portal-login-badge--governance strong { color: #60a5fa; }
.portal-login-badge--governance:hover {
    border-color: rgba(96, 165, 250, 0.95);
    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.4),
        0 0 28px rgba(59, 130, 246, 0.45),
        0 0 48px rgba(59, 130, 246, 0.22),
        inset 0 0 20px rgba(59, 130, 246, 0.08);
}
.portal-login-badge--governance:hover i {
    filter: drop-shadow(0 0 8px rgba(96, 165, 250, 0.85));
}

.portal-login-badge--ai {
    border-color: rgba(168, 85, 247, 0.55);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35), 0 0 18px rgba(168, 85, 247, 0.12);
}
.portal-login-badge--ai i,
.portal-login-badge--ai strong { color: #c084fc; }
.portal-login-badge--ai:hover {
    border-color: rgba(192, 132, 252, 0.95);
    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.4),
        0 0 28px rgba(168, 85, 247, 0.45),
        0 0 48px rgba(168, 85, 247, 0.22),
        inset 0 0 20px rgba(168, 85, 247, 0.08);
}
.portal-login-badge--ai:hover i {
    filter: drop-shadow(0 0 8px rgba(192, 132, 252, 0.85));
}

.portal-login-badge--monitor {
    border-color: rgba(45, 212, 191, 0.55);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35), 0 0 18px rgba(45, 212, 191, 0.12);
}
.portal-login-badge--monitor i,
.portal-login-badge--monitor strong { color: #2dd4bf; }
.portal-login-badge--monitor:hover {
    border-color: rgba(45, 212, 191, 0.95);
    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.4),
        0 0 28px rgba(45, 212, 191, 0.45),
        0 0 48px rgba(45, 212, 191, 0.22),
        inset 0 0 20px rgba(45, 212, 191, 0.08);
}
.portal-login-badge--monitor:hover i {
    filter: drop-shadow(0 0 8px rgba(45, 212, 191, 0.85));
}

.portal-login-badge--cases {
    border-color: rgba(96, 165, 250, 0.55);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35), 0 0 18px rgba(37, 99, 235, 0.14);
}
.portal-login-badge--cases i,
.portal-login-badge--cases strong { color: #93c5fd; }
.portal-login-badge--cases:hover {
    border-color: rgba(147, 197, 253, 0.95);
    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.4),
        0 0 28px rgba(59, 130, 246, 0.4),
        0 0 48px rgba(37, 99, 235, 0.22),
        inset 0 0 20px rgba(59, 130, 246, 0.08);
}
.portal-login-badge--cases:hover i {
    filter: drop-shadow(0 0 8px rgba(147, 197, 253, 0.85));
}

.portal-login-badge--dashboard {
    border-color: rgba(251, 146, 60, 0.55);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35), 0 0 18px rgba(251, 146, 60, 0.12);
}
.portal-login-badge--dashboard i,
.portal-login-badge--dashboard strong { color: #fb923c; }
.portal-login-badge--dashboard:hover {
    border-color: rgba(251, 146, 60, 0.95);
    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.4),
        0 0 28px rgba(251, 146, 60, 0.45),
        0 0 48px rgba(251, 146, 60, 0.22),
        inset 0 0 20px rgba(251, 146, 60, 0.08);
}
.portal-login-badge--dashboard:hover i {
    filter: drop-shadow(0 0 8px rgba(251, 146, 60, 0.85));
}

@media (prefers-reduced-motion: reduce) {
    .portal-login-badge,
    .portal-login-badge i {
        transition: none;
    }

    .portal-login-badge:hover {
        transform: none;
    }

    .portal-login-badge:hover i {
        transform: none;
    }
}

.portal-login-main {
    position: fixed;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1.5rem calc(9.25rem + env(safe-area-inset-bottom, 0px));
    pointer-events: none;
}

.portal-login-card-shell {
    position: relative;
    isolation: isolate;
    pointer-events: auto;
    width: 100%;
    max-width: 368px;
    padding: 0;
    border-radius: 26px;
    transform: scale(0.86) translateZ(0);
    transform-origin: center center;
    background: transparent;
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.38);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.portal-login-card-shell::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(
        148deg,
        rgba(56, 212, 255, 0.95) 0%,
        rgba(129, 140, 248, 0.88) 16%,
        rgba(192, 132, 252, 0.9) 28%,
        rgba(244, 63, 94, 0.92) 46%,
        rgba(251, 146, 60, 0.9) 62%,
        rgba(248, 113, 113, 0.88) 78%,
        rgba(96, 165, 250, 0.92) 92%,
        rgba(56, 212, 255, 0.95) 100%
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 2;
}

.portal-login-card-shell::before {
    content: "";
    position: absolute;
    inset: -16px -20px;
    border-radius: 40px;
    background: linear-gradient(
        145deg,
        rgba(34, 211, 238, 0.5) 0%,
        rgba(129, 140, 248, 0.32) 20%,
        rgba(192, 132, 252, 0.28) 35%,
        rgba(239, 68, 68, 0.38) 52%,
        rgba(249, 115, 22, 0.32) 70%,
        rgba(59, 130, 246, 0.36) 90%
    );
    filter: blur(28px);
    opacity: 0.78;
    z-index: -1;
    pointer-events: none;
}

.portal-login-card {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding: 1.45rem 1.35rem 1.2rem;
    border-radius: 26px;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    background:
        linear-gradient(
            180deg,
            rgba(210, 220, 240, 0.08) 0%,
            rgba(210, 220, 240, 0.02) 16%,
            transparent 32%
        ),
        linear-gradient(
            180deg,
            #222a3c 0%,
            #1c2434 45%,
            #182030 78%,
            #161e2c 100%
        );
    border: 0;
    box-shadow:
        inset 0 1px 0 rgba(190, 205, 230, 0.14),
        inset 0 -12px 28px rgba(0, 0, 0, 0.18);
}

.portal-login-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        165deg,
        rgba(160, 185, 220, 0.06) 0%,
        transparent 50%,
        rgba(30, 40, 58, 0.12) 100%
    );
    pointer-events: none;
}

.portal-login-card > * {
    position: relative;
    z-index: 1;
}

.portal-login-card-crest {
    display: flex;
    justify-content: center;
    margin-bottom: 0.6rem;
}

.portal-login-card-crest img {
    width: min(168px, 78%);
    height: auto;
    max-height: 48px;
    object-fit: contain;
}

.portal-login-title {
    margin: 0 0 0.6rem;
    text-align: center;
    font-size: calc(1.36rem + 2px);
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.portal-login-title-rule {
    width: 3rem;
    height: 2px;
    margin: 0 auto 0.9rem;
    border-radius: 999px;
    background: linear-gradient(90deg, #ef4444 0%, #ef4444 50%, #38bdf8 50%, #38bdf8 100%);
}

.portal-login-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin-bottom: 0.7rem;
    padding: 0.55rem 0.75rem;
    border-radius: 12px;
    font-size: calc(0.84rem + 2px);
    line-height: 1.45;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
    animation: portal-login-notice-in 0.28s ease-out;
}

.portal-login-notice.is-hidden {
    display: none;
}

.portal-login-notice i {
    flex-shrink: 0;
    margin-top: 0.08rem;
    font-size: calc(1.05rem + 2px);
}

.portal-login-notice--warn {
    color: #fde68a;
    background: linear-gradient(135deg, rgba(120, 53, 15, 0.72), rgba(69, 26, 3, 0.65));
    border: 1px solid rgba(251, 191, 36, 0.42);
}

.portal-login-notice--warn i {
    color: #fbbf24;
}

.portal-login-notice--error {
    color: #fecaca;
    background: linear-gradient(135deg, rgba(127, 29, 29, 0.72), rgba(69, 10, 10, 0.65));
    border: 1px solid rgba(248, 113, 113, 0.42);
}

.portal-login-notice--error i {
    color: #f87171;
}

@keyframes portal-login-notice-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.portal-login-alert {
    margin-bottom: 1rem;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    font-size: calc(0.85rem + 2px);
    color: #fecaca;
    background: rgba(127, 29, 29, 0.55);
    border: 1px solid rgba(248, 113, 113, 0.4);
}

.portal-login-field { margin-bottom: 0.75rem; }

.portal-login-field label {
    display: block;
    margin-bottom: 0.32rem;
    font-size: calc(0.92rem + 2px);
    font-weight: 500;
    color: #f1f5f9;
}

.portal-login-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.85rem;
    min-height: 44px;
    border-radius: 11px;
    background: rgba(4, 10, 22, 0.58);
    border: 1px solid rgba(71, 85, 105, 0.72);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.portal-login-input-wrap:focus-within {
    border-color: rgba(96, 181, 255, 0.75);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.16);
}

.portal-login-input-wrap > i.bi { color: #94a3b8; font-size: calc(0.98rem + 2px); flex-shrink: 0; }

.portal-login-input-wrap input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: calc(0.9rem + 2px);
    color: #f1f5f9;
}

.portal-login-input-wrap input::placeholder { color: #64748b; }

.portal-login-toggle-pw {
    border: 0;
    background: transparent;
    color: #94a3b8;
    padding: 0.25rem;
    line-height: 1;
    cursor: pointer;
}

.portal-login-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0.1rem 0 0.85rem;
    font-size: calc(0.92rem + 2px);
}

.portal-login-remember {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    color: #e2e8f0;
    cursor: pointer;
    user-select: none;
}

.portal-login-remember input { accent-color: #e31e24; }

.portal-login-forgot {
    color: #5ec8ff;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}

.portal-login-forgot:hover { text-decoration: underline; }

.portal-login-submit {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    border: 0;
    border-radius: 999px;
    font-size: calc(0.94rem + 2px);
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(90deg, #db2777 0%, #ef4444 45%, #f97316 100%);
    box-shadow: 0 8px 24px rgba(219, 39, 119, 0.38);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.portal-login-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(249, 115, 22, 0.45);
}

.portal-login-submit:disabled,
.portal-login-submit.is-loading {
    opacity: 0.92;
    cursor: wait;
    transform: none;
    box-shadow: 0 10px 24px rgba(185, 28, 28, 0.38);
}

.portal-login-submit__spinner {
    display: none;
    width: 1.05rem;
    height: 1.05rem;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: portal-spin 0.65s linear infinite;
    flex-shrink: 0;
}

.portal-login-submit.is-loading .portal-login-submit__spinner {
    display: inline-block;
}

.portal-login-submit.is-loading .portal-login-submit__icon {
    display: none;
}

.portal-login-submit i,
.portal-login-submit__icon { font-size: calc(1.16rem + 2px); }

.portal-login-trust-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(100, 116, 139, 0.28);
}

.portal-login-trust-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.2rem;
}

.portal-login-trust-item i {
    color: #7dd3fc;
    font-size: calc(0.96rem + 2px);
}

.portal-login-trust-item strong {
    font-size: calc(0.78rem + 2px);
    font-weight: 700;
    color: #e2e8f0;
    letter-spacing: 0.02em;
}

.portal-login-dev-hint { margin-top: 1rem; font-size: calc(0.72rem + 2px); color: #94a3b8; }
.portal-login-dev-hint summary { cursor: pointer; font-weight: 600; color: #cbd5e1; }
.portal-login-dev-hint ul { margin: 0.35rem 0 0; padding-left: 1.1rem; }
.portal-login-dev-hint code { color: #e2e8f0; }

@media (max-width: 1100px) {
    .portal-login-main {
        padding: 4.5rem 1.25rem calc(13rem + env(safe-area-inset-bottom, 0px));
    }
}

@media (prefers-reduced-motion: reduce) {
    .portal-login-network {
        opacity: 0.45;
    }
}

@media (max-width: 600px) {
    .portal-login-card-shell {
        transform: scale(0.88) translateZ(0);
    }

    .portal-login-card {
        padding: 1.1rem 1.1rem 0.85rem;
    }
}

@media (max-width: 900px) {
    .portal-login-bottom-strip {
        pointer-events: auto;
        overflow: hidden;
    }

    .portal-login-badge-row {
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 0.6rem;
        max-width: none;
        margin: 0;
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
        touch-action: pan-x;
        padding: 0 0.15rem 0.2rem;
    }

    .portal-login-badge-row::-webkit-scrollbar {
        display: none;
    }

    .portal-login-badge {
        flex: 0 0 auto;
        width: min(220px, 78vw);
        min-height: 84px;
        padding: 0.8rem 0.75rem;
        scroll-snap-align: start;
    }

    .portal-login-badge i {
        font-size: 1.2rem;
    }
}

@media (max-width: 720px) {
    .portal-login-logo-corner {
        top: 0.85rem;
        left: 1rem;
    }

    .portal-login-logo-corner img {
        width: min(168px, 52vw);
    }

    .portal-login-main {
        align-items: center;
        padding: 4.25rem 0.85rem calc(7.25rem + env(safe-area-inset-bottom, 0px));
    }

    .portal-login-card-shell {
        border-radius: 18px;
    }

    .portal-login-card {
        padding: 1.35rem 1.15rem 1.1rem;
        border-radius: 18px;
    }

    .portal-login-card-crest {
        margin-bottom: 0.55rem;
    }

    .portal-login-card-crest img {
        max-height: 58px;
        width: min(180px, 82%);
    }

    .portal-login-title {
        margin-bottom: 0.95rem;
        font-size: calc(1.45rem + 2px);
    }

    .portal-login-field {
        margin-bottom: 0.85rem;
    }

    .portal-login-trust {
        margin: 0.85rem 0 0;
        font-size: calc(0.68rem + 2px);
    }
}

@media (max-width: 480px) {
    .portal-login-main { padding: 3.85rem 0.75rem calc(6.75rem + env(safe-area-inset-bottom, 0px)); }
    .portal-login-card { padding: 1.15rem 1rem 1rem; }
}

/* ============================================================
   PORTAL PAGE HEADER
   ============================================================ */

.portal-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.portal-page-header-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.4rem;
}

.portal-data-freshness {
    font-size: 0.76rem;
    color: #7a8fad;
}

/* ============================================================
   MODULE ICON (Index.cshtml admin cards)
   ============================================================ */

.portal-module-icon {
    display: block;
    font-size: 1.65rem;
    margin-bottom: 0.75rem;
}

.portal-module-icon--blue   { color: #1d4ed8; }
.portal-module-icon--green  { color: #16a34a; }
.portal-module-icon--amber  { color: #b45309; }
.portal-module-icon--purple { color: #7c3aed; }

/* ============================================================
   REGISTRATIONS PAGE
   ============================================================ */

.reg-page-header {
    align-items: flex-end;
    margin-bottom: 1.35rem;
}

.reg-page-title-icon {
    color: #1d4ed8;
    margin-right: 0.45rem;
}

.reg-refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    border: 1px solid #c7d8f0;
    background: #fff;
    color: #0a2f7a;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.reg-refresh-btn:hover {
    background: #f4f8ff;
    border-color: #93c5fd;
    box-shadow: 0 4px 14px rgba(29, 78, 216, 0.1);
}

.portal-data-freshness {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: #607089;
}

.reg-alert {
    border-radius: 14px;
    border: none;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.12);
}

.reg-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
    margin-bottom: 1.35rem;
}

.reg-kpi-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.95rem;
    overflow: hidden;
    isolation: isolate;
    padding: 1.15rem 1.1rem 1.05rem;
    border-radius: 18px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: #fff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.reg-kpi-card:hover {
    transform: translateY(-3px);
    box-shadow:
        0 14px 30px rgba(15, 23, 42, 0.1),
        0 3px 8px rgba(15, 23, 42, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

/* Geometric hex d?cor shared with .portal-kpi-card above */

.reg-kpi-card__icon {
    width: 52px;
    height: 60px;
    font-size: 1.35rem;
}

.reg-kpi-card::before {
    top: 12px;
    right: 38px;
    width: 58px;
    height: 67px;
    box-shadow:
        -9px 26px 0 -4px var(--kpi-hex-fade-3),
        7px 48px 0 -2px var(--kpi-hex-fade-2);
}

.reg-kpi-card::after {
    bottom: -30px;
    right: -20px;
    width: 94px;
    height: 108px;
    opacity: 0.36;
}

.reg-kpi-card__content {
    min-width: 0;
    position: relative;
    z-index: 2;
    flex: 1;
    padding-right: 3.25rem;
}

.reg-kpi-card__label {
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 0.35rem;
}

.reg-kpi-card__value {
    display: block;
    font-size: 1.95rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    color: #0f172a;
    margin-bottom: 0.35rem;
}

.reg-kpi-card__hint {
    display: block;
    font-size: 0.76rem;
    font-weight: 600;
    color: #94a3b8;
}

.reg-kpi-card--blue {
    --kpi-icon-bg: #3b82f6;
    --kpi-icon-shadow: rgba(59, 130, 246, 0.38);
    --kpi-hex-solid: #3b82f6;
    --kpi-hex-fade-1: rgba(59, 130, 246, 0.06);
    --kpi-hex-fade-2: rgba(59, 130, 246, 0.1);
    --kpi-hex-fade-3: rgba(59, 130, 246, 0.04);
    border-color: rgba(191, 219, 254, 0.85);
}

.reg-kpi-card--green {
    --kpi-icon-bg: #22a06b;
    --kpi-icon-shadow: rgba(34, 160, 107, 0.38);
    --kpi-hex-solid: #22a06b;
    --kpi-hex-fade-1: rgba(34, 160, 107, 0.06);
    --kpi-hex-fade-2: rgba(34, 160, 107, 0.1);
    --kpi-hex-fade-3: rgba(34, 160, 107, 0.04);
    border-color: rgba(187, 247, 208, 0.85);
}

.reg-kpi-card--amber {
    --kpi-icon-bg: #f59e0b;
    --kpi-icon-shadow: rgba(245, 158, 11, 0.38);
    --kpi-hex-solid: #f59e0b;
    --kpi-hex-fade-1: rgba(245, 158, 11, 0.06);
    --kpi-hex-fade-2: rgba(245, 158, 11, 0.1);
    --kpi-hex-fade-3: rgba(245, 158, 11, 0.04);
    border-color: rgba(253, 230, 138, 0.9);
}

.reg-kpi-card--purple {
    --kpi-icon-bg: #8b5cf6;
    --kpi-icon-shadow: rgba(139, 92, 246, 0.38);
    --kpi-hex-solid: #8b5cf6;
    --kpi-hex-fade-1: rgba(139, 92, 246, 0.06);
    --kpi-hex-fade-2: rgba(139, 92, 246, 0.1);
    --kpi-hex-fade-3: rgba(139, 92, 246, 0.04);
    border-color: rgba(221, 214, 254, 0.9);
}

.reg-kpi-card--red {
    --kpi-icon-bg: #e85d8a;
    --kpi-icon-shadow: rgba(232, 93, 138, 0.38);
    --kpi-hex-solid: #e85d8a;
    --kpi-hex-fade-1: rgba(232, 93, 138, 0.06);
    --kpi-hex-fade-2: rgba(232, 93, 138, 0.1);
    --kpi-hex-fade-3: rgba(232, 93, 138, 0.04);
    border-color: rgba(254, 205, 211, 0.9);
}

.reg-panel {
    padding: 1.25rem 1.35rem 1.35rem;
    border: 1px solid #e2e8f3;
    box-shadow: 0 10px 30px rgba(10, 47, 122, 0.06);
}

.reg-panel--otp {
    margin-top: 0.25rem;
}

.reg-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.95rem;
    border-bottom: 1px solid #edf2f8;
}

.reg-panel-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0a2f7a;
}

.reg-panel-title > i {
    color: #1d4ed8;
}

.reg-panel-subtitle {
    margin: 0.35rem 0 0;
    font-size: 0.82rem;
    color: #64748b;
    font-weight: 500;
}

.reg-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 0.45rem;
    border-radius: 999px;
    background: #dbeafe;
    color: #1e3a8a;
    font-size: 0.74rem;
    font-weight: 800;
}

.reg-count-badge--amber {
    background: #fef3c7;
    color: #92400e;
}

.reg-table-wrap {
    margin: 0 -0.15rem;
}

.reg-dt-table {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0;
}

.reg-dt-table thead th {
    padding: 0.8rem 0.9rem !important;
    font-size: 0.7rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b !important;
    background: linear-gradient(180deg, #f8fbff 0%, #f1f5fb 100%) !important;
    border-bottom: 1px solid #e2e8f0 !important;
    white-space: nowrap;
    vertical-align: middle;
}

.reg-dt-table tbody td {
    padding: 0.85rem 0.9rem !important;
    vertical-align: middle !important;
    border-bottom: 1px solid #eef2f7 !important;
    font-size: 0.86rem;
    color: #1e293b;
}

.reg-dt-table tbody tr:hover td {
    background: #f8fbff !important;
}

.reg-dt-table tbody tr:last-child td {
    border-bottom: none !important;
}

div.dataTables_wrapper div.dataTables_length label,
div.dataTables_wrapper div.dataTables_filter label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0;
}

div.dataTables_wrapper div.dataTables_filter input {
    min-width: 220px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    padding: 0.45rem 0.9rem;
    font-size: 0.84rem;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

div.dataTables_wrapper div.dataTables_filter input:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    outline: none;
}

div.dataTables_wrapper div.dataTables_length select {
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    padding: 0.3rem 1.8rem 0.3rem 0.55rem;
    font-size: 0.84rem;
}

div.dataTables_wrapper div.dataTables_info {
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 600;
    padding-top: 0.85rem;
}

div.dataTables_wrapper div.dataTables_paginate {
    padding-top: 0.65rem;
}

div.dataTables_wrapper div.dataTables_paginate .pagination {
    gap: 0.25rem;
    margin-bottom: 0;
}

div.dataTables_wrapper div.dataTables_paginate .page-link {
    border-radius: 10px !important;
    border: 1px solid #dbe3ef;
    color: #0a2f7a;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.35rem 0.7rem;
}

div.dataTables_wrapper div.dataTables_paginate .page-item.active .page-link {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-color: #1d4ed8;
}

.reg-col-actions {
    width: 64px;
    text-align: center;
}

.reg-id {
    font-size: 0.78rem;
    font-weight: 700;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
}

.reg-name-cell {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 160px;
}

.reg-avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 0.88rem;
    font-weight: 800;
    color: #1d4ed8;
    background: linear-gradient(145deg, #eff6ff, #dbeafe);
    border: 1px solid rgba(147, 197, 253, 0.55);
    flex-shrink: 0;
}

.reg-fullname {
    font-weight: 700;
    color: #0f172a;
}

.reg-contact-cell {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 180px;
}

.reg-contact-line {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: #475569;
    word-break: break-word;
}

.reg-contact-line i {
    color: #64748b;
    font-size: 0.72rem;
    flex-shrink: 0;
}

.reg-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
    text-transform: capitalize;
}

.reg-badge i { font-size: 0.68rem; }

.reg-badge--blue   { background: #dbeafe; color: #1e40af; }
.reg-badge--purple { background: #ede9fe; color: #5b21b6; }
.reg-badge--green  { background: #dcfce7; color: #166534; }

.reg-status {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: capitalize;
    white-space: nowrap;
}

.reg-status i { font-size: 0.72rem; }

.reg-status--success { background: #dcfce7; color: #166534; }
.reg-status--warning { background: #fef3c7; color: #92400e; }
.reg-status--muted   { background: #f1f5f9; color: #64748b; }

.reg-lang {
    font-size: 0.8rem;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
}

.reg-date {
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 600;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.reg-delete-form {
    margin: 0;
    display: inline-flex;
}

.reg-actions-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.reg-view-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: #94a3b8;
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.reg-dt-table tbody tr:hover .reg-view-btn {
    color: #1d4ed8;
    background: #eff6ff;
    border-color: #bfdbfe;
}

.reg-view-btn:hover {
    color: #1e40af !important;
    background: #dbeafe !important;
    border-color: #93c5fd !important;
}

.reg-details-modal .modal-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
    color: #0a2f7a;
}

.reg-details-grid {
    display: grid;
    gap: 1.25rem;
}

@media (min-width: 768px) {
    .reg-details-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.reg-details-section h6 {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0.75rem;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #475569;
}

.reg-details-dl {
    display: grid;
    grid-template-columns: minmax(120px, 38%) 1fr;
    gap: 0.45rem 0.75rem;
    margin: 0;
}

.reg-details-dl dt {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    color: #64748b;
}

.reg-details-dl dd {
    margin: 0;
    font-size: 0.84rem;
    color: #0f172a;
    word-break: break-word;
}

.reg-details-dl code {
    font-size: 0.78rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.12rem 0.35rem;
}

.reg-details-empty {
    margin: 0;
    font-size: 0.84rem;
    color: #64748b;
}

.reg-details-map {
    margin-top: 0.85rem;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    min-height: 220px;
    background: #f8fafc;
}

.reg-details-map iframe {
    display: block;
    width: 100%;
    height: 220px;
    border: 0;
}

.reg-delete-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: #94a3b8;
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.reg-dt-table tbody tr:hover .reg-delete-btn {
    color: #dc2626;
    background: #fef2f2;
    border-color: #fecaca;
}

.reg-delete-btn:hover {
    color: #b91c1c !important;
    background: #fee2e2 !important;
    border-color: #f87171 !important;
}

.reg-otp-code {
    display: inline-block;
    background: #f0fdf4;
    color: #166534;
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    padding: 0.22rem 0.55rem;
    border-radius: 8px;
    border: 1px solid #bbf7d0;
    font-family: ui-monospace, "Courier New", monospace;
}

@media (max-width: 768px) {
    .reg-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    div.dataTables_wrapper div.dataTables_filter input {
        min-width: 140px;
    }
}


/* =========================================================
   Dark theme - light mode stays unchanged; overrides only
   ========================================================= */
html.portal-theme-dark {
    color-scheme: dark;
}

html.portal-theme-dark body {
    background: #0b1220;
    color: #e2e8f0;
}

html.portal-theme-dark body .portal-page {
    background: #0b1220;
}

html.portal-theme-dark body .portal-sidebar {
    background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
    box-shadow: 2px 0 22px rgba(0, 0, 0, 0.45);
    border-right: 1px solid rgba(148, 163, 184, 0.08);
}

html.portal-theme-dark body .portal-nav-link:hover {
    background: rgba(148, 163, 184, 0.1);
}

html.portal-theme-dark body .portal-nav-link.active,
html.portal-theme-dark body .portal-nav-group.is-open > .portal-nav-group-toggle {
    background: rgba(148, 163, 184, 0.14);
    box-shadow: inset 3px 0 0 #60a5fa;
}

html.portal-theme-dark body .portal-nav-sub {
    border-left-color: rgba(148, 163, 184, 0.18);
}

html.portal-theme-dark body .portal-nav-sublink:hover {
    background: rgba(148, 163, 184, 0.1);
}

html.portal-theme-dark body .portal-nav-sublink.active {
    background: rgba(96, 165, 250, 0.16);
    box-shadow: inset 2px 0 0 #60a5fa;
}

html.portal-theme-dark body .portal-nav-summary,
html.portal-theme-dark body .portal-nav-footer {
    background: rgba(0, 0, 0, 0.28);
    border-color: rgba(148, 163, 184, 0.12);
}

html.portal-theme-dark body .portal-nav-logout {
    background: rgba(148, 163, 184, 0.1);
    border-color: rgba(148, 163, 184, 0.16);
}

html.portal-theme-dark body .portal-nav-logout:hover {
    background: rgba(148, 163, 184, 0.18);
}

html.portal-theme-dark body .portal-topbar {
    background: #111827;
    border-bottom-color: #1f2937;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

html.portal-theme-dark body .portal-topbar-icon-btn {
    background: #1f2937;
    border-color: #374151;
    color: #cbd5e1;
}

html.portal-theme-dark body .portal-topbar-icon-btn:hover {
    background: #273449;
    border-color: #4b5563;
    color: #f8fafc;
}

html.portal-theme-dark body .portal-topbar-notif-dot {
    border-color: #111827;
}

html.portal-theme-dark body .portal-topbar-profile-btn {
    background: #1f2937;
    border-color: #374151;
    color: #f1f5f9;
}

html.portal-theme-dark body .portal-topbar-profile-btn:hover {
    background: #273449;
    border-color: #4b5563;
}

html.portal-theme-dark body .portal-topbar-username,
html.portal-theme-dark body .portal-topbar-chevron {
    color: #e2e8f0;
}

html.portal-theme-dark body .portal-topbar-dropdown {
    background: #111827;
    border-color: #1f2937;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

html.portal-theme-dark body .portal-topbar-dropdown-header strong,
html.portal-theme-dark body .portal-notif-header strong,
html.portal-theme-dark body .portal-topbar-dropdown-item {
    color: #f1f5f9;
}

html.portal-theme-dark body .portal-topbar-dropdown-header span,
html.portal-theme-dark body .portal-theme-picker-label,
html.portal-theme-dark body .portal-theme-swatch span {
    color: #94a3b8;
}

html.portal-theme-dark body .portal-topbar-dropdown-divider,
html.portal-theme-dark body .portal-notif-header {
    border-color: #1f2937;
    background: transparent;
}

html.portal-theme-dark body .portal-topbar-dropdown-divider {
    background: #1f2937;
}

html.portal-theme-dark body .portal-topbar-dropdown-item:hover {
    background: #1e293b;
    color: #93c5fd;
}

html.portal-theme-dark body .portal-topbar-dropdown-item--danger {
    color: #fca5a5;
}

html.portal-theme-dark body .portal-topbar-dropdown-item--danger:hover {
    background: rgba(127, 29, 29, 0.35);
    color: #fecaca;
}

html.portal-theme-dark body .portal-mode-btn {
    background: #1f2937;
    border-color: #374151;
    color: #cbd5e1;
}

html.portal-theme-dark body .portal-mode-btn:hover {
    border-color: #60a5fa;
    color: #93c5fd;
}

html.portal-theme-dark body .portal-mode-btn.is-active {
    background: rgba(37, 99, 235, 0.22);
    border-color: #3b82f6;
    color: #93c5fd;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

html.portal-theme-dark body .portal-theme-swatch:hover,
html.portal-theme-dark body .portal-theme-swatch.is-active {
    background: #1e293b;
    border-color: #475569;
}

html.portal-theme-dark body .portal-theme-swatch.is-active {
    border-color: #3b82f6;
}

html.portal-theme-dark body .portal-notif-item {
    background: transparent;
    color: #e2e8f0;
    border-color: transparent;
}

html.portal-theme-dark body .portal-notif-item:hover,
html.portal-theme-dark body .portal-notif-item--unread {
    background: #1e293b;
}

html.portal-theme-dark body .portal-notif-copy strong { color: #f8fafc; }
html.portal-theme-dark body .portal-notif-copy span,
html.portal-theme-dark body .portal-notif-copy em { color: #94a3b8; }
html.portal-theme-dark body .portal-notif-footer {
    color: #93c5fd;
    border-top-color: #1f2937;
}

html.portal-theme-dark body .portal-content {
    background: linear-gradient(165deg, #0b1220 0%, #111827 48%, #0f172a 100%) !important;
}

html.portal-theme-dark body.portal-bg-white .portal-content {
    background: linear-gradient(165deg, #0b1220 0%, #111827 48%, #0f172a 100%) !important;
}

html.portal-theme-dark body.portal-bg-sky .portal-content {
    background: linear-gradient(165deg, #0b1524 0%, #0f1f38 45%, #10243f 100%) !important;
}

html.portal-theme-dark body.portal-bg-blue .portal-content {
    background: linear-gradient(165deg, #0a1628 0%, #102a4a 48%, #123058 100%) !important;
}

html.portal-theme-dark body.portal-bg-mint .portal-content {
    background: linear-gradient(165deg, #0b1714 0%, #10241f 45%, #0f1f2a 100%) !important;
}

html.portal-theme-dark body .portal-page-title,
html.portal-theme-dark body .portal-dash-panel-title,
html.portal-theme-dark body .portal-dash-section-title,
html.portal-theme-dark body .portal-panel-title,
html.portal-theme-dark body .portal-map-expand-modal__head h2 {
    color: #f8fafc;
}

html.portal-theme-dark body .portal-page-lead,
html.portal-theme-dark body .portal-dash-panel-sub,
html.portal-theme-dark body .portal-map-expand-modal__head p {
    color: #94a3b8;
}

html.portal-theme-dark body .portal-panel,
html.portal-theme-dark body .portal-dash-map-panel,
html.portal-theme-dark body .portal-dash-chart-panel,
html.portal-theme-dark body .portal-quick-actions-panel,
html.portal-theme-dark body .portal-dash-chart-panel--premium {
    background: linear-gradient(180deg, #151c2c 0%, #111827 100%);
    border-color: #243044;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

html.portal-theme-dark body .portal-kpi-card,
html.portal-theme-dark body .reg-kpi-card {
    background: linear-gradient(165deg, #1e293b 0%, #162032 55%, #121a2b 100%);
    border-color: rgba(148, 163, 184, 0.22);
    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

html.portal-theme-dark body .portal-kpi-card:hover,
html.portal-theme-dark body a.portal-kpi-card:hover,
html.portal-theme-dark body .reg-kpi-card:hover {
    box-shadow:
        0 16px 36px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(148, 163, 184, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

html.portal-theme-dark body .portal-kpi-card__label {
    color: #f1f5f9;
}

html.portal-theme-dark body .reg-kpi-card__label {
    color: #cbd5e1;
}

html.portal-theme-dark body .portal-kpi-card__value {
    color: var(--kpi-accent);
}

html.portal-theme-dark body .reg-kpi-card__value {
    color: #f8fafc;
}

html.portal-theme-dark body .portal-kpi-trend.up {
    color: var(--kpi-accent);
    background: color-mix(in srgb, var(--kpi-accent) 18%, transparent);
}

html.portal-theme-dark body .portal-kpi-trend.down {
    color: #fb7185;
    background: rgba(244, 63, 94, 0.16);
}

html.portal-theme-dark body .portal-kpi-card__foot {
    border-top-color: rgba(148, 163, 184, 0.16);
}

html.portal-theme-dark body .portal-kpi-card__foot-icon {
    background: color-mix(in srgb, var(--kpi-accent) 18%, transparent);
    color: var(--kpi-accent);
}

html.portal-theme-dark body .portal-kpi-card__foot-copy strong {
    color: #f1f5f9;
}

html.portal-theme-dark body .portal-kpi-card__foot-copy em {
    color: #94a3b8;
}

html.portal-theme-dark body .portal-kpi-card--blue {
    --kpi-accent: #60a5fa;
    --kpi-accent-soft: rgba(96, 165, 250, 0.16);
    --kpi-accent-soft-2: rgba(96, 165, 250, 0.1);
    --kpi-poly-1: rgba(96, 165, 250, 0.28);
    --kpi-poly-2: rgba(147, 197, 253, 0.16);
    --kpi-poly-3: rgba(191, 219, 254, 0.1);
    border-color: rgba(96, 165, 250, 0.28);
}
html.portal-theme-dark body .portal-kpi-card--green {
    --kpi-accent: #4ade80;
    --kpi-accent-soft: rgba(74, 222, 128, 0.16);
    --kpi-accent-soft-2: rgba(74, 222, 128, 0.1);
    --kpi-poly-1: rgba(74, 222, 128, 0.26);
    --kpi-poly-2: rgba(134, 239, 172, 0.14);
    --kpi-poly-3: rgba(187, 247, 208, 0.09);
    border-color: rgba(74, 222, 128, 0.28);
}
html.portal-theme-dark body .portal-kpi-card--amber {
    --kpi-accent: #fbbf24;
    --kpi-accent-soft: rgba(251, 191, 36, 0.16);
    --kpi-accent-soft-2: rgba(251, 191, 36, 0.1);
    --kpi-poly-1: rgba(251, 191, 36, 0.26);
    --kpi-poly-2: rgba(253, 224, 71, 0.14);
    --kpi-poly-3: rgba(254, 243, 199, 0.09);
    border-color: rgba(251, 191, 36, 0.28);
}
html.portal-theme-dark body .portal-kpi-card--rose {
    --kpi-accent: #fb7185;
    --kpi-accent-soft: rgba(251, 113, 133, 0.16);
    --kpi-accent-soft-2: rgba(251, 113, 133, 0.1);
    --kpi-poly-1: rgba(251, 113, 133, 0.26);
    --kpi-poly-2: rgba(253, 164, 175, 0.14);
    --kpi-poly-3: rgba(254, 205, 211, 0.09);
    border-color: rgba(251, 113, 133, 0.28);
}

html.portal-theme-dark body .reg-kpi-card::after {
    opacity: 0.28;
}

html.portal-theme-dark body .portal-quick-action {
    background: linear-gradient(180deg, #1a2233 0%, #151c2c 100%);
    border-color: #2a364a;
    color: #e2e8f0;
}

html.portal-theme-dark body .portal-quick-action:hover {
    border-color: #3b82f6;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
    color: #e2e8f0;
}

html.portal-theme-dark body .portal-quick-action__copy strong { color: #f8fafc; }
html.portal-theme-dark body .portal-quick-action__copy em,
html.portal-theme-dark body .portal-quick-action__chevron { color: #94a3b8; }

html.portal-theme-dark body .portal-map-type-select,
html.portal-theme-dark body .portal-map-expand-btn,
html.portal-theme-dark body .portal-map-expand-close,
html.portal-theme-dark body .portal-map-area-close,
html.portal-theme-dark body .portal-map-area-select,
html.portal-theme-dark body .portal-trend-state-select {
    background: #1f2937;
    border-color: #374151;
    color: #e2e8f0;
}

html.portal-theme-dark body .portal-map-area-btn {
    background: linear-gradient(145deg, #1e3a5f 0%, #1e293b 100%);
    border-color: #334155;
    color: #e2e8f0;
}

html.portal-theme-dark body .portal-map-area-btn em {
    background: rgba(15, 23, 42, 0.65);
    border-color: #334155;
    color: #94a3b8;
}

html.portal-theme-dark body .portal-map-area-modal__dialog,
html.portal-theme-dark body .portal-map-area-modal__head,
html.portal-theme-dark body .portal-map-area-modal__foot {
    background: #111827;
    border-color: #1f2937;
}

html.portal-theme-dark body .portal-map-area-modal__body {
    background: #0f172a;
}

html.portal-theme-dark body .portal-map-area-modal__head h2,
html.portal-theme-dark body .portal-map-area-type-card strong {
    color: #f8fafc;
}

html.portal-theme-dark body .portal-map-area-modal__head p,
html.portal-theme-dark body .portal-map-area-field > span,
html.portal-theme-dark body .portal-map-area-field > legend,
html.portal-theme-dark body .portal-map-area-type-card em {
    color: #94a3b8;
}

html.portal-theme-dark body .portal-map-area-type-card {
    background: #1f2937;
    border-color: #334155;
}

html.portal-theme-dark body .portal-map-area-type-card:has(input:checked) {
    background: linear-gradient(145deg, #1e3a5f 0%, #1e293b 100%);
    border-color: #3b82f6;
}

html.portal-theme-dark body .portal-map-type-label { color: #94a3b8; }

html.portal-theme-dark body .portal-map-expand-btn:hover {
    border-color: #60a5fa;
    color: #93c5fd;
    background: #273449;
}

html.portal-theme-dark body .portal-dash-map {
    border-color: #334155;
    background: #d4e4f0;
}

/* Keep geography light/readable inside dark theme — do not invert tiles */
html.portal-theme-dark body .portal-dash-map.portal-map--light-basemap,
html.portal-theme-dark body .portal-dash-map.portal-map--night {
    background: #d4e4f0;
}

html.portal-theme-dark body .portal-dash-map.portal-map--light-basemap .leaflet-tile-pane,
html.portal-theme-dark body .portal-dash-map.portal-map--night .leaflet-tile-pane {
    filter: contrast(1.06) saturate(1.1);
}

html.portal-theme-dark body .portal-heat-filter {
    background: rgba(17, 24, 39, 0.96);
    border-color: #334155;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

/* Zoom + Issue Density: keep dark floating look in dark theme (do not restyle to light) */
html.portal-theme-dark body .portal-density-legend,
html.portal-theme-dark body .portal-map-zoom-rail {
    background: rgba(17, 24, 39, 0.96);
    border-color: #334155;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

html.portal-theme-dark body .portal-heat-filter h3,
html.portal-theme-dark body .portal-density-legend strong,
html.portal-theme-dark body .portal-map-zoom-value {
    color: #f1f5f9;
}

html.portal-theme-dark body .portal-map-zoom-step {
    background: #1f2937;
    border-color: #374151;
    color: #e2e8f0;
}

html.portal-theme-dark body .portal-map-zoom-step:hover {
    border-color: #60a5fa;
    color: #93c5fd;
    background: #273449;
}

html.portal-theme-dark body .portal-map-zoom-step i {
    color: #e2e8f0;
}

html.portal-theme-dark body .portal-heat-filter-item,
html.portal-theme-dark body .portal-density-labels,
html.portal-theme-dark body .portal-map-legend {
    color: #cbd5e1;
}

html.portal-theme-dark body .portal-map-stage-slot.is-expanded {
    border-color: #475569;
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.95), rgba(30, 41, 59, 0.9));
}

html.portal-theme-dark body .portal-map-stage-slot.is-expanded::after {
    color: #94a3b8;
}

html.portal-theme-dark body .portal-map-expand-modal__dialog {
    background: #111827;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
}

html.portal-theme-dark body .portal-map-expand-modal__head,
html.portal-theme-dark body .portal-map-expand-modal__body {
    background: #0f172a;
    border-color: #1f2937;
}

html.portal-theme-dark body .portal-hotspot-modal__dialog,
html.portal-theme-dark body .portal-hs-modal-head,
html.portal-theme-dark body .portal-hs-modal-body,
html.portal-theme-dark body .portal-hs-modal-foot,
html.portal-theme-dark body .portal-hs-section {
    background: #111827;
    color: #e2e8f0;
    border-color: #1f2937;
}

html.portal-theme-dark body .portal-hs-modal-head h2,
html.portal-theme-dark body .portal-hs-kpi strong,
html.portal-theme-dark body .portal-hs-info-list strong,
html.portal-theme-dark body .portal-hs-cases-table th,
html.portal-theme-dark body .portal-hs-cases-table td {
    color: #f8fafc;
}

html.portal-theme-dark body .portal-hs-modal-head p,
html.portal-theme-dark body .portal-hs-kpi span,
html.portal-theme-dark body .portal-hs-info-list span,
html.portal-theme-dark body .portal-hs-modal-foot p {
    color: #94a3b8;
}

html.portal-theme-dark body .portal-hs-type-name {
    color: #e2e8f0;
}

html.portal-theme-dark body .portal-hs-type-name--pot { color: #fca5a5; }
html.portal-theme-dark body .portal-hs-type-name--str { color: #fcd34d; }
html.portal-theme-dark body .portal-hs-type-name--san { color: #86efac; }
html.portal-theme-dark body .portal-hs-type-name--utl { color: #93c5fd; }
html.portal-theme-dark body .portal-hs-type-name--drn { color: #c4b5fd; }
html.portal-theme-dark body .portal-hs-type-name--hotl { color: #f9a8d4; }
html.portal-theme-dark body .portal-hs-type-name--fld { color: #5eead4; }

html.portal-theme-dark body .portal-hs-type-track {
    background: #1f2937;
}

html.portal-theme-dark body .portal-hs-type-row strong {
    color: #f8fafc;
}

html.portal-theme-dark body .portal-hs-btn--ghost {
    background: #1f2937;
    color: #e2e8f0;
    border-color: #374151;
}

html.portal-theme-dark body .portal-map-tip {
    background: linear-gradient(145deg, rgba(17, 24, 39, 0.98), rgba(30, 41, 59, 0.96));
    border-color: #334155;
    color: #e2e8f0;
}

html.portal-theme-dark body .portal-map-tip-head strong { color: #93c5fd; }
html.portal-theme-dark body .portal-map-tip-sub,
html.portal-theme-dark body .portal-map-tip-foot { color: #94a3b8; }

html.portal-theme-dark body .portal-chart-center strong { color: #f8fafc; }
html.portal-theme-dark body .portal-chart-center span { color: #94a3b8; }
html.portal-theme-dark body .portal-chart-center {
    background: radial-gradient(circle at 50% 42%, rgba(30, 41, 59, 0.98) 0%, rgba(15, 23, 42, 0.94) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        inset 0 -8px 18px rgba(0, 0, 0, 0.2),
        0 8px 20px rgba(0, 0, 0, 0.25);
}
html.portal-theme-dark body .portal-chart-meta {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-color: rgba(96, 165, 250, 0.28);
    color: #93c5fd;
}
html.portal-theme-dark body .portal-pie-legend__item {
    background: linear-gradient(145deg, #1f2937 0%, #111827 100%);
    border-color: #334155;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
}
html.portal-theme-dark body .portal-pie-legend__copy strong { color: #f1f5f9; }
html.portal-theme-dark body .portal-pie-legend__copy span { color: #94a3b8; }
html.portal-theme-dark body .portal-pie-legend__value { color: #93c5fd; }
html.portal-theme-dark body .portal-dash-chart-panel--bar,
html.portal-theme-dark body .portal-dash-chart-panel--pie {
    background:
        radial-gradient(120% 80% at 100% 0%, rgba(59, 130, 246, 0.12) 0%, transparent 55%),
        linear-gradient(180deg, #111827 0%, #0f172a 100%);
}

html.portal-theme-dark body .portal-action-btn {
    background: #1f2937;
    border-color: #374151;
    color: #e2e8f0;
}

html.portal-theme-dark body .portal-table,
html.portal-theme-dark body .portal-table th,
html.portal-theme-dark body .portal-table td,
html.portal-theme-dark body table.reg-dt-table,
html.portal-theme-dark body table.reg-dt-table th,
html.portal-theme-dark body table.reg-dt-table td {
    color: #e2e8f0;
    border-color: #243044 !important;
    background-color: transparent;
}

html.portal-theme-dark body .portal-table th,
html.portal-theme-dark body table.reg-dt-table thead th {
    background: #1a2233 !important;
    color: #f1f5f9 !important;
}

html.portal-theme-dark body table.reg-dt-table tbody tr:hover {
    background: #1e293b !important;
}

html.portal-theme-dark body .reg-name,
html.portal-theme-dark body .reg-lang,
html.portal-theme-dark body div.dataTables_wrapper div.dataTables_length label,
html.portal-theme-dark body div.dataTables_wrapper div.dataTables_filter label,
html.portal-theme-dark body div.dataTables_wrapper div.dataTables_info {
    color: #e2e8f0;
}

html.portal-theme-dark body .reg-date,
html.portal-theme-dark body .reg-meta {
    color: #94a3b8;
}

html.portal-theme-dark body div.dataTables_wrapper div.dataTables_filter input,
html.portal-theme-dark body div.dataTables_wrapper div.dataTables_length select,
html.portal-theme-dark body div.dataTables_wrapper div.dataTables_paginate .page-link {
    background: #1f2937;
    border-color: #374151;
    color: #e2e8f0;
}

html.portal-theme-dark body .portal-placeholder-card,
html.portal-theme-dark body .portal-mock-pill {
    background: #1f2937;
    color: #e2e8f0;
    border-color: #334155;
}

html.portal-theme-dark body .portal-placeholder-card h3 { color: #f8fafc; }
html.portal-theme-dark body .portal-placeholder-card p { color: #94a3b8; }

html.portal-theme-dark body .text-muted,
html.portal-theme-dark body .form-label,
html.portal-theme-dark body label {
    color: #cbd5e1 !important;
}

html.portal-theme-dark body .form-control,
html.portal-theme-dark body .form-select {
    background-color: #1f2937;
    border-color: #374151;
    color: #f1f5f9;
}

html.portal-theme-dark body .form-control:focus,
html.portal-theme-dark body .form-select:focus {
    background-color: #1f2937;
    border-color: #60a5fa;
    color: #f8fafc;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.2);
}

html.portal-theme-dark body .card,
html.portal-theme-dark body .modal-content {
    background-color: #111827;
    color: #e2e8f0;
    border-color: #1f2937;
}

html.portal-theme-dark body .modal-header,
html.portal-theme-dark body .modal-footer {
    border-color: #1f2937;
}

html.portal-theme-dark body .btn-outline-secondary {
    color: #cbd5e1;
    border-color: #475569;
}

html.portal-theme-dark body .btn-outline-secondary:hover {
    background: #1f2937;
    color: #f8fafc;
}

/* Map help modal */
.portal-map-help-modal {
    position: fixed;
    inset: 0;
    z-index: 1450;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.portal-map-help-modal[hidden] {
    display: none !important;
}

.portal-map-help-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
}

.portal-map-help-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(860px, 100%);
    max-height: min(90vh, 820px);
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
}

.portal-map-help-modal__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid #e8eef7;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.portal-map-help-modal__head h2 {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 800;
    color: #0a2f7a;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.portal-map-help-modal__head h2 i { color: #0284c7; }

.portal-map-help-modal__head p {
    margin: 0.3rem 0 0;
    font-size: 0.8rem;
    color: #64748b;
}

.portal-map-help-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    display: grid;
    place-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

.portal-map-help-modal__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 1.15rem 1.35rem 1.4rem;
    scroll-behavior: smooth;
}

.portal-map-help-section {
    margin-bottom: 1.25rem;
}

.portal-map-help-section h3 {
    margin: 0 0 0.45rem;
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
}

.portal-map-help-section p,
.portal-map-help-section li {
    font-size: 0.86rem;
    line-height: 1.55;
    color: #475569;
}

.portal-map-help-section ul {
    margin: 0.45rem 0 0.65rem;
    padding-left: 1.15rem;
}

.portal-map-help-section li { margin-bottom: 0.35rem; }

.portal-map-help-swatches {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
    margin: 0.65rem 0 0.85rem;
}

.portal-map-help-swatches > div {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.65rem;
    border-radius: 10px;
    border: 1px solid #e8eef7;
    background: #f8fafc;
    font-size: 0.78rem;
    color: #334155;
}

.portal-map-help-swatches .swatch {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}

.swatch-low { background: #22c55e; }
.swatch-mid { background: #eab308; }
.swatch-high { background: #ef4444; }

.portal-map-help-note {
    margin-top: 0.75rem !important;
    padding: 0.7rem 0.85rem;
    border-radius: 10px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af !important;
    font-weight: 600;
}

.portal-map-help-modal__foot {
    display: flex;
    justify-content: flex-end;
    padding: 0.85rem 1.25rem;
    border-top: 1px solid #e8eef7;
    background: #f8fafc;
}

html.portal-theme-dark body .portal-map-help-btn {
    background: #1f2937;
    border-color: #374151;
    color: #7dd3fc;
}

html.portal-theme-dark body .portal-map-help-modal__dialog,
html.portal-theme-dark body .portal-map-help-modal__head,
html.portal-theme-dark body .portal-map-help-modal__foot {
    background: #111827;
    border-color: #1f2937;
}

html.portal-theme-dark body .portal-map-help-modal__body {
    background: #0f172a;
}

html.portal-theme-dark body .portal-map-help-modal__head h2,
html.portal-theme-dark body .portal-map-help-section h3 {
    color: #f8fafc;
}

html.portal-theme-dark body .portal-map-help-modal__head p,
html.portal-theme-dark body .portal-map-help-section p,
html.portal-theme-dark body .portal-map-help-section li {
    color: #94a3b8;
}

html.portal-theme-dark body .portal-map-help-swatches > div {
    background: #1f2937;
    border-color: #334155;
    color: #e2e8f0;
}

html.portal-theme-dark body .portal-map-help-note {
    background: rgba(37, 99, 235, 0.18);
    border-color: #1d4ed8;
    color: #93c5fd !important;
}

@media (max-width: 700px) {
    .portal-map-help-btn span,
    .portal-map-expand-btn span {
        display: none;
    }

    .portal-map-area-type-grid {
        grid-template-columns: 1fr;
    }

    .portal-map-help-swatches {
        grid-template-columns: 1fr;
    }
}

/* Create staff user modal ? sticky footer while body scrolls */
.staff-create-modal .modal-body {
    max-height: min(70vh, 640px);
}
.staff-create-modal-footer {
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    z-index: 2;
}
html.portal-theme-dark .staff-create-modal-footer {
    background: #111827;
    border-top-color: #1f2937;
}

/* ?? Portal loading modal + nav progress + toast polish ?? */
.portal-nav-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10050;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.portal-nav-progress.is-active {
    opacity: 1;
}
.portal-nav-progress__bar {
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, #3b82f6, #60a5fa, #93c5fd);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.55);
}
.portal-nav-progress.is-active .portal-nav-progress__bar {
    animation: portal-nav-bar 1.15s ease-in-out infinite;
}
.portal-nav-progress__label {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.88);
    color: #f8fafc;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
    white-space: nowrap;
    max-width: min(90vw, 360px);
    overflow: hidden;
    text-overflow: ellipsis;
}
html.portal-theme-light .portal-nav-progress__label {
    background: rgba(255, 255, 255, 0.95);
    color: #0f172a;
    border: 1px solid #e2e8f0;
}
@keyframes portal-nav-bar {
    0% { width: 0; margin-left: 0; }
    50% { width: 70%; margin-left: 15%; }
    100% { width: 100%; margin-left: 0; opacity: 0.85; }
}

.portal-loading {
    position: fixed;
    inset: 0;
    z-index: 10040;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.portal-loading--visible {
    opacity: 1;
    visibility: visible;
}
.portal-loading__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
}
.portal-loading__card {
    position: relative;
    z-index: 1;
    width: min(100%, 340px);
    padding: 1.75rem 1.5rem 1.55rem;
    border-radius: 18px;
    background: linear-gradient(165deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow:
        0 24px 48px rgba(15, 23, 42, 0.18),
        0 0 0 1px rgba(255, 255, 255, 0.4) inset;
    text-align: center;
}
.portal-loading__spinner {
    position: relative;
    width: 64px;
    height: 64px;
    margin: 0 auto 1.1rem;
}
.portal-loading__ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #2563eb;
    border-right-color: rgba(37, 99, 235, 0.35);
    animation: portal-spin 0.9s linear infinite;
}
.portal-loading__ring--inner {
    inset: 10px;
    border-top-color: #60a5fa;
    border-right-color: transparent;
    animation-duration: 1.25s;
    animation-direction: reverse;
}
.portal-loading__icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #1d4ed8;
    line-height: 64px;
}
.portal-loading__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.01em;
}
.portal-loading__subtitle {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    color: #64748b;
}
body.portal-loading-open {
    overflow: hidden;
}
@keyframes portal-spin {
    to { transform: rotate(360deg); }
}

html.portal-theme-dark .portal-loading__backdrop {
    background: rgba(2, 6, 23, 0.65);
}
html.portal-theme-dark .portal-loading__card {
    background: linear-gradient(165deg, #1e293b 0%, #0f172a 100%);
    border-color: #334155;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}
html.portal-theme-dark .portal-loading__title { color: #f8fafc; }
html.portal-theme-dark .portal-loading__subtitle { color: #94a3b8; }
html.portal-theme-dark .portal-loading__icon { color: #93c5fd; }
html.portal-theme-dark .portal-loading__ring {
    border-top-color: #60a5fa;
    border-right-color: rgba(96, 165, 250, 0.3);
}

.iziToast-wrapper { z-index: 10060 !important; }

/* Dark theme: blue text / accents that were hard to read */
html.portal-theme-dark body .portal-dash-more-btn {
    background: rgba(30, 58, 138, 0.45);
    border-color: #1d4ed8;
    color: #93c5fd;
}

html.portal-theme-dark body .portal-dash-cards-modal__dialog {
    background: #111827;
    border-color: #334155;
}

html.portal-theme-dark body .portal-dash-cards-modal__head {
    border-bottom-color: #334155;
}

html.portal-theme-dark body .portal-dash-cards-modal__head h2 {
    color: #f8fafc;
}

html.portal-theme-dark body .portal-dash-cards-modal__head p,
html.portal-theme-dark body .portal-dash-card-pick__copy em {
    color: #94a3b8;
}

html.portal-theme-dark body .portal-dash-card-pick {
    background: #1e293b;
    border-color: #334155;
}

html.portal-theme-dark body .portal-dash-card-pick:hover {
    background: #0f172a;
    border-color: #1d4ed8;
}

html.portal-theme-dark body .portal-dash-card-pick__copy strong {
    color: #f1f5f9;
}

html.portal-theme-dark body .portal-dash-cards-modal__foot {
    background: #0f172a;
    border-top-color: #334155;
}

html.portal-theme-dark body .portal-dash-cancel-btn {
    background: #1e293b;
    color: #e2e8f0;
    border-color: #334155;
}

html.portal-theme-dark body .portal-map-menu-btn {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}

html.portal-theme-dark body .portal-map-menu-btn:hover,
html.portal-theme-dark body .portal-map-menu-btn[aria-expanded="true"] {
    background: #0f172a;
    color: #f1f5f9;
}

html.portal-theme-dark body .portal-map-filter-menu-dropdown {
    background: #111827;
    border-color: #334155;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}

html.portal-theme-dark body .portal-map-filter-menu-item {
    color: #cbd5e1;
}

html.portal-theme-dark body .portal-map-filter-menu-item:hover {
    background: #1e293b;
    color: #f8fafc;
}

html.portal-theme-dark body .portal-map-filter-menu-item.is-active {
    background: rgba(59, 130, 246, 0.18);
    color: #93c5fd;
}

html.portal-theme-dark body .portal-map-filter-menu-divider {
    background: #334155;
}


html.portal-theme-dark body .portal-quick-actions-close {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}

html.portal-theme-dark body .portal-quick-actions-close:hover {
    background: rgba(127, 29, 29, 0.35);
    border-color: #7f1d1d;
    color: #fca5a5;
}

html.portal-theme-dark body .portal-dash-widget-handle {
    background: rgba(30, 41, 59, 0.95);
    border-color: #334155;
    color: #94a3b8;
}

html.portal-theme-dark body.portal-dash-edit-mode .portal-kpi-sortable {
    outline-color: rgba(96, 165, 250, 0.45);
}

html.portal-theme-dark body.portal-dash-edit-mode .portal-kpi-sortable.is-drag-over {
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.45), 0 8px 18px rgba(37, 99, 235, 0.25);
}


html.portal-theme-dark body.portal-dash-edit-mode .portal-dash-widget.is-drag-over {
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.45), 0 8px 18px rgba(37, 99, 235, 0.25);
}

html.portal-theme-dark body .portal-dash-drag-ghost {
    background: #111827;
    border-color: #334155;
}

html.portal-theme-dark body .portal-dash-panel-title i,
html.portal-theme-dark body .portal-dash-section-title i {
    color: #93c5fd;
}
html.portal-theme-dark body .portal-map-area-btn i {
    color: #93c5fd;
}
html.portal-theme-dark body .portal-map-expand-btn i {
    color: #e2e8f0;
}
html.portal-theme-dark body .reg-refresh-btn {
    background: #1f2937;
    border-color: #374151;
    color: #e2e8f0;
}
html.portal-theme-dark body .reg-refresh-btn:hover {
    background: #273549;
    border-color: #4b5563;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
html.portal-theme-dark body .reg-panel-title,
html.portal-theme-dark body .reg-page-title-icon {
    color: #f8fafc;
}
html.portal-theme-dark body .reg-panel-title > i {
    color: #93c5fd;
}
html.portal-theme-dark body .reg-count-badge {
    background: rgba(96, 165, 250, 0.18);
    color: #93c5fd;
}
html.portal-theme-dark body .reg-kpi-card__label { color: #cbd5e1; }
html.portal-theme-dark body .reg-kpi-card__value { color: #f8fafc; }
html.portal-theme-dark body .reg-kpi-card__hint { color: #94a3b8; }
html.portal-theme-dark body .reg-kpi-card--blue {
    --kpi-hex-fade-1: rgba(96, 165, 250, 0.22);
    --kpi-hex-fade-2: rgba(96, 165, 250, 0.16);
    --kpi-hex-fade-3: rgba(96, 165, 250, 0.1);
    border-color: rgba(96, 165, 250, 0.42);
}
html.portal-theme-dark body .reg-kpi-card--green {
    --kpi-hex-fade-1: rgba(74, 222, 128, 0.2);
    --kpi-hex-fade-2: rgba(74, 222, 128, 0.14);
    --kpi-hex-fade-3: rgba(74, 222, 128, 0.09);
    border-color: rgba(74, 222, 128, 0.4);
}
html.portal-theme-dark body .reg-kpi-card--amber {
    --kpi-hex-fade-1: rgba(251, 191, 36, 0.22);
    --kpi-hex-fade-2: rgba(251, 191, 36, 0.15);
    --kpi-hex-fade-3: rgba(251, 191, 36, 0.09);
    border-color: rgba(251, 191, 36, 0.42);
}
html.portal-theme-dark body .reg-kpi-card--purple {
    --kpi-hex-fade-1: rgba(167, 139, 250, 0.22);
    --kpi-hex-fade-2: rgba(167, 139, 250, 0.15);
    --kpi-hex-fade-3: rgba(167, 139, 250, 0.09);
    border-color: rgba(167, 139, 250, 0.42);
}
html.portal-theme-dark body .reg-kpi-card--red {
    --kpi-hex-fade-1: rgba(251, 113, 133, 0.22);
    --kpi-hex-fade-2: rgba(251, 113, 133, 0.15);
    --kpi-hex-fade-3: rgba(251, 113, 133, 0.09);
    border-color: rgba(251, 113, 133, 0.42);
}
html.portal-theme-dark body .portal-filter-bar {
    background: #111827;
    border-color: #1f2937;
}
html.portal-theme-dark body .form-text a {
    color: #93c5fd;
}
html.portal-theme-dark body .form-text a:hover {
    color: #bfdbfe;
}
html.portal-theme-dark body .text-primary {
    color: #93c5fd !important;
}
html.portal-theme-dark body .btn-outline-primary {
    color: #93c5fd;
    border-color: #3b82f6;
}
html.portal-theme-dark body .btn-outline-primary:hover {
    background: rgba(59, 130, 246, 0.2);
    color: #bfdbfe;
}
html.portal-theme-dark body .portal-heat-filter-item .tone-road,
html.portal-theme-dark body .portal-heat-filter-item .tone-icons {
    color: #93c5fd;
}
html.portal-theme-dark body .portal-heat-filter-item .tone-flood { color: #2dd4bf; }
html.portal-theme-dark body .portal-heat-filter-item .tone-sanitation { color: #4ade80; }
html.portal-theme-dark body .portal-heat-filter-item .tone-drainage { color: #c4b5fd; }
html.portal-theme-dark body .portal-heat-filter-item .tone-lighting { color: #facc15; }
html.portal-theme-dark body .portal-heat-filter-item .tone-others { color: #cbd5e1; }
html.portal-theme-dark body .table code,
html.portal-theme-dark body .reg-table code {
    color: #fca5a5;
}

/* ========== Cases queue mockup (premium intake desk) ========== */
.cases-mock {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cases-mock__intro {
    display: flex;
    justify-content: flex-end;
    margin-bottom: -0.35rem;
}

.cases-mock__banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.85rem 1.05rem;
    border-radius: 14px;
    border: 1px solid rgba(147, 197, 253, 0.55);
    background: linear-gradient(120deg, #eff6ff 0%, #f8fbff 55%, #ffffff 100%);
}

.cases-mock__banner-copy {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    max-width: 52rem;
}

.cases-mock__banner-copy > i {
    color: #2563eb;
    font-size: 1.1rem;
    margin-top: 0.15rem;
}

.cases-mock__banner-copy strong {
    display: block;
    font-size: 0.82rem;
    color: #0f172a;
}

.cases-mock__banner-copy span {
    display: block;
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.4;
}

.cases-mock__kpis {
    margin-bottom: 0;
}

.cases-mock__flow {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    padding: 0.65rem 0.85rem;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #e8eef6;
}

.cases-mock__flow-step {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.cases-mock__flow-step i { font-size: 0.85rem; }

.cases-mock__flow-step.is-done {
    color: #15803d;
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.cases-mock__flow-step.is-active {
    color: #1d4ed8;
    background: #eff6ff;
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.cases-mock__flow-sep {
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, #cbd5e1, #e2e8f0);
}

.cases-mock__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #e8eef6;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.cases-mock__toolbar--simple {
    align-items: flex-end;
}

.cases-mock__toolbar--simple .cases-mock__search {
    flex: 1 1 240px;
    min-width: 200px;
}

.cases-mock__geo-filters--inline {
    flex: 2 1 28rem;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    align-items: flex-end;
}

.cases-mock__geo-filters--inline .cases-mock__geo-field {
    min-width: 8.5rem;
    flex: 1 1 8.5rem;
}

.cases-mock__search {
    position: relative;
    flex: 1 1 220px;
    min-width: 200px;
}

.cases-mock__search i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.cases-mock__search input {
    width: 100%;
    height: 40px;
    padding: 0 0.9rem 0 2.2rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 0.85rem;
    color: #64748b;
}

.cases-mock__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.cases-mock__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    height: 34px;
    padding: 0 0.75rem;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #fff;
    font-size: 0.74rem;
    font-weight: 700;
    color: #64748b;
}

.cases-mock__chip em {
    font-style: normal;
    font-size: 0.68rem;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
}

.cases-mock__chip.is-active {
    color: #1d4ed8;
    border-color: #93c5fd;
    background: #eff6ff;
}

.cases-mock__chip.is-active em {
    background: #dbeafe;
    color: #1d4ed8;
}

.cases-mock__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-left: auto;
}

.cases-mock__geo-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid #e8eef6;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.cases-mock__geo-field {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    min-width: 11.5rem;
    flex: 1 1 11.5rem;
}

.cases-mock__geo-field > span {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
}

.cases-mock__geo-select {
    appearance: none;
    height: 40px;
    width: 100%;
    padding: 0 2rem 0 0.75rem;
    border-radius: 10px;
    border: 1px solid #dbe3ef;
    background:
        #fff
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1.2 1.2 6 6l4.8-4.8'/%3E%3C/svg%3E")
        no-repeat right 0.75rem center;
    color: #0f172a;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
}

.cases-mock__geo-select:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background-color: #f8fafc;
}

.cases-mock__geo-select:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.cases-mock__geo-reset {
    height: 40px;
    padding: 0 0.9rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    flex-shrink: 0;
}

.cases-mock__geo-reset:hover {
    border-color: #93c5fd;
    color: #1d4ed8;
    background: #eff6ff;
}

.cases-mock__empty-filter {
    display: grid;
    place-items: center;
    gap: 0.35rem;
    padding: 2.5rem 1.25rem;
    text-align: center;
    color: #64748b;
}

.cases-mock__empty-filter[hidden] {
    display: none !important;
}

.cases-mock__empty-filter i {
    font-size: 1.6rem;
    color: #94a3b8;
}

.cases-mock__empty-filter strong {
    color: #0f172a;
    font-size: 0.95rem;
}

.cases-mock__empty-filter span {
    font-size: 0.8rem;
    max-width: 22rem;
}

.cases-mock__search input:not(:disabled) {
    background: #fff;
    color: #0f172a;
}

.cases-mock__filter-btn {
    height: 34px;
    padding: 0 0.75rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    font-size: 0.74rem;
    font-weight: 700;
    color: #475569;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.cases-mock__workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.95fr);
    gap: 1rem;
    align-items: start;
}

.cases-mock__queue,
.cases-mock__detail {
    margin-bottom: 0;
    padding: 0;
    overflow: hidden;
}

.cases-mock__queue-head {
    padding: 1rem 1.15rem 0.85rem;
    border-bottom: 1px solid #edf2f8;
}

.cases-mock__queue-head h2 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    color: #0a2f7a;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.cases-mock__queue-head p {
    margin: 0.35rem 0 0;
    font-size: 0.76rem;
    color: #94a3b8;
}

.cases-mock__list {
    list-style: none;
    margin: 0;
    padding: 0.45rem;
    max-height: 72vh;
    overflow: auto;
}

.cases-mock__item {
    margin: 0 0 0.4rem;
}

.cases-mock__item-btn {
    width: 100%;
    text-align: left;
    display: flex;
    gap: 0.75rem;
    padding: 0.85rem 0.9rem;
    border-radius: 14px;
    border: 1px solid transparent;
    background: #fff;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.cases-mock__item.is-selected .cases-mock__item-btn {
    border-color: #93c5fd;
    background: linear-gradient(135deg, #f8fbff 0%, #eff6ff 100%);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.08);
}

.cases-mock__item.is-new:not(.is-selected) .cases-mock__item-btn {
    background: #fcfcfd;
    border-color: #eef2f7;
}

.cases-mock__item-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    color: #fff;
    font-size: 1rem;
}

.cases-mock__item-icon--high { background: linear-gradient(145deg, #f87171, #dc2626); }
.cases-mock__item-icon--medium { background: linear-gradient(145deg, #fbbf24, #d97706); }
.cases-mock__item-icon--critical { background: linear-gradient(145deg, #fb7185, #be123c); }
.cases-mock__item-icon--low { background: linear-gradient(145deg, #94a3b8, #64748b); }

.cases-mock__item-main { min-width: 0; flex: 1; }

.cases-mock__item-top {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-bottom: 0.2rem;
}

.cases-mock__id {
    font-size: 0.72rem;
    font-weight: 700;
    color: #b91c1c;
    background: transparent;
}

.cases-mock__pill {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
}

.cases-mock__pill--new {
    color: #1d4ed8;
    background: #dbeafe;
}

.cases-mock__sla {
    margin-left: auto;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}

.cases-mock__sla--ok { color: #15803d; background: #dcfce7; }
.cases-mock__sla--warn { color: #b45309; background: #fef3c7; }
.cases-mock__sla--danger { color: #b91c1c; background: #fee2e2; }

.cases-mock__title {
    display: block;
    font-size: 0.92rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
    margin-bottom: 0.3rem;
}

.cases-mock__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 0.9rem;
    font-size: 0.72rem;
    color: #64748b;
    margin-bottom: 0.45rem;
}

.cases-mock__meta i { margin-right: 0.2rem; color: #94a3b8; }

.cases-mock__item-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.cases-mock__attach {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    margin-left: 0.15rem;
    font-size: 0.7rem;
    color: #64748b;
}

.cases-mock__attach em {
    font-style: normal;
    font-weight: 700;
    margin-right: 0.35rem;
}

.cases-mock__similar {
    font-size: 0.68rem;
    font-weight: 700;
    color: #7c3aed;
    background: #f5f3ff;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
}

.cases-mock__detail {
    position: sticky;
    top: 0.75rem;
    max-height: calc(100vh - 5.5rem);
    overflow: auto;
}

.cases-mock__detail-head {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.1rem 1.15rem 0.9rem;
    border-bottom: 1px solid #edf2f8;
    background:
        radial-gradient(circle at 100% 0%, rgba(59, 130, 246, 0.1) 0%, transparent 42%),
        linear-gradient(180deg, #f8fbff 0%, #fff 100%);
}

.cases-mock__detail-kicker {
    display: block;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.cases-mock__detail-head h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: #0a2f7a;
    letter-spacing: -0.02em;
}

.cases-mock__detail-head p {
    margin: 0.25rem 0 0;
    font-size: 0.88rem;
    font-weight: 700;
    color: #334155;
}

.cases-mock__detail-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
}

.cases-mock__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
    padding: 0.9rem 1.15rem;
    border-bottom: 1px solid #edf2f8;
}

.cases-mock__action {
    height: 38px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    font-size: 0.74rem;
    font-weight: 700;
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    opacity: 0.85;
}

.cases-mock__action--primary {
    background: #0a2f7a;
    border-color: #0a2f7a;
    color: #fff;
}

.cases-mock__action--danger {
    color: #b91c1c;
    border-color: #fecaca;
    background: #fff5f5;
}

.cases-mock__action-note {
    margin: 0.35rem 0 0;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    color: #166534;
    font-size: 0.8rem;
    font-weight: 600;
}

.cases-mock__remarks {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.cases-mock__remarks li {
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.cases-mock__remarks li strong {
    display: block;
    font-size: 0.7rem;
    color: #64748b;
    margin-bottom: 0.2rem;
}

.cases-mock__remarks li span {
    font-size: 0.84rem;
    color: #0f172a;
}

.cases-mock__remarks-empty {
    color: #94a3b8 !important;
    font-size: 0.82rem !important;
    border-style: dashed !important;
}

.cases-action-modal__dialog {
    max-width: 480px;
}

.cases-action-fields {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.cases-action-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.cases-action-field > span {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
}

.cases-action-field select,
.cases-action-field textarea {
    width: 100%;
    border-radius: 10px;
    border: 1px solid #dbe3ef;
    padding: 0.65rem 0.75rem;
    font-size: 0.9rem;
    color: #0f172a;
    background: #fff;
}

.cases-action-field textarea {
    resize: vertical;
    min-height: 96px;
}

.cases-action-warn {
    margin: 0;
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    font-size: 0.86rem;
    line-height: 1.45;
}

.cases-mock__ai {
    margin: 0.95rem 1.15rem 0;
    padding: 0.85rem 0.95rem;
    border-radius: 14px;
    border: 1px solid #c7d2fe;
    background: linear-gradient(145deg, #eef2ff 0%, #f8fafc 70%);
}

.cases-mock__ai-head {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.45rem;
}

.cases-mock__ai-head i { color: #4f46e5; }
.cases-mock__ai-head strong { font-size: 0.8rem; color: #312e81; }
.cases-mock__ai-head span {
    margin-left: auto;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #6366f1;
    background: #e0e7ff;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
}

.cases-mock__ai p {
    margin: 0 0 0.55rem;
    font-size: 0.78rem;
    color: #4338ca;
    line-height: 1.45;
}

.cases-mock__ai ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.3rem;
}

.cases-mock__ai li {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.74rem;
    padding: 0.35rem 0.45rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.7);
}

.cases-mock__ai li span { color: #64748b; }
.cases-mock__ai li strong { color: #0f172a; }

.cases-mock__facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin: 0;
    padding: 1rem 1.15rem;
}

.cases-mock__facts > div {
    min-width: 0;
}

.cases-mock__facts--wide {
    grid-column: 1 / -1;
}

.cases-mock__facts dt {
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.cases-mock__facts dd {
    margin: 0;
    font-size: 0.86rem;
    font-weight: 700;
    color: #0f172a;
}

.cases-mock__facts dd small {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
}

.cases-mock__block {
    padding: 0 1.15rem 1.05rem;
}

.cases-mock__block h3 {
    margin: 0 0 0.45rem;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
}

.cases-mock__block p {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.5;
    color: #334155;
}

.cases-mock__block--muted {
    margin: 0 1.15rem 1.15rem;
    padding: 0.85rem 0.95rem;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px dashed #e2e8f0;
}

.cases-mock__map {
    position: relative;
    height: 120px;
    border-radius: 14px;
    overflow: hidden;
    display: grid;
    place-items: center;
    text-align: center;
    border: 1px solid #dbeafe;
    background:
        radial-gradient(circle at 30% 40%, rgba(59, 130, 246, 0.18), transparent 45%),
        radial-gradient(circle at 70% 60%, rgba(14, 165, 233, 0.12), transparent 40%),
        linear-gradient(160deg, #e0f2fe 0%, #f0f9ff 50%, #e2e8f0 100%);
}

.cases-mock__map-pin {
    position: absolute;
    top: 28%;
    left: 52%;
    transform: translate(-50%, -50%);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #2563eb;
    color: #fff;
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.35);
}

.cases-mock__map span {
    position: relative;
    z-index: 1;
    margin-top: 2.4rem;
    font-size: 0.8rem;
    font-weight: 800;
    color: #0f172a;
}

.cases-mock__map em {
    position: absolute;
    right: 0.65rem;
    bottom: 0.45rem;
    font-size: 0.64rem;
    font-style: normal;
    color: #64748b;
}

.cases-mock__evidence {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 0.55rem;
}

.cases-mock__evidence-tile {
    aspect-ratio: 1;
    border-radius: 12px;
    border: 1px dashed #cbd5e1;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    color: #475569;
    font-size: 0.68rem;
    font-weight: 700;
}

.cases-mock__evidence-tile i { font-size: 1.2rem; }
.cases-mock__evidence-tile em { font-style: normal; color: #94a3b8; font-weight: 600; }
.cases-mock__evidence-tile--photo { border-color: #93c5fd; background: #eff6ff; color: #1d4ed8; }
.cases-mock__evidence-tile--voice { border-color: #c4b5fd; background: #f5f3ff; color: #6d28d9; }
.cases-mock__evidence-tile--file { border-color: #fcd34d; background: #fffbeb; color: #b45309; }

.cases-mock__empty {
    font-size: 0.8rem;
    color: #94a3b8;
}

.cases-mock__steps {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.78rem;
    color: #475569;
    line-height: 1.55;
}

.cases-mock__steps li + li { margin-top: 0.25rem; }

@media (max-width: 1100px) {
    .cases-mock__workspace {
        grid-template-columns: 1fr;
    }

    .cases-mock__detail {
        position: static;
        max-height: none;
    }
}

html.portal-theme-dark body .cases-mock__banner {
    background: linear-gradient(120deg, #152033 0%, #111827 100%);
    border-color: rgba(59, 130, 246, 0.28);
}

html.portal-theme-dark body .cases-mock__banner-copy strong { color: #f8fafc; }
html.portal-theme-dark body .cases-mock__banner-copy span,
html.portal-theme-dark body .cases-mock__queue-head p,
html.portal-theme-dark body .cases-mock__meta,
html.portal-theme-dark body .cases-mock__facts dt { color: #94a3b8; }

html.portal-theme-dark body .cases-mock__flow,
html.portal-theme-dark body .cases-mock__toolbar,
html.portal-theme-dark body .cases-mock__geo-filters,
html.portal-theme-dark body .cases-mock__item-btn {
    background: #111827;
    border-color: #1f2937;
}

html.portal-theme-dark body .cases-mock__item.is-selected .cases-mock__item-btn {
    background: linear-gradient(135deg, #152033 0%, #1a2740 100%);
    border-color: rgba(59, 130, 246, 0.45);
}

html.portal-theme-dark body .cases-mock__title,
html.portal-theme-dark body .cases-mock__facts dd,
html.portal-theme-dark body .cases-mock__detail-head h2,
html.portal-theme-dark body .cases-mock__queue-head h2 { color: #f8fafc; }

html.portal-theme-dark body .cases-mock__detail-head {
    background: linear-gradient(180deg, #152033 0%, #111827 100%);
    border-bottom-color: #1f2937;
}

html.portal-theme-dark body .cases-mock__search input {
    background: #0b1220;
    border-color: #1f2937;
    color: #94a3b8;
}

html.portal-theme-dark body .cases-mock__geo-select,
html.portal-theme-dark body .cases-mock__geo-reset {
    background-color: #1f2937;
    border-color: #374151;
    color: #e2e8f0;
}

html.portal-theme-dark body .cases-mock__geo-select:disabled {
    background-color: #111827;
}

html.portal-theme-dark body .cases-mock__geo-field > span,
html.portal-theme-dark body .cases-mock__empty-filter span {
    color: #94a3b8;
}

html.portal-theme-dark body .cases-mock__empty-filter strong {
    color: #f8fafc;
}

html.portal-theme-dark body .cases-mock__chip,
html.portal-theme-dark body .cases-mock__filter-btn,
html.portal-theme-dark body .cases-mock__flow-step {
    background: #0b1220;
    border-color: #1f2937;
    color: #94a3b8;
}

html.portal-theme-dark body .cases-mock__ai {
    background: linear-gradient(145deg, #1e1b4b 0%, #111827 70%);
    border-color: rgba(129, 140, 248, 0.35);
}

html.portal-theme-dark body .cases-mock__ai p { color: #c7d2fe; }
html.portal-theme-dark body .cases-mock__ai li { background: rgba(15, 23, 42, 0.55); }
html.portal-theme-dark body .cases-mock__ai li strong { color: #f8fafc; }

html.portal-theme-dark body .cases-mock__block p,
html.portal-theme-dark body .cases-mock__detail-head p { color: #cbd5e1; }

html.portal-theme-dark body .cases-mock__block--muted {
    background: #0b1220;
    border-color: #1f2937;
}

html.portal-theme-dark body .cases-mock__map {
    border-color: #1e3a5f;
    background:
        radial-gradient(circle at 30% 40%, rgba(59, 130, 246, 0.25), transparent 45%),
        linear-gradient(160deg, #0f172a 0%, #1e293b 100%);
}

html.portal-theme-dark body .cases-mock__map span { color: #e2e8f0; }

html.portal-theme-dark body .cases-mock__evidence-tile {
    background: #0b1220;
    border-color: #1f2937;
    color: #94a3b8;
}

html.portal-theme-dark body .cases-mock__action {
    background: #0b1220;
    border-color: #1f2937;
    color: #e2e8f0;
}

html.portal-theme-dark body .cases-mock__action--primary {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

/* ========== Reports & Analytics mock ========== */
.reports-mock {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.reports-mock__toolbar--premium {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    border-radius: 16px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.reports-mock__toolbar-left {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.85rem 1.1rem;
    min-width: 0;
}

.reports-mock__toolbar-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.reports-mock__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 0.15rem;
}

.reports-mock__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.reports-mock__kpis {
    margin-bottom: 0;
}

.reports-mock__delta {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    margin-top: 0.35rem;
    font-size: 0.68rem;
    font-weight: 700;
}

.reports-mock__delta--up { color: #15803d; }
.reports-mock__delta--down { color: #b91c1c; }

.reports-mock__hero {
    margin: 0;
}

.reports-mock__chart-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.reports-mock__legend-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin: 0 0 0.35rem;
    font-size: 0.74rem;
    font-weight: 650;
    color: #64748b;
}

.reports-mock__legend-inline span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.reports-mock__swatch {
    display: inline-block;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 3px;
}

.reports-mock__swatch--received { background: #2563eb; }
.reports-mock__swatch--resolved { background: #0f766e; }
.reports-mock__swatch--breach { background: #e11d48; }

.reports-mock__trend-wrap {
    height: 320px;
}

.reports-mock__cat-wrap,
.reports-mock__age-wrap {
    height: 280px;
}

.reports-mock__grid--premium {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.reports-mock__wide {
    grid-column: 1 / -1;
}

.reports-mock__link-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 0.65rem 0 0;
    font-size: 0.8rem;
}

.reports-mock__link-row a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}

.reports-mock__link-row a:hover {
    text-decoration: underline;
}

.reports-mock__hotspots--premium {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.55rem;
}

.reports-mock__hotspots--premium li {
    display: grid;
    grid-template-columns: 1.6rem minmax(0, 1.2fr) minmax(3.5rem, 0.8fr) 2rem;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.6rem;
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
}

.reports-mock__rank {
    display: inline-grid;
    place-items: center;
    width: 1.45rem;
    height: 1.45rem;
    border-radius: 8px;
    background: linear-gradient(145deg, #0a2f7a 0%, #2563eb 100%);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
}

.reports-mock__hotspots--premium strong {
    display: block;
    font-size: 0.78rem;
    color: #0f172a;
    line-height: 1.25;
}

.reports-mock__hotspots--premium em {
    display: block;
    font-style: normal;
    font-size: 0.66rem;
    color: #94a3b8;
    font-weight: 600;
}

.reports-mock__hot-bar {
    height: 0.45rem;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.reports-mock__hot-bar span {
    display: block;
    height: 100%;
    width: var(--w, 40%);
    border-radius: inherit;
    background: linear-gradient(90deg, #2563eb 0%, #60a5fa 100%);
}

.reports-mock__hotspots--premium b {
    text-align: right;
    font-size: 0.82rem;
    color: #0a2f7a;
}

.reports-mock__dept-table td,
.reports-mock__dept-table th {
    vertical-align: middle;
}

.reports-mock__sla-chip {
    display: inline-flex;
    padding: 0.18rem 0.45rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 750;
}

.reports-mock__sla-chip--ok { background: #dcfce7; color: #15803d; }
.reports-mock__sla-chip--warn { background: #fef3c7; color: #b45309; }
.reports-mock__sla-chip--bad { background: #fee2e2; color: #b91c1c; }

.reports-mock__mini-bar {
    width: 4.5rem;
    height: 0.4rem;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.reports-mock__mini-bar span {
    display: block;
    height: 100%;
    width: var(--w, 50%);
    border-radius: inherit;
    background: linear-gradient(90deg, #1d4ed8 0%, #60a5fa 100%);
}

@media (max-width: 1100px) {
    .reports-mock__grid--premium {
        grid-template-columns: 1fr;
    }

    .reports-mock__hotspots--premium li {
        grid-template-columns: 1.6rem minmax(0, 1fr) 2rem;
    }

    .reports-mock__hot-bar {
        display: none;
    }
}

/* Complaint category master — Ionicons (same bundle as mobile forms) */
.portal-category-ionicon {
    font-size: 1.5rem;
    color: #1d4ed8;
    vertical-align: middle;
}

.portal-category-table-icon-cell {
    width: 4rem;
    text-align: center;
}

.portal-category-table-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.65rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.portal-category-icon-picker {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.portal-category-icon-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    padding: 0;
    border-radius: 0.85rem;
    background: #eff6ff;
    border: 2px solid #93c5fd;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.portal-category-icon-preview:hover,
.portal-category-icon-preview:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    outline: none;
}

.portal-category-icon-preview .portal-category-ionicon {
    font-size: 2rem;
}

.portal-category-icon-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
}

.portal-category-icon-name {
    font-size: 0.75rem;
    color: #64748b;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.portal-ionicon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
    gap: 0.5rem;
    max-height: 24rem;
    overflow: auto;
}

.portal-ionicon-pick {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.55rem 0.35rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.65rem;
    background: #fff;
    cursor: pointer;
    min-height: 5rem;
}

.portal-ionicon-pick:hover,
.portal-ionicon-pick:focus {
    border-color: #3b82f6;
    background: #eff6ff;
    outline: none;
}

.portal-ionicon-pick__icon {
    font-size: 1.5rem;
    color: #1d4ed8;
}

.portal-ionicon-pick__label {
    font-size: 0.62rem;
    line-height: 1.2;
    text-align: center;
    color: #64748b;
    word-break: break-all;
}
