/* ====================================================
   admin.css - Admin Panel Styles
   GMISSPORTSDAY Admin Interface - FULLY RESPONSIVE
   ==================================================== */

/* ====================================================
   CSS Variables
   ==================================================== */
:root {
    /* Admin specific colors */
    --admin-sidebar-bg: #1a1a2e;
    --admin-sidebar-text: rgba(255, 255, 255, 0.6);
    --admin-sidebar-hover: rgba(255, 255, 255, 0.05);
    --admin-sidebar-active: rgba(102, 126, 234, 0.2);
    --admin-topbar-bg: #ffffff;
    --admin-topbar-border: #e5e7eb;
    --admin-card-bg: #ffffff;
    --admin-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    
    /* Text colors */
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    --text-white: #ffffff;
    
    /* Form colors */
    --form-label: #1f2937;
    --form-text: #4b5563;
    --form-placeholder: #9ca3af;
    --form-border: #d1d5db;
    --form-focus: #667eea;
    --form-bg: #ffffff;
}

/* ====================================================
   Admin Wrapper & Layout
   ==================================================== */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
    background: #f3f4f6;
}

/* ====================================================
   Admin Sidebar
   ==================================================== */
.admin-sidebar {
    width: 260px;
    background: #1a1a2e;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    
    .admin-sidebar.open {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0 !important;
    }
}

@media (min-width: 769px) {
    .admin-main {
        margin-left: 260px;
    }
}

.admin-sidebar::-webkit-scrollbar {
    width: 4px;
}

.admin-sidebar::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 9999px;
}

.sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.sidebar-brand-text {
    font-size: 16px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.025em;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    transition: color 0.15s ease;
    display: none;
}

@media (max-width: 768px) {
    .sidebar-toggle {
        display: block;
    }
}

.sidebar-toggle:hover {
    color: #ffffff;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav ul li {
    margin-bottom: 2px;
}

.sidebar-nav ul li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.15s ease;
    position: relative;
}

.sidebar-nav ul li a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.sidebar-nav ul li a.active {
    background: rgba(102, 126, 234, 0.2);
    color: #ffffff;
}

.sidebar-nav ul li a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: #667eea;
    border-radius: 0 4px 4px 0;
}

.sidebar-nav ul li a i {
    width: 18px;
    text-align: center;
    font-size: 15px;
}

.sidebar-nav ul li.divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 12px 0;
}

.sidebar-nav ul li a.text-danger {
    color: #ef4444;
}

.sidebar-nav ul li a.text-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.sidebar-footer {
    padding: 12px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info i {
    font-size: 24px;
    color: #9ca3af;
}

.user-info .user-name {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #ffffff;
}

.user-info .user-role {
    display: block;
    font-size: 11px;
    color: #9ca3af;
    text-transform: capitalize;
}

/* ====================================================
   Admin Topbar - FIXED
   ==================================================== */
.admin-topbar {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.mobile-sidebar-toggle {
    background: none;
    border: none;
    font-size: 22px;
    color: #4b5563;
    cursor: pointer;
    padding: 4px;
    display: none;
}

@media (max-width: 768px) {
    .mobile-sidebar-toggle {
        display: block;
    }
}

.mobile-sidebar-toggle:hover {
    color: #1f2937;
}

.page-title {
    font-size: 17px;
    font-weight: 600;
    color: #1f2937;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: rgba(16, 185, 129, 0.12);
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    color: #065f46;
}

.live-indicator i {
    font-size: 8px;
}

.live-indicator .live-text {
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@media (max-width: 480px) {
    .live-indicator .live-text {
        display: none;
    }
}

.topbar-time {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

.topbar-logout {
    color: #9ca3af;
    font-size: 20px;
    transition: color 0.15s ease;
    padding: 4px;
}

.topbar-logout:hover {
    color: #ef4444;
}

/* ====================================================
   Admin Content Wrapper
   ==================================================== */
.admin-content-wrapper {
    flex: 1;
    padding: 20px;
}

.admin-content {
    max-width: 1400px;
    margin: 0 auto;
}

/* ====================================================
   Page Header - FIXED
   ==================================================== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
}

.page-header .text-muted {
    margin: 2px 0 0;
    font-size: 13px;
    color: #6b7280;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-actions {
        width: 100%;
    }
    
    .header-actions .btn {
        flex: 1;
        justify-content: center;
    }
}

.live-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #f3f4f6;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
    color: #4b5563;
}

.live-status i {
    font-size: 10px;
}

.live-status .text-success {
    color: #10b981;
}

.live-status .text-muted {
    color: #6b7280;
}

/* ====================================================
   Stats Grid - FIXED
   ==================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stats-grid-sm {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.stat-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.25s ease;
}

.stat-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.stat-card-sm {
    padding: 14px;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.2;
}

.stat-value.small {
    font-size: 14px;
}

/* ====================================================
   Live Mode Section - FIXED
   ==================================================== */
.live-mode-section {
    margin-bottom: 20px;
}

.live-mode-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 14px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    color: #ffffff;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .live-mode-card {
        flex-direction: column;
        text-align: center;
        padding: 18px;
    }
}

.live-mode-icon {
    font-size: 30px;
    opacity: 0.8;
}

.live-mode-content {
    flex: 1;
}

.live-mode-content h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
}

.live-mode-content p {
    margin: 2px 0 0;
    opacity: 0.8;
    font-size: 13px;
    color: #ffffff;
}

.live-status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    font-size: 13px;
    color: #ffffff;
    flex-wrap: wrap;
}

