:root {
    --brand-red: #b8202a;
    --brand-red-dark: #8f1620;
    --brand-orange: #f59b22;
    --ink: #252525;
    --muted: #6f747b;
    --line: #e9edf2;
    --surface: #ffffff;
    --soft: #f6f7f9;
    --success: #168a56;
    --shadow: 0 18px 48px rgba(32, 32, 32, 0.14);
}

* {
    letter-spacing: 0;
}

body {
    min-height: 100vh;
    color: var(--ink);
    background: var(--soft);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: var(--brand-red);
    text-decoration: none;
}

.mb-1 {
    margin-bottom: 0.25rem !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.p-3 {
    padding: 1rem !important;
}

.py-4 {
    padding-block: 1.5rem !important;
}

.w-100 {
    width: 100% !important;
}

.small,
small {
    font-size: 0.82rem;
}

.text-muted {
    color: var(--muted) !important;
}

.text-center {
    text-align: center !important;
}

.text-end {
    text-align: right !important;
}

.text-uppercase {
    text-transform: uppercase !important;
}

.fw-bold {
    font-weight: 800 !important;
}

.fs-5 {
    font-size: 1.15rem !important;
}

.opacity-75 {
    opacity: 0.75;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1.2;
    transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.72;
    transform: none;
}

.btn-sm {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 0.8rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table > :not(caption) > * > * {
    border-bottom: 1px solid var(--line);
}

.table-hover tbody tr:hover {
    background: #fffaf5;
}

.table-striped tbody tr:nth-child(odd) {
    background: #fbf7f2;
}

.table-striped tbody tr:nth-child(even) {
    background: #ffffff;
}

.table-striped.table-hover tbody tr:hover {
    background: #fff0df;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(320px, 0.84fr) minmax(360px, 1.16fr);
    background:
        radial-gradient(circle at 12% 18%, rgba(245, 155, 34, 0.2), transparent 25%),
        linear-gradient(135deg, #fff 0%, #f9f5ef 48%, #f3f4f6 100%);
    overflow: hidden;
}

.auth-visual {
    position: relative;
    padding: 30px;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(142, 22, 32, 0.94), rgba(184, 32, 42, 0.88)),
        url("../images/logo/logo.png") center 54% / 72% auto no-repeat;
    isolation: isolate;
}

.auth-visual::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, rgba(0, 0, 0, 0.26), rgba(0, 0, 0, 0.03));
    z-index: -1;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-brand img,
.app-logo {
    height: 42px;
    width: auto;
    object-fit: contain;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}

.brand-mark img {
    max-width: 38px;
    max-height: 38px;
}

.auth-copy {
    position: absolute;
    left: 30px;
    right: 30px;
    bottom: 30px;
}

.auth-tagline {
    width: max-content;
    max-width: 100%;
    margin-bottom: 13px;
    padding: 7px 10px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.88);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(12px);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.auth-copy h1 {
    max-width: 560px;
    margin: 0 0 12px;
    font-size: clamp(2rem, 4vw, 4.15rem);
    line-height: 1.02;
    font-weight: 800;
}

.auth-copy p {
    max-width: 520px;
    margin: 0;
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.98rem;
}

.auth-points {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    max-width: 650px;
    margin-top: 24px;
}

.auth-point {
    min-height: 112px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.07)),
        rgba(32, 18, 21, 0.16);
    box-shadow: 0 16px 34px rgba(40, 12, 16, 0.18);
    backdrop-filter: blur(16px);
}

.auth-point span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 22px;
    margin-bottom: 10px;
    border-radius: 6px;
    color: #ffd8b2;
    background: rgba(245, 155, 34, 0.16);
    font-size: 0.66rem;
    font-weight: 900;
}

.auth-point strong {
    display: block;
    color: #fff;
    font-size: 0.82rem;
    line-height: 1.2;
}

.auth-point small {
    display: block;
    margin-top: 5px;
    color: rgba(255, 255, 255, 0.74);
    font-size: 0.72rem;
    line-height: 1.35;
}

.portal-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
}

.portal-chip {
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 8px;
    padding: 7px 10px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    backdrop-filter: blur(12px);
}

.auth-panel-wrap {
    display: grid;
    align-items: center;
    padding: 30px;
}

.login-card {
    width: min(100%, 430px);
    margin-inline: auto;
    border: 1px solid rgba(184, 32, 42, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    animation: riseIn 520ms ease both;
}

.login-card-header {
    padding: 22px 22px 12px;
    border-bottom: 1px solid var(--line);
}

.login-card-body {
    padding: 22px;
}

.eyebrow {
    margin-bottom: 6px;
    color: var(--brand-red);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
}

.compact-title {
    margin: 0;
    font-size: 1.42rem;
    font-weight: 800;
}

.compact-subtitle {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.form-label {
    margin-bottom: 6px;
    font-size: 0.82rem;
    font-weight: 700;
}

.form-control,
.form-select {
    min-height: 42px;
    border-color: #dce1e7;
    border-radius: 6px;
    font-size: 0.92rem;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(184, 32, 42, 0.52);
    box-shadow: 0 0 0 0.2rem rgba(184, 32, 42, 0.1);
}

.btn-brand {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--brand-red);
    --bs-btn-border-color: var(--brand-red);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--brand-red-dark);
    --bs-btn-hover-border-color: var(--brand-red-dark);
    color: #fff;
    background: var(--brand-red);
    border-color: var(--brand-red);
    min-height: 42px;
    border-radius: 6px;
    font-weight: 800;
    box-shadow: 0 12px 24px rgba(184, 32, 42, 0.22);
}

.btn-brand:hover {
    color: #fff;
    background: var(--brand-red-dark);
    border-color: var(--brand-red-dark);
}

.btn-soft {
    --bs-btn-color: var(--brand-red);
    --bs-btn-bg: #fff2ee;
    --bs-btn-border-color: #ffd8c5;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--brand-red);
    --bs-btn-hover-border-color: var(--brand-red);
    color: var(--brand-red);
    background: #fff2ee;
    border-color: #ffd8c5;
    border-radius: 6px;
    font-weight: 700;
}

.btn-soft:hover {
    color: #fff;
    background: var(--brand-red);
    border-color: var(--brand-red);
}

.mpin-box {
    font-size: 1.25rem;
    font-weight: 800;
    text-align: center;
}

.secure-note {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 14px;
    color: var(--muted);
    font-size: 0.78rem;
}

.policy-link-strip {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px;
    margin-top: 15px;
    padding-top: 13px;
    border-top: 1px solid rgba(222, 226, 230, 0.72);
}

.policy-link-btn {
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid rgba(184, 32, 42, 0.18);
    border-radius: 8px;
    color: #8f1620;
    background: linear-gradient(135deg, rgba(255, 248, 244, 0.96), rgba(255, 255, 255, 0.96));
    box-shadow: 0 8px 18px rgba(184, 32, 42, 0.06);
    font-size: 0.72rem;
    font-weight: 850;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.policy-link-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(184, 32, 42, 0.32);
    box-shadow: 0 12px 24px rgba(184, 32, 42, 0.12);
}

.policy-modal {
    max-width: 780px;
}

.legal-content {
    display: grid;
    gap: 12px;
    color: #444950;
    font-size: 0.88rem;
    line-height: 1.58;
}

.legal-content p {
    margin: 0;
}

.legal-content h3 {
    margin: 8px 0 -4px;
    color: #8f1620;
    font-size: 0.92rem;
    font-weight: 900;
}

.pulse-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--success);
    box-shadow: 0 0 0 0 rgba(22, 138, 86, 0.42);
    animation: pulse 1.8s infinite;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 248px 1fr;
    background: #f5f6f8;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 16px;
    background: linear-gradient(180deg, #fff 0%, #fff7ef 100%);
    border-right: 1px solid var(--line);
}

.sidebar-brand {
    display: block;
    min-height: 54px;
    margin-bottom: 14px;
}

.sidebar-brand span {
    display: block;
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 700;
}

.nav-stack {
    display: grid;
    gap: 7px;
}

.sidebar-footer {
    display: grid;
    gap: 10px;
    margin-top: auto;
    padding-top: 14px;
}

.session-card {
    padding: 12px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.76);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.session-dot-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: #fff;
    font-size: 0.82rem;
}

.session-card dl {
    display: grid;
    gap: 8px;
    margin: 0;
}

.session-card dt {
    color: rgba(255, 255, 255, 0.48);
    font-size: 0.68rem;
    font-weight: 850;
    text-transform: uppercase;
}

.session-card dd {
    margin: 2px 0 0;
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.78rem;
    line-height: 1.35;
    word-break: break-word;
}

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 44px;
    padding: 9px 11px;
    border-radius: 7px;
    color: #fff;
    background: linear-gradient(135deg, rgba(184, 32, 42, 0.9), rgba(143, 22, 32, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.88rem;
    font-weight: 850;
}

.sidebar-logout:hover {
    color: #fff;
    background: linear-gradient(135deg, #b8202a, #f59b22);
}

.nav-item-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 40px;
    padding: 9px 11px;
    border-radius: 7px;
    color: #3a3d42;
    font-size: 0.88rem;
    font-weight: 700;
}

.nav-item-link:hover,
.nav-item-link.active {
    color: var(--brand-red);
    background: #fff2e3;
}

.nav-count-badge {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    height: 22px;
    margin-left: auto;
    padding: 0 7px;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, #168a56, #44c18a);
    border: 1px solid rgba(255, 255, 255, 0.36);
    box-shadow: 0 8px 18px rgba(22, 138, 86, 0.18);
    font-size: 0.68rem;
    font-weight: 850;
}

.nav-item-link .nav-icon {
    flex: 0 0 auto;
}

.nav-item-link > span:not(.nav-icon) {
    margin-right: auto;
}

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

.topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 64px;
    padding: 12px 22px;
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
}

.page-wrap {
    flex: 1;
    padding: 18px 22px 28px;
}

.body-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 54px;
    margin: 0 22px 18px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 12px 26px rgba(31, 32, 36, 0.04);
    backdrop-filter: blur(14px);
    font-size: 0.78rem;
}

.body-footer div {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
}

.body-footer strong {
    color: var(--brand-red);
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.page-title {
    margin: 0;
    font-size: 1.42rem;
    font-weight: 850;
}

.page-kicker {
    margin: 0 0 4px;
    color: var(--brand-red);
    font-size: 0.75rem;
    font-weight: 850;
    text-transform: uppercase;
}

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

.metric-card,
.panel-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 10px 24px rgba(29, 31, 35, 0.05);
}

.metric-card {
    position: relative;
    min-height: 96px;
    padding: 14px;
    overflow: hidden;
}

