/*
 * Simba Results - Admin Portal Professional Styles
 * Zimbabwe Primary School Administration — Dashboard, Management & Settings
 */

/* ========================================
   ADMIN PORTAL LAYOUT
   ======================================== */
.admin-portal {
    background-color: var(--simba-bg-light);
    min-height: 100vh;
    padding-bottom: 2rem;
}

/* ========================================
   PAGE HEADER BANNER
   ======================================== */
.admin-portal .ap-page-header {
    background: linear-gradient(135deg, var(--simba-primary) 0%, var(--simba-primary-dark) 100%);
    color: #fff;
    border-radius: 14px;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.admin-portal .ap-page-header::before {
    content: '';
    position: absolute;
    top: -60%;
    right: -8%;
    width: 280px;
    height: 280px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50%;
    pointer-events: none;
}

.admin-portal .ap-page-header h2 {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
}

.admin-portal .ap-page-header .ap-subtitle {
    color: rgba(255, 255, 255, 0.78);
    margin-bottom: 0;
    font-size: 0.9rem;
}

.admin-portal .ap-page-header .ap-header-actions .btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 8px;
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s;
}

.admin-portal .ap-page-header .ap-header-actions .btn:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.admin-portal .ap-page-header .ap-header-actions .btn-primary-action {
    background: var(--simba-secondary);
    border-color: var(--simba-secondary);
    color: #1e293b;
}

.admin-portal .ap-page-header .ap-header-actions .btn-primary-action:hover {
    background: var(--simba-secondary-dark);
    border-color: var(--simba-secondary-dark);
}

/* ========================================
   STAT CARDS
   ======================================== */
.ap-stat-card {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    cursor: pointer;
}

.ap-stat-card:hover {
    transform: translateY(-5px);
}

.ap-stat-card .ap-stat-body {
    padding: 1.25rem 1rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.ap-stat-card .ap-stat-body::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -15%;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.ap-stat-card .ap-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin: 0 auto 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    position: relative;
    z-index: 1;
}

.ap-stat-card .ap-stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.15;
    color: #fff;
    position: relative;
    z-index: 1;
}

.ap-stat-card .ap-stat-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 0.2rem;
    position: relative;
    z-index: 1;
}