@media (max-width: 480px) {
    .live-status-indicator {
        justify-content: center;
    }
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.live {
    background: #10b981;
    animation: pulse 1.5s ease-in-out infinite;
}

.refresh-info {
    opacity: 0.7;
    font-size: 11px;
}

.live-mode-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

@media (max-width: 768px) {
    .live-mode-actions {
        width: 100%;
        justify-content: center;
    }
}

.last-update {
    font-size: 13px;
    opacity: 0.9;
    color: #ffffff;
}

/* ====================================================
   Quick Actions
   ==================================================== */
.quick-actions {
    background: #ffffff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.quick-actions h3 {
    margin: 0 0 14px;
    font-size: 17px;
    font-weight: 700;
    color: #1f2937;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

@media (max-width: 480px) {
    .action-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px;
    background: #f3f4f6;
    border-radius: 10px;
    text-decoration: none;
    color: #4b5563;
    transition: all 0.25s ease;
    border: 2px solid transparent;
    text-align: center;
}

.action-card:hover {
    background: #ffffff;
    border-color: #667eea;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    color: #1f2937;
}

.action-card i {
    font-size: 24px;
}

.action-card span {
    font-weight: 600;
    font-size: 13px;
}

/* ====================================================
   Standings Section
   ==================================================== */
.standings-section {
    background: #ffffff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.standings-section h3 {
    margin: 0 0 14px;
    font-size: 17px;
    font-weight: 700;
    color: #1f2937;
}

.standings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

@media (max-width: 480px) {
    .standings-grid {
        grid-template-columns: 1fr;
    }
}

.standing-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f3f4f6;
    border-radius: 10px;
    border-left: 4px solid #d1d5db;
    transition: all 0.25s ease;
}

.standing-card:hover {
    background: #e5e7eb;
}

.standing-card.leader {
    background: #fef3c7;
    border-left-color: #f59e0b;
}

.standing-rank {
    display: flex;
    align-items: center;
    gap: 4px;
}

.standing-rank .crown {
    font-size: 16px;
}

.standing-rank .rank {
    font-weight: 700;
    font-size: 13px;
    color: #4b5563;
}

.standing-info {
    flex: 1;
    min-width: 0;
}

.standing-info .house-name {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #1f2937;
}

.standing-info .house-score {
    display: block;
    font-weight: 700;
    font-size: 16px;
    color: #1f2937;
}

.standing-games {
    font-size: 11px;
    color: #6b7280;
}

/* ====================================================
   Classification Section
   ==================================================== */
.classification-section {
    background: #ffffff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.classification-section h3 {
    margin: 0 0 14px;
    font-size: 17px;
    font-weight: 700;
    color: #1f2937;
}

.classification-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

@media (max-width: 480px) {
    .classification-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.classification-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    background: #f3f4f6;
    border-radius: 10px;
    text-align: center;
}

.classification-card .class-name {
    font-weight: 600;
    font-size: 13px;
    color: #4b5563;
}

.classification-card .class-count {
    font-size: 11px;
    color: #6b7280;
    margin-top: 2px;
}

/* ====================================================
   Recent Activity - FIXED
   ==================================================== */
.recent-activity-section {
    background: #ffffff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.recent-activity-section h3 {
    margin: 0 0 14px;
    font-size: 17px;
    font-weight: 700;
    color: #1f2937;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -4px;
}

.activity-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 400px;
}

