/* ==============================================================================
   BẢO PHÁT MRO - DESIGN SYSTEM & MODERN PREMIUM THEME
   Glassmorphism, Vibrant Accents, High Contrast & Smooth Micro-animations
   ============================================================================== */

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

:root {
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Theme Colors (Luxury Tech Slate / Crisp Contrast) */
    --bg-main: #0c1322;
    --bg-card: rgba(22, 32, 54, 0.8);
    --bg-card-solid: #151f33;
    --bg-card-hover: rgba(33, 47, 77, 0.85);
    --bg-sidebar: #090e1a;
    --bg-input: rgba(15, 23, 42, 0.7);

    /* Accent & Brand Colors */
    --brand-primary: #38bdf8;
    --brand-primary-hover: #0284c7;
    --brand-primary-glow: rgba(56, 189, 248, 0.3);
    
    --brand-success: #10b981;
    --brand-success-glow: rgba(16, 185, 129, 0.25);
    
    --brand-warning: #f59e0b;
    --brand-warning-glow: rgba(245, 158, 11, 0.25);
    
    --brand-danger: #ef4444;
    --brand-danger-glow: rgba(239, 68, 68, 0.25);
    
    --brand-purple: #8b5cf6;
    --brand-purple-glow: rgba(139, 92, 246, 0.25);
    
    --brand-cyan: #06b6d4;

    /* Text Colors - Tương phản cao trên nền tối */
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-highlight: #38bdf8;

    /* Borders & Glass Effects */
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-bright: rgba(255, 255, 255, 0.16);
    --glass-blur: blur(16px);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 1px 1px var(--border-glass);
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #334155;
}

/* Sidebar Styles */
.app-sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-glass);
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-purple));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    box-shadow: 0 0 20px var(--brand-primary-glow);
}

.brand-text h2 {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.3px;
    background: linear-gradient(to right, #fff, #93c5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.brand-text p {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 20px 12px;
    list-style: none;
}

.menu-category {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 12px 14px 6px;
    font-weight: 700;
}

.menu-item a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 3px;
}

.menu-item a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.menu-item.active a {
    color: #fff;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.05));
    border-left: 3px solid var(--brand-primary);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.1);
}

.menu-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

/* App Main Container */
.app-container {
    margin-left: 260px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Top Navbar */
.app-header {
    height: 70px;
    background: rgba(11, 15, 25, 0.8);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 900;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Mileage Counter Badge */
.mileage-badge {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.15));
    border: 1px solid rgba(59, 130, 246, 0.3);
    padding: 6px 14px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #93c5fd;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.15);
}

.mileage-num {
    font-family: var(--font-mono);
    color: #60a5fa;
    font-weight: 700;
}

/* AI Patrol Status Badge */
.patrol-status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 30px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    font-size: 12px;
    font-weight: 600;
    color: #34d399;
}

.pulsing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.7; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.7; }
}

/* Content Area */
.app-content {
    padding: 32px;
    flex: 1;
}

/* Cards & Glass Panel */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.glass-panel:hover {
    border-color: var(--border-glass-bright);
}

/* KPI Card Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.kpi-card {
    padding: 22px;
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--card-accent, var(--brand-primary)), transparent);
}

.kpi-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.kpi-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--card-accent, var(--brand-primary));
}

.kpi-value {
    font-size: 26px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
}

.kpi-sub {
    font-size: 12px;
    color: var(--text-secondary);
}

/* AI Mood Banner */
.ai-mood-banner {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.8));
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.ai-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0284c7, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 0 15px rgba(2, 132, 199, 0.4);
}

.ai-mood-content h4 {
    font-size: 15px;
    font-weight: 700;
    color: #93c5fd;
    margin-bottom: 4px;
}

.ai-mood-content p {
    font-size: 14px;
    color: #e2e8f0;
    font-style: italic;
}

/* Buttons */
.btn-custom {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-primary-gradient {
    background: linear-gradient(135deg, var(--brand-primary), #2563eb);
    color: #fff;
    box-shadow: 0 4px 14px var(--brand-primary-glow);
}

.btn-primary-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    color: #fff;
}

.btn-success-gradient {
    background: linear-gradient(135deg, var(--brand-success), #059669);
    color: #fff;
    box-shadow: 0 4px 14px var(--brand-success-glow);
}

.btn-glass {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-glass-bright);
    color: var(--text-primary);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* Tables */
.table-custom {
    width: 100%;
    border-collapse: collapse;
}

.table-custom th {
    background: rgba(255, 255, 255, 0.05);
    padding: 14px 18px;
    text-align: left;
    font-size: 13px;
    font-weight: 700;
    color: #f1f5f9 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-glass-bright);
}

.table-custom td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-glass);
    font-size: 14px;
    color: #cbd5e1 !important;
}

.table-custom tr:hover td {
    background: rgba(255, 255, 255, 0.04);
    color: #ffffff !important;
}