.metric-card::after {
    content: "";
    position: absolute;
    right: -18px;
    top: -18px;
    width: 74px;
    height: 74px;
    border-radius: 50%;
    background: rgba(245, 155, 34, 0.18);
}

.metric-label {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.metric-value {
    margin-top: 6px;
    font-size: 1.75rem;
    font-weight: 850;
}

.panel-card {
    overflow: hidden;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
}

.panel-title {
    margin: 0;
    font-size: 0.96rem;
    font-weight: 850;
}

.table-compact {
    margin: 0;
    font-size: 0.84rem;
}

.table-compact th {
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    white-space: nowrap;
}

.table-compact td,
.table-compact th {
    padding: 0.68rem 0.78rem;
    vertical-align: middle;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #edf9f3;
    color: var(--success);
    font-size: 0.72rem;
    font-weight: 800;
}

.status-pill.inactive,
.status-pill.suspended {
    background: #fff1f1;
    color: var(--brand-red);
}

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

.form-grid .span-2 {
    grid-column: span 2;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--brand-red), var(--brand-orange));
    color: #fff;
    font-weight: 850;
}

@keyframes riseIn {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(22, 138, 86, 0.42);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(22, 138, 86, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(22, 138, 86, 0);
    }
}

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

    .auth-visual {
        min-height: 280px;
    }

    .auth-copy {
        position: static;
        margin-top: 52px;
    }

    .auth-points {
        grid-template-columns: 1fr;
        max-width: 520px;
    }

    .auth-point {
        min-height: auto;
    }

    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        height: auto;
        padding: 12px 14px;
    }

    .sidebar-footer {
        margin-top: 12px;
    }

    .nav-stack {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

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

@media (max-width: 575.98px) {
    .auth-panel-wrap,
    .auth-visual,
    .page-wrap,
    .topbar {
        padding-inline: 14px;
    }

    .auth-visual {
        min-height: 245px;
    }

    .auth-copy h1 {
        font-size: 2rem;
    }

    .auth-tagline {
        margin-bottom: 10px;
        padding: 6px 8px;
        font-size: 0.62rem;
    }

    .auth-copy p {
        font-size: 0.86rem;
    }

    .auth-points {
        gap: 7px;
        margin-top: 16px;
    }

    .auth-point {
        padding: 9px 10px;
    }

    .login-card-body,
    .login-card-header {
        padding-inline: 16px;
    }

    .policy-link-strip {
        gap: 6px;
        margin-top: 12px;
        padding-top: 11px;
    }

    .policy-link-btn {
        flex: 1 1 calc(50% - 6px);
        min-height: 30px;
        padding: 6px 8px;
        font-size: 0.66rem;
    }

    .policy-link-btn:last-child {
        flex-basis: 100%;
    }

    .nav-stack,
    .metric-grid,
    .form-grid,
    .form-grid .span-2 {
        grid-template-columns: 1fr;
        grid-column: auto;
    }

    .page-head,
    .topbar,
    .form-actions {
        align-items: stretch;
        flex-direction: column;
    }
}

body.modal-active {
    overflow: hidden;
}

.app-shell {
    grid-template-columns: 270px 1fr;
    background:
        linear-gradient(135deg, #f7f4ef 0%, #f8f8fa 42%, #eef4f1 100%);
}

.sidebar {
    background:
        linear-gradient(180deg, #201719 0%, #2c171b 42%, #121212 100%);
    border-right: 0;
    box-shadow: 16px 0 36px rgba(22, 18, 18, 0.12);
}

.sidebar-brand {
    min-height: 76px;
    padding: 4px 0 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.sidebar-brand .app-logo {
    width: min(100%, 222px);
    height: auto;
    max-height: 68px;
    object-fit: contain;
    object-position: left center;
}

.nav-stack {
    gap: 9px;
}

.nav-item-link {
    justify-content: flex-start;
    gap: 11px;
    min-height: 46px;
    color: rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-item-link:hover,
.nav-item-link.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(184, 32, 42, 0.88), rgba(245, 155, 34, 0.72));
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: 0 14px 26px rgba(184, 32, 42, 0.22);
}

.nav-icon,
.metric-icon {
    position: relative;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.1);
}

.nav-icon::before,
.nav-icon::after,
.metric-icon::before,
.metric-icon::after {
    content: "";
    position: absolute;
    background: currentColor;
}

.dashboard-icon::before {
    inset: 7px 14px 14px 7px;
}

.dashboard-icon::after {
    inset: 14px 7px 7px 14px;
}

.users-icon::before {
    width: 8px;
    height: 8px;
    left: 7px;
    top: 7px;
    border-radius: 50%;
}

.users-icon::after {
    width: 14px;
    height: 7px;
    left: 7px;
    bottom: 7px;
    border-radius: 7px 7px 3px 3px;
}

.logout-icon::before {
    width: 14px;
    height: 2px;
    right: 6px;
    top: 13px;
}

.logout-icon::after {
    width: 8px;
    height: 8px;
    right: 6px;
    top: 9px;
    transform: rotate(45deg);
    background: transparent;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
}

.analytics-icon::before {
    width: 4px;
    height: 14px;
    left: 7px;
    bottom: 7px;
}

.analytics-icon::after {
    width: 4px;
    height: 20px;
    left: 15px;
    bottom: 7px;
    box-shadow: 8px 6px 0 currentColor;
}

.nsdl-icon::before {
    left: 6px;
    top: 7px;
    width: 16px;
    height: 12px;
    border-radius: 2px;
    background: transparent;
    border: 2px solid currentColor;
}

.nsdl-icon::after {
    left: 9px;
    top: 12px;
    width: 10px;
    height: 2px;
    box-shadow: 0 4px 0 currentColor;
}

.logs-icon::before {
    width: 16px;
    height: 14px;
    left: 7px;
    top: 7px;
    background: transparent;
    border: 2px solid currentColor;
    border-radius: 2px;
}

.logs-icon::after {
    width: 10px;
    height: 2px;
    left: 10px;
    top: 13px;
    box-shadow: 0 4px 0 currentColor;
}

.topbar {
    min-height: 72px;
    padding: 14px 24px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 12px 30px rgba(31, 32, 36, 0.05);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.notification-bell {
    position: relative;
}

.notification-bell summary {
    position: relative;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid #f0d3c0;
    border-radius: 7px;
    color: var(--brand-red);
    background: #fff7ef;
    cursor: pointer;
    list-style: none;
    box-shadow: 0 8px 18px rgba(184, 32, 42, 0.1);
}

.notification-bell summary::-webkit-details-marker {
    display: none;
}

.notification-bell summary b {
    position: absolute;
    top: -6px;
    right: -6px;
    display: grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border: 2px solid #fff;
    border-radius: 999px;
    color: #fff;
    background: var(--brand-red);
    font-size: 0.56rem;
    font-weight: 950;
}

.bell-icon {
    position: relative;
    width: 15px;
    height: 16px;
    border: 2px solid currentColor;
    border-bottom: 0;
    border-radius: 9px 9px 4px 4px;
}

.bell-icon::before,
.bell-icon::after {
    content: "";
    position: absolute;
    left: 50%;
    background: currentColor;
    transform: translateX(-50%);
}

.bell-icon::before {
    top: -5px;
    width: 5px;
    height: 4px;
    border-radius: 4px 4px 0 0;
}

.bell-icon::after {
    bottom: -5px;
    width: 6px;
    height: 3px;
    border-radius: 0 0 5px 5px;
}

.notification-popover {
    position: absolute;
    top: calc(100% + 9px);
    right: 0;
    z-index: 20;
    width: min(340px, calc(100vw - 28px));
    overflow: hidden;
    border: 1px solid #ead8ca;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 22px 44px rgba(29, 31, 35, 0.16);
}

.notification-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 10px;
    border-bottom: 1px solid #f0e1d5;
    background: #fff8f1;
}

.notification-head strong {
    font-size: 0.78rem;
}

.notification-head button {
    border: 0;
    color: var(--brand-red);
    background: transparent;
    font-size: 0.68rem;
    font-weight: 900;
}

.notification-list {
    display: grid;
    max-height: 320px;
    overflow: auto;
}

.notification-item {
    display: grid;
    gap: 3px;
    padding: 9px 10px;
    border-bottom: 1px solid #f4e8dc;
    text-decoration: none;
}

.notification-item:hover {
    background: #fffaf5;
}

.notification-item.unread {
    box-shadow: inset 3px 0 0 var(--brand-red);
}

.notification-item.refund.unread {
    box-shadow: inset 3px 0 0 #f0a42b;
}

.notification-item.dispute.unread {
    box-shadow: inset 3px 0 0 #b8202a;
}

.notification-item span {
    color: var(--brand-red);
    font-size: 0.62rem;
    font-weight: 950;
    text-transform: uppercase;
}

.notification-item strong {
    color: var(--text);
    font-size: 0.72rem;
    line-height: 1.25;
}

.notification-item small,
.notification-empty {
    color: var(--muted);
    font-size: 0.64rem;
}

.notification-empty {
    padding: 12px;
    text-align: center;
}

.env-badge {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 5px 11px;
    border-radius: 999px;
    color: #8f1620;
    background: #fff1e2;
    border: 1px solid #ffd8b0;
    font-size: 0.78rem;
    font-weight: 850;
}

.dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
    padding: 18px;
    border-radius: 8px;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(143, 22, 32, 0.96), rgba(184, 32, 42, 0.9) 52%, rgba(245, 155, 34, 0.9)),
        linear-gradient(90deg, #1f1f1f, #3b2222);
    box-shadow: 0 18px 40px rgba(143, 22, 32, 0.2);
}

.dashboard-hero .page-kicker {
    color: #ffe1b5;
}

.dashboard-hero h2 {
    max-width: 780px;
    margin: 0;
    font-size: clamp(1.2rem, 2vw, 1.82rem);
    font-weight: 850;
}

.dashboard-hero p:last-child {
    max-width: 760px;
    margin: 7px 0 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.9rem;
}

.btn-contrast {
    color: #8f1620;
    background: #fff;
    border-color: rgba(255, 255, 255, 0.72);
    font-weight: 850;
}

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

.number-card {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 82px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(29, 31, 35, 0.045);
}

.number-card > span {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    color: #8f1620;
    background: #fff4ed;
    border: 1px solid #ffd9c4;
    font-size: 0.72rem;
    font-weight: 850;
}

.number-card strong {
    display: block;
    color: var(--ink);
    font-size: 1.38rem;
    line-height: 1;
    font-weight: 850;
}

.number-card em {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.68rem;
    font-style: normal;
    font-weight: 850;
    text-transform: uppercase;
}

.number-card small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.25;
}

