/* ============================================
   ADMIN PANEL STYLES
   ============================================ */
:root {
    --admin-primary: #1a5276;
    --admin-secondary: #27ae60;
    --admin-accent: #f39c12;
    --admin-danger: #e74c3c;
    --admin-bg: #f0f2f5;
    --admin-sidebar: #1a1a2e;
    --admin-card: #ffffff;
    --admin-text: #2c3e50;
    --admin-text-light: #6c757d;
    --admin-border: #dee2e6;
    --admin-radius: 10px;
    --admin-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', 'Open Sans', sans-serif;
    background: var(--admin-bg);
    color: var(--admin-text);
    min-height: 100vh;
}

/* ===== Login Page ===== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a5276, #0e2f44);
}

.login-box {
    background: var(--admin-card);
    border-radius: 20px;
    padding: 50px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-box .logo {
    text-align: center;
    margin-bottom: 35px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--admin-primary);
}

.login-box .logo span { color: var(--admin-secondary); }

.login-box h2 {
    text-align: center;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.login-box p {
    text-align: center;
    color: var(--admin-text-light);
    margin-bottom: 30px;
    font-size: 0.95rem;
}

.login-box .form-group {
    margin-bottom: 20px;
}

.login-box .form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.login-box .form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--admin-border);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
}

.login-box .form-group input:focus {
    border-color: var(--admin-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 82, 118, 0.1);
}

.login-box .btn {
    width: 100%;
    padding: 14px;
    background: var(--admin-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.login-box .btn:hover {
    background: #0e2f44;
    transform: translateY(-2px);
}

.login-box .error-msg {
    color: var(--admin-danger);
    font-size: 0.9rem;
    text-align: center;
    margin-top: 15px;
    display: none;
}

/* ===== Admin Layout ===== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
    width: 260px;
    background: var(--admin-sidebar);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    transition: all 0.3s;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 700;
}

.sidebar-header span { color: var(--admin-secondary); }

.sidebar-menu {
    padding: 15px 0;
}

.sidebar-menu .menu-label {
    padding: 10px 20px;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    letter-spacing: 1px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.3s;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: rgba(255,255,255,0.05);
    color: white;
    border-left-color: var(--admin-secondary);
}

.sidebar-menu a i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

/* ===== Main Content ===== */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 30px;
}

/* ===== Top Bar ===== */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 15px 25px;
    background: white;
    border-radius: var(--admin-radius);
    box-shadow: var(--admin-shadow);
}

.topbar h2 {
    font-size: 1.3rem;
    margin-bottom: 0;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.topbar-right .admin-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-right .admin-user .avatar {
    width: 40px;
    height: 40px;
    background: var(--admin-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
}

.topbar-right .logout-btn {
    padding: 8px 20px;
    background: none;
    border: 2px solid var(--admin-danger);
    color: var(--admin-danger);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.topbar-right .logout-btn:hover {
    background: var(--admin-danger);
    color: white;
}

/* ===== Dashboard Cards ===== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.dash-card {
    background: white;
    border-radius: var(--admin-radius);
    padding: 25px;
    box-shadow: var(--admin-shadow);
    transition: all 0.3s;
}

.dash-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.12);
}

.dash-card .card-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    margin-bottom: 15px;
}

.dash-card .card-icon.blue { background: var(--admin-primary); }
.dash-card .card-icon.green { background: var(--admin-secondary); }
.dash-card .card-icon.gold { background: var(--admin-accent); }
.dash-card .card-icon.red { background: var(--admin-danger); }

.dash-card .card-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.dash-card .card-label {
    color: var(--admin-text-light);
    font-size: 0.9rem;
}

/* ===== Tables ===== */
.table-container {
    background: white;
    border-radius: var(--admin-radius);
    padding: 25px;
    box-shadow: var(--admin-shadow);
    margin-bottom: 30px;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.table-header h3 {
    font-size: 1.1rem;
}

.table-header .btn-sm {
    padding: 8px 16px;
    background: var(--admin-primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s;
}

.table-header .btn-sm:hover {
    background: #0e2f44;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    text-align: left;
    padding: 12px 15px;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--admin-text-light);
    border-bottom: 2px solid var(--admin-border);
}

table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--admin-border);
    font-size: 0.95rem;
}

table tr:hover td {
    background: #f8f9fa;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success { background: rgba(39,174,96,0.1); color: var(--admin-secondary); }
.badge-warning { background: rgba(243,156,18,0.1); color: var(--admin-accent); }
.badge-danger { background: rgba(231,76,60,0.1); color: var(--admin-danger); }

.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    margin: 0 3px;
    transition: all 0.3s;
}

.action-btn.edit { background: rgba(26,82,118,0.1); color: var(--admin-primary); }
.action-btn.delete { background: rgba(231,76,60,0.1); color: var(--admin-danger); }
.action-btn.view { background: rgba(39,174,96,0.1); color: var(--admin-secondary); }

.action-btn:hover { transform: scale(1.1); }

/* ===== Forms ===== */
.form-card {
    background: white;
    border-radius: var(--admin-radius);
    padding: 30px;
    box-shadow: var(--admin-shadow);
    max-width: 700px;
}

.form-card .form-group {
    margin-bottom: 20px;
}

.form-card .form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.form-card .form-group input,
.form-card .form-group select,
.form-card .form-group textarea {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid var(--admin-border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s;
}

.form-card .form-group input:focus,
.form-card .form-group select:focus,
.form-card .form-group textarea:focus {
    border-color: var(--admin-primary);
    outline: none;
}

.form-card .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-card .btn {
    padding: 12px 30px;
    background: var(--admin-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.form-card .btn:hover { background: #0e2f44; }
.form-card .btn-secondary {
    background: var(--admin-secondary);
}
.form-card .btn-secondary:hover { background: #1e8449; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
        overflow: hidden;
    }
    
    .sidebar .sidebar-header span:not(.icon),
    .sidebar .menu-label,
    .sidebar a span {
        display: none;
    }
    
    .sidebar a {
        justify-content: center;
        padding: 15px;
    }
    
    .main-content {
        margin-left: 60px;
        padding: 15px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .form-card .form-row {
        grid-template-columns: 1fr;
    }
}

/* ===== Modal ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active { display: flex; }

.modal-box {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-box h3 {
    margin-bottom: 20px;
}

.modal-box .modal-close {
    float: right;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--admin-text-light);
}

/* ===== Certificate Preview ===== */
.certificate {
    background: white;
    border: 5px solid var(--admin-accent);
    padding: 40px;
    text-align: center;
    border-radius: 10px;
    margin: 20px 0;
}

.certificate h1 {
    color: var(--admin-primary);
    font-size: 2rem;
    margin-bottom: 10px;
}

.certificate .winner-name {
    font-size: 1.8rem;
    color: var(--admin-accent);
    margin: 15px 0;
    font-weight: 700;
}

.certificate p {
    color: var(--admin-text-light);
    line-height: 1.8;
}

/* ===== Toast ===== */
.admin-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 3000;
    transform: translateX(120%);
    transition: all 0.3s;
}

.admin-toast.show { transform: translateX(0); }
.admin-toast.success { background: var(--admin-secondary); }
.admin-toast.error { background: var(--admin-danger); }
.admin-toast.info { background: var(--admin-primary); }