/* ==========================================
   TULIO - SISTEMA DE DISEÑO Y HOJA DE ESTILOS
   ========================================== */

:root {
    /* Color Palette */
    --bg-dark: #070a13;
    --bg-panel: rgba(15, 22, 42, 0.65);
    --bg-panel-opaque: #0f162a;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(247, 148, 29, 0.2);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    
    /* Branding and Statuses */
    --tieh-orange: #f7941d;
    --tieh-rojo: #e31e24;
    --success: #10b981;
    --info: #0ea5e9;
    --purple: #a855f7;
    --warning: #f59e0b;
    
    /* Fonts */
    --font-heading: 'Outfit', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Transitions */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(247, 148, 29, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(227, 30, 36, 0.03) 0%, transparent 45%);
    background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #ffffff;
}

/* Glassmorphism Panel Utility */
.glass {
    background: var(--bg-panel);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    border-radius: 18px;
}

.glass-opaque {
    background: var(--bg-panel-opaque);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

/* Common Accent Borders */
.border-orange { border-top: 3px solid var(--tieh-orange); }
.border-blue { border-top: 3px solid var(--info); }
.border-green { border-top: 3px solid var(--success); }
.border-purple { border-top: 3px solid var(--purple); }

/* Color Badges & Icons */
.accent-red { color: var(--tieh-rojo); }
.accent-orange { color: var(--tieh-orange); }
.icon-orange { color: var(--tieh-orange); font-size: 1.5rem; }
.icon-blue { color: var(--info); font-size: 1.5rem; }
.icon-green { color: var(--success); font-size: 1.5rem; }
.icon-purple { color: var(--purple); font-size: 1.5rem; }
.text-orange { color: var(--tieh-orange); }
.text-green { color: var(--success); }
.text-gray { color: var(--text-dim); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 10px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-bounce);
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.btn-primary {
    background: linear-gradient(135deg, var(--tieh-orange) 0%, var(--tieh-rojo) 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(247, 148, 29, 0.35);
}
.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(247, 148, 29, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.btn-cancel {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.btn-cancel:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-small-add {
    padding: 4px 8px;
    background: var(--tieh-orange);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition-bounce);
}
.btn-small-add:hover {
    transform: scale(1.1);
    background: var(--tieh-rojo);
}

/* ==========================================
   PANTALLA DE INICIO DE SESIÓN (LOGIN OVERLAY)
   ========================================== */
.login-overlay-container {
    position: fixed;
    inset: 0;
    background: rgba(7, 10, 19, 0.92);
    backdrop-filter: blur(24px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.login-card {
    width: 100%;
    max-width: 440px;
    padding: 40px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-brand {
    margin-bottom: 30px;
}

.login-brand .logo-text {
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    background: linear-gradient(135deg, var(--tieh-orange) 0%, var(--tieh-rojo) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-info-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: 8px;
    font-size: 0.7rem;
}

/* Header & Switcher Style */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    border-radius: 0;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 24px;
    margin-bottom: 24px;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.logo-text {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 900;
    text-transform: uppercase;
}
.subbrand {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
}
.divider {
    color: var(--text-dim);
}

.header-user-badge {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.04);
    padding: 6px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}
.user-info-text {
    display: flex;
    flex-direction: column;
}
.user-name {
    font-weight: 700;
    font-size: 0.88rem;
    color: #ffffff;
}
.user-role-badge {
    font-size: 0.72rem;
    font-weight: 500;
}

/* Main Views Toggle */
.role-view {
    display: none;
    animation: fadeIn 0.4s ease-out;
}
.role-view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px 40px;
}

/* KPI Dashboards Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}
.kpi-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition-bounce);
}
.kpi-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
    border-color: rgba(247, 148, 29, 0.3);
}
.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.kpi-title {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.kpi-value {
    font-size: 2.2rem;
    font-family: var(--font-heading);
    font-weight: 800;
    margin: 8px 0;
}
.kpi-footer {
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* Grid Layout for Admin View */
.main-grid {
    display: grid;
    grid-template-columns: 450px 1fr;
    gap: 24px;
}

/* Tab Navigation Buttons */
.tab-buttons {
    display: flex;
    padding: 6px;
    margin-bottom: 16px;
    border-radius: 12px;
}
.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-weight: 600;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.tab-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.03);
}
.tab-btn.active {
    color: #ffffff;
    background: var(--tieh-orange);
    box-shadow: 0 4px 10px rgba(247, 148, 29, 0.2);
}

/* Forms & Inputs */
.admin-tab {
    display: none;
}
.admin-tab.active {
    display: block;
}
.form-container {
    padding: 24px;
}
.form-container h3 {
    margin-bottom: 20px;
    font-size: 1.25rem;
}
.form-group {
    margin-bottom: 18px;
}
.form-group.row {
    display: flex;
    gap: 16px;
}
.form-group.row .col {
    flex: 1;
}
label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="time"],
textarea,
select {
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px;
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: var(--transition-smooth);
}
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--tieh-orange);
    box-shadow: 0 0 0 2px var(--border-glow);
}
.field-desc {
    display: block;
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 4px;
}

