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

/* =====================================================
   METRICS MART — DEEP SPACE DESIGN SYSTEM v3.0
   ===================================================== */

:root {
    /* === Core Brand Colors === */
    --primary: #818cf8;
    --primary-dark: #6366f1;
    --primary-glow: rgba(129, 140, 248, 0.35);
    --accent: #f472b6;
    --accent-glow: rgba(244, 114, 182, 0.3);
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;

    /* === Deep Space Background Layers === */
    --bg-void: #04050f;
    --bg-deep: #080c1a;
    --bg-surface: #0d1226;
    --bg-elevated: #111827;

    /* === Glass System === */
    --glass-1: rgba(255, 255, 255, 0.03);
    --glass-2: rgba(255, 255, 255, 0.055);
    --glass-3: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.09);
    --glass-border-active: rgba(129, 140, 248, 0.5);
    --glass-glow: 0 0 30px rgba(129, 140, 248, 0.08);

    /* === Text Hierarchy === */
    --text-1: #f0f3ff;
    --text-2: #a8b4cc;
    --text-3: #5c6b82;

    /* === Component Tokens === */
    --sidebar-w: 270px;
    --topbar-h: 72px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.4);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px rgba(129,140,248,0.06);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);

    /* === Sidebar & Card Backgrounds === */
    --sidebar-bg: rgba(12, 16, 36, 0.95);
    --card-bg: rgba(14, 20, 42, 0.7);
    --input-bg: rgba(255, 255, 255, 0.05);
    --input-bg-focus: rgba(255, 255, 255, 0.08);

    /* === Department Themes === */
    --it-primary: #818cf8;
    --it-glow: rgba(129, 140, 248, 0.4);
    --sales-primary: #34d399;
    --sales-glow: rgba(52, 211, 153, 0.4);
    --marketing-primary: #fb923c;
    --marketing-glow: rgba(251, 146, 60, 0.4);

    /* Department active vars (defaults to IT) */
    --primary-color: var(--it-primary);
    --dept-glow: var(--it-glow);
    --secondary-color: var(--it-primary);
}

/* === Light Theme Overrides === */
.light-theme {
    /* === Core Brand Colors (Slightly adjusted for contrast if needed) === */
    --primary-dark: #4f46e5;
    
    /* === Background Layers (Bright) === */
    --bg-void: #f8fafc;
    --bg-deep: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-elevated: #ffffff;

    /* === Glass System for Light Theme === */
    --glass-1: rgba(0, 0, 0, 0.03);
    --glass-2: rgba(0, 0, 0, 0.05);
    --glass-3: rgba(0, 0, 0, 0.08);
    --glass-border: rgba(0, 0, 0, 0.1);
    --glass-border-active: rgba(99, 102, 241, 0.5);
    --glass-glow: 0 0 30px rgba(99, 102, 241, 0.1);

    /* === Text Hierarchy === */
    --text-1: #0f172a;
    --text-2: #334155;
    --text-3: #64748b;

    /* === Component Backgrounds === */
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --input-bg: #f8fafc;
    --input-bg-focus: #f1f5f9;
    
    /* Shadow adjustments for light mode to be softer but visible */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.1), 0 0 40px rgba(99, 102, 241, 0.05);
}

