:root {
    --primary-blue: #004a99;
    --accent-blue: #00aeef;
    --header-bg: #f8f9fa;
    --text-dark: #1a1a1a;
    --text-muted: #6c757d;
    --border-grey: #e0e0e0;
    --bg-main: #f0f2f5;
    --white: #ffffff;
    --success-green: #2ecc71;
    --error-red: #e74c3c;
    --glass-bg: rgba(255, 255, 255, 0.9);
    --shadow-soft: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Fons de quadrícula desactivat (estètica neta) */
.technical-grid-bg {
    display: none;
}

/* Main Layout & Background */
body {
    font-family: 'Inter', sans-serif;
    background: #f8f9fa;
    color: var(--text-dark);
    font-size: 13px;
    line-height: 1.5;
    min-height: 100vh;
}

/* Header Redesign */
.main-header {
    background: #ffffff;
    padding: 10px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #eee;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-logo {
    height: 65px;
    object-fit: contain;
}

.search-box {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-grow: 1;
    justify-content: center;
}

.eng-date-input {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fdfdfd;
    font-size: 0.9rem;
    color: #444;
}

.search-box input[type="text"] {
    width: 350px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
    transition: box-shadow 0.2s;
}

.search-box input[type="text"]:focus {
    box-shadow: 0 0 0 3px rgba(0, 74, 153, 0.1);
    border-color: var(--primary-blue);
    outline: none;
}

#search-btn {
    background: #004a99;
    color: white;
    padding: 10px 25px;
    border-radius: 8px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.2s;
}

#search-btn:hover {
    background: #003a7a;
}

.route-choice-panel {
    width: 100%;
    max-width: 980px;
    margin: 18px auto;
}

.route-choice-card {
    background: #fff;
    border: 1px solid var(--border-grey);
    border-left: 4px solid var(--primary-blue);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
    padding: 18px;
}

.route-choice-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.route-choice-header h2 {
    color: var(--primary-blue);
    font-size: 1.2rem;
    margin: 0;
}

.route-choice-list {
    display: grid;
    gap: 10px;
}

.route-choice-item {
    width: 100%;
    text-align: left;
    border: 1px solid #cfd8e3;
    background: #f8fbff;
    padding: 12px;
    cursor: pointer;
    border-radius: 6px;
}

.route-choice-item:hover {
    border-color: var(--primary-blue);
    background: #eef6ff;
}

.route-choice-main {
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 3px;
}

.route-choice-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.signature-section {
    margin-top: 22px;
    border: 1px solid var(--border-grey);
    background: #fff;
    padding: 14px;
}

.signature-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 10px;
}

.signature-title {
    font-weight: 800;
    color: var(--primary-blue);
}

.signature-subtitle,
.autosave-status {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.signature-canvas {
    display: block;
    width: 100%;
    height: 170px;
    border: 2px dashed #9fb7cf;
    background: #fbfdff;
    touch-action: none;
}

.signature-confirm-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
    font-weight: 600;
}

.autosave-status {
    margin-top: 8px;
}

.autosave-status.saving {
    color: #b26a00;
}

.autosave-status.saved {
    color: #1e8449;
}

.autosave-status.error {
    color: var(--error-red);
}

/* Modern Welcome Screen */
.modern-welcome {
    position: relative;
    width: 100%;
    height: calc(100vh - 80px);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Fons de circuit desactivat (estètica neta) */
.circuit-bg {
    display: none;
}

/* Targeta neta i moderna per a totes les pantalles */
.engineering-card {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 6px 24px rgba(15, 40, 80, 0.10);
}

/* Overlay de login centrat i net */
#login-overlay {
    position: fixed;
    inset: 0;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eef3f9 0%, #dde8f3 100%);
    z-index: 1000;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 430px;
    padding: 38px 34px;
    text-align: center;
}

.login-logo img {
    height: 110px;
    object-fit: contain;
    margin-bottom: 8px;
}

.login-card h2 {
    color: var(--primary-blue);
    font-size: 1.6rem;
    margin-bottom: 4px;
}

.login-eco-intro {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.eco-phrase {
    background: #eef7f0;
    border-left: 4px solid #2ecc71;
    border-radius: 8px;
    padding: 12px 14px;
    color: #1e6b3a;
    font-style: italic;
    font-size: 0.95rem;
    line-height: 1.4;
    margin-bottom: 22px;
    text-align: left;
}

.login-input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#login-password {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid #cfd8e3;
    border-radius: 10px;
    font-size: 1rem;
    text-align: center;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

#login-password:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 74, 153, 0.12);
}

#login-btn {
    width: 100%;
    padding: 13px;
    background: var(--primary-blue);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.98rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background 0.15s, transform 0.05s;
}

#login-btn:hover {
    background: #003a7a;
}

#login-btn:active {
    transform: scale(0.99);
}

#login-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.welcome-card {
    background: #ffffff;
    padding: 60px 50px;
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    text-align: center;
    width: 100%;
    max-width: 750px;
    z-index: 10;
    border: 1px solid #f0f0f0;
}

.welcome-logo-large img {
    height: 140px;
    margin-bottom: 30px;
}

.welcome-card h1 {
    font-size: 3.2rem;
    color: #004a99;
    margin-bottom: 20px;
    font-weight: 800;
    letter-spacing: -1px;
}

.welcome-subtitle {
    font-size: 1.4rem;
    color: #888;
    margin-bottom: 40px;
    font-weight: 500;
}

