/**
 * DL Car Consulting Fleet Portal - Custom Styles
 * Uses Tailwind CSS via CDN - this file contains custom additions
 */

/* Hide Alpine.js x-cloak elements until Alpine initialises (prevents flash) */
[x-cloak] { display: none !important; }

/* ==========================================
   CSS Variables - Brand Colors
   ========================================== */
:root {
    --brand-primary: #151459;
    --brand-secondary: #45A3DA;
    --brand-light: #CEEBFF;
    --brand-light-muted: rgba(206,235,255,0.3);
    --brand-white: #FFFFFF;
    --brand-accent: #FF6B35;
    --brand-success: #00D9A3;
    --brand-warning: #D4AF37;
    --brand-danger: #FF6B35;
    --brand-info: #45A3DA;

    --accent-orange: #FF6B35;
    --accent-gold: #D4AF37;
    --accent-green: #00D9A3;

    --text-primary: #2C3E50;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;

    --bg-primary: #FFFFFF;
    --bg-secondary: #F3F4F6;
    --bg-tertiary: #E5E7EB;

    --border-color: #E5E7EB;
    --border-radius: 0.5rem;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    --sidebar-width: 260px;
    --sidebar-collapsed-width: 64px;
    --header-height: 64px;
}

/* ==========================================
   Base Styles
   ========================================== */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================
   Utility Classes
   ========================================== */
.bg-brand-primary { background-color: var(--brand-primary); }
.bg-brand-secondary { background-color: var(--brand-secondary); }
.bg-brand-accent { background-color: var(--brand-accent); }
.text-brand-primary { color: var(--brand-primary); }
.text-brand-secondary { color: var(--brand-secondary); }
.text-brand-accent { color: var(--brand-accent); }
.border-brand-primary { border-color: var(--brand-primary); }

/* ==========================================
   Admin Layout
   ========================================== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--brand-primary);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 40;
    transition: transform 0.3s ease, width 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-logo {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo img {
    height: 40px;
    width: auto;
}

.sidebar-logo span {
    font-size: 1.125rem;
    font-weight: 600;
    margin-left: 0.75rem;
    white-space: nowrap;
}

.sidebar.collapsed .sidebar-logo span {
    display: none;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-left-color: var(--accent-orange);
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-item span {
    margin-left: 0.75rem;
    white-space: nowrap;
}

.sidebar.collapsed .nav-item span {
    display: none;
}

.nav-section {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 1rem;
}

.sidebar.collapsed .nav-section {
    display: none;
}

/* Main Content */
.main-content {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed + .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* Header */
.header {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 30;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.toggle-sidebar-btn {
    padding: 0.5rem;
    border-radius: 0.375rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-sidebar-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Page Content */
.page-content {
    flex: 1;
    padding: 1.5rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--brand-primary);
    margin-bottom: 1.5rem;
}

/* ==========================================
   Driver Home Hero Banner (animated greeting)
   ========================================== */
.driver-home-hero {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    color: white;
    padding: 1.25rem 1.25rem;
    border-radius: 1rem;
}
.driver-home-hero__inner {
    display: flex;
    align-items: center;
    gap: 0;
}
.driver-home-hero__logo {
    height: 32px;
    width: auto;
    flex-shrink: 0;
}
.driver-home-hero__pipe {
    color: rgba(255, 255, 255, 0.2);
    font-size: 20px;
    font-weight: 300;
    margin: 0 10px;
    flex-shrink: 0;
}
.driver-home-hero__date {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.875rem;
    margin-top: 0.75rem;
    text-transform: capitalize;
}

.header-text-switcher {
    position: relative;
    height: 24px;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}
.header-text-switcher .hlabel {
    position: absolute;
    top: 0;
    left: 0;
    line-height: 24px;
    white-space: nowrap;
    will-change: transform, opacity;
}
#hlbl-fleet {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    font-weight: 300;
    letter-spacing: 3px;
    text-transform: uppercase;
}
#hlbl-greeting {
    color: white;
    font-size: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}
#hlbl-wave {
    display: inline-block;
    font-size: 16px;
    line-height: 1;
    transform-origin: 70% 80%;
}
@keyframes waveHand {
    0%   { transform: rotate(0deg); }
    10%  { transform: rotate(22deg); }
    25%  { transform: rotate(-8deg); }
    40%  { transform: rotate(20deg); }
    55%  { transform: rotate(-5deg); }
    70%  { transform: rotate(16deg); }
    85%  { transform: rotate(-3deg); }
    100% { transform: rotate(0deg); }
}
#hlbl-wave.waving {
    animation: waveHand 0.9s ease-in-out;
}

