:root {
    --dn-bg: #0a0a0f;
    --dn-bg-soft: #13131a;
    --dn-bg-card: #171720;
    --dn-bg-card-2: #1c1c27;
    --dn-border: rgba(255, 255, 255, 0.08);
    --dn-border-strong: rgba(255, 255, 255, 0.14);
    --dn-text: #e8e8f0;
    --dn-text-soft: #b8bfd6;
    --dn-text-muted: #8f97b3;
    --dn-accent: #6366f1;
    --dn-accent-2: #a5b4fc;
    --dn-success: #10b981;
    --dn-warning: #f59e0b;
    --dn-danger: #ef4444;
    --dn-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body.admin-shell {
    margin: 0;
    min-height: 100vh;
    color: var(--dn-text);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(1200px 620px at 8% -5%, rgba(99, 102, 241, 0.12), transparent 55%),
        radial-gradient(900px 480px at 100% 0%, rgba(16, 185, 129, 0.08), transparent 58%),
        var(--dn-bg);
}

.admin-shell a {
    color: inherit;
}

.admin-layout {
    display: grid;
    min-height: 100vh;
    grid-template-columns: 272px minmax(0, 1fr);
    transition: grid-template-columns 160ms ease;
}

body.admin-shell.sidebar-collapsed .admin-layout {
    grid-template-columns: 84px minmax(0, 1fr);
}

.admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 0.85rem;
    border-right: 1px solid var(--dn-border);
    background: rgba(10, 10, 15, 0.92);
    backdrop-filter: blur(10px);
}

body.admin-shell.sidebar-collapsed .admin-sidebar {
    padding: 0.8rem 0.55rem;
}

.admin-sidebar-inner {
    display: flex;
    min-height: calc(100vh - 1.7rem);
    flex-direction: column;
    gap: 0.8rem;
}

.admin-brand {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.8rem 0.85rem 0.7rem;
    border: 1px solid var(--dn-border);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
}

.admin-brand-actions {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
}

.admin-brand-mark {
    font-family: "Plus Jakarta Sans", "Inter", sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.admin-brand-mark span {
    color: var(--dn-accent);
}

.admin-brand-title {
    margin: 0.15rem 0 0.2rem;
    font-size: 0.78rem;
    color: var(--dn-text-soft);
}

.admin-brand-sub {
    font-size: 0.72rem;
    color: var(--dn-text-muted);
}

.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.52rem;
    border-radius: 999px;
    border: 1px solid var(--dn-border-strong);
    background: rgba(255, 255, 255, 0.04);
    color: var(--dn-text-soft);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.admin-badge.demo {
    color: #fcd34d;
    border-color: rgba(245, 158, 11, 0.32);
    background: rgba(245, 158, 11, 0.11);
}

.admin-nav {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.3rem;
}

.admin-nav-group {
    display: flex;
    flex-direction: column;
    gap: 0.04rem;
}

.admin-nav-label {
    padding: 0 0.6rem;
    color: var(--dn-text-muted);
    font-size: 0.66rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.11em;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 0.62rem;
    padding: 0.3rem 0.62rem;
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--dn-text-soft);
    line-height: 1.15;
    text-decoration: none;
    transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.admin-nav-item:hover {
    transform: translateY(-1px);
    border-color: var(--dn-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--dn-text);
}

.admin-nav-item.is-active {
    border-color: rgba(99, 102, 241, 0.35);
    background: rgba(99, 102, 241, 0.14);
    color: #ffffff;
}

.admin-nav-icon {
    width: 1.5rem;
    flex: 0 0 1.5rem;
    text-align: center;
    color: var(--dn-accent-2);
    font-size: 0.95rem;
}

.admin-sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding-top: 0.55rem;
    border-top: 1px solid var(--dn-border);
}