.instruction-box {
    background: linear-gradient(135deg, #5c59ac 0%, #46438b 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    text-align: left;
    margin-top: 20px;
    box-shadow: 0 10px 20px rgba(70, 67, 139, 0.2);
}

.info-icon svg {
    width: 32px;
    height: 32px;
}

.instruction-box p {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 500;
    opacity: 0.95;
    line-height: 1.4;
}

/* Hide route sheet by default */
.route-sheet {
    width: 1050px;
    max-width: 98vw;
    background: var(--white);
    padding: 15px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    display: none;
    margin: 20px auto;
}

/* 3-Column Top Header */
.sheet-top-header {
    display: grid;
    grid-template-columns: 220px 1fr 220px;
    border-bottom: 2px solid #000;
    padding-bottom: 15px;
    margin-bottom: 5px;
    align-items: center;
}

.logos {
    display: flex;
    gap: 15px;
    align-items: center;
}

.header-center {
    text-align: center;
}

.header-center h1 {
    font-size: 1.1rem;
    margin: 5px 0;
    color: #000;
}

.header-center h2 {
    font-size: 1.2rem;
    font-weight: bold;
}

.header-right-box {
    border: 1px solid var(--border-grey);
    display: grid;
    grid-template-columns: 80px 1fr;
}

.right-box-item {
    border: 0.5px solid var(--border-grey);
    padding: 5px;
    min-height: 25px;
    display: flex;
    align-items: center;
}

.right-box-label {
    background: var(--header-bg);
    font-size: 0.7rem;
    justify-content: flex-end;
    color: #555;
    font-weight: bold;
}

.right-box-value {
    font-weight: bold;
    font-size: 1rem;
    justify-content: flex-end;
    padding-right: 10px;
}

/* Field Groups (Servei, Centre, etc) */
.field-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    margin-bottom: 5px;
}

.field {
    border: 1px solid var(--border-grey);
    display: flex;
    flex-direction: column;
}

.field-label {
    background: var(--primary-blue);
    font-size: 0.7rem;
    padding: 2px 5px;
    font-weight: bold;
    color: #fff;
}

.field-value {
    padding: 5px;
    font-weight: 500;
    font-size: 0.95rem;
    min-height: 25px;
}

/* Vehicle Section */
.vehicle-container {
    margin-top: 5px;
    margin-bottom: 5px;
}

.vehicle-header-label {
    background: var(--primary-blue);
    border: 1px solid var(--border-grey);
    border-bottom: none;
    font-size: 0.7rem;
    padding: 2px 5px;
    font-weight: bold;
    color: #fff;
}

.vehicle-row {
    display: grid;
    grid-template-columns: 200px 120px 1fr;
    border: 1px solid var(--border-grey);
    background: #fff;
}

.veh-col {
    border-right: 1px solid var(--border-grey);
}

.veh-col:last-child {
    border-right: none;
}

/* Table Styles */
.sheet-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 5px;
}

.sheet-table th {
    background: var(--primary-blue);
    border: 1px solid var(--border-grey);
    padding: 4px 8px;
    font-size: 0.75rem;
    text-align: left;
    font-weight: bold;
    color: #fff;
}

.sheet-table td {
    border: 1px solid var(--border-grey);
    padding: 4px 8px;
    vertical-align: middle;
}

.row-header {
    background: var(--header-bg);
    font-weight: bold;
    font-size: 0.9rem;
}

/* Inputs */
.sheet-input {
    width: 100%;
    border: none;
    padding: 4px;
    font-family: inherit;
    font-size: 1.1rem;
    background: transparent;
    outline: none;
    color: #004a99;
    font-weight: bold;
}

textarea.sheet-input {
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
}

.sheet-input:focus {
    background: #fff9c4;
}

/* Checklist Section */
.checklist-container {
    margin-top: 10px;
    border: 1px solid var(--border-grey);
}

.checklist-header {
    background: #e8f5e9;
    /* Light green header */
    padding: 3px 10px;
    font-size: 0.75rem;
    font-weight: bold;
    border-bottom: 1px solid var(--border-grey);
}

.checklist-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: #fff;
}

/* Sheet Inputs - Premium Editable Style */
.sheet-input {
    border: none;
    border-bottom: 2px dashed #ddd;
    background: transparent;
    padding: 2px 5px;
    font-family: inherit;
    color: #333;
    transition: all 0.2s ease;
    outline: none;
}

.sheet-input:focus {
    border-bottom: 2px solid var(--primary-blue);
    background: rgba(0, 74, 153, 0.03);
    color: #000;
}

.sheet-input::placeholder {
    color: #ccc;
    font-style: italic;
    font-size: 0.8rem;
}

.checklist-item {
    border-right: 1px solid var(--border-grey);
    border-bottom: 1px solid var(--border-grey);
    padding: 6px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 35px;
}

.checklist-item:nth-child(4n) {
    border-right: none;
}

.checklist-item label {
    font-size: 0.75rem;
    color: #444;
    font-weight: 500;
}

.checklist-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.fuel-input-container {
    display: flex;
    align-items: center;
    gap: 5px;
}

.fuel-liters {
    width: 50px;
    padding: 2px;
    border: 1px solid var(--border-grey);
    border-radius: 3px;
    font-size: 0.8rem;
    text-align: right;
    display: none;
    /* Shown when fuel checkbox is checked */
}

/* Reporting Buttons */
.report-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
    padding: 5px 0;
}

.report-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-grey);
    border-radius: 20px;
    background: #f8f9fa;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.report-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

.report-btn.fraction-btn {
    color: #004a99;
    border-color: #a3c1e0;
}

