:root {
    --primary: #4a90e2;
    --primary-dark: #357abd;
    --danger: #e74c3c;
    --danger-dark: #c0392b;
    --success: #2ecc71;
    --warning: #f39c12;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-600: #6c757d;
    --gray-800: #343a40;
    --gray-900: #212529;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--gray-100);
    color: var(--gray-900);
    line-height: 1.6;
    min-height: 100vh;
}

.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.admin-header {
    background: white;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 {
    font-size: 28px;
    color: var(--gray-800);
    margin: 0;
}

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

.admin-name {
    color: var(--gray-600);
    font-weight: 500;
    margin-right: 8px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: var(--danger-dark);
}

.btn-outline {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-outline:hover {
    background: var(--gray-100);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

/* Dashboard Stats */
.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-card h3 {
    font-size: 14px;
    color: var(--gray-600);
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

/* Section */
.section {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

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

.section-header h2 {
    font-size: 22px;
    color: var(--gray-800);
    margin: 0;
}

/* Search Bar */
.search-bar {
    margin-bottom: 20px;
}

.search-bar input {
    width: 100%;
    max-width: 400px;
    padding: 10px 16px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 14px;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* Players Table */
.players-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.players-table thead {
    background: var(--gray-100);
}

.players-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-300);
}

.players-table td {
    padding: 12px;
    border-bottom: 1px solid var(--gray-200);
}

.players-table tbody tr {
    transition: background 0.15s;
}

.players-table tbody tr:hover {
    background: var(--gray-100);
}

.players-table .loading {
    text-align: center;
    color: var(--gray-600);
    padding: 40px;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

/* Action Buttons in Table */
.action-buttons {
    display: flex;
    gap: 8px;
}

.action-buttons .btn {
    padding: 4px 10px;
    font-size: 12px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.2s;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s;
}

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

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 20px;
    color: var(--gray-800);
    margin: 0;
}

.close {
    font-size: 28px;
    color: var(--gray-400);
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.close:hover {
    color: var(--gray-600);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

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

.form-group label {
    display: block;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 6px;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.form-group input[type="checkbox"] {
    margin-right: 8px;
}

.error-message {
    color: var(--danger);
    font-size: 13px;
    margin-top: 12px;
    display: none;
}

.error-message.show {
    display: block;
}

.warning {
    color: var(--warning);
    font-size: 13px;
    margin-top: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-container {
        padding: 12px;
    }

    .header-content {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .dashboard {
        grid-template-columns: repeat(2, 1fr);
    }

    .players-table {
        font-size: 12px;
    }

    .players-table th,
    .players-table td {
        padding: 8px;
    }

    .action-buttons {
        flex-direction: column;
    }
}