.admin-sidebar-cta {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.8rem 0.85rem;
    border: 1px solid rgba(99, 102, 241, 0.32);
    border-radius: 14px;
    background:
        radial-gradient(180px 90px at 0% 0%, rgba(99, 102, 241, 0.24), transparent 70%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    box-shadow: 0 18px 32px rgba(0, 0, 0, 0.18);
}

.admin-sidebar-cta-kicker {
    color: #c7d2fe;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.admin-sidebar-cta-title {
    color: #ffffff;
    font-size: 0.96rem;
    font-weight: 700;
    line-height: 1.25;
}

.admin-sidebar-cta-copy {
    color: var(--dn-text-soft);
    font-size: 0.78rem;
    line-height: 1.45;
}

.admin-sidebar-note {
    color: var(--dn-text-muted);
    font-size: 0.73rem;
    line-height: 1.5;
}

.admin-sidebar-toggle {
    min-width: 32px;
    min-height: 32px;
    padding: 0.4rem;
    border-radius: 9px;
}

.admin-sidebar-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    transition: transform 140ms ease;
}

body.admin-shell.sidebar-collapsed .admin-sidebar-toggle-icon {
    transform: rotate(180deg);
}

body.admin-shell.sidebar-collapsed .admin-brand {
    justify-content: center;
    padding: 0.7rem 0.45rem;
}

body.admin-shell.sidebar-collapsed .admin-brand > div:first-child,
body.admin-shell.sidebar-collapsed .admin-nav-label,
body.admin-shell.sidebar-collapsed .admin-nav-item span:not(.admin-nav-icon),
body.admin-shell.sidebar-collapsed .admin-sidebar-note {
    display: none;
}

body.admin-shell.sidebar-collapsed .admin-brand-actions {
    flex-direction: column;
    align-items: center;
}

body.admin-shell.sidebar-collapsed .admin-badge.demo {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    padding: 0.35rem 0.24rem;
    letter-spacing: 0.05em;
}

body.admin-shell.sidebar-collapsed .admin-nav-item {
    justify-content: center;
    gap: 0;
    padding: 0.42rem;
}

body.admin-shell.sidebar-collapsed .admin-sidebar-footer {
    display: none;
}

.report-switcher {
    position: sticky;
    top: 1rem;
    z-index: 25;
    margin-bottom: 1.2rem;
    padding: 0.82rem 1rem;
    border: 1px solid var(--dn-border);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.02));
    box-shadow: var(--dn-shadow);
}

.report-switcher-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.72rem;
}

.report-switcher-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.report-switcher-kicker {
    margin-bottom: 0.3rem;
    color: var(--dn-text-muted);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.report-switcher-title {
    margin: 0;
    color: var(--dn-text);
    font-family: "Plus Jakarta Sans", "Inter", sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
}

.report-switcher-subtitle {
    margin: 0.2rem 0 0;
    color: var(--dn-text-soft);
    font-size: 0.82rem;
    line-height: 1.45;
}

.report-switcher-group-tabs,
.report-switcher-report-tabs {
    display: flex;
    gap: 0.55rem;
    overflow-x: auto;
    padding-bottom: 0.15rem;
}

.report-switcher-body {
    display: block;
}

.report-switcher.is-collapsed .report-switcher-header {
    margin-bottom: 0;
}

.report-switcher.is-collapsed .report-switcher-body {
    display: none;
}

.report-switcher.is-collapsed {
    padding: 0.58rem 0.8rem;
    border-radius: 14px;
}

.report-switcher.is-collapsed .report-switcher-kicker,
.report-switcher.is-collapsed .report-switcher-subtitle {
    display: none;
}

.report-switcher.is-collapsed .report-switcher-title {
    font-size: 0.92rem;
}

.report-switcher.is-collapsed .report-switcher-actions {
    gap: 0.35rem;
}

.report-switcher-group-tabs {
    margin-bottom: 0.62rem;
}

.report-switcher-group-tab,
.report-switcher-report-tab {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    text-decoration: none;
    border-radius: 999px;
    transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.report-switcher-group-tab {
    padding: 0.4rem 0.78rem;
    border: 1px solid var(--dn-border-strong);
    background: rgba(255, 255, 255, 0.03);
    color: var(--dn-text-soft);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.report-switcher-group-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.1rem;
    height: 1.1rem;
    margin-left: 0.38rem;
    padding: 0 0.28rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
    font-size: 0.67rem;
    font-weight: 700;
}

.report-switcher-report-tab {
    padding: 0.38rem 0.72rem;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.02);
    color: var(--dn-text-soft);
    font-size: 0.78rem;
    font-weight: 600;
}

.report-switcher-group-tab:hover,
.report-switcher-report-tab:hover {
    transform: translateY(-1px);
    color: var(--dn-text);
    border-color: var(--dn-border);
    background: rgba(255, 255, 255, 0.06);
}

.report-switcher-group-tab.is-active {
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(99, 102, 241, 0.12);
    color: #ffffff;
}

.report-switcher-report-tab.is-active {
    border-color: rgba(16, 185, 129, 0.28);
    background: rgba(16, 185, 129, 0.12);
    color: #d1fae5;
}

.section-switcher {
    position: sticky;
    top: 1rem;
    z-index: 24;
    margin-bottom: 1rem;
    padding: 0.72rem 0.9rem;
    border: 1px solid var(--dn-border);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(22, 24, 34, 0.98), rgba(16, 18, 26, 0.985));
    box-shadow: var(--dn-shadow);
    backdrop-filter: blur(10px);
}