.ap-stat-card.stat-primary {
    background: linear-gradient(135deg, #195D1B 0%, #2F7A31 100%);
    box-shadow: 0 4px 16px rgba(25, 93, 27, 0.25);
}

.ap-stat-card.stat-primary:hover {
    box-shadow: 0 12px 28px rgba(25, 93, 27, 0.3);
}

.ap-stat-card.stat-success {
    background: linear-gradient(135deg, #059669 0%, #10B981 100%);
    box-shadow: 0 4px 16px rgba(5, 150, 105, 0.25);
}

.ap-stat-card.stat-success:hover {
    box-shadow: 0 12px 28px rgba(5, 150, 105, 0.3);
}

.ap-stat-card.stat-info {
    background: linear-gradient(135deg, #0576B3 0%, #0EA5E9 100%);
    box-shadow: 0 4px 16px rgba(5, 118, 179, 0.25);
}

.ap-stat-card.stat-info:hover {
    box-shadow: 0 12px 28px rgba(5, 118, 179, 0.3);
}

.ap-stat-card.stat-warning {
    background: linear-gradient(135deg, #D97706 0%, #F59E0B 100%);
    box-shadow: 0 4px 16px rgba(217, 119, 6, 0.25);
}

.ap-stat-card.stat-warning:hover {
    box-shadow: 0 12px 28px rgba(217, 119, 6, 0.3);
}

.ap-stat-card.stat-danger {
    background: linear-gradient(135deg, #B91C1C 0%, #EF4444 100%);
    box-shadow: 0 4px 16px rgba(185, 28, 28, 0.25);
}

.ap-stat-card.stat-danger:hover {
    box-shadow: 0 12px 28px rgba(185, 28, 28, 0.3);
}

/* ========================================
   SECTION CARDS
   ======================================== */
.ap-section {
    border: none;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    margin-bottom: 1.5rem;
    background: #fff;
}

.ap-section .ap-section-header {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.ap-section .ap-section-header .ap-section-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--simba-primary) 0%, var(--simba-primary-light) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.ap-section .ap-section-header h5 {
    margin-bottom: 0;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--simba-text-primary);
}

.ap-section .ap-section-body {
    padding: 1.25rem;
}

.ap-section .ap-section-body.p-0 {
    padding: 0;
}

/* ========================================
   FILTER BAR
   ======================================== */
.ap-filter-bar {
    padding: 1rem 1.25rem;
}

.ap-filter-bar .form-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    color: var(--simba-text-muted);
}

.ap-filter-bar .form-select,
.ap-filter-bar .form-control {
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.ap-filter-bar .form-select:focus,
.ap-filter-bar .form-control:focus {
    border-color: var(--simba-primary);
    box-shadow: 0 0 0 3px rgba(var(--simba-primary-rgb), 0.1);
}

.ap-filter-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    color: var(--simba-text-muted);
    margin-bottom: 0.35rem;
    display: block;
}

.ap-section-body .form-select,
.ap-section-body .form-control {
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.ap-section-body .form-select:focus,
.ap-section-body .form-control:focus {
    border-color: var(--simba-primary);
    box-shadow: 0 0 0 3px rgba(var(--simba-primary-rgb), 0.1);
}

/* ========================================
   DATA TABLES
   ======================================== */
.ap-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
    margin-bottom: 0;
}

.ap-table thead th {
    background: var(--simba-bg-light);
    color: var(--simba-text-secondary);
    padding: 0.7rem 1rem;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

.ap-table tbody td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    color: var(--simba-text-primary);
}

.ap-table tbody tr:last-child td {
    border-bottom: none;
}

.ap-table tbody tr {
    transition: background-color 0.15s ease;
}

.ap-table tbody tr:hover {
    background-color: rgba(var(--simba-primary-rgb), 0.03);
}

/* ========================================
   QUICK ACTIONS
   ======================================== */
.ap-quick-action {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s;
    border: 1px solid #e2e8f0;
    color: var(--simba-text-primary);
    background: #fff;
}

.ap-quick-action:hover {
    border-color: var(--simba-primary);
    background: rgba(var(--simba-primary-rgb), 0.04);
    color: var(--simba-primary);
    transform: translateX(4px);
}

.ap-quick-action .ap-qa-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.ap-quick-action .ap-qa-icon.qa-primary {
    background: rgba(var(--simba-primary-rgb), 0.1);
    color: var(--simba-primary);
}

.ap-quick-action .ap-qa-icon.qa-success {
    background: rgba(5, 150, 105, 0.1);
    color: var(--simba-success);
}

.ap-quick-action .ap-qa-icon.qa-info {
    background: rgba(14, 165, 233, 0.1);
    color: var(--simba-info);
}

.ap-quick-action .ap-qa-icon.qa-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--simba-secondary);
}

/* ========================================
   BADGES
   ======================================== */
.ap-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.ap-badge.badge-active {
    background: rgba(22, 163, 74, 0.1);
    color: var(--simba-success);
}

.ap-badge.badge-inactive {
    background: rgba(148, 163, 184, 0.15);
    color: var(--simba-text-muted);
}

.ap-badge.badge-pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--simba-secondary-dark);
}

/* ========================================
   EMPTY & LOADING STATES
   ======================================== */
.ap-loading {
    text-align: center;
    padding: 4rem 2rem;
}

.ap-loading .ap-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e2e8f0;
    border-top-color: var(--simba-primary);
    border-radius: 50%;
    animation: ap-spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes ap-spin {
    to { transform: rotate(360deg); }
}