/* === Theme Transition & Global Background Transition === */
html, body, .sidebar, .top-bar, .section-card, .stat-item, input, select, textarea {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* === Department Overrides === */
.dept-Sales   { --primary-color: var(--sales-primary);     --dept-glow: var(--sales-glow); }
.dept-Marketing { --primary-color: var(--marketing-primary); --dept-glow: var(--marketing-glow); }
.dept-it { --primary-color: var(--it-primary); --dept-glow: var(--it-glow); }

/* =====================================================
   BASE RESET & TYPOGRAPHY
   ===================================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body { 
    overflow-x: hidden; 
    width: 100%; 
}
html  { scroll-behavior: smooth; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-void);
    color: var(--text-1);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

h1, h2, h3, h4, h5 {
    font-family: 'Outfit', sans-serif;
    line-height: 1.2;
}

a { text-decoration: none; }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--glass-3); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* =====================================================
   ANIMATIONS
   ===================================================== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-25px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 20px var(--primary-glow); }
    50%       { box-shadow: 0 0 40px var(--primary-glow), 0 0 80px var(--primary-glow); }
}
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-6px); }
}
@keyframes orb-drift {
    0%   { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(30px, -20px) scale(1.05); }
    66%  { transform: translate(-15px, 15px) scale(0.97); }
    100% { transform: translate(0, 0) scale(1); }
}

.animate-fade  { animation: fadeInUp 0.6s ease-out both; }
.animate-slide { animation: slideInLeft 0.5s ease-out both; }

/* =====================================================
   APP LAYOUT
   ===================================================== */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
    background:
        radial-gradient(ellipse 60% 50% at 5% 5%, rgba(99,102,241,0.12) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 95% 90%, rgba(244,114,182,0.08) 0%, transparent 60%),
        radial-gradient(ellipse 40% 60% at 50% 50%, rgba(129,140,248,0.03) 0%, transparent 70%),
        var(--bg-void);
}

/* =====================================================
   SIDEBAR
   ===================================================== */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 100;
    box-shadow: 4px 0 30px rgba(0,0,0,0.3);
    flex-shrink: 0;
}

.sidebar-header {
    padding: 2rem 1.75rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.sidebar-header i {
    font-size: 1.6rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.sidebar-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-1);
    letter-spacing: -0.02em;
}

.sidebar-close-btn {
    display: none;
    background: transparent !important;
    border: none !important;
    color: var(--text-2);
    font-size: 1.5rem;
    cursor: pointer;
    margin-left: auto;
    transition: var(--transition);
}

.sidebar-close-btn:hover {
    color: var(--danger);
}

.nav-menu {
    flex: 1;
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-2);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    text-decoration: none;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    transition: var(--transition);
}

.nav-item:hover {
    background: var(--glass-2);
    color: var(--text-1);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(129,140,248,0.2), rgba(244,114,182,0.1));
    color: var(--primary);
    border: 1px solid rgba(129,140,248,0.2);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -1px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: linear-gradient(to bottom, var(--primary), var(--accent));
    border-radius: 0 4px 4px 0;
}

.nav-label {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    padding: 0 1rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.nav-label:first-child { margin-top: 0.5rem; }

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--glass-border);
}

.sidebar-footer .nav-item {
    color: var(--danger);
}

/* =====================================================
   MAIN CONTENT
   ===================================================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* =====================================================
   TOP BAR
   ===================================================== */
.top-bar {
    height: var(--topbar-h);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(8, 12, 26, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 80;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 0.6rem 1.25rem;
    flex: 1;
    max-width: 420px;
    transition: var(--transition);
}

.search-bar:focus-within {
    border-color: var(--glass-border-active);
    background: var(--input-bg-focus);
    box-shadow: 0 0 0 3px rgba(129,140,248,0.12);
}

.search-bar input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-1);
    font-size: 0.9rem;
    flex: 1;
    padding: 0;
}

.search-bar input::placeholder { color: var(--text-3); }

.theme-toggle {
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-2);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: var(--input-bg-focus);
    color: var(--primary-color);
    box-shadow: var(--glass-glow);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
}

.user-info {
    text-align: right;
}

.user-info strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-1);
}

.user-info small {
    font-size: 0.75rem;
    color: var(--text-3);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-dark), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 0 15px var(--primary-glow);
    border: 2px solid rgba(129,140,248,0.3);
    flex-shrink: 0;
}

/* =====================================================
   CONTENT BODY
   ===================================================== */
.content-body {
    padding: 2rem;
    flex: 1;
}

/* =====================================================
   WELCOME CARD
   ===================================================== */