/* ==========================================
   Cards
   ========================================== */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

/* Stats Card */
.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-card .stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* ==========================================
   Tables
   ========================================== */
.table-container {
    overflow-x: auto;
    border-radius: var(--border-radius);
    background: white;
    box-shadow: var(--shadow);
}

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

.data-table th,
.data-table td {
    padding: 0.875rem 1rem;
    text-align: left;
}

.data-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    white-space: nowrap;
}

.data-table tbody tr {
    border-top: 1px solid var(--border-color);
    transition: background 0.2s;
}

.data-table tbody tr:hover {
    background: var(--bg-secondary);
}

.data-table td {
    font-size: 0.875rem;
}

/* ==========================================
   Forms
   ========================================== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-label.required::after {
    content: ' *';
    color: var(--brand-danger);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background: white;
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(21, 20, 89, 0.1);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: var(--brand-danger);
}

.form-error {
    font-size: 0.75rem;
    color: var(--brand-danger);
    margin-top: 0.25rem;
}

.form-help {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Input Group */
.input-group {
    display: flex;
}

.input-group .form-input {
    border-radius: 0.375rem 0 0 0.375rem;
}

.input-group-append {
    padding: 0.625rem 0.875rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-left: 0;
    border-radius: 0 0.375rem 0.375rem 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--brand-primary);
}

/* ==========================================
   Buttons
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--brand-primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #1C1B73;
}

.btn-secondary {
    background: var(--brand-secondary);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #3891C4;
}

.btn-accent {
    background: var(--accent-gold);
    color: white;
}

.btn-accent:hover:not(:disabled) {
    background: #BF9D30;
}

.btn-success {
    background: var(--accent-green);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #00C090;
}

.btn-danger {
    background: var(--accent-orange);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #E85A27;
}

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

.btn-ghost:hover:not(:disabled) {
    background: var(--bg-tertiary);
}

.btn-outline {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover:not(:disabled) {
    background: var(--bg-secondary);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

.btn-icon {
    padding: 0.5rem;
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

/* ==========================================
   Status Badges
   ========================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    white-space: nowrap;
}

.badge-success {
    background: #E6FFF7;
    color: #065F46;
}

.badge-warning {
    background: #FFF8E1;
    color: #92400E;
}

.badge-danger {
    background: #FFF0EB;
    color: #991B1B;
}

.badge-info {
    background: var(--brand-light);
    color: var(--brand-primary);
}

.badge-gray {
    background: #F3F4F6;
    color: #374151;
}

.badge-primary {
    background: var(--brand-primary);
    color: white;
}

.badge-secondary {
    background: var(--brand-secondary);
    color: white;
}

.badge-blue {
    background: var(--brand-light);
    color: var(--brand-primary);
}

.badge-green {
    background: #00D9A3;
    color: white;
}

.badge-gold {
    background: #D4AF37;
    color: white;
}

.badge-orange {
    background: #FF6B35;
    color: white;
}

/* ==========================================
   Alert Badges
   ========================================== */
.alert-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

.alert-badge-success {
    background: #E6FFF7;
    color: #065F46;
    border: 1px solid var(--accent-green);
}

.alert-badge-warning {
    background: #FFF8E1;
    color: #92400E;
    border: 1px solid var(--accent-gold);
}

.alert-badge-danger {
    background: #FFF0EB;
    color: #991B1B;
    border: 1px solid var(--accent-orange);
}

.alert-badge-info {
    background: var(--brand-light);
    color: var(--brand-primary);
    border: 1px solid var(--brand-secondary);
}

/* ==========================================
   Notifications
   ========================================== */
.notification-bell {
    position: relative;
    cursor: pointer;
}

.notification-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    background: var(--brand-danger);
    color: white;
    font-size: 0.625rem;
    font-weight: 600;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 360px;
    max-height: 400px;
    background: white;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    z-index: 50;
    margin-top: 0.5rem;
}

.notification-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.notification-item:hover {
    background: var(--bg-secondary);
}

.notification-item.unread {
    background: var(--brand-light);
}

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.notification-message {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 0.125rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ==========================================
   Pagination
   ========================================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
}