.activity-table th {
    background: #f3f4f6;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    color: #4b5563;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.025em;
    border-bottom: 2px solid #e5e7eb;
}

.activity-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
    color: #1f2937;
}

@media (max-width: 640px) {
    .activity-table {
        font-size: 12px;
        min-width: 320px;
    }
    
    .activity-table th,
    .activity-table td {
        padding: 8px 10px;
    }
}

.activity-table tbody tr:hover {
    background: #f3f4f6;
}

.change-amount {
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
}

.change-amount.positive {
    color: #10b981;
    background: rgba(16, 185, 129, 0.12);
}

.change-amount.negative {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
}

/* ====================================================
   Game Management - FIXED
   ==================================================== */
.filter-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding: 14px 16px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

@media (max-width: 640px) {
    .filter-section {
        flex-direction: column;
        align-items: stretch;
    }
}

.filter-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .filter-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 6px;
    }
    
    .filter-tab {
        white-space: nowrap;
    }
}

.filter-tab {
    padding: 5px 14px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
    background: transparent;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.filter-tab:hover {
    color: #1f2937;
    background: #f3f4f6;
}

.filter-tab.active {
    color: #ffffff;
    background: #667eea;
}

.search-box {
    min-width: 160px;
}

@media (max-width: 640px) {
    .search-box {
        min-width: unset;
        width: 100%;
    }
}

.search-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-group i {
    position: absolute;
    left: 12px;
    color: #9ca3af;
}

.search-input-group input {
    width: 100%;
    padding: 7px 12px 7px 36px;
    border: 2px solid #e5e7eb;
    border-radius: 9999px;
    font-size: 13px;
    transition: all 0.15s ease;
    background: #f3f4f6;
    color: #1f2937;
}

.search-input-group input:focus {
    outline: none;
    border-color: #667eea;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-clear {
    position: absolute;
    right: 10px;
    color: #9ca3af;
    cursor: pointer;
    transition: color 0.15s ease;
    text-decoration: none;
}

.search-clear:hover {
    color: #4b5563;
}

/* ====================================================
   Games Grid - FIXED
   ==================================================== */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

@media (max-width: 480px) {
    .games-grid {
        grid-template-columns: 1fr;
    }
}

.game-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 2px solid #e5e7eb;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
}

.game-card:hover {
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.game-card.universal {
    border-color: #fcd34d;
    background: #fffbeb;
}

.game-card.inactive {
    opacity: 0.7;
    border-color: #d1d5db;
}

.game-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 6px;
}

.game-card-title h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
}

.game-code {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 500;
    padding: 2px 8px;
    background: #f3f4f6;
    border-radius: 4px;
}

.game-card-body {
    flex: 1;
}

.game-description {
    font-size: 13px;
    color: #4b5563;
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
}

.game-classifications {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 10px;
}

.class-tag {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    background: #e5e7eb;
    color: #4b5563;
}

.class-tag.universal {
    background: #fef3c7;
    color: #92400e;
}

.game-stats {
    display: flex;
    gap: 14px;
    font-size: 11px;
    color: #6b7280;
}

.game-stats .stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.game-card-actions {
    display: flex;
    gap: 6px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
    flex-wrap: wrap;
}

@media (max-width: 480px) {
    .game-card-actions {
        flex-direction: column;
    }
    
    .game-card-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

.game-card-actions .btn {
    flex: 1;
    min-width: 70px;
    justify-content: center;
    padding: 5px 10px;
    font-size: 11px;
    min-height: 32px;
}

/* ====================================================
   Score Cards - FIXED
   ==================================================== */
.score-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

@media (max-width: 480px) {
    .score-cards-grid {
        grid-template-columns: 1fr;
    }
}

.score-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border-top: 4px solid #d1d5db;
    transition: all 0.25s ease;
}

.score-card:hover {
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.score-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 6px;
}

.house-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.house-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.house-info h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
}

.house-total {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
}

.score-display {
    text-align: center;
    padding: 12px 0;
    margin-bottom: 14px;
    background: #f3f4f6;
    border-radius: 10px;
}

.score-display .score-number {
    font-size: 42px;
    font-weight: 900;
    display: block;
    line-height: 1;
    color: #1f2937;
    transition: all 0.25s ease;
}