.section-switcher-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.55rem;
}

.section-switcher-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--dn-text);
}

.section-switcher-subtitle {
    margin: 0.12rem 0 0;
    color: var(--dn-text-soft);
    font-size: 0.76rem;
    line-height: 1.4;
}

.section-switcher-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.section-switcher-body {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.section-switcher-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0.34rem 0.66rem;
    border: 1px solid var(--dn-border-strong);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--dn-text);
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
    cursor: pointer;
}

.section-switcher-tab:hover {
    transform: translateY(-1px);
    border-color: var(--dn-border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--dn-text);
}

.section-switcher-tab.is-active {
    border-color: rgba(99, 102, 241, 0.32);
    background: rgba(99, 102, 241, 0.13);
    color: #ffffff;
}

.section-switcher.is-collapsed {
    padding: 0.54rem 0.76rem;
    border-radius: 14px;
}

.section-switcher.is-collapsed .section-switcher-header {
    margin-bottom: 0;
}

.section-switcher.is-collapsed .section-switcher-subtitle,
.section-switcher.is-collapsed .section-switcher-body {
    display: none;
}

.section-switcher.is-collapsed .section-switcher-title {
    font-size: 0.86rem;
}

.admin-btn,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 34px;
    padding: 0.48rem 0.9rem;
    border-radius: 10px;
    border: 1px solid var(--dn-border-strong);
    background: rgba(255, 255, 255, 0.03);
    color: var(--dn-text);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition: background-color 140ms ease, border-color 140ms ease, transform 140ms ease, filter 140ms ease;
    cursor: pointer;
}

.admin-btn:hover,
.btn:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.06);
}

.admin-btn-primary,
.btn-primary {
    border-color: transparent;
    background: var(--dn-accent);
    color: #ffffff;
}

.admin-btn-primary:hover,
.btn-primary:hover {
    filter: brightness(1.05);
    background: var(--dn-accent);
}

.admin-btn-secondary,
.btn-secondary,
.btn-ghost,
.btn-outline {
    background: rgba(255, 255, 255, 0.02);
    color: var(--dn-text-soft);
    border-color: var(--dn-border-strong);
}

.admin-btn-danger,
.btn-error {
    color: #fecaca;
    border-color: rgba(239, 68, 68, 0.28);
    background: rgba(239, 68, 68, 0.09);
}

.btn-success {
    color: #d1fae5;
    border-color: rgba(16, 185, 129, 0.28);
    background: rgba(16, 185, 129, 0.1);
}

.btn-warning {
    color: #fde68a;
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.11);
}

.btn-sm,
.btn-xs {
    min-height: 29px;
    padding: 0.36rem 0.66rem;
    font-size: 0.72rem;
}

.btn-xs {
    min-height: 25px;
    padding: 0.26rem 0.52rem;
}

.btn-block {
    width: 100%;
}

.admin-main {
    min-width: 0;
    padding: 1.25rem 1.25rem 1.6rem;
}

.admin-mobilebar {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.78rem 0.95rem;
    border: 1px solid var(--dn-border);
    border-radius: 14px;
    background: rgba(19, 19, 26, 0.84);
}