.pagination a:hover {
    background: var(--bg-secondary);
}

.pagination .active {
    background: var(--brand-primary);
    color: white;
}

.pagination .disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================
   Toast Notifications
   ========================================== */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    max-width: 400px;
    animation: slideIn 0.3s ease;
}

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

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 0.875rem;
}

.toast-message {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 0.125rem;
}

.toast-close {
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
}

.toast-close:hover {
    color: var(--text-primary);
}

.toast-success { border-left: 4px solid var(--brand-success); }
.toast-error { border-left: 4px solid var(--brand-danger); }
.toast-warning { border-left: 4px solid var(--brand-warning); }
.toast-info { border-left: 4px solid var(--brand-info); }

/* ==========================================
   Modals
   ========================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal {
    background: white;
    border-radius: 0.5rem;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

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

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

/* ==========================================
   Settlement Card (Driver View)
   ========================================== */
.settlement-card {
    background: white;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.settlement-card-header {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    color: white;
    padding: 1.25rem;
}

.settlement-week {
    font-size: 0.875rem;
    opacity: 0.8;
}

.settlement-period {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.settlement-card-body {
    padding: 1.25rem;
}

.settlement-row {
    display: flex;
    justify-content: space-between;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border-color);
}

.settlement-row:last-child {
    border-bottom: none;
}

.settlement-row.total {
    font-weight: 600;
    font-size: 1.125rem;
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 2px solid var(--border-color);
}

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

.settlement-value {
    font-weight: 500;
}

.settlement-value.positive {
    color: var(--brand-success);
}

.settlement-value.negative {
    color: var(--brand-danger);
}

/* ==========================================
   File Upload
   ========================================== */
.file-upload {
    border: 2px dashed var(--border-color);
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.file-upload:hover {
    border-color: var(--brand-primary);
    background: var(--bg-secondary);
}

.file-upload.dragover {
    border-color: var(--brand-primary);
    background: rgba(21, 20, 89, 0.05);
}

.file-upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    color: var(--text-muted);
}

.file-upload-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.file-upload-text strong {
    color: var(--brand-primary);
}

/* ==========================================
   Charts Container
   ========================================== */
.chart-container {
    position: relative;
    height: 300px;
}

/* ==========================================
   Print Styles
   ========================================== */
@media print {
    .sidebar,
    .header,
    .btn,
    .no-print {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .page-content {
        padding: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    body {
        background: white;
    }
}

/* ==========================================
   Responsive Styles
   ========================================== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .main-content {
        margin-left: 0;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 35;
    }
}

@media (max-width: 768px) {
    .page-content {
        padding: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.625rem 0.75rem;
    }

    .notification-dropdown {
        width: 100vw;
        right: -1rem;
        border-radius: 0;
    }

    .header {
        padding: 0 0.75rem;
    }

    .header-left,
    .header-right {
        gap: 0.5rem;
        min-width: 0;
    }

    .header h1 {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        min-width: 0;
        flex: 0 1 auto;
    }

    .btn-icon {
        min-width: 44px;
        min-height: 44px;
    }

    .data-table .btn-sm,
    .data-table .btn-icon,
    table .btn-sm,
    table .btn-icon {
        min-width: 44px;
        min-height: 44px;
        padding: 0.625rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Responsive tables → card list on mobile */
    .data-table--responsive thead { display: none; }

    .data-table--responsive,
    .data-table--responsive tbody,
    .data-table--responsive tr,
    .data-table--responsive td {
        display: block;
        width: 100%;
    }

    .data-table--responsive tr {
        background: #fff;
        border: 1px solid var(--border-color) !important;
        border-radius: 12px;
        margin-bottom: 10px;
        padding: 12px 14px;
        box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    }

    .data-table--responsive tr:hover {
        background: #fff;
    }

    .data-table--responsive td {
        padding: 6px 0 !important;
        border: none !important;
        min-height: 28px;
        font-size: 14px;
    }

    .data-table--responsive td:not(.is-actions) {
        display: grid;
        grid-template-columns: max-content 1fr;
        gap: 12px;
        align-items: center;
        text-align: right;
    }

    .data-table--responsive td::before {
        content: attr(data-label);
        font-size: 11px;
        text-transform: uppercase;
        color: var(--text-secondary);
        font-weight: 600;
        letter-spacing: 0.04em;
        text-align: left;
    }

    .data-table--responsive td:not(.is-actions) > * {
        grid-column: 2;
        justify-self: end;
        text-align: right;
    }

    .data-table--responsive td.is-actions {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        gap: 8px;
        border-top: 1px solid #F3F4F6 !important;
        margin-top: 8px;
        padding-top: 12px !important;
    }

    .data-table--responsive td.is-actions::before { display: none; }

    .data-table--responsive td.is-actions > * {
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }

    /* Hide container chrome when it wraps a responsive table */
    .table-container:has(.data-table--responsive) {
        background: transparent;
        box-shadow: none;
        overflow: visible;
        border-radius: 0;
    }

    /* Form inputs inside responsive table cells stretch to fill column 2 */
    .data-table--responsive td:not(.is-actions) > input,
    .data-table--responsive td:not(.is-actions) > select,
    .data-table--responsive td:not(.is-actions) > textarea {
        width: 100% !important;
        max-width: none !important;
        min-width: 0;
        justify-self: stretch;
    }
}

@media (max-width: 640px) {
    .stat-card {
        padding: 1rem;
    }
    .stat-card .stat-icon {
        width: 36px;
        height: 36px;
        margin-bottom: 0.5rem;
    }
    .stat-card .stat-icon svg {
        width: 18px;
        height: 18px;
    }
    .stat-card .stat-value {
        font-size: 1.25rem;
    }
    .stat-card .stat-label {
        font-size: 0.75rem;
    }
}

/* Settlement create — flex-row sections become vertical cards on mobile */
@media (max-width: 768px) {
    .settlement-form-rows {
        overflow-x: visible;
    }

    /* Hide column headers row (first child of the form-rows wrapper) */
    .settlement-form-rows > div:first-child {
        display: none;
    }

    /* Each row becomes a vertical card */
    .settlement-form-rows .flex.items-center.gap-3 {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 6px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Label area: full width */
    .settlement-form-rows .w-44,
    .settlement-form-rows .w-40 {
        width: 100% !important;
        flex: none;
    }

    /* Inputs container: vertical stack */
    .settlement-form-rows .flex.items-center.gap-2.flex-1 {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100%;
        gap: 6px !important;
    }

    /* Each cell becomes a flex row with mini-label + input */
    .settlement-form-rows .flex.items-center.gap-2.flex-1 > * {
        width: 100% !important;
        display: flex !important;
        align-items: center;
        gap: 8px;
        min-width: 0;
    }

    /* Mini-labels via ::before, position-based */
    .settlement-form-rows .flex.items-center.gap-2.flex-1 > *:nth-child(1)::before {
        content: "C/IVA";
    }
    .settlement-form-rows .flex.items-center.gap-2.flex-1 > *:nth-child(2)::before {
        content: "IVA";
    }
    .settlement-form-rows .flex.items-center.gap-2.flex-1 > *:nth-child(3)::before {
        content: "S/IVA";
    }
    .settlement-form-rows .flex.items-center.gap-2.flex-1 > *::before {
        font-size: 11px;
        color: var(--text-secondary);
        text-transform: uppercase;
        font-weight: 600;
        letter-spacing: 0.04em;
        flex-shrink: 0;
        width: 56px;
    }

    /* Hide empty placeholder cells (parent rows like Uber/Bolt Total) */
    .settlement-form-rows .min-w-\[70px\]:empty {
        display: none !important;
    }
    .settlement-form-rows .flex.items-center.gap-2.flex-1 > div:has(> div.w-\[110px\]:empty) {
        display: none !important;
    }

    /* Inputs and selects: grow to fill remaining space */
    .settlement-form-rows .settlement-input,
    .settlement-form-rows .iva-select {
        flex: 1 !important;
        width: auto !important;
        min-width: 0;
    }

    /* Read-only display divs (.w-[110px]) inside cells */
    .settlement-form-rows .w-\[110px\] {
        width: auto !important;
        flex: 1;
        text-align: right !important;
    }

    /* IVA badge wrapper (sub-rows): left-align */
    .settlement-form-rows .min-w-\[70px\] {
        text-align: left !important;
    }

    /* Regime warning chip: no left indent on mobile */
    .settlement-form-rows .pl-44 {
        padding-left: 0 !important;
    }
}

/* Transfer create form layout */
.transfer-form-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: stretch;
}
.transfer-form-sidebar {
    width: 100%;
}
@media (min-width: 1024px) {
    .transfer-form-layout {
        flex-direction: row;
        align-items: flex-start;
    }
    .transfer-form-layout > .flex-1 {
        flex: 1;
        min-width: 0;
    }
    .transfer-form-sidebar {
        width: 280px;
        flex-shrink: 0;
        position: sticky;
        top: 80px;
    }
}

.pivot-table {
    min-width: 720px;
}
.pivot-scroll {
    -webkit-overflow-scrolling: touch;
}
@media (max-width: 768px) {
    /* Default pivot table: horizontal scroll with sticky first column (matrix data, e.g. Balanço) */
    .pivot-table {
        table-layout: fixed;
    }
    .pivot-table > thead > tr > th:first-child,
    .pivot-table > tbody > tr > td:first-child,
    .pivot-table > tfoot > tr > td:first-child {
        width: 38%;
        position: sticky;
        left: 0;
        background: #fff;
        z-index: 1;
        box-shadow: 2px 0 4px -2px rgba(0,0,0,0.08);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .pivot-table > thead > tr > th:first-child {
        background: #F9FAFB;
    }

    /* Stack modifier (settlement value tables): a compact auto-layout table where the value
       columns (C/IVA · IVA · S/IVA) size to their widest cell and align vertically, right-aligned.
       The label column takes the remaining space and wraps — no horizontal scroll. */
    .pivot-table--stack {
        min-width: 0 !important;
        width: 100%;
        table-layout: auto !important;
    }
    .pivot-table--stack thead { display: none; }
    .pivot-table--stack td,
    .pivot-table--stack th {
        padding: 8px 5px;
    }
    /* Label column: flexible, always breakable so the table can shrink to fit the viewport
       (no horizontal scroll) even with long tokens/descriptions. Undo the sticky-first-column
       matrix treatment. */
    .pivot-table--stack > tbody > tr > td:first-child,
    .pivot-table--stack > tfoot > tr > td:first-child {
        position: static;
        width: auto;
        background: transparent;
        box-shadow: none;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        word-break: break-word;
        overflow-wrap: anywhere;
    }
    /* Value columns shrink to their content (= widest cell in the column), right-aligned. */
    .pivot-table--stack td:not(:first-child),
    .pivot-table--stack th:not(:first-child) {
        width: 1%;
        white-space: nowrap;
        text-align: right !important;
    }
}

/* ==========================================
   Loading Spinner
   ========================================== */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: currentColor;
    animation: spin 0.8s linear infinite;
}

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

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-tertiary);
    border-radius: 50%;
    border-top-color: var(--brand-primary);
    animation: spin 0.8s linear infinite;
}