.ap-loading p {
    color: var(--simba-text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.ap-empty {
    text-align: center;
    padding: 3.5rem 2rem;
}

.ap-empty .ap-empty-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--simba-bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: var(--simba-text-muted);
    margin: 0 auto 1rem;
}

.ap-empty h5 {
    font-weight: 700;
    color: var(--simba-text-primary);
    margin-bottom: 0.35rem;
}

.ap-empty p {
    color: var(--simba-text-muted);
    font-size: 0.9rem;
    max-width: 400px;
    margin: 0 auto;
}

/* ========================================
   SETTINGS SIDEBAR NAV
   ======================================== */
.ap-settings-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ap-settings-nav .ap-nav-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 1rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--simba-text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

.ap-settings-nav .ap-nav-item:hover {
    background: rgba(var(--simba-primary-rgb), 0.06);
    color: var(--simba-primary);
}

.ap-settings-nav .ap-nav-item.active {
    background: rgba(var(--simba-primary-rgb), 0.1);
    color: var(--simba-primary);
    font-weight: 700;
}

.ap-settings-nav .ap-nav-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
    background: rgba(var(--simba-primary-rgb), 0.08);
    color: var(--simba-primary);
}

.ap-settings-nav .ap-nav-item.active .ap-nav-icon {
    background: var(--simba-primary);
    color: #fff;
}

/* ========================================
   TERM PROGRESS BAR
   ======================================== */
.ap-progress-bar {
    height: 8px;
    border-radius: 4px;
    background: #e2e8f0;
    overflow: hidden;
}

.ap-progress-bar .ap-progress-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--simba-primary) 0%, var(--simba-primary-light) 100%);
    transition: width 0.5s ease;
}

/* ========================================
   EVENT CARD (ADMIN)
   ======================================== */
.ap-event-card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ap-event-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

/* ========================================
   RESPONSIVE - TABLET
   ======================================== */
@media (max-width: 992px) {
    .admin-portal .ap-page-header {
        padding: 1.25rem 1.5rem;
    }

    .admin-portal .ap-page-header h2 {
        font-size: 1.2rem;
    }

    .ap-stat-card .ap-stat-value {
        font-size: 1.5rem;
    }
}

/* ========================================
   RESPONSIVE - PHONE
   ======================================== */
@media (max-width: 768px) {
    .admin-portal .ap-page-header {
        padding: 1rem 1.25rem;
        border-radius: 10px;
    }

    .admin-portal .ap-page-header h2 {
        font-size: 1.05rem;
    }

    .admin-portal .ap-page-header .ap-subtitle {
        font-size: 0.8rem;
    }

    .ap-stat-card .ap-stat-body {
        padding: 1rem 0.75rem;
    }

    .ap-stat-card .ap-stat-icon {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }

    .ap-stat-card .ap-stat-value {
        font-size: 1.5rem;
    }

    .ap-section .ap-section-header {
        padding: 0.75rem 1rem;
    }

    .ap-section .ap-section-body {
        padding: 1rem;
    }

    .ap-settings-nav .ap-nav-item {
        padding: 0.55rem 0.85rem;
    }
}

@media (max-width: 576px) {
    .admin-portal .ap-page-header {
        padding: 0.85rem 1rem;
        border-radius: 8px;
    }

    .admin-portal .ap-page-header h2 {
        font-size: 0.95rem;
    }

    .ap-stat-card .ap-stat-body {
        padding: 0.85rem 0.5rem;
    }

    .ap-stat-card .ap-stat-icon {
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }

    .ap-stat-card .ap-stat-value {
        font-size: 1.35rem;
    }

    .ap-stat-card .ap-stat-label {
        font-size: 0.62rem;
    }

    .ap-section .ap-section-header {
        padding: 0.65rem 0.85rem;
    }

    .ap-section .ap-section-body {
        padding: 0.75rem;
    }

    .ap-quick-action {
        padding: 0.55rem 0.75rem;
        font-size: 0.82rem;
    }
}