.report-btn.fraction-btn:active {
    background: #e3f2fd;
}

.report-btn.breakdown-btn {
    color: #c62828;
    border-color: #ffccbc;
}

.report-btn.breakdown-btn:active {
    background: #ffebee;
}

/* Engineering Buttons */
.eng-btn-primary,
.eng-btn-secondary {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.eng-btn-primary {
    background: var(--primary-blue);
    color: white;
    border: 1px solid var(--primary-blue);
    box-shadow: 0 4px 6px rgba(0, 74, 153, 0.2);
}

.eng-btn-primary:hover {
    background: #003a7a;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 74, 153, 0.3);
}

.eng-btn-secondary {
    background: white;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.eng-btn-secondary:hover {
    background: #f0f7ff;
    transform: translateY(-1px);
}

/* History Table Styles */
.history-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.history-table tr:hover {
    background-color: #e3f2fd;
}

.history-table td {
    font-size: 0.9rem;
    color: #444;
}

.history-table .action-btn {
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    margin: 0 2px;
}

.history-table .view-btn {
    background: #e3f2fd;
    color: var(--primary-blue);
    border: 1px solid var(--primary-blue);
}

.history-table .delete-btn {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.history-table .delete-btn:hover {
    background: #ef5350;
    color: white;
}

/* Botó de plegar capçalera: només visible en mòbil */
.header-toggle {
    display: none;
}

/* Botó per afegir vehicle manualment en serveis a peu */
.add-vehicle-btn {
    width: 100%;
    margin: 8px 0;
    padding: 10px;
    background: #fff;
    color: var(--primary-blue);
    border: 1.5px dashed var(--primary-blue);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
}

.add-vehicle-btn:hover {
    background: #eef6ff;
}

.remove-vehicle-btn {
    width: 100%;
    margin: 0 0 8px;
    padding: 8px;
    background: #fff;
    color: #c0392b;
    border: 1px solid #e8b4b0;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
}

.remove-vehicle-btn:hover {
    background: #fdecea;
}

/* ===== Comptadors i temps (blocs Inici / Descansos / Fi) ===== */
.comptadors-section {
    margin-top: 8px;
    margin-bottom: 5px;
}

.cmp-title {
    background: var(--primary-blue);
    color: #fff;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 3px 8px;
}

.cmp-block {
    border: 1px solid var(--border-grey);
    border-top: none;
}

.cmp-block-title {
    background: #eef3f9;
    color: var(--primary-blue);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 6px 10px;
    border-bottom: 1px solid var(--border-grey);
}

.cmp-field,
.cmp-break {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-bottom: 1px solid #eef1f5;
}

.cmp-field:last-child,
.cmp-break:last-child {
    border-bottom: none;
}

.cmp-label {
    flex: 0 0 44%;
    font-size: 0.85rem;
    font-weight: 600;
    color: #444;
}

.cmp-field input,
.cmp-break input {
    flex: 1;
    min-width: 0;
    border: 1px solid #cfd8e3;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 0.95rem;
    background: #fff;
}

.cmp-field input:focus,
.cmp-break input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 2px rgba(0, 74, 153, 0.12);
}

.cmp-sep {
    color: #888;
    font-weight: 700;
}

.req {
    color: #e74c3c;
    font-weight: 700;
}

.map-btn {
    width: 100%;
    margin: 10px 0 4px;
    padding: 11px;
    background: #eef6ff;
    color: var(--primary-blue);
    border: 1.5px solid var(--primary-blue);
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
}

.map-btn:hover {
    background: #dcecff;
}

#map-canvas {
    width: 100%;
    height: 100%;
}

.cmp-hint {
    padding: 4px 12px 9px;
    font-size: 0.78rem;
    color: #1e6b3a;
    background: #eef7f0;
    border-bottom: 1px solid #eef1f5;
}

.ara-btn {
    flex: 0 0 auto;
    margin-left: 6px;
    padding: 8px 12px;
    background: var(--primary-blue);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    text-transform: lowercase;
}

.ara-btn:hover {
    background: #003a7a;
}

.cmp-textarea {
    width: 100%;
    border: none;
    outline: none;
    padding: 9px 11px;
    min-height: 60px;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    background: #fff;
    box-sizing: border-box;
}

/* ===== Responsive mòbil ===== */
@media (max-width: 820px) {
    .main-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 10px 14px;
    }

    .header-top-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    .header-toggle {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: var(--primary-blue);
        color: #fff;
        border: none;
        border-radius: 8px;
        padding: 9px 16px;
        font-weight: 700;
        font-size: 0.85rem;
        cursor: pointer;
    }

    /* Quan està plegada, amaga cercador i navegació (deixa logo + botó) */
    .main-header.collapsed {
        gap: 0;
    }

    .main-header.collapsed .search-box,
    .main-header.collapsed .header-actions {
        display: none;
    }

    .logo-container {
        text-align: center;
    }

    .header-logo {
        height: 46px;
    }

    .search-box {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 8px;
    }

    .eng-date-input,
    .search-box input[type="text"] {
        width: 100%;
    }

    #search-btn {
        width: 100%;
        padding: 13px;
    }

    .header-actions {
        display: flex;
        gap: 8px;
        width: 100%;
    }

    .header-actions button {
        flex: 1;
    }

    .modern-welcome {
        height: auto;
        min-height: auto;
        overflow: visible;
        padding: 24px 14px;
    }

    .welcome-card {
        padding: 30px 22px;
        border-radius: 18px;
    }

    .welcome-logo-large img {
        height: 90px;
    }

    .welcome-card h1 {
        font-size: 1.9rem;
        letter-spacing: -0.5px;
        margin-bottom: 14px;
    }

    .welcome-subtitle {
        font-size: 1.05rem;
        margin-bottom: 26px;
    }

    /* Pantalles de taula (historial, control) amb scroll horitzontal */
    #history-screen,
    #control-screen {
        width: 100%;
        padding: 0 6px;
    }

    .history-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    /* --- Hoja de ruta (full de ruta) responsive --- */
    .route-sheet {
        padding: 12px !important;
        margin: 8px auto !important;
    }

    .sheet-top-header {
        grid-template-columns: 1fr !important;
        text-align: center;
        gap: 8px;
    }

    .sheet-top-header .logos {
        justify-content: center !important;
    }

    .header-center h1 {
        font-size: 1.3rem !important;
        margin: 6px 0 !important;
    }

    .header-right-box {
        grid-template-columns: 90px 1fr;
    }

    .field-group {
        grid-template-columns: 1fr;
    }

    .vehicle-row {
        grid-template-columns: 1fr 1fr;
    }

    .vehicle-row .veh-col:nth-child(3) {
        grid-column: 1 / -1;
        border-top: 1px solid var(--border-grey);
    }

    .checklist-grid {
        grid-template-columns: 1fr 1fr !important;
    }

    /* Taules amples (personal, etc.): scroll horitzontal */
    .sheet-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    #signature-canvas {
        width: 100% !important;
    }
}