/* Badges */
.badge-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-parsing {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-parsed {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-overdue {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-paid {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Form Controls & Labels - High Contrast Overrides */
.form-label {
    color: #e2e8f0 !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    margin-bottom: 6px !important;
    letter-spacing: 0.2px;
}

.form-control-custom {
    width: 100%;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius-md);
    padding: 11px 16px;
    color: #ffffff !important;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.form-control-custom:focus {
    outline: none;
    border-color: var(--brand-primary);
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 0 0 3px var(--brand-primary-glow);
    color: #ffffff !important;
}

.form-control-custom::placeholder {
    color: #64748b !important;
}

.form-control-custom:disabled,
.form-control-custom[readonly] {
    background: rgba(15, 23, 42, 0.45) !important;
    color: #94a3b8 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    cursor: not-allowed;
    opacity: 0.75;
}

.form-select.form-control-custom {
    color: #ffffff !important;
    background-color: rgba(15, 23, 42, 0.85);
}

.form-select.form-control-custom option {
    background-color: #0f172a;
    color: #ffffff;
    padding: 10px;
}

/* High-contrast Text Utility Overrides for Dark Background */
.text-secondary {
    color: #cbd5e1 !important;
}

.text-muted {
    color: #94a3b8 !important;
}

.text-white-50 {
    color: #cbd5e1 !important;
}

/* Drag & Drop Upload Zone */
.dropzone-box {
    border: 2px dashed rgba(59, 130, 246, 0.4);
    border-radius: var(--radius-lg);
    background: rgba(15, 23, 42, 0.5);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dropzone-box:hover, .dropzone-box.dragover {
    border-color: var(--brand-primary);
    background: rgba(59, 130, 246, 0.08);
}

/* Floating AI Progress Widget */
.floating-progress-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 380px;
    background: rgba(18, 24, 38, 0.95);
    backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    z-index: 2000;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: none;
}

.floating-header {
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.floating-body {
    padding: 18px;
    max-height: 280px;
    overflow-y: auto;
}

.timeline-step {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 13px;
}

.step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand-primary);
    margin-top: 6px;
    flex-shrink: 0;
}

/* ==============================================================================
   LUXURY AUTHENTICATION PAGE SYSTEM (PREMIUM GLASS & HIGH CONTRAST)
   ============================================================================== */
.auth-page-body {
    background-color: #0b1120 !important;
    background-image: 
        radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.18) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(139, 92, 246, 0.22) 0px, transparent 50%),
        radial-gradient(at 50% 100%, rgba(14, 165, 233, 0.16) 0px, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(30, 41, 59, 0.5) 0%, transparent 100%) !important;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 24px;
}

/* Ambient Glow Orbs */
.auth-ambient-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
    z-index: 0;
}

.auth-glow-top {
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    height: 350px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.35), transparent 70%);
}

.auth-glow-bottom-right {
    bottom: -80px;
    right: -80px;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.25), transparent 70%);
}

.auth-glow-bottom-left {
    bottom: -60px;
    left: -60px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.22), transparent 70%);
}

/* Luxury Glass Card */
.login-card-luxury {
    width: 100%;
    max-width: 460px;
    padding: 42px 36px;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.82), rgba(15, 23, 42, 0.92));
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 26px;
    box-shadow: 
        0 25px 60px -15px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(255, 255, 255, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 0 20px rgba(56, 189, 248, 0.05);
    position: relative;
    z-index: 1;
    animation: authCardFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes authCardFadeIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Brand Avatar Icon Box */
.brand-avatar-box {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 50%, #8b5cf6 100%);
    box-shadow: 0 0 30px rgba(14, 165, 233, 0.45), 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.brand-title-glow {
    font-size: 24px;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #ffffff 20%, #e2e8f0 60%, #93c5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(56, 189, 248, 0.2);
}

.text-light-muted {
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
}

/* Modern Input Groups */
.auth-label {
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 7px;
    letter-spacing: 0.2px;
}

.input-group-modern {
    display: flex;
    align-items: stretch;
    background: rgba(15, 23, 42, 0.75);
    border: 1.5px solid rgba(148, 163, 184, 0.28);
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-group-modern:hover {
    border-color: rgba(56, 189, 248, 0.45);
    background: rgba(15, 23, 42, 0.88);
}

.input-group-modern:focus-within {
    border-color: #38bdf8;
    background: rgba(15, 23, 42, 0.98);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.2), 0 0 20px rgba(56, 189, 248, 0.12);
}

.input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    color: #38bdf8;
    font-size: 15px;
    background: rgba(56, 189, 248, 0.08);
    border-right: 1px solid rgba(148, 163, 184, 0.2);
    transition: all 0.2s ease;
}

.input-group-modern:focus-within .input-icon {
    color: #7dd3fc;
    background: rgba(56, 189, 248, 0.15);
}

.auth-input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    padding: 13px 16px;
    color: #f8fafc !important;
    font-size: 14px;
    font-weight: 500;
    outline: none !important;
    box-shadow: none !important;
}

.auth-input::placeholder {
    color: #64748b !important;
    font-weight: 400;
}

/* Submit Button */
.btn-auth-submit {
    background: linear-gradient(135deg, #0284c7 0%, #2563eb 50%, #6366f1 100%);
    color: #ffffff !important;
    font-weight: 600;
    font-size: 15px;
    padding: 13px 22px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 6px 20px -3px rgba(37, 99, 235, 0.45);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.btn-auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -3px rgba(37, 99, 235, 0.65);
    filter: brightness(1.1);
}

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

/* Alert Danger Custom */
.alert-custom-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
    border-radius: 12px;
}

/* Auth Footer */
.auth-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-footer-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 20px;
    font-size: 12px;
    color: #cbd5e1;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

