/* RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #1e1e2e 0%, #2d2d44 100%);
    color: #fff;
    min-height: 100vh;
}

/* ROOT VARIABLES */
:root {
    --accent: #6366f1;
    --accent-dark: #4f46e5;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --text: #fff;
    --text-muted: #a1a1aa;
    --card-bg: #2a2a3e;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    --radius: 16px;
}

/* HEADER */
header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    color: #fff;
    padding: 20px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-left h1 {
    margin: 0;
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    font-weight: 700;
}

.header-left .subtitle {
    margin-top: 4px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* SELECT DROPDOWN */
header select {
    appearance: none;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    padding: 10px 40px 10px 16px;
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 600;
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23fff' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
    transition: all 0.25s ease;
}

header select:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background-color: rgba(255, 255, 255, 0.15);
}

header select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
    border-color: var(--accent);
}

header select option {
    color: #111;
    background: #fff;
}

/* Header Buttons */
.back-btn, .add-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.25s ease;
}

.back-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.add-btn {
    background: linear-gradient(135deg, var(--success), #16a34a);
    color: #fff;
    border: none;
}

.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.35);
}

/* MAIN CONTENT */
main {
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

/* TEAM GRID */
#teamGrid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

/* Loading State */
.loading-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* TEAM CARD */
.team-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.team-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(99, 102, 241, 0.3);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.card-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-btn {
    background: rgba(99, 102, 241, 0.2);
}

.edit-btn:hover {
    background: rgba(99, 102, 241, 0.4);
    transform: scale(1.1);
}

.delete-btn {
    background: rgba(239, 68, 68, 0.2);
}

.delete-btn:hover {
    background: rgba(239, 68, 68, 0.4);
    transform: scale(1.1);
}

.team-card h2 {
    margin: 0 0 8px;
    font-size: 1.25rem;
    color: #fff;
}

/* Badge (Male / Female) */
.pill {
    display: inline-block;
    padding: 6px 14px;
    font-size: 0.75rem;
    border-radius: 999px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pill.male {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(37, 99, 235, 0.3));
    color: #93c5fd;
}

.pill.female {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.3), rgba(219, 39, 119, 0.3));
    color: #f9a8d4;
}

/* TEAM META INFO */
.team-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* EMPTY STATE */
.empty-state {
    grid-column: 1 / -1;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 60px 40px;
    text-align: center;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.empty-state h3 {
    margin: 0 0 8px;
    font-size: 1.5rem;
    color: #fff;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* BUTTONS */
.btn-primary {
    display: inline-block;
    padding: 12px 28px;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    color: #fff;
    text-decoration: none;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.25s ease;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
}

.btn-secondary {
    display: inline-block;
    padding: 12px 28px;
    background: transparent;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.25s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

.btn-danger {
    display: inline-block;
    padding: 12px 28px;
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: #fff;
    text-decoration: none;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.25s ease;
    border: none;
    cursor: pointer;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.35);
}

/* MODAL */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    padding: 20px;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 28px;
    max-width: 480px;
    width: 100%;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal.show .modal-content {
    transform: translateY(0);
}

.modal-small {
    max-width: 400px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.3rem;
}

.close-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    margin-bottom: 24px;
}

.modal-body p {
    margin: 0 0 8px;
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* FORM STYLES */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    transition: all 0.25s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}

.form-group select option {
    color: #111;
    background: #fff;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* NOTIFICATION */
.notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    z-index: 1100;
    animation: slideIn 0.3s ease;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.notification.success {
    background: linear-gradient(135deg, var(--success), #16a34a);
    color: #fff;
}

.notification.error {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: #fff;
}

.notification.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* RESPONSIVE */
@media (max-width: 640px) {
    header {
        padding: 16px;
        flex-direction: column;
        text-align: center;
    }
    
    .header-right {
        width: 100%;
        justify-content: center;
    }
    
    main {
        padding: 16px;
    }
    
    #teamGrid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions button {
        width: 100%;
    }
}

/* ==================== TAB NAVIGATION ==================== */
.tab-nav {
    display: flex;
    gap: 8px;
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    overflow-x: auto;
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.tab-btn.active {
    background: var(--accent);
    color: #fff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ==================== SECTION HEADER ==================== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.section-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 4px 0 0;
}

/* ==================== POOL STYLES ==================== */
.pool-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.pool-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.pool-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
}

.pool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pool-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--accent);
}

.pool-actions {
    display: flex;
    gap: 8px;
}

.pool-teams {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.pool-team-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 0.9rem;
}

.pool-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.team-count {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ==================== CHECKBOX GRID ==================== */
.checkbox-grid {
    display: grid;
    gap: 12px;
    max-height: 250px;
    overflow-y: auto;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.checkbox-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

.checkbox-item span {
    font-size: 0.95rem;
}

/* ==================== MATCH LIST ==================== */
.match-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.match-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.25s ease;
    cursor: grab;
}

.match-item:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

.match-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.match-item.upcoming {
    border-left: 4px solid var(--accent);
}

.match-item.ongoing {
    border-left: 4px solid var(--warning);
}

.match-item.completed {
    border-left: 4px solid var(--success);
    opacity: 0.7;
}

.match-drag-handle {
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: grab;
    padding: 4px;
}

.match-order {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.2);
    color: var(--accent);
    font-weight: 700;
    border-radius: 10px;
    font-size: 0.9rem;
}