/* Dynamic Guides Area */
.guides-section {
    margin-top: 20px;
    margin-bottom: 20px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}
.guides-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.guides-header h4 {
    font-size: 0.95rem;
    color: var(--text-muted);
}
.guide-input-row {
    display: grid;
    grid-template-columns: 100px 1fr 1fr;
    gap: 8px;
    padding: 8px;
    margin-bottom: 8px;
    position: relative;
}

/* Active Routes Table */
.card-list-container {
    padding: 24px;
    height: 100%;
    min-height: 500px;
}
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}
.list-header h3 {
    font-size: 1.25rem;
}
.table-responsive {
    overflow-x: auto;
}
.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.88rem;
}
.custom-table th {
    padding: 12px 16px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}
.custom-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}
.custom-table tbody tr {
    transition: var(--transition-smooth);
}
.custom-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Status Badges */
.status-tag {
    display: inline-flex;
    padding: 3px 10px;
    border-radius: 30px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
}
.status-tag.planificado { background: rgba(245, 158, 11, 0.15); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.3); }
.status-tag.retirado { background: rgba(168, 85, 247, 0.15); color: var(--purple); border: 1px solid rgba(168, 85, 247, 0.3); }
.status-tag.transito { background: rgba(14, 165, 233, 0.15); color: var(--info); border: 1px solid rgba(14, 165, 233, 0.3); }
.status-tag.entregado { background: rgba(16, 185, 129, 0.15); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.3); }

/* Settings Sub-Lists */
.sub-settings-lists {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 24px;
}
.settings-list-box {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
}
.box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.box-header h4 {
    font-size: 0.9rem;
    color: var(--text-muted);
}
.settings-ul {
    list-style: none;
    font-size: 0.8rem;
}
.settings-ul li {
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

/* File Dropzone for GPS upload */
.dropzone {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    margin-bottom: 16px;
}
.dropzone:hover, .dropzone.active {
    border-color: var(--tieh-orange);
    background: rgba(247, 148, 29, 0.05);
}
.dropzone-icon {
    font-size: 2.2rem;
    color: var(--text-dim);
    margin-bottom: 12px;
    transition: var(--transition-smooth);
}
.dropzone:hover .dropzone-icon {
    color: var(--tieh-orange);
}
.dropzone-text {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.file-info-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(247, 148, 29, 0.08);
    border: 1px solid rgba(247, 148, 29, 0.2);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    margin-bottom: 16px;
}

/* ==========================================
   MOBILE DEMO FRAME (CHOFER VIEW)
   ========================================== */
.mobile-frame-container {
    display: flex;
    justify-content: center;
    padding: 20px 0;
}
.mobile-device {
    width: 375px;
    height: 720px;
    border-radius: 40px;
    padding: 12px;
    border: 6px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    background: #000000;
    position: relative;
    overflow: hidden;
}
.mobile-device::after {
    content: '';
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 20px;
    background: #000000;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    z-index: 102;
}
.mobile-screen {
    width: 100%;
    height: 100%;
    border-radius: 30px;
    background: #090f1e;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}
.mobile-header {
    background: rgba(15, 22, 42, 0.9);
    padding: 24px 16px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}
.mobile-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}
.mobile-status-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 4px;
}
.mobile-status-badge.online i {
    color: var(--success);
}
.mobile-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    padding-bottom: 40px;
}
.icon-huge {
    font-size: 4rem;
    margin-bottom: 16px;
    display: block;
    opacity: 0.3;
}
.chofer-content-section {
    display: none;
    animation: fadeIn 0.3s ease-out;
}
.chofer-content-section.active {
    display: block;
}
.route-header-card {
    padding: 16px;
    margin-bottom: 16px;
}
.route-id-tag {
    font-size: 0.7rem;
    font-weight: 800;
    background: rgba(247, 148, 29, 0.15);
    color: var(--tieh-orange);
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 8px;
}
.route-details-mini {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 8px;
}
.route-actions-bar {
    margin-bottom: 20px;
}
.transit-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(14, 165, 233, 0.12);
    border: 1px solid rgba(14, 165, 233, 0.3);
    color: var(--info);
    padding: 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}
