@import url('https://fonts.googleapis.com/css2?family=Saira:wght@300;400;500;600;700&display=swap');

/*!
 * Custom styles for matchplan.one admin area
 * Light Theme — inspired by matchplan.one brand identity
 * Font: Saira (Google Fonts) | Accent: #B29146
 */

/* ─── Design Tokens ───────────────────────────────────────────── */
:root {
    /* Brand */
    --mp-gold: #B29146;
    --mp-gold-hover: #9A7C38;
    --mp-gold-light: rgba(178, 145, 70, 0.10);
    --mp-gold-subtle: rgba(178, 145, 70, 0.06);

    /* Surfaces */
    --mp-bg: #F4F5F7;
    --mp-surface: #FFFFFF;
    --mp-surface-2: #F8F9FA;
    --mp-border: #E4E7EC;
    --mp-border-light: #EEF0F3;

    /* Text */
    --mp-text: #131416;
    --mp-text-muted: #6B7280;
    --mp-text-light: #9CA3AF;

    /* Shadows */
    --mp-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --mp-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.05);
    --mp-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.05);

    /* Typography */
    --mp-font: 'Saira', system-ui, sans-serif;
    --mp-radius: 8px;
    --mp-radius-lg: 12px;
    --mp-radius-pill: 999px;

    /* Layout constants (keep from original) */
    --mp-admin-content-min-height: clamp(24rem, 60vh, 43.75rem);
    --mp-admin-cell-max-width: 22.5rem;
    --mp-gold-color: #B29146;
}

/* ─── Dark Theme ───────────────────────────────────────────── */
[data-theme="dark"] {
    /* Brand */
    --mp-gold: #D4AF37;
    --mp-gold-hover: #E5C362;
    --mp-gold-light: rgba(212, 175, 55, 0.15);
    --mp-gold-subtle: rgba(212, 175, 55, 0.08);

    /* Surfaces */
    --mp-bg: #0B0E14;
    --mp-surface: #151921;
    --mp-surface-2: #1C222D;
    --mp-border: #2D333B;
    --mp-border-light: #373E47;

    /* Text */
    --mp-text: #F0F2F5;
    --mp-text-muted: #9CA3AF;
    --mp-text-light: #6B7280;

    /* Shadows */
    --mp-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --mp-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
    --mp-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);

    /* Overrides for dark mode specificity */
    --bs-table-striped-bg: var(--mp-surface-2);
    --bs-table-hover-bg: var(--mp-gold-subtle);
}

[data-theme="dark"] body {
    color: var(--mp-text) !important;
}

[data-theme="dark"] .bg-white {
    background-color: var(--mp-surface) !important;
}

[data-theme="dark"] .bg-light {
    background-color: var(--mp-surface-2) !important;
}

[data-theme="dark"] .text-dark {
    color: var(--mp-text) !important;
}

[data-theme="dark"] .text-muted {
    color: var(--mp-text-muted) !important;
}

[data-theme="dark"] .breadcrumb-item::before {
    color: var(--mp-text-light) !important;
}

[data-theme="dark"] .btn-link {
    color: var(--mp-text-muted) !important;
}

[data-theme="dark"] .dropdown-menu {
    background-color: var(--mp-surface);
}

[data-theme="dark"] .dropdown-item {
    color: var(--mp-text);
}

[data-theme="dark"] .form-control-plaintext {
    color: var(--mp-text);
}

[data-theme="dark"] hr {
    border-color: var(--mp-border);
    opacity: 0.25;
}

[data-theme="dark"] .list-group-item {
    background-color: transparent;
    border-color: var(--mp-border);
    color: var(--mp-text);
}

[data-theme="dark"] .list-group-item .text-muted {
    color: var(--mp-text-muted) !important;
}

[data-theme="dark"] .table-striped>tbody>tr:nth-of-type(odd)>* {
    --bs-table-accent-bg: var(--mp-surface-2);
    background-color: var(--mp-surface-2) !important;
    color: var(--mp-text) !important;
}

[data-theme="dark"] .table-striped>tbody>tr:nth-of-type(even)>* {
    color: var(--mp-text) !important;
}

[data-theme="dark"] .table {
    color: var(--mp-text) !important;
    border-color: var(--mp-border) !important;
}

