/* ============================================================
   Logi Bluechip — Admin Panel Styles
   Bootstrap 5.3 + Custom Styling with Light/Dark Theme
   Purple AI Theme | Poppins Font
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

/* ============================================================
   CSS Variables — Light Theme (Default)
   ============================================================ */
:root {
    /* Primary Purple */
    --primary: #7c3aed;
    --primary-light: #a78bfa;
    --primary-dark: #5b21b6;
    --primary-rgb: 124, 58, 237;

    /* Secondary */
    --secondary: #64748b;
    --secondary-light: #94a3b8;
    --secondary-dark: #475569;

    /* Accent Colors */
    --accent-teal: #14b8a6;
    --accent-teal-light: #2dd4bf;
    --accent-coral: #f97316;
    --accent-coral-light: #fb923c;
    --accent-pink: #ec4899;
    --accent-pink-light: #f472b6;
    --accent-cyan: #06b6d4;
    --accent-cyan-light: #22d3ee;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-violet: #8b5cf6;

    /* Background Colors — clean white & mild grey only */
    --bg-body: #f4f6f8;
    --bg-sidebar: #ffffff;
    --bg-sidebar-solid: #ffffff;
    --bg-card: #ffffff;
    --bg-header: #ffffff;
    --bg-input: #f9fafb;
    --bg-hover: #f1f3f5;

    /* Text Colors */
    --text-primary: #1a1a2e;
    --text-secondary: #4a5568;
    --text-muted: #9aa5b4;
    --text-light: #cbd2d9;
    --text-inverse: #ffffff;

    /* Border Colors */
    --border-color: #e4e7eb;
    --border-light: #eef0f2;

    /* Shadow — neutral grey, no purple tint */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.12);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 20px rgba(124, 58, 237, 0.2);

    /* Sidebar */
    --sidebar-width: 268px;
    --sidebar-collapsed-width: 72px;
    --sidebar-text: #1a1a2e;
    --sidebar-text-muted: #7b8694;
    --sidebar-active-bg: rgba(124, 58, 237, 0.08);
    --sidebar-active-text: #7c3aed;
    --sidebar-hover-bg: #f1f3f5;
    --sidebar-section-text: #b0b8c4;
    --sidebar-border: #e8eaed;

    /* Header */
    --header-height: 68px;

    /* Border Radius */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius: 10px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition: 200ms ease;
    --transition-slow: 300ms ease;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #7c3aed 0%, #9333ea 50%, #a855f7 100%);
    --gradient-primary-soft: linear-gradient(135deg, #f4f6f8 0%, #eef0f2 100%);
    --gradient-teal: linear-gradient(135deg, #14b8a6 0%, #06b6d4 100%);
    --gradient-coral: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
    --gradient-pink: linear-gradient(135deg, #ec4899 0%, #f472b6 100%);
    --gradient-cyan: linear-gradient(135deg, #06b6d4 0%, #22d3ee 100%);
    --gradient-emerald: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    --gradient-amber: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    --gradient-violet: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
    --gradient-sidebar-brand: linear-gradient(135deg, #7c3aed 0%, #9333ea 100%);
}

/* ============================================================
   CSS Variables — Dark Theme
   ============================================================ */
[data-theme="dark"] {
    --bg-body: #0d0b1a;
    --bg-sidebar: #120f22;
    --bg-sidebar-solid: #120f22;
    --bg-card: #1a1630;
    --bg-header: #1a1630;
    --bg-input: #231d3d;
    --bg-hover: #231d3d;

    --text-primary: #f0eeff;
    --text-secondary: #c4b5fd;
    --text-muted: #7c6ba8;
    --text-light: #4c4070;

    --border-color: #2a2248;
    --border-light: #1f1a38;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.6);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.6);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0,0,0,0.2);
    --shadow-glow: 0 0 20px rgba(124, 58, 237, 0.4);

    --sidebar-text: #e8e0ff;
    --sidebar-text-muted: #8b7fb8;
    --sidebar-active-bg: linear-gradient(135deg, rgba(124,58,237,0.25) 0%, rgba(168,85,247,0.15) 100%);
    --sidebar-active-text: #c4b5fd;
    --sidebar-hover-bg: rgba(124, 58, 237, 0.15);
    --sidebar-section-text: #4c4070;
    --sidebar-border: #2a2248;
}

/* ============================================================
   Base Styles
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-body);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover { color: var(--primary-dark); }

/* ============================================================
   Layout Structure
   ============================================================ */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: all var(--transition-slow);
    border-right: 1px solid var(--sidebar-border);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.admin-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition-slow);
}

.admin-header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    z-index: 999;
    display: flex;
    align-items: center;
    padding: 0 28px;
    box-shadow: 0 1px 0 var(--border-color), 0 4px 16px rgba(0,0,0,0.04);
    gap: 16px;
}

.admin-content {
    flex: 1;
    padding: 28px;
}

/* ============================================================
   Sidebar — Brand / Logo Header
   ============================================================ */
.sidebar-header {
    padding: 0 20px;
    height: 68px;
    display: flex;
    align-items: center;
    gap: 13px;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
    position: relative;
}

.sidebar-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20px;
    right: 20px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-light), transparent);
    opacity: 0.25;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 21px;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.45), 0 0 0 1px rgba(255,255,255,0.15) inset;
    position: relative;
    overflow: hidden;
    animation: logo-breathe 3s ease-in-out infinite;
}

