/**
 * ELISCO GLOBAL - Admin Portal Stylesheet
 * Fully Responsive & Mobile Friendly
 */

:root {
    --admin-bg: #091326;
    --admin-sidebar: #091326;
    --admin-content: #f4f7fb;
    --admin-card: #ffffff;
    --admin-border: #e2e8f0;
    --admin-primary: #0b5ed7;
    --admin-primary-hover: #0a58ca;
    --admin-gold: #f59e0b;
    --admin-gold-hover: #d97706;
    --admin-text: #0f172a;
    --admin-muted: #64748b;
    --admin-success: #10b981;
    --admin-danger: #ef4444;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body.admin-body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--admin-content);
    color: var(--admin-text);
    margin: 0;
    padding: 0;
    display: flex;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

body.sidebar-open {
    overflow: hidden;
}

/* ==========================================================================
   SIDEBAR (Desktop & Mobile Drawer)
   ========================================================================== */
.admin-sidebar {
    width: 260px;
    background: var(--admin-sidebar);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    padding: 22px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-brand-wrapper {
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    font-size: 1.25rem;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.2;
}

.sidebar-brand span {
    color: #00d2ff;
}

.sidebar-sub {
    font-size: 0.68rem;
    color: var(--admin-gold);
    font-weight: 800;
    letter-spacing: 1.5px;
    display: block;
    margin-top: 3px;
}

.sidebar-close-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: #cbd5e1;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.4);
}

.sidebar-menu {
    list-style: none;
    padding: 15px 12px;
    margin: 0;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-menu li {
    margin-bottom: 4px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.sidebar-menu a:hover {
    background: rgba(11, 94, 215, 0.15);
    color: #ffffff;
}

.sidebar-menu a.active {
    background: var(--admin-primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(11, 94, 215, 0.35);
}

.sidebar-menu a i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.15);
}

/* Mobile Drawer Backdrop */
.admin-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(3, 11, 24, 0.75);
    backdrop-filter: blur(4px);
    z-index: 1040;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* ==========================================================================
   MAIN CONTENT & TOPBAR
   ========================================================================== */
.admin-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-x: hidden;
}

.admin-topbar {
    background: #ffffff;
    padding: 14px 28px;
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 990;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
    gap: 16px;
}

.admin-topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1;
}

.admin-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--admin-border);
    background: #ffffff;
    color: #0f172a;
    font-size: 1.15rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.admin-menu-toggle:hover, .admin-menu-toggle:active {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: var(--admin-primary);
}

.admin-topbar-title h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    margin: 0;
    color: #0f172a;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.admin-topbar-user {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.topbar-live-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--admin-primary);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    background: rgba(11, 94, 215, 0.08);
    transition: all 0.2s ease;
}

.topbar-live-link:hover {
    background: rgba(11, 94, 215, 0.16);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #334155;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #0b5ed7, #00d2ff);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.82rem;
    box-shadow: 0 2px 6px rgba(11, 94, 215, 0.25);
    flex-shrink: 0;
}

.admin-container {
    padding: 28px;
    max-width: 1400px;
    width: 100%;
}

/* ==========================================================================
   STAT CARDS
   ========================================================================== */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 26px;
}