.admin-mobile-toggle {
    border: 1px solid var(--dn-border-strong);
    background: rgba(255, 255, 255, 0.03);
}

.admin-workspace-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem 0.95rem;
    border: 1px solid var(--dn-border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
}

.admin-workspace-meta {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    min-width: 0;
}

.scope-selector-wrapper {
    position: relative;
    min-width: min(100%, 28rem);
}

.scope-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--dn-border);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.02));
    color: var(--dn-text);
    cursor: pointer;
}

.scope-icon,
.scope-option-icon {
    width: 1.85rem;
    height: 1.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.14);
    color: #c7d2fe;
    font-size: 0.78rem;
    font-weight: 700;
    flex: 0 0 1.85rem;
}

.scope-trigger-copy,
.scope-option-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    flex: 1;
}

.scope-trigger-label,
.scope-option-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dn-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scope-trigger-meta,
.scope-option-meta {
    font-size: 0.76rem;
    color: var(--dn-text-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scope-health {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 999px;
    flex: 0 0 0.6rem;
    background: var(--dn-success);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12);
}

.scope-health-warning,
.scope-health-syncing {
    background: var(--dn-warning);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.12);
}

.scope-health-error {
    background: var(--dn-danger);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}

.scope-caret {
    color: var(--dn-text-muted);
    flex: 0 0 auto;
}

.scope-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 0.55rem);
    width: min(100%, 32rem);
    padding: 0.45rem;
    border: 1px solid var(--dn-border);
    border-radius: 16px;
    background: rgba(11, 15, 28, 0.98);
    box-shadow: var(--dn-shadow);
    z-index: 40;
}

.scope-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.72rem 0.78rem;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.scope-option:hover,
.scope-option.is-active {
    background: rgba(255, 255, 255, 0.05);
}

.scope-option.is-active {
    outline: 1px solid rgba(99, 102, 241, 0.35);
}

.scope-divider {
    height: 1px;
    margin: 0.25rem 0;
    background: var(--dn-border);
}

.scope-context-bar {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: -0.1rem 0 0.9rem;
    color: var(--dn-text-soft);
    font-size: 0.78rem;
}

.scope-context-bar a {
    color: var(--dn-text);
    text-decoration: none;
}

.scope-context-bar a:hover {
    text-decoration: underline;
}

.scope-context-current {
    color: var(--dn-text);
    font-weight: 600;
}

.scope-context-badge,
.scope-context-count {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.45rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--dn-border);
    color: var(--dn-text-soft);
}

.admin-page-header,
.content-header {
    margin-bottom: 1rem;
    padding: 0.9rem 1.05rem;
    border: 1px solid var(--dn-border);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
    box-shadow: var(--dn-shadow);
}

.admin-page-header h1,
.content-header h1 {
    margin: 0;
    font-family: "Plus Jakarta Sans", "Inter", sans-serif;
    font-size: clamp(1.7rem, 2.6vw, 2.35rem);
    line-height: 1.05;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--dn-text);
}

.admin-page-header p,
.content-header p {
    margin: 0.35rem 0 0;
    color: var(--dn-text-soft);
    font-size: 0.88rem;
    line-height: 1.48;
}

.admin-kicker {
    margin-bottom: 0.72rem;
    color: var(--dn-text-muted);
    font-size: 0.69rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.admin-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1rem;
}

.page-content,
.container {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.reports-grid {
    display: grid;
    gap: 0.78rem;
    align-items: start;
}

@media (max-width: 900px) {
    .reports-grid[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    .admin-workspace-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .scope-selector-wrapper,
    .scope-dropdown {
        width: 100%;
    }
}

.card,
.form-section,
.recent-activity,
.report-card {
    border: 1px solid var(--dn-border);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.02));
    box-shadow: var(--dn-shadow);
}

.card-body,
.form-section {
    padding: 0.88rem 1rem;
}

.report-card {
    display: block;
    padding: 0.66rem 0.8rem;
    text-decoration: none;
    transition: border-color 140ms ease, transform 140ms ease, background-color 140ms ease;
}

.report-card:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.28);
    background: rgba(99, 102, 241, 0.08);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.72rem;
}