/* Desktop/Print adjustments */
@media print {
    header {
        display: none;
    }

    body {
        background: white;
        padding: 0;
    }

    .route-sheet {
        box-shadow: none;
        border: none;
        width: 100%;
        max-width: 100%;
        padding: 0;
    }
}

/* ===== Vision clean integration v2 =====
   Solo cambia aspecto de controles reales. Sin barras, pestanas ni iconos falsos. */
body::before,
body::after,
.main-header::before,
.main-header::after {
    content: none !important;
    display: none !important;
}

html,
body {
    background: #e8f1f8;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    font-size: 13px;
    color: #16324f;
}

#app-content {
    padding-left: 0 !important;
}

.main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: grid !important;
    grid-template-columns: minmax(210px, 300px) minmax(420px, 1fr) auto;
    grid-template-areas: "brand search actions";
    align-items: center;
    gap: 14px;
    min-height: 58px !important;
    padding: 8px 14px !important;
    background: linear-gradient(#f8fbfe, #eef5fb);
    border-top: 4px solid #3f7fb6;
    border-bottom: 1px solid #afcce3;
    box-shadow: 0 2px 8px rgba(33, 80, 120, 0.08);
}

.header-top-row {
    grid-area: brand;
    margin-top: 0 !important;
    height: auto !important;
    padding: 0 !important;
    background: transparent !important;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-container::after {
    content: "Full de ruta digital";
    color: #005a9c;
    font-weight: 800;
    font-size: 15px;
    white-space: nowrap;
}

.header-logo {
    height: 34px !important;
    width: auto;
}

.search-box {
    grid-area: search;
    margin-top: 0 !important;
    height: auto !important;
    display: grid !important;
    grid-template-columns: 150px minmax(230px, 1fr) 112px;
    gap: 8px;
    align-items: center;
    padding: 0 !important;
    background: transparent !important;
}

.header-actions {
    grid-area: actions;
    margin-top: 0 !important;
    height: auto !important;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 !important;
    background: transparent !important;
}

.eng-date-input,
.search-box input[type="text"],
.history-filters input,
.cmp-field input,
.cmp-break input,
#login-password {
    height: 30px !important;
    min-height: 30px !important;
    padding: 5px 9px !important;
    border: 1px solid #9fc2df !important;
    border-radius: 4px !important;
    background: #fff !important;
    color: #16324f !important;
    font-size: 13px !important;
}

.eng-date-input:focus,
.search-box input[type="text"]:focus,
.history-filters input:focus,
.cmp-field input:focus,
.cmp-break input:focus,
#login-password:focus {
    border-color: #2f76b4 !important;
    box-shadow: 0 0 0 3px rgba(47, 118, 180, 0.16) !important;
    outline: none !important;
}

#search-btn,
.eng-btn-primary,
.eng-btn-secondary,
#login-btn,
.ara-btn,
.history-table .action-btn,
.add-vehicle-btn,
.remove-vehicle-btn,
.report-btn {
    border-radius: 4px !important;
    font-family: "Inter", "Segoe UI", Arial, sans-serif !important;
    letter-spacing: 0 !important;
    box-shadow: none !important;
    transform: none !important;
}

#search-btn {
    height: 30px !important;
    padding: 5px 14px !important;
    background: #2f76b4 !important;
    border: 1px solid #245f93 !important;
    color: #fff !important;
    font-size: 13px !important;
    font-weight: 700 !important;
}

#search-btn::before {
    content: "";
}

#search-btn:hover,
.eng-btn-primary:hover,
#login-btn:hover,
.ara-btn:hover {
    background: #225f95 !important;
}

.eng-btn-secondary,
.history-table .view-btn {
    min-height: 30px !important;
    padding: 5px 12px !important;
    background: #ffffff !important;
    color: #1d5f98 !important;
    border: 1px solid #9fc2df !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    text-transform: none !important;
}

.eng-btn-secondary:hover,
.history-table .view-btn:hover {
    background: #e7f2fb !important;
}

main {
    padding: 16px !important;
}