.stat-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--admin-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-icon.blue { background: rgba(11, 94, 215, 0.1); color: #0b5ed7; }
.stat-icon.gold { background: rgba(245, 158, 11, 0.1); color: #d97706; }
.stat-icon.green { background: rgba(16, 185, 129, 0.1); color: #059669; }
.stat-icon.purple { background: rgba(147, 51, 234, 0.1); color: #7e22ce; }

.stat-info {
    min-width: 0;
}

.stat-info h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0;
    color: #0f172a;
    line-height: 1.1;
}

.stat-info span {
    font-size: 0.8rem;
    color: var(--admin-muted);
    font-weight: 600;
    display: block;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   CARDS & TABLES
   ========================================================================== */
.admin-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--admin-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    margin-bottom: 24px;
    overflow: hidden;
}

.admin-card-header {
    padding: 16px 22px;
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: #ffffff;
}

.admin-card-header h4 {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Responsive Table Wrapper with Touch Scroll */
.admin-table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0 0 12px 12px;
}

.admin-table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.admin-table th {
    background: #f8fafc;
    padding: 12px 16px;
    font-weight: 700;
    color: #475569;
    text-align: left;
    border-bottom: 1px solid var(--admin-border);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.admin-table td {
    padding: 13px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover td {
    background: #fafcff;
}

/* STATUS BADGES */
.status-pill {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.status-new { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.status-contacted { background: #fefce8; color: #854d0e; border: 1px solid #fef08a; }
.status-enrolled { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.status-closed { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }

.badge-gold {
    display: inline-block;
    padding: 3px 8px;
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.meta-pill {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.hide-mobile {
    display: inline;
}

@media (max-width: 576px) {
    .hide-mobile {
        display: none !important;
    }
}

/* ACTION BUTTONS */
.btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-primary {
    background: var(--admin-primary);
    color: #ffffff !important;
}

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

.btn-secondary {
    background: #f1f5f9;
    color: #334155 !important;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

/* ==========================================================================
   RESPONSIVE GRIDS (Reusable Across All Admin Pages)
   ========================================================================== */
.admin-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.admin-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.admin-grid-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.admin-quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 10px;
}

/* ==========================================================================
   FORMS & INPUTS
   ========================================================================== */
.admin-form-group {
    margin-bottom: 18px;
}

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

.admin-form-control {
    width: 100%;
    min-height: 42px;
    padding: 9px 13px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    font-family: inherit;
    font-size: 0.92rem;
    color: #0f172a;
    background: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.admin-form-control:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(11, 94, 215, 0.15);
}

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

/* FILTER STRIP */
.admin-filter-bar {
    padding: 14px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.admin-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ==========================================================================
   LOGIN PORTAL
   ========================================================================== */
.login-wrapper {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #051630 0%, #0a2754 100%);
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
    padding: 38px 32px;
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES FOR TABLETS & MOBILES
   ========================================================================== */

/* Tablet & Mobile Screens (<= 992px) */
@media (max-width: 992px) {
    body.admin-body {
        display: block;
        width: 100%;
        overflow-x: hidden;
    }

    /* Convert Sidebar to Off-canvas Slide-out Drawer */
    .admin-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        max-width: 82vw;
        height: 100vh;
        z-index: 1050;
        transform: translateX(-100%);
        border-right: none;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .admin-sidebar.open {
        transform: translateX(0);
        box-shadow: 12px 0 40px rgba(0, 0, 0, 0.6);
    }

    .sidebar-close-btn {
        display: flex;
    }

    .admin-sidebar-backdrop {
        display: block;
    }

    .admin-sidebar-backdrop.show {
        opacity: 1;
        pointer-events: auto;
    }

    /* Topbar for Tablets & Mobiles */
    .admin-topbar {
        padding: 10px 16px;
    }

    .admin-menu-toggle {
        display: flex;
    }

    .admin-topbar-title h2 {
        font-size: 1.15rem;
    }

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

    .admin-grid-layout {
        grid-template-columns: 1fr;
        gap: 18px;
    }

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

    .admin-quick-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .admin-container {
        padding: 18px 16px;
    }
}

/* Small Tablets & Large Phones (<= 768px) */
@media (max-width: 768px) {
    .admin-grid-2 {
        grid-template-columns: 1fr;
    }

    .admin-grid-3 {
        grid-template-columns: 1fr;
    }

    .admin-quick-actions {
        grid-template-columns: 1fr;
    }

    .admin-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 14px 16px;
    }

    .admin-filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px 14px;
    }

    .admin-filter-group {
        overflow-x: auto;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
    }

    .admin-filter-group .btn-sm {
        flex-shrink: 0;
    }

    .topbar-live-link span {
        display: none;
    }

    .user-badge .user-name {
        display: none;
    }
}

/* Mobile Phones (<= 576px) */
@media (max-width: 576px) {
    .admin-topbar {
        padding: 8px 12px;
        gap: 10px;
    }

    .admin-topbar-title h2 {
        font-size: 1.02rem;
    }

    .admin-container {
        padding: 14px 10px;
    }

    /* 2x2 compact stat cards grid for high density */
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-bottom: 16px;
    }

    .stat-card {
        padding: 12px 10px;
        gap: 8px;
        border-radius: 10px;
    }

    .stat-icon {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
        border-radius: 8px;
    }

    .stat-info h3 {
        font-size: 1.35rem;
    }

    .stat-info span {
        font-size: 0.72rem;
        letter-spacing: -0.2px;
    }

    .admin-card {
        border-radius: 10px;
        margin-bottom: 16px;
    }

    .admin-card-header {
        padding: 12px 14px;
    }

    .admin-card-header h4 {
        font-size: 0.98rem;
    }

    .admin-table th, .admin-table td {
        padding: 10px 12px;
        font-size: 0.8rem;
    }

    .login-card {
        padding: 26px 18px;
        border-radius: 14px;
    }
}