[data-theme="dark"] .form-control:disabled,
[data-theme="dark"] .form-control[readonly] {
    background-color: var(--mp-surface-2);
    border-color: var(--mp-border);
    color: var(--mp-text-muted);
}

[data-theme="dark"] .alert-success {
    background-color: rgba(16, 185, 129, 0.1) !important;
    color: #10b981 !important;
    border: 1px solid rgba(16, 185, 129, 0.2) !important;
}

[data-theme="dark"] .alert-danger {
    background-color: rgba(239, 68, 68, 0.1) !important;
    color: #ef4444 !important;
    border: 1px solid rgba(239, 68, 68, 0.2) !important;
}

[data-theme="dark"] .alert-warning {
    background-color: rgba(245, 158, 11, 0.1) !important;
    color: #f59e0b !important;
    border: 1px solid rgba(245, 158, 11, 0.2) !important;
}

[data-theme="dark"] .alert-info {
    background-color: rgba(59, 130, 246, 0.1) !important;
    color: #3b82f6 !important;
    border: 1px solid rgba(59, 130, 246, 0.2) !important;
}

[data-theme="dark"] .card-header {
    color: var(--mp-text) !important;
}

[data-theme="dark"] .table-light {
    border-color: var(--mp-border) !important;
    --bs-table-bg: var(--mp-surface) !important;
    --bs-table-border-color: var(--mp-border) !important;
    --bs-table-color: var(--mp-text) !important;
    --bs-table-hover-bg: var(--mp-gold-subtle) !important
}

[data-theme="dark"] .border {
    border-color: var(--mp-border) !important;
}




/* ─── Theme Toggle Button ─────────────────────────────────── */
.theme-toggle {
    background: transparent;
    border: none;
    color: var(--mp-text-muted);
    padding: 0.5rem;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, transform 0.2s;
    border-radius: var(--mp-radius);
    margin-right: 0.5rem;
}

.theme-toggle:hover {
    color: var(--mp-gold);
    background-color: var(--mp-gold-subtle);
}

.theme-toggle i {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

[data-theme="dark"] .theme-toggle i {
    transform: rotate(360deg);
}

.theme-toggle .fa-sun {
    display: none;
}

.theme-toggle .fa-moon {
    display: block;
}

[data-theme="dark"] .theme-toggle .fa-sun {
    display: block;
}

[data-theme="dark"] .theme-toggle .fa-moon {
    display: none;
}

/* ─── Global Reset / Base ──────────────────────────────── */
/* Apply Saira ONLY to elements that don't need icon fonts */
body {
    background-color: var(--mp-bg) !important;
    font-size: 0.9rem;
    -webkit-font-smoothing: antialiased;
}

/* Apply Saira explicitly (not via !important inheritance) */
body>*:not(script):not(style),
.sb-topnav,
#layoutSidenav_content,
.card,
.modal,
.alert,
.table,
.form-control,
.form-select,
p,
span:not([class*="fa"]),
div,
li,
td,
th,
label,
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--mp-font);
}

/* ─── Top Navigation Bar ──────────────────────────────────────── */
.sb-topnav.navbar {
    background-color: var(--mp-surface) !important;
    border-bottom: 1px solid var(--mp-border) !important;
    box-shadow: var(--mp-shadow-xs) !important;
    min-height: 58px;
    padding: 0 1.25rem;
}

.sb-topnav .navbar-brand {
    color: var(--mp-text) !important;
    font-family: var(--mp-font) !important;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.01em;
    padding: 0;
    text-decoration: none;
    transition: opacity 0.15s ease;
}

.sb-topnav .navbar-brand:hover {
    opacity: 0.8;
}

.sb-topnav .btn-link {
    color: var(--mp-text-muted) !important;
    transition: color 0.15s ease;
}

.sb-topnav .btn-link:hover {
    color: var(--mp-gold) !important;
}

.sb-topnav .nav-link {
    color: var(--mp-text-muted) !important;
}

.sb-topnav .nav-link:hover {
    color: var(--mp-gold) !important;
}

.sb-topnav .dropdown-menu {
    border: 1px solid var(--mp-border);
    box-shadow: var(--mp-shadow-md);
    border-radius: var(--mp-radius);
    padding: 0.35rem;
    min-width: 160px;
}

