:root {
    --bg: #07152f;
    --panel: #0b1d41;
    --panel-2: #102750;
    --panel-3: #0f213f;
    --text: #f8fafc;
    --muted: #cbd5e1;
    --accent: #d4af37;
    --accent-soft: rgba(212, 175, 55, 0.16);
    --border: rgba(148, 163, 184, 0.22);
    --success: #22c55e;
    --warn: #f59e0b;
    --danger: #ef4444;
    --shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    background: linear-gradient(180deg, #08152f 0%, #071228 100%);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--panel-2);
    color: var(--text);
    border-radius: 12px;
    padding: 10px 14px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    background: var(--panel-3);
    color: var(--text);
    border-radius: 12px;
    padding: 10px 12px;
}

code {
    font-family: Consolas, Monaco, monospace;
    font-size: 0.95em;
    color: #fde68a;
}

.site_shell {
    width: min(1100px, calc(100% - 32px));
    margin: 0 auto;
}

.site_shell_public {
    width: min(1160px, calc(100% - 32px));
}

.site_shell_wide {
    width: min(1380px, calc(100% - 32px));
}

.page_main {
    padding: 22px 0 34px;
    min-height: 70vh;
}

.page_panel {
    background: rgba(10, 25, 56, 0.9);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 22px;
    box-shadow: var(--shadow);
}

.page_panel_public,
.page_panel_admin,
.page_panel_abc {
    min-height: 360px;
}

.flash {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(15, 33, 63, 0.9);
}

.flash_success {
    border-color: rgba(34, 197, 94, 0.6);
}

.flash_warn {
    border-color: rgba(245, 158, 11, 0.6);
}

.flash_error {
    border-color: rgba(239, 68, 68, 0.6);
}

.public_shell_header,
.admin_shell_header,
.abc_shell_header {
    padding: 18px 0 0;
}

.public_shell_header_top,
.admin_shell_header_top,
.abc_shell_header_top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 18px 20px 16px;
    background: rgba(10, 25, 56, 0.95);
    border: 1px solid var(--border);
    border-radius: 20px 20px 0 0;
    border-bottom: 0;
    box-shadow: var(--shadow);
}

.public_shell_brand,
.admin_shell_brand,
.abc_shell_brand {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.public_shell_brand a,
.admin_shell_brand strong,
.abc_shell_brand strong {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--text);
}

.public_shell_brand_subtitle,
.admin_shell_eyebrow,
.abc_shell_eyebrow,
.eyebrow {
    display: inline-block;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.public_shell_nav,
.admin_shell_nav,
.abc_shell_nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 14px 20px 18px;
    background: rgba(10, 25, 56, 0.95);
    border: 1px solid var(--border);
    border-top: 1px dashed rgba(212, 175, 55, 0.28);
    border-radius: 0 0 20px 20px;
    box-shadow: var(--shadow);
}

.public_shell_link,
.admin_shell_link,
.abc_shell_link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(16, 39, 80, 0.85);
    color: var(--text);
    font-weight: 700;
    line-height: 1;
    transition: 0.15s ease;
}

.public_shell_link:hover,
.admin_shell_link:hover,
.abc_shell_link:hover {
    text-decoration: none;
    border-color: rgba(212, 175, 55, 0.45);
    background: rgba(212, 175, 55, 0.1);
}

.public_shell_link.is_active,
.admin_shell_link.is_active,
.abc_shell_link.is_active {
    background: var(--accent-soft);
    border-color: rgba(212, 175, 55, 0.5);
    color: #fff4c6;
}

.public_shell_link_secondary {
    margin-left: auto;
}

.admin_shell_user,
.abc_shell_meta {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 0.94rem;
}

.admin_shell_role {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    border: 1px solid rgba(212, 175, 55, 0.36);
    color: #fff4c6;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
}

.admin_shell_logout {
    margin-left: auto;
}

.admin_shell_link_button {
    background: rgba(16, 39, 80, 0.85);
}

.stack_lg > * + * {
    margin-top: 24px;
}

.page_intro {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
}

.page_intro_split {
    align-items: center;
}

.page_title {
    margin: 0;
    font-size: 2rem;
    line-height: 1.1;
}

.page_subtitle {
    margin: 8px 0 0;
    color: var(--muted);
}

.page_intro_actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.metric_grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.metric_card,
.content_card,
.empty_state,
.auth_card {
    background: rgba(16, 39, 80, 0.88);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
}

.metric_card {
    min-height: 118px;
}

.metric_label {
    display: block;
    color: var(--muted);
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.metric_value {
    display: block;
    font-size: 2rem;
    line-height: 1;
}

.metric_value_sm {
    font-size: 1.2rem;
    line-height: 1.35;
}

.content_grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.clean_list {
    margin: 0;
    padding-left: 18px;
}

.clean_list li + li {
    margin-top: 8px;
}

.filter_bar {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr) auto;
    gap: 14px;
    align-items: end;
    padding: 16px;
    background: rgba(16, 39, 80, 0.88);
    border: 1px solid var(--border);
    border-radius: 16px;
}

.filter_bar_payments {
    grid-template-columns: repeat(6, minmax(0, 1fr)) auto;
}

.form_field label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 700;
}

.filter_actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.list_header {
    color: var(--muted);
}

.table_wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 14px;
}

.data_table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
    background: rgba(16, 39, 80, 0.9);
}

.data_table th,
.data_table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.data_table thead th {
    background: rgba(7, 21, 47, 0.96);
    color: var(--muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.data_table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.inline_flag {
    display: inline-block;
    margin-top: 6px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(239, 68, 68, 0.16);
    border: 1px solid rgba(239, 68, 68, 0.38);
    color: #fecaca;
    font-size: 0.8rem;
    font-weight: 700;
}

.status_pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.status_pill_success {
    background: rgba(34, 197, 94, 0.16);
    border-color: rgba(34, 197, 94, 0.42);
    color: #bbf7d0;
}

.status_pill_danger {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.42);
    color: #fecaca;
}

.table_note {
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.85rem;
}

.align_right {
    text-align: right;
}

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.detail_grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
    margin: 0;
}

.detail_grid dt {
    color: var(--muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.detail_grid dd {
    margin: 0;
    font-weight: 600;
    word-break: break-word;
}

.auth_wrap {
    width: min(560px, 100%);
    margin: 32px auto 0;
}

.auth_card {
    padding: 28px;
}

.auth_header {
    margin-bottom: 20px;
}

.auth_form {
    display: grid;
    gap: 16px;
}

.auth_actions {
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 1280px) {
    .filter_bar_payments {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .metric_grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .content_grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .public_shell_header_top,
    .admin_shell_header_top,
    .abc_shell_header_top {
        flex-direction: column;
        align-items: start;
    }

    .public_shell_link_secondary,
    .admin_shell_logout {
        margin-left: 0;
    }

    .filter_bar,
    .filter_bar_payments {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .metric_grid,
    .detail_grid {
        grid-template-columns: 1fr;
    }

    .page_title {
        font-size: 1.7rem;
    }

    .site_shell,
    .site_shell_public,
    .site_shell_wide {
        width: min(100% - 20px, 100%);
    }

    .auth_card {
        padding: 20px;
    }
}