.score-display .score-label {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.score-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quick-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

@media (max-width: 480px) {
    .quick-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
}

.btn-control {
    padding: 8px;
    font-size: 15px;
    font-weight: 700;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 40px;
}

.btn-negative {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border-color: #ef4444;
}

.btn-negative:hover {
    background: #ef4444;
    color: #ffffff;
}

.btn-positive {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border-color: #10b981;
}

.btn-positive:hover {
    background: #10b981;
    color: #ffffff;
}

.custom-score {
    display: flex;
    gap: 6px;
}

@media (max-width: 480px) {
    .custom-score {
        flex-direction: column;
    }
}

.custom-score .custom-input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    transition: all 0.15s ease;
    color: #1f2937;
    background: #ffffff;
    min-height: 40px;
}

.custom-score .custom-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.score-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
    flex-wrap: wrap;
}

@media (max-width: 480px) {
    .score-actions {
        justify-content: center;
    }
}

/* ====================================================
   Buttons - FIXED
   ==================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    white-space: nowrap;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
    user-select: none;
    text-decoration: none;
    min-height: 40px;
}

@media (max-width: 480px) {
    .btn {
        white-space: normal;
        min-height: 44px;
    }
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border-color: transparent;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
    color: #ffffff;
}

.btn-secondary {
    background: #e5e7eb;
    color: #4b5563;
    border-color: #d1d5db;
}

.btn-secondary:hover {
    background: #d1d5db;
    color: #1f2937;
}

.btn-success {
    background: #10b981;
    color: #ffffff;
    border-color: #10b981;
}

.btn-success:hover {
    background: #059669;
    border-color: #059669;
    color: #ffffff;
}

.btn-danger {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}

.btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
}

.btn-warning {
    background: #f59e0b;
    color: #1f2937;
    border-color: #f59e0b;
}

.btn-warning:hover {
    background: #d97706;
    border-color: #d97706;
    color: #ffffff;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 11px;
    min-height: 30px;
}

.btn-lg {
    padding: 10px 24px;
    font-size: 15px;
    min-height: 48px;
}

.btn-block {
    width: 100%;
    display: flex;
}

/* ====================================================
   Form Elements
   ==================================================== */
.form-card {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    overflow: hidden;
}

.form-card-header {
    padding: 14px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #f3f4f6;
}

.form-card-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #1f2937;
}

.form-card-header .text-muted {
    margin: 2px 0 0;
    font-size: 13px;
    color: #6b7280;
}

.form-card-body {
    padding: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #1f2937;
    margin-bottom: 5px;
}

.form-group label .required {
    color: #ef4444;
    margin-left: 4px;
}

.form-group .form-text {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: #6b7280;
}

.form-group .text-muted {
    color: #6b7280;
    font-size: 12px;
}

