:root {
    --brand: #00e676;
    --ink: #0f172a;
    --text: #111827;
    --bg: #f8fafc;
    --blue-electric: #2563eb;
    --violet: #6d28d9;
    --orange: #f97316;
    --red: #ef4444;
    --yellow: #eab308;
    --radius-lg: 24px;
    --radius-md: 18px;
    --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: radial-gradient(circle at 20% 10%, #e6fff3 0%, transparent 35%),
        radial-gradient(circle at 85% 0%, #dbeafe 0%, transparent 30%),
        var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.auth-body {
    margin: 0;
    overflow: hidden;
}

.login-screen {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    min-height: 100vh;
}

.login-hero {
    position: relative;
    background-image: url('https://images.unsplash.com/photo-1574629810360-7efbbe195018?auto=format&fit=crop&w=1200&q=80');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: end;
    padding: 3.5rem;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(140deg, rgba(15, 23, 42, 0.72), rgba(15, 23, 42, 0.35));
}

.hero-content {
    position: relative;
    color: #f8fafc;
    max-width: 560px;
}

.hero-tag {
    display: inline-flex;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: rgba(0, 230, 118, 0.2);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
}

.hero-content h1 {
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.1;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-content p {
    color: rgba(248, 250, 252, 0.85);
}

.login-panel {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.glass-card {
    width: min(460px, 100%);
    border-radius: var(--radius-lg);
    padding: 2rem;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(10px);
}

.logo-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.brand-dot {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: linear-gradient(120deg, var(--brand), #00c853);
    box-shadow: 0 0 0 6px rgba(0, 230, 118, 0.14);
}

.login-card h3 {
    margin-top: 1rem;
    font-size: 1.6rem;
    font-weight: 700;
}

.link-muted {
    color: #475569;
    text-decoration: none;
}

.btn-brand {
    border-radius: 16px;
    border: none;
    padding: 0.85rem 1.2rem;
    background: linear-gradient(120deg, #00e676, #16a34a);
    color: #06230a;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-brand:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 24px rgba(22, 163, 74, 0.25);
}

.app-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: linear-gradient(185deg, #0f172a 0%, #101d38 45%, #1e293b 100%);
    color: #dbeafe;
    padding: 1.25rem;
    border-right: 1px solid rgba(148, 163, 184, 0.16);
    position: sticky;
    top: 0;
    height: 100vh;
    transition: width 0.25s ease;
}

.sidebar-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.3rem;
}

.brand {
    color: #e2e8f0;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
}

.btn-sidebar-toggle,
.btn-icon,
.btn-danger-soft {
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(148, 163, 184, 0.12);
    color: #e2e8f0;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    padding: 0.6rem;
    margin-bottom: 1rem;
}

.user-chip img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--brand);
    border-radius: 50%;
    display: inline-block;
}

.menu-link {
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 14px;
    padding: 0.72rem 0.8rem;
    display: flex;
    gap: 0.72rem;
    align-items: center;
    margin-bottom: 0.35rem;
    transition: all 0.2s ease;
}

.menu-link:hover {
    transform: translateX(3px);
    color: #fff;
    background: rgba(37, 99, 235, 0.25);
}

.main-content {
    padding: 1rem 1.2rem 1.5rem;
}

.topbar {
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: var(--shadow-soft);
    padding: 1rem 1.2rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    position: sticky;
    top: 0.8rem;
    z-index: 10;
}

.page-title {
    font-size: 1.3rem;
    margin: 0;
    font-weight: 700;
}

.breadcrumb-line {
    color: #64748b;
    font-size: 0.88rem;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.search-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: #fff;
    min-width: 320px;
}

.search-wrap input {
    border: none;
    outline: none;
    width: 100%;
}

.content-area {
    margin-top: 1rem;
}

.widgets-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 0.9rem;
}

.stat-card,
.widget,
.champ-card {
    background: #fff;
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: var(--shadow-soft);
}

.stat-card {
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    right: -50px;
    top: -50px;
    opacity: 0.2;
    background: linear-gradient(120deg, var(--blue-electric), var(--brand));
}

.stat-value {
    font-size: 1.7rem;
    font-weight: 700;
}

.stat-meta {
    color: #475569;
    font-size: 0.84rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 0.9rem;
}

.widget {
    padding: 1rem;
    grid-column: span 4;
}

.card-lg {
    grid-column: span 6;
}

.widget-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.badge-soft {
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
    font-size: 0.75rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
}

.list-stack > div {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.6rem 0.1rem;
    border-bottom: 1px dashed #e2e8f0;
}

.timeline-item {
    border-left: 2px solid #d1d5db;
    padding-left: 0.7rem;
    margin-bottom: 0.7rem;
    color: #475569;
}

.timeline-item span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--brand);
    display: inline-block;
    margin-right: 0.4rem;
}

#liveTimeline {
    max-height: 280px;
    overflow-y: auto;
}

