/* ============================================
   AIFLC Admin Dashboard - Main Styles
   ============================================ */

:root {
    --sidebar-width: 260px;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Gradients */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --success-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --warning-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --info-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --danger-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    
    /* Colors */
    --primary: #667eea;
    --primary-dark: #5a6fd6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    --bg-body: #f0f2f8;
    --text-dark: #1e293b;
    --text-muted: #94a3b8;
}

/* Reset & Base */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-body);
    color: var(--text-dark);
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1050;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    padding: 1.5rem 0.8rem;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.1);
    transition: transform var(--transition);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 0.6rem 1.5rem 0.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 1.5rem;
}

.sidebar-brand .logo-icon {
    background: var(--primary-gradient);
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    color: white;
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

.sidebar-brand h4 {
    color: white;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin: 0;
    font-size: 1.3rem;
}

.sidebar-brand h4 span { color: #a5b4fc; }

.sidebar-sub {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0 0.6rem 1.2rem 0.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    margin-bottom: 1rem;
}

.sidebar .nav { flex: 1; }

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.55);
    padding: 0.7rem 1rem;
    margin: 0.15rem 0.2rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    cursor: pointer;
}

.sidebar .nav-link i {
    font-size: 1.2rem;
    width: 24px;
}

.sidebar .nav-link .badge {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 40px;
    font-size: 0.7rem;
}

.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: white;
    transform: translateX(4px);
}

.sidebar .nav-link.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.15));
    color: white;
    box-shadow: inset 3px 0 0 #667eea;
}

.sidebar .nav-link.logout {
    margin-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1.2rem;
    color: #f87171;
}

.sidebar .nav-link.logout:hover {
    background: rgba(248, 113, 113, 0.08);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background: var(--bg-body);
}

/* Top Bar */
.top-bar {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    padding: 1rem 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 0;
    z-index: 1040;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.top-bar h5 {
    font-weight: 600;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.top-bar .status-badge {
    background: #10b981;
    color: white;
    padding: 0.25rem 0.8rem;
    border-radius: 40px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.top-bar .status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    display: inline-block;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.content-area {
    padding: 2rem;
}

/* ============================================
   STAT CARDS
   ============================================ */
.stat-card {
    background: white;
    padding: 1.5rem 1.8rem;
    border-radius: var(--radius-md);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.stat-card .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: transform var(--transition);
}

.stat-card:hover .stat-icon {
    transform: scale(1.05) rotate(-2deg);
}

.stat-card .stat-number {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.1rem;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .stat-action {
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: gap var(--transition);
}

.stat-card .stat-action:hover {
    gap: 8px;
}

/* ============================================
   TABLE CARD
   ============================================ */
.table-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: box-shadow var(--transition);
}

.table-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

/* Recent Items */
.recent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 0;
    border-bottom: 1px solid #f1f5f9;
    transition: background var(--transition);
}

.recent-item:hover {
    background: #f8fafc;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    border-radius: 8px;
}

.recent-item:last-child {
    border-bottom: none;
}

/* ============================================
   TABLES
   ============================================ */
.table {
    font-size: 0.9rem;
}

.table thead th {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
    padding: 0.8rem 0.5rem;
}

.table tbody td {
    padding: 0.7rem 0.5rem;
    vertical-align: middle;
}

.table tbody tr:hover {
    background: #f8fafc;
}

/* ============================================
   BADGES (Soft)
   ============================================ */
.badge-soft-primary {
    background: #e0e7ff;
    color: #4338ca;
}

.badge-soft-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-soft-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-soft-info {
    background: #cffafe;
    color: #0e7490;
}

.badge-soft-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-soft-secondary {
    background: #f1f5f9;
    color: #475569;
}

/* ============================================
   BUTTONS (Glass)
   ============================================ */
.btn-glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all var(--transition);
}

.btn-glass:hover {
    background: white;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ============================================
   HAMBURGER (Mobile)
   ============================================ */
.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-dark);
    padding: 0;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1040;
}

.sidebar-overlay.show {
    display: block;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .top-bar {
        padding: 0.8rem 1rem;
    }
    
    .content-area {
        padding: 1rem;
    }
    
    .stat-card .stat-number {
        font-size: 1.6rem;
    }
    
    .hamburger {
        display: block;
    }
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    padding: 1rem;
}

.login-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 28px;
    padding: 2.5rem 2.8rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease;
}

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

.login-card .logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-card .logo .logo-icon {
    background: var(--primary-gradient);
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: white;
    box-shadow: 0 12px 24px rgba(102, 126, 234, 0.3);
    margin-bottom: 0.5rem;
}

.login-card .logo h2 {
    color: #0f172a;
    font-weight: 700;
    margin-bottom: 0;
    letter-spacing: -0.5px;
}

.login-card .logo h2 span {
    color: #667eea;
}

.login-card .logo p {
    color: #64748b;
    font-size: 0.9rem;
    margin-top: 0.2rem;
}

.login-card .form-control {
    border-radius: 14px;
    padding: 0.8rem 1.2rem;
    border: 2px solid #e2e8f0;
    font-size: 0.95rem;
    transition: all 0.25s;
    background: rgba(255, 255, 255, 0.6);
}

.login-card .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
    background: white;
}

.login-card .btn-primary {
    border-radius: 14px;
    padding: 0.8rem;
    font-weight: 600;
    background: var(--primary-gradient);
    border: none;
    width: 100%;
    font-size: 1rem;
    transition: all 0.3s;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.login-card .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.4);
}

.login-card .btn-primary:active {
    transform: scale(0.97);
}

.login-card .credentials-hint {
    text-align: center;
    margin-top: 1.8rem;
    padding: 0.8rem;
    background: rgba(241, 245, 249, 0.7);
    border-radius: 12px;
    font-size: 0.8rem;
    color: #64748b;
    backdrop-filter: blur(4px);
}

.login-card .credentials-hint code {
    background: #e2e8f0;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-weight: 600;
    color: #1e293b;
}

/* ============================================
   MISC HELPERS
   ============================================ */
.bg-soft-primary { background: #e0e7ff; }
.bg-soft-success { background: #d1fae5; }
.bg-soft-warning { background: #fef3c7; }
.bg-soft-info { background: #cffafe; }
.bg-soft-danger { background: #fee2e2; }

.text-primary-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}