.match-details {
    flex: 1;
}

.match-teams {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.team-name {
    font-weight: 600;
    font-size: 1rem;
}

.vs {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

.match-info {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.pool-badge {
    padding: 4px 10px;
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.upcoming {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
}

.status-badge.ongoing {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
}

.status-badge.completed {
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
}

.match-actions {
    display: flex;
    gap: 8px;
}

.match-actions .btn-icon:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ==================== RESPONSIVE - ADDITIONAL ==================== */
@media (max-width: 768px) {
    .tab-nav {
        padding: 12px 16px;
    }
    
    .tab-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
    
    .pool-grid {
        grid-template-columns: 1fr;
    }
    
    .match-item {
        flex-wrap: wrap;
        padding: 16px;
    }
    
    .match-details {
        width: 100%;
        order: 2;
    }
    
    .match-actions {
        order: 1;
        margin-left: auto;
    }
    
    .match-drag-handle {
        display: none;
    }
}

/* ==================== PAST MATCHES ==================== */
.past-matches-header {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.past-match-list .match-item {
    cursor: default;
}

.match-winner-badge {
    font-size: 1.5rem;
    min-width: 40px;
    text-align: center;
}

.match-number-badge {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent);
    background: rgba(99, 102, 241, 0.15);
    padding: 3px 8px;
    border-radius: 6px;
}

.past-match-list .match-item {
    position: relative;
}

.match-score {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent);
    padding: 6px 12px;
    background: rgba(99, 102, 241, 0.2);
    border-radius: 8px;
}

.team-name.winner {
    color: var(--success);
    font-weight: 700;
}

.winner-text {
    font-size: 0.8rem;
    color: var(--success);
    font-weight: 500;
}

/* ==================== LOGOUT BUTTON ==================== */
.logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.25s ease;
    background: rgba(239, 68, 68, 0.2);
    color: #fff;
    border: 2px solid rgba(239, 68, 68, 0.4);
    cursor: pointer;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.35);
    border-color: var(--danger);
}

/* User Info in Header */
.user-info {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ==================== USER MANAGEMENT ==================== */
.user-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.user-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.user-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.user-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.user-info-card {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.user-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.user-username {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.user-status {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.user-status.active {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.user-status.inactive {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.user-role {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.user-role.admin {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #fff;
}

.user-role.editor {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.user-role.viewer {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

.user-permissions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.permission-badge {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.permission-badge.enabled {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.user-actions {
    display: flex;
    gap: 8px;
}

.user-actions button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.user-actions .btn-edit {
    background: rgba(99, 102, 241, 0.2);
    color: var(--accent);
}

.user-actions .btn-edit:hover {
    background: rgba(99, 102, 241, 0.35);
}

.user-actions .btn-toggle {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.user-actions .btn-toggle:hover {
    background: rgba(245, 158, 11, 0.35);
}

.user-actions .btn-delete {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.user-actions .btn-delete:hover {
    background: rgba(239, 68, 68, 0.35);
}

/* Permission Grid in Modals */
.permission-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

/* Permissions Table (like ERP systems) */
.permissions-table {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    overflow: hidden;
    max-height: 350px;
    overflow-y: auto;
}

.permission-module {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.permission-module:last-child {
    border-bottom: none;
}

.permission-module-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(99, 102, 241, 0.15);
    cursor: pointer;
    transition: background 0.2s;
}

.permission-module-header:hover {
    background: rgba(99, 102, 241, 0.25);
}

.permission-module-header .module-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.permission-module-header .toggle-all-btn {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.permission-module-header .toggle-all-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.permission-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.15);
}

.permission-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.permission-action:hover {
    background: rgba(255, 255, 255, 0.1);
}

.permission-action.checked {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.4);
    color: var(--success);
}

.permission-action input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--success);
    cursor: pointer;
}

/* Modal Large */
.modal-content.modal-large {
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

/* Edit Players Container */
.edit-players-container {
    max-height: 400px;
    overflow-y: auto;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    margin-top: 8px;
}

.edit-player-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.edit-player-item:last-child {
    margin-bottom: 0;
}

.edit-player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.edit-player-header h4 {
    margin: 0;
    font-size: 0.9rem;
    color: var(--accent);
}

.edit-player-number {
    background: var(--accent);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
}

.edit-player-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.edit-player-fields label {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.edit-player-fields input,
.edit-player-fields select {
    padding: 8px 10px;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
}

.edit-player-fields input:focus,
.edit-player-fields select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.edit-player-fields select option {
    background: #2a2a3e;
    color: white;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.95rem;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}