/* ==========================================
   Empty State
   ========================================== */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    color: var(--text-muted);
}

.empty-state-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.empty-state-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

/* ==========================================
   Settlement Table - Spreadsheet Style
   ========================================== */
.settlement-input {
    width: 110px;
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    background: white;
    text-align: right;
    color: var(--text-primary);
    transition: border-color 0.15s;
}

.settlement-input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 2px rgba(21, 20, 89, 0.1);
}

.drop-highlight {
    outline: 2px dashed var(--brand-primary);
    outline-offset: -2px;
    background: rgba(21, 20, 89, 0.03);
}

.iva-select {
    padding: 0.25rem 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    cursor: pointer;
    appearance: auto;
    text-align: center;
    min-width: 70px;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* ==========================================
   Settlement: Regime de Comissão
   ========================================== */

/* Show/hide blocks based on form's data-regime attribute */
[data-regime="aluguer"]  [data-regime-show="comissao"] { display: none !important; }
[data-regime="comissao"] [data-regime-show="aluguer"]  { display: none !important; }

/* Regime segmented toggle */
.regime-toggle {
    display: inline-flex;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--bg-secondary);
    padding: 0.25rem;
    gap: 0.25rem;
}
.regime-toggle__option { position: relative; cursor: pointer; }
.regime-toggle__option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}
.regime-toggle__option span {
    display: inline-block;
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: 0.375rem;
    transition: background 0.15s ease, color 0.15s ease;
    user-select: none;
}
.regime-toggle__option:hover span { color: var(--text-primary); }
.regime-toggle__option input:checked + span {
    background: var(--brand-primary);
    color: white;
}
.regime-toggle__option input:focus-visible + span {
    outline: 2px solid var(--brand-secondary);
    outline-offset: 2px;
}