.welcome-card {
    background: linear-gradient(135deg, rgba(99,102,241,0.15) 0%, rgba(244,114,182,0.08) 100%);
    border: 1px solid rgba(129,140,248,0.25);
    border-radius: var(--radius-xl);
    padding: 2.25rem 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.welcome-card::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(129,140,248,0.15), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.welcome-text h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-1);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.welcome-text p {
    color: var(--text-2);
    font-size: 0.95rem;
}

.welcome-text small {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    color: var(--text-3);
    font-size: 0.8rem;
}

.welcome-stats {
    display: flex;
    gap: 2rem;
}

.stat-item { text-align: center; }

.stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-1), var(--text-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    margin-bottom: 0.3rem;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* =====================================================
   DASHBOARD GRID
   ===================================================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
}

.full-width { grid-column: span 12; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }

/* =====================================================
   SECTION CARDS
   ===================================================== */
.section-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.section-card:hover {
    border-color: rgba(255,255,255,0.13);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.section-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-1);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    letter-spacing: -0.01em;
}

.section-header h3 i { opacity: 0.85; }

/* =====================================================
   TABLES
   ===================================================== */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

thead tr {
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid var(--glass-border);
}

thead th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-3);
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: var(--transition);
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--glass-1); }

tbody td {
    padding: 0.875rem 1rem;
    color: var(--text-2);
    vertical-align: middle;
}

tbody td strong { color: var(--text-1); font-weight: 600; }
tbody td small { font-size: 0.78rem; color: var(--text-3); }

/* =====================================================
   STATUS BADGES
   ===================================================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: capitalize;
    white-space: nowrap;
}

.status-completed, .status-visited, .status-approved, .status-deployed {
    background: rgba(52, 211, 153, 0.12);
    color: var(--success);
    border: 1px solid rgba(52, 211, 153, 0.2);
}

.status-pending, .status-developing, .status-scheduled {
    background: rgba(251, 191, 36, 0.12);
    color: var(--warning);
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.status-cancelled, .status-rejected, .status-testing {
    background: rgba(248, 113, 113, 0.12);
    color: var(--danger);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.status-late {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.status-halfday {
    background: rgba(139, 92, 246, 0.12);
    color: #8b5cf6;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

/* =====================================================
   UNIVERSAL FORM INPUTS
   ===================================================== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-2);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* *** Universal Input Styling — covers ALL input types *** */
input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="datetime-local"],
input[type="tel"],
input[type="number"],
input[type="search"],
textarea,
select {
    background: var(--input-bg) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: var(--radius-md) !important;
    padding: 0.825rem 1.1rem !important;
    color: var(--text-1) !important;
    width: 100%;
    outline: none;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

input:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
select:focus,
textarea:focus {
    border-color: var(--glass-border-active) !important;
    background: var(--input-bg-focus) !important;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.12), inset 0 1px 0 rgba(255,255,255,0.05) !important;
}

input::placeholder,
textarea::placeholder { color: var(--text-3) !important; }

select option {
    background: var(--bg-surface) !important;
    color: var(--text-1) !important;
}

/* With icon inside wrapper */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 1.1rem;
    color: var(--text-3);
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 1;
    transition: var(--transition);
}

.input-wrapper input,
.input-wrapper select {
    padding-left: 2.8rem !important;
}

.input-wrapper:focus-within i { color: var(--primary); }

/* Grid Layouts */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }

/* Inline form grid */
.inline-form {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    align-items: end;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--primary-dark), var(--accent));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.85rem 1.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(99,102,241,0.35);
    letter-spacing: 0.01em;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99,102,241,0.55);
    filter: brightness(1.1);
}

.btn-primary:active { transform: translateY(0); }

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--glass-1);
    border: 1px solid var(--glass-border);
    color: var(--text-2);
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}

.action-btn:hover {
    background: var(--glass-3);
    color: var(--danger);
    border-color: rgba(248, 113, 113, 0.3);
}

/* =====================================================
   AUTHENTICATION PAGES — DEEP SPACE STYLE
   ===================================================== */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    background-color: var(--bg-void);
    background-image:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(99, 102, 241, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse 60% 50% at 80% 85%, rgba(244, 114, 182, 0.12) 0%, transparent 55%),
        radial-gradient(ellipse 40% 60% at 60% 30%, rgba(129, 140, 248, 0.06) 0%, transparent 60%);
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Floating blobs */
.login-body::before,
.login-body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(80px);
    animation: orb-drift 18s ease-in-out infinite alternate;
}

