/* ============================================
   ADMIN PANEL STYLESHEET
   ============================================ */

:root {
    --admin-primary:    #4D96FF;
    --admin-secondary:  #6BCB77;
    --admin-danger:     #E74C3C;
    --admin-warning:    #F39C12;
    --admin-dark:       #1A2332;
    --admin-sidebar-w:  260px;
    --admin-font:       'Nunito', sans-serif;
}

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

body.admin-body {
    font-family: var(--admin-font);
    background: #F0F4F8;
    color: #343A40;
}

/* ===== LOGIN PAGE ===== */
.admin-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1A2332 0%, #2C3E6E 50%, #1A2332 100%);
    padding: 24px;
}

.login-box {
    background: #fff;
    border-radius: 24px;
    padding: 48px 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo .icon {
    font-size: 3.5rem;
    display: block;
    margin-bottom: 8px;
}

.login-logo h1 {
    font-family: 'Fredoka One', cursive;
    font-size: 1.6rem;
    color: #1A2332;
}

.login-logo p {
    font-size: 0.85rem;
    color: #6C757D;
    margin-top: 4px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: #343A40;
}

.login-form .input-icon {
    position: relative;
}

.login-form .input-icon i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #ADB5BD;
}

.login-form .input-icon input {
    width: 100%;
    padding: 12px 14px 12px 40px;
    border: 2px solid #E9ECEF;
    border-radius: 10px;
    font-family: var(--admin-font);
    font-size: 0.95rem;
    transition: all 0.2s;
}

.login-form .input-icon input:focus {
    border-color: var(--admin-primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(77,150,255,0.15);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(90deg, var(--admin-primary), #2C3E6E);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: var(--admin-font);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-login:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* ===== ADMIN LAYOUT ===== */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: var(--admin-sidebar-w);
    background: var(--admin-dark);
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s;
}

.sidebar-brand {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-brand .brand-icon { font-size: 2rem; }
.sidebar-brand .brand-name {
    font-family: 'Fredoka One', cursive;
    font-size: 1.2rem;
    color: #fff;
    line-height: 1.1;
}
.sidebar-brand .brand-sub {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.5);
}

.sidebar-nav {
    flex: 1;
    padding: 20px 12px;
    overflow-y: auto;
}

.sidebar-section-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255,255,255,0.35);
    padding: 12px 8px 8px;
    font-weight: 700;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: 10px;
    color: rgba(255,255,255,0.75);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    margin-bottom: 2px;
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 0.95rem;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: rgba(77,150,255,0.2);
    color: #fff;
}