.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--info);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.5);
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(14, 165, 233, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(14, 165, 233, 0); }
}

.mobile-section-title {
    margin-bottom: 10px;
}
.mobile-section-title h5 {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-dim);
    letter-spacing: 0.03em;
}
.mobile-guides-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.mobile-guide-card {
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition-smooth);
}
.mobile-guide-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}
.mob-g-num {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
}
.mob-g-client {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}
.mob-g-city {
    font-size: 0.72rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 4px;
}
.mobile-guide-card-footer {
    margin-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 10px;
    display: flex;
    justify-content: flex-end;
}
.btn-mobile-action {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    border: none;
    transition: var(--transition-smooth);
}
.btn-mobile-action.pickup {
    background: var(--tieh-orange);
    color: #ffffff;
}
.btn-mobile-action.delivery {
    background: var(--success);
    color: #ffffff;
}
.btn-mobile-action.done {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
    cursor: default;
    border: 1px dashed var(--border-color);
}

/* ==========================================
   PERFIL CLIENTE (SUMMIT AGRO VIEW)
   ========================================== */
.tracking-hero {
    padding: 40px 24px;
    max-width: 900px;
    margin: 0 auto 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.tracking-sub {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--success);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}
.tracking-hero h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 8px;
}
.hero-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 24px;
    max-width: 600px;
}
.search-box-container {
    width: 100%;
    max-width: 600px;
}
.search-input-wrapper {
    display: flex;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 6px;
    align-items: center;
    position: relative;
    transition: var(--transition-smooth);
}
.search-input-wrapper:focus-within {
    border-color: var(--tieh-orange);
    box-shadow: 0 0 15px rgba(247, 148, 29, 0.15);
}
.search-icon {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-left: 14px;
    margin-right: 8px;
}
.search-input-wrapper input {
    border: none;
    background: transparent;
    padding: 10px 10px 10px 4px;
    font-size: 0.98rem;
    flex: 1;
    color: #ffffff;
}

/* Results panel styles */
.tracking-results {
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px;
}
.tracking-results-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    margin-bottom: 24px;
}
.guide-number-badge {
    font-family: var(--font-heading);
    font-weight: 800;
    background: rgba(247, 148, 29, 0.15);
    color: var(--tieh-orange);
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    display: inline-block;
    margin-bottom: 8px;
}
.track-route-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}
.header-status .status-badge {
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    padding: 6px 16px;
    border-radius: 30px;
    background: var(--tieh-orange);
}

.tracking-content-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 24px;
}

/* Timeline Components */
.tracking-timeline-box {
    padding: 20px;
}
.tracking-timeline-box h4 {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    font-size: 1.05rem;
}
.timeline {
    position: relative;
    padding-left: 36px;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: rgba(255, 255, 255, 0.08);
}
.timeline-item {
    position: relative;
    padding-bottom: 24px;
}
.timeline-item:last-child {
    padding-bottom: 0;
}
.timeline-icon {
    position: absolute;
    left: -36px;
    top: 2px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-panel-opaque);
    border: 2px solid var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: var(--text-dim);
    z-index: 2;
    transition: var(--transition-smooth);
}
.timeline-content h5 {
    font-size: 0.95rem;
    color: var(--text-muted);
    transition: var(--transition-smooth);
}
.tl-desc {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-top: 2px;
}
.tl-time {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-weight: 500;
    margin-top: 4px;
}
.tl-evidence {
    margin-top: 8px;
}
.tl-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--tieh-orange);
    text-decoration: none;
    font-weight: 600;
}
.tl-link:hover {
    text-decoration: underline;
}

