@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    --secondary-gradient: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --warning-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.5);
    --body-bg: #f8fafc;
    --dark-bg: #0f172a;
    --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.08), 0 1px 3px 0 rgba(0, 0, 0, 0.03);
    --glow-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
    --border-radius-xl: 1rem;
    --border-radius-lg: 0.75rem;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--body-bg);
    color: #1e293b;
    font-size: 0.95rem;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6, .brand-font {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

/* Background Gradients */
.bg-gradient-primary { background: var(--primary-gradient) !important; }
.bg-gradient-secondary { background: var(--secondary-gradient) !important; }
.bg-gradient-success { background: var(--success-gradient) !important; }
.bg-gradient-warning { background: var(--warning-gradient) !important; }
.bg-gradient-danger { background: var(--danger-gradient) !important; }

/* Custom Navbar */
.navbar-custom {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    padding: 0.85rem 1.5rem;
}

/* Sidebar Custom Styling */
.sidebar-panel {
    background: #0f172a;
    color: #94a3b8;
    min-height: 100vh;
    box-shadow: 4px 0 20px rgba(0,0,0,0.05);
}

.sidebar-panel .nav-link {
    color: #94a3b8;
    padding: 0.8rem 1.2rem;
    margin: 0.2rem 0.8rem;
    border-radius: var(--border-radius-lg);
    font-weight: 500;
    transition: all 0.3s ease;
}

.sidebar-panel .nav-link:hover, 
.sidebar-panel .nav-link.active {
    color: #fff;
    background: rgba(99, 102, 241, 0.15);
    box-shadow: inset 3px 0 0 #6366f1;
}

/* Premium Glass Cards */
.card-premium {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: var(--border-radius-xl);
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.card-premium:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.12);
}

/* Table Customization */
.table-premium {
    background: #ffffff;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.table-premium thead th {
    background-color: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    color: #64748b;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 1rem;
}

.table-premium tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

/* Custom Buttons */
.btn-premium {
    background: var(--primary-gradient);
    color: #fff;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius-lg);
    padding: 0.65rem 1.5rem;
    box-shadow: var(--glow-shadow);
    transition: all 0.3s ease;
}

.btn-premium:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.btn-premium-secondary {
    background: var(--secondary-gradient);
    color: #fff;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius-lg);
    padding: 0.65rem 1.5rem;
    transition: all 0.3s ease;
}

.btn-premium-secondary:hover {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(6, 182, 212, 0.4);
}

.btn-premium-success {
    background: var(--success-gradient);
    color: #fff;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius-lg);
    padding: 0.65rem 1.5rem;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
    transition: all 0.3s ease;
}

.btn-premium-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

/* Glassmorphism Auth Container */
.auth-container {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-xl);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
    padding: 2.5rem;
}

/* Badges */
.badge-status {
    padding: 0.4em 0.8em;
    font-weight: 600;
    font-size: 0.75rem;
    border-radius: 50rem;
}

/* Floating Form Control */
.form-control-premium {
    border: 1px solid #cbd5e1;
    border-radius: var(--border-radius-lg);
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control-premium:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
    outline: none;
}

/* Mobile responsive fixes */
@media (max-width: 768px) {
    .sidebar-panel {
        min-height: auto;
    }
}

/* ===================================================
   ADMIN SIDEBAR LAYOUT
   =================================================== */
:root {
    --sidebar-width: 260px;
    --sidebar-bg: #1e1b4b;
    --sidebar-hover: rgba(255,255,255,0.08);
    --sidebar-active-bg: rgba(99,102,241,0.25);
    --sidebar-active-border: #6366f1;
    --sidebar-text: rgba(255,255,255,0.75);
    --sidebar-text-muted: rgba(255,255,255,0.4);
}

.admin-layout { display: flex; min-height: 100vh; }
.admin-layout.has-impersonation-bar { margin-top: 40px; }

/* Sidebar */
.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 1040;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.3s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
}