.number-card.accent-green > span {
    color: #137a4d;
    background: #e9f8f1;
    border-color: #bfe8d3;
}

.number-card.accent-orange > span {
    color: #b44b00;
    background: #fff8ef;
    border-color: #f8d7ad;
}

.number-card.accent-dark > span {
    color: #3a3d42;
    background: #eef1f4;
    border-color: #d8dde4;
}

.pulse-dashboard-widget {
    margin-bottom: 12px;
}

.pulse-widget-body {
    display: grid;
    grid-template-columns: 260px minmax(0, 0.75fr) minmax(360px, 1.25fr);
    gap: 10px;
    padding: 10px;
}

.pulse-widget-score,
.pulse-widget-stats > div,
.pulse-widget-row {
    border: 1px solid #edf1f5;
    border-radius: 8px;
    background: linear-gradient(180deg, #fff, #fbfcfd);
}

.pulse-widget-score {
    display: grid;
    align-content: center;
    min-height: 120px;
    padding: 12px;
    box-shadow: inset 4px 0 0 #22a06b;
}

.pulse-widget-score span,
.pulse-widget-stats span {
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 900;
    text-transform: uppercase;
}

.pulse-widget-score strong {
    margin-top: 3px;
    color: #137a4d;
    font-size: 2rem;
    line-height: 1;
    font-weight: 900;
}

.pulse-widget-score small,
.pulse-widget-score em {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 0.72rem;
    font-style: normal;
}

.pulse-widget-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.pulse-widget-stats > div {
    min-height: 58px;
    padding: 9px;
}

.pulse-widget-stats strong {
    display: block;
    color: var(--ink);
    font-size: 1.12rem;
    line-height: 1.1;
}

.pulse-widget-stats small {
    color: var(--muted);
    font-size: 0.68rem;
}

.pulse-widget-list {
    display: grid;
    gap: 6px;
}

.pulse-widget-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 62px auto;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 6px 8px;
}

.pulse-widget-row > span {
    color: #8f1620;
    font-size: 0.68rem;
    font-weight: 850;
}

.pulse-widget-row strong {
    overflow: hidden;
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pulse-widget-row small {
    color: var(--muted);
    font-size: 0.7rem;
}

.pulse-widget-row .status-pill {
    font-style: normal;
    white-space: nowrap;
}

.metric-grid.premium-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 118px;
    padding: 15px;
    overflow: hidden;
}

.metric-card::after {
    display: none;
}

.metric-card small {
    color: var(--muted);
    font-size: 0.76rem;
}

.metric-icon {
    width: 44px;
    height: 44px;
    color: #fff;
    border-radius: 8px;
}

.metric-card-red .metric-icon {
    background: linear-gradient(135deg, #b8202a, #f59b22);
}

.metric-card-green .metric-icon {
    background: linear-gradient(135deg, #168a56, #44c18a);
}

.metric-card-orange .metric-icon {
    background: linear-gradient(135deg, #f59b22, #b8202a);
}

.metric-card-dark .metric-icon {
    background: linear-gradient(135deg, #262626, #6a3538);
}

.total-icon::before,
.portal-icon::before {
    inset: 11px 12px;
    border-radius: 3px;
    background: transparent;
    border: 2px solid currentColor;
}

.active-icon::before {
    width: 20px;
    height: 10px;
    left: 12px;
    top: 14px;
    background: transparent;
    border-left: 3px solid currentColor;
    border-bottom: 3px solid currentColor;
    transform: rotate(-45deg);
}

.lock-icon::before {
    width: 20px;
    height: 16px;
    left: 12px;
    bottom: 10px;
    border-radius: 3px;
}

.lock-icon::after {
    width: 16px;
    height: 16px;
    left: 14px;
    top: 9px;
    background: transparent;
    border: 3px solid currentColor;
    border-bottom: 0;
    border-radius: 12px 12px 0 0;
}

.insight-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 14px;
}

.portal-code {
    display: inline-flex;
    min-height: 25px;
    align-items: center;
    padding: 3px 8px;
    margin-right: 6px;
    border-radius: 6px;
    color: #8f1620;
    background: #fff1e2;
    border: 1px solid #ffd8b0;
    font-size: 0.74rem;
    font-weight: 850;
}

.portal-list {
    display: grid;
    gap: 10px;
    padding: 14px;
}

.portal-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    padding: 9px 10px;
    border-radius: 7px;
    background: #faf6f1;
    border: 1px solid #f0e4d7;
}

.portal-row span {
    color: #8f1620;
    font-weight: 900;
}

.portal-row strong {
    font-size: 0.82rem;
}

.workspace-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 48px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.76);
    backdrop-filter: blur(14px);
}

.toolbar-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.toolbar-pills span {
    min-height: 26px;
    padding: 4px 8px;
    border-radius: 999px;
    color: #8f1620;
    background: #fff1e2;
    font-size: 0.75rem;
    font-weight: 850;
}

.user-workspace {
    box-shadow: 0 18px 42px rgba(32, 32, 32, 0.08);
}

.modal-shell {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.modal-shell.is-open {
    display: flex;
}

.modal-scrim {
    position: absolute;
    inset: 0;
    background: rgba(18, 18, 18, 0.54);
    backdrop-filter: blur(10px);
}

.premium-modal {
    position: relative;
    width: min(100%, 940px);
    max-height: min(86vh, 760px);
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 26px 70px rgba(15, 15, 15, 0.3);
    animation: modalRise 220ms ease both;
    overflow: hidden;
}

.premium-modal-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px;
    color: #fff;
    background: linear-gradient(135deg, #8f1620, #b8202a 58%, #f59b22);
}

.premium-modal-head h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 900;
}

.premium-modal-head span {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.84rem;
}

.premium-modal-head .page-kicker {
    color: #ffe4bd;
}

.modal-close {
    position: relative;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
}

.modal-close::before,
.modal-close::after {
    content: "";
    position: absolute;
    left: 9px;
    top: 16px;
    width: 16px;
    height: 2px;
    background: #fff;
}

.modal-close::before {
    transform: rotate(45deg);
}

.modal-close::after {
    transform: rotate(-45deg);
}

.premium-modal-body {
    overflow-y: auto;
    padding: 18px 20px 20px;
}

.form-section-title {
    margin: 10px 0 10px;
    color: #8f1620;
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
}

.modal-actions {
    position: sticky;
    bottom: -20px;
    margin-inline: -20px;
    padding: 14px 20px 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), #fff 42%);
}

@keyframes modalRise {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 991.98px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        position: sticky;
        z-index: 8;
        top: 0;
        height: auto;
        border-radius: 0 0 10px 10px;
    }

    .sidebar-brand {
        min-height: 54px;
        margin-bottom: 10px;
        padding-bottom: 10px;
    }

    .nav-stack {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .sidebar-footer {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: stretch;
    }

    .sidebar-logout {
        justify-content: center;
        min-width: 132px;
    }

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

    .nav-item-link {
        justify-content: center;
    }

    .topbar {
        position: static;
    }

    .dashboard-hero,
    .page-head,
    .workspace-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

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

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

@media (max-width: 575.98px) {
    .nav-stack {
        grid-template-columns: 1fr;
    }

    .sidebar-footer,
    .session-card dl {
        grid-template-columns: 1fr;
    }

    .sidebar-logout {
        min-width: 0;
    }

    .nav-item-link {
        justify-content: flex-start;
    }

    .topbar-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .metric-grid.premium-metrics,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .premium-modal {
        max-height: 92vh;
    }

    .body-footer {
        align-items: flex-start;
        flex-direction: column;
        margin-inline: 14px;
    }

    .premium-modal-head,
    .premium-modal-body {
        padding-inline: 14px;
    }

    .modal-actions {
        align-items: stretch;
        margin-inline: -14px;
        padding-inline: 14px;
    }
}

/* Compact HD protected-app theme */
.app-shell {
    grid-template-columns: 220px 1fr;
}

.sidebar {
    padding: 12px;
}

.sidebar-brand {
    min-height: 58px;
    margin-bottom: 10px;
    padding: 0 0 10px;
}

.sidebar-brand .app-logo {
    width: 176px;
    max-height: 50px;
}

.nav-stack {
    gap: 7px;
}

.nav-item-link,
.sidebar-logout {
    min-height: 36px;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
}

.nav-icon,
.metric-icon {
    width: 25px;
    height: 25px;
    border-radius: 6px;
}

.sidebar-footer {
    gap: 7px;
    padding-top: 10px;
}

.session-card {
    padding: 8px;
    border-radius: 7px;
}

.session-dot-row {
    gap: 7px;
    margin-bottom: 6px;
    font-size: 0.76rem;
}

.session-card dl {
    gap: 5px;
}

.session-card dt {
    font-size: 0.62rem;
}

.session-card dd {
    font-size: 0.7rem;
}

.topbar {
    min-height: 54px;
    padding: 8px 16px;
}

.page-title {
    font-size: 1.25rem;
}

.page-kicker {
    margin-bottom: 2px;
    font-size: 0.68rem;
}

.env-badge {
    min-height: 26px;
    padding: 3px 9px;
    font-size: 0.72rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 7px;
}

.user-badge {
    gap: 8px;
}

.user-badge .fw-bold {
    font-size: 0.88rem;
}

.user-badge small {
    font-size: 0.72rem;
}

.page-wrap {
    padding: 10px 16px 12px;
}

.dashboard-hero {
    min-height: 108px;
    margin-bottom: 9px;
    padding: 12px 14px;
    border-radius: 7px;
    box-shadow: 0 10px 26px rgba(143, 22, 32, 0.16);
    animation: compactFadeUp 260ms ease both;
}

.ops-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 8px;
}

.ops-strip div {
    min-height: 44px;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 8px 18px rgba(29, 31, 35, 0.04);
    animation: compactFadeUp 260ms ease both;
}

.ops-strip span {
    display: block;
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 900;
    text-transform: uppercase;
}

.ops-strip strong {
    display: block;
    margin-top: 2px;
    color: var(--ink);
    font-size: 0.73rem;
    line-height: 1.2;
    word-break: break-word;
}

.dashboard-hero h2 {
    max-width: 760px;
    font-size: 1.28rem;
    line-height: 1.18;
}

.dashboard-hero p:last-child {
    margin-top: 5px;
    font-size: 0.78rem;
}

.btn,
.btn-brand,
.btn-soft,
.btn-contrast {
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
}

.metric-grid,
.metric-grid.premium-metrics {
    gap: 8px;
    margin-bottom: 9px;
}

.metric-card {
    min-height: 78px;
    padding: 10px;
    gap: 9px;
    border-radius: 7px;
    box-shadow: 0 8px 18px rgba(29, 31, 35, 0.045);
    animation: compactFadeUp 260ms ease both;
}