.login-body::before {
    width: 500px; height: 500px;
    top: -150px; left: -150px;
    background: rgba(99, 102, 241, 0.15);
}

.login-body::after {
    width: 400px; height: 400px;
    bottom: -100px; right: -100px;
    background: rgba(244, 114, 182, 0.12);
    animation-duration: 22s;
    animation-direction: alternate-reverse;
}

.login-container {
    width: 100%;
    max-width: 460px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: rgba(12, 17, 36, 0.82);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-xl);
    padding: 2.5rem 2.5rem;
    box-shadow:
        0 25px 50px rgba(0,0,0,0.5),
        0 0 0 1px rgba(255,255,255,0.04) inset,
        0 1px 0 rgba(255,255,255,0.08) inset;
}

/* Top shine line */
.login-card::before {
    content: '';
    position: absolute;
    top: 0; left: 15%; right: 15%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(129,140,248,0.6), transparent);
    border-radius: 99px;
    pointer-events: none;
}

.login-card { position: relative; }

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-header .logo-icon {
    display: block;
    font-size: 3.25rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 20px rgba(129,140,248,0.5));
    animation: float 3s ease-in-out infinite;
}

.login-header h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #ffffff 30%, rgba(200,210,255,0.8));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-header p {
    color: var(--text-3);
    font-size: 0.9rem;
}

/* Auth form spacing */
.login-form .form-group {
    margin-bottom: 1.25rem;
}

/* Override label in auth context */
.login-form .form-group label {
    color: var(--text-2);
    font-size: 0.78rem;
}

/* Override input in auth context — larger radius, glow */
.login-form .input-wrapper input,
.login-form .input-wrapper select {
    background: rgba(255,255,255,0.05) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    border-radius: var(--radius-md) !important;
    padding: 0.9rem 1rem 0.9rem 2.9rem !important;
    font-size: 0.9rem !important;
}

.login-form .input-wrapper input:focus,
.login-form .input-wrapper select:focus {
    border-color: rgba(129,140,248,0.6) !important;
    background: rgba(255,255,255,0.07) !important;
    box-shadow: 0 0 0 3px rgba(129,140,248,0.15), 0 4px 15px rgba(0,0,0,0.2) !important;
}

/* Full-width login button */
.login-form .btn-primary {
    width: 100%;
    padding: 1rem;
    font-size: 0.95rem;
    margin-top: 0.5rem;
    border-radius: var(--radius-md);
    box-shadow: 0 6px 25px rgba(99,102,241,0.45), 0 2px 8px rgba(0,0,0,0.3);
}

.login-footer {
    text-align: center;
    margin-top: 1.75rem;
    color: var(--text-3);
    font-size: 0.875rem;
}

.login-footer a {
    color: var(--primary);
    font-weight: 600;
    transition: var(--transition);
}

.login-footer a:hover { color: white; }

/* Alerts */
.alert {
    padding: 0.9rem 1.1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    border-width: 1px;
    border-style: solid;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    line-height: 1.5;
}

.alert-error {
    background: rgba(248, 113, 113, 0.08);
    border-color: rgba(248, 113, 113, 0.2);
    color: var(--danger);
}

.alert-success {
    background: rgba(52, 211, 153, 0.08);
    border-color: rgba(52, 211, 153, 0.2);
    color: var(--success);
}

.alert-success a { color: inherit; text-decoration: underline; }

/* =====================================================
   LANDING PAGE — HERO
   ===================================================== */
.hero-section {
    text-align: center;
    max-width: 1050px;
    width: 100%;
    padding: 2rem;
}

.hero-header {
    margin-bottom: 4.5rem;
    animation: fadeInUp 0.8s ease-out both;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(129,140,248,0.12);
    border: 1px solid rgba(129,140,248,0.25);
    border-radius: 99px;
    padding: 0.35rem 1rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 1.75rem;
}