.modern-welcome {
    height: auto !important;
    min-height: calc(100vh - 90px);
    align-items: flex-start !important;
    padding-top: 24px !important;
}

.welcome-card {
    max-width: 760px !important;
    padding: 34px 42px !important;
    border-radius: 6px !important;
    border: 1px solid #bfd5e8 !important;
    box-shadow: 0 10px 28px rgba(35, 80, 120, 0.10) !important;
}

.welcome-logo-large img {
    height: 92px !important;
    margin-bottom: 18px !important;
}

.welcome-card h1 {
    color: #005a9c !important;
    font-size: 1.75rem !important;
    letter-spacing: 0 !important;
    margin-bottom: 8px !important;
}

.welcome-subtitle {
    color: #566d80 !important;
    font-size: 0.98rem !important;
    margin-bottom: 22px !important;
}

.instruction-box {
    background: #edf6fd !important;
    color: #1d5f98 !important;
    border: 1px solid #b8d2e6 !important;
    border-left: 4px solid #2f76b4 !important;
    border-radius: 4px !important;
    box-shadow: none !important;
    padding: 14px 18px !important;
}

.info-icon {
    color: #2f76b4 !important;
}

.route-sheet,
#history-screen,
#control-screen {
    width: min(1480px, calc(100vw - 32px)) !important;
    max-width: none !important;
    margin: 0 auto 16px !important;
}

.route-sheet,
.route-choice-card,
.engineering-card,
#control-screen > div {
    border-radius: 5px !important;
    border: 1px solid #bfd5e8 !important;
    box-shadow: 0 8px 22px rgba(35, 80, 120, 0.08) !important;
    background: #fff !important;
}

.route-sheet {
    padding: 12px !important;
}

.sheet-top-header {
    grid-template-columns: 190px 1fr 230px !important;
    border-bottom: 1px solid #bfd5e8 !important;
    padding: 10px 8px !important;
    background: #fff !important;
}

.header-center h1 {
    color: #111 !important;
    font-size: 1.55rem !important;
    margin: 10px 0 !important;
}

.field-label,
.vehicle-header-label,
.sheet-table th,
.cmp-title,
.route-choice-header,
.signature-header {
    background: #2f76b4 !important;
    color: #fff !important;
}

.field-label,
.vehicle-header-label,
.sheet-table th,
.cmp-title {
    font-size: 11px !important;
    line-height: 18px !important;
    padding: 3px 7px !important;
}

.field,
.vehicle-row,
.checklist-container,
.cmp-block,
.signature-section,
.sheet-table td,
.sheet-table th {
    border-color: #bfd5e8 !important;
}

.field-value {
    font-size: 13px !important;
    min-height: 28px !important;
    padding: 6px 7px !important;
}

.sheet-input,
textarea.sheet-input,
.cmp-textarea {
    border: 1px solid #c2d8e9 !important;
    border-radius: 4px !important;
    background: #fff !important;
    color: #1b2d3f !important;
    font-size: 13px !important;
    font-weight: 500 !important;
}

.sheet-input:focus,
textarea.sheet-input:focus,
.cmp-textarea:focus {
    background: #fffde6 !important;
    border-color: #2f76b4 !important;
}

.checklist-header,
.cmp-block-title {
    background: #e8f5e2 !important;
    color: #285f1e !important;
    border-bottom: 1px solid #bfd5e8 !important;
    font-size: 12px !important;
    padding: 5px 8px !important;
}

.sheet-table tbody tr:nth-child(even),
.history-table tbody tr:nth-child(even) {
    background: #f5f8fb !important;
}

.sheet-table tbody tr:hover,
.history-table tbody tr:hover {
    background: #dff0dd !important;
}

.report-btn {
    padding: 5px 10px !important;
    background: #fff !important;
    color: #1d5f98 !important;
    border: 1px solid #9fc2df !important;
}

.report-btn:hover {
    background: #e7f2fb !important;
}

.signature-canvas {
    height: 150px !important;
    border: 1px solid #9fc2df !important;
    border-radius: 4px !important;
    background: #fff !important;
}

.signature-header {
    border-radius: 4px 4px 0 0;
    padding: 8px 10px !important;
}

.signature-subtitle {
    color: rgba(255, 255, 255, 0.86) !important;
}

.autosave-status,
.signature-confirm-row {
    color: #16324f !important;
}

#save-to-history-btn {
    background: #6dbf22 !important;
    border-color: #4d9914 !important;
    color: #fff !important;
}

#save-to-history-btn:hover {
    background: #5aa719 !important;
}

#history-screen > .engineering-card,
#control-screen > div {
    padding: 18px !important;
}

#history-screen > .engineering-card > div:nth-child(3),
#control-screen > div > div:first-child {
    background: transparent !important;
    color: inherit !important;
    border-bottom: 2px solid #2f76b4 !important;
    padding: 0 0 12px !important;
    margin-bottom: 16px !important;
}

#history-screen h1,
#control-screen h1 {
    color: #005a9c !important;
    font-size: 1.45rem !important;
}

.history-table thead tr {
    background: #2f76b4 !important;
    color: #fff !important;
}

.history-table th,
.history-table td {
    font-size: 12px !important;
    padding: 6px 8px !important;
}

#error-message {
    width: min(920px, calc(100vw - 32px));
    margin: 10px auto !important;
    border-radius: 4px;
}

@media (max-width: 820px) {
    .main-header {
        display: flex !important;
        border-top-width: 3px;
    }

    .search-box {
        grid-template-columns: 1fr !important;
    }

    .route-sheet,
    #history-screen,
    #control-screen {
        width: calc(100vw - 12px) !important;
    }
}

