/* ═══════════════════════════════════════════════════════════════════════════════
   TRANSPORT PRO - DESIGN SYSTEM V6
   Theme Light Premium - Vannes Express
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Google Fonts - DM Sans & JetBrains Mono */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap');

:root {
    /* Couleurs Vannes Express */
    --ve-marine: #1a3a5c;
    --ve-marine-light: #2a5a8c;
    --ve-marine-dark: #0f2840;
    --ve-cyan: #4fc3f7;
    --ve-cyan-light: #81d4fa;
    --ve-cyan-glow: rgba(79, 195, 247, 0.4);
    --ve-orange: #f5a623;
    --ve-orange-light: #ffb74d;

    /* Palette Light Premium */
    --bg-primary: #f4f7fb;
    --bg-secondary: #ffffff;
    --bg-tertiary: #edf2f7;
    --bg-glass: rgba(255, 255, 255, 0.7);
    --border-color: #e2e8f0;
    --border-light: #f0f4f8;

    /* Texte */
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #a0aec0;

    /* Etats */
    --success: #10b981;
    --success-light: #34d399;
    --success-bg: #ecfdf5;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --info: #3b82f6;
    --info-bg: #eff6ff;

    /* Ombres Premium */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 20px rgba(79, 195, 247, 0.15);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 6px 16px rgba(0, 0, 0, 0.04);

    /* Rayons */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   BASE - RESET V6
   ═══════════════════════════════════════════════════════════════════════════════ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Background Pattern subtil */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(79, 195, 247, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(245, 166, 35, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   LAYOUT V6
   ═══════════════════════════════════════════════════════════════════════════════ */

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   SIDEBAR V6
   ═══════════════════════════════════════════════════════════════════════════════ */

.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    box-shadow: var(--shadow-lg);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   SIDEBAR RÉTRACTABLE
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Bouton hamburger toggle */
.sidebar-toggle {
    position: absolute;
    top: 20px;
    right: -16px;
    width: 32px;
    height: 32px;
    background: var(--ve-marine);
    border: 2px solid var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 101;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.sidebar-toggle:hover {
    background: var(--ve-marine-light);
    transform: scale(1.1);
}

.sidebar-toggle-icon {
    width: 16px;
    height: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sidebar-toggle-icon span {
    display: block;
    height: 2px;
    background: white;
    border-radius: 1px;
    transition: all 0.3s ease;
}

/* État rétracté (collapsed) */
.sidebar.collapsed {
    width: 72px;
}

.sidebar.collapsed .sidebar-header {
    padding: 20px 12px;
}

.sidebar.collapsed .sidebar-brand {
    justify-content: center;
    margin-bottom: 0;
}

.sidebar.collapsed .sidebar-title,
.sidebar.collapsed .sidebar-company,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .nav-item-text,
.sidebar.collapsed .nav-item-badge,
.sidebar.collapsed .sidebar-user-info {
    opacity: 0;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar.collapsed .sidebar-nav {
    padding: 16px 8px;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 14px;
}

.sidebar.collapsed .nav-item-icon {
    margin: 0;
}

.sidebar.collapsed .nav-item.active::before {
    left: -8px;
}

.sidebar.collapsed .sidebar-footer {
    justify-content: center;
    padding: 18px 12px;
}

.sidebar.collapsed .sidebar-user {
    justify-content: center;
}

.sidebar.collapsed .sidebar-toggle {
    right: -16px;
}

.sidebar.collapsed .sidebar-toggle-icon span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

.sidebar.collapsed .sidebar-toggle-icon span:nth-child(2) {
    opacity: 0;
}

.sidebar.collapsed .sidebar-toggle-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
}

/* Hover pour ouvrir temporairement (quand collapsed) */
.sidebar.collapsed:hover {
    width: 260px;
    box-shadow: var(--shadow-xl);
}

.sidebar.collapsed:hover .sidebar-header {
    padding: 24px 20px;
}

.sidebar.collapsed:hover .sidebar-brand {
    justify-content: flex-start;
    margin-bottom: 16px;
}

.sidebar.collapsed:hover .sidebar-title,
.sidebar.collapsed:hover .sidebar-company,
.sidebar.collapsed:hover .nav-section-title,
.sidebar.collapsed:hover .nav-item-text,
.sidebar.collapsed:hover .nav-item-badge,
.sidebar.collapsed:hover .sidebar-user-info {
    opacity: 1;
    width: auto;
}

.sidebar.collapsed:hover .sidebar-nav {
    padding: 16px 12px;
}

.sidebar.collapsed:hover .nav-item {
    justify-content: flex-start;
    padding: 11px 14px;
}

.sidebar.collapsed:hover .nav-item.active::before {
    left: -12px;
}

.sidebar.collapsed:hover .sidebar-footer {
    justify-content: flex-start;
    padding: 18px 20px;
}

.sidebar.collapsed:hover .sidebar-user {
    justify-content: flex-start;
}

/* Ajustement du main-content quand sidebar rétractée */
.app-layout.sidebar-collapsed .main-content {
    margin-left: 72px;
    max-width: calc(100vw - 72px);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.sidebar-logo {
    width: 48px;
    height: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md), 0 0 20px rgba(26, 58, 92, 0.2);
}

.sidebar-logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--ve-marine) 0%, var(--ve-marine-light) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
    box-shadow: var(--shadow-md), 0 0 20px rgba(26, 58, 92, 0.2);
}

.sidebar-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--ve-marine);
    letter-spacing: -0.3px;
}

.sidebar-company {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-primary) 100%);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    border: 1px solid var(--border-light);
}