.sb-topnav .dropdown-item {
    border-radius: 6px;
    padding: 0.45rem 0.85rem;
    font-size: 0.875rem;
    color: var(--mp-text);
    transition: background 0.12s ease;
}

[data-theme="dark"] .dropdown-item:hover {
    background-color: var(--mp-gold-light);
    color: var(--mp-gold);
}

[data-theme="dark"] .dropdown-menu {
    border-color: var(--mp-border) !important;
}

/* ───── Dark Mode specific components ───── */
[data-theme="dark"] .modal-content {
    background-color: var(--mp-surface);
    border: 1px solid var(--mp-border) !important;
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    border-color: var(--mp-border) !important;
}

[data-theme="dark"] .card {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(1) brightness(1);
}

[data-theme="dark"] .form-check-input {
    background-color: var(--mp-surface);
    border-color: var(--mp-border);
}

[data-theme="dark"] .form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

[data-theme="dark"] .text-black {
    color: var(--mp-text) !important;
}

[data-theme="dark"] .text-white {
    color: #FFFFFF !important;
}

[data-theme="dark"] .text-primary {
    color: #3b82f6 !important;
    /* Slightly lighter blue for dark mode */
}

[data-theme="dark"] .dataTable-pagination-list li a,
[data-theme="dark"] .dataTable-pagination a {
    background-color: var(--mp-surface);
    border-color: var(--mp-border);
    color: var(--mp-text) !important;
}

[data-theme="dark"] .dataTable-pagination-list li.active a,
[data-theme="dark"] .dataTable-pagination-list li a:hover,
[data-theme="dark"] .dataTable-pagination li.active a,
[data-theme="dark"] .dataTable-pagination a:hover {
    background-color: var(--mp-gold-subtle) !important;
    color: var(--mp-gold) !important;
    border-color: var(--mp-gold) !important;
}

[data-theme="dark"] .dataTable-selector,
[data-theme="dark"] .dataTable-input {
    background-color: var(--mp-surface) !important;
    border-color: var(--mp-border) !important;
    color: var(--mp-text) !important;
}

[data-theme="dark"] .dataTable-info {
    color: var(--mp-text-muted);
}

[data-theme="dark"] .dataTable-sorter::before {
    border-top-color: var(--mp-text) !important;
}

[data-theme="dark"] .dataTable-sorter::after {
    border-bottom-color: var(--mp-text) !important;
}

[data-theme="dark"] .pagination .page-link {
    background-color: var(--mp-surface);
    border-color: var(--mp-border);
    color: var(--mp-text);
}

[data-theme="dark"] .pagination .page-item.active .page-link {
    background-color: var(--mp-gold) !important;
    border-color: var(--mp-gold) !important;
    color: #FFFFFF !important;
}

[data-theme="dark"] .pagination .page-item.disabled .page-link {
    background-color: var(--mp-surface-2);
    color: var(--mp-text-light);
}

/* ─── Sidebar ─────────────────────────────────────────────────── */
#layoutSidenav_nav {
    background-color: var(--mp-surface);
    border-right: 1px solid var(--mp-border);
}

.sb-sidenav {
    background-color: var(--mp-surface) !important;
}

.sb-sidenav-dark {
    background-color: var(--mp-surface) !important;
}

.sb-sidenav-dark .sb-sidenav-menu .nav-link {
    color: var(--mp-text-muted) !important;
    border-radius: var(--mp-radius) !important;
    margin: 1px 10px;
    padding: 0.6rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.sb-sidenav-dark .sb-sidenav-menu .nav-link:hover {
    color: var(--mp-gold) !important;
    background-color: var(--mp-gold-subtle) !important;
}

.sb-sidenav-dark .sb-sidenav-menu .nav-link.active {
    color: #0d6efd !important;
    background-color: rgba(13, 110, 253, 0.08) !important;
    font-weight: 600;
}

.sb-sidenav-dark .sb-sidenav-menu .nav-link.disabled {
    color: var(--mp-text-light) !important;
    opacity: 0.55;
}

.sb-sidenav-dark .sb-sidenav-menu .nav-link .sb-nav-link-icon {
    color: inherit !important;
    margin-right: 0.6rem;
    width: 1rem;
    text-align: center;
    font-size: 0.875rem;
}

.sb-sidenav-dark .sb-sidenav-menu .nav-link hr {
    margin: 0.5rem 0;
    border-color: var(--mp-border);
    /*opacity: 1;*/
}

.sb-sidenav-menu>.nav hr {
    border-color: var(--mp-border);
    margin: 0.5rem 1rem;
    /*opacity: 1;*/
}

/* Sidenav footer */
.sb-sidenav-footer {
    background-color: var(--mp-surface) !important;
    border-top: 1px solid var(--mp-border) !important;
}

/* Sidenav menu header text */
.sb-sidenav-dark .sb-sidenav-menu-heading {
    color: var(--mp-text-light) !important;
}

/* ─── Content Area ────────────────────────────────────────────── */
#layoutSidenav_content>main {
    padding-top: 1rem;
}