.metric-card,
.stat {
    position: relative;
    overflow: hidden;
    min-width: 0;
    padding: 0.68rem 0.82rem;
    border: 1px solid var(--dn-border);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(28, 28, 39, 0.95), rgba(19, 19, 26, 0.96));
    box-shadow: var(--dn-shadow);
}

a.metric-card,
a.stat,
.metric-link {
    display: block;
    text-decoration: none;
    transition: transform 140ms ease, border-color 140ms ease, background-color 140ms ease;
}

a.metric-card:hover,
a.stat:hover,
.metric-link:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.28);
    background: linear-gradient(180deg, rgba(38, 38, 56, 0.98), rgba(19, 19, 26, 0.98));
}

.metric-card::before,
.stat::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--dn-accent), rgba(99, 102, 241, 0));
    opacity: 0.9;
}

.metric-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.55rem;
}

.metric-title,
.stat-title {
    color: var(--dn-text-muted);
    font-size: 0.69rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.metric-value,
.metric-content h3,
.stat-value {
    margin: 0;
    color: var(--dn-text);
    font-family: "JetBrains Mono", monospace;
    font-size: clamp(1.15rem, 1.55vw, 1.55rem);
    line-height: 1.03;
    font-weight: 600;
}

.metric-subtitle,
.metric-content p,
.stat-desc {
    margin: 0.26rem 0 0;
    color: var(--dn-text-soft);
    font-size: 0.72rem;
    line-height: 1.35;
}

.metric-link-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.32rem;
    color: var(--dn-accent-2);
    font-size: 0.69rem;
    font-weight: 600;
    line-height: 1.3;
}

.metric-icon,
.stat-figure {
    color: var(--dn-accent-2);
    font-size: 1.35rem;
}

.table-responsive,
.overflow-x-auto {
    overflow-x: auto;
}

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

.data-table th,
.data-table td,
.table th,
.table td {
    padding: 0.54rem 0.72rem;
    border-bottom: 1px solid var(--dn-border);
    text-align: left;
    vertical-align: top;
    color: var(--dn-text-soft);
    font-size: 0.83rem;
}

.data-table th,
.table th {
    color: var(--dn-text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.table-zebra tbody tr:nth-child(even),
.data-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.data-table tbody tr:hover,
.table tbody tr:hover {
    background: rgba(99, 102, 241, 0.06);
}

.badge,
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.24rem 0.44rem;
    border-radius: 999px;
    border: 1px solid var(--dn-border-strong);
    font-size: 0.67rem;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: rgba(255, 255, 255, 0.04);
    color: var(--dn-text-soft);
}

.badge-success,
.status-active {
    border-color: rgba(16, 185, 129, 0.26);
    background: rgba(16, 185, 129, 0.1);
    color: #d1fae5;
}

.badge-warning,
.status-warning {
    border-color: rgba(245, 158, 11, 0.28);
    background: rgba(245, 158, 11, 0.12);
    color: #fde68a;
}

.badge-error,
.status-error,
.status-inactive {
    border-color: rgba(239, 68, 68, 0.26);
    background: rgba(239, 68, 68, 0.1);
    color: #fecaca;
}

.badge-info {
    border-color: rgba(99, 102, 241, 0.28);
    background: rgba(99, 102, 241, 0.1);
    color: #c7d2fe;
}

.badge-neutral,
.badge-ghost {
    color: var(--dn-text-muted);
}

.alert {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.78rem 0.9rem;
    border: 1px solid var(--dn-border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--dn-text-soft);
}

.alert-warning {
    border-color: rgba(245, 158, 11, 0.28);
    background: rgba(245, 158, 11, 0.12);
    color: #fde68a;
}

.alert-success {
    border-color: rgba(16, 185, 129, 0.28);
    background: rgba(16, 185, 129, 0.1);
    color: #d1fae5;
}

.alert-error {
    border-color: rgba(239, 68, 68, 0.28);
    background: rgba(239, 68, 68, 0.1);
    color: #fecaca;
}

.alert-info {
    border-color: rgba(99, 102, 241, 0.28);
    background: rgba(99, 102, 241, 0.1);
    color: #c7d2fe;
}

.risk-tone-card {
    padding: 0.9rem 0.95rem;
    border: 1px solid var(--dn-border-strong);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(28, 28, 39, 0.96), rgba(19, 19, 26, 0.98));
    color: var(--dn-text);
}

