:root {
    --bg-gradient: radial-gradient(circle at 20% 20%, rgba(106, 76, 255, 0.12), rgba(28, 28, 37, 0.65)), radial-gradient(circle at 80% 0%, rgba(0, 196, 255, 0.12), transparent);
    --card-bg: rgba(32, 34, 45, 0.85);
    --card-border: rgba(255, 255, 255, 0.08);
    --glass: rgba(255, 255, 255, 0.04);
    --text: #f5f7fb;
    --muted: #9aa5b1;
    --accent: #4f9cff;
    --success: #2de0a5;
    --danger: #ff7b7b;
    --warning: #ffc15d;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Space Grotesk', 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--text);
    min-height: 100vh;
    background: #0f1117;
    background-image: var(--bg-gradient);
    overflow-x: hidden;
    width: 100%;
}

.bg-surface {
    background: #0f1117;
}

a {
    color: var(--accent);
    text-decoration: none;
}

.layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 0;
}

.sidebar {
    background: linear-gradient(180deg, rgba(19, 21, 29, 0.95), rgba(14, 16, 23, 0.98));
    border-right: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.brand-badge {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, #6f6dfd, #4f9cff);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1.1rem;
    box-shadow: 0 10px 30px rgba(79, 156, 255, 0.4);
}

.nav-link {
    color: var(--muted);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(79, 156, 255, 0.18), rgba(111, 109, 253, 0.12));
    border: 1px solid rgba(79, 156, 255, 0.3);
    box-shadow: 0 12px 40px rgba(79, 156, 255, 0.15);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-weight: 700;
}

.main {
    padding: 2rem;
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 1rem;
    z-index: 100;
    background: rgba(15, 17, 23, 0.7);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

@media (max-width: 992px) {
    .topbar {
        top: 0.5rem;
        margin-bottom: 1rem;
    }
}

.card-glass {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.metric-card {
    transition: transform 0.2s ease, border 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-4px);
    border-color: rgba(79, 156, 255, 0.6);
}

.tag {
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.table-dark-glow {
    color: #fff;
}

.table-dark-glow thead {
    color: var(--muted);
}

.table-dark-glow tbody tr {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.table-dark-glow tbody tr:hover {
    background: rgba(79, 156, 255, 0.06);
}

.badge-soft {
    background: rgba(79, 156, 255, 0.16);
    color: #cfe5ff;
    border: 1px solid rgba(79, 156, 255, 0.35);
}

.login-hero {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.login-card {
    width: 100%;
    max-width: 320px;
    padding: 2rem;
    border-radius: 20px;
    background: rgba(19, 21, 29, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.gradient-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(79, 156, 255, 0.2), rgba(45, 224, 165, 0.2));
    color: #d3e4ff;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.list-soft li {
    padding: 0.35rem 0;
    color: var(--muted);
}

@media (max-width: 992px) {
    .layout {
        grid-template-columns: minmax(0, 1fr);
    }
    
    .main {
        padding: 1rem 0.75rem;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: 280px;
        height: 100vh;
        z-index: 1050;
        transition: transform 0.3s ease;
        transform: translateX(-110%);
        box-shadow: 5px 0 20px rgba(0,0,0,0.5);
    }

    .sidebar.show {
        transform: translateX(0);
    }
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1040;
    backdrop-filter: blur(3px);
    transition: opacity 0.3s;
    opacity: 0;
    pointer-events: none;
}

.sidebar-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

@keyframes pos-dot-pop {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    70% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.pos-dot-animate {
    animation: pos-dot-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Match Day Highlight */
.bg-gold-glow {
    background: linear-gradient(180deg, rgba(255, 193, 7, 0.15) 0%, rgba(255, 193, 7, 0.05) 100%) !important;
    border-left: 1px solid rgba(255, 193, 7, 0.2) !important;
    border-right: 1px solid rgba(255, 193, 7, 0.2) !important;
    position: relative;
}

.text-gold-glow {
    color: #ffc107 !important;
    text-shadow: 0 0 8px rgba(255, 193, 7, 0.4);
}

.bg-gold-glow::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ffc107, transparent);
    opacity: 0.5;
}

/* Modern Tooltips */
.tooltip {
    --bs-tooltip-bg: rgba(15, 17, 23, 0.95);
    --bs-tooltip-color: #f5f7fb;
    --bs-tooltip-padding-x: 0.85rem;
    --bs-tooltip-padding-y: 0.6rem;
    --bs-tooltip-border-radius: 12px;
    --bs-tooltip-opacity: 1;
    z-index: 1100;
}

.tooltip-inner {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    line-height: 1.4;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
}

.tooltip.bs-tooltip-top .tooltip-arrow::before { border-top-color: rgba(255, 255, 255, 0.12); }
.tooltip.bs-tooltip-bottom .tooltip-arrow::before { border-bottom-color: rgba(255, 255, 255, 0.12); }
.tooltip.bs-tooltip-start .tooltip-arrow::before { border-left-color: rgba(255, 255, 255, 0.12); }
.tooltip.bs-tooltip-end .tooltip-arrow::before { border-right-color: rgba(255, 255, 255, 0.12); }

/* Hint Balloon (Popover Modern Style) */
.popover {
    --bs-popover-bg: rgba(19, 21, 29, 0.98);
    --bs-popover-border-color: rgba(255, 255, 255, 0.15);
    --bs-popover-header-bg: transparent;
    --bs-popover-header-color: #ffd700;
    --bs-popover-body-color: #f5f7fb;
    --bs-popover-border-radius: 20px;
    --bs-popover-inner-padding-x: 1rem;
    --bs-popover-inner-padding-y: 0.8rem;
    border: 1px solid var(--bs-popover-border-color);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    font-family: 'Space Grotesk', sans-serif;
    animation: hint-bounce 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.popover-body {
    font-size: 0.88rem;
    line-height: 1.5;
    text-align: center;
    font-weight: 500;
}

/* Balloon Arrow Style */
.bs-popover-top .popover-arrow::after, .bs-popover-auto[data-popper-placement^="top"] .popover-arrow::after {
    border-top-color: var(--bs-popover-bg);
}

@keyframes hint-bounce {
    0% { transform: scale(0.8) translateY(10px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Premium Buttons & Interactive Elements */
.btn {
    border-radius: 12px !important;
    font-weight: 600 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-premium {
    padding: 0.6rem 1.75rem !important;
    text-transform: none;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Specific button colors for consistency */
.btn-primary { background: var(--accent) !important; border-color: var(--accent) !important; }
.btn-success { background: var(--success) !important; border-color: var(--success) !important; }
.btn-info { background: #0dcaf0 !important; border-color: #0dcaf0 !important; color: #000 !important; }
.btn-warning { background: var(--warning) !important; border-color: var(--warning) !important; color: #000 !important; }
.btn-secondary { background: rgba(255,255,255,0.1) !important; border-color: rgba(255,255,255,0.15) !important; color: #fff !important; backdrop-filter: blur(5px); }
.btn-secondary:hover { background: rgba(255,255,255,0.15) !important; }

.btn-premium i {
    font-size: 1.1rem;
}