/* ─── Bootstrap Overrides — primary = Bootstrap blue ───────── */

.btn-primary {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    color: #fff !important;
    font-weight: 600;
    border-radius: var(--mp-radius) !important;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #0b5ed7 !important;
    border-color: #0b5ed7 !important;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.3) !important;
}

.btn-outline-primary {
    color: #0d6efd !important;
    border-color: #0d6efd !important;
    border-radius: var(--mp-radius) !important;
    font-weight: 500;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    color: #fff !important;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25) !important;
}

/* ─── Font Awesome protection — never override icon fonts ────── */
.fas,
.far,
.fab,
.fa,
.fa-solid,
.fa-regular,
.fa-brands,
[class^="fa-"],
[class*=" fa-"] {
    /*WP: font-family: inherit; /* let FA's own CSS win */
}

/* ─── All buttons — consistent radius ────────────────────────── */
.btn {
    border-radius: var(--mp-radius) !important;
    font-size: 0.875rem;
    transition: all 0.15s ease;
}

.btn-sm {
    border-radius: 6px !important;
    font-size: 0.8rem;
}

/* ─── Focus rings ─────────────────────────────────────── */
.btn:focus-visible,
.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25) !important;
    border-color: #0d6efd !important;
    outline: none;
}

/* ─── Cards ───────────────────────────────────────────────────── */
.card {
    background-color: var(--mp-surface);
    border: 1px solid var(--mp-border) !important;
    border-radius: var(--mp-radius-lg) !important;
    box-shadow: var(--mp-shadow-sm) !important;
    transition: box-shadow 0.2s ease;
}

.card-header {
    background-color: var(--mp-surface) !important;
    border-bottom: 1px solid var(--mp-border-light) !important;
    border-radius: var(--mp-radius-lg) var(--mp-radius-lg) 0 0 !important;
    padding: 1rem 1.25rem !important;
    font-family: var(--mp-font) !important;
}

.card-body {
    padding: 1.25rem !important;
}

/* ─── Tables ──────────────────────────────────────────────────── */
.table {
    font-size: 0.875rem;
    color: var(--mp-text);
    --bs-table-striped-bg: transparent;
    --bs-table-hover-bg: var(--mp-gold-subtle);
    --bs-table-bg: transparent;
}

.table thead th {
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--mp-text-muted);
    border-bottom: 2px solid var(--mp-border) !important;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
    white-space: nowrap;
}

.table tbody tr {
    border-bottom: 1px solid var(--mp-border-light);
    transition: background-color 0.1s ease;
}

.table tbody tr:hover {
    background-color: var(--mp-gold-subtle);
}

.table-striped>tbody>tr:nth-of-type(odd)>* {
    --bs-table-accent-bg: var(--mp-surface-2);
    background-color: var(--mp-surface-2);
}

.table> :not(caption)>*>* {
    padding: 0.6rem 0.75rem;
}

/* ─── Forms ───────────────────────────────────────────────────── */
.form-control,
.form-select {
    border-color: var(--mp-border);
    border-radius: var(--mp-radius) !important;
    font-size: 0.875rem;
    color: var(--mp-text);
    background-color: var(--mp-surface);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--mp-gold);
    box-shadow: 0 0 0 0.2rem rgba(178, 145, 70, 0.18);
    background-color: var(--mp-surface);
}

.form-control::placeholder {
    color: var(--mp-text-light);
}