.sidebar-logo::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(135deg, rgba(255,255,255,0.18) 0%, transparent 50%);
    pointer-events: none;
}

@keyframes logo-breathe {
    0%, 100% { box-shadow: 0 4px 14px rgba(124, 58, 237, 0.45), 0 0 0 1px rgba(255,255,255,0.15) inset; }
    50%       { box-shadow: 0 4px 22px rgba(124, 58, 237, 0.65), 0 0 0 1px rgba(255,255,255,0.2) inset; }
}

.sidebar-brand { display: flex; flex-direction: column; min-width: 0; }

.sidebar-brand-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--sidebar-text);
    line-height: 1.25;
    letter-spacing: -0.2px;
    white-space: nowrap;
}

.sidebar-brand-name span {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-brand-tagline {
    font-size: 10.5px;
    color: var(--sidebar-text-muted);
    font-weight: 400;
    white-space: nowrap;
    letter-spacing: 0.2px;
}

/* ============================================================
   Sidebar — AI Status Strip
   ============================================================ */
.sidebar-ai-strip {
    margin: 14px 14px 0;
    padding: 10px 14px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.ai-strip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    flex-shrink: 0;
    box-shadow: 0 0 0 0 rgba(16,185,129,0.4);
    animation: ai-pulse 2s infinite;
}

@keyframes ai-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(16,185,129,0.4); }
    70%  { box-shadow: 0 0 0 6px rgba(16,185,129,0); }
    100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

.ai-strip-text {
    flex: 1;
    min-width: 0;
}

.ai-strip-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    line-height: 1.2;
}

.ai-strip-status {
    font-size: 10.5px;
    color: var(--sidebar-text-muted);
}

/* ============================================================
   Sidebar — Navigation
   ============================================================ */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px 10px 10px;
}

.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(124,58,237,0.15);
    border-radius: var(--radius-full);
}

.sidebar-section { margin-bottom: 6px; }

.sidebar-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--sidebar-section-text);
    padding: 10px 14px 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--sidebar-border);
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu-item { margin-bottom: 1px; }

.sidebar-menu-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--sidebar-text-muted);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    text-decoration: none;
    border: 1px solid transparent;
}

.sidebar-menu-link:hover {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-text);
    border-color: var(--border-color);
}

.sidebar-menu-link.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    border-color: rgba(124,58,237,0.12);
    font-weight: 600;
}

.sidebar-menu-link.active::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 22px;
    background: var(--gradient-primary);
    border-radius: 0 3px 3px 0;
    box-shadow: 2px 0 8px rgba(124,58,237,0.4);
}

.sidebar-menu-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
    transition: all var(--transition);
    background: transparent;
}

.sidebar-menu-link:hover .sidebar-menu-icon {
    background: rgba(124,58,237,0.1);
    color: var(--primary);
}

