:root {
    --modern-shell-max-width: 1320px;
    --modern-shell-max-width-wide: 1600px;
    --modern-shell-gap: 28px;
    --modern-frame-radius: 30px;
    --modern-frame-padding: 28px;
    --modern-frame-background: rgba(255, 255, 255, 0.18);
    --modern-frame-border: rgba(255, 255, 255, 0.18);
    --modern-frame-shadow: 0 30px 70px rgba(15, 23, 42, 0.22);
    --modern-surface-radius: 24px;
    --modern-surface-background: rgba(255, 255, 255, 0.94);
    --modern-surface-border: rgba(148, 163, 184, 0.16);
    --modern-surface-shadow: 0 20px 38px rgba(15, 23, 42, 0.12);
    --modern-surface-secondary: rgba(255, 255, 255, 0.9);
    --modern-text-primary: #0f172a;
    --modern-text-secondary: #475569;
    --modern-muted-chip: rgba(99, 102, 241, 0.1);
    --modern-muted-chip-text: #3730a3;
}

body[data-theme="ocean"] {
    --modern-frame-background: linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, rgba(191, 219, 254, 0.08) 100%);
    --modern-frame-border: rgba(125, 211, 252, 0.18);
    --modern-frame-shadow: 0 34px 82px rgba(8, 47, 73, 0.26);
}

body[data-theme="graphite"] {
    --modern-frame-background: linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0%, rgba(228, 228, 231, 0.16) 100%);
    --modern-frame-border: rgba(82, 82, 91, 0.2);
    --modern-frame-shadow: 0 32px 78px rgba(63, 63, 70, 0.22);
    --modern-surface-background: rgba(255, 255, 255, 0.97);
    --modern-surface-border: rgba(161, 161, 170, 0.22);
    --modern-surface-shadow: 0 20px 40px rgba(63, 63, 70, 0.16);
    --modern-surface-secondary: linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(244, 244, 245, 0.98) 100%);
    --modern-text-primary: #18181b;
    --modern-text-secondary: #52525b;
    --modern-muted-chip: rgba(82, 82, 91, 0.12);
    --modern-muted-chip-text: #3f3f46;
}

body[data-theme="midnight"] {
    --modern-frame-background: linear-gradient(180deg, rgba(255, 255, 255, 0.09) 0%, rgba(148, 163, 184, 0.04) 100%);
    --modern-frame-border: rgba(148, 163, 184, 0.22);
    --modern-frame-shadow: 0 38px 88px rgba(2, 6, 23, 0.48);
    --modern-surface-background: rgba(255, 255, 255, 0.97);
    --modern-surface-border: rgba(148, 163, 184, 0.18);
    --modern-surface-shadow: 0 24px 42px rgba(2, 6, 23, 0.22);
    --modern-surface-secondary: linear-gradient(180deg, rgba(255, 255, 255, 0.985) 0%, rgba(241, 245, 249, 0.985) 100%);
}

.modern-page-shell,
.reports-main-shell,
.dashboard-container,
.search-container,
.users-container,
.commission-container,
.addon-container,
.pdf-container,
.client-detail-container,
.policy-page-shell,
.main-container {
    position: relative;
}

.modern-page-shell {
    width: min(var(--modern-shell-max-width), calc(100% - 48px));
    margin: 28px auto 44px;
}

.modern-page-shell--wide {
    width: min(var(--modern-shell-max-width-wide), calc(100% - 48px));
}

.modern-page-frame,
.reports-page-frame,
.dashboard-container,
.users-container,
.commission-container,
.addon-container,
.pdf-container,
.client-detail-container,
.policy-page-frame,
.search-container {
    background: var(--modern-frame-background);
    border: 1px solid var(--modern-frame-border);
    border-radius: var(--modern-frame-radius);
    box-shadow: var(--modern-frame-shadow);
    backdrop-filter: blur(14px);
}

.modern-page-frame {
    padding: var(--modern-frame-padding);
}

.dashboard-container,
.users-container,
.commission-container,
.addon-container,
.pdf-container,
.client-detail-container,
.search-container {
    padding: 28px;
}

.modern-page-surface,
.reports-header,
.reports-panel,
.dashboard-header,
.search-header,
.modern-header,
.detail-header,
.page-header,
.users-card,
.commission-card,
.addon-card,
.pdf-card,
.client-info-card,
.policies-section,
.modern-card,
.card-modern,
.modern-tabs {
    background: var(--modern-surface-background);
    border: 1px solid var(--modern-surface-border);
    border-radius: var(--modern-surface-radius);
    box-shadow: var(--modern-surface-shadow);
}

.modern-page-header,
.reports-header,
.dashboard-header,
.search-header,
.modern-header,
.detail-header,
.commission-header,
.users-header,
.addon-header,
.pdf-header,
.page-header {
    position: relative;
    overflow: hidden;
}

.modern-page-header::after,
.reports-header::after,
.dashboard-header::after,
.search-header::after,
.modern-header::after,
.detail-header::after,
.commission-header::after,
.users-header::after,
.addon-header::after,
.pdf-header::after,
.page-header::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(120deg, transparent 0 64%, rgba(255, 255, 255, 0.08) 64% 78%, transparent 78% 100%);
}

.modern-surface-section {
    background: var(--modern-surface-secondary);
    border-radius: 22px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: var(--modern-surface-shadow);
}