.hero-header h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    margin-bottom: 1.25rem;
    line-height: 1.05;
    background: linear-gradient(135deg, #ffffff 20%, rgba(200,210,255,0.75) 70%, rgba(244,114,182,0.8) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-header p {
    color: var(--text-2);
    font-size: 1.1rem;
    max-width: 550px;
    margin: 0 auto;
    line-height: 1.7;
}

.option-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    animation: fadeInUp 0.9s 0.15s ease-out both;
    text-align: left;
}

.option-card {
    background: rgba(12, 17, 38, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 3rem 2.5rem;
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: var(--text-1);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
}

.option-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
}

.option-card:hover {
    transform: translateY(-8px);
    border-color: rgba(129,140,248,0.3);
    box-shadow: 0 30px 70px rgba(0,0,0,0.5), 0 0 40px rgba(129,140,248,0.1);
}

.option-card .card-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(244,114,182,0.15));
    border: 1px solid rgba(129,140,248,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.option-card .card-icon i {
    font-size: 1.75rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.option-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.875rem;
    letter-spacing: -0.02em;
}

.option-card p {
    color: var(--text-2);
    font-size: 0.9rem;
    line-height: 1.65;
    margin-bottom: 2.5rem;
    flex: 1;
}

.auth-actions {
    display: flex;
    gap: 1rem;
    width: 100%;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--glass-border);
    color: var(--text-1);
    border-radius: var(--radius-md);
    padding: 0.825rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-ghost:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.15);
    transform: translateY(-1px);
}

.landing-footer {
    margin-top: 5rem;
    color: var(--text-3);
    font-size: 0.85rem;
    text-align: center;
    letter-spacing: 0.04em;
    animation: fadeInUp 1s 0.3s ease-out both;
}

/* =====================================================
   PROFILE MODULE
   ===================================================== */
.profile-card {
    max-width: 600px;
    margin: 0 auto;
}

.profile-avatar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--glass-border);
}

.profile-avatar-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.default-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-2);
    font-size: 3rem;
    color: var(--text-2);
}

.upload-btn {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 99px;
    color: var(--text-1);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.upload-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
/* Desktop & Large Tablet Display */
@media (max-width: 1200px) {
    :root { --sidebar-w: 240px; }
    .welcome-card { padding: 1.5rem; }
    .stat-value { font-size: 2rem; }
}

/* Tablet & Smaller Desktop Display */
@media (max-width: 1024px) {
    .col-4, .col-5, .col-6, .col-7, .col-8 { grid-column: span 12 !important; }
    .option-grid { grid-template-columns: 1fr; max-width: 500px; margin: 0 auto; }
    .welcome-stats { gap: 1rem; }
    .grid-3, .grid-4, .inline-form { grid-template-columns: repeat(2, 1fr) !important; }
}

/* Mobile Display */
@media (max-width: 768px) {
    .grid-2 { grid-template-columns: 1fr !important; }
    .grid-3, .grid-4, .inline-form { grid-template-columns: repeat(2, 1fr) !important; }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .section-header > div, .section-header form {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .stat-value { font-size: 2rem !important; }

    :root { 
        --sidebar-w: 280px;
        --topbar-h: 64px;
    }

    /* Mobile Sidebar Redesign */
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        animation: none !important;
        transform: translateX(-100%);
        height: 100vh;
        z-index: 1000;
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        width: var(--sidebar-w);
        box-shadow: 20px 0 50px rgba(0,0,0,0.6);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    /* Sidebar Overlay */
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
        z-index: 999;
        display: none;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

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

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

    /* Top Bar Mobile Layout */
    .top-bar {
        padding: 0 1rem;
        gap: 0.75rem;
    }

    .mobile-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: var(--glass-2);
        border: 1px solid var(--glass-border);
        border-radius: var(--radius-sm);
        color: var(--text-1);
        font-size: 1.2rem;
        cursor: pointer;
    }

    .search-bar {
        display: none; /* Hide search bar on small mobile or shrink it */
    }

    .user-info { display: none; } /* Hide text info on mobile */
    .user-profile { gap: 0.5rem; }

    /* Content Area Refinement */
    .content-body {
        padding: 1rem;
    }

    .welcome-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.5rem;
        text-align: left;
        gap: 1.5rem;
    }

    .welcome-stats {
        width: 100%;
        justify-content: space-between;
        background: rgba(255,255,255,0.03);
        padding: 1rem;
        border-radius: var(--radius-md);
    }

    .hero-header h1 { font-size: 2.25rem; }
    .hero-header p { font-size: 1rem; }
    
    /* Tables on Mobile */
    .table-container {
        margin: 0 -0.5rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    /* Auth Cards */
    .login-container {
        padding: 0;
    }
    .login-card {
        padding: 2rem 1.5rem;
        border-radius: var(--radius-lg);
    }
    .option-card {
        padding: 2rem 1.5rem;
    }
    .auth-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    .auth-actions .btn-primary, .auth-actions .btn-ghost {
        width: 100%;
    }
}

/* Small Mobile Display */
@media (max-width: 576px) {
    .grid-3, .grid-4, .inline-form { grid-template-columns: 1fr !important; }
    
    .grid-3 > [style], .grid-4 > [style], .inline-form > [style] {
        grid-column: 1 / -1 !important;
    }
    
    .grid-4 > div[style] {
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
    }
}

/* UI Helper Classes */
.mobile-toggle { display: none; }

/* =====================================================
   CRM AI CHATBOT MODULE
   ===================================================== */
#crm-chatbot-trigger {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4), 0 0 20px var(--primary-glow);
    z-index: 9999;
    transition: var(--transition);
    animation: pulse-glow 3s infinite;
}

#crm-chatbot-trigger i {
    color: white;
    font-size: 1.5rem;
}

#crm-chatbot-trigger:hover {
    transform: scale(1.1) rotate(5deg);
}

#crm-chatbot-container {
    position: fixed;
    bottom: 95px;
    right: 25px;
    width: 380px;
    height: 520px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    display: flex;
    flex-direction: column;
    z-index: 9998;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: var(--transition);
    overflow: hidden;
}

#crm-chatbot-container.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.chat-header {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(90deg, rgba(129,140,248,0.1), rgba(244,114,182,0.1));
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.bot-avatar {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

.bot-info h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
}

.bot-info span {
    font-size: 0.7rem;
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 4px;
}

.bot-info span::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    max-width: 85%;
    padding: 0.8rem 1rem;
    border-radius: 15px;
    font-size: 0.85rem;
    line-height: 1.5;
    animation: fadeInUp 0.3s ease;
}

.message.bot {
    background: rgba(255,255,255,0.06);
    color: var(--text-1);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
    border: 1px solid var(--glass-border);
}

.message.user {
    background: var(--primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.chat-input-area {
    padding: 1.2rem;
    border-top: 1px solid var(--glass-border);
}

.chat-input-wrapper {
    position: relative;
    display: flex;
    gap: 8px;
}

.chat-input-wrapper input {
    margin: 0 !important;
    padding-right: 45px !important;
}

.chat-send-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 35px;
    height: 35px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: var(--transition);
}

.chat-send-btn:hover {
    background: var(--accent);
}

/* Scrollbar for chat */
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); }

@keyframes pulse-glow {
    0% { box-shadow: 0 0 0 0 rgba(129, 140, 248, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(129, 140, 248, 0); }
    100% { box-shadow: 0 0 0 0 rgba(129, 140, 248, 0); }
}

@media (max-width: 480px) {
    #crm-chatbot-container {
        width: calc(100vw - 40px);
        height: 70vh;
        right: 20px;
        bottom: 85px;
    }
}

/* Typing Indicator Animation */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px 15px;
    background: rgba(255,255,255,0.06);
    border-radius: 15px;
    width: fit-content;
    border-bottom-left-radius: 2px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--text-3);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}