.form-label {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--mp-text);
    margin-bottom: 0.35rem;
}

/* ─── Badges ──────────────────────────────────────────────────── */
.badge {
    font-family: var(--mp-font) !important;
    font-weight: 600;
    font-size: 0.72rem;
    border-radius: var(--mp-radius-pill);
    letter-spacing: 0.02em;
}

.bg-primary {
    background-color: #0d6efd !important;
}

/* ─── Alerts ──────────────────────────────────────────────────── */
.alert {
    border-radius: var(--mp-radius-lg) !important;
    border: none !important;
    font-size: 0.875rem;
}

.alert-success {
    background-color: #ECFDF5;
    color: #065F46;
}

.alert-danger {
    background-color: #FEF2F2;
    color: #991B1B;
}

.alert-warning {
    background-color: #FFFBEB;
    color: #92400E;
}

.alert-info {
    background-color: #EFF6FF;
    color: #1E40AF;
}

/* ─── Breadcrumbs ─────────────────────────────────────────────── */
.breadcrumb {
    font-size: 0.8rem;
    font-weight: 500;
}

.breadcrumb-item+.breadcrumb-item::before {
    color: var(--mp-text-light);
}

.breadcrumb-item a {
    color: var(--mp-text-muted);
    text-decoration: none;
    transition: color 0.15s;
}

.breadcrumb-item a:hover {
    color: var(--mp-gold);
}

.breadcrumb-item.active {
    color: var(--mp-text);
}

/* ─── Page Headings ───────────────────────────────────────────── */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--mp-font) !important;
    color: var(--mp-text);
}

h1.mt-4 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--mp-text);
}

/* ─── Modals ──────────────────────────────────────────────────── */
.modal-content {
    border: none !important;
    border-radius: var(--mp-radius-lg) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15) !important;
}

.modal-header {
    border-bottom: 1px solid var(--mp-border) !important;
    padding: 1.1rem 1.25rem;
}

.modal-footer {
    border-top: 1px solid var(--mp-border) !important;
}

/* ─── Login page (not logged in state) ───────────────────────── */
body.bg-light {
    background-color: var(--mp-bg) !important;
}

/* ─── Footer ──────────────────────────────────────────────────── */
footer.py-4.bg-light {
    background-color: var(--mp-surface) !important;
    border-top: 1px solid var(--mp-border);
    font-size: 0.8rem;
    color: var(--mp-text-muted);
}

/* ─── Dropdown menus (generic) ────────────────────────────────── */
.dropdown-menu {
    border: 1px solid var(--mp-border) !important;
    border-radius: var(--mp-radius) !important;
    box-shadow: var(--mp-shadow-md) !important;
    padding: 0.35rem !important;
    font-size: 0.875rem;
}

.dropdown-item {
    border-radius: 6px;
    padding: 0.45rem 0.85rem;
    color: var(--mp-text);
    transition: background 0.1s ease;
}

.dropdown-item:hover {
    background-color: var(--mp-gold-subtle);
    color: var(--mp-gold-hover);
}

/* ─── Links ───────────────────────────────────────────────────── */
a {
    color: #0d6efd;
}

a:hover {
    color: #0b5ed7;
}

/* ─── Scrollbar (subtle) ──────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--mp-border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #CBD5E0;
}

/* ─── Utility classes ─────────────────────────────────────────── */
.content-min-height {
    min-height: var(--mp-admin-content-min-height);
}

.collapse-card-toggle {
    transition: background-color 0.2s ease;
}

.collapse-card-toggle:hover,
.collapse-card-toggle:focus {
    background-color: var(--mp-gold-subtle);
}

.collapse-card-toggle .collapse-indicator {
    transition: transform 0.2s ease;
}

.collapse-card-toggle.collapsed .collapse-indicator {
    transform: rotate(-90deg);
}

@media (max-width: 767.98px) {
    .content-min-height {
        min-height: auto;
    }
}

.chart-width-md {
    width: min(40%, 32rem);
}

@media (max-width: 991.98px) {
    .chart-width-md {
        width: 100%;
    }
}

.table-text-block {
    display: inline-block;
    max-width: var(--mp-admin-cell-max-width);
    word-break: break-word;
}

.provider-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 1.1rem;
}