.sidebar-menu-link.active .sidebar-menu-icon {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 3px 10px rgba(124,58,237,0.35);
}

.sidebar-menu-text { flex: 1; white-space: nowrap; }

.sidebar-menu-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    color: white;
    line-height: 1.4;
    box-shadow: 0 2px 6px rgba(124,58,237,0.3);
}

.sidebar-menu-badge.badge-warning {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    box-shadow: 0 2px 6px rgba(245,158,11,0.3);
}

.sidebar-menu-badge.badge-danger {
    background: linear-gradient(135deg, #ef4444, #f87171);
    box-shadow: 0 2px 6px rgba(239,68,68,0.3);
}

.sidebar-menu-arrow {
    font-size: 11px;
    transition: transform var(--transition);
    color: var(--sidebar-section-text);
}

.sidebar-menu-item.open > .sidebar-menu-link .sidebar-menu-arrow {
    transform: rotate(90deg);
    color: var(--primary);
}

/* Submenu */
.sidebar-submenu {
    list-style: none;
    padding: 3px 0 3px 46px;
    margin: 0;
    display: none;
}

.sidebar-menu-item.open > .sidebar-submenu { display: block; }

.sidebar-submenu-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    font-size: 13px;
    color: var(--sidebar-text-muted);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    position: relative;
}

.sidebar-submenu-link::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    border: 1.5px solid currentColor;
    flex-shrink: 0;
    opacity: 0.5;
}

.sidebar-submenu-link:hover,
.sidebar-submenu-link.active {
    color: var(--primary);
    background: var(--sidebar-hover-bg);
}

.sidebar-submenu-link.active::before {
    background: var(--primary);
    border-color: var(--primary);
    opacity: 1;
}

/* ============================================================
   Sidebar — Status Dots
   ============================================================ */
.sidebar-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.sidebar-status-dot.bg-success {
    background-color: #10b981;
    box-shadow: 0 0 6px rgba(16,185,129,0.5);
    animation: pulse-dot 2s infinite;
}

.sidebar-status-dot.bg-warning {
    background-color: #f59e0b;
    box-shadow: 0 0 6px rgba(245,158,11,0.5);
}

.sidebar-status-dot.bg-danger {
    background-color: #ef4444;
    box-shadow: 0 0 6px rgba(239,68,68,0.5);
}

.sidebar-status-dot.bg-secondary { background-color: #6b7280; }

@keyframes pulse-dot {
    0%   { box-shadow: 0 0 0 0 rgba(16,185,129,0.45); }
    70%  { box-shadow: 0 0 0 5px rgba(16,185,129,0); }
    100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

/* ============================================================
   Sidebar — Footer
   ============================================================ */
.sidebar-footer {
    padding: 14px 10px;
    border-top: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.sidebar-footer-user {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    background: var(--bg-hover);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.sidebar-footer-user:hover {
    background: var(--sidebar-hover-bg);
}

.sidebar-footer-avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(124,58,237,0.35);
}

.sidebar-footer-info { flex: 1; min-width: 0; }

.sidebar-footer-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--sidebar-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-footer-role {
    font-size: 11px;
    color: var(--sidebar-text-muted);
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    background: transparent;
    border: 1px solid var(--sidebar-border);
}

.theme-toggle:hover { background: var(--sidebar-hover-bg); border-color: rgba(124,58,237,0.2); }

.theme-toggle-icon {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    background: var(--gradient-primary-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--primary);
    flex-shrink: 0;
}

.theme-toggle-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--sidebar-text-muted);
    flex: 1;
}

/* ============================================================
   Header Styles
   ============================================================ */
.header-toggle {
    display: none;
    width: 38px;
    height: 38px;
    border: none;
    background: var(--bg-hover);
    border-radius: var(--radius);
    color: var(--text-secondary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all var(--transition);
    flex-shrink: 0;
}

.header-toggle:hover {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(124,58,237,0.35);
}

/* Breadcrumb / Title */
.header-title-section { display: flex; flex-direction: column; }

.header-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.25;
    letter-spacing: -0.2px;
}

.header-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

/* Search Bar */
.header-search {
    flex: 1;
    max-width: 360px;
    position: relative;
}

.header-search-input {
    width: 100%;
    height: 40px;
    padding: 0 16px 0 42px;
    background: var(--bg-hover);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-full);
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    color: var(--text-primary);
    transition: all var(--transition);
    outline: none;
}

