:root {
    --admin-primary: #b61c1d;
    --admin-accent: #ee231d;
    --admin-ink: #332e2e;
    --admin-muted: #716767;
    --admin-background: #faf8f8;
    --admin-surface: #fff;
    --admin-border: #eee7e7;
    --admin-input-border: #e3dada;
    --admin-icon-background: var(--admin-icon-background);
    --admin-table-stripe: #fcf9f9;
    --admin-table-text: #5c5151;
    --bs-primary: #b61c1d;
    --bs-primary-rgb: 182, 28, 29;
    --bs-link-color: #b61c1d;
    --bs-link-hover-color: #881415;
    --bs-link-color-rgb: 182, 28, 29;
    --bs-link-hover-color-rgb: 136, 20, 21;
    --bs-primary-text-emphasis: #881415;
    --bs-primary-bg-subtle: #fbe8e7;
    --bs-primary-border-subtle: #f1c0be;
}
body { color: var(--admin-ink); font-family: "Segoe UI", system-ui, sans-serif; }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.ui-icon { width: 1.25rem; height: 1.25rem; flex-shrink: 0; vertical-align: middle; }
.admin-shell { display: flex; min-height: 100vh; background: var(--admin-background); }
.admin-sidebar {
    --bs-offcanvas-width: 16rem;
    background: linear-gradient(180deg, #2c2929 0%, #191717 100%) !important;
    color: #fff;
    border-top: 3px solid var(--admin-accent);
}
.sidebar-brand { display: flex !important; position: relative; padding: 1.4rem 1.25rem; border-bottom: 1px solid #ffffff26; }
.brand-mark { object-fit: contain; width: 8.375rem; height: auto; }
.brand-subtitle { font-size: .6rem; letter-spacing: .18em; color: #e4dada; }
.admin-sidebar .offcanvas-body { display: flex; flex-direction: column; flex-grow: 1; padding: 1.4rem 1rem; }
.sidebar-heading { color: #fff; text-transform: uppercase; font-size: .62rem; font-weight: 700; letter-spacing: .12em; padding: 0 .8rem; margin-bottom: .8rem; }
.admin-sidebar .nav-link { display: flex; align-items: center; gap: .8rem; color: #fff; padding: .85rem .8rem; border-radius: .5rem; font-size: .83rem; transition: background .15s, color .15s; }
.admin-sidebar .nav-link:hover, .admin-sidebar .nav-link:focus-visible { color: #fff; background: #ffffff12; }
.admin-sidebar .nav-link.active { color: #fff; background: #b61c1d; font-weight: 600; }
.sidebar-footer { display: flex; align-items: center; gap: .7rem; padding: 1rem .5rem 0; border-top: 1px solid #ffffff26; font-size: .72rem; color: #fff; }
.sidebar-footer strong { color: #fff; font-weight: 500; }
.sidebar-footer span { font-size: .65rem; margin-top: .2rem; }
.admin-workspace { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.admin-topbar { min-height: 5rem; background: var(--admin-surface); box-shadow: 0 2px 14px #4a222208; display: flex; justify-content: space-between; align-items: center; padding: 1rem 2rem; }
.topbar-breadcrumb { font-size: .8rem; color: var(--admin-muted); }
.topbar-breadcrumb .fw-semibold { color: var(--admin-ink); }
.profile-button { display: flex; align-items: center; gap: .85rem; padding: 0; background: none; border: 0; color: var(--admin-muted); }
.profile-name { font-size: .78rem; font-weight: 600; color: var(--admin-ink); }
.profile-role { font-size: .66rem; margin-top: .2rem; }
.admin-content { padding: 2rem; }
.admin-footer { background: var(--admin-surface); padding: 1.4rem; text-align: center; font-size: .72rem; color: var(--admin-muted); }
.admin-footer a { text-decoration: none; }
.page-heading { font-size: 1.6rem; font-weight: 500; letter-spacing: -.04em; margin: 0 0 .35rem; }
.page-description { font-size: .85rem; color: var(--admin-muted); margin: 0; }
.date-label { display: inline-flex; align-items: center; gap: .5rem; background: var(--admin-surface); border: 1px solid var(--admin-border); border-radius: .5rem; padding: .6rem .85rem; color: var(--admin-muted); font-size: .75rem; white-space: nowrap; }
.admin-shell .card { border: 1px solid var(--admin-border); border-radius: .65rem; box-shadow: 0 .2rem 1.2rem #4a222207; }
.admin-shell .card-header { background: var(--admin-surface); border-color: var(--admin-border); padding: 1.15rem 1.4rem; }
.admin-shell .card-header h2 { font-size: .9rem; font-weight: 600; color: var(--admin-primary); }
.admin-shell details > summary { cursor: pointer; color: var(--admin-primary); }
.admin-shell details:not([open]) > summary { border-bottom: 0; border-radius: var(--bs-card-inner-border-radius); }
.admin-shell .card-body { padding: 1.4rem; }
.stat-card { --stat-color: var(--admin-primary); border-left: 4px solid var(--stat-color) !important; }
.stat-card.success { --stat-color: #16805d; }
.stat-card.danger { --stat-color: #be424f; }
.stat-card.info { --stat-color: #157a8c; }
.stat-card.warning { --stat-color: #916a18; }
.stat-card .card-body { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.stat-label { font-size: .65rem; font-weight: 700; letter-spacing: .055em; text-transform: uppercase; color: var(--stat-color); margin-bottom: .5rem; }
.stat-card .card-body > div { min-width: 0; }
.stat-value { font-size: 1.35rem; font-weight: 650; letter-spacing: -.04em; overflow-wrap: anywhere; }
.stat-note { font-size: .72rem; color: var(--admin-muted); margin-top: .25rem; }
.stat-icon { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: .7rem; background: var(--admin-icon-background); color: var(--stat-color); flex-shrink: 0; }
.stat-icon .ui-icon { width: 1.45rem; height: 1.45rem; }
.activity-label { font-size: .76rem; color: var(--admin-muted); }
.activity-value { font-weight: 650; font-size: 1.05rem; margin-top: .35rem; }
.activity-icon { color: #aaa0a0; }
.section-caption { font-size: .73rem; color: var(--admin-muted); }
.admin-shell .table { --bs-table-striped-bg: var(--admin-table-stripe); --bs-table-striped-color: var(--admin-table-text); --bs-table-color: var(--admin-table-text); font-size: .8rem; }
.admin-shell .table > :not(caption) > * > * { padding: .85rem .8rem; border-color: var(--admin-border); }
.admin-shell .table thead th { font-size: .69rem; font-weight: 600; color: var(--admin-muted); white-space: nowrap; }
.admin-shell .form-label { font-size: .8rem; font-weight: 500; }
.expense-players { max-height: 16rem; overflow-y: auto; }
.admin-shell .form-control, .admin-shell .form-select { border-color: var(--admin-input-border); border-radius: .4rem; font-size: .85rem; }
.form-control:focus, .form-select:focus { border-color: #d87f80; box-shadow: 0 0 0 .2rem #b61c1d18; }
.btn { font-size: .82rem; border-radius: .4rem; padding: .55rem .85rem; }
.btn-primary { --bs-btn-focus-shadow-rgb: 182, 28, 29; --bs-btn-bg: #b61c1d; --bs-btn-border-color: #b61c1d; --bs-btn-hover-bg: #9e1718; --bs-btn-hover-border-color: #9e1718; --bs-btn-active-bg: #881415; --bs-btn-active-border-color: #881415; }
.admin-shell .btn-sm { font-size: .72rem; padding: .35rem .65rem; }
.admin-shell .badge { font-weight: 500; }
.admin-shell .dt-container { font-size: .76rem; }
.admin-shell .dt-layout-table { --bs-gutter-x: 0; }
.admin-shell .dt-container .dt-info { color: var(--admin-muted); }
@media (min-width: 992px) {
    .admin-sidebar { position: sticky; top: 0; width: 14rem; height: 100vh; flex-shrink: 0; display: flex; flex-direction: column; }
}
@media (max-width: 767.98px) {
    .admin-content { padding: 1.25rem 1rem; }
    .admin-topbar { padding: 1rem; min-height: 4.5rem; }
    .page-heading { font-size: 1.4rem; }
    .admin-shell .card-body { padding: 1rem; }
    .admin-shell .card-header { padding: 1rem; }
    .stat-value { font-size: 1.25rem; }
}
@media print {
    .admin-shell { display: block; background: var(--admin-surface); }
    .admin-content { padding: 0; }
    .admin-shell .card { box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
    .admin-sidebar .nav-link { transition: none; }
}

.admin-shell .pagination { --bs-pagination-active-bg: #b61c1d; --bs-pagination-active-border-color: #b61c1d; --bs-pagination-color: var(--admin-primary); --bs-pagination-focus-box-shadow: 0 0 0 .2rem #b61c1d18; }
.admin-shell .page-link { font-size: .75rem; }

.btn-outline-primary { --bs-btn-focus-shadow-rgb: 182, 28, 29; --bs-btn-color: var(--admin-primary); --bs-btn-border-color: var(--admin-primary); --bs-btn-hover-bg: #b61c1d; --bs-btn-hover-border-color: #b61c1d; --bs-btn-active-bg: #881415; --bs-btn-active-border-color: #881415; }
.form-check-input:checked { background-color: #b61c1d; border-color: #b61c1d; }
.form-check-input:focus { border-color: #d87f80; box-shadow: 0 0 0 .2rem #b61c1d18; }
.dropdown-menu { --bs-dropdown-link-active-bg: #b61c1d; }

[data-bs-theme="dark"] {
    --admin-primary: #f07878;
    --bs-primary-rgb: 240, 120, 120;
    --admin-ink: #eee7e7;
    --admin-muted: #bfb3b3;
    --admin-background: #191717;
    --admin-surface: #252121;
    --admin-border: #453c3c;
    --admin-input-border: #5c5050;
    --admin-icon-background: #3d2727;
    --admin-table-stripe: #2d2727;
    --admin-table-text: #e1d7d7;
    --bs-body-bg: #252121;
    --bs-body-color: #eee7e7;
    --bs-tertiary-bg: #191717;
    --bs-border-color: #453c3c;
    --bs-link-color: #f07878;
    --bs-link-hover-color: #ffa1a1;
    --bs-link-color-rgb: 240, 120, 120;
    --bs-link-hover-color-rgb: 255, 161, 161;
    --bs-primary-text-emphasis: #f07878;
    --bs-primary-bg-subtle: #3d2727;
    --bs-primary-border-subtle: #754343;
    --bs-success-rgb: 108, 212, 171;
    --bs-danger-rgb: 240, 120, 120;
}
[data-bs-theme="dark"] .stat-card.success { --stat-color: #6cd4ab; }
[data-bs-theme="dark"] .stat-card.danger { --stat-color: #f07878; }
[data-bs-theme="dark"] .stat-card.info { --stat-color: #72cbd7; }
[data-bs-theme="dark"] .stat-card.warning { --stat-color: #efc36d; }
.theme-toggle { color: var(--admin-ink); border: 1px solid var(--admin-border); flex-shrink: 0; }
.theme-toggle:hover, .theme-toggle:focus-visible { color: var(--admin-primary); background: var(--admin-icon-background); }
.theme-sun, [data-bs-theme="dark"] .theme-moon { display: none; }
[data-bs-theme="dark"] .theme-sun { display: inline-block; }
