/* ==========================================================================
   Online Exam Platform - Multi-Tenant Portal Theme
   Elevated Indigo / Slate Dark Navbar & Sidebar with Modern Aesthetic
   ========================================================================== */

:root {
    --portal-brand-primary: #4f46e5;
    --portal-brand-gradient: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
    --portal-header-bg: linear-gradient(135deg, #090d16 0%, #0f172a 45%, #1e1b4b 100%);
    --portal-sidebar-bg: #0f172a;
    --portal-sidebar-active: #4f46e5;
    --portal-card-border: #e2e8f0;
    --portal-font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    font-family: var(--portal-font-sans);
    background-color: #f8fafc;
    color: #1e293b;
}

/* 1. Header Styling */
.app-header.portal-header {
    background: var(--portal-header-bg) !important;
    border-bottom: 1px solid rgba(99, 102, 241, 0.25) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    height: 62px;
}

.portal-brand-container {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none !important;
}

.portal-inst-logo {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    object-fit: cover;
    background: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.portal-inst-initials {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: var(--portal-brand-gradient);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
}

.portal-inst-title {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.portal-inst-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 320px;
}

.portal-inst-sub {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.tenant-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(99, 102, 241, 0.25);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.4);
    letter-spacing: 0.5px;
}

.tenant-role-badge {
    font-size: 0.68rem;
    font-weight: 600;
    color: #94a3b8;
}

/* 2. Tenant Switcher for SuperAdmin */
.tenant-switcher-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #f1f5f9 !important;
    border-radius: 8px;
    padding: 5px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.tenant-switcher-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(99, 102, 241, 0.5);
}

/* 3. User Avatar & Menu */
.portal-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* 4. Stat Cards & Dashboard Metrics */
.stat-card-elevated {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 22px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.stat-card-elevated:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08);
}

.stat-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.stat-icon-indigo { background: #eef2ff; color: #4f46e5; }
.stat-icon-emerald { background: #ecfdf5; color: #10b981; }
.stat-icon-amber { background: #fffbeb; color: #f59e0b; }
.stat-icon-sky { background: #f0f9ff; color: #0284c7; }
.stat-icon-rose { background: #fff1f2; color: #f43f5e; }

.stat-number {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #0f172a;
    line-height: 1.1;
    margin-top: 8px;
}

.stat-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 5. Custom Table Styling */
.table-portal {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.table-portal thead th {
    background: #f8fafc;
    color: #475569;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
}

.table-portal tbody td {
    padding: 14px 16px;
    vertical-align: middle;
    font-size: 0.88rem;
    border-bottom: 1px solid #f1f5f9;
}

.table-portal tbody tr:last-child td {
    border-bottom: none;
}

.table-portal tbody tr:hover td {
    background-color: #f8fafc;
}

/* 6. Action Badges */
.badge-active {
    background: #dcfce7;
    color: #15803d;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
}

.badge-suspended {
    background: #fee2e2;
    color: #b91c1c;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
}