.timeline-item.completed .timeline-icon {
    border-color: var(--tieh-orange);
    background: var(--tieh-orange);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(247, 148, 29, 0.4);
}
.timeline-item.completed .timeline-content h5 {
    color: #ffffff;
}

.timeline-item.active-step .timeline-icon {
    border-color: var(--info);
    background: var(--info);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(14, 165, 233, 0.4);
}
.timeline-item.active-step .timeline-content h5 {
    color: var(--info);
}

/* Map tracking component */
.tracking-map-box {
    padding: 20px;
}
.tracking-map-box h4 {
    margin-bottom: 16px;
    font-size: 1.05rem;
}
.custom-vector-map {
    width: 100%;
    height: 180px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    margin-bottom: 16px;
}
.map-bg {
    width: 100%;
    height: 100%;
    position: relative;
    background-size: 20px 20px;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
}
.route-line-vector {
    position: absolute;
    top: 50%;
    left: 20px;
    right: 20px;
    height: 2px;
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-50%);
    z-index: 1;
}

.map-stop-node {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
}
.stop-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-dim);
    border: 2px solid var(--bg-dark);
}
.stop-label {
    font-size: 0.6rem;
    color: var(--text-dim);
    margin-top: 4px;
    white-space: nowrap;
    position: absolute;
    top: 8px;
}
.map-stop-node.active .stop-dot {
    background: var(--tieh-orange);
    width: 10px;
    height: 10px;
    box-shadow: 0 0 6px var(--tieh-orange);
}
.map-stop-node.active .stop-label {
    color: var(--text-main);
    font-weight: 600;
}

.map-stop-node.requinoa { left: 10%; }
.map-stop-node.curico { left: 28%; }
.map-stop-node.chillan { left: 46%; }
.map-stop-node.temuco { left: 64%; }
.map-stop-node.osorno { left: 82%; }
.map-stop-node.montt { left: 93%; }

.truck-pointer-icon {
    position: absolute;
    top: 50%;
    left: 10%;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--tieh-orange);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    z-index: 5;
    box-shadow: 0 0 10px rgba(247, 148, 29, 0.6);
}
.truck-radar-wave {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(247, 148, 29, 0.4);
    animation: ping 1.5s ease-in-out infinite;
}
@keyframes ping {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.6); opacity: 0; }
}

.tracking-info-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.82rem;
}
.info-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding-bottom: 6px;
}
.info-row span {
    color: var(--text-muted);
}

.all-guides-table-container {
    padding: 24px;
}
.search-filter-mini input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    width: 240px;
    color: #ffffff;
}

/* ==========================================
   MODALES (POPUPS OVERLAYS)
   ========================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.25s ease-out;
}
.modal-content {
    width: 90%;
    max-width: 500px;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 16px;
}
.modal-header h4 {
    font-size: 1.1rem;
    color: #ffffff;
}
.btn-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.btn-close:hover {
    color: var(--tieh-rojo);
}
.modal-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.camera-lens-view {
    width: 100%;
    height: 240px;
    background: #000000;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    margin-bottom: 16px;
}
.camera-stream-mock {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-dim);
    font-size: 0.85rem;
}
.camera-preview-mock {
    width: 100%;
    height: 100%;
}
.camera-preview-mock img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.text-huge {
    font-size: 3rem;
}
.focus-brackets {
    position: absolute;
    inset: 30px;
    border: 2px dashed rgba(247, 148, 29, 0.4);
    border-radius: 8px;
    pointer-events: none;
}
.photo-inputs {
    margin-top: 12px;
}
.cursor-pointer {
    cursor: pointer;
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    margin-top: 20px;
}
.mt-10 { margin-top: 40px; }
.mt-4 { margin-top: 16px; }

/* Responsive Adjustments */
@media (max-width: 1100px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
    .col-right {
        order: -1;
    }
}
@media (max-width: 820px) {
    .tracking-content-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 600px) {
    .header-container {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    .kpi-grid {
        grid-template-columns: 1fr;
    }
}