.metric-icon {
    width: 34px;
    height: 34px;
}

.metric-label {
    font-size: 0.66rem;
}

.metric-value {
    margin-top: 2px;
    font-size: 1.35rem;
    line-height: 1.05;
}

.metric-card small {
    font-size: 0.68rem;
}

.total-icon::before,
.portal-icon::before {
    inset: 8px 9px;
}

.active-icon::before {
    width: 16px;
    height: 8px;
    left: 9px;
    top: 10px;
}

.lock-icon::before {
    width: 16px;
    height: 12px;
    left: 9px;
    bottom: 8px;
}

.lock-icon::after {
    width: 13px;
    height: 12px;
    left: 10px;
    top: 7px;
}

.insight-grid {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 9px;
}

.panel-card,
.metric-card {
    border-radius: 7px;
}

.panel-head {
    min-height: 38px;
    padding: 8px 10px;
}

.panel-title {
    font-size: 0.84rem;
}

.table-compact {
    font-size: 0.76rem;
}

.table-compact th {
    font-size: 0.63rem;
}

.table-compact td,
.table-compact th {
    padding: 0.42rem 0.55rem;
}

.portal-code {
    min-height: 21px;
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 0.65rem;
}

.status-pill {
    min-height: 21px;
    padding: 2px 7px;
    font-size: 0.66rem;
}

.portal-list {
    gap: 7px;
    padding: 9px;
}

.portal-row {
    min-height: 34px;
    padding: 6px 8px;
    border-radius: 6px;
}

.portal-row span {
    font-size: 0.82rem;
}

.portal-row strong {
    font-size: 0.72rem;
}

.portal-row-live {
    display: block;
}

.portal-row-live > div:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.portal-row-live small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.66rem;
}

.portal-row-live dl {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(70px, 0.65fr);
    align-items: start;
    gap: 10px;
    margin: 6px 0 0;
}

.portal-live-metrics .metric-left {
    text-align: left;
}

.portal-live-metrics .metric-right {
    text-align: right;
}

.portal-live-metrics dt + dd + dt {
    margin-top: 5px;
}

.portal-row-live dt {
    color: var(--muted);
    font-size: 0.56rem;
    font-weight: 900;
    text-transform: uppercase;
}

.portal-row-live dd {
    margin: 1px 0 0;
    color: var(--ink);
    font-size: 0.7rem;
    font-weight: 850;
}

.portal-row-live .money-value {
    color: var(--brand-red);
    font-size: 0.6rem;
    line-height: 1.1;
    white-space: nowrap;
}

.empty-live-state {
    padding: 10px;
    border: 1px dashed #e4d2bf;
    border-radius: 7px;
    color: var(--muted);
    background: #fffaf5;
    font-size: 0.74rem;
    text-align: center;
}

.analytics-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.range-filter {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.range-filter .form-control,
.range-filter .form-select {
    width: auto;
    min-width: 124px;
}

.analytics-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 8px;
}

.kpi-tile {
    display: block;
    position: relative;
    min-height: 70px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 8px 18px rgba(29, 31, 35, 0.045);
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    animation: compactFadeUp 260ms ease both;
}

.kpi-tile::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--brand-red);
}

.kpi-tile span {
    display: block;
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 900;
    text-transform: uppercase;
}

.kpi-tile strong {
    display: block;
    margin-top: 3px;
    font-size: 1.14rem;
    line-height: 1.05;
}

.kpi-tile small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 0.66rem;
}

.accent-green::before {
    background: #168a56;
}

.accent-orange::before {
    background: var(--brand-orange);
}

.accent-dark::before {
    background: #332225;
}