/* ─── Activity Bars ───────────────────────────────────────────── */
.user-activity-bars-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.25rem;
}

.user-activity-bars {
    height: 88px;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 8px;
    align-items: end;
    gap: 2px;
    width: max-content;
    min-width: 100%;
}

.user-activity-cell {
    display: flex;
    align-items: end;
    justify-content: center;
    margin: 0 -1px;
    padding: 0 1px;
}

.month-even {
    background: rgba(178, 145, 70, 0.04);
}

.month-odd {
    background: rgba(178, 145, 70, 0.10);
}

.user-activity-bar {
    min-height: 4px;
    border-radius: 3px 3px 0 0;
    background: linear-gradient(180deg, #CFA953 0%, #B29146 100%);
    transition: opacity 0.15s ease;
}

.user-activity-bar-empty {
    background: var(--mp-border);
}

.user-activity-bar:hover {
    opacity: 0.8;
}

.user-activity-months {
    display: grid;
    grid-auto-columns: 8px;
    gap: 2px;
    width: max-content;
    min-width: 100%;
    margin-top: 0.35rem;
}

.user-activity-month {
    text-align: center;
    font-size: 0.68rem;
    color: var(--mp-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ─── Timeline ────────────────────────────────────────────────── */
.user-activity-timeline {
    position: relative;
    min-height: 70px;
    padding: 2.75rem 0.75rem;
    margin: 0 20px;
}

.user-activity-timeline-track {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, #f0e8d5 0%, #dcc98a 100%);
    transform: translateY(-50%);
}

.timeline-item {
    position: absolute;
    top: 50%;
    transform: translate(-50%, calc(-50%));
    z-index: 2;
}

.timeline-dot {
    display: block;
    width: 14px;
    height: 14px;
    margin: 0 auto;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px rgba(178, 145, 70, 0.25);
    background: var(--mp-text-muted);
}

.timeline-provider-mark {
    display: block;
    font-size: 14px;
    line-height: 1;
    position: absolute;
    top: -30px;
}

.timeline-subscription-caption {
    position: absolute;
    left: 50%;
    top: calc(100% + 10px);
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 90px;
    text-align: center;
}

.timeline-subscription-plan {
    font-size: 0.67rem;
    font-weight: 600;
    line-height: 1.1;
    color: var(--mp-text);
}

.timeline-subscription-date {
    font-size: 0.63rem;
    line-height: 1.1;
    color: var(--mp-text-muted);
}

.timeline-content {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    background: var(--mp-surface);
    border: 1px solid var(--mp-border);
    border-radius: 0.5rem;
    padding: 0.45rem 0.55rem;
    box-shadow: var(--mp-shadow-sm);
    text-align: center;
}

.timeline-content-top {
    bottom: calc(100% + 10px);
}

.timeline-content-bottom {
    top: calc(100% + 10px);
}

.timeline-label {
    font-weight: 600;
    font-size: 0.82rem;
    line-height: 1.2;
}

.timeline-date,
.timeline-details {
    font-size: 0.72rem;
    color: var(--mp-text-muted);
    line-height: 1.25;
}

.timeline-item-registration .timeline-dot {
    background: #5900ff;
}

.timeline-item-purchase .timeline-dot,
.timeline-item-renewal .timeline-dot,
.timeline-item-subscriptions .timeline-dot {
    background: var(--mp-gold);
    z-index: 4;
}

.timeline-item-subscriptions .timeline-provider-mark {
    z-index: 4;
}

.timeline-item-team .timeline-dot {
    background: #24e74e;
}

.timeline-item-lineup .timeline-dot {
    background: #3325f6;
}

.timeline-item-token .timeline-dot {
    background: #6008ac;
    z-index: 3;
}

.timeline-item-s2u .timeline-dot {
    display: none;
}

@media (max-width: 767.98px) {
    .user-activity-bars {
        height: 72px;
        grid-auto-columns: 6px;
        gap: 1px;
    }

    .user-activity-months {
        grid-template-columns: repeat(var(--activity-days-count, 1), minmax(6px, 1fr));
        gap: 1px;
    }

    .user-activity-timeline {
        min-height: 320px;
    }

    .timeline-item {
        width: min(160px, 60vw);
    }
}

/* ─── Weight Matrix ───────────────────────────────────────────── */
#weight_matrix td {
    padding: 0;
}

#weight_matrix th {
    text-align: center;
    writing-mode: sideways-lr;
    text-orientation: mixed;
    width: 30px;
    min-width: 30px;
}

#weight_matrix tr {
    border: 2px solid transparent;
}