/* Primary guided incidence action. */
.loaded-vehicle-btn {
    background: #1f669f !important;
    color: #ffffff !important;
    border: 1px solid #164d79 !important;
    font-weight: 900 !important;
    padding: 7px 14px !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.28);
    opacity: 1 !important;
    box-shadow: 0 4px 12px rgba(31, 102, 159, 0.22) !important;
}

.loaded-vehicle-btn::before {
    content: "+ ";
    font-weight: 900;
    color: #ffffff !important;
}

.loaded-vehicle-btn:hover {
    background: #164d79 !important;
    color: #ffffff !important;
}

.app-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(18, 43, 67, 0.42);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 3000;
}

.app-modal.open {
    display: flex;
}

.app-modal-card {
    width: min(760px, 96vw);
    max-height: 92vh;
    overflow: auto;
    border: 1px solid rgba(173, 203, 226, 0.9);
    border-radius: var(--vision-radius-lg, 14px);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 18px 48px rgba(18, 43, 67, 0.24);
}

.app-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.02)),
        #2f76b4;
    color: #fff;
}

.app-modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.app-modal-close {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.app-modal-body {
    padding: 18px;
}

.modal-step {
    margin-bottom: 18px;
}

.modal-label {
    display: block;
    margin-bottom: 8px;
    color: #16324f;
    font-weight: 900;
    font-size: 0.95rem;
}

.choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 9px;
}

.choice-grid button {
    min-height: 42px;
    border: 1px solid #9fc2df;
    border-radius: 9px;
    background: linear-gradient(180deg, #fff, #edf6fd);
    color: #1d5f98;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(33, 80, 120, 0.08);
}

.choice-grid button.selected {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.03)),
        #6dbf22;
    border-color: #4d9914;
    color: #fff;
}

.modal-textarea {
    width: 100%;
    min-height: 96px;
    resize: vertical;
    border: 1px solid #9fc2df;
    border-radius: 9px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 0.95rem;
}

.app-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 18px 18px;
    border-top: 1px solid #d7e7f3;
}

@media (max-width: 640px) {
    .choice-grid {
        grid-template-columns: 1fr 1fr;
    }

    .app-modal-actions {
        flex-direction: column-reverse;
    }

    .app-modal-actions button {
        width: 100%;
    }
}

/* Dictation helper for workers who prefer speaking instead of typing. */
.dictation-field {
    position: relative;
}

.dictation-field textarea {
    padding-right: 62px !important;
    padding-bottom: 42px !important;
}

.dictation-tools {
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: flex;
    align-items: center;
    gap: 7px;
    pointer-events: none;
}

.dictation-btn {
    width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    border-radius: var(--vision-radius-sm, 6px);
    border: 1px solid rgba(31, 95, 151, 0.85);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.04)),
        var(--vision-blue-glass, #2f76b4);
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        0 5px 14px rgba(33, 96, 150, 0.18);
    pointer-events: auto;
    position: relative;
}

.dictation-btn.recording {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.04)),
        #d9534f;
    border-color: #b33a36;
}

.dictation-btn::before,
.dictation-btn::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: block;
}

.dictation-btn.mic::before {
    top: 9px;
    width: 9px;
    height: 15px;
    border-radius: 8px;
    background: #fff;
    box-shadow: inset 0 -3px 0 rgba(255, 255, 255, 0.55);
}

.dictation-btn.mic::after {
    top: 23px;
    width: 18px;
    height: 8px;
    border: 2px solid #fff;
    border-top: 0;
    border-radius: 0 0 12px 12px;
}

.dictation-btn.mic {
    color: transparent;
}

.dictation-btn.mic span {
    display: none;
}

.dictation-btn.stop::before {
    top: 11px;
    width: 16px;
    height: 16px;
    border-radius: 3px;
    background: #fff;
}

.dictation-btn.stop::after {
    display: none;
}

.dictation-btn.stopping {
    opacity: 0.78;
}

.dictation-status {
    max-width: 220px;
    color: #fff;
    background: rgba(22, 50, 79, 0.72);
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 11px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(2px);
    transition: opacity 0.15s, transform 0.15s;
    pointer-events: none;
}

.dictation-status:not(:empty) {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 820px) {
    .dictation-tools {
        right: 10px;
        bottom: 10px;
    }
}

/* Stronger service instructions visibility */
.route-sheet .sheet-top-header .logos img {
    height: 78px !important;
}

.route-sheet div[style*="Observacions del servei"] {
    font-size: 14px !important;
    line-height: 24px !important;
    font-weight: 900 !important;
    padding: 5px 8px !important;
}

.route-sheet #val-observaciones {
    font-size: 14px !important;
    line-height: 1.55 !important;
    font-weight: 800 !important;
    color: #172534 !important;
    background: #fffdf2 !important;
    border-color: #bfd5e8 !important;
    min-height: 72px !important;
}

@media (max-width: 820px) {
    .route-sheet .sheet-top-header .logos img {
        height: 58px !important;
    }
}

/* ===== Sheet readability tuning ===== */
.route-sheet .sheet-top-header .logos img {
    height: 58px !important;
}

.route-sheet .header-center h1 {
    font-size: 2rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.2px;
}

.route-sheet .field-label,
.route-sheet .vehicle-header-label,
.route-sheet .sheet-table th,
.route-sheet .cmp-title,
.route-sheet .signature-title {
    font-size: 13px !important;
    line-height: 22px !important;
    font-weight: 800 !important;
}