.header-search-input::placeholder { color: var(--text-muted); }

.header-search-input:focus {
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(124,58,237,0.1);
}

.header-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

/* Header Right */
.header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Icon Buttons (notification, settings) */
.header-icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 18px;
    text-decoration: none;
}

.header-icon-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--bg-hover);
}

.header-icon-btn .notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    background: linear-gradient(135deg, #ef4444, #f87171);
    color: white;
    font-size: 9.5px;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(239,68,68,0.4);
    border: 2px solid var(--bg-header);
}

/* Language selector */
.header-lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 14px;
    background: transparent;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius);
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.header-lang-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.header-lang-btn .bi-chevron-down {
    font-size: 10px;
    opacity: 0.6;
}

/* User Profile */
.header-user-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 40px;
    padding: 0 6px 0 6px;
    background: transparent;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.header-user-btn:hover {
    border-color: var(--primary);
    background: rgba(124,58,237,0.04);
}

.header-user-avatar {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(124,58,237,0.35);
}

.header-user-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    padding-right: 4px;
}

.header-user-chevron {
    font-size: 11px;
    color: var(--text-muted);
    padding-right: 6px;
}

/* Header Dropdown Menus */
.header-dropdown-menu {
    min-width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    --bs-dropdown-bg: var(--bg-card);
    --bs-dropdown-border-color: var(--border-color);
    --bs-dropdown-color: var(--text-primary);
    --bs-dropdown-link-color: var(--text-secondary);
    --bs-dropdown-link-hover-bg: var(--bg-hover);
    --bs-dropdown-link-hover-color: var(--text-primary);
    --bs-dropdown-link-active-bg: rgba(124,58,237,0.1);
    --bs-dropdown-link-active-color: var(--primary);
    --bs-dropdown-padding-x: 0;
    --bs-dropdown-padding-y: 0;
    --bs-dropdown-border-radius: var(--radius-md);
    --bs-dropdown-box-shadow: none;
}

.header-dropdown-header {
    padding: 10px 14px 8px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 4px;
}

.header-dropdown-header-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-dropdown-header-email {
    font-size: 12px;
    color: var(--text-muted);
}

.header-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    font-size: 13.5px;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    cursor: pointer;
    text-decoration: none;
    width: 100%;
    border: none;
    background: none;
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
}

.header-dropdown-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.header-dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.header-dropdown-item.active,
.header-dropdown-item.active:hover {
    background: var(--bg-hover);
    color: var(--primary);
    font-weight: 500;
}

.header-dropdown-item.text-danger { color: #ef4444; }
.header-dropdown-item.text-danger:hover {
    background: rgba(239,68,68,0.08);
    color: #ef4444;
}

.dropdown-divider-custom {
    height: 1px;
    background: var(--border-light);
    margin: 4px 8px;
}

/* Notif Dropdown */
.notif-dropdown-menu {
    min-width: 320px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    padding: 0;
    overflow: hidden;
    --bs-dropdown-bg: var(--bg-card);
    --bs-dropdown-border-color: var(--border-color);
    --bs-dropdown-color: var(--text-primary);
}

.notif-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--border-light);
}

.notif-dropdown-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.notif-mark-all {
    font-size: 12px;
    color: var(--primary);
    cursor: pointer;
    font-weight: 500;
    background: none;
    border: none;
    padding: 0;
    font-family: 'Poppins', sans-serif;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition);
    cursor: pointer;
}

.notif-item:last-child { border-bottom: none; }

.notif-item:hover { background: var(--bg-hover); }

.notif-item.unread { background: #f9fafb; }

.notif-item-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.notif-item-body { flex: 1; min-width: 0; }

.notif-item-text {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.45;
    margin-bottom: 2px;
}

.notif-item-time {
    font-size: 11.5px;
    color: var(--text-muted);
}

.notif-unread-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
    margin-top: 6px;
}