.rate-tile {
    background:
        linear-gradient(#fff, #fff) padding-box,
        conic-gradient(#168a56 var(--rate), #f0e7dd 0) border-box;
    border: 1px solid transparent;
}

.attention-tile {
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.attention-tile:hover {
    color: inherit;
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(31, 32, 36, 0.11);
}

.attention-refund {
    border-color: #ffdca9;
    background: linear-gradient(135deg, #fff 0%, #fff7eb 100%);
}

.attention-dispute {
    border-color: #f4c2c7;
    background: linear-gradient(135deg, #fff 0%, #fff0f2 100%);
}

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

.wide-panel {
    grid-column: span 2;
}

.mini-chart {
    display: flex;
    align-items: end;
    gap: 7px;
    min-height: 156px;
    padding: 10px;
}

.chart-bar {
    flex: 1;
    height: 128px;
    display: grid;
    align-items: end;
    gap: 4px;
    color: var(--muted);
    font-size: 0.62rem;
    text-align: center;
}

.chart-bar span {
    display: block;
    min-height: 4px;
    border-radius: 6px 6px 2px 2px;
    background: linear-gradient(180deg, var(--brand-orange), var(--brand-red));
    box-shadow: 0 8px 16px rgba(184, 32, 42, 0.14);
    transition: transform 160ms ease;
}

.chart-bar:hover span {
    transform: scaleY(1.04);
    transform-origin: bottom;
}

.compact-list,
.performance-list,
.attention-list {
    display: grid;
    gap: 6px;
    padding: 9px;
}

.attention-row {
    display: grid;
    gap: 3px;
    min-height: 42px;
    padding: 7px 9px;
    border-radius: 6px;
    text-decoration: none;
    transition: transform 150ms ease, box-shadow 150ms ease;
}

.attention-row:hover {
    transform: translateX(2px);
    box-shadow: 0 10px 18px rgba(31, 32, 36, 0.08);
}

.attention-row strong {
    color: var(--text);
    font-size: 0.72rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.attention-row span,
.attention-row small {
    color: var(--muted);
    font-size: 0.64rem;
    font-weight: 750;
}

.refund-row {
    border: 1px solid #ffdca9;
    background: #fff8ed;
}

.dispute-row {
    border: 1px solid #f3bdc4;
    background: #fff1f2;
}

.compact-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    align-items: center;
    min-height: 32px;
    padding: 6px 8px;
    border-radius: 6px;
    background: #fbf7f2;
    border: 1px solid #efe3d6;
}

.compact-row > span:first-child {
    font-size: 0.74rem;
    font-weight: 850;
}

.compact-row strong {
    font-size: 0.8rem;
}

.compact-row small {
    color: var(--muted);
    font-size: 0.68rem;
}

.performance-row {
    display: grid;
    grid-template-columns: minmax(220px, 0.9fr) minmax(160px, 1fr) auto;
    align-items: center;
    gap: 9px;
    min-height: 40px;
    padding: 6px 8px;
    border: 1px solid #efe3d6;
    border-radius: 6px;
    background: #fffaf5;
}

.performance-row strong {
    font-size: 0.78rem;
}

.performance-row small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.66rem;
}

.performance-row b {
    color: var(--brand-red);
    font-size: 0.78rem;
}

.performance-bar {
    height: 8px;
    border-radius: 99px;
    background: #f0e4d7;
    overflow: hidden;
}

.performance-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand-red), var(--brand-orange));
}

.logs-filter .form-select,
.logs-filter .form-control {
    min-width: 118px;
}

.logs-filter .attention-select {
    min-width: 138px;
}

.logs-panel {
    overflow: hidden;
}

.dt-container {
    padding: 9px;
    font-size: 0.76rem;
}

.dt-container .dt-length select,
.dt-container .dt-search input {
    min-height: 30px;
    border: 1px solid #dce1e7;
    border-radius: 5px;
    font-size: 0.76rem;
}

.dt-container .dt-search input {
    min-width: 220px;
}

.dt-container .dt-paging-button {
    border-radius: 5px !important;
    padding: 4px 8px !important;
}

.dt-amount {
    font-weight: 850;
    color: var(--brand-red);
}

.dt-stack {
    display: grid;
    gap: 3px;
    min-width: max-content;
    line-height: 1.15;
}

.dt-stack strong {
    font-size: 0.74rem;
    font-weight: 900;
    color: var(--text);
}

.dt-stack small {
    color: var(--muted);
    font-size: 0.64rem;
    font-weight: 750;
}

.dt-code-stack strong,
.dt-code-stack small {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.risk-badge {
    display: inline-flex;
    align-items: center;
    min-height: 17px;
    margin-left: 5px;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 0.56rem;
    font-weight: 950;
    text-transform: uppercase;
}

.refund-badge {
    color: #9c5508;
    background: #fff1cf;
}

.dispute-badge {
    color: #a11225;
    background: #ffe0e4;
}

table.dataTable tbody tr.row-refund-attention > * {
    background: #fff8e8 !important;
    box-shadow: inset 3px 0 0 #f0a42b;
}

table.dataTable tbody tr.row-dispute-attention > * {
    background: #fff0f2 !important;
    box-shadow: inset 3px 0 0 #b8202a;
}

table.dataTable tbody tr.row-refund-attention:hover > * {
    background: #fff6dc !important;
}

table.dataTable tbody tr.row-dispute-attention:hover > * {
    background: #ffe7ea !important;
}

@media (max-width: 1199.98px) {
    .analytics-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

.workspace-toolbar {
    min-height: 38px;
    margin-bottom: 8px;
    padding: 7px 9px;
    border-radius: 7px;
}

.toolbar-pills {
    gap: 5px;
}

.toolbar-pills span {
    min-height: 22px;
    padding: 3px 7px;
    font-size: 0.66rem;
}

.body-footer {
    min-height: 36px;
    margin: 0 16px 10px;
    padding: 7px 10px;
    border-radius: 7px;
    font-size: 0.7rem;
}

.premium-modal {
    width: min(100%, 900px);
}

.premium-modal-head {
    padding: 12px 14px;
}

.premium-modal-head h2 {
    font-size: 1.05rem;
}

.premium-modal-head span {
    font-size: 0.74rem;
}

.premium-modal-body {
    padding: 12px 14px 14px;
}

.form-grid {
    gap: 9px;
}

.form-section-title {
    margin: 8px 0 7px;
    font-size: 0.68rem;
}

.form-label {
    margin-bottom: 4px;
    font-size: 0.74rem;
}

.form-control,
.form-select {
    min-height: 34px;
    border-radius: 5px;
    font-size: 0.82rem;
}

.modal-actions {
    padding-top: 10px;
}

.metric-card:hover,
.panel-card:hover,
.portal-row:hover {
    transform: translateY(-1px);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.metric-card:hover,
.panel-card:hover {
    box-shadow: 0 12px 28px rgba(29, 31, 35, 0.075);
}

@keyframes compactFadeUp {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 991.98px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        padding: 10px;
    }

    .sidebar-brand {
        min-height: 42px;
    }

    .sidebar-brand .app-logo {
        width: 150px;
        max-height: 38px;
    }

    .sidebar-footer {
        grid-template-columns: 1fr auto;
    }

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

    .analytics-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .analytics-strip,
    .analytics-grid {
        grid-template-columns: 1fr;
    }

    .wide-panel {
        grid-column: auto;
    }

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

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

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

@media (max-width: 575.98px) {
    .topbar,
    .page-wrap {
        padding-inline: 10px;
    }

    .dashboard-hero {
        min-height: auto;
    }

    .dashboard-hero h2 {
        font-size: 1.05rem;
    }

    .metric-grid.premium-metrics,
    .ops-strip,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .body-footer {
        margin-inline: 10px;
    }
}

.pulse-icon::before {
    left: 6px;
    right: 6px;
    top: 13px;
    height: 2px;
}

.pulse-icon::after {
    left: 8px;
    top: 8px;
    width: 12px;
    height: 12px;
    background: transparent;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.head-actions,
.row-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

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

.monitor-sites-layout {
    align-items: stretch;
    margin-bottom: 14px;
}

.monitor-sites-layout > [class*="col-"] {
    display: flex;
    min-width: 0;
}

.monitor-sites-layout .monitor-panel {
    width: 100%;
    margin-bottom: 0;
}

.pulse-summary-side {
    position: sticky;
    top: 78px;
    width: 100%;
    grid-template-columns: 1fr;
    gap: 9px;
    margin-bottom: 0;
}

.pulse-summary-side .kpi-tile {
    min-height: 78px;
    padding: 10px 12px;
}

.pulse-summary-side .kpi-tile strong {
    font-size: 1.28rem;
    line-height: 1.1;
}

.monitor-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin-bottom: 14px;
    padding-bottom: 2px;
}

.monitor-tabs a {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 8px 12px;
    border: 1px solid #ead8ca;
    border-radius: 6px;
    color: #3a3d42;
    background: #fff;
    font-size: 0.78rem;
    font-weight: 850;
}

.monitor-tabs a:hover {
    color: var(--brand-red);
    background: #fff7ef;
}

.monitor-panel {
    margin-bottom: 14px;
}

.monitor-info-note {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #6f171e;
    font-size: 0.76rem;
    font-weight: 650;
}

.info-fa-icon {
    display: inline-grid;
    place-items: center;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, #b8202a, #f59b22);
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 6px 14px rgba(184, 32, 42, 0.18);
}

.portal-sites-table {
    min-width: 760px;
    table-layout: fixed;
}

.portal-sites-table .site-col-sl {
    width: 54px;
}

.portal-sites-table .site-col-portal {
    width: 31%;
}

.portal-sites-table .site-col-admin {
    width: 22%;
}

.portal-sites-table .site-col-status {
    width: 13%;
}

.portal-sites-table .site-col-response {
    width: 15%;
}

.portal-sites-table .site-col-actions {
    width: 166px;
}

.portal-sites-table td,
.portal-sites-table th {
    padding: 0.52rem 0.6rem;
}

.portal-sites-table tbody tr {
    border-color: #edf1f5;
}

.portal-sites-table tbody tr:hover > * {
    background: #fffaf5;
}

.portal-sites-table .site-sl {
    width: 29px;
    height: 29px;
    font-size: 0.72rem;
}

.portal-sites-table .site-main,
.portal-sites-table .site-contact,
.portal-sites-table .site-response {
    width: 100%;
}

.portal-sites-table .site-actions {
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 4px;
}

.portal-sites-table .portal-code {
    min-height: 19px;
    padding: 2px 6px;
    margin-right: 0;
    border-radius: 5px;
    font-size: 0.62rem;
    font-weight: 500;
}

.portal-sites-table .status-pill {
    min-height: 21px;
    padding: 2px 7px;
    font-size: 0.66rem;
    font-weight: 500;
}

.portal-site-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    padding: 10px 12px 12px;
}

.portal-site-card {
    display: grid;
    grid-template-columns: 38px minmax(170px, 1.45fr) minmax(120px, 0.9fr) auto minmax(92px, 0.7fr) auto;
    align-items: center;
    gap: 9px;
    min-height: 70px;
    padding: 10px 11px;
    border: 1px solid #edf1f5;
    border-radius: 8px;
    background: linear-gradient(180deg, #ffffff, #fbfcfd);
    box-shadow: 0 10px 24px rgba(24, 31, 42, 0.045);
}

.site-sl {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    color: #8f1620;
    background: #fff4ed;
    border: 1px solid #ffd9c4;
    font-size: 0.74rem;
    font-weight: 600;
}

.site-main,
.site-contact,
.site-response {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.site-title-line {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.site-name {
    overflow: hidden;
    color: #252525;
    font-size: 0.86rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-url,
.site-contact small,
.site-response small {
    overflow: hidden;
    color: #6f747b;
    font-size: 0.72rem;
    font-weight: 400;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-site-card .portal-code {
    min-height: 20px;
    padding: 2px 6px;
    margin-right: 0;
    border-radius: 5px;
    font-size: 0.64rem;
    font-weight: 500;
}

.portal-site-card .status-pill {
    min-height: 21px;
    padding: 2px 7px;
    font-size: 0.66rem;
    font-weight: 500;
}

.site-contact span,
.site-response span {
    color: #252525;
    font-size: 0.8rem;
    font-weight: 500;
}

.site-status {
    display: flex;
    justify-content: center;
}

.site-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
}

.site-actions form {
    margin: 0;
}

.icon-action-btn {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid #ead8ca;
    border-radius: 8px;
    color: #8f1620;
    background: #fff9f5;
    font-size: 0.78rem;
    line-height: 1;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.icon-action-btn:hover {
    color: #ffffff;
    background: #b8202a;
    border-color: #b8202a;
    box-shadow: 0 9px 18px rgba(184, 32, 42, 0.16);
    transform: translateY(-1px);
}

.icon-action-btn.active {
    color: #137a4d;
    background: #e9f8f1;
    border-color: #bfe8d3;
}

.icon-action-btn.active:hover {
    color: #ffffff;
    background: #137a4d;
    border-color: #137a4d;
}

.icon-action-btn.health-check.connected {
    color: #0f7b4d;
    background: #e8fff3;
    border-color: #a9ebc8;
    box-shadow: 0 0 0 3px rgba(34, 160, 107, 0.12), 0 0 18px rgba(34, 160, 107, 0.2);
}

.icon-action-btn.health-check.connected:hover {
    color: #ffffff;
    background: #137a4d;
    border-color: #137a4d;
}

.icon-action-btn.health-check.disconnected {
    color: #b8202a;
    background: #fff4f5;
    border-color: #ffd1d6;
}

.icon-action-btn.health-check.disconnected:hover {
    color: #ffffff;
    background: #b8202a;
    border-color: #b8202a;
}

.icon-action-btn.health-check.unknown-link {
    color: #68717c;
    background: #f4f6f8;
    border-color: #d8dde4;
}

.icon-action-btn.health-check.unknown-link:hover {
    color: #ffffff;
    background: #68717c;
    border-color: #68717c;
}

.icon-action-btn.test {
    color: #b44b00;
    background: #fff8ef;
    border-color: #f8d7ad;
}

.icon-action-btn.test:hover {
    color: #ffffff;
    background: #d96d00;
    border-color: #d96d00;
}

.icon-action-btn.danger {
    color: #b8202a;
    background: #fff4f5;
    border-color: #ffd1d6;
}

.icon-action-btn.danger:hover {
    color: #ffffff;
    background: #8f1620;
    border-color: #8f1620;
}

.empty-compact-state {
    margin: 10px 12px 12px;
    padding: 18px;
    border: 1px dashed #d8dde4;
    border-radius: 8px;
    color: #6f747b;
    text-align: center;
    font-size: 0.84rem;
}

.status-pill.healthy {
    background: #e9f8f1;
    color: #137a4d;
}

.status-pill.slow {
    background: #fff7d7;
    color: #8a6500;
}

.status-pill.critical_slow {
    background: #fff0df;
    color: #b44b00;
}

.status-pill.down {
    background: #ffe6e9;
    color: #b8202a;
}

.status-pill.unknown {
    background: #eef1f4;
    color: #68717c;
}

.switch-pill {
    min-width: 48px;
    min-height: 27px;
    padding: 4px 9px;
    border: 1px solid #d8dde4;
    border-radius: 999px;
    color: #6f747b;
    background: #f3f5f7;
    font-size: 0.72rem;
    font-weight: 850;
}

.switch-pill.on {
    color: #137a4d;
    background: #e9f8f1;
    border-color: #bfe8d3;
}

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

.channel-tile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfd;
}

.channel-tile div {
    display: grid;
    gap: 2px;
}

.channel-tile strong {
    font-size: 0.9rem;
}

.channel-tile small {
    color: var(--muted);
    word-break: break-word;
}

.wide-modal {
    width: min(920px, calc(100vw - 28px));
}

.code-modal {
    width: min(1080px, calc(100vw - 28px));
}

.code-copy-grid {
    display: grid;
    gap: 12px;
}

.code-copy-card {
    overflow: hidden;
    border: 1px solid #2f3746;
    border-radius: 8px;
    background: #111827;
    box-shadow: 0 16px 34px rgba(17, 24, 39, 0.12);
}

.code-copy-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 44px;
    padding: 9px 12px;
    border-bottom: 1px solid #2f3746;
    background: linear-gradient(180deg, #202a3a, #161f2d);
}

.code-copy-head strong {
    color: #f8fafc;
    font-size: 0.86rem;
}

.code-copy-head .btn-soft {
    color: #ffe5c2;
    background: rgba(245, 155, 34, 0.12);
    border-color: rgba(245, 155, 34, 0.34);
}

.code-copy-head .btn-soft:hover {
    color: #111827;
    background: #f59b22;
    border-color: #f59b22;
}

.code-copy-card pre {
    max-height: 360px;
    margin: 0;
    overflow: auto;
    padding: 12px;
    color: #dbeafe;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 44px 100%,
        #0b1020;
    font: 0.78rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: pre;
    scrollbar-color: #465267 #0b1020;
}

.form-check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 7px 9px;
    border: 1px solid #e5e9ef;
    border-radius: 6px;
    background: #fbfcfd;
    font-size: 0.82rem;
    font-weight: 800;
}

.form-check-row input {
    width: 16px;
    height: 16px;
    accent-color: var(--brand-red);
}

.monitor-filter {
    margin-bottom: 14px;
}

.alert-message-row td {
    background: #fffaf5;
    border-top: 0;
}

.alert-message-row pre {
    margin: 0;
    white-space: pre-wrap;
    color: #3a3d42;
    font: 0.76rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.analytics-filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    padding: 8px 10px;
    border: 1px solid #ead8ca;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 12px 26px rgba(31, 32, 36, 0.04);
}

.analytics-filter-bar .form-select {
    width: auto;
    min-width: 190px;
    min-height: 34px;
}

.impact-disclaimer {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-left: auto;
    color: #8f1620;
    font-size: 0.74rem;
    font-weight: 850;
}

.analytics-impact-hero {
    display: grid;
    grid-template-columns: 1.25fr repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.analytics-impact-hero article {
    min-height: 86px;
    padding: 11px 12px;
    border: 1px solid #ead8ca;
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 248, 241, 0.92)),
        #fff;
    box-shadow: 0 16px 34px rgba(31, 32, 36, 0.07);
}

.analytics-impact-hero article:first-child {
    color: #fff;
    background: linear-gradient(135deg, #8f1620, #b8202a 56%, #f59b22);
    border-color: rgba(255, 255, 255, 0.18);
}

.analytics-impact-hero span {
    display: block;
    color: inherit;
    opacity: 0.72;
    font-size: 0.66rem;
    font-weight: 900;
    text-transform: uppercase;
}

.analytics-impact-hero strong {
    display: block;
    margin-top: 5px;
    font-size: clamp(1.08rem, 1.65vw, 1.62rem);
    line-height: 1.05;
    font-weight: 950;
}

.analytics-impact-hero small {
    display: block;
    margin-top: 5px;
    color: inherit;
    opacity: 0.72;
    font-size: 0.7rem;
}

.pulse-chart-grid,
.pulse-analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.pulse-chart-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 10px 22px rgba(29, 31, 35, 0.045);
}

.pulse-chart-card .panel-head,
.pulse-analytics-grid .panel-head,
.monitor-panel .panel-head {
    min-height: 40px;
    padding: 8px 10px;
}

.pulse-chart-card .panel-title,
.pulse-analytics-grid .panel-title,
.monitor-panel .panel-title {
    font-size: 0.86rem;
}

.wide-chart {
    grid-column: span 2;
}

.chart-box {
    position: relative;
    min-height: 238px;
    padding: 9px 10px;
}

.pulse-chart-card:not(.wide-chart) .chart-box {
    min-height: 230px;
}

.hour-heatmap {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    padding: 10px;
}

.hour-cell {
    min-height: 58px;
    padding: 7px;
    border: 1px solid rgba(184, 32, 42, calc(0.12 + var(--heat) * 0.28));
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(184, 32, 42, calc(0.04 + var(--heat) * 0.24)), rgba(245, 155, 34, calc(0.04 + var(--heat) * 0.2))),
        #fff;
}

.hour-cell strong,
.hour-cell span,
.hour-cell small {
    display: block;
}

.hour-cell strong {
    color: #8f1620;
    font-size: 0.7rem;
    font-weight: 950;
}

.hour-cell span {
    margin-top: 4px;
    color: #252525;
    font-size: 0.76rem;
    font-weight: 900;
}

.hour-cell small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.62rem;
}

.danger-soft {
    --bs-btn-color: #b8202a;
    --bs-btn-bg: #fff1f1;
    --bs-btn-border-color: #ffd4d9;
}

@media (max-width: 991.98px) {
    .pulse-summary,
    .channel-grid,
    .analytics-impact-hero,
    .pulse-chart-grid,
    .pulse-analytics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .analytics-impact-hero article:first-child,
    .wide-chart {
        grid-column: span 2;
    }

    .hour-heatmap {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .pulse-summary,
    .channel-grid,
    .analytics-impact-hero,
    .pulse-chart-grid,
    .pulse-analytics-grid {
        grid-template-columns: 1fr;
    }

    .analytics-impact-hero article:first-child,
    .wide-chart {
        grid-column: auto;
    }

    .analytics-filter-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .analytics-filter-bar .form-select,
    .analytics-filter-bar .btn,
    .impact-disclaimer {
        width: 100%;
        margin-left: 0;
    }

    .chart-box {
        min-height: 260px;
        padding: 10px;
    }

    .hour-heatmap {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 10px;
    }

    .head-actions,
    .row-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .head-actions .btn,
    .row-actions .btn,
    .row-actions form {
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .app-shell {
        display: block;
        background: #f6f7f9;
    }

    .sidebar {
        position: static;
        height: auto;
        max-height: none;
        padding: 10px;
        border-radius: 0;
        box-shadow: none;
    }

    .sidebar-brand {
        min-height: 46px;
        margin-bottom: 8px;
        padding-bottom: 8px;
    }

    .sidebar-brand .app-logo {
        width: 150px;
        max-height: 42px;
    }

    .nav-stack {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }

    .nav-item-link {
        min-height: 40px;
        padding: 8px;
        gap: 7px;
        border-radius: 7px;
        font-size: 0.76rem;
    }

    .nav-icon {
        width: 24px;
        height: 24px;
        border-radius: 6px;
    }

    .sidebar-footer {
        display: flex;
        margin-top: 8px;
        padding-top: 8px;
    }

    .session-card {
        display: none;
    }

    .sidebar-logout {
        width: 100%;
        min-height: 40px;
        justify-content: center;
        font-size: 0.78rem;
    }

    .topbar {
        min-height: auto;
        padding: 10px;
        align-items: flex-start;
        gap: 10px;
    }

    .topbar .page-title {
        font-size: 1.1rem;
    }

    .topbar-actions {
        width: 100%;
        align-items: center;
        flex-direction: row;
        justify-content: space-between;
    }

    .user-badge {
        min-width: 0;
        gap: 8px;
    }

    .user-badge .text-end {
        text-align: left !important;
    }

    .page-wrap {
        padding: 12px 10px 20px;
    }

    .page-head {
        gap: 10px;
        margin-bottom: 12px;
    }

    .page-title {
        font-size: 1.18rem;
    }

    .head-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .head-actions .btn {
        width: 100%;
        min-height: 38px;
        padding-inline: 8px;
        font-size: 0.78rem;
    }

    .modal-shell {
        align-items: flex-start;
        justify-content: center;
        overflow-y: auto;
        padding: 10px;
    }

    .premium-modal,
    .wide-modal,
    .code-modal {
        width: 100%;
        max-width: calc(100vw - 20px);
        max-height: none;
        margin: 0 auto 10px;
    }

    .premium-modal-head {
        align-items: flex-start;
        padding: 14px;
    }

    .premium-modal-head h2 {
        font-size: 1.02rem;
    }

    .premium-modal-head span {
        font-size: 0.76rem;
    }

    .premium-modal-body {
        max-height: calc(100vh - 150px);
        padding: 14px;
    }

    .modal-actions {
        bottom: -14px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-inline: -14px;
        padding: 12px 14px 0;
    }

    .swal2-popup {
        width: calc(100vw - 24px) !important;
        max-width: 360px;
        padding: 0.85rem !important;
    }

    .swal2-title {
        font-size: 1rem !important;
    }

    .code-copy-card pre {
        max-height: 300px;
        font-size: 0.7rem;
    }
}

.main-area {
    min-height: 100vh;
    padding-bottom: 62px;
}

.page-wrap {
    padding-bottom: 88px;
}

.body-footer {
    position: fixed;
    right: 16px;
    bottom: 10px;
    left: 286px;
    z-index: 6;
    min-height: 38px;
    margin: 0;
    padding: 8px 11px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 16px 34px rgba(31, 32, 36, 0.1);
}

@media (max-width: 991.98px) {
    .main-area {
        padding-bottom: 70px;
    }

    .page-wrap {
        padding-bottom: 96px;
    }

    .body-footer {
        right: 10px;
        bottom: 8px;
        left: 10px;
    }
}

@media (max-width: 575.98px) {
    .main-area {
        padding-bottom: 90px;
    }

    .page-wrap {
        padding-bottom: 112px;
    }

    .body-footer {
        display: grid;
        gap: 4px;
        min-height: 56px;
        padding: 8px 10px;
        text-align: center;
    }

    .body-footer div {
        justify-content: center;
    }
}

@media (max-width: 991.98px) {
    .app-shell {
        display: block;
        min-height: 100vh;
        background: #f6f7f9;
    }

    .sidebar {
        position: sticky;
        top: 0;
        z-index: 30;
        height: auto;
        max-height: none;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 8px 10px;
        padding: 8px 10px 9px;
        border-radius: 0 0 12px 12px;
        background: linear-gradient(180deg, #201719 0%, #28161a 100%);
        box-shadow: 0 14px 26px rgba(22, 18, 18, 0.18);
    }

    .sidebar-brand {
        grid-column: 1;
        min-height: 0;
        margin: 0;
        padding: 0;
        border: 0;
    }

    .sidebar-brand .app-logo {
        width: 132px;
        max-height: 38px;
        object-fit: contain;
        object-position: left center;
    }

    .nav-stack {
        grid-column: 1 / -1;
        display: flex;
        gap: 7px;
        overflow-x: auto;
        padding: 2px 1px 1px;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
    }

    .nav-stack::-webkit-scrollbar {
        display: none;
    }

    .nav-item-link {
        flex: 0 0 auto;
        justify-content: flex-start;
        gap: 7px;
        min-height: 34px;
        padding: 6px 10px;
        border-radius: 8px;
        font-size: 0.72rem;
        line-height: 1;
        white-space: nowrap;
        scroll-snap-align: start;
    }

    .nav-icon {
        width: 22px;
        height: 22px;
        border-radius: 6px;
    }

    .sidebar-footer {
        grid-column: 3;
        grid-row: 1;
        display: block;
        margin: 0;
        padding: 0;
    }

    .session-card {
        display: none;
    }

    .sidebar-logout {
        width: 34px;
        min-height: 34px;
        justify-content: center;
        padding: 0;
        border-radius: 8px;
    }

    .sidebar-logout span:last-child {
        display: none;
    }

    .main-area {
        min-height: auto;
        padding-bottom: 70px;
    }

    .topbar {
        position: static;
        min-height: 50px;
        padding: 10px 12px;
        gap: 10px;
        background: rgba(255, 255, 255, 0.92);
    }

    .topbar .page-kicker {
        margin-bottom: 2px !important;
        font-size: 0.58rem;
    }

    .topbar .page-title {
        font-size: 1.02rem;
        line-height: 1.1;
    }

    .topbar-actions {
        flex: 0 0 auto;
        gap: 8px;
    }

    .notification-bell summary,
    .user-avatar {
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }

    .user-badge {
        min-width: 0;
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .user-badge .text-end {
        display: none;
    }

    .notification-popover {
        position: fixed;
        top: 70px;
        right: 8px;
        left: 8px;
        width: auto;
    }

    .page-wrap {
        padding: 10px 10px 94px;
    }

    .dashboard-hero {
        min-height: auto;
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
        padding: 13px;
    }

    .dashboard-hero h2 {
        max-width: none;
        font-size: 1.18rem;
    }

    .dashboard-hero p:last-child {
        max-width: none;
        font-size: 0.78rem;
    }

    .dashboard-hero .btn {
        width: 100%;
        min-height: 38px;
    }

    .ops-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .ops-strip div {
        min-height: 42px;
        padding: 7px 8px;
    }

    .metric-grid,
    .metric-grid.premium-metrics,
    .pulse-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }

    .metric-card {
        min-height: 76px;
        padding: 10px;
    }

    .metric-icon {
        width: 32px;
        height: 32px;
    }

    .metric-value {
        font-size: 1.4rem;
    }

    .insight-grid,
    .analytics-grid,
    .pulse-chart-grid,
    .pulse-analytics-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .wide-panel,
    .wide-chart {
        grid-column: auto;
    }

    .panel-card,
    .monitor-panel,
    .pulse-chart-card {
        border-radius: 8px;
        overflow: hidden;
    }

    .panel-head {
        align-items: flex-start;
        gap: 8px;
        padding: 9px 10px;
    }

    .panel-title {
        font-size: 0.92rem;
        line-height: 1.2;
    }

    .portal-row-live dl {
        grid-template-columns: minmax(0, 1.2fr) minmax(74px, 0.8fr);
    }

    .analytics-head,
    .page-head {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
    }

    .range-filter,
    .logs-filter,
    .monitor-filter,
    .analytics-filter-bar,
    .head-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        gap: 6px;
    }

    .range-filter .btn,
    .range-filter .form-control,
    .range-filter .form-select,
    .logs-filter .form-control,
    .logs-filter .form-select,
    .monitor-filter .form-control,
    .monitor-filter .form-select,
    .analytics-filter-bar .form-control,
    .analytics-filter-bar .form-select,
    .head-actions .btn {
        width: 100%;
        min-width: 0;
        min-height: 36px;
        font-size: 0.76rem;
    }

    .analytics-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }

    .kpi-tile {
        min-height: 72px;
        padding: 9px 10px;
    }

    .kpi-tile strong {
        font-size: 1rem;
        word-break: break-word;
    }

    .mini-chart {
        min-height: 120px;
        padding: 8px;
    }

    .chart-bar {
        height: 94px;
    }

    .performance-row {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table,
    .dt-container {
        font-size: 0.7rem;
    }

    .table th,
    .table td {
        white-space: nowrap;
    }

    .dt-container {
        padding: 7px;
    }

    .dt-container .dt-layout-row {
        display: grid !important;
        gap: 7px;
    }

    .dt-container .dt-search,
    .dt-container .dt-length {
        text-align: left !important;
    }

    .dt-container .dt-search input {
        width: 100%;
        min-width: 0;
    }

    .monitor-tabs {
        display: flex;
        gap: 7px;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    .monitor-tabs::-webkit-scrollbar {
        display: none;
    }

    .monitor-tabs a {
        flex: 0 0 auto;
        min-height: 34px;
        padding: 7px 10px;
        white-space: nowrap;
    }

    .modal-shell {
        align-items: flex-start;
        overflow-y: auto;
        padding: 10px;
    }

    .premium-modal,
    .wide-modal,
    .code-modal {
        width: 100%;
        max-width: calc(100vw - 20px);
        max-height: none;
    }

    .premium-modal-body {
        max-height: calc(100vh - 150px);
        padding: 12px;
    }

    .body-footer {
        right: 8px;
        bottom: 8px;
        left: 8px;
        min-height: 42px;
        padding: 8px 10px;
        font-size: 0.64rem;
    }
}

@media (max-width: 575.98px) {
    .sidebar {
        gap: 7px;
        padding: 7px 8px 8px;
    }

    .sidebar-brand .app-logo {
        width: 116px;
        max-height: 32px;
    }

    .nav-stack {
        margin-inline: -1px;
    }

    .nav-item-link {
        min-height: 32px;
        padding: 6px 9px;
        font-size: 0.68rem;
    }

    .nav-icon {
        width: 20px;
        height: 20px;
    }

    .sidebar-logout {
        width: 32px;
        min-height: 32px;
    }

    .topbar {
        padding: 9px 8px;
    }

    .topbar .page-title {
        font-size: 0.98rem;
    }

    .page-wrap {
        padding: 8px 8px 104px;
    }

    .dashboard-hero h2 {
        font-size: 1.02rem;
    }

    .ops-strip,
    .metric-grid,
    .metric-grid.premium-metrics,
    .analytics-strip,
    .pulse-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .metric-card {
        grid-template-columns: 30px minmax(0, 1fr);
        min-height: 70px;
        gap: 8px;
    }

    .metric-card small {
        display: none;
    }

    .portal-row-live > div:first-child {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
    }

    .portal-row-live > div:first-child strong {
        text-align: right;
    }

    .range-filter,
    .logs-filter,
    .monitor-filter,
    .analytics-filter-bar,
    .head-actions {
        grid-template-columns: 1fr 1fr;
    }

    .range-filter .btn-brand,
    .logs-filter .btn-brand,
    .head-actions .btn:first-child:last-child {
        grid-column: 1 / -1;
    }

    .body-footer {
        display: grid;
        place-items: center;
        gap: 3px;
        min-height: 48px;
        text-align: center;
    }

    .body-footer div {
        width: 100%;
        align-items: center;
        justify-content: center;
    }

    .body-footer div:nth-child(2) {
        display: none;
    }
}

.mobile-menu-toggle,
.sidebar-backdrop {
    display: none;
}

@media (max-width: 991.98px) {
    body.nav-open {
        overflow: hidden;
    }

    .app-shell {
        display: block;
        min-height: 100dvh;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 80;
        width: min(318px, calc(100vw - 48px));
        height: 100dvh;
        max-height: none;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 15px 13px;
        overflow-y: auto;
        border-radius: 0 16px 16px 0;
        background:
            linear-gradient(180deg, rgba(184, 32, 42, 0.18), transparent 34%),
            linear-gradient(180deg, #201719 0%, #170f11 100%);
        box-shadow: 18px 0 40px rgba(0, 0, 0, 0.34);
        transform: translateX(-104%);
        transition: transform 210ms ease;
    }

    body.nav-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 70;
        width: 100%;
        height: 100%;
        padding: 0;
        border: 0;
        background: rgba(20, 12, 14, 0.48);
        opacity: 0;
        pointer-events: none;
        transition: opacity 180ms ease;
    }

    body.nav-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar-brand {
        display: flex;
        grid-column: auto;
        align-items: center;
        min-height: 46px;
        margin: 0 0 3px;
        padding: 0 0 13px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }

    .sidebar-brand .app-logo {
        width: 170px;
        max-height: 42px;
    }

    .nav-stack {
        grid-column: auto;
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        margin: 0;
        padding: 0;
        overflow: visible;
        scroll-snap-type: none;
    }

    .nav-item-link {
        width: 100%;
        min-height: 42px;
        justify-content: flex-start;
        padding: 8px 10px;
        border-radius: 9px;
        font-size: 0.76rem;
        white-space: normal;
    }

    .nav-icon {
        width: 26px;
        height: 26px;
        border-radius: 7px;
    }

    .sidebar-footer {
        grid-column: auto;
        grid-row: auto;
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        margin-top: auto;
        padding-top: 8px;
    }

    .session-card {
        display: block;
        padding: 11px 12px;
        border-radius: 10px;
    }

    .session-card dl {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        margin-top: 9px;
    }

    .sidebar-logout {
        width: 100%;
        min-height: 42px;
        justify-content: flex-start;
        gap: 9px;
        padding: 8px 10px;
        border-radius: 9px;
    }

    .sidebar-logout span:last-child {
        display: inline;
    }

    .main-area {
        min-width: 0;
        min-height: 100dvh;
        padding-bottom: 70px;
    }

    .topbar {
        position: sticky;
        top: 0;
        z-index: 60;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        min-height: 54px;
        padding: 8px 10px;
        border-bottom: 1px solid rgba(222, 226, 230, 0.88);
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(16px);
    }

    .mobile-menu-toggle {
        display: grid;
        place-items: center;
        width: 36px;
        height: 36px;
        padding: 0;
        border: 1px solid rgba(184, 32, 42, 0.18);
        border-radius: 9px;
        background: linear-gradient(135deg, #fff8f4, #ffffff);
        box-shadow: 0 8px 18px rgba(184, 32, 42, 0.1);
    }

    .mobile-menu-toggle span {
        width: 16px;
        height: 2px;
        margin: 2px 0;
        border-radius: 999px;
        background: #9f1522;
        transition: transform 180ms ease, opacity 180ms ease;
    }

    body.nav-open .mobile-menu-toggle span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    body.nav-open .mobile-menu-toggle span:nth-child(2) {
        opacity: 0;
    }

    body.nav-open .mobile-menu-toggle span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    .topbar-title {
        min-width: 0;
    }

    .topbar .page-kicker {
        margin-bottom: 1px !important;
        font-size: 0.56rem;
        letter-spacing: 0;
    }

    .topbar .page-title {
        max-width: 100%;
        overflow: hidden;
        font-size: 1rem;
        line-height: 1.05;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .topbar-actions {
        gap: 7px;
        min-width: 0;
    }

    .page-wrap {
        padding: 9px 9px 92px;
    }

    .dashboard-hero {
        gap: 9px;
        padding: 12px;
        border-radius: 8px;
    }

    .dashboard-hero h2 {
        font-size: 1.04rem;
        line-height: 1.16;
    }

    .dashboard-hero p:last-child {
        font-size: 0.74rem;
        line-height: 1.35;
    }

    .ops-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .ops-strip div {
        min-height: 48px;
        padding: 8px;
        border-radius: 8px;
    }

    .ops-strip span,
    .metric-label,
    .kpi-tile span {
        font-size: 0.61rem;
    }

    .ops-strip strong {
        font-size: 0.73rem;
        line-height: 1.2;
        overflow-wrap: anywhere;
    }

    .metric-grid,
    .metric-grid.premium-metrics,
    .analytics-strip,
    .pulse-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }

    .metric-card {
        min-height: 72px;
        padding: 9px;
        border-radius: 8px;
    }

    .metric-value {
        font-size: 1.28rem;
        line-height: 1;
    }

    .panel-card,
    .monitor-panel,
    .pulse-chart-card,
    .kpi-tile,
    .mini-chart {
        border-radius: 8px;
    }
}

@media (max-width: 575.98px) {
    .sidebar {
        width: min(302px, calc(100vw - 42px));
        padding: 13px 11px;
    }

    .sidebar-brand .app-logo {
        width: 154px;
        max-height: 38px;
    }

    .nav-item-link {
        min-height: 40px;
        font-size: 0.74rem;
    }

    .topbar {
        min-height: 52px;
        gap: 8px;
        padding: 8px;
    }

    .mobile-menu-toggle,
    .notification-bell summary,
    .user-avatar {
        width: 34px;
        height: 34px;
    }

    .topbar .page-title {
        font-size: 0.96rem;
    }

    .page-wrap {
        padding: 8px 8px 84px;
    }

    .dashboard-hero h2 {
        font-size: 0.98rem;
    }

    .metric-card {
        grid-template-columns: 28px minmax(0, 1fr);
        min-height: 66px;
        gap: 8px;
    }

    .metric-icon {
        width: 28px;
        height: 28px;
    }

    .portal-row-live {
        padding: 10px;
    }

    .portal-row-live > div:first-child {
        grid-template-columns: 72px minmax(0, 1fr);
        gap: 8px;
    }

    .portal-row-live > div:first-child strong {
        text-align: left;
    }

    .portal-row-live dl {
        grid-template-columns: 1fr 0.78fr;
        gap: 8px;
    }

    .range-filter,
    .logs-filter,
    .monitor-filter,
    .analytics-filter-bar,
    .head-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .range-filter [type="date"],
    .logs-filter [type="date"],
    .monitor-filter [type="date"],
    .analytics-filter-bar [type="date"] {
        font-size: 0.72rem;
    }

    .body-footer {
        right: 7px;
        bottom: 5px;
        left: 7px;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 34px;
        padding: 4px 8px;
        border-radius: 8px;
        font-size: 0.58rem;
    }

    .body-footer > div:first-child {
        display: flex;
        width: 100%;
        min-height: 24px;
        align-items: center;
        justify-content: center;
        gap: 4px 8px;
        line-height: 1.15;
    }

    .body-footer strong,
    .body-footer span {
        display: inline-flex;
        align-items: center;
        min-height: 16px;
    }
}

.nsdl-head {
    margin-bottom: 6px;
}

.nsdl-range {
    justify-content: flex-end;
    margin-bottom: 8px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: 0 10px 22px rgba(29, 31, 35, 0.04);
}

.nsdl-kpi-strip {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.nsdl-kpi {
    min-height: 82px;
}

.nsdl-kpi strong {
    font-size: 1.32rem;
}

.nsdl-kpi em {
    display: block;
    margin-top: 4px;
    color: #475569;
    font-size: 0.62rem;
    font-style: normal;
    font-weight: 800;
}

.nsdl-control-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    align-items: start;
    gap: 10px;
    margin-bottom: 8px;
}

.nsdl-side-stack {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.nsdl-output-panel {
    width: 100%;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 12px 26px rgba(29, 31, 35, 0.055);
    overflow: hidden;
    animation: compactFadeUp 260ms ease both;
}

.nsdl-output-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 36px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.nsdl-output-title strong {
    font-size: 0.88rem;
    font-weight: 900;
}

.nsdl-output-title small {
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 850;
}

.nsdl-output-head,
.nsdl-output-row {
    display: grid;
    grid-template-columns: minmax(118px, 1fr) repeat(4, minmax(44px, 0.42fr));
    align-items: center;
    gap: 6px;
}

.nsdl-output-head {
    min-height: 24px;
    padding: 0 9px;
    color: var(--muted);
    background: #fffaf5;
    border-top: 1px solid var(--line);
    font-size: 0.56rem;
    font-weight: 950;
    text-transform: uppercase;
}

.nsdl-output-head span:not(:first-child),
.nsdl-output-row > b {
    text-align: right;
}

.nsdl-output-row {
    min-height: 34px;
    padding: 6px 9px;
    color: var(--ink);
    border-top: 1px solid var(--line);
    transition: background-color 160ms ease, transform 160ms ease;
}

.nsdl-output-row:hover {
    background: #fff7ed;
}

.nsdl-output-total {
    min-height: 36px;
    border-top: 0;
    background: linear-gradient(90deg, #fff7ed, #fff);
    box-shadow: inset 4px 0 0 var(--brand-orange);
}

.nsdl-output-total b,
.nsdl-output-total strong {
    color: #8f1620;
    font-size: 0.84rem;
    font-weight: 950;
}

.nsdl-output-name {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nsdl-output-name strong {
    min-width: 0;
    font-size: 0.68rem;
    font-weight: 950;
    text-transform: uppercase;
}

.nsdl-output-name small {
    display: none;
}

.nsdl-output-name i {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    margin-left: 13px;
    border: 2px solid rgba(22, 138, 86, 0.18);
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 5px rgba(22, 138, 86, 0.08);
}

.nsdl-output-toggle {
    position: relative;
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    border: 1px solid #ffd8c5;
    border-radius: 5px;
    background: #fff2ee;
}

.nsdl-output-toggle::before,
.nsdl-output-toggle::after {
    content: "";
    position: absolute;
    background: var(--brand-red);
}

.nsdl-output-toggle::before {
    left: 5px;
    top: 9px;
    width: 9px;
    height: 2px;
    transform: rotate(45deg);
}

.nsdl-output-toggle::after {
    right: 5px;
    top: 9px;
    width: 9px;
    height: 2px;
    transform: rotate(-45deg);
}

.nsdl-output-row > b {
    font-size: 0.72rem;
    font-weight: 850;
    font-variant-numeric: tabular-nums;
}

.nsdl-output-empty {
    padding: 12px;
    color: var(--muted);
    font-size: 0.78rem;
    text-align: center;
}

.nsdl-map-panel,
.nsdl-live-panel,
.nsdl-logs-panel {
    animation: compactFadeUp 260ms ease both;
}

.nsdl-live-panel {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.9)),
        var(--surface);
}

.nsdl-receiver-box {
    display: grid;
    gap: 6px;
    padding: 12px;
}

.nsdl-receiver-box span,
.nsdl-receiver-box small {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 850;
    text-transform: uppercase;
}

.nsdl-receiver-box code,
.nsdl-code-card code {
    display: block;
    padding: 9px 10px;
    border: 1px solid #c7d2fe;
    border-radius: 7px;
    color: #1e3a8a;
    background: #eef2ff;
    font-size: 0.74rem;
    line-height: 1.45;
    white-space: normal;
    word-break: break-all;
}

.nsdl-signal-list {
    display: grid;
    gap: 7px;
    padding: 0 12px 12px;
}

.nsdl-signal-list div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 34px;
    padding: 7px 9px;
    border: 1px solid #dbeafe;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.78);
}

.nsdl-signal-list strong {
    font-size: 0.72rem;
}

.nsdl-signal-list span {
    color: #0f766e;
    font-size: 0.68rem;
    font-weight: 900;
}

.nsdl-chart-wrap {
    height: 240px;
    padding: 10px;
}

.nsdl-chart-wrap.small-chart {
    height: 214px;
}

.nsdl-url-cell {
    display: block;
    max-width: 360px;
    color: #475569;
    line-height: 1.35;
    word-break: break-all;
}

.nsdl-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.nsdl-modal {
    width: min(100%, 760px);
}

.nsdl-form-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 150px 140px;
    gap: 12px;
}

.nsdl-webhook-field {
    grid-column: 1 / -1;
}

.nsdl-code-input {
    font-weight: 900;
    text-transform: uppercase;
}

.nsdl-code-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    background: #f8fbff;
}

.nsdl-log-filter {
    justify-content: flex-end;
    margin-bottom: 8px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.74);
}

.nsdl-log-filter .form-control,
.nsdl-log-filter .form-select {
    min-width: 116px;
}

table.dataTable tbody tr.nsdl-duplicate-row > * {
    background: #fff7ed !important;
    box-shadow: inset 3px 0 0 #f59b22;
}

table.dataTable tbody tr.nsdl-forward-failed-row > * {
    background: #fff1f2 !important;
    box-shadow: inset 3px 0 0 #dc2626;
}

.nsdl-raw-pre {
    max-height: 420px;
    margin: 0;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 0.76rem;
    line-height: 1.45;
    overflow: auto;
    text-align: left;
}

.nsdl-error-note {
    margin-top: 10px;
    padding: 9px 10px;
    border: 1px solid #fecdd3;
    border-radius: 7px;
    color: #9f1239;
    background: #fff1f2;
    font-size: 0.78rem;
    text-align: left;
}

.nsdl-portal-row {
    grid-template-columns: minmax(0, 1fr) 54px 56px;
}

@media (max-width: 1199.98px) {
    .nsdl-kpi-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .nsdl-control-grid {
        grid-template-columns: minmax(0, 1fr) 360px;
    }
}

@media (max-width: 991.98px) {
    .nsdl-head,
    .nsdl-range {
        align-items: stretch;
        flex-direction: column;
    }

    .nsdl-kpi-strip,
    .nsdl-analytics-grid {
        grid-template-columns: 1fr;
    }

    .nsdl-analytics-grid .wide-panel {
        grid-column: span 1;
    }

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

    .nsdl-control-grid {
        grid-template-columns: 1fr;
    }

    .nsdl-output-panel {
        overflow-x: auto;
    }

    .nsdl-output-head,
    .nsdl-output-row {
        min-width: 390px;
    }
}

@media (max-width: 575.98px) {
    .nsdl-code-card {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 1399.98px) {
    .portal-site-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .portal-site-grid {
        gap: 8px;
        padding: 9px;
    }

    .portal-site-card {
        grid-template-columns: 34px minmax(0, 1fr) auto;
        gap: 8px;
        min-height: auto;
        padding: 9px;
    }

    .site-main {
        grid-column: 2 / -1;
    }

    .site-contact,
    .site-response {
        grid-column: 2 / 3;
    }

    .site-status {
        grid-column: 3;
        grid-row: 2;
        justify-content: flex-end;
    }

    .site-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
        padding-top: 4px;
        border-top: 1px solid #edf1f5;
    }

    .site-url,
    .site-contact small,
    .site-response small {
        white-space: normal;
    }
}

.pulse-summary.pulse-summary-side {
    grid-template-columns: 1fr;
}

@media (max-width: 767.98px) {
    .pulse-summary.pulse-summary-side {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-number-grid,
    .pulse-widget-body {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 575.98px) {
    .pulse-summary.pulse-summary-side {
        grid-template-columns: 1fr;
    }

    .dashboard-number-grid,
    .pulse-widget-stats {
        grid-template-columns: 1fr;
    }

    .pulse-widget-row {
        grid-template-columns: 30px minmax(0, 1fr) auto;
    }

    .pulse-widget-row small {
        display: none;
    }
}
