/* ==========================================================================
   Classbit CMS — Main Stylesheet
   Counselling Management System
   Dark Modern UI with Glassmorphism
   ========================================================================== */

/* ─── CSS Custom Properties ─────────────────────────────────────────────── */
:root {
    /* Brand Colors */
    --brand-primary:     #6366f1;
    --brand-primary-rgb: 99, 102, 241;
    --brand-secondary:   #8b5cf6;
    --brand-accent:      #06b6d4;

    /* Gradient Palette */
    --gradient-1: linear-gradient(135deg, #6366f1, #8b5cf6);
    --gradient-2: linear-gradient(135deg, #06b6d4, #0891b2);
    --gradient-3: linear-gradient(135deg, #10b981, #059669);
    --gradient-4: linear-gradient(135deg, #f59e0b, #d97706);
    --gradient-5: linear-gradient(135deg, #ec4899, #db2777);
    --gradient-6: linear-gradient(135deg, #3b82f6, #2563eb);

    /* Dark Theme Base */
    --bg-body:      #0b0f19;
    --bg-surface:   #111827;
    --bg-card:      rgba(17, 24, 39, 0.8);
    --bg-sidebar:   #0f1629;
    --bg-navbar:    rgba(11, 15, 25, 0.85);
    --bg-input:     rgba(30, 41, 59, 0.8);

    /* Borders */
    --border-color:       rgba(99, 102, 241, 0.15);
    --border-color-light: rgba(255, 255, 255, 0.06);

    /* Text */
    --text-primary:   #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted:     #8b9dc3;

    /* Sidebar */
    --sidebar-width:   260px;

    /* Shadows */
    --shadow-sm:  0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md:  0 4px 6px rgba(0,0,0,0.3), 0 2px 4px rgba(0,0,0,0.2);
    --shadow-lg:  0 10px 15px rgba(0,0,0,0.3), 0 4px 6px rgba(0,0,0,0.2);
    --shadow-xl:  0 20px 25px rgba(0,0,0,0.3), 0 10px 10px rgba(0,0,0,0.2);
    --shadow-glow: 0 0 20px rgba(var(--brand-primary-rgb), 0.3);

    /* Transitions */
    --transition-fast:   0.15s ease;
    --transition-base:   0.25s ease;
    --transition-slow:   0.4s cubic-bezier(0.4, 0, 0.2, 1);

    /* Font */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Bootstrap Dark Theme Overrides */
    --bs-primary:       #818cf8;
    --bs-primary-rgb:   129, 140, 248;
    --bs-info:          #22d3ee;
    --bs-info-rgb:      34, 211, 238;
    --bs-secondary:     #94a3b8;
    --bs-secondary-rgb: 148, 163, 184;
    --bs-success:       #4ade80;
    --bs-success-rgb:   74, 222, 128;
    --bs-danger:        #f87171;
    --bs-danger-rgb:    248, 113, 113;
    --bs-warning:       #fbbf24;
    --bs-warning-rgb:   251, 191, 36;
    --bs-body-color:    #f1f5f9;
    --bs-body-bg:       #0b0f19;
}

/* ─── Global Reset / Base ───────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-body);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
}

::selection {
    background: rgba(var(--brand-primary-rgb), 0.4);
    color: #fff;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(var(--brand-primary-rgb), 0.3);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--brand-primary-rgb), 0.5);
}

/* ─── Font Weights ──────────────────────────────────────────────────────── */
.fw-300 { font-weight: 300; }
.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }


/* ==========================================================================
   TOP NAVBAR
   ========================================================================== */

.navbar-top {
    background: var(--bg-navbar);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-color);
    height: 64px;
    z-index: 1050;
    box-shadow: var(--shadow-md);
}

.navbar-brand {
    text-decoration: none !important;
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: var(--gradient-1);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.brand-text {
    font-size: 1.15rem;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

/* Notifications */
.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color-light);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    padding: 0;
}
.btn-icon:hover {
    background: rgba(var(--brand-primary-rgb), 0.15);
    color: var(--brand-primary);
    border-color: rgba(var(--brand-primary-rgb), 0.3);
}

.badge-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid var(--bg-navbar);
}

/* User dropdown */
.user-dropdown {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color-light);
    border-radius: var(--radius-lg);
    padding: 6px 12px;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}
.user-dropdown:hover {
    background: rgba(var(--brand-primary-rgb), 0.08);
    border-color: rgba(var(--brand-primary-rgb), 0.2);
    color: var(--text-primary);
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--gradient-1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
    flex-shrink: 0;
}

.user-name {
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1.2;
}
.user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Dropdown */
.glass-dropdown {
    background: rgba(17, 24, 39, 0.95) !important;
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-xl) !important;
    padding: 8px !important;
}
.glass-dropdown .dropdown-item {
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}
.glass-dropdown .dropdown-item:hover {
    background: rgba(var(--brand-primary-rgb), 0.1);
    color: var(--text-primary);
}
.glass-dropdown .dropdown-item.text-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}
.glass-dropdown .dropdown-divider {
    border-color: var(--border-color-light);
}
.glass-dropdown .dropdown-header {
    padding: 8px 12px 4px;
}