/* Driver-percentage input with reactive Frota companion */
.pct-input-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.pct-input-group__field {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid var(--brand-secondary);
    border-radius: 0.5rem;
    padding: 0 0.625rem;
    box-shadow: 0 0 0 3px rgba(69,163,218,0.1);
}
.pct-input-group__field input {
    width: 3.25rem;
    padding: 0.5rem 0;
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--brand-primary);
    text-align: right;
    border: 0;
    outline: none;
    background: transparent;
    font-variant-numeric: tabular-nums;
    font-family: inherit;
}
.pct-input-group__sym {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--brand-primary);
    margin-left: 0.25rem;
}
.pct-input-group__hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.3;
}
.pct-input-group__hint b {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.875rem;
    display: block;
    font-variant-numeric: tabular-nums;
}

/* ⚠️ warning chip (used next to Renda when in Comissão) */
.warn-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #FFF8E1;
    color: #92400E;
    padding: 0.1875rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    border: 1px solid #FCE7AA;
}

/* Commission payout card — admin (3-line) */
.commission-payout {
    background: var(--brand-primary);
    color: white;
    border-radius: 0.5rem;
    padding: 1rem 1.5rem 1.25rem;
    box-shadow: 0 8px 30px -12px rgba(21,20,89,0.4);
}
.commission-payout__total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0 0.875rem;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}
.commission-payout__total-label {
    font-size: 0.6875rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.6);
    font-weight: 600;
}
.commission-payout__total-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: rgba(255,255,255,0.85);
    font-variant-numeric: tabular-nums;
}
.commission-payout__split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-top: 1rem;
}
.commission-payout__cell-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.6875rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.65);
    font-weight: 600;
}
.commission-payout__cell-pct {
    background: rgba(255,255,255,0.12);
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.625rem;
    letter-spacing: 0.04em;
    font-weight: 700;
    color: white;
}
.commission-payout__cell-value {
    margin-top: 0.375rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}