.company-name,
.sidebar-company-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.company-role,
.sidebar-company-role {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

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

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 4px;
    position: relative;
    cursor: pointer;
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transform: translateX(4px);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--ve-marine) 0%, var(--ve-marine-light) 100%);
    color: white;
    box-shadow: var(--shadow-md), 0 4px 12px rgba(26, 58, 92, 0.25);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: var(--ve-cyan);
    border-radius: 0 4px 4px 0;
}

.nav-item-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
}

.nav-item-badge {
    margin-left: auto;
    background: var(--ve-orange);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(245, 166, 35, 0.3);
}

/* User Section V6 */
.sidebar-user,
.sidebar-footer {
    padding: 18px 20px;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(to top, var(--bg-tertiary), transparent);
}

.user-avatar,
.sidebar-user-avatar {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--ve-cyan) 0%, var(--ve-cyan-light) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--ve-marine);
    font-size: 15px;
    box-shadow: 0 2px 8px rgba(79, 195, 247, 0.3);
}

.user-info,
.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.user-name,
.sidebar-user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-email,
.sidebar-user-email {
    font-size: 12px;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   MAIN CONTENT V6
   ═══════════════════════════════════════════════════════════════════════════════ */

.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    background: var(--bg-primary);
    max-width: calc(100vw - 260px);
    overflow-x: hidden;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Header V6 */
.main-header {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    gap: 16px;
    flex-wrap: wrap;
    box-sizing: border-box;
    width: 100%;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
}

.header-left h1,
.page-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.header-left p,
.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Health Score */
.health-score {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--success-bg) 0%, white 100%);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.health-score-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: conic-gradient(var(--success) 0% 87%, var(--border-color) 87% 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.health-score-circle::before {
    content: '';
    position: absolute;
    width: 38px;
    height: 38px;
    background: white;
    border-radius: 50%;
}

.health-score-value {
    position: relative;
    font-size: 14px;
    font-weight: 700;
    color: var(--success);
}

.health-score-text {
    text-align: left;
}

.health-score-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--success);
}

.health-score-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.header-left {
    flex: 1;
    min-width: 0;
}