body[data-theme] .modern-surface-section,
body[data-theme] .client-info-card,
body[data-theme] .policies-section,
body[data-theme] .users-card,
body[data-theme] .addon-card,
body[data-theme] .pdf-card,
body[data-theme] .modern-card,
body[data-theme] .card-modern,
body[data-theme] .modern-tabs {
    background: var(--modern-surface-secondary) !important;
}

.modern-page-title,
.reports-header-title,
.dashboard-title,
.search-title,
.page-title,
.users-title,
.commission-title,
.addon-title,
.pdf-title,
.modern-header h1,
.detail-header h1 {
    color: var(--modern-text-primary);
}

.modern-page-subtitle,
.reports-header-subtitle,
.dashboard-subtitle,
.page-subtitle,
.users-meta,
.commission-subtitle,
.addon-meta,
.pdf-meta {
    color: var(--modern-text-secondary);
}

body[data-theme] .dashboard-header,
body[data-theme] .search-header,
body[data-theme] .modern-header,
body[data-theme] .detail-header,
body[data-theme] .commission-header,
body[data-theme] .users-header,
body[data-theme] .addon-header,
body[data-theme] .pdf-header,
body[data-theme] .page-header,
body[data-theme] .reports-header {
    background: linear-gradient(135deg, var(--modern-theme-header-start) 0%, var(--modern-theme-header-end) 100%) !important;
    border-color: var(--modern-theme-surface-border) !important;
    box-shadow: 0 20px 44px var(--modern-theme-shadow) !important;
}

body[data-theme] .dashboard-title,
body[data-theme] .dashboard-subtitle,
body[data-theme] .search-title,
body[data-theme] .page-title,
body[data-theme] .page-subtitle,
body[data-theme] .users-title,
body[data-theme] .users-meta,
body[data-theme] .commission-title,
body[data-theme] .commission-subtitle,
body[data-theme] .addon-title,
body[data-theme] .addon-meta,
body[data-theme] .pdf-title,
body[data-theme] .pdf-meta,
body[data-theme] .modern-header h1,
body[data-theme] .detail-header h1,
body[data-theme] .reports-header-title,
body[data-theme] .reports-header-subtitle,
body[data-theme] .reports-meta-chip,
body[data-theme] .reports-dynamic-chip {
    color: #f8fafc !important;
}

body[data-theme] .reports-meta-chip,
body[data-theme] .reports-dynamic-chip {
    background: rgba(255, 255, 255, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

body[data-theme="midnight"] .dashboard-container,
body[data-theme="midnight"] .users-container,
body[data-theme="midnight"] .commission-container,
body[data-theme="midnight"] .addon-container,
body[data-theme="midnight"] .pdf-container,
body[data-theme="midnight"] .client-detail-container,
body[data-theme="midnight"] .policy-page-frame,
body[data-theme="midnight"] .reports-page-frame,
body[data-theme="midnight"] .search-container {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(148, 163, 184, 0.03) 100%) !important;
    border-color: rgba(148, 163, 184, 0.24) !important;
    box-shadow: 0 42px 96px rgba(2, 6, 23, 0.52) !important;
}

body[data-theme="ocean"] .dashboard-container,
body[data-theme="ocean"] .users-container,
body[data-theme="ocean"] .commission-container,
body[data-theme="ocean"] .addon-container,
body[data-theme="ocean"] .pdf-container,
body[data-theme="ocean"] .client-detail-container,
body[data-theme="ocean"] .policy-page-frame,
body[data-theme="ocean"] .reports-page-frame,
body[data-theme="ocean"] .search-container {
    border-color: rgba(125, 211, 252, 0.22) !important;
}

body[data-theme="graphite"] .dashboard-container,
body[data-theme="graphite"] .users-container,
body[data-theme="graphite"] .commission-container,
body[data-theme="graphite"] .addon-container,
body[data-theme="graphite"] .pdf-container,
body[data-theme="graphite"] .client-detail-container,
body[data-theme="graphite"] .policy-page-frame,
body[data-theme="graphite"] .reports-page-frame,
body[data-theme="graphite"] .search-container {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, rgba(212, 212, 216, 0.14) 100%) !important;
    border-color: rgba(82, 82, 91, 0.16) !important;
    box-shadow: 0 34px 84px rgba(63, 63, 70, 0.24) !important;
}

@media (max-width: 1199px) {
    .modern-page-shell,
    .modern-page-shell--wide,
    .reports-main-shell,
    .dashboard-container,
    .users-container,
    .commission-container,
    .addon-container,
    .pdf-container,
    .client-detail-container,
    .search-container,
    .main-container {
        width: calc(100% - 28px);
        margin-left: auto;
        margin-right: auto;
        padding-left: 20px;
        padding-right: 20px;
    }

    .modern-page-frame,
    .reports-page-frame,
    .policy-page-frame {
        padding: 22px;
    }
}

@media (max-width: 767px) {
    .modern-page-shell,
    .modern-page-shell--wide,
    .reports-main-shell,
    .dashboard-container,
    .users-container,
    .commission-container,
    .addon-container,
    .pdf-container,
    .client-detail-container,
    .search-container,
    .main-container {
        width: calc(100% - 18px);
        padding-left: 14px;
        padding-right: 14px;
    }

    .modern-page-frame,
    .reports-page-frame,
    .policy-page-frame {
        padding: 16px;
        border-radius: 24px;
    }
}