.commission-payout__cell-sub {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.55);
}
.commission-payout__cell-sub-label { opacity: 0.7; }
.commission-payout__cell--driver .commission-payout__cell-value {
    font-size: 2.125rem;
    color: var(--brand-success);
}
.commission-payout__cell--driver .commission-payout__cell-pct {
    background: rgba(0,217,163,0.25);
    color: var(--brand-success);
}
.commission-payout__cell--fleet .commission-payout__cell-value {
    color: rgba(255,255,255,0.7);
}

@media (max-width: 600px) {
    .commission-payout__split { grid-template-columns: 1fr; }
}

/* Driver-side commission payout — 2-line: Total + Receber, no Frota */
.driver-commission-payout {
    background: linear-gradient(135deg, #151459 0%, #45A3DA 100%);
    color: white;
    border-radius: 0.75rem;
    padding: 0;
    overflow: hidden;
}
.driver-commission-payout.is-debt {
    background: linear-gradient(135deg, #FF6B35 0%, #D4321B 100%);
}
.driver-commission-payout__top {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}
.driver-commission-payout__label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: rgba(255,255,255,0.65);
    font-weight: 600;
}
.driver-commission-payout__total-value {
    font-size: 1.0625rem;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
    font-variant-numeric: tabular-nums;
}
.driver-commission-payout__hero {
    padding: 1.25rem;
    text-align: center;
}
.driver-commission-payout__pct {
    display: inline-block;
    background: rgba(0,217,163,0.25);
    color: var(--brand-success);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}
.is-debt .driver-commission-payout__pct {
    background: rgba(255,255,255,0.2);
    color: white;
}
.driver-commission-payout__hero-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: rgba(255,255,255,0.7);
    margin: 0;
    font-weight: 600;
}
.driver-commission-payout__hero-value {
    font-size: 2.625rem;
    font-weight: 800;
    color: var(--brand-success);
    margin: 0.375rem 0 0;
    line-height: 1;
    letter-spacing: -0.025em;
    font-variant-numeric: tabular-nums;
}
.is-debt .driver-commission-payout__hero-value {
    color: white;
}
.driver-commission-payout__hero-sub {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
    margin: 0.625rem 0 0;
}

/* ==========================================
   Privacy Toggle (transfers list)
   ========================================== */