/* Page Content */
.page-content {
    padding: 28px 32px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   BUTTONS V6
   ═══════════════════════════════════════════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--ve-marine);
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--ve-marine) 0%, var(--ve-marine-light) 100%);
    color: white;
    box-shadow: var(--shadow-md), 0 4px 12px rgba(26, 58, 92, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl), 0 8px 20px rgba(26, 58, 92, 0.25);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #f87171 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-light) 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, var(--ve-orange) 0%, var(--ve-orange-light) 100%);
    color: white;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}

.btn-full {
    width: 100%;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   KPI CARDS V6 - Premium Style
   ═══════════════════════════════════════════════════════════════════════════════ */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.kpi-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.kpi-card.kpi-blue::before { background: linear-gradient(90deg, var(--ve-cyan), var(--ve-marine)); }
.kpi-card.kpi-green::before { background: linear-gradient(90deg, var(--success), var(--success-light)); }
.kpi-card.kpi-orange::before { background: linear-gradient(90deg, var(--ve-orange), var(--ve-orange-light)); }
.kpi-card.kpi-purple::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }

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

.kpi-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.kpi-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.kpi-badge.positive {
    background: var(--success-bg);
    color: var(--success);
}

.kpi-badge.negative {
    background: var(--danger-bg);
    color: var(--danger);
}

.kpi-value {
    font-size: 34px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -1px;
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 4px;
}

.kpi-comparison {
    font-size: 13px;
    color: var(--text-muted);
}

.kpi-comparison strong {
    color: var(--text-secondary);
}

/* Stats Grid (alternative) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-lg);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--ve-marine);
}

.stat-card.blue::before { background: var(--ve-cyan); }
.stat-card.orange::before { background: var(--ve-orange); }
.stat-card.purple::before { background: #8b5cf6; }
.stat-card.green::before { background: var(--success); }

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 12px;
}

.stat-icon.green { background: var(--success-bg); }
.stat-icon.orange { background: var(--warning-bg); }
.stat-icon.red { background: var(--danger-bg); }
.stat-icon.blue { background: var(--info-bg); }

.stat-card-value,
.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 4px;
}

.stat-card-label,
.stat-label {
    color: var(--text-muted);
    font-size: 13px;
}

.stat-trend {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 8px;
}

.stat-trend.up {
    background: var(--success-bg);
    color: var(--success);
}

.stat-trend.down {
    background: var(--danger-bg);
    color: var(--danger);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   CARDS V6
   ═══════════════════════════════════════════════════════════════════════════════ */

.card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 24px;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(to bottom, white, var(--bg-tertiary));
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--ve-cyan), var(--ve-cyan-light));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.card-actions {
    display: flex;
    gap: 6px;
}

.card-btn {
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.card-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.card-btn.active {
    background: var(--ve-marine);
    color: white;
    border-color: var(--ve-marine);
}

.card-body {
    padding: 24px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   CHART SECTION V6
   ═══════════════════════════════════════════════════════════════════════════════ */

.chart-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 28px;
}

.chart-container {
    position: relative;
    height: 280px;
}

/* Stats Panel */
.stats-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   PLANNING GANTT V6
   ═══════════════════════════════════════════════════════════════════════════════ */

.gantt-section {
    margin-bottom: 28px;
}

.gantt-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.gantt-date-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gantt-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
}

.gantt-nav-btn:hover {
    background: var(--ve-marine);
    color: white;
    border-color: var(--ve-marine);
}

.gantt-current-date {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 180px;
    text-align: center;
}