#weight_matrix tr.table-row-highlight {
    background-color: rgba(178, 145, 70, 0.12);
    border: 2px solid var(--mp-gold);
}

#weight_matrix .form-select {
    background-image: none;
    padding-right: 0;
    padding-left: 15px;
}

#simple_weight_matrix .wm-lr {
    vertical-align: middle;
    text-align: center;
    writing-mode: sideways-lr;
    text-orientation: mixed;
}

/* ─── Lineup / Field ──────────────────────────────────────────── */
.lineup-field-wrapper {
    display: flex;
    justify-content: center;
}

.lineup-field-overlay {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 1100;
    width: min(90vw, 420px);
    cursor: grab;
}

.lineup-field-overlay.dragging {
    cursor: grabbing;
    user-select: none;
}

.lineup-field-overlay-handle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    background-color: #1f5f33;
    color: #fff;
    border-radius: 0.5rem 0.5rem 0 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    cursor: inherit;
}

.lineup-field-overlay-body {
    background: var(--mp-surface);
    padding: 0.5rem;
    border-radius: 0 0 0.75rem 0.75rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.lineup-field-overlay-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.lineup-field-overlay-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.lineup-field-toggle {
    padding-inline: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.lineup-field-overlay-collapsed .lineup-field-overlay-body {
    display: none;
}

.lineup-field-overlay-collapsed .lineup-field-overlay-handle {
    border-radius: 0.75rem;
}

.team-player-photo {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 2rem;
    border: 1px solid var(--mp-border);
}

.team-player-photo-trigger {
    display: inline-flex;
    padding: 0;
    border: 0;
    background: transparent;
    line-height: 0;
    cursor: zoom-in;
}

.team-player-photo-trigger:focus-visible {
    outline: 2px solid var(--mp-gold);
    outline-offset: 2px;
}

#field,
.lineup-field {
    position: relative;
    width: 100%;
    max-width: 400px;
    height: 600px;
    background: linear-gradient(0deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.06) 50%, rgba(255, 255, 255, 0.12) 50%, rgba(255, 255, 255, 0.12) 100%), #1f7a3c;
    background-size: 100% 120px;
    border: 3px solid #1f5f33;
    border-radius: 12px;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.3);
    overflow: hidden;
}

#field::before,
.lineup-field::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: rgba(255, 255, 255, 0.4);
    transform: translateX(-50%);
    pointer-events: none;
}

#field::after,
.lineup-field::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 120px;
    height: 120px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

#field .lineup-field-penalty,
.lineup-field .lineup-field-penalty {
    position: absolute;
    left: 18%;
    width: 64%;
    height: 15%;
    border: 2px solid rgba(255, 255, 255, 0.35);
}

#field .lineup-field-penalty-top,
.lineup-field .lineup-field-penalty-top {
    top: 0;
    border-top: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

#field .lineup-field-penalty-bottom,
.lineup-field .lineup-field-penalty-bottom {
    bottom: 0;
    border-bottom: none;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

#field .field-point,
.lineup-field .field-point {
    position: absolute;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #ffd447;
    border: 2px solid #ffffff;
    color: #20552a;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
    min-width: 26px;
    pointer-events: auto;
    text-transform: none;
}

#field .field-point.opponent,
.lineup-field .field-point.opponent {
    background-color: #6e6e6e;
}

#field .field-point::after,
.lineup-field .field-point::after {
    content: attr(data-player-name);
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    pointer-events: none;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    max-width: 120px;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 4px;
}

#field .field-point.field-point-highlight,
.lineup-field .field-point.field-point-highlight {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 0 16px rgba(255, 255, 255, 0.85);
    background: #ff9d1c;
    z-index: 5;
}

#field .field-point.field-point-missing,
.lineup-field .field-point.field-point-missing {
    background: #dc3545;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(220, 53, 69, 0.6);
}

#field .field-point.field-point-hidden {
    opacity: 0;
    pointer-events: none;
}

.lineup-selection {
    text-decoration: none;
}

.lineup-selection.active {
    background-color: var(--mp-gold);
    color: #fff;
    border-color: var(--mp-gold);
}

.lineup-selection.active:hover,
.lineup-selection.active:focus {
    color: #fff;
}

#player-default-lineup-table .table-active {
    --bs-table-accent-bg: rgba(178, 145, 70, 0.12);
}