.risk-tone-card .text-sm,
.risk-tone-card .font-semibold,
.risk-tone-card code {
    color: inherit;
}

.risk-tone-card-high {
    border-color: rgba(239, 68, 68, 0.34);
    background:
        linear-gradient(180deg, rgba(127, 29, 29, 0.32), rgba(19, 19, 26, 0.98)),
        linear-gradient(180deg, rgba(28, 28, 39, 0.96), rgba(19, 19, 26, 0.98));
    color: #fee2e2;
}

.risk-tone-card-medium {
    border-color: rgba(245, 158, 11, 0.34);
    background:
        linear-gradient(180deg, rgba(120, 53, 15, 0.28), rgba(19, 19, 26, 0.98)),
        linear-gradient(180deg, rgba(28, 28, 39, 0.96), rgba(19, 19, 26, 0.98));
    color: #fef3c7;
}

.risk-tone-card-low {
    border-color: rgba(16, 185, 129, 0.3);
    background:
        linear-gradient(180deg, rgba(6, 78, 59, 0.28), rgba(19, 19, 26, 0.98)),
        linear-gradient(180deg, rgba(28, 28, 39, 0.96), rgba(19, 19, 26, 0.98));
    color: #d1fae5;
}

.input,
.select,
.textarea,
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
select,
textarea {
    width: 100%;
    min-height: 36px;
    padding: 0.58rem 0.74rem;
    border: 1px solid var(--dn-border-strong);
    border-radius: 10px;
    background: var(--dn-bg-soft);
    color: var(--dn-text);
    font: inherit;
}

.input::placeholder,
.textarea::placeholder,
input::placeholder,
textarea::placeholder {
    color: var(--dn-text-muted);
}

.input:focus,
.select:focus,
.textarea:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.58);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
}

code,
pre {
    font-family: "JetBrains Mono", monospace;
}

code {
    padding: 0.18rem 0.35rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: #dbe4ff;
}

pre {
    padding: 0.9rem 1rem;
    border: 1px solid var(--dn-border);
    border-radius: 12px;
    background: #0c1018;
    color: var(--dn-text-soft);
    overflow: auto;
}

.text-gray-600,
.text-gray-500 {
    color: var(--dn-text-soft) !important;
}

.bg-white,
.bg-base-100,
.bg-base-200 {
    background: transparent !important;
}

.bg-yellow-50,
.bg-amber-50,
.bg-red-50,
.bg-green-50,
.bg-blue-50 {
    background: rgba(255, 255, 255, 0.03) !important;
}

.border,
.border-b,
.border-base-300 {
    border-color: var(--dn-border) !important;
}

.text-blue-500,
.text-blue-600 {
    color: #a5b4fc !important;
}

.text-purple-500,
.text-indigo-600 {
    color: #c4b5fd !important;
}

.text-green-500,
.text-green-600 {
    color: #6ee7b7 !important;
}

.text-yellow-500,
.text-yellow-600,
.text-orange-500 {
    color: #fcd34d !important;
}

.text-red-500,
.text-red-600 {
    color: #fca5a5 !important;
}

.text-red-700,
.text-red-900 {
    color: #fca5a5 !important;
}

.text-green-700 {
    color: #86efac !important;
}

.text-blue-700 {
    color: #93c5fd !important;
}

.text-amber-900 {
    color: #fcd34d !important;
}

.link,
.link-primary {
    color: var(--dn-accent-2) !important;
}

.link:hover,
.link-primary:hover {
    color: #ffffff !important;
}

.list-disc {
    color: var(--dn-text-soft);
}

.border-red-300,
.border-red-500,
.border-amber-200,
.border-amber-300,
.border-green-200,
.border-green-300,
.border-blue-200 {
    border-color: var(--dn-border-strong) !important;
}

