/* Variables globales */
:root {
    --primary: #FF6B35;
    --primary-dark: #E55A2B;
    --secondary: #004E89;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --light: #f8f9fa;
    --dark: #343a40;
    --gray: #6c757d;
    --border: #dee2e6;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 20px 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(--light);
    color: var(--dark);
    line-height: 1.6;
}

/* ===== LOGIN PAGE ===== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo .icon {
    width: 64px;
    height: 64px;
    display: block;
    margin: 0 auto 12px;
}

.logo h1 {
    font-size: 32px;
    margin-bottom: 8px;
    color: var(--primary);
}

.logo p {
    color: var(--gray);
    font-size: 16px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.error-message {
    background: #fee;
    color: var(--danger);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    border-left: 4px solid var(--danger);
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-primary:disabled {
    background: var(--gray);
    cursor: not-allowed;
}

.footer-text {
    text-align: center;
    margin-top: 20px;
    color: var(--gray);
    font-size: 14px;
}

/* ===== DASHBOARD ===== */
.dashboard {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--dark);
    color: white;
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.logo-sidebar {
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-sidebar .icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.logo-sidebar h2 {
    font-size: 24px;
    margin: 0;
}

.logo-sidebar p {
    color: var(--gray);
    font-size: 14px;
    margin: 0;
}

.nav-menu {
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 8px;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.3s;
}

.nav-item .icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    flex-shrink: 0;
    filter: brightness(0) invert(1);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-item.active {
    background: var(--primary);
}

.nav-item.NEW-ITEM-1 {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%) !important;
    font-weight: bold;
}

.nav-item.NEW-ITEM-2 {
    background: linear-gradient(135deg, #2196F3 0%, #0b7dda 100%) !important;
    font-weight: bold;
}

.nav-item.NEW-ITEM-1:hover,
.nav-item.NEW-ITEM-2:hover {
    opacity: 0.9;
}

.btn-logout {
    width: 100%;
    padding: 12px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-logout .icon {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    filter: brightness(0) invert(1);
}

.btn-logout:hover {
    opacity: 0.9;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.top-bar {
    background: white;
    padding: 20px 32px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar h1 {
    font-size: 24px;
    color: var(--dark);
}

.user-info {
    color: var(--gray);
    font-size: 14px;
}

.content-area {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-header {
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.stat-card h3 {
    font-size: 14px;
    color: var(--gray);
    margin-bottom: 8px;
    text-transform: uppercase;
    font-weight: 600;
}

.stat-number {
    font-size: 36px;
    font-weight: bold;
    color: var(--primary);
}

.table-container {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.table-container h2 {
    margin-bottom: 20px;
    font-size: 20px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--light);
}

.data-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--dark);
    border-bottom: 2px solid var(--border);
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

.data-table tbody tr:hover {
    background: var(--light);
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: var(--success);
}

.badge-admin {
    background: #ffeaa7;
    color: #d63031;
    font-weight: 700;
}

.badge-user {
    background: #dfe6e9;
    color: #2d3436;
}

.badge-secondary {
    background: #e9ecef;
    color: #6c757d;
}

.badge-winner {
    background: #ffd700;
    color: #856404;
    font-weight: 700;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-card h3 {
    font-size: 32px;
    color: var(--primary);
    margin: 0 0 8px 0;
}

.stat-card p {
    color: var(--gray);
    font-size: 14px;
    margin: 0;
}

.btn-action {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    transition: transform 0.2s;
}

.btn-action:hover {
    transform: scale(1.2);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h2 {
    margin: 0;
    color: var(--dark);
}

.users-filters {
    margin-bottom: 20px;
}

.badge-danger {
    background: #f8d7da;
    color: var(--danger);
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.btn-action {
    padding: 6px 12px;
    margin-right: 4px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: opacity 0.3s;
}

.btn-action:hover {
    opacity: 0.8;
}

.btn-edit {
    background: var(--warning);
    color: white;
}

.btn-delete {
    background: var(--danger);
    color: white;
}

.btn-secondary {
    padding: 10px 20px;
    background: var(--gray);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s;
}

.btn-secondary:hover {
    opacity: 0.9;
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    overflow-y: auto;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 24px;
    color: var(--dark);
}

.close {
    font-size: 32px;
    font-weight: bold;
    color: var(--gray);
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: var(--dark);
}

.modal form {
    padding: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .dashboard {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px;
    }
}