.quick-match {
    align-items: center;
}

.quick-match .btn-chip {
    white-space: nowrap;
}

.skeleton {
    height: 54px;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    background: linear-gradient(110deg, #e2e8f0 8%, #f1f5f9 18%, #e2e8f0 33%);
    background-size: 200% 100%;
    animation: shimmer 1.15s linear infinite;
}

@keyframes shimmer {
    to {
        background-position-x: -200%;
    }
}

.championship-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 1rem;
}

.team-grid,
.player-grid,
.match-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 1rem;
}

.team-card,
.player-card,
.match-card {
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    padding: 1rem;
}

.team-head,
.player-head,
.match-head {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    align-items: start;
}

.team-head img {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    object-fit: cover;
}

.player-head img {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(15, 23, 42, 0.12);
}

.module-meta {
    margin-top: 0.6rem;
    color: #64748b;
    font-size: 0.88rem;
}

.module-actions {
    margin-top: 0.8rem;
    display: flex;
    gap: 0.5rem;
}

.selectable-team {
    cursor: pointer;
    position: relative;
}

.selectable-team .team-checkbox {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 18px;
    height: 18px;
}

.selectable-team.selected {
    border: 1px solid rgba(0, 230, 118, 0.8);
    box-shadow: 0 0 0 3px rgba(0, 230, 118, 0.18), var(--shadow-soft);
}

.match-pending {
    border: 1px solid rgba(37, 99, 235, 0.35);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12), var(--shadow-soft);
}

.champ-card {
    padding: 1rem;
}

.champ-card header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.badge-format {
    background: rgba(109, 40, 217, 0.12);
    color: var(--violet);
    border-radius: 999px;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
}

.champ-card ul {
    list-style: none;
    padding: 0;
    margin: 0.8rem 0 0.9rem;
}

.champ-card li {
    padding: 0.32rem 0;
}

.btn-chip {
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    font-size: 0.84rem;
}

.btn-chip-danger {
    color: #b91c1c;
    border-color: #fecaca;
}

.panel-modal {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.22);
}

.panel-modal .form-control,
.panel-modal .form-select {
    border-radius: 12px;
}

.app-shell.sidebar-collapsed {
    grid-template-columns: 94px 1fr;
}

.app-shell.sidebar-collapsed .menu-link {
    justify-content: center;
    font-size: 0;
}

.app-shell.sidebar-collapsed .menu-link i {
    font-size: 1rem;
    margin-right: 0;
}

.app-shell.sidebar-collapsed .brand span:last-child,
.app-shell.sidebar-collapsed .user-chip div {
    display: none;
}

body.dark {
    --bg: #0b1120;
    background: radial-gradient(circle at 20% 10%, #1e293b 0%, transparent 30%), #0b1120;
    color: #dbeafe;
}

body.dark .topbar,
body.dark .widget,
body.dark .stat-card,
body.dark .champ-card {
    background: rgba(15, 23, 42, 0.82);
    color: #dbeafe;
    border-color: rgba(148, 163, 184, 0.18);
}

body.dark .search-wrap {
    background: rgba(15, 23, 42, 0.65);
    border-color: rgba(148, 163, 184, 0.2);
}

body.dark .search-wrap input {
    color: #e2e8f0;
    background: transparent;
}

body.dark .team-card,
body.dark .player-card,
body.dark .match-card {
    background: rgba(15, 23, 42, 0.82);
    color: #dbeafe;
    border-color: rgba(148, 163, 184, 0.18);
}

@media (max-width: 1200px) {
    .widgets-grid {
        grid-template-columns: repeat(3, minmax(150px, 1fr));
    }

    .championship-grid {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }

    .team-grid,
    .player-grid,
    .match-grid {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }
}

@media (max-width: 992px) {
    .login-screen {
        grid-template-columns: 1fr;
    }

    .login-hero {
        min-height: 280px;
    }

    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .widgets-grid {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
    }

    .widget,
    .card-lg {
        grid-column: span 12;
    }

    .search-wrap {
        min-width: 200px;
    }
}

@media (max-width: 600px) {
    .main-content {
        padding: 0.7rem;
    }

    .topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar-right {
        flex-wrap: wrap;
    }

    .widgets-grid,
    .championship-grid,
    .team-grid,
    .player-grid,
    .match-grid {
        grid-template-columns: 1fr;
    }
}