.report-meta,
.form-section,
.metric-card,
.risk-factor-card,
.chart-section,
.trend-placeholder,
.opportunity-card,
.category-card,
.timeline-period,
.strategy-card,
.performance-card,
.automation-rule,
.aging-bucket,
.breakdown-item,
.alert-option,
.status-card,
.panel,
.placeholder-card {
    background: var(--dn-bg-card) !important;
    border: 1px solid var(--dn-border) !important;
    box-shadow: none !important;
    color: var(--dn-text) !important;
}

body.admin-shell [class$="-card"],
body.admin-shell [class*="-card "],
body.admin-shell [class$="-panel"],
body.admin-shell [class*="-panel "],
body.admin-shell .form-section,
body.admin-shell .report-meta,
body.admin-shell .cohort-table,
body.admin-shell .tab-btn {
    background: var(--dn-bg-card) !important;
    border-color: var(--dn-border) !important;
    box-shadow: none !important;
    color: var(--dn-text) !important;
}

body.admin-shell .cohort-table,
body.admin-shell .tab-btn {
    border: 1px solid var(--dn-border) !important;
}

.metric-card.primary,
.metric-card.success,
.metric-card.info,
.metric-card.confidence,
.metric-card.warning,
.metric-card.risk,
.metric-card.danger,
.opportunity-card.high_value,
.opportunity-card.medium_value,
.opportunity-card.low_value,
.aging-bucket.current,
.aging-bucket.overdue,
.confidence-level.high,
.confidence-level.medium,
.confidence-level.low,
.status-open,
.status-paid,
.status-overdue {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)) !important;
}

.metric-card,
.opportunity-card,
.aging-bucket,
.confidence-level,
.status-badge {
    border-color: var(--dn-border-strong) !important;
}

.metric-card.primary,
.metric-card.success,
.aging-bucket.current,
.status-paid,
.confidence-level.high {
    border-left-color: rgba(16, 185, 129, 0.9) !important;
    border-color: rgba(16, 185, 129, 0.28) !important;
}

.metric-card.warning,
.metric-card.confidence,
.aging-bucket.overdue,
.status-open,
.confidence-level.medium {
    border-left-color: rgba(245, 158, 11, 0.9) !important;
    border-color: rgba(245, 158, 11, 0.28) !important;
}

.metric-card.risk,
.metric-card.danger,
.status-overdue,
.confidence-level.low {
    border-left-color: rgba(239, 68, 68, 0.9) !important;
    border-color: rgba(239, 68, 68, 0.28) !important;
}

.metric-content h3,
.metric-content p,
.metric-content small,
.form-section h2,
.form-section > p,
.meta-item,
.factor-header h4,
.factor-weight,
.distribution-label,
.confidence-level h3,
.confidence-level p,
.confidence-factors h4,
.factor-name,
.bucket-header h4,
.bucket-days,
.control-group label,
.placeholder-content h4,
.placeholder-content p,
.opportunity-info h4,
.opportunity-type,
.metric-label,
.category-header h4,
.period-confidence,
.strategy-content h4,
.strategy-content p,
.performance-card h4,
.report-actions,
.legal-disclaimer-banner {
    color: var(--dn-text-soft) !important;
}

.metric-content h3,
.form-section h2,
.factor-header h4,
.confidence-level h3,
.confidence-factors h4,
.opportunity-info h4,
.category-header h4,
.strategy-content h4,
.performance-card h4,
.bucket-header h4 {
    color: var(--dn-text) !important;
}

.factor-category,
.bucket-days {
    background: rgba(99, 102, 241, 0.16) !important;
    color: #c7d2fe !important;
    border: 1px solid rgba(99, 102, 241, 0.28) !important;
}

.report-meta,
.trend-controls,
.chart-section,
.breakdown-item,
.opportunity-icon,
.opportunity-type,
.trend-placeholder,
.legal-disclaimer-banner {
    background: var(--dn-bg-card-2) !important;
}

body.admin-shell .report-meta,
body.admin-shell .timeline-chart,
body.admin-shell .timeline-period,
body.admin-shell .country-icon,
body.admin-shell .method-icon,
body.admin-shell .item-icon,
body.admin-shell .risk-metric,
body.admin-shell .summary-metric,
body.admin-shell .report-empty-state,
body.admin-shell .chart-placeholder {
    background: var(--dn-bg-card-2) !important;
    border-color: var(--dn-border) !important;
    color: var(--dn-text-soft) !important;
}