.privacy-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: 6px 10px;
    border-radius: 8px;
    transition: background 0.2s;
}
.privacy-toggle:hover {
    background: var(--bg-secondary);
}
.privacy-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.privacy-toggle__track {
    width: 36px;
    height: 20px;
    background: #D1D5DB;
    border-radius: 9999px;
    position: relative;
    transition: background 0.2s;
    flex-shrink: 0;
}
.privacy-toggle__thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}
.privacy-toggle input:checked + .privacy-toggle__track {
    background: var(--brand-primary);
}
.privacy-toggle input:checked + .privacy-toggle__track .privacy-toggle__thumb {
    transform: translateX(16px);
}
.privacy-toggle input:focus-visible + .privacy-toggle__track {
    outline: 2px solid var(--brand-secondary);
    outline-offset: 2px;
}
.privacy-toggle__label {
    color: var(--text-primary);
    font-weight: 500;
}

/* When privacy mode is ON: hide DL value cells (both desktop and mobile card) */
.dl-private-on .dl-private-col {
    display: none !important;
}
/* Reflow the transfers stats grid when one card is hidden so the remaining 3 cards fill the row */
.dl-private-on .transfers-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
}
@media (min-width: 768px) {
    .dl-private-on .transfers-stats-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* ==========================================
   Sidebar: The Golden Triangle sub-section
   ========================================== */
.nav-gt-section {
    margin: 0.75rem 0.5rem 0.25rem;
    background: linear-gradient(135deg, rgba(212,175,55,0.18) 0%, rgba(212,175,55,0.06) 100%);
    border: 1px solid rgba(212,175,55,0.35);
    border-radius: 12px;
    padding: 0.5rem 0 0.5rem;
    position: relative;
}
.nav-gt-section::before {
    content: "▲";
    color: var(--accent-gold);
    font-size: 9px;
    position: absolute;
    top: 8px;
    right: 12px;
    opacity: 0.85;
}
.nav-gt-label {
    color: var(--accent-gold);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    padding: 0 1rem 0.4rem;
}
.nav-item--gt {
    color: rgba(255,255,255,0.85) !important;
    margin: 0;
    padding: 0.55rem 1rem !important;
    border-left: 3px solid transparent !important;
}
.nav-item--gt:hover {
    background: rgba(212,175,55,0.15) !important;
    color: white !important;
}
.nav-item--gt.active {
    background: rgba(212,175,55,0.25) !important;
    color: white !important;
    border-left-color: var(--accent-gold) !important;
}

/* ==========================================
   Transfers — weekly calendar (agenda by day)
   ========================================== */
.cal-viewtoggle {
    display: inline-flex;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.cal-viewtoggle__btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    background: #fff;
}
.cal-viewtoggle__btn:hover { background: var(--bg-page); }
.cal-viewtoggle__btn.is-active {
    background: var(--brand-primary);
    color: #fff;
}

.cal-week {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}
@media (min-width: 900px) {
    .cal-week { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}

.cal-day {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 90px;
}
@media (min-width: 900px) {
    .cal-day { min-height: 220px; }
}
.cal-day.is-today { border-color: var(--brand-secondary); box-shadow: 0 0 0 1px var(--brand-secondary); }

.cal-day__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 0.45rem 0.6rem;
    border-bottom: 1px solid var(--border-color);
    background: #F9FAFB;
}
.cal-day.is-today .cal-day__head { background: var(--brand-primary); }
.cal-day__wd {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}
.cal-day__num { font-size: 1rem; font-weight: 800; color: var(--brand-primary); }
.cal-day.is-today .cal-day__wd,
.cal-day.is-today .cal-day__num { color: #fff; }

.cal-day__body {
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
}
.cal-day__empty { color: #D1D5DB; text-align: center; margin: 0.5rem 0; font-size: 0.85rem; }

.cal-event {
    display: block;
    text-decoration: none;
    background: var(--brand-light-muted, rgba(206,235,255,0.3));
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--brand-secondary);
    border-radius: 7px;
    padding: 0.4rem 0.5rem;
    transition: background 0.15s, box-shadow 0.15s;
}
.cal-event:hover { background: var(--brand-light); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.cal-event__time { display: block; font-size: 0.78rem; font-weight: 800; color: var(--brand-primary); }
.cal-event__route {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.76rem;
    color: var(--text-primary);
    line-height: 1.25;
    margin-top: 0.1rem;
}
.cal-event__arrow { color: var(--text-secondary); }
.cal-event__driver { display: block; font-size: 0.72rem; color: var(--text-secondary); margin-top: 0.15rem; }
.cal-event__driver--none { font-style: italic; }

/* Platform chip inside a calendar event card */
.cal-event__plat {
    display: inline-block;
    margin-top: 0.2rem;
    font-size: 0.66rem;
    font-weight: 700;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    background: var(--brand-light);
    color: var(--brand-primary);
}

/* Calendar event footer: price left, platform chip right (same row) */
.cal-event__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    margin-top: 0.45rem;
    padding-top: 0.4rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.cal-event__price { font-weight: 700; color: var(--brand-primary); font-size: 0.78rem; }
.cal-event__foot .cal-event__plat { margin-top: 0; }

/* Calendar event: top row (time left, platform right) + per-stop lines */
.cal-event__top { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; margin-bottom: 0.35rem; }
.cal-event__top .cal-event__time { margin-bottom: 0; }
.cal-stop { display: flex; align-items: flex-start; gap: 0.4rem; font-size: 0.76rem; color: var(--text-primary); line-height: 1.25; margin: 0 0 0.25rem; }
.cal-stop:last-of-type { margin-bottom: 0; }
.cal-stop__k { flex: none; width: 16px; height: 16px; border-radius: 5px; display: flex; align-items: center; justify-content: center; font-size: 0.62rem; font-weight: 800; color: #fff; margin-top: 0.05rem; }
.cal-stop--a  .cal-stop__k { background: var(--accent-green); }
.cal-stop--wp .cal-stop__k { background: var(--brand-secondary); }
.cal-stop--b  .cal-stop__k { background: var(--accent-orange); }

/* ==========================================
   Documentos (admin /admin/documents + driver /driver/documents)
   ========================================== */
.doc-tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0 1rem;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.doc-tabs__tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.85rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
}
.doc-tabs__tab:hover { color: var(--brand-primary); }
.doc-tabs__tab.is-active { color: var(--brand-primary); border-bottom-color: var(--brand-primary); }
.doc-tabs__count {
    font-size: 0.7rem;
    background: var(--bg-secondary);
    color: #374151;
    border-radius: 9999px;
    padding: 0.05rem 0.45rem;
}
.doc-tabs__count.is-alert { background: var(--accent-gold); color: #fff; }

.doc-row--pending td { background: #FFFDF5; }
.doc-badge--pending { border: 1px dashed var(--accent-gold); }

.doc-ficon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.62rem;
    font-weight: 800;
    flex-shrink: 0;
}
.doc-ficon--pdf { background: #FFF0EB; color: var(--accent-orange); }
.doc-ficon--img { background: var(--brand-light); color: var(--brand-primary); }

.doc-section-title { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.6rem; }
.doc-section-title h2 { margin: 0; font-size: 1rem; font-weight: 700; color: var(--brand-primary); }

.doc-card {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem 0.5rem 0.75rem 0.8rem;
    margin-bottom: 0.55rem;
    min-height: 56px;
    color: var(--text-primary);
}
.doc-card:hover { border-color: var(--brand-secondary); }
.doc-card--rejected { border-color: var(--accent-orange); }
.doc-card__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.doc-card__title { font-size: 0.9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-card__sub { font-size: 0.75rem; color: var(--text-secondary); }
.doc-card__go { width: 20px; height: 20px; color: var(--brand-secondary); flex-shrink: 0; margin: 0 0.4rem; }

.doc-empty {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 1rem;
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    background: #fff;
}

.doc-upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    min-height: 44px;
    margin-bottom: 0.55rem;
    border-radius: 10px;
    border: 1px dashed var(--brand-secondary);
    background: var(--brand-light-muted);
    color: var(--brand-primary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}
.doc-upload-btn:hover { background: var(--brand-light); }

.doc-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 1.25rem 1rem;
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
}
.doc-drop:hover, .doc-drop.is-dragging { border-color: var(--brand-secondary); background: var(--brand-light-muted); }

/* Driver upload: bottom sheet on phones, centred modal on larger screens */
@media (max-width: 640px) {
    .doc-sheet-overlay { align-items: flex-end; padding: 0; }
    .doc-sheet { max-width: none; border-radius: 18px 18px 0 0; }
}