.gantt-container {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.gantt-wrapper {
    display: flex;
    overflow-x: auto;
}

/* Colonne chauffeurs */
.gantt-drivers {
    flex-shrink: 0;
    width: 200px;
    background: var(--bg-tertiary);
    border-right: 1px solid var(--border-color);
}

.gantt-driver-header {
    height: 50px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.gantt-driver-row {
    height: 70px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.2s ease;
}

.gantt-driver-row:hover {
    background: var(--bg-primary);
}

.driver-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ve-cyan), var(--ve-cyan-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    color: var(--ve-marine);
    flex-shrink: 0;
}

.driver-info {
    min-width: 0;
}

.driver-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.driver-vehicle {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Timeline */
.gantt-timeline {
    flex: 1;
    min-width: 800px;
}

.gantt-hours {
    height: 50px;
    display: flex;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.gantt-hour {
    flex: 1;
    min-width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    border-right: 1px solid var(--border-light);
    position: relative;
}

.gantt-hour.now::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: var(--ve-orange);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--ve-orange);
}

.gantt-rows {
    position: relative;
}

.gantt-row {
    height: 70px;
    display: flex;
    border-bottom: 1px solid var(--border-light);
    position: relative;
}

.gantt-cell {
    flex: 1;
    min-width: 60px;
    border-right: 1px solid var(--border-light);
    position: relative;
}

.gantt-cell.current-hour {
    background: rgba(245, 166, 35, 0.08);
}

/* Mission Bar */
.mission-bar {
    position: absolute;
    top: 12px;
    height: 46px;
    background: linear-gradient(135deg, var(--ve-marine) 0%, var(--ve-marine-light) 100%);
    border-radius: var(--radius-sm);
    padding: 0 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-md);
    z-index: 5;
}

.mission-bar:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.mission-bar-title {
    font-size: 12px;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mission-bar-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
}

.mission-bar.completed {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-light) 100%);
}

.mission-bar.in-progress {
    background: linear-gradient(135deg, var(--ve-orange) 0%, var(--ve-orange-light) 100%);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   TABLE V6
   ═══════════════════════════════════════════════════════════════════════════════ */

.table-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    padding: 16px 20px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
    color: var(--text-primary);
}

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

.table tr:hover {
    background: var(--bg-tertiary);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   BADGES V6
   ═══════════════════════════════════════════════════════════════════════════════ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
}

.badge-primary {
    background: rgba(26, 58, 92, 0.1);
    color: var(--ve-marine);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   FORMS V6
   ═══════════════════════════════════════════════════════════════════════════════ */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input,
.form-select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    transition: all 0.2s;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--ve-marine);
    box-shadow: 0 0 0 3px rgba(26, 58, 92, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   MODAL V6
   ═══════════════════════════════════════════════════════════════════════════════ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

.modal-large {
    max-width: 700px;
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, white, var(--bg-tertiary));
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: var(--bg-tertiary);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   ALERTS V6
   ═══════════════════════════════════════════════════════════════════════════════ */

.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    line-height: 1.5;
}

.alert-success {
    background: var(--success-bg);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
}

.alert-error {
    background: var(--danger-bg);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

.alert-info {
    background: var(--info-bg);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--info);
}

.alert-warning {
    background: var(--warning-bg);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--warning);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   LOADING V6
   ═══════════════════════════════════════════════════════════════════════════════ */

.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    gap: 16px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--ve-marine);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ═══════════════════════════════════════════════════════════════════════════════
   EMPTY STATE V6
   ═══════════════════════════════════════════════════════════════════════════════ */

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state-text {
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE V6
   ═══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1280px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .chart-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
    }

    .sidebar-title,
    .sidebar-company,
    .nav-section-title,
    .nav-item-text,
    .nav-item-badge,
    .sidebar-user-info,
    .user-info {
        display: none;
    }

    .sidebar-brand {
        justify-content: center;
    }

    .nav-item {
        justify-content: center;
        padding: 14px;
    }

    .sidebar-user,
    .sidebar-footer {
        justify-content: center;
    }

    .main-content {
        margin-left: 80px;
        max-width: calc(100vw - 80px);
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
        max-width: 100vw;
    }

    .page-content {
        padding: 20px;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .form-row,
    .form-row-3 {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        gap: 16px;
    }

    .gantt-drivers {
        display: none;
    }
}