.route-sheet .checklist-header,
.route-sheet .cmp-block-title {
    font-size: 13px !important;
    line-height: 22px !important;
    font-weight: 800 !important;
}

.route-sheet [id="val-sectores"],
.route-sheet #personnel-list td:nth-child(2),
.route-sheet #personnel-list td:nth-child(3) {
    font-weight: 800 !important;
    color: #0b1f33 !important;
}

.route-sheet .field-value {
    font-size: 14px !important;
}

.route-sheet #val-observaciones {
    font-size: 13px !important;
    line-height: 1.45 !important;
}

.route-sheet .sheet-table td {
    font-size: 13px !important;
}

@media (max-width: 820px) {
    .route-sheet .sheet-top-header .logos img {
        height: 48px !important;
    }

    .route-sheet .header-center h1 {
        font-size: 1.55rem !important;
    }
}

/* Header title emphasis: real app title, not decorative navigation. */
.main-header {
    grid-template-columns: minmax(255px, 360px) minmax(420px, 1fr) auto !important;
}

.logo-container::after {
    font-size: 19px !important;
    line-height: 1.1;
    letter-spacing: -0.2px;
}

.header-logo {
    height: 38px !important;
}

@media (max-width: 820px) {
    .logo-container::after {
        font-size: 17px !important;
    }

    .header-logo {
        height: 34px !important;
    }
}

/* ===== Vision modern glass polish =====
   Evoluciona el estilo Vision sin inventar controles: radios suaves, vidrio,
   foco claro y profundidad ligera en botones/paneles reales. */
:root {
    --vision-radius-sm: 6px;
    --vision-radius: 10px;
    --vision-radius-lg: 14px;
    --vision-glass: rgba(255, 255, 255, 0.72);
    --vision-glass-strong: rgba(255, 255, 255, 0.88);
    --vision-blue-glass: rgba(47, 118, 180, 0.88);
    --vision-blue-deep: #235f96;
    --vision-green: #67b926;
    --vision-shadow: 0 12px 34px rgba(28, 74, 114, 0.14);
    --vision-shadow-soft: 0 6px 18px rgba(28, 74, 114, 0.10);
}

body {
    background:
        radial-gradient(circle at 20% -10%, rgba(255, 255, 255, 0.75), transparent 34%),
        linear-gradient(135deg, #eaf3fb 0%, #dcebf6 52%, #edf5fb 100%);
}

.main-header {
    border-top: 0 !important;
    border-bottom-color: rgba(122, 174, 213, 0.6) !important;
    background: rgba(248, 252, 255, 0.82) !important;
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    box-shadow: 0 8px 24px rgba(28, 74, 114, 0.12) !important;
}

.logo-container::after {
    color: #0d5f9f;
}

.eng-date-input,
.search-box input[type="text"],
.history-filters input,
.cmp-field input,
.cmp-break input,
#login-password,
.sheet-input,
textarea.sheet-input,
.cmp-textarea {
    border-radius: var(--vision-radius-sm) !important;
    border-color: rgba(123, 174, 213, 0.82) !important;
    background: rgba(255, 255, 255, 0.86) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 1px 2px rgba(33, 80, 120, 0.05) !important;
}

.eng-date-input:focus,
.search-box input[type="text"]:focus,
.history-filters input:focus,
.cmp-field input:focus,
.cmp-break input:focus,
#login-password:focus,
.sheet-input:focus,
textarea.sheet-input:focus,
.cmp-textarea:focus {
    background: #fff !important;
    border-color: #2f76b4 !important;
    box-shadow:
        0 0 0 3px rgba(47, 118, 180, 0.18),
        0 4px 12px rgba(28, 74, 114, 0.10) !important;
}

#search-btn,
.eng-btn-primary,
.eng-btn-secondary,
#login-btn,
.ara-btn,
.history-table .action-btn,
.add-vehicle-btn,
.remove-vehicle-btn,
.report-btn,
.route-choice-item {
    border-radius: var(--vision-radius-sm) !important;
}

#search-btn,
.eng-btn-primary,
#login-btn,
.ara-btn {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.04)),
        var(--vision-blue-glass) !important;
    border-color: rgba(31, 95, 151, 0.85) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        0 5px 14px rgba(33, 96, 150, 0.22) !important;
}

#search-btn:hover,
.eng-btn-primary:hover,
#login-btn:hover,
.ara-btn:hover {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.03)),
        #235f96 !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.38),
        0 8px 18px rgba(33, 96, 150, 0.26) !important;
}

.eng-btn-secondary,
.history-table .view-btn,
.report-btn,
.add-vehicle-btn,
.remove-vehicle-btn {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(232, 244, 252, 0.86)) !important;
    border-color: rgba(128, 179, 218, 0.9) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 3px 10px rgba(33, 80, 120, 0.08) !important;
}

.eng-btn-secondary:hover,
.history-table .view-btn:hover,
.report-btn:hover,
.add-vehicle-btn:hover,
.remove-vehicle-btn:hover {
    background:
        linear-gradient(180deg, #ffffff, rgba(217, 237, 250, 0.96)) !important;
    border-color: #5d9ccc !important;
}

.route-sheet,
.route-choice-card,
.engineering-card,
#control-screen > div,
.welcome-card,
.login-card {
    border-radius: var(--vision-radius-lg) !important;
    border-color: rgba(173, 203, 226, 0.86) !important;
    background: var(--vision-glass-strong) !important;
    backdrop-filter: blur(10px) saturate(125%);
    -webkit-backdrop-filter: blur(10px) saturate(125%);
    box-shadow: var(--vision-shadow) !important;
}

.route-sheet {
    overflow: hidden;
}

.sheet-top-header {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 251, 254, 0.86)) !important;
}