/* Brand */
.sidebar-brand {
    display: flex; align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    min-height: 72px;
}
.sidebar-brand-link {
    display: flex; align-items: center; gap: 0.75rem;
    text-decoration: none; flex: 1; min-width: 0;
}
.sidebar-logo {
    width: 38px; height: 38px; border-radius: 10px;
    object-fit: cover; flex-shrink: 0;
}
.sidebar-logo-placeholder {
    width: 38px; height: 38px; border-radius: 10px;
    background: var(--primary-gradient); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 0.85rem; flex-shrink: 0;
    font-family: 'Outfit', sans-serif;
}
.sidebar-brand-text { display: flex; flex-direction: column; min-width: 0; }
.sidebar-brand-name {
    font-family: 'Outfit', sans-serif; font-weight: 700; color: #fff;
    font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-brand-sub { font-size: 0.7rem; color: var(--sidebar-text-muted); margin-top: 1px; }

/* Section Labels */
.sidebar-section-label {
    font-size: 0.65rem; font-weight: 700; letter-spacing: 0.1em;
    color: var(--sidebar-text-muted); padding: 1rem 1.25rem 0.4rem;
}

/* Nav */
.sidebar-nav { flex: 1; padding: 0.5rem 0; overflow-y: auto; }
.sidebar-menu { list-style: none; padding: 0; margin: 0; }
.sidebar-item { margin: 2px 0.75rem; border-radius: 10px; overflow: hidden; }
.sidebar-link {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.65rem 0.9rem; color: var(--sidebar-text);
    text-decoration: none; border-radius: 10px;
    font-size: 0.875rem; font-weight: 500;
    transition: background 0.2s, color 0.2s;
    border-left: 3px solid transparent;
}
.sidebar-link:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-item.active .sidebar-link {
    background: var(--sidebar-active-bg); color: #fff; font-weight: 600;
    border-left-color: var(--sidebar-active-border);
}
.sidebar-icon { width: 18px; text-align: center; font-size: 0.9rem; flex-shrink: 0; opacity: 0.85; }
.sidebar-item.active .sidebar-icon { opacity: 1; color: #818cf8; }

/* Sidebar Footer */
.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 0.9rem 1rem;
    display: flex; align-items: center; gap: 0.6rem;
}
.sidebar-user { display: flex; align-items: center; gap: 0.6rem; flex: 1; min-width: 0; }
.sidebar-user-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--primary-gradient); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.8rem; flex-shrink: 0;
}
.sidebar-user-info { display: flex; flex-direction: column; min-width: 0; }
.sidebar-user-name { font-size: 0.8rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 0.68rem; color: var(--sidebar-text-muted); }
.sidebar-logout-btn {
    width: 32px; height: 32px; border-radius: 8px;
    background: rgba(239,68,68,0.15); color: #f87171;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none; flex-shrink: 0; transition: background 0.2s;
}
.sidebar-logout-btn:hover { background: rgba(239,68,68,0.35); color: #fca5a5; }

/* Main Content */
.admin-content {
    flex: 1; margin-left: var(--sidebar-width);
    display: flex; flex-direction: column;
    min-height: 100vh; background: var(--body-bg);
}
.admin-page-content { flex: 1; padding: 2rem; }
.admin-footer { margin-left: 0; }

/* Mobile Top Bar */
.admin-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.75rem 1rem; background: #fff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Toggle Button */
.sidebar-toggle-btn {
    background: none; border: none; color: #64748b;
    width: 36px; height: 36px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 1.1rem; transition: background 0.2s;
}
.sidebar-toggle-btn:hover { background: #f1f5f9; }

/* Overlay */
.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.5); z-index: 1039;
    backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* Mobile Responsive */
@media (max-width: 991.98px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.sidebar-open { transform: translateX(0); }
    .admin-content { margin-left: 0; }
    .admin-page-content { padding: 1rem; }
}