.notif-view-all {
    display: block;
    text-align: center;
    padding: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    border-top: 1px solid var(--border-light);
    transition: background var(--transition);
}

.notif-view-all:hover { background: var(--bg-hover); }

/* ============================================================
   Page Header
   ============================================================ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header-left { display: flex; flex-direction: column; gap: 3px; }

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.3px;
}

.page-subtitle {
    font-size: 13.5px;
    color: var(--text-muted);
    margin: 0;
}

.page-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.page-breadcrumb a { color: var(--text-muted); }
.page-breadcrumb a:hover { color: var(--primary); }
.page-breadcrumb .separator { opacity: 0.5; }

.page-header-right { display: flex; align-items: center; gap: 10px; }

/* ============================================================
   Stats Cards
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-card);
    transition: all var(--transition-slow);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-color);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    opacity: 0;
    transition: opacity var(--transition);
}

.stat-card:hover::before { opacity: 1; }
.stat-card.primary::before { background: var(--gradient-primary); }
.stat-card.teal::before    { background: var(--gradient-teal); }
.stat-card.coral::before   { background: var(--gradient-coral); }
.stat-card.cyan::before    { background: var(--gradient-cyan); }
.stat-card.pink::before    { background: var(--gradient-pink); }
.stat-card.emerald::before { background: var(--gradient-emerald); }
.stat-card.amber::before   { background: var(--gradient-amber); }

.stat-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.stat-card-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
}

.stat-card-icon.primary { background: var(--gradient-primary); box-shadow: 0 4px 12px rgba(124,58,237,0.3); }
.stat-card-icon.teal    { background: var(--gradient-teal);    box-shadow: 0 4px 12px rgba(20,184,166,0.3); }
.stat-card-icon.coral   { background: var(--gradient-coral);   box-shadow: 0 4px 12px rgba(249,115,22,0.3); }
.stat-card-icon.cyan    { background: var(--gradient-cyan);    box-shadow: 0 4px 12px rgba(6,182,212,0.3); }
.stat-card-icon.pink    { background: var(--gradient-pink);    box-shadow: 0 4px 12px rgba(236,72,153,0.3); }
.stat-card-icon.emerald { background: var(--gradient-emerald); box-shadow: 0 4px 12px rgba(16,185,129,0.3); }
.stat-card-icon.amber   { background: var(--gradient-amber);   box-shadow: 0 4px 12px rgba(245,158,11,0.3); }

.stat-card-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    font-size: 11.5px;
    font-weight: 600;
}

.stat-card-change.positive { background: rgba(16,185,129,0.1); color: #10b981; }
.stat-card-change.negative { background: rgba(239,68,68,0.1);  color: #ef4444; }
.stat-card-change.neutral  { background: rgba(100,116,139,0.1); color: #64748b; }

.stat-card-value {
    font-size: 30px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.15;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.stat-card-label {
    font-size: 13.5px;
    color: var(--text-muted);
    margin-bottom: 14px;
    font-weight: 500;
}

.stat-card-footer {
    font-size: 12.5px;
    color: var(--text-secondary);
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

/* ============================================================
   Charts Grid
   ============================================================ */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.chart-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
}

.chart-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 22px;
}

.chart-card-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chart-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
}

.chart-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.chart-card-subtitle {
    font-size: 12.5px;
    color: var(--text-muted);
    margin: 0;
}

/* ============================================================
   Activity Grid
   ============================================================ */
.activity-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.activity-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
}

.activity-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.activity-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ============================================================
   Badge / Status Chips
   ============================================================ */
.badge-new        { background: rgba(124,58,237,0.1); color: var(--primary); }
.badge-processing { background: rgba(245,158,11,0.1); color: var(--accent-amber); }
.badge-actioned   { background: rgba(16,185,129,0.1); color: var(--accent-emerald); }
.badge-waiting    { background: rgba(6,182,212,0.1);  color: var(--accent-cyan); }
.badge-escalated  { background: rgba(239,68,68,0.1);  color: #ef4444; }
.badge-closed     { background: rgba(100,116,139,0.1);color: var(--secondary); }
.badge-normal     { background: rgba(6,182,212,0.1);  color: var(--accent-cyan); }

/* ============================================================
   Form Controls
   ============================================================ */
.form-control {
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
    font-size: 13.5px;
    padding: 10px 14px;
    transition: all var(--transition);
}

.form-control:focus {
    background: var(--bg-card);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124,58,237,0.12);
    outline: none;
    color: var(--text-primary);
}

