/* ==========================================================================
   SIRECO Mobile App - Executive & Premium Design System
   ========================================================================== */

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

:root {
    /* Color Palette - Executive Navy & Indigo */
    --primary: #1e40af;
    --primary-dark: #1e3a8a;
    --primary-light: #3b82f6;
    --primary-gradient: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    --accent: #0284c7;
    --accent-gradient: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);

    --bg-viewport-outer: #0f172a;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --bg-input: #ffffff;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;
    
    --success: #10b981;
    --success-bg: #ecfdf5;
    --success-border: #a7f3d0;
    --success-text: #047857;
    
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --danger-border: #fca5a5;
    --danger-text: #b91c1c;
    
    --warning: #f59e0b;
    --warning-bg: #fffbe6;
    --warning-border: #fde68a;
    --warning-text: #b45309;
    
    --info: #0284c7;
    --info-bg: #f0f9ff;
    
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.03);
    --shadow-md: 0 6px 18px -2px rgba(15, 23, 42, 0.07);
    --shadow-lg: 0 12px 28px -4px rgba(15, 23, 42, 0.12);
    --shadow-glow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-viewport-outer);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-x: hidden;
}

/* Container simulating mobile viewport */
.app-viewport {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    background-color: var(--bg-main);
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.35);
}

@media (min-width: 481px) {
    .app-viewport {
        min-height: 92vh;
        margin: 20px 0;
        border-radius: 28px;
        overflow: hidden;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* ==========================================================================
   Header Architecture
   ========================================================================== */
.app-header {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-logo-img {
    height: 38px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.1));
}

.app-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.4px;
    line-height: 1.1;
}

.app-subtitle {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.header-user-btn {
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.header-user-btn:hover {
    background: #e2e8f0;
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.user-avatar-mini {
    font-size: 13px;
}

.logout-arrow {
    color: var(--text-muted);
    font-size: 11px;
    transition: transform 0.2s ease;
}

.header-user-btn:hover .logout-arrow {
    transform: translateX(2px);
    color: var(--primary);
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.app-body {
    flex: 1;
    padding: 16px;
    padding-bottom: 96px;
    overflow-y: auto;
}

.view-page {
    display: none;
    animation: slideUpFade 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.view-page.active {
    display: block;
}

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

/* ==========================================================================
   Login Screen Design
   ========================================================================== */
.login-brand-wrapper {
    text-align: center;
    margin-top: 15px;
    margin-bottom: 24px;
}

.login-logo-circle {
    width: 90px;
    height: 90px;
    background: #ffffff;
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-md), 0 0 0 1px rgba(226, 232, 240, 0.8);
}

.login-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.login-welcome-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.login-welcome-sub {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 500;
}

.login-card {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

/* ==========================================================================
   Dashboard Hero Conductor Banner
   ========================================================================== */
.dashboard-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.25);
    position: relative;
    overflow: hidden;
}

.dashboard-hero::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -20%;
    width: 160px;
    height: 160px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.25) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-user-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.hero-avatar {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: white;
    font-weight: 800;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.hero-welcome {
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 700;
}

.hero-name {
    font-size: 16px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.3px;
    margin-top: 1px;
}

.hero-status-pill {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.4px;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: #34d399;
    box-shadow: 0 0 8px #34d399;
}

/* ==========================================================================
   Cards Architecture
   ========================================================================== */
.card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin-bottom: 14px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

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

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    letter-spacing: -0.2px;
}

.vehicle-selector-card {
    border-left: 4px solid var(--primary);
}

.select-vehiculo-main {
    font-weight: 700 !important;
    font-size: 15px !important;
    color: var(--primary-dark) !important;
    background-color: #f8fafc !important;
}

/* Dynamic Chromatic Semaphorization Cards */
.status-card-ok {
    background-color: var(--success-bg) !important;
    border: 1px solid var(--success-border) !important;
    border-left: 5px solid var(--success) !important;
}

.status-card-warning {
    background-color: var(--warning-bg) !important;
    border: 1px solid var(--warning-border) !important;
    border-left: 5px solid var(--warning) !important;
}

.status-card-danger {
    background-color: var(--danger-bg) !important;
    border: 1px solid var(--danger-border) !important;
    border-left: 5px solid var(--danger) !important;
}

/* Dashboard Summary & Support Widgets */
.dashboard-widget-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
}

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

.widget-title {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.widget-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
}

.support-widget {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.support-widget-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.support-icon-circle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: #e0f2fe;
    color: #0284c7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.support-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.support-sub {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.support-btn {
    width: auto !important;
    padding: 8px 14px !important;
    font-size: 12px !important;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-sm) !important;
}

/* ==========================================================================
   Quick Access Module Grid
   ========================================================================== */
.quick-access-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
}

.quick-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.quick-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.quick-card:active {
    transform: scale(0.97);
}

.quick-card-icon-badge {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--primary-light);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

.quick-card-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.25;
}

.quick-card-action-text {
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ==========================================================================
   Form Controls & Inputs
   ========================================================================== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    background-color: var(--bg-input);
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    outline: none;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
    background-color: #ffffff;
}

/* Buttons System */
.btn {
    width: 100%;
    padding: 13px 18px;
    border-radius: var(--radius-md);
    border: none;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    letter-spacing: -0.1px;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-glow);
}

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

.btn-secondary:hover {
    background-color: #e2e8f0;
}

.btn-success {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3);
}

/* ==========================================================================
   Badges & Indicators
   ========================================================================== */
.badge {
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-apto {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid var(--success-border);
}

.badge-no-apto {
    background: var(--danger-bg);
    color: var(--danger-text);
    border: 1px solid var(--danger-border);
}

.badge-pendiente {
    background: var(--warning-bg);
    color: var(--warning-text);
    border: 1px solid var(--warning-border);
}

/* ==========================================================================
   Tree Item Checklist Styling
   ========================================================================== */
.checklist-progress-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.progress-bar-container {
    background: #e2e8f0;
    border-radius: 10px;
    height: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar-fill {
    background: linear-gradient(90deg, #3b82f6, #10b981);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.btn-quick-ok {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-quick-ok:hover {
    background: #dbeafe;
}

.group-header {
    background: #f0f9ff;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-weight: 800;
    font-size: 12px;
    color: #0369a1;
    border: 1px solid #bae6fd;
    margin-top: 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.checklist-item {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    transition: all 0.2s ease;
}

.checklist-item.missing-eval {
    border: 2px solid #f59e0b;
    background-color: #fffbe6;
}

.checklist-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.toggle-group {
    display: flex;
    background-color: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    padding: 2px;
    gap: 2px;
}

.toggle-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 800;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.toggle-btn.active-b {
    background-color: var(--success);
    color: white;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
}

.toggle-btn.active-m {
    background-color: var(--danger);
    color: white;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
}

/* ==========================================================================
   Floating Bottom Navigation Pill
   ========================================================================== */
.bottom-nav {
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 24px);
    max-width: 456px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.15);
    display: flex;
    justify-content: space-around;
    padding: 6px 8px;
    z-index: 200;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    gap: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
}

.nav-item:hover {
    color: var(--primary);
}

.nav-item.active {
    color: var(--primary-dark);
    font-weight: 800;
    background-color: #eff6ff;
}

.nav-icon {
    font-size: 18px;
    transition: transform 0.2s ease;
}

.nav-item.active .nav-icon {
    transform: translateY(-2px) scale(1.1);
}

/* Toast Notification */
.toast-offline {
    background-color: var(--warning);
    color: #78350f;
    padding: 9px 16px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    display: none;
}

.toast-offline.active {
    display: block;
}