.field,
.vehicle-row,
.checklist-container,
.cmp-block,
.signature-section {
    border-radius: var(--vision-radius-sm) !important;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.78);
}

.field-label,
.vehicle-header-label,
.sheet-table th,
.cmp-title,
.route-choice-header,
.signature-header {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.02)),
        #2f76b4 !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.checklist-header,
.cmp-block-title {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(229, 246, 222, 0.9)) !important;
}

.sheet-table th:first-child {
    border-top-left-radius: var(--vision-radius-sm);
}

.sheet-table th:last-child {
    border-top-right-radius: var(--vision-radius-sm);
}

.sheet-table tbody tr,
.history-table tbody tr {
    transition: background 0.12s ease;
}

.sheet-table tbody tr:hover,
.history-table tbody tr:hover,
.route-choice-item:hover {
    background: rgba(206, 238, 190, 0.86) !important;
}

.report-buttons {
    background: rgba(247, 251, 255, 0.74) !important;
}

.signature-canvas {
    border-radius: 0 0 var(--vision-radius-sm) var(--vision-radius-sm) !important;
    background:
        linear-gradient(rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.92)),
        repeating-linear-gradient(0deg, transparent 0 23px, rgba(47, 118, 180, 0.08) 24px) !important;
}

#save-to-history-btn {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.03)),
        var(--vision-green) !important;
    border-color: #4d9914 !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        0 7px 18px rgba(77, 153, 20, 0.22) !important;
}

#save-to-history-btn:hover {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.03)),
        #58a91a !important;
}

#error-message {
    border-radius: var(--vision-radius) !important;
    box-shadow: var(--vision-shadow-soft);
}

#login-overlay {
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.95), transparent 34%),
        linear-gradient(135deg, #eaf3fb, #dcebf6) !important;
}

.eco-phrase,
.instruction-box {
    border-radius: var(--vision-radius) !important;
}

@media (max-width: 820px) {
    .main-header {
        border-radius: 0 0 var(--vision-radius) var(--vision-radius);
    }

    .route-sheet,
    .route-choice-card,
    .engineering-card,
    #control-screen > div,
    .welcome-card {
        border-radius: var(--vision-radius) !important;
    }
}

/* Mapa de recorregut */
.route-map-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(9, 35, 58, 0.52);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.route-map-dialog {
    position: absolute;
    inset: 4% 3%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(167, 202, 228, 0.95);
    border-radius: var(--vision-radius-lg);
    box-shadow: 0 18px 50px rgba(14, 50, 84, 0.32);
}

.route-map-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    color: #ffffff;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.02)),
        var(--vision-blue-glass);
}

.route-map-header strong {
    display: block;
    font-size: 1rem;
}

.route-map-subtitle {
    display: block;
    margin-top: 2px;
    font-size: 0.78rem;
    font-weight: 700;
    opacity: 0.9;
}

.route-map-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.route-map-legend {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    font-weight: 800;
}

.route-map-legend i {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.85);
}

.route-map-legend .done {
    background: #1e9e4a;
}

.route-map-legend .pending {
    background: #e23b3b;
}

.route-map-body {
    position: relative;
    flex: 1;
    min-height: 0;
    background: #eaf3fb;
}

#map-canvas {
    width: 100%;
    height: 100%;
}

.route-map-status {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 600;
    display: flex;
    max-width: min(520px, calc(100% - 32px));
    min-height: 48px;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    color: #0c4774;
    font-weight: 800;
    text-align: center;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(128, 179, 218, 0.9);
    border-radius: var(--vision-radius);
    box-shadow: var(--vision-shadow-soft);
    transform: translate(-50%, -50%);
}

.route-map-empty {
    color: #6d4e00;
    border-color: rgba(222, 177, 72, 0.7);
    background: rgba(255, 250, 231, 0.96);
}

/* Ultima capa de contraste: evita que el estilo glass genérico lave este botón. */
.report-buttons .report-btn.loaded-vehicle-btn {
    color: #064f86 !important;
    text-shadow: none !important;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(228, 243, 253, 0.92)) !important;
    border-color: #5d9ccc !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        0 3px 10px rgba(33, 80, 120, 0.12) !important;
}

.report-buttons .report-btn.loaded-vehicle-btn::before {
    color: #064f86 !important;
}

.report-buttons .report-btn.loaded-vehicle-btn:hover {
    color: #073f68 !important;
    background:
        linear-gradient(180deg, #ffffff, rgba(210, 235, 249, 0.98)) !important;
}

@media (max-width: 820px) {
    .route-map-dialog {
        inset: 2% 2%;
        border-radius: var(--vision-radius);
    }

    .route-map-header {
        align-items: flex-start;
        flex-direction: column;
    }
}

.vehicle-incident-actions {
    display: flex;
    gap: 8px;
    padding: 8px 10px 0;
    background: rgba(255, 255, 255, 0.72);
}

.vehicle-incident-actions .breakdown-btn {
    color: #9f2f1f !important;
    border-color: #efb4a8 !important;
    background: linear-gradient(180deg, #fff, #fff1ee) !important;
    font-weight: 900 !important;
}

.vehicle-incident-actions .breakdown-btn:hover {
    color: #7e2115 !important;
    border-color: #dc8d7e !important;
    background: linear-gradient(180deg, #fff8f6, #ffe4df) !important;
}