.form-control::placeholder { color: var(--text-muted); }

.form-label {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-select {
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
    font-size: 13.5px;
    padding: 10px 14px;
}

.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124,58,237,0.12);
    outline: none;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    border-radius: var(--radius);
    transition: all var(--transition);
    font-size: 13.5px;
}

.btn-primary {
    background: var(--gradient-primary);
    border: none;
    color: white;
    box-shadow: 0 4px 14px rgba(124,58,237,0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
    box-shadow: 0 6px 18px rgba(124,58,237,0.4);
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--primary);
    border: 1.5px solid var(--primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 14px rgba(124,58,237,0.3);
}

.btn-primary-gradient {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius);
    font-size: 13.5px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 4px 14px rgba(124,58,237,0.3);
    font-family: 'Poppins', sans-serif;
    text-decoration: none;
}

.btn-primary-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124,58,237,0.45);
    color: white;
}

/* ============================================================
   Tables
   ============================================================ */
.table { color: var(--text-primary); }

.table thead th {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 16px;
    background: var(--bg-body);
}

.table tbody td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
    font-size: 13.5px;
}

.table tbody tr:hover { background: var(--bg-hover); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1400px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1200px) {
    .charts-grid   { grid-template-columns: 1fr; }
    .activity-grid { grid-template-columns: 1fr; }
}

@media (max-width: 992px) {
    .admin-sidebar { transform: translateX(-100%); box-shadow: none; }
    .admin-sidebar.open { transform: translateX(0); box-shadow: 8px 0 40px rgba(0,0,0,0.2); }
    .admin-main { margin-left: 0; }
    .header-toggle { display: flex; }
    .header-search { max-width: 220px; }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(13, 11, 26, 0.55);
        backdrop-filter: blur(2px);
        z-index: 999;
    }

    .admin-sidebar.open ~ .sidebar-overlay { display: block; }
}

@media (max-width: 768px) {
    .stats-grid { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .page-header-right { width: 100%; }
    .header-user-name { display: none; }
    .admin-content { padding: 16px; }
    .header-search { display: none; }
}

@media (max-width: 576px) {
    .header-lang-btn span { display: none; }
}

/* ============================================================
   Animations
   ============================================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-16px); }
    to   { opacity: 1; transform: translateX(0); }
}

.animate-fade-in { animation: fadeIn 0.35s ease forwards; }
.animate-slide-in { animation: slideIn 0.35s ease forwards; }

.stat-card:nth-child(1) { animation-delay: 0.04s; }
.stat-card:nth-child(2) { animation-delay: 0.08s; }
.stat-card:nth-child(3) { animation-delay: 0.12s; }
.stat-card:nth-child(4) { animation-delay: 0.16s; }

/* ============================================================
   Utility Classes
   ============================================================ */
.text-primary-custom { color: var(--primary) !important; }
.text-muted-custom   { color: var(--text-muted) !important; }
.text-success        { color: var(--accent-emerald) !important; }
.text-danger         { color: #ef4444 !important; }
.text-warning        { color: var(--accent-amber) !important; }

.bg-primary-light  { background: #f1f3f5 !important; }
.bg-success-light  { background: rgba(16,185,129,0.1) !important; }
.bg-danger-light   { background: rgba(239,68,68,0.1) !important; }
.bg-warning-light  { background: rgba(245,158,11,0.1) !important; }

.fw-500 { font-weight: 500 !important; }
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }

.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-xl { border-radius: var(--radius-xl) !important; }

/* Dark mode select/input fix */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background-color: var(--bg-input);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .table thead th {
    background: rgba(255,255,255,0.03);
}

/* Date Picker Button */
.date-picker-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition);
    font-family: 'Poppins', sans-serif;
}

.date-picker-btn:hover { border-color: var(--primary); }
.date-picker-btn i     { color: var(--text-muted); }
.modal{z-index: 99999;}