.sidebar-link.active {
    background: var(--admin-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(77,150,255,0.4);
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    margin-bottom: 8px;
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--admin-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #fff;
    font-weight: 700;
}

.sidebar-user-name   { font-size: 0.88rem; font-weight: 700; color: #fff; }
.sidebar-user-role   { font-size: 0.72rem; color: rgba(255,255,255,0.5); }

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    background: rgba(231,76,60,0.15);
    color: #E74C3C;
    border: 1px solid rgba(231,76,60,0.3);
    border-radius: 10px;
    font-family: var(--admin-font);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: #E74C3C;
    color: #fff;
}

/* ===== MAIN CONTENT ===== */
.admin-content {
    margin-left: var(--admin-sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Top bar */
.admin-topbar {
    background: #fff;
    padding: 16px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 50;
}

.admin-topbar .page-title {
    font-family: 'Fredoka One', cursive;
    font-size: 1.4rem;
    color: var(--admin-dark);
}

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

.topbar-badge {
    background: #F0F4F8;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #6C757D;
}

/* ===== MAIN BODY ===== */
.admin-main {
    padding: 28px;
    flex: 1;
}

/* ===== STAT CARDS ===== */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s;
}

.stat-card:hover { transform: translateY(-4px); }

.stat-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.stat-card.blue   .stat-card-icon { background: #D6EAFF; }
.stat-card.green  .stat-card-icon { background: #D4F5D7; }
.stat-card.yellow .stat-card-icon { background: #FFF5C0; }
.stat-card.pink   .stat-card-icon { background: #FFD6E8; }

.stat-card-num {
    font-family: 'Fredoka One', cursive;
    font-size: 2rem;
    line-height: 1;
    color: var(--admin-dark);
}

.stat-card-label {
    font-size: 0.82rem;
    color: #6C757D;
    font-weight: 600;
}

/* ===== TABLES ===== */
.admin-table-wrap {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    overflow: hidden;
}

.admin-table-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #F1F3F5;
}

.admin-table-header h3 {
    font-family: 'Fredoka One', cursive;
    font-size: 1.2rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    padding: 14px 20px;
    background: #F8F9FA;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6C757D;
    text-align: left;
}

.admin-table td {
    padding: 14px 20px;
    font-size: 0.9rem;
    border-bottom: 1px solid #F1F3F5;
    vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #FAFBFF; }

.table-action-btn {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    font-family: var(--admin-font);
}

.btn-edit   { background: #D6EAFF; color: var(--admin-primary); }
.btn-delete { background: #FFEAEA; color: var(--admin-danger); }
.btn-view   { background: #D4F5D7; color: #2ECC71; }

.btn-edit:hover   { background: var(--admin-primary); color: #fff; }
.btn-delete:hover { background: var(--admin-danger);  color: #fff; }
.btn-view:hover   { background: #2ECC71;              color: #fff; }

/* Status badges */
.status-badge {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-new       { background: #D6EAFF; color: var(--admin-primary); }
.status-contacted { background: #FFF5C0; color: #9A6F00; }
.status-enrolled  { background: #D4F5D7; color: #2ECC71; }
.status-closed    { background: #F1F3F5; color: #6C757D; }
.status-published { background: #D4F5D7; color: #2ECC71; }
.status-draft     { background: #F1F3F5; color: #6C757D; }

/* ===== ADMIN FORMS ===== */
.admin-form-card {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    max-width: 700px;
}

.admin-form-group {
    margin-bottom: 20px;
}

.admin-form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: #343A40;
}

.admin-form-control {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid #E9ECEF;
    border-radius: 10px;
    font-family: var(--admin-font);
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.admin-form-control:focus {
    border-color: var(--admin-primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(77,150,255,0.12);
}

textarea.admin-form-control {
    resize: vertical;
    min-height: 120px;
}

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

/* ===== ADMIN BUTTONS ===== */
.btn-admin {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 24px;
    border-radius: 10px;
    font-family: var(--admin-font);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-admin-primary {
    background: var(--admin-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(77,150,255,0.3);
}

.btn-admin-primary:hover {
    background: #1A6FD4;
    transform: translateY(-2px);
}

.btn-admin-success {
    background: var(--admin-secondary);
    color: #fff;
}

.btn-admin-success:hover {
    background: #3BA847;
    transform: translateY(-2px);
}

.btn-admin-danger  {
    background: var(--admin-danger);
    color: #fff;
}

.btn-admin-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.btn-admin-outline {
    background: transparent;
    color: var(--admin-primary);
    border: 2px solid var(--admin-primary);
}

.btn-admin-outline:hover {
    background: var(--admin-primary);
    color: #fff;
}

/* ===== ALERTS ===== */
.admin-alert {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-alert-success {
    background: #D4F5D7;
    color: #1E7E34;
    border-left: 4px solid #6BCB77;
}

.admin-alert-danger {
    background: #FFEAEA;
    color: #C0392B;
    border-left: 4px solid #E74C3C;
}

/* ===== RESPONSIVE ADMIN ===== */
@media (max-width: 1024px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    .admin-content {
        margin-left: 0;
    }

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

@media (max-width: 640px) {
    .admin-form-row { grid-template-columns: 1fr; }
    .stat-cards     { grid-template-columns: 1fr; }
    .admin-main     { padding: 16px; }
}