.form-control {
    display: block;
    width: 100%;
    padding: 8px 12px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    line-height: 1.5;
    color: #1f2937;
    background: #ffffff;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    transition: all 0.15s ease;
    appearance: none;
    min-height: 40px;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control.error {
    border-color: #ef4444;
}

.form-control:disabled {
    background: #f3f4f6;
    cursor: not-allowed;
}

.form-control::placeholder {
    color: #9ca3af;
}

select.form-control {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 36px;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 480px) {
    .checkbox-group {
        flex-direction: column;
    }
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    background: #f3f4f6;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.checkbox-label:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 2px;
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: #667eea;
}

.checkbox-label .checkbox-text {
    font-size: 13px;
    color: #1f2937;
}

.checkbox-label .checkbox-text strong {
    color: #1f2937;
}

.checkbox-label .checkbox-text .text-muted {
    color: #6b7280;
    font-size: 11px;
}

.form-actions {
    display: flex;
    gap: 12px;
    padding: 14px 20px;
    border-top: 1px solid #e5e7eb;
    background: #f3f4f6;
    border-radius: 0 0 14px 14px;
}

@media (max-width: 480px) {
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

/* ====================================================
   Settings - FIXED
   ==================================================== */
.settings-section {
    margin-bottom: 20px;
}

.settings-card {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.settings-card.danger-zone {
    border: 2px solid #ef4444;
}

.settings-header {
    padding: 14px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #f3f4f6;
}

.settings-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #1f2937;
}

.settings-header .text-muted {
    margin: 2px 0 0;
    font-size: 13px;
    color: #6b7280;
}

.settings-header .text-danger {
    margin: 2px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: #ef4444;
}

.settings-body {
    padding: 20px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.info-item {
    padding: 10px 14px;
    background: #f3f4f6;
    border-radius: 10px;
}

.info-item .info-label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-item .info-value {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    margin-top: 2px;
}

.danger-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.danger-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #f3f4f6;
    border-radius: 10px;
    border-left: 4px solid #ef4444;
    gap: 12px;
}

@media (max-width: 640px) {
    .danger-action {
        flex-direction: column;
        text-align: center;
    }
}

.danger-action h4 {
    margin: 0;
    font-size: 15px;
    color: #1f2937;
}

.danger-action p {
    margin: 2px 0 0;
    font-size: 13px;
    color: #6b7280;
}

/* ====================================================
   Empty State
   ==================================================== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.empty-state i {
    font-size: 56px;
    color: #d1d5db;
    margin-bottom: 14px;
}

.empty-state h3 {
    margin: 0 0 6px;
    font-size: 19px;
    font-weight: 700;
    color: #4b5563;
}

.empty-state p {
    color: #6b7280;
    margin: 0 0 14px;
}

/* ====================================================
   Modals - FIXED
   ==================================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1;
}

.modal-content {
    position: relative;
    z-index: 2;
    background: #ffffff;
    border-radius: 18px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.3s ease;
}

@media (max-width: 480px) {
    .modal-content {
        border-radius: 14px;
        max-width: 100%;
        margin: 10px;
    }
}

.modal-sm {
    max-width: 400px;
}

.modal-lg {
    max-width: 680px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    color: #1f2937;
}

.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #9ca3af;
    padding: 4px;
    transition: color 0.15s ease;
    line-height: 1;
}

.modal-close:hover {
    color: #1f2937;
}

.modal-body {
    padding: 20px;
}

.modal-body p {
    color: #4b5563;
    margin: 0 0 10px;
}

.modal-body .text-danger {
    color: #ef4444;
}

.modal-body .text-muted {
    color: #6b7280;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid #e5e7eb;
    background: #f3f4f6;
    border-radius: 0 0 18px 18px;
}

@media (max-width: 480px) {
    .modal-footer {
        flex-wrap: wrap;
    }
    
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ====================================================
   Badges
   ==================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge.active {
    background: rgba(16, 185, 129, 0.12);
    color: #065f46;
}

.badge.inactive {
    background: #e5e7eb;
    color: #6b7280;
}

.badge.universal {
    background: #fef3c7;
    color: #92400e;
}

.badge-primary {
    background: #667eea;
    color: #ffffff;
}

.badge-secondary {
    background: #6b7280;
    color: #ffffff;
}

.badge-success {
    background: #10b981;
    color: #ffffff;
}

.badge-danger {
    background: #ef4444;
    color: #ffffff;
}

.badge-warning {
    background: #f59e0b;
    color: #1f2937;
}

/* ====================================================
   Dark Mode Support
   ==================================================== */
@media (prefers-color-scheme: dark) {
    .admin-wrapper {
        background: #1f2937;
    }
    
    .admin-topbar {
        background: #1f2937;
        border-color: #374151;
    }
    
    .page-title {
        color: #ffffff;
    }
    
    .topbar-time {
        color: #9ca3af;
    }
    
    .stat-card,
    .quick-actions,
    .standings-section,
    .classification-section,
    .recent-activity-section,
    .form-card,
    .game-card,
    .score-card,
    .game-selector,
    .game-info-card,
    .recent-history,
    .settings-card,
    .export-section,
    .filter-section,
    .empty-state {
        background: #1f2937;
        border-color: #374151;
    }
    
    .stat-label {
        color: #9ca3af;
    }
    
    .stat-value {
        color: #ffffff;
    }
    
    .form-card-header,
    .settings-header {
        background: #374151;
        border-color: #4b5563;
    }
    
    .form-card-header h3,
    .settings-header h3 {
        color: #ffffff;
    }
    
    .form-control {
        background: #374151;
        color: #e5e7eb;
        border-color: #4b5563;
    }
    
    .form-control:focus {
        border-color: #667eea;
        background: #4b5563;
    }
    
    .form-control::placeholder {
        color: #6b7280;
    }
    
    .checkbox-label {
        background: #374151;
        border-color: #4b5563;
    }
    
    .checkbox-label:hover {
        background: #4b5563;
    }
    
    .checkbox-label .checkbox-text {
        color: #e5e7eb;
    }
    
    .checkbox-label .checkbox-text strong {
        color: #ffffff;
    }
    
    .game-card-title h4 {
        color: #ffffff;
    }
    
    .standings-section h3,
    .classification-section h3,
    .recent-activity-section h3,
    .quick-actions h3 {
        color: #ffffff;
    }
    
    .game-description {
        color: #9ca3af;
    }
    
    .game-stats {
        color: #9ca3af;
    }
    
    .score-display {
        background: #374151;
    }
    
    .score-display .score-number {
        color: #ffffff;
    }
    
    .score-display .score-label {
        color: #9ca3af;
    }
    
    .activity-table th,
    .history-table th {
        background: #374151;
        color: #d1d5db;
        border-bottom-color: #4b5563;
    }
    
    .activity-table td,
    .history-table td {
        border-color: #374151;
        color: #d1d5db;
    }
    
    .activity-table tbody tr:hover,
    .history-table tbody tr:hover {
        background: #374151;
    }
    
    .action-card {
        background: #374151;
        color: #d1d5db;
    }
    
    .action-card:hover {
        background: #4b5563;
        color: #ffffff;
    }
    
    .standing-card {
        background: #374151;
    }
    
    .standing-card:hover {
        background: #4b5563;
    }
    
    .standing-card.leader {
        background: rgba(251, 191, 36, 0.15);
    }
    
    .standing-info .house-name {
        color: #e5e7eb;
    }
    
    .standing-info .house-score {
        color: #ffffff;
    }
    
    .standing-rank .rank {
        color: #9ca3af;
    }
    
    .classification-card {
        background: #374151;
    }
    
    .classification-card .class-name {
        color: #e5e7eb;
    }
    
    .classification-card .class-count {
        color: #9ca3af;
    }
    
    .game-card.universal {
        background: rgba(251, 191, 36, 0.1);
        border-color: rgba(251, 191, 36, 0.3);
    }
    
    .filter-tab {
        color: #9ca3af;
    }
    
    .filter-tab:hover {
        color: #ffffff;
        background: #374151;
    }
    
    .filter-tab.active {
        color: #ffffff;
        background: #667eea;
    }
    
    .search-input-group input {
        background: #374151;
        border-color: #4b5563;
        color: #ffffff;
    }
    
    .search-input-group input:focus {
        background: #4b5563;
        border-color: #667eea;
    }
    
    .search-input-group i {
        color: #9ca3af;
    }
    
    .search-clear {
        color: #9ca3af;
    }
    
    .search-clear:hover {
        color: #e5e7eb;
    }
    
    .game-code {
        background: #374151;
        color: #9ca3af;
    }
    
    .class-tag {
        background: #374151;
        color: #9ca3af;
    }
    
    .class-tag.universal {
        background: rgba(251, 191, 36, 0.2);
        color: #fcd34d;
    }
    
    .game-card-actions {
        border-color: #374151;
    }
    
    .info-item {
        background: #374151;
    }
    
    .info-item .info-label {
        color: #9ca3af;
    }
    
    .info-item .info-value {
        color: #ffffff;
    }
    
    .danger-action {
        background: #374151;
    }
    
    .danger-action h4 {
        color: #ffffff;
    }
    
    .danger-action p {
        color: #9ca3af;
    }
    
    .modal-content {
        background: #1f2937;
    }
    
    .modal-header {
        border-color: #374151;
    }
    
    .modal-header h3 {
        color: #ffffff;
    }
    
    .modal-footer {
        background: #374151;
        border-color: #4b5563;
    }
    
    .empty-state i {
        color: #4b5563;
    }
    
    .empty-state h3 {
        color: #d1d5db;
    }
    
    .empty-state p {
        color: #9ca3af;
    }
    
    .page-header h1 {
        color: #ffffff;
    }
    
    .page-header .text-muted {
        color: #9ca3af;
    }
    
    .live-status {
        background: #374151;
        color: #9ca3af;
    }
    
    .btn-secondary {
        background: #374151;
        color: #9ca3af;
        border-color: #4b5563;
    }
    
    .btn-secondary:hover {
        background: #4b5563;
        color: #ffffff;
    }
}

/* ====================================================
   Animation Keyframes
   ==================================================== */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ====================================================
   Custom Scrollbar
   ==================================================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 9999px;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

@media (prefers-color-scheme: dark) {
    ::-webkit-scrollbar-track {
        background: #1f2937;
    }
    
    ::-webkit-scrollbar-thumb {
        background: #4b5563;
    }
    
    ::-webkit-scrollbar-thumb:hover {
        background: #6b7280;
    }
}