.opportunity-icon,
.trend-placeholder,
.legal-disclaimer-banner {
    border: 1px solid var(--dn-border) !important;
}

.factor-bar,
.distribution-bar,
.score-bar,
.breakdown-bar {
    background: rgba(255, 255, 255, 0.08) !important;
}

.data-table th,
.table th,
table thead th {
    background: rgba(255, 255, 255, 0.04) !important;
    color: var(--dn-text) !important;
    border-bottom-color: var(--dn-border) !important;
}

.data-table td,
.table td,
table tbody td,
.data-table th,
.table th,
table tbody tr {
    border-color: var(--dn-border) !important;
    color: var(--dn-text-soft) !important;
}

.data-table tr:hover,
.table tbody tr:hover,
body.admin-shell .cohort-table tr:hover {
    background: rgba(255, 255, 255, 0.03) !important;
}

.legal-disclaimer-banner {
    color: #fcd34d !important;
    border-color: rgba(245, 158, 11, 0.22) !important;
}

.control-group select,
.rule-controls select,
.rule-controls input,
.alert-controls select,
.alert-controls input {
    background: #0f1420 !important;
    border: 1px solid var(--dn-border) !important;
    color: var(--dn-text) !important;
}

.status-open {
    color: #fcd34d !important;
}

.status-paid {
    color: #86efac !important;
}

.status-overdue,
.urgent {
    color: #fca5a5 !important;
}

body.admin-shell .metric-content h3,
body.admin-shell .metric-content p,
body.admin-shell .metric-content small,
body.admin-shell .form-section h2,
body.admin-shell .form-section > p,
body.admin-shell .report-meta,
body.admin-shell .tab-btn,
body.admin-shell .country-card *,
body.admin-shell .method-card *,
body.admin-shell .reason-card *,
body.admin-shell .risk-factor-card *,
body.admin-shell .category-card *,
body.admin-shell .action-card *,
body.admin-shell .strategy-card *,
body.admin-shell .performance-card *,
body.admin-shell .churn-card *,
body.admin-shell .dispute-card *,
body.admin-shell .summary-metric *,
body.admin-shell .risk-metric * {
    color: inherit !important;
}

body.admin-shell [style*="background: white"],
body.admin-shell [style*="background:white"],
body.admin-shell [style*="background: #fff"],
body.admin-shell [style*="background:#fff"],
body.admin-shell [style*="background: #f8f9fa"],
body.admin-shell [style*="background:#f8f9fa"],
body.admin-shell [style*="background: #fafbfc"],
body.admin-shell [style*="background:#fafbfc"],
body.admin-shell [style*="background: #fff8e6"],
body.admin-shell [style*="background:#fff8e6"] {
    background: var(--dn-bg-card-2) !important;
    color: var(--dn-text-soft) !important;
    border-color: var(--dn-border) !important;
}

#restricted-sync-status {
    background: var(--dn-bg-card-2) !important;
    color: var(--dn-text-soft) !important;
    border-color: var(--dn-border) !important;
}

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

    .section-switcher,
    .report-switcher {
        top: 0;
    }
}

@media (max-width: 960px) {
    .admin-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    body.admin-shell.sidebar-collapsed .admin-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .admin-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        z-index: 80;
        width: min(86vw, 320px);
        transform: translateX(-100%);
        transition: transform 180ms ease;
    }

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

    .admin-mobilebar {
        display: flex;
    }

    .admin-main {
        padding-top: 1.1rem;
    }

    .report-switcher {
        top: 0.75rem;
    }

    .section-switcher {
        top: 0.75rem;
    }
}

@media (max-width: 720px) {
    .metrics-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .admin-main {
        padding: 1rem 1rem 1.5rem;
    }

    .admin-page-header,
    .content-header,
    .card-body,
    .form-section {
        padding: 1rem;
    }

    .report-switcher-header {
        flex-direction: column;
        align-items: stretch;
    }

    .report-switcher-actions {
        justify-content: flex-start;
    }

    .section-switcher {
        padding: 0.82rem;
    }

    .section-switcher-header {
        flex-direction: column;
        align-items: stretch;
    }
}