@media (max-width: 575.98px) {
    #field {
        max-width: 100%;
        height: 420px;
    }
}

/* ─── AI Collapsible Trigger & Modal content ──────────────────── */
.ai-collapsible-trigger {
    cursor: pointer;
    display: inline-block;
    white-space: pre-wrap;
    word-break: break-word;
    text-decoration: underline dotted transparent;
    transition: text-decoration-color 0.2s ease-in-out, color 0.15s ease-in-out;
}

.ai-collapsible-trigger:hover,
.ai-collapsible-trigger:focus {
    text-decoration-color: currentColor;
    color: var(--mp-gold) !important;
}

.ai-collapsible-trigger:focus {
    outline: none;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    border-radius: 0.25rem;
    padding: 0 0.1rem;
    margin: 0 -0.1rem;
}

.ai-modal-body-content {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: var(--bs-font-monospace, monospace);
    font-size: 0.95rem;
    margin: 0;
    padding: 1rem;
    background-color: var(--mp-surface-2) !important;
    border: 1px solid var(--mp-border) !important;
    border-radius: 0.375rem;
    color: var(--mp-text) !important;
}

.prompt-code-badge {
    font-family: var(--bs-font-monospace, monospace);
    font-size: 0.9rem;
}

/* ─── Lineup Pitch (Weight Matrix) ────────────────────────────── */
.lineup-pitch {
    position: relative;
    width: 100%;
    padding-top: 60%;
    background: linear-gradient(0deg, #3f9f3f 0%, #2f7f2f 100%);
    border: 2px solid #1e5f1e;
    border-radius: 12px;
    overflow: hidden;
}

.lineup-pitch::before,
.lineup-pitch::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    width: 2px;
    height: 100%;
    background: rgba(255, 255, 255, 0.4);
}

.lineup-pitch::after {
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
}

.lineup-player {
    position: absolute;
    transform: translate(-50%, -50%);
    min-width: 58px;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: 2px solid #fff;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    font-weight: 600;
}

.lineup-player small {
    display: block;
    font-weight: 400;
    opacity: 0.9;
}

/* ─── Dark Mode Card Background overrides (index.php) ─────────── */
[data-theme="dark"] .bg-primary {
    background-color: rgba(13, 110, 253, 0.15) !important;
    border: 1px solid rgba(13, 110, 253, 0.3) !important;
    color: #3b82f6 !important;
}
[data-theme="dark"] .bg-primary h1,
[data-theme="dark"] .bg-primary h3,
[data-theme="dark"] .bg-primary h5 {
    color: #3b82f6 !important;
}

[data-theme="dark"] .bg-warning {
    background-color: rgba(245, 158, 11, 0.15) !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
    color: #f59e0b !important;
}
[data-theme="dark"] .bg-warning h1,
[data-theme="dark"] .bg-warning h5 {
    color: #f59e0b !important;
}

[data-theme="dark"] .bg-danger {
    background-color: rgba(239, 68, 68, 0.15) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    color: #ef4444 !important;
}
[data-theme="dark"] .bg-danger h1,
[data-theme="dark"] .bg-danger h5 {
    color: #ef4444 !important;
}

[data-theme="dark"] .bg-success {
    background-color: rgba(16, 185, 129, 0.15) !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
    color: #10b981 !important;
}
[data-theme="dark"] .bg-success h1,
[data-theme="dark"] .bg-success h5,
[data-theme="dark"] .bg-success h6 {
    color: #10b981 !important;
}

[data-theme="dark"] .bg-secondary {
    background-color: rgba(107, 114, 128, 0.15) !important;
    border: 1px solid rgba(107, 114, 128, 0.3) !important;
    color: #9ca3af !important;
}
[data-theme="dark"] .bg-secondary h1,
[data-theme="dark"] .bg-secondary h5 {
    color: #9ca3af !important;
}