/* ==========================================================================
   SIDEBAR
   ========================================================================== */

.app-wrapper {
    padding-top: 64px;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    height: calc(100vh - 64px);
    position: fixed;
    top: 64px;
    left: 0;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    overflow: hidden;
    transition: transform var(--transition-slow);
}

.sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color-light);
    display: none;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.brand-icon-sm {
    font-size: 1.2rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-close {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0;
    margin-left: auto;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0 10px;
}

.nav-divider {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    padding: 18px 14px 6px;
    text-transform: uppercase;
}

.nav-item {
    margin-bottom: 2px;
}

.nav-link-custom {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.nav-link-custom:hover {
    background: rgba(var(--brand-primary-rgb), 0.08);
    color: var(--text-primary);
}

.nav-item.active .nav-link-custom {
    background: rgba(var(--brand-primary-rgb), 0.12);
    color: var(--brand-primary);
    font-weight: 600;
}

.nav-icon {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.nav-badge {
    margin-left: auto;
    background: var(--gradient-5);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
}

.active-indicator {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--brand-primary);
    border-radius: 3px 0 0 3px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-color-light);
}

.user-avatar-sm {
    width: 32px;
    height: 32px;
    background: var(--gradient-1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    color: #fff;
    flex-shrink: 0;
}

/* Sidebar Overlay (mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 1035;
    backdrop-filter: blur(4px);
}

/* Mobile sidebar */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .sidebar-header {
        display: flex;
        align-items: center;
    }
    .sidebar-overlay.show {
        display: block;
    }
    .main-content {
        padding-left: 0;
        width: 100%;
    }
}


/* ==========================================================================
   MAIN CONTENT
   ========================================================================== */

.main-content {
    width: 100%;
    padding-left: var(--sidebar-width);
    margin-left: 0;
    min-height: calc(100vh - 64px);
}

.content-wrapper {
    padding: 24px;
    max-width: 1600px;
    margin: 0 auto;
}

@media (max-width: 767.98px) {
    .content-wrapper {
        padding: 16px;
    }
}


/* ==========================================================================
   PAGE HEADER
   ========================================================================== */

.page-header {
    margin-bottom: 24px;
}

.page-title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
    background: linear-gradient(135deg, var(--text-primary), var(--brand-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0;
}


/* ==========================================================================
   GLASS CARD
   ========================================================================== */

.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    overflow: hidden;
}

.glass-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: rgba(var(--brand-primary-rgb), 0.25);
}

.glass-card .card-header {
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid var(--border-color-light);
    padding: 16px 20px;
}

.glass-card .card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.glass-card .card-body {
    padding: 20px;
}


/* ==========================================================================
   STAT CARDS
   ========================================================================== */

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base);
    cursor: default;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(var(--brand-primary-rgb), 0.3);
}

.stat-card-gradient-1::before { background: var(--gradient-1); }
.stat-card-gradient-2::before { background: var(--gradient-2); }
.stat-card-gradient-3::before { background: var(--gradient-3); }
.stat-card-gradient-4::before { background: var(--gradient-4); }
.stat-card-gradient-5::before { background: var(--gradient-5); }
.stat-card-gradient-6::before { background: var(--gradient-6); }

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 12px;
    background: rgba(var(--brand-primary-rgb), 0.1);
    color: var(--brand-primary);
}

.stat-card-gradient-1 .stat-icon { background: rgba(99,102,241,0.12); color: #818cf8; }
.stat-card-gradient-2 .stat-icon { background: rgba(6,182,212,0.12);  color: #22d3ee; }
.stat-card-gradient-3 .stat-icon { background: rgba(16,185,129,0.12); color: #34d399; }
.stat-card-gradient-4 .stat-icon { background: rgba(245,158,11,0.12); color: #fbbf24; }
.stat-card-gradient-5 .stat-icon { background: rgba(236,72,153,0.12); color: #f472b6; }
.stat-card-gradient-6 .stat-icon { background: rgba(59,130,246,0.12); color: #60a5fa; }

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.2;
    margin-bottom: 4px;
}

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

@media (max-width: 575.98px) {
    .stat-card {
        padding: 14px;
    }
    .stat-value {
        font-size: 1.2rem;
    }
    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
        margin-bottom: 8px;
    }
}


/* ==========================================================================
   PIPELINE CHART
   ========================================================================== */

.pipeline-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pipeline-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pipeline-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pipeline-count {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.pipeline-bar {
    height: 8px;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    overflow: hidden;
}

.pipeline-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 4px;
}

/* Pipeline bar colors */
.pipeline-bar-fill.badge-stage-new        { background: var(--gradient-2); }
.pipeline-bar-fill.badge-stage-call       { background: var(--gradient-6); }
.pipeline-bar-fill.badge-stage-interested { background: var(--gradient-3); }
.pipeline-bar-fill.badge-stage-visit      { background: var(--gradient-4); }
.pipeline-bar-fill.badge-stage-demo       { background: var(--gradient-1); }
.pipeline-bar-fill.badge-stage-ready      { background: var(--gradient-5); }
.pipeline-bar-fill.badge-stage-enrolled   { background: linear-gradient(135deg, #22c55e, #16a34a); }
.pipeline-bar-fill.badge-stage-dropped    { background: linear-gradient(135deg, #ef4444, #dc2626); }


/* ==========================================================================
   STAGE / STATUS BADGES
   ========================================================================== */

.badge-stage-new        { background: rgba(6,182,212,0.15) !important; color: #22d3ee !important; border: 1px solid rgba(6,182,212,0.2); }
.badge-stage-call       { background: rgba(59,130,246,0.15) !important; color: #60a5fa !important; border: 1px solid rgba(59,130,246,0.2); }
.badge-stage-interested { background: rgba(16,185,129,0.15) !important; color: #34d399 !important; border: 1px solid rgba(16,185,129,0.2); }
.badge-stage-visit      { background: rgba(245,158,11,0.15) !important; color: #fbbf24 !important; border: 1px solid rgba(245,158,11,0.2); }
.badge-stage-demo       { background: rgba(139,92,246,0.15) !important; color: #a78bfa !important; border: 1px solid rgba(139,92,246,0.2); }
.badge-stage-ready      { background: rgba(236,72,153,0.15) !important; color: #f472b6 !important; border: 1px solid rgba(236,72,153,0.2); }
.badge-stage-enrolled   { background: rgba(34,197,94,0.15) !important; color: #4ade80 !important; border: 1px solid rgba(34,197,94,0.2); }
.badge-stage-dropped    { background: rgba(239,68,68,0.15) !important; color: #f87171 !important; border: 1px solid rgba(239,68,68,0.2); }

[class*="badge-stage-"] {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.3px;
}


/* ==========================================================================
   ACTIVITY FEED
   ========================================================================== */

.activity-list {
    padding: 8px 0;
}

.activity-item {
    display: flex;
    gap: 12px;
    padding: 10px 20px;
    transition: background var(--transition-fast);
}

.activity-item:hover {
    background: rgba(var(--brand-primary-rgb), 0.04);
}

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
}

.activity-text {
    font-size: 0.825rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.activity-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: flex;
    gap: 6px;
    margin-top: 2px;
}


/* ==========================================================================
   TABLES
   ========================================================================== */

.table-custom {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: rgba(var(--brand-primary-rgb), 0.04);
    margin: 0;
}

.table-custom thead th {
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid var(--border-color-light);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 12px 16px;
    white-space: nowrap;
}

.table-custom tbody td {
    border-bottom: 1px solid var(--border-color-light);
    padding: 12px 16px;
    font-size: 0.875rem;
    vertical-align: middle;
    color: var(--text-primary);
}

.table-custom tbody tr:last-child td {
    border-bottom: none;
}


/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn-primary {
    background: var(--gradient-1) !important;
    border: none !important;
    font-weight: 600;
    letter-spacing: 0.2px;
    box-shadow: 0 4px 12px rgba(var(--brand-primary-rgb), 0.3);
    transition: all var(--transition-base);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(var(--brand-primary-rgb), 0.4);
    transform: translateY(-1px);
}

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

.btn-outline-primary {
    border-color: rgba(var(--brand-primary-rgb), 0.3) !important;
    color: var(--brand-primary) !important;
}

.btn-outline-primary:hover {
    background: rgba(var(--brand-primary-rgb), 0.1) !important;
    border-color: var(--brand-primary) !important;
    color: #fff !important;
}


/* ==========================================================================
   FORM CONTROLS
   ========================================================================== */

.form-control,
.form-select {
    background: var(--bg-input) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-md) !important;
    transition: all var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 3px rgba(var(--brand-primary-rgb), 0.15) !important;
}

.form-floating > label {
    color: var(--text-muted);
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: var(--brand-primary);
}

.input-group-text {
    background: rgba(var(--brand-primary-rgb), 0.08) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--brand-primary) !important;
}


/* ==========================================================================
   ALERTS
   ========================================================================== */

.alert {
    border-radius: var(--radius-md);
    border: none;
    font-size: 0.875rem;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.12);
    color: #fde68a;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-success {
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.2);
}


/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */

.toast-custom {
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    min-width: 320px;
    overflow: hidden;
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-custom::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
}

.toast-custom.toast-success::before { background: var(--gradient-3); }
.toast-custom.toast-error::before   { background: linear-gradient(180deg, #ef4444, #dc2626); }
.toast-custom.toast-warning::before { background: var(--gradient-4); }
.toast-custom.toast-info::before    { background: var(--gradient-2); }

.toast-body-custom {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px 14px 20px;
}

.toast-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.toast-success .toast-icon { background: rgba(34,197,94,0.15); color: #4ade80; }
.toast-error .toast-icon   { background: rgba(239,68,68,0.15); color: #f87171; }
.toast-warning .toast-icon { background: rgba(245,158,11,0.15); color: #fbbf24; }
.toast-info .toast-icon    { background: rgba(6,182,212,0.15); color: #22d3ee; }

.toast-message {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 0;
    transition: color var(--transition-fast);
}
.toast-close:hover {
    color: var(--text-primary);
}

@keyframes slideInRight {
    from {
        transform: translateX(100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}


/* ==========================================================================
   DARK THEME TEXT OVERRIDES — ensure readability on dark backgrounds
   ========================================================================== */

.text-muted {
    color: var(--text-muted) !important;
}

.small, small {
    color: var(--text-secondary);
}

/* Bootstrap modal in dark mode */
.modal-content {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary);
}

.modal-header {
    border-bottom-color: var(--border-color-light) !important;
}

.form-text {
    color: var(--text-muted) !important;
}

.form-label {
    color: var(--text-secondary);
}

/* Bootstrap text color overrides for dark theme */
.text-primary {
    color: #818cf8 !important;
}
.text-info {
    color: #22d3ee !important;
}
.text-secondary {
    color: var(--text-secondary) !important;
}
.text-success {
    color: #4ade80 !important;
}
.text-danger {
    color: #f87171 !important;
}
.text-warning {
    color: #fbbf24 !important;
}

/* Bootstrap bg-opacity badges — ensure text is bright on semi-transparent backgrounds */
.badge.bg-primary.bg-opacity-15,
.badge.bg-primary[class*="bg-opacity"] {
    background-color: rgba(99, 102, 241, 0.15) !important;
    color: #a5b4fc !important;
}
.badge.bg-info.bg-opacity-15,
.badge.bg-info[class*="bg-opacity"] {
    background-color: rgba(6, 182, 212, 0.15) !important;
    color: #67e8f9 !important;
}
.badge.bg-secondary.bg-opacity-15,
.badge.bg-secondary[class*="bg-opacity"] {
    background-color: rgba(148, 163, 184, 0.15) !important;
    color: #cbd5e1 !important;
}
.badge.bg-success.bg-opacity-15,
.badge.bg-success[class*="bg-opacity"] {
    background-color: rgba(34, 197, 94, 0.15) !important;
    color: #86efac !important;
}
.badge.bg-warning.bg-opacity-15,
.badge.bg-warning[class*="bg-opacity"] {
    background-color: rgba(245, 158, 11, 0.15) !important;
    color: #fde68a !important;
}
.badge.bg-danger.bg-opacity-15,
.badge.bg-danger[class*="bg-opacity"] {
    background-color: rgba(239, 68, 68, 0.15) !important;
    color: #fca5a5 !important;
}


/* ==========================================================================
   LOGIN PAGE
   ========================================================================== */

.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 20px;
}

/* Animated Background Orbs */
.login-bg-animation {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #6366f1, transparent 70%);
    top: -100px;
    right: -100px;
    animation: floatOrb 12s ease-in-out infinite;
}

.orb-2 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, #8b5cf6, transparent 70%);
    bottom: -80px;
    left: -80px;
    animation: floatOrb 15s ease-in-out infinite reverse;
}

.orb-3 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, #06b6d4, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: floatOrb 10s ease-in-out infinite;
}

@keyframes floatOrb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(30px, -30px) scale(1.05); }
    66%      { transform: translate(-20px, 20px) scale(0.95); }
}

/* Login Container */
.login-container {
    display: flex;
    width: 100%;
    max-width: 1000px;
    min-height: 600px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    position: relative;
    z-index: 1;
}

/* Branding Panel */
.login-branding {
    flex: 0 0 42%;
    background: linear-gradient(160deg, 
        rgba(99, 102, 241, 0.15) 0%, 
        rgba(139, 92, 246, 0.1) 50%,
        rgba(6, 182, 212, 0.08) 100%
    );
    border-right: 1px solid var(--border-color-light);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
}

.login-branding::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(99,102,241,0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139,92,246,0.06) 0%, transparent 50%);
}

.branding-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.brand-logo-lg {
    width: 80px;
    height: 80px;
    background: var(--gradient-1);
    border-radius: var(--radius-xl);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: #fff;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(var(--brand-primary-rgb), 0.3);
}

.brand-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff, var(--brand-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
}

.brand-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 30px;
}

.brand-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.feature-item i {
    color: var(--brand-primary);
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.brand-footer {
    margin-top: 32px;
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Login Form Panel */
.login-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.login-form-container {
    width: 100%;
    max-width: 380px;
}

.login-header {
    margin-bottom: 28px;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* Login Form Inputs */
.login-form .input-group {
    border-radius: var(--radius-md);
    overflow: hidden;
}

.login-form .input-group-text {
    width: 48px;
    justify-content: center;
}

.login-form .form-floating > .form-control {
    border-left: none !important;
    border-right: none !important;
}

.login-form .input-group > :last-child .input-group-text,
.login-form .toggle-password {
    background: var(--bg-input) !important;
    color: var(--text-muted) !important;
    border-left: none !important;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.login-form .toggle-password:hover {
    color: var(--brand-primary) !important;
}

/* Login Button */
.btn-login {
    height: 52px;
    border-radius: var(--radius-md) !important;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.login-hint code {
    background: rgba(var(--brand-primary-rgb), 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--brand-primary);
    font-size: 0.78rem;
}

/* Responsive Login */
@media (max-width: 991.98px) {
    .login-branding {
        display: none;
    }
    .login-container {
        max-width: 440px;
    }
}

@media (max-width: 575.98px) {
    .login-form-panel {
        padding: 24px;
    }
    .login-container {
        border-radius: var(--radius-lg);
    }
}


/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

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

/* Loading Spinner */
.page-loader {
    position: fixed;
    inset: 0;
    background: rgba(11,15,25,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner-ring {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(var(--brand-primary-rgb), 0.1);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.stat-card { animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) both; }
.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.2s; }
.stat-card:nth-child(5) { animation-delay: 0.25s; }
.stat-card:nth-child(6) { animation-delay: 0.3s; }

.glass-card {
    animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
    animation-delay: 0.15s;
}

/* Modal Dark Overrides */
.modal-content {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg) !important;
}

.modal-header {
    border-bottom: 1px solid var(--border-color-light) !important;
}

.modal-footer {
    border-top: 1px solid var(--border-color-light) !important;
}


/* ==========================================================================
   ROLE BADGES
   ========================================================================== */

.badge-role-admin {
    background: rgba(239, 68, 68, 0.12) !important;
    color: #f87171 !important;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-role-manager {
    background: rgba(59, 130, 246, 0.12) !important;
    color: #60a5fa !important;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-role-head {
    background: rgba(139, 92, 246, 0.12) !important;
    color: #a78bfa !important;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.badge-role-exec {
    background: rgba(6, 182, 212, 0.12) !important;
    color: #22d3ee !important;
    border: 1px solid rgba(6, 182, 212, 0.2);
}

[class*="badge-role-"] {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.3px;
}


/* ==========================================================================
   STATUS BADGES
   ========================================================================== */

.badge-status-active {
    background: rgba(34, 197, 94, 0.12) !important;
    color: #4ade80 !important;
    border: 1px solid rgba(34, 197, 94, 0.2);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

.badge-status-disabled {
    background: rgba(239, 68, 68, 0.12) !important;
    color: #f87171 !important;
    border: 1px solid rgba(239, 68, 68, 0.2);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}


/* ==========================================================================
   ACTION BUTTONS (Table)
   ========================================================================== */

.btn-icon-action {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color-light);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    font-size: 0.85rem;
}

.btn-icon-action:hover {
    background: rgba(var(--brand-primary-rgb), 0.12);
    border-color: rgba(var(--brand-primary-rgb), 0.3);
    color: var(--brand-primary);
    transform: translateY(-1px);
}

.btn-icon-action.text-danger:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}


/* ==========================================================================
   BREADCRUMBS
   ========================================================================== */

.breadcrumb {
    background: none;
    padding: 0;
    margin-bottom: 4px;
    font-size: 0.8rem;
}

.breadcrumb-item a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.breadcrumb-item a:hover {
    color: var(--brand-primary);
}

.breadcrumb-item.active {
    color: var(--text-secondary);
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--text-muted);
}


/* ==========================================================================
   FORM VALIDATION
   ========================================================================== */

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

.invalid-feedback {
    color: #fca5a5;
    font-size: 0.78rem;
    margin-top: 4px;
}

.form-label {
    font-size: 0.85rem;
    margin-bottom: 6px;
    color: var(--text-secondary);
}


/* ==========================================================================
   LEAD STAGE BADGES
   ========================================================================== */

.badge-stage-new {
    background: rgba(148, 163, 184, 0.15) !important;
    color: #94a3b8 !important;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.badge-stage-call {
    background: rgba(59, 130, 246, 0.12) !important;
    color: #60a5fa !important;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-stage-interested {
    background: rgba(34, 197, 94, 0.12) !important;
    color: #4ade80 !important;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.badge-stage-visit {
    background: rgba(168, 85, 247, 0.12) !important;
    color: #c084fc !important;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.badge-stage-demo {
    background: rgba(6, 182, 212, 0.12) !important;
    color: #22d3ee !important;
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.badge-stage-ready {
    background: rgba(245, 158, 11, 0.12) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-stage-enrolled {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #34d399 !important;
    border: 1px solid rgba(16, 185, 129, 0.25);
    font-weight: 700;
}

.badge-stage-dropped {
    background: rgba(239, 68, 68, 0.12) !important;
    color: #f87171 !important;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

