@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

  * { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

  body {
    font-family: 'Inter', sans-serif;
    background: #e8f5e9;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: #1b5e20;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 16px 0;
  }

  .phone-frame {
    width: 390px;
    height: 844px;
    background: #f0f9f0;
    border-radius: 48px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 0 3px #c8e6c9, 0 0 0 6px #e8f5e9, 0 30px 80px rgba(0,0,0,0.5);
    flex-shrink: 0;
  }
  /* Si la ventana del navegador es mas baja que el alto del telefono, escalamos */
  @media (max-height: 880px) and (min-width: 480px) {
    body { padding: 0; align-items: flex-start; }
    .phone-frame { transform: scale(0.85); transform-origin: top center; margin-top: 8px; }
  }
  @media (max-height: 760px) and (min-width: 480px) {
    .phone-frame { transform: scale(0.75); }
  }
  @media (max-height: 660px) and (min-width: 480px) {
    .phone-frame { transform: scale(0.65); }
  }

  .notch {
    position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 160px; height: 34px; background: #000;
    border-radius: 0 0 20px 20px; z-index: 100;
  }

  .status-bar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 28px 0; font-size: 12px; font-weight: 600;
    position: relative; z-index: 99;
  }
  .status-bar .time { font-size: 14px; font-weight: 700; color: #2e7d32; }
  .status-icons { display: flex; gap: 6px; align-items: center; }
  .status-icons svg { width: 16px; height: 16px; fill: #2e7d32; }

  .screen { display: none; width: 100%; height: 100%; position: absolute; top: 0; left: 0; }
  .screen.active { display: flex; flex-direction: column; animation: screenIn 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
  .screen.slide-left { animation: slideLeft 0.35s cubic-bezier(0.16, 1, 0.3, 1); }
  .screen.slide-right { animation: slideRight 0.35s cubic-bezier(0.16, 1, 0.3, 1); }
  .screen.scale-in { animation: scaleIn 0.4s cubic-bezier(0.16, 1, 0.3, 1); }

  @keyframes screenIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
  @keyframes slideLeft {
    from { opacity: 0; transform: translateX(60px); }
    to { opacity: 1; transform: translateX(0); }
  }
  @keyframes slideRight {
    from { opacity: 0; transform: translateX(-60px); }
    to { opacity: 1; transform: translateX(0); }
  }
  @keyframes scaleIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
  }

  /* Ripple Effect */
  .ripple-wrap { position: relative; overflow: hidden; }
  .ripple-wrap::after {
    content: ''; position: absolute; width: 100%; height: 100%;
    top: 0; left: 0; pointer-events: none;
    background-image: radial-gradient(circle, rgba(0,0,0,0.1) 10%, transparent 10.01%);
    background-repeat: no-repeat; background-position: 50%;
    transform: scale(10, 10); opacity: 0; transition: transform 0.5s, opacity 0.8s;
  }
  .ripple-wrap:active::after { transform: scale(0, 0); opacity: 0.3; transition: 0s; }

  /* Staggered entrance animations */
  .stagger > * { opacity: 0; animation: staggerIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
  .stagger > *:nth-child(1) { animation-delay: 0.05s; }
  .stagger > *:nth-child(2) { animation-delay: 0.1s; }
  .stagger > *:nth-child(3) { animation-delay: 0.15s; }
  .stagger > *:nth-child(4) { animation-delay: 0.2s; }
  .stagger > *:nth-child(5) { animation-delay: 0.25s; }
  .stagger > *:nth-child(6) { animation-delay: 0.3s; }
  .stagger > *:nth-child(7) { animation-delay: 0.35s; }
  .stagger > *:nth-child(8) { animation-delay: 0.4s; }
  .stagger > *:nth-child(9) { animation-delay: 0.45s; }
  .stagger > *:nth-child(10) { animation-delay: 0.5s; }
  .stagger > *:nth-child(11) { animation-delay: 0.55s; }
  .stagger > *:nth-child(12) { animation-delay: 0.6s; }
  @keyframes staggerIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
  }

  @keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0,212,170,0); }
    50% { box-shadow: 0 0 20px 2px rgba(0,212,170,0.15); }
  }

  /* Touch feedback */
  .touch-scale { transition: transform 0.15s ease, opacity 0.15s ease; }
  .touch-scale:active { transform: scale(0.96); opacity: 0.85; }
  .btn-press { transition: all 0.12s ease; }
  .btn-press:active { transform: scale(0.95); box-shadow: none !important; }
  .card-lift { transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease; }
  .card-lift:active { transform: translateY(-3px); box-shadow: 0 12px 24px rgba(0,0,0,0.2); }

  /* Shimmer */
  .shimmer { position: relative; overflow: hidden; }
  .shimmer::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.03) 50%, transparent 100%);
    animation: shimmerAnim 2s infinite;
  }
  @keyframes shimmerAnim { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

  /* Notification dot bounce */
  .notif-bounce { animation: notifBounce 2s ease infinite; }
  @keyframes notifBounce {
    0%, 80%, 100% { transform: scale(1); }
    40% { transform: scale(1.3); }
    60% { transform: scale(0.9); }
  }

  /* Nav active indicator */
  .nav-item.active::before {
    content: ''; position: absolute; top: -1px; left: 50%; transform: translateX(-50%);
    width: 20px; height: 3px; background: #00d4aa; border-radius: 0 0 4px 4px;
  }
  .nav-item { position: relative; }

  /* Pull indicator */
  .pull-indicator { text-align: center; padding: 8px 0 4px; opacity: 0.3; }
  .pull-indicator .pull-line {
    width: 36px; height: 4px; background: rgba(255,255,255,0.2);
    border-radius: 4px; margin: 0 auto;
  }

  /* Progress bar */
  .top-progress-bar {
    position: absolute; top: 0; left: 0; width: 100%; height: 2px;
    z-index: 200; pointer-events: none;
  }
  .top-progress-bar .bar-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, #00d4aa, #0088ff);
    border-radius: 0 2px 2px 0; transition: width 0.3s ease;
  }
  .top-progress-bar.animating .bar-fill { animation: progressAnim 0.6s ease forwards; }
  @keyframes progressAnim {
    0% { width: 0%; } 50% { width: 70%; } 100% { width: 100%; opacity: 0; }
  }

  /* Welcome toast */
  .welcome-toast {
    position: absolute; top: 60px; left: 50%; transform: translateX(-50%) translateY(-20px);
    z-index: 200; padding: 12px 24px;
    background: rgba(0,212,170,0.15);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0,212,170,0.3);
    border-radius: 16px; font-size: 14px; font-weight: 600; color: #00d4aa;
    opacity: 0; pointer-events: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
  }
  .welcome-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

  /* ===== SPLASH ===== */
  .splash {
    background: linear-gradient(160deg, #e8f5e9 0%, #c8e6c9 40%, #a5d6a7 100%);
    justify-content: center; align-items: center;
    position: relative; overflow: hidden;
  }
  .splash::before {
    content: ''; position: absolute; width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(0,212,170,0.08) 0%, transparent 70%);
    top: -100px; left: -100px; animation: floatGlow 6s ease-in-out infinite;
  }
  .splash::after {
    content: ''; position: absolute; width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(0,136,255,0.06) 0%, transparent 70%);
    bottom: -50px; right: -100px; animation: floatGlow 8s ease-in-out infinite reverse;
  }
  .splash-orb1 {
    position: absolute; width: 300px; height: 300px; border-radius: 50%;
    background: radial-gradient(circle, rgba(0,212,170,0.1) 0%, transparent 70%);
    top: 50%; left: 50%; transform: translate(-50%,-50%);
    animation: orbFloat 10s ease-in-out infinite;
  }
  .splash-orb2 {
    position: absolute; width: 200px; height: 200px; border-radius: 50%;
    background: radial-gradient(circle, rgba(0,136,255,0.08) 0%, transparent 70%);
    bottom: 10%; right: 10%;
    animation: orbFloat 7s ease-in-out infinite reverse;
  }
  @keyframes orbFloat {
    0%,100% { transform: translate(-50%,-50%) scale(1); }
    50% { transform: translate(-40%,-60%) scale(1.3); }
  }
  @keyframes floatGlow {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, 20px); }
  }

  .splash-content { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; animation: splashIn 1.2s ease; }
  @keyframes splashIn {
    0% { transform: scale(0.5) translateY(50px); opacity: 0; filter: blur(10px); }
    40% { filter: blur(0); }
    60% { transform: scale(1.03); }
    100% { transform: scale(1) translateY(0); opacity: 1; }
  }

  /* Logo nuevo */
  .danuri-logo {
    width: 110px; height: 110px; margin-bottom: 28px;
    filter: drop-shadow(0 6px 20px rgba(0,0,0,0.12));
  }

  .splash-brand { font-size: 38px; font-weight: 900; letter-spacing: -1px; }
  .splash-brand .brand-danuri { color: #2e7d32; }
  .splash-brand .brand-app {
    background: linear-gradient(135deg, #00d4aa, #0088ff);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .splash-tagline {
    margin-top: 12px; font-size: 15px; font-weight: 500;
    letter-spacing: 1.5px; text-transform: uppercase;
    background: linear-gradient(90deg, #00d4aa, #0088ff, #00d4aa);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% auto; animation: shineText 3s linear infinite;
  }
  @keyframes shineText { to { background-position: 200% center; } }

  .splash-sub { color: #4a7c59; font-size: 12px; margin-top: 6px; letter-spacing: 1px; }

  .splash-enter {
    margin-top: 50px; padding: 18px 56px;
    background: linear-gradient(135deg, #00d4aa 0%, #0088ff 100%);
    border: none; border-radius: 50px; color: #fff;
    font-size: 17px; font-weight: 700; cursor: pointer;
    transition: all 0.3s; position: relative; overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,212,170,0.3), 0 2px 8px rgba(0,0,0,0.3);
    font-family: 'Inter', sans-serif;
  }
  .splash-enter:hover { transform: translateY(-3px); box-shadow: 0 14px 44px rgba(0,212,170,0.4); }

  /* ===== LOGIN SCREEN ===== */
  .login-screen {
    background: linear-gradient(180deg, #0a2012 0%, #ffffff 100%);
    padding: 50px 24px 24px;
  }
  .login-logo {
    width: 60px; height: 60px; margin: 20px auto 16px;
  }
  .login-header { text-align: center; margin-bottom: 30px; }
  .login-header h2 { font-size: 26px; font-weight: 700; margin-bottom: 6px; color: #1b5e20; }
  .login-header p { color: #6b8f72; font-size: 13px; }

  .input-group { margin-bottom: 18px; }
  .input-group label {
    display: block; font-size: 12px; color: #6b8f72; margin-bottom: 8px;
    font-weight: 500; text-transform: uppercase; letter-spacing: 1px;
  }
  .input-group input, .input-group textarea, .input-group select {
    width: 100%; padding: 16px;
    background: #fff; border: 1px solid rgba(0,0,0,0.12);
    border-radius: 14px; color: #2e4a33; font-size: 15px;
    font-family: 'Inter', sans-serif; transition: border 0.3s; outline: none;
  }
  .input-group input:focus, .input-group textarea:focus, .input-group select:focus { border-color: #2e7d32; }
  .input-group input::placeholder, .input-group textarea::placeholder { color: #a0b5a5; }
  .input-group select { appearance: none; }
  .input-group select option { background: #ffffff; color: #2e4a33; }

  .login-btn {
    width: 100%; padding: 16px;
    background: linear-gradient(135deg, #00d4aa, #0088ff);
    border: none; border-radius: 14px; color: #fff;
    font-size: 16px; font-weight: 600; cursor: pointer;
    margin-top: 10px; transition: all 0.3s; font-family: 'Inter', sans-serif;
  }
  .login-btn:hover { opacity: 0.9; transform: translateY(-1px); }

  .user-type-section {
    margin-top: 30px; text-align: center;
  }
  .user-type-section h3 { font-size: 16px; font-weight: 600; margin-bottom: 16px; color: #5a7d63; }

  .type-btn-group { display: flex; flex-direction: column; gap: 14px; }
  .type-btn {
    width: 100%; padding: 18px 20px;
    background: #ffffff; border: 2px solid #c8e6c9;
    border-radius: 16px; color: #1b5e20;
    font-size: 16px; font-weight: 700; cursor: pointer;
    transition: all 0.2s; font-family: 'Inter', sans-serif;
    display: flex; align-items: center; gap: 14px;
    box-shadow: 0 4px 14px rgba(27, 94, 32, 0.08);
  }
  .type-btn:hover {
    border-color: #2e7d32;
    background: #f1f8e9;
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(27, 94, 32, 0.15);
  }
  .type-btn:active { transform: translateY(0); }
  .type-btn .type-icon {
    width: 48px; height: 48px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
  }
  .type-btn .type-icon svg { width: 24px; height: 24px; fill: #fff; }
  .type-btn .type-info { text-align: left; flex: 1; }
  .type-btn .type-info span { font-size: 16px; font-weight: 700; color: #1b5e20; display: block; }
  .type-btn .type-info small { display: block; font-size: 12px; color: #4a6b53; font-weight: 500; margin-top: 3px; }

  /* Conductor: azul brillante */
  .type-btn.conductor { border-color: #1565c0; }
  .type-btn.conductor .type-icon { background: linear-gradient(135deg, #1976d2, #0d47a1); }
  .type-btn.conductor:hover { background: #e3f2fd; border-color: #0d47a1; }

  /* Empresa: verde Kanwork */
  .type-btn.autonomo:not(#btnTypeRegistrarse) { border-color: #2e7d32; }
  .type-btn.autonomo:not(#btnTypeRegistrarse) .type-icon { background: linear-gradient(135deg, #2e7d32, #1b5e20); }
  .type-btn.autonomo:not(#btnTypeRegistrarse):hover { background: #e8f5e9; border-color: #1b5e20; }

  /* Registrarse: CTA destacada con fondo verde solido */
  #btnTypeRegistrarse {
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    border-color: #1b5e20;
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(27, 94, 32, 0.35);
  }
  #btnTypeRegistrarse .type-info span,
  #btnTypeRegistrarse .type-info small { color: #ffffff; }
  #btnTypeRegistrarse .type-info small { opacity: 0.92; }
  #btnTypeRegistrarse .type-icon {
    background: rgba(255,255,255,0.18) !important;
    box-shadow: none;
  }
  #btnTypeRegistrarse .type-icon svg path { fill: #ffffff !important; }
  #btnTypeRegistrarse:hover {
    background: linear-gradient(135deg, #1b5e20, #0d3d12);
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(27, 94, 32, 0.45);
  }

  /* ===== HOME SCREEN ===== */
  .home-screen { background: #f0f9f0; padding: 50px 0 0; }

  .home-top {
    padding: 16px 20px; display: flex;
    justify-content: space-between; align-items: center;
  }
  .greeting h3 { font-size: 13px; color: #6b8f72; font-weight: 400; }
  .greeting h2 { font-size: 20px; font-weight: 700; color: #1b5e20; }

  .avatar-wrap { display: flex; align-items: center; gap: 10px; }
  .notif-btn {
    width: 40px; height: 40px; border-radius: 12px;
    background: rgba(0,0,0,0.04); border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; position: relative;
  }
  .notif-btn svg { width: 20px; height: 20px; fill: #6b8f72; }
  .notif-dot {
    position: absolute; top: 8px; right: 8px;
    width: 8px; height: 8px; background: #ff4757;
    border-radius: 50%; border: 2px solid #f0f9f0;
    display: none;
  }
  .avatar {
    width: 40px; height: 40px; border-radius: 12px;
    background: linear-gradient(135deg, #00d4aa, #0088ff);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 700; color: #fff;
  }

  .home-scroll {
    flex: 1; overflow-y: auto; padding: 0 20px 100px;
    -webkit-overflow-scrolling: touch;
  }
  .home-scroll::-webkit-scrollbar { display: none; }

  .section-title {
    font-size: 17px; font-weight: 700; margin: 20px 0 12px;
    display: flex; align-items: center; justify-content: space-between;
    color: #1b5e20;
  }
  .section-title .see-all { font-size: 13px; color: #00d4aa; font-weight: 500; cursor: pointer; }

  /* Trip cards */
  .trip-card {
    background: #ffffff; border-radius: 16px; padding: 16px;
    margin-bottom: 12px; cursor: pointer;
    border: 1px solid rgba(0,0,0,0.08);
    transition: all 0.25s;
  }
  .trip-card:active { transform: scale(0.98); }
  .trip-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
  .trip-route { flex: 1; }
  .trip-route .route-line { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
  .route-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid #00d4aa; flex-shrink: 0; }
  .route-dot.dest { background: #00d4aa; }
  .route-line .route-text { font-size: 14px; font-weight: 600; color: #2e4a33; }
  .route-line .route-text small { display: block; font-size: 11px; color: #6b8f72; font-weight: 400; }
  .trip-connector { width: 2px; height: 16px; background: rgba(0,212,170,0.3); margin-left: 4px; }
  .trip-status {
    padding: 4px 10px; border-radius: 8px; font-size: 11px; font-weight: 600;
    white-space: nowrap;
  }
  .trip-status.pendiente { background: rgba(255,165,0,0.15); color: #ffa500; }
  .trip-status.en-curso { background: rgba(0,212,170,0.15); color: #00d4aa; }
  .trip-status.completado { background: rgba(0,136,255,0.15); color: #0088ff; }
  .trip-meta { display: flex; gap: 16px; }
  .trip-meta span { font-size: 12px; color: #6b8f72; display: flex; align-items: center; gap: 4px; }
  .trip-meta svg { width: 14px; height: 14px; fill: #6b8f72; }

  /* Quick stats */
  .stats-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
    margin-bottom: 20px;
  }
  .stat-card {
    background: #ffffff; border-radius: 14px; padding: 16px;
    border: 1px solid rgba(0,0,0,0.08);
  }
  .stat-card .stat-icon {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 10px;
  }
  .stat-card .stat-icon svg { width: 18px; height: 18px; fill: #fff; }
  .stat-card .stat-value { font-size: 24px; font-weight: 800; color: #1b5e20; }
  .stat-card .stat-label { font-size: 12px; color: #6b8f72; margin-top: 2px; }
  .stat-card:nth-child(1) .stat-icon { background: linear-gradient(135deg, #00d4aa, #0088ff); }
  .stat-card:nth-child(2) .stat-icon { background: linear-gradient(135deg, #0088ff, #6c5ce7); }
  .stat-card:nth-child(3) .stat-icon { background: linear-gradient(135deg, #ff6b35, #f7931e); }
  .stat-card:nth-child(4) .stat-icon { background: linear-gradient(135deg, #ff4757, #ff6b81); }

  /* Availability toggle */
  .availability-card {
    background: #ffffff; border-radius: 16px; padding: 18px;
    margin-bottom: 16px; display: flex; align-items: center;
    justify-content: space-between;
    border: 1px solid rgba(0,0,0,0.08);
  }
  .availability-card .avail-info h4 { font-size: 15px; font-weight: 600; color: #2e4a33; }
  .availability-card .avail-info p { font-size: 12px; color: #6b8f72; margin-top: 2px; }
  .toggle-switch {
    width: 52px; height: 30px; background: rgba(0,0,0,0.12);
    border-radius: 15px; cursor: pointer; position: relative;
    transition: background 0.3s;
  }
  .toggle-switch.on { background: #00d4aa; }
  .toggle-switch .toggle-knob {
    width: 24px; height: 24px; background: #fff; border-radius: 50%;
    position: absolute; top: 3px; left: 3px;
    transition: transform 0.3s;
  }
  .toggle-switch.on .toggle-knob { transform: translateX(22px); }

  /* Vehicle card */
  .vehicle-card {
    background: #ffffff; border-radius: 16px; padding: 16px;
    margin-bottom: 16px;
    border: 1px solid rgba(0,0,0,0.08);
    display: flex; align-items: center; gap: 14px;
  }
  .vehicle-icon {
    width: 50px; height: 50px; border-radius: 14px;
    background: linear-gradient(135deg, rgba(0,212,170,0.15), rgba(0,136,255,0.15));
    display: flex; align-items: center; justify-content: center;
  }
  .vehicle-icon svg { width: 28px; height: 28px; fill: #00d4aa; }
  .vehicle-info h4 { font-size: 15px; font-weight: 600; color: #2e4a33; }
  .vehicle-info p { font-size: 12px; color: #6b8f72; margin-top: 2px; }

  /* ===== BOTTOM NAV ===== */
  .bottom-nav {
    position: absolute; bottom: 0; left: 0; right: 0;
    height: 80px; background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0,0,0,0.08);
    display: flex; align-items: center; justify-content: space-around;
    padding: 0 8px; padding-bottom: env(safe-area-inset-bottom, 0px);
    z-index: 50;
  }
  .nav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    gap: 4px; padding: 8px 0; cursor: pointer;
    transition: all 0.2s;
  }
  .nav-item svg { width: 22px; height: 22px; fill: #8a9a8e; transition: fill 0.2s; }
  .nav-item span { font-size: 10px; color: #8a9a8e; font-weight: 500; transition: color 0.2s; }
  .nav-item.active svg { fill: #00d4aa; }
  .nav-item.active span { color: #00d4aa; }

  .nav-center {
    width: 56px; height: 56px; border-radius: 50%;
    background: linear-gradient(135deg, #00d4aa, #0088ff);
    display: flex; align-items: center; justify-content: center;
    margin-top: -20px; cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,212,170,0.3);
    transition: transform 0.2s;
  }
  .nav-center:active { transform: scale(0.9); }
  .nav-center svg { width: 26px; height: 26px; fill: #fff; }

  /* ===== TRIP DETAIL ===== */
  .detail-screen { background: #f0f9f0; padding: 50px 0 0; }
  .detail-header {
    padding: 16px 20px; display: flex; align-items: center; gap: 14px;
  }
  .back-btn {
    width: 40px; height: 40px; border-radius: 12px;
    background: rgba(0,0,0,0.04); border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
  }
  .back-btn svg { width: 20px; height: 20px; fill: #2e7d32; }
  .detail-header h2 { font-size: 18px; font-weight: 700; color: #1b5e20; }

  .detail-scroll {
    flex: 1; overflow-y: auto; padding: 0 20px 30px;
    -webkit-overflow-scrolling: touch;
  }
  .detail-scroll::-webkit-scrollbar { display: none; }

  .detail-info-card {
    background: #ffffff; border-radius: 16px; padding: 20px;
    margin-bottom: 16px; border: 1px solid rgba(0,0,0,0.08);
  }
  .detail-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid rgba(0,0,0,0.03); }
  .detail-row:last-child { border-bottom: none; }
  .detail-row .dr-label { font-size: 13px; color: #6b8f72; }
  .detail-row .dr-value { font-size: 14px; font-weight: 600; text-align: right; color: #2e4a33; }

  .gps-indicator {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 16px; background: rgba(0,212,170,0.08);
    border-radius: 12px; margin-bottom: 16px;
  }
  .gps-dot {
    width: 10px; height: 10px; border-radius: 50%; background: #00d4aa;
    animation: gpsPulse 2s ease infinite;
  }
  @keyframes gpsPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
  .gps-indicator span { font-size: 13px; color: #00d4aa; font-weight: 500; }

  .doc-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 16px; }
  .doc-thumb {
    aspect-ratio: 1; background: rgba(0,0,0,0.03);
    border-radius: 12px; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 6px;
    border: 1px dashed rgba(0,0,0,0.08);
  }
  .doc-thumb svg { width: 24px; height: 24px; fill: #8a9a8e; }
  .doc-thumb span { font-size: 10px; color: #6b8f72; }
  .doc-thumb.filled { border-style: solid; border-color: rgba(0,212,170,0.2); background: rgba(0,212,170,0.05); }
  .doc-thumb.filled svg { fill: #00d4aa; }
  .doc-thumb.filled span { color: #00d4aa; }

  .add-doc-btn {
    width: 100%; padding: 14px; background: rgba(0,212,170,0.1);
    border: 1px dashed rgba(0,212,170,0.3); border-radius: 14px;
    color: #00d4aa; font-size: 14px; font-weight: 600;
    cursor: pointer; font-family: 'Inter', sans-serif;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin-bottom: 16px;
  }
  .add-doc-btn svg { width: 20px; height: 20px; fill: #00d4aa; }

  .doc-list-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 0; border-bottom: 1px solid rgba(0,0,0,0.03);
  }
  .doc-list-item:last-child { border-bottom: none; }
  .doc-type-badge {
    padding: 4px 8px; border-radius: 6px; font-size: 10px; font-weight: 600;
    background: rgba(0,212,170,0.15); color: #00d4aa; white-space: nowrap;
  }
  .doc-list-info { flex: 1; }
  .doc-list-info h4 { font-size: 14px; font-weight: 600; color: #2e4a33; }
  .doc-list-info p { font-size: 11px; color: #6b8f72; margin-top: 2px; }

  /* ===== DOCUMENTS SCREEN ===== */
  .docs-screen { background: #f0f9f0; padding: 50px 0 0; }
  .docs-header { padding: 16px 20px; }
  .docs-header h2 { font-size: 22px; font-weight: 700; margin-bottom: 14px; color: #1b5e20; }

  .search-bar {
    display: flex; align-items: center; gap: 10px;
    background: rgba(0,0,0,0.04); border-radius: 14px;
    padding: 12px 16px; margin-bottom: 14px;
  }
  .search-bar svg { width: 18px; height: 18px; fill: #8a9a8e; flex-shrink: 0; }
  .search-bar input {
    flex: 1; background: none; border: none; color: #2e4a33;
    font-size: 14px; font-family: 'Inter', sans-serif; outline: none;
  }
  .search-bar input::placeholder { color: #6b8f72; }

  .filter-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
  .filter-chips::-webkit-scrollbar { display: none; }
  .filter-chip {
    padding: 8px 16px; border-radius: 20px; font-size: 12px; font-weight: 600;
    background: rgba(0,0,0,0.04); color: #6b8f72;
    cursor: pointer; white-space: nowrap; border: none;
    font-family: 'Inter', sans-serif; transition: all 0.2s;
  }
  .filter-chip.active, .filter-chip.active-chip { background: rgba(0,212,170,0.15); color: #00d4aa; }

  .docs-scroll {
    flex: 1; overflow-y: auto; padding: 14px 20px 100px;
    -webkit-overflow-scrolling: touch;
  }
  .docs-scroll::-webkit-scrollbar { display: none; }

  .doc-card {
    background: #ffffff; border-radius: 14px; padding: 14px;
    margin-bottom: 10px; display: flex; align-items: center; gap: 12px;
    border: 1px solid rgba(0,0,0,0.08); cursor: pointer;
  }
  .doc-card:active { transform: scale(0.98); }
  .doc-card .doc-preview {
    width: 50px; height: 50px; border-radius: 10px;
    background: rgba(0,0,0,0.03); display: flex;
    align-items: center; justify-content: center;
  }
  .doc-card .doc-preview svg { width: 24px; height: 24px; fill: #8a9a8e; }
  .doc-card .doc-info { flex: 1; }
  .doc-card .doc-info h4 { font-size: 14px; font-weight: 600; color: #2e4a33; }
  .doc-card .doc-info .doc-ref { font-size: 12px; color: #00d4aa; margin-top: 2px; }
  .doc-card .doc-info .doc-date { font-size: 11px; color: #6b8f72; margin-top: 2px; }

  .scan-fab {
    position: absolute; bottom: 96px; right: 20px;
    width: 56px; height: 56px; border-radius: 50%;
    background: linear-gradient(135deg, #00d4aa, #0088ff);
    border: none; display: flex; align-items: center; justify-content: center;
    cursor: pointer; box-shadow: 0 6px 24px rgba(0,212,170,0.3);
    z-index: 40; transition: transform 0.2s;
  }
  .scan-fab:active { transform: scale(0.9); }
  .scan-fab svg { width: 26px; height: 26px; fill: #fff; }

  /* ===== EXPENSES SCREEN ===== */
  .expenses-screen { background: #f0f9f0; padding: 50px 0 0; }
  .expenses-header {
    padding: 16px 20px; display: flex; align-items: center; gap: 14px;
  }
  .expenses-header h2 { font-size: 20px; font-weight: 700; color: #1b5e20; }

  .expenses-scroll {
    flex: 1; overflow-y: auto; padding: 0 20px 30px;
    -webkit-overflow-scrolling: touch;
  }
  .expenses-scroll::-webkit-scrollbar { display: none; }

  .expense-form {
    background: #ffffff; border-radius: 16px; padding: 20px;
    margin-bottom: 20px; border: 1px solid rgba(0,0,0,0.08);
  }
  .expense-form h3 { font-size: 17px; font-weight: 700; margin-bottom: 16px; color: #1b5e20; }

  .expense-type-grid {
    display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 16px;
  }
  .expense-type-btn {
    padding: 12px 8px; border-radius: 12px;
    background: rgba(0,0,0,0.03); border: 2px solid rgba(0,0,0,0.04);
    color: #6b8f72; font-size: 11px; font-weight: 600; cursor: pointer;
    text-align: center; font-family: 'Inter', sans-serif; transition: all 0.2s;
  }
  .expense-type-btn.active { border-color: #00d4aa; color: #00d4aa; background: rgba(0,212,170,0.08); }
  .expense-type-btn svg { display: block; margin: 0 auto 6px; width: 20px; height: 20px; fill: currentColor; }

  .photo-btn {
    width: 100%; padding: 14px; background: rgba(0,0,0,0.03);
    border: 1px dashed rgba(0,0,0,0.08); border-radius: 14px;
    color: #6b8f72; font-size: 13px; font-weight: 500;
    cursor: pointer; font-family: 'Inter', sans-serif;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin-bottom: 16px;
  }
  .photo-btn svg { width: 20px; height: 20px; fill: #8a9a8e; }

  .submit-btn {
    width: 100%; padding: 16px;
    background: linear-gradient(135deg, #00d4aa, #0088ff);
    border: none; border-radius: 14px; color: #fff;
    font-size: 16px; font-weight: 600; cursor: pointer;
    font-family: 'Inter', sans-serif;
  }

  .expense-item {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 0; border-bottom: 1px solid rgba(0,0,0,0.03);
  }
  .expense-item:last-child { border-bottom: none; }
  .expense-item .ei-icon {
    width: 42px; height: 42px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
  }
  .expense-item .ei-icon svg { width: 20px; height: 20px; fill: #fff; }
  .expense-item .ei-info { flex: 1; }
  .expense-item .ei-info h4 { font-size: 14px; font-weight: 600; color: #2e4a33; }
  .expense-item .ei-info p { font-size: 11px; color: #6b8f72; margin-top: 2px; }
  .expense-item .ei-amount { font-size: 16px; font-weight: 700; color: #00d4aa; }

  /* ===== CHAT SCREEN ===== */
  .chat-screen { background: #f0f9f0; padding: 50px 0 0; }
  .chat-header {
    padding: 16px 20px; display: flex; align-items: center; gap: 14px;
    border-bottom: 1px solid rgba(0,0,0,0.03);
  }
  .chat-avatar {
    width: 40px; height: 40px; border-radius: 12px;
    background: linear-gradient(135deg, #00d4aa, #0088ff);
    display: flex; align-items: center; justify-content: center;
  }
  .chat-avatar svg { width: 20px; height: 20px; fill: #fff; }
  .chat-header-info h3 { font-size: 15px; font-weight: 600; color: #1b5e20; }
  .chat-header-info p { font-size: 11px; color: #00d4aa; }

  .chat-messages {
    flex: 1; overflow-y: auto; padding: 16px 20px;
    display: flex; flex-direction: column; gap: 12px;
    -webkit-overflow-scrolling: touch;
  }
  .chat-messages::-webkit-scrollbar { display: none; }

  .msg { max-width: 80%; padding: 12px 16px; border-radius: 18px; font-size: 14px; line-height: 1.5; color: #2e4a33; }
  .msg.received {
    background: #ffffff; align-self: flex-start;
    border-bottom-left-radius: 4px;
  }
  .msg.sent {
    background: linear-gradient(135deg, rgba(0,212,170,0.2), rgba(0,136,255,0.2));
    align-self: flex-end;
    border-bottom-right-radius: 4px;
  }
  .msg .msg-time { font-size: 10px; color: #6b8f72; margin-top: 4px; }
  .msg.received .msg-sender { font-size: 11px; color: #00d4aa; font-weight: 600; margin-bottom: 4px; }

  .chat-input-bar {
    padding: 12px 20px; display: flex; align-items: center; gap: 10px;
    border-top: 1px solid rgba(0,0,0,0.03);
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  }
  .chat-input {
    flex: 1; padding: 12px 16px;
    background: rgba(0,0,0,0.04); border: none; border-radius: 20px;
    color: #2e4a33; font-size: 14px; font-family: 'Inter', sans-serif; outline: none;
  }
  .chat-input::placeholder { color: #a0b5a5; }
  .send-btn {
    width: 42px; height: 42px; border-radius: 50%;
    background: linear-gradient(135deg, #00d4aa, #0088ff);
    border: none; display: flex; align-items: center; justify-content: center;
    cursor: pointer;
  }
  .send-btn svg { width: 20px; height: 20px; fill: #fff; }

  /* ===== PROFILE SCREEN ===== */
  .profile-screen { background: #f0f9f0; padding: 50px 0 0; }
  .profile-header-section {
    text-align: center; padding: 20px;
  }
  .profile-avatar {
    width: 80px; height: 80px; border-radius: 24px;
    background: linear-gradient(135deg, #00d4aa, #0088ff);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 14px; font-size: 32px; font-weight: 800;
  }
  .profile-header-section h2 { font-size: 22px; font-weight: 700; color: #1b5e20; }
  .profile-header-section .profile-company { font-size: 13px; color: #00d4aa; margin-top: 4px; }
  .profile-header-section .profile-role {
    display: inline-block; padding: 4px 12px; border-radius: 8px;
    background: rgba(0,212,170,0.1); color: #00d4aa;
    font-size: 12px; font-weight: 600; margin-top: 8px;
  }

  .profile-stats {
    display: flex; justify-content: center; gap: 24px;
    padding: 16px 20px; margin-bottom: 8px;
  }
  .profile-stat { text-align: center; }
  .profile-stat .ps-value { font-size: 22px; font-weight: 800; color: #1b5e20; }
  .profile-stat .ps-label { font-size: 11px; color: #6b8f72; margin-top: 2px; }

  .profile-scroll {
    flex: 1; overflow-y: auto; padding: 0 20px 100px;
    -webkit-overflow-scrolling: touch;
  }
  .profile-scroll::-webkit-scrollbar { display: none; }

  .profile-menu-item {
    display: flex; align-items: center; gap: 14px;
    padding: 16px; background: #ffffff; border-radius: 14px;
    margin-bottom: 8px; cursor: pointer;
    border: 1px solid rgba(0,0,0,0.08);
    transition: all 0.2s;
  }
  .profile-menu-item:active { transform: scale(0.98); background: rgba(0,0,0,0.04); }
  .profile-menu-item .pmi-icon {
    width: 38px; height: 38px; border-radius: 10px;
    background: rgba(0,0,0,0.04); display: flex;
    align-items: center; justify-content: center;
  }
  .profile-menu-item .pmi-icon svg { width: 18px; height: 18px; fill: #8a9a8e; }
  .profile-menu-item .pmi-text { flex: 1; font-size: 14px; font-weight: 500; color: #2e4a33; }
  .profile-menu-item .pmi-arrow { fill: #8a9a8e; width: 16px; height: 16px; }

  .logout-btn {
    width: 100%; padding: 16px; margin-top: 16px;
    background: rgba(255,71,87,0.1); border: 1px solid rgba(255,71,87,0.2);
    border-radius: 14px; color: #ff4757; font-size: 15px; font-weight: 600;
    cursor: pointer; font-family: 'Inter', sans-serif;
  }
  .version-text {
    text-align: center; font-size: 12px; color: #6b8f72; margin-top: 16px; padding-bottom: 20px;
  }

  /* ===== MODAL ===== */
  .modal-overlay {
    position: absolute; inset: 0; background: rgba(0,0,0,0.7);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    z-index: 300; display: none; align-items: center; justify-content: center;
    padding: 30px;
  }
  .modal-overlay.show { display: flex; }
  .modal-content {
    background: #ffffff; border-radius: 24px; padding: 30px;
    width: 100%; max-width: 320px; text-align: center;
    border: 1px solid rgba(0,0,0,0.04);
    animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .modal-content h3 { font-size: 18px; font-weight: 700; margin-bottom: 10px; color: #1b5e20; }
  .modal-content p { font-size: 13px; color: #6b8f72; line-height: 1.5; margin-bottom: 20px; }
  .modal-close {
    padding: 12px 32px; background: rgba(0,0,0,0.06);
    border: none; border-radius: 12px; color: #2e4a33;
    font-size: 14px; font-weight: 600; cursor: pointer;
    font-family: 'Inter', sans-serif;
  }

  /* Camera viewfinder */
  .viewfinder {
    width: 200px; height: 200px; margin: 0 auto 20px;
    border: 2px solid #00d4aa; border-radius: 16px; position: relative;
    display: flex; align-items: center; justify-content: center;
  }
  .viewfinder::before, .viewfinder::after {
    content: ''; position: absolute; width: 30px; height: 30px;
    border: 3px solid #00d4aa;
  }
  .viewfinder::before { top: -2px; left: -2px; border-right: none; border-bottom: none; border-radius: 16px 0 0 0; }
  .viewfinder::after { bottom: -2px; right: -2px; border-left: none; border-top: none; border-radius: 0 0 16px 0; }
  .viewfinder .vf-corner-tr, .viewfinder .vf-corner-bl {
    position: absolute; width: 30px; height: 30px; border: 3px solid #00d4aa;
  }
  .viewfinder .vf-corner-tr { top: -2px; right: -2px; border-left: none; border-bottom: none; border-radius: 0 16px 0 0; }
  .viewfinder .vf-corner-bl { bottom: -2px; left: -2px; border-right: none; border-top: none; border-radius: 0 0 0 16px; }
  .scan-line {
    position: absolute; width: 80%; height: 2px; background: #00d4aa;
    box-shadow: 0 0 10px #00d4aa; animation: scanMove 2s ease-in-out infinite;
  }
  @keyframes scanMove { 0%,100% { top: 20%; } 50% { top: 80%; } }

  /* ===== RESPONSIVE ===== */
  @media (max-width: 420px) {
    .phone-frame { width: 100vw; height: 100vh; border-radius: 0; box-shadow: none; }
    .notch { display: none; }
    .status-bar { padding-top: env(safe-area-inset-top, 12px); }
    .bottom-nav { padding-bottom: env(safe-area-inset-bottom, 8px); }
  }
  @media (max-width: 375px) {
    .greeting h2 { font-size: 18px; }
    .stat-card .stat-value { font-size: 20px; }
    .splash-brand { font-size: 32px; }
  }
  @media (max-width: 320px) {
    .stats-grid { grid-template-columns: 1fr; }
    .splash-brand { font-size: 28px; }
  }

  @media (display-mode: standalone) {
    .phone-frame { width: 100vw; height: 100vh; border-radius: 0; box-shadow: none; }
    .notch { display: none; }
    .status-bar { padding-top: env(safe-area-inset-top, 12px); }
    .bottom-nav { padding-bottom: env(safe-area-inset-bottom, 8px); }
  }


  /* Visibilidad por rol */
  body.role-oficina .conductor-only { display: none !important; }
  body:not(.role-oficina) .office-only { display: none !important; }
  body:not(.rol-admin) .admin-only { display: none !important; }
  body:not(.rol-admin):not(.rol-logistica) .logistica-or-admin { display: none !important; }
  body:not(.rol-admin):not(.rol-facturacion) .facturacion-or-admin { display: none !important; }
  body:not(.rol-admin):not(.rol-facturacion) .precio-only { display: none !important; }
  body.rol-facturacion .no-facturacion { display: none !important; }

  /* ===== Pantalla oficina (rol admin) ===== */
  .office-screen { background: #f5f9f5; display: flex; flex-direction: column; }
  .office-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; background: linear-gradient(135deg, #2e7d32, #1b5e20); color: #fff; }
  .office-brand { display: flex; align-items: center; gap: 12px; }
  .office-empresa-name { font-size: 16px; font-weight: 700; line-height: 1.1; }
  .office-tagline { font-size: 12px; opacity: 0.85; }
  .office-profile-btn { background: rgba(255,255,255,0.18); border: none; border-radius: 50%; width: 36px; height: 36px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
  .office-profile-btn svg { width: 22px; height: 22px; fill: #fff; }
  .office-tabs {
    display: flex; gap: 4px;
    padding: 8px 14px 0;
    background: #fff;
    border-bottom: 1px solid #e0eee2;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }
  .office-tabs::-webkit-scrollbar { display: none; }
  .office-tab {
    flex: 0 0 auto;
    padding: 10px 14px;
    background: none; border: none;
    font-size: 14px; font-weight: 600;
    color: #6b8f72; cursor: pointer;
    border-bottom: 3px solid transparent;
    font-family: inherit;
    white-space: nowrap;
    scroll-snap-align: start;
  }
  .office-tab.active { color: #1b5e20; border-bottom-color: #2e7d32; }
  /* En pantallas grandes, repartir el ancho */
  @media (min-width: 600px) {
    .office-tab { flex: 1; }
  }
  .office-filters { display: flex; gap: 8px; padding: 12px 14px; overflow-x: auto; background: #fff; border-bottom: 1px solid #e0eee2; -webkit-overflow-scrolling: touch; }
  .office-filter { flex-shrink: 0; padding: 6px 14px; background: rgba(46,125,50,0.08); color: #2e7d32; border: none; border-radius: 16px; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; font-family: inherit; }
  .office-filter.active { background: linear-gradient(135deg, #2e7d32, #1b5e20); color: #fff; }
  .office-content { flex: 1; overflow-y: auto; padding: 14px; }
  .office-route-card { background: #fff; border-radius: 14px; padding: 14px; margin-bottom: 10px; border: 1px solid #e0eee2; box-shadow: 0 1px 3px rgba(0,0,0,0.04); cursor: pointer; }
  .office-route-card .orc-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
  .office-route-card .orc-fecha { font-size: 12px; font-weight: 700; color: #2e7d32; text-transform: uppercase; }
  .office-route-card .orc-estado { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
  .office-route-card .orc-estado.pending { background: #fff3cd; color: #856404; }
  .office-route-card .orc-estado.aceptada { background: #d4edda; color: #155724; }
  .office-route-card .orc-estado.encurso { background: #cce5ff; color: #004085; }
  .office-route-card .orc-estado.completada { background: #d1ecf1; color: #0c5460; }
  .office-route-card .orc-cliente { font-size: 15px; font-weight: 700; color: #1b5e20; margin-bottom: 6px; }
  .office-route-card .orc-ruta { font-size: 13px; color: #4a6b53; display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
  .office-route-card .orc-conductor { font-size: 12px; color: #6b8f72; }
  .office-route-card .orc-numero { font-size: 11px; font-weight: 700; color: #6b8f72; background: #f1f8e9; padding: 2px 7px; border-radius: 6px; margin-right: 8px; }
  .office-route-card .orc-metido { font-size: 11px; color: #455a64; background: #eceff1; padding: 2px 7px; border-radius: 6px; margin-top: 4px; display: inline-block; }
  .office-route-card .orc-metido.future { color: #1565c0; background: #e3f2fd; }
  /* AGENDA BAR */
  .office-agenda-bar { display: flex; gap: 6px; align-items: center; padding: 8px 10px; background: #fff; border-bottom: 1px solid #e0eee2; flex-wrap: nowrap; }
  .office-agenda-nav { width: 28px; height: 44px; border: 1px solid #c8e6c9; background: #fff; color: #1b5e20; border-radius: 8px; font-size: 18px; font-weight: 700; cursor: pointer; flex-shrink: 0; font-family: inherit; }
  .office-agenda-today { padding: 0 10px; height: 44px; border: 1px solid #1b5e20; background: #1b5e20; color: #fff; border-radius: 8px; font-size: 11px; font-weight: 700; cursor: pointer; flex-shrink: 0; font-family: inherit; }
  .office-agenda-strip { display: flex; gap: 5px; overflow-x: auto; flex: 1; -webkit-overflow-scrolling: touch; padding: 2px 0; }
  .office-agenda-strip::-webkit-scrollbar { height: 4px; }
  .office-agenda-strip::-webkit-scrollbar-thumb { background: #c8e6c9; border-radius: 2px; }
  .office-agenda-jump { height: 44px; padding: 0 8px; border: 1px solid #c8e6c9; border-radius: 8px; font-size: 11px; font-family: inherit; background: #fff; color: #1b5e20; cursor: pointer; flex-shrink: 0; }
  .agenda-day { flex-shrink: 0; min-width: 60px; padding: 4px 8px 3px; border-radius: 8px; border: 1px solid #c8e6c9; background: #fafafa; text-align: center; line-height: 1.2; cursor: pointer; position: relative; font-family: inherit; }
  .agenda-day .ad-dn { font-size: 9px; text-transform: uppercase; opacity: 0.7; color: #1b5e20; }
  .agenda-day .ad-dd { font-size: 14px; font-weight: 700; color: #1b5e20; }
  .agenda-day .ad-cnt { display: inline-block; min-width: 16px; padding: 0 5px; margin-top: 2px; font-size: 9px; font-weight: 700; border-radius: 7px; background: #c8e6c9; color: #1b5e20; }
  .agenda-day.empty { background: #fafafa; border-color: #e0e0e0; }
  .agenda-day.empty .ad-dn, .agenda-day.empty .ad-dd { color: #9e9e9e; }
  .agenda-day.empty .ad-cnt { background: #eee; color: #aaa; }
  .agenda-day.light { background: #f1f8e9; border-color: #c8e6c9; }
  .agenda-day.medium { background: #fff8e1; border-color: #ffe082; }
  .agenda-day.medium .ad-dn, .agenda-day.medium .ad-dd { color: #e65100; }
  .agenda-day.medium .ad-cnt { background: #ffe082; color: #856404; }
  .agenda-day.heavy { background: #ffebee; border-color: #ef9a9a; }
  .agenda-day.heavy .ad-dn, .agenda-day.heavy .ad-dd { color: #b71c1c; }
  .agenda-day.heavy .ad-cnt { background: #ef9a9a; color: #721c24; }
  .agenda-day.active { background: #1b5e20 !important; border-color: #1b5e20 !important; box-shadow: 0 0 0 2px #1b5e20; }
  .agenda-day.active .ad-dn, .agenda-day.active .ad-dd { color: #fff !important; opacity: 1; }
  .agenda-day.active .ad-cnt { background: rgba(255,255,255,0.25) !important; color: #fff !important; }
  .agenda-day.today:not(.active) { box-shadow: inset 0 0 0 2px #2e7d32; }
  .agenda-bell { position: absolute; top: -5px; right: -5px; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 1.5px solid #ff8f00; color: #ff8f00; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; line-height: 1; }
  /* DAY HEADER */
  .office-day-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: #eef5ec; border-bottom: 1px solid #e0eee2; }
  .office-day-header-title { font-size: 13px; font-weight: 700; color: #1b5e20; }
  .office-day-add { padding: 6px 12px; font-size: 11px; font-weight: 700; background: linear-gradient(135deg, #2e7d32, #1b5e20); color: #fff; border: none; border-radius: 8px; cursor: pointer; font-family: inherit; }
  /* VIEW TOGGLE ROW */
  .office-view-toggle-row { display: flex; gap: 6px; align-items: center; padding: 8px 14px; background: #fff; border-bottom: 1px solid #e0eee2; }
  .office-view-label { font-size: 11px; color: #6b8f72; font-weight: 600; }
  .office-view-btn { padding: 5px 12px; font-size: 11px; font-weight: 600; border: 1px solid #c8e6c9; background: #fff; color: #6b8f72; border-radius: 7px; cursor: pointer; font-family: inherit; }
  .office-view-btn.active { background: #e8f5e9; color: #1b5e20; border-color: #1b5e20; }
  .office-search-input { width: 160px; height: 28px; padding: 0 8px; border: 1px solid #c8e6c9; border-radius: 7px; font-size: 11px; font-family: inherit; background: #fff; color: #1b5e20; }
  /* TABLE VIEW */
  .office-routes-table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border-radius: 10px; overflow: hidden; border: 1px solid #e0eee2; }
  .office-routes-table thead th { position: sticky; top: 0; background: #1b5e20; color: #fff; padding: 6px 6px; text-align: left; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; z-index: 2; }
  .office-routes-table td { padding: 4px 6px; font-size: 11px; border-bottom: 1px solid #f1f1f1; color: #2c3e50; line-height: 1.4; white-space: nowrap; }
  .office-routes-table tbody tr { cursor: pointer; }
  .office-routes-table tbody tr:hover td { background: #f9fbf9; }
  .office-routes-table .ort-num { font-weight: 700; color: #1b5e20; white-space: nowrap; }
  .office-routes-table .ort-hora { color: #1b5e20; font-weight: 700; white-space: nowrap; }
  .office-routes-table .ort-cliente { font-weight: 600; color: #1b5e20; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .office-routes-table .ort-ruta { color: #4a6b53; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .office-routes-table .ort-cond { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .office-routes-table .ort-cond-pill { display: inline-block; padding: 1px 7px; border-radius: 8px; font-size: 10px; font-weight: 600; }
  .office-routes-table .ort-est { font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 5px; white-space: nowrap; }
  .office-routes-table .ort-est.pending { background: #fff3cd; color: #856404; }
  .office-routes-table .ort-est.aceptada { background: #d4edda; color: #155724; }
  .office-routes-table .ort-est.encurso { background: #cce5ff; color: #004085; }
  .office-routes-table .ort-est.completada { background: #d1ecf1; color: #0c5460; }
  .office-routes-table .ort-met { font-size: 10px; color: #455a64; background: #eceff1; padding: 1px 6px; border-radius: 5px; white-space: nowrap; }
  .office-routes-table .ort-met.future { color: #1565c0; background: #e3f2fd; }
  .office-routes-table .ort-sub { font-size: 13px; }
  .office-routes-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 4px 0; }
  /* FUTURE BANNER en modal */
  .cv-future-banner { background: #e3f2fd; border: 1px solid #90caf9; border-radius: 10px; padding: 10px 12px; font-size: 12px; color: #0d47a1; line-height: 1.5; margin-bottom: 12px; }
  .cv-future-banner strong { font-weight: 700; }
  /* FACTURACION */
  .fact-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; padding: 10px 14px; background: #fff; border-bottom: 1px solid #e0eee2; }
  @media (max-width: 900px) { .fact-kpis { grid-template-columns: repeat(3, 1fr); } }
  @media (max-width: 480px) { .fact-kpis { grid-template-columns: repeat(2, 1fr); } }
  .fact-kpi.gray { background: #f5f5f5; border-color: #ddd; }
  .fact-kpi.gray .fk-val { color: #455a64; }
  .fact-kpi.success { background: #e8f5e9; border-color: #c8e6c9; }
  .fact-kpi.success .fk-val { color: #1b5e20; }
  .fact-kpi.info { background: #e3f2fd; border-color: #90caf9; }
  .fact-kpi.info .fk-val { color: #0d47a1; }
  /* Categoria pills */
  .gasto-cat { display: inline-block; font-size: 10px; font-weight: 600; padding: 1px 7px; border-radius: 5px; }
  .gasto-cat.combustible { background: #fff8e1; color: #856404; }
  .gasto-cat.peajes { background: #e3f2fd; color: #0d47a1; }
  .gasto-cat.mantenimiento { background: #f3e5f5; color: #4a148c; }
  .gasto-cat.repuestos { background: #ffebee; color: #b71c1c; }
  .gasto-cat.seguros { background: #e0f2f1; color: #004d40; }
  .gasto-cat.otros { background: #f5f5f5; color: #455a64; }
  .fact-kpi { background: #f9fbf9; border: 1px solid #e0eee2; border-radius: 8px; padding: 7px 9px; }
  .fact-kpi .fk-lbl { font-size: 10px; color: #6b8f72; text-transform: uppercase; letter-spacing: 0.3px; font-weight: 600; }
  .fact-kpi .fk-val { font-size: 15px; font-weight: 700; color: #1b5e20; line-height: 1.1; margin-top: 2px; }
  .fact-kpi .fk-sub { font-size: 10px; color: #6b8f72; margin-top: 2px; }
  .fact-kpi.warn { background: #fff8e1; border-color: #ffe082; }
  .fact-kpi.warn .fk-val { color: #e65100; }
  .fact-kpi.danger { background: #ffebee; border-color: #ef9a9a; }
  .fact-kpi.danger .fk-val { color: #b71c1c; }
  .fact-subtabs { display: flex; gap: 6px; padding: 10px 14px; background: #fff; border-bottom: 1px solid #e0eee2; }
  .fact-subtab { padding: 6px 14px; font-size: 12px; font-weight: 600; border-radius: 8px; border: 1px solid #c8e6c9; color: #6b8f72; background: #fff; cursor: pointer; font-family: inherit; }
  .fact-subtab.active { background: #e8f5e9; color: #1b5e20; border-color: #1b5e20; }
  .fact-subtab .fst-badge { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 5px; font-size: 10px; border-radius: 8px; background: #fff3cd; color: #856404; font-weight: 700; }
  .fact-subtab.active .fst-badge { background: rgba(27,94,32,0.15); color: #1b5e20; }
  .fact-toolbar { display: flex; gap: 8px; align-items: center; padding: 8px 14px; background: #fff; border-bottom: 1px solid #e0eee2; }
  .fact-search { height: 28px; padding: 0 10px; border: 1px solid #c8e6c9; border-radius: 7px; font-size: 12px; font-family: inherit; background: #fff; color: #1b5e20; flex: 1; max-width: 220px; }
  .fact-info-help { font-size: 10px; color: #9aaa9d; }
  .fact-act-btn { padding: 4px 10px; font-size: 10px; font-weight: 700; background: #2e7d32; color: #fff; border-radius: 6px; cursor: pointer; border: none; font-family: inherit; }
  .fact-pill-pago { font-size: 10px; font-weight: 600; padding: 1px 7px; border-radius: 6px; white-space: nowrap; }
  .fact-pill-pago.pdte { background: #fff3cd; color: #856404; }
  .fact-pill-pago.cob { background: #d4edda; color: #155724; }
  .fact-empty { text-align: center; padding: 40px 16px; color: #6b8f72; }
  .fact-empty h3 { color: #1b5e20; margin: 0 0 6px; }
  .fact-empty p { font-size: 12px; margin: 0; line-height: 1.5; }
  .office-conductor-card { background: #fff; border-radius: 14px; padding: 14px; margin-bottom: 10px; display: flex; align-items: center; gap: 12px; border: 1px solid #e0eee2; }
  .office-conductor-avatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, #2e7d32, #1b5e20); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; }
  .office-conductor-info { flex: 1; }
  .office-conductor-name { font-size: 15px; font-weight: 700; color: #1b5e20; }
  .office-conductor-email { font-size: 12px; color: #6b8f72; }
  .office-conductor-vehiculo { font-size: 11px; color: #2e7d32; margin-top: 2px; }
  .office-empty { text-align: center; padding: 60px 20px; color: #6b8f72; }
  .office-empty h3 { margin: 0 0 8px; color: #1b5e20; }
  .office-empty p { font-size: 13px; }
  .office-fab { position: absolute; right: 18px; bottom: 24px; width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, #2e7d32, #1b5e20); color: #fff; border: none; font-size: 28px; font-weight: 300; cursor: pointer; box-shadow: 0 6px 18px rgba(46,125,50,0.35); display: flex; align-items: center; justify-content: center; z-index: 10; line-height: 1; }

  /* ===== Banner de actualizacion de la PWA ===== */
  #updateBanner {
    position: fixed;
    left: 12px;
    right: 12px;
    transform: translateY(-150%);
    top: env(safe-area-inset-top, 0px);
    margin-top: 8px;
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    color: #fff;
    padding: 10px 14px;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    font-size: 13px;
    font-weight: 600;
    transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1);
    flex-wrap: wrap;
  }
  #updateBanner.visible { transform: translateY(0) !important; }
  @media (min-width: 600px) {
    #updateBanner { left: 50%; right: auto; transform: translateX(-50%) translateY(-150%); max-width: 480px; }
    #updateBanner.visible { transform: translateX(-50%) translateY(0) !important; }
  }

  #updateBanner .upd-text { flex: 1; line-height: 1.3; }
  #updateBanner button {
    border: none;
    background: #fff;
    color: #1b5e20;
    padding: 8px 12px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
  }
  #updateBanner .upd-dismiss {
    background: transparent;
    color: #fff;
    opacity: 0.75;
    padding: 6px 8px;
    font-size: 18px;
    font-weight: 400;
  }
  /* Clientes */
  .cliente-card { background: #fff; border: 1px solid #e0eee2; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; }
  .cliente-card:hover { background: #f9fbf9; }
  .cliente-card .cl-nom { font-size: 13px; font-weight: 700; color: #1b5e20; }
  .cliente-card .cl-cif { font-size: 11px; color: #6b8f72; }
  .cliente-card .cl-modo { display: inline-block; font-size: 10px; padding: 1px 6px; border-radius: 5px; background: #e8f5e9; color: #1b5e20; margin-left: 6px; font-weight: 600; }
  .cliente-card .cl-iban { font-size: 10px; color: #6b8f72; font-family: monospace; }
  /* Lista viajes en factura mensual */
  .em-viaje-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 11px; border-bottom: 1px solid #f1f1f1; }
  .em-viaje-row:last-child { border-bottom: none; }
  .em-viaje-row input[type=checkbox] { width: 14px; height: 14px; accent-color: #2e7d32; flex-shrink: 0; }
  .em-viaje-row .evr-fecha { color: #6b8f72; width: 50px; flex-shrink: 0; }
  .em-viaje-row .evr-ruta { flex: 1; color: #2c3e50; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .em-viaje-row .evr-imp { font-weight: 700; color: #1b5e20; flex-shrink: 0; min-width: 70px; text-align: right; }
  .em-viaje-row .evr-com { font-size: 9px; color: #856404; font-style: italic; flex-shrink: 0; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Manual de uso */
  .manual-section { margin-bottom: 18px; border: 1px solid #e0eee2; border-radius: 10px; overflow: hidden; background: #fff; }
  .manual-section-title { background: #e8f5e9; padding: 12px 14px; font-size: 14px; font-weight: 700; color: #1b5e20; cursor: pointer; display: flex; justify-content: space-between; align-items: center; user-select: none; }
  .manual-section-title:hover { background: #d4ebd4; }
  .manual-section-title .arrow { font-size: 16px; transition: transform 0.2s; }
  .manual-section.open .arrow { transform: rotate(90deg); }
  .manual-section-body { padding: 0 14px; max-height: 0; overflow: hidden; transition: max-height 0.25s ease, padding 0.25s ease; }
  .manual-section.open .manual-section-body { padding: 14px; max-height: 4000px; }
  .manual-section-body h4 { color: #1b5e20; font-size: 13px; margin: 12px 0 6px; font-weight: 700; }
  .manual-section-body h4:first-child { margin-top: 0; }
  .manual-section-body p { margin: 0 0 10px; font-size: 13px; line-height: 1.6; color: #2c3e50; }
  .manual-section-body ol, .manual-section-body ul { padding-left: 22px; margin: 0 0 10px; font-size: 13px; line-height: 1.6; color: #2c3e50; }
  .manual-section-body li { margin-bottom: 4px; }
  .manual-section-body strong { color: #1b5e20; font-weight: 700; }
  .manual-section-body code { background: #f1f8e9; padding: 1px 5px; border-radius: 3px; font-family: monospace; font-size: 12px; color: #1b5e20; }
  .manual-section-body .tip { background: #fff8e1; border-left: 3px solid #ffb300; padding: 8px 12px; margin: 8px 0; font-size: 12px; color: #856404; border-radius: 0 6px 6px 0; }
  .manual-section-body .warn { background: #ffebee; border-left: 3px solid #c62828; padding: 8px 12px; margin: 8px 0; font-size: 12px; color: #b71c1c; border-radius: 0 6px 6px 0; }

/* Spinner overlay */
.kw-spinner-overlay { position: absolute; inset: 0; background: rgba(255,255,255,0.85); display: flex; align-items: center; justify-content: center; z-index: 50; pointer-events: all; }
.kw-spinner { width: 32px; height: 32px; border: 3px solid #c8e6c9; border-top-color: #1b5e20; border-radius: 50%; animation: kwspin 0.8s linear infinite; }
@keyframes kwspin { to { transform: rotate(360deg); } }
/* Snackbar undo */
.kw-snackbar { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #2c3e50; color: #fff; padding: 10px 14px; border-radius: 10px; font-size: 13px; display: flex; align-items: center; gap: 14px; box-shadow: 0 4px 12px rgba(0,0,0,0.25); z-index: 9999; max-width: 90vw; }
.kw-snackbar button { background: #ffeb3b; color: #2c3e50; border: none; padding: 6px 14px; border-radius: 6px; font-size: 12px; font-weight: 700; cursor: pointer; font-family: inherit; }
/* Checkbox row in tables */
.kw-bulk-toolbar { display: none; padding: 8px 12px; background: #1b5e20; color: #fff; border-radius: 8px; margin-bottom: 8px; align-items: center; gap: 12px; font-size: 12px; }
.kw-bulk-toolbar.active { display: flex; }
.kw-bulk-toolbar button { background: #ffeb3b; color: #1b5e20; border: none; padding: 5px 12px; border-radius: 6px; font-size: 11px; font-weight: 700; cursor: pointer; font-family: inherit; }
.kw-bulk-toolbar button.danger { background: #ff8a80; color: #5a1a1a; }
.kw-bulk-toolbar button.gray { background: rgba(255,255,255,0.2); color: #fff; }
.kw-checkbox-cell { width: 28px; }
.kw-checkbox-cell input[type=checkbox] { width: 16px; height: 16px; accent-color: #2e7d32; cursor: pointer; }

/* Modales full-screen en movil */
@media (max-width: 600px) {
  .modal-overlay { padding: 0 !important; align-items: stretch !important; }
  .modal-content {
    width: 100% !important;
    max-width: none !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
    height: 100vh !important;
    border-radius: 0 !important;
    margin: 0 !important;
    overflow-y: auto !important;
    padding: 14px !important;
  }
  .modal-content > div:first-child {
    position: sticky;
    top: -14px;
    background: #fff;
    margin: -14px -14px 12px;
    padding: 12px 14px;
    border-bottom: 1px solid #e0eee2;
    z-index: 100;
  }
}

/* Confirm modal */
.kw-confirm-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 99998; padding: 16px; }
.kw-confirm-box { background: #fff; border-radius: 14px; padding: 20px 22px; max-width: 380px; width: 100%; box-shadow: 0 8px 32px rgba(0,0,0,0.3); }
.kw-confirm-box h4 { margin: 0 0 8px; color: #1b5e20; font-size: 16px; font-weight: 700; }
.kw-confirm-box p { margin: 0 0 16px; color: #2c3e50; font-size: 13px; line-height: 1.5; }
.kw-confirm-box .actions { display: flex; gap: 8px; justify-content: flex-end; }
.kw-confirm-box button { padding: 9px 16px; font-size: 13px; font-weight: 600; border: none; border-radius: 8px; cursor: pointer; font-family: inherit; }
.kw-confirm-box button.cancel { background: #f5f5f5; color: #6b8f72; }
.kw-confirm-box button.ok { background: #2e7d32; color: #fff; }
.kw-confirm-box button.danger { background: #c62828; color: #fff; }
/* Sortable table headers */
.office-routes-table thead th[data-sort] { cursor: pointer; user-select: none; }
.office-routes-table thead th[data-sort]:hover { background: #2e7d32; }
.office-routes-table thead th[data-sort]::after { content: ' \2195'; opacity: 0.4; font-size: 10px; }
.office-routes-table thead th[data-sort].asc::after { content: ' \2191'; opacity: 1; }
.office-routes-table thead th[data-sort].desc::after { content: ' \2193'; opacity: 1; }

/* v41.1: forzar mayusculas en UI clave para consistencia */
.office-tab, .fact-subtab, .filter-chip, .office-filter,
.kw-bulk-toolbar, .kw-bulk-toolbar button,
button.login-btn, button.type-btn,
.fact-kpi .fk-lbl, .fact-kpi .fk-val,
.profile-menu-title,
h3, h4 {
  text-transform: uppercase !important;
  letter-spacing: 0.3px;
}
/* Datos de clientes y proveedores en mayusculas */
.ort-cliente, .col-cliente, .col-cli, .orc-cliente,
.cliente-card .cl-nom {
  text-transform: uppercase !important;
}

/* v41.2: mayusculas tambien en columna ruta y todos los datos visibles de tabla */
.ort-ruta, .col-ruta, .orc-ruta,
.col-cli, .ort-num, .col-cond, .ort-cond,
.gasto-cat, .ort-est,
.fact-pill-pago,
.cliente-card .cl-cif,
td {
  text-transform: uppercase;
}
/* Excepciones (que se queden tal cual): emails, IBAN */
.cliente-card .cl-iban, code, [data-no-upper] {
  text-transform: none !important;
}

/* Bell notifications */
.kw-bell-btn { position:relative; background:rgba(255,255,255,0.18); border:none; color:#fff; padding:8px; border-radius:50%; cursor:pointer; width:36px; height:36px; display:flex; align-items:center; justify-content:center; margin-right:6px; }
.kw-bell-btn:hover { background:rgba(255,255,255,0.3); }
.kw-bell-btn svg { width:20px; height:20px; }
.kw-bell-badge { position:absolute; top:-2px; right:-2px; background:#ff4757; color:#fff; min-width:18px; height:18px; padding:0 4px; border-radius:9px; font-size:10px; font-weight:700; display:flex; align-items:center; justify-content:center; }
.kw-notif-list { font-size:12px; }
.kw-notif-item { padding:10px 12px; border-bottom:1px solid #f0f0f0; display:flex; gap:10px; align-items:flex-start; }
.kw-notif-item .ico { font-size:18px; flex-shrink:0; }
.kw-notif-item .text { flex:1; }
.kw-notif-item.unread { background:#fff8e1; }

/* Super Admin */
.kw-sa-screen { padding:14px; }
.kw-sa-stats { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-bottom:18px; }
@media (max-width: 600px) { .kw-sa-stats { grid-template-columns:repeat(2,1fr); } }
.kw-sa-stat { background:#f7faf7; border:1px solid #e0eee2; border-radius:10px; padding:10px 12px; }
.kw-sa-stat .l { font-size:10px; color:#6b8f72; text-transform:uppercase; letter-spacing:0.3px; }
.kw-sa-stat .v { font-size:22px; font-weight:700; color:#1b5e20; line-height:1.1; margin-top:3px; }
.kw-sa-stat .s { font-size:10px; color:#6b8f72; margin-top:2px; }
.kw-sa-table { width:100%; border-collapse:collapse; background:#fff; border-radius:10px; overflow:hidden; border:1px solid #e0eee2; font-size:12px; }
.kw-sa-table thead th { background:#1b5e20; color:#fff; padding:8px 6px; text-align:left; font-size:10px; font-weight:700; text-transform:uppercase; }
.kw-sa-table tbody td { padding:7px 6px; border-bottom:1px solid #f1f1f1; color:#2c3e50; }
.kw-sa-table tbody tr:hover td { background:#f9fbf9; }


/* ===== v47 Viajes seleccion (copiar a WhatsApp) ===== */
.office-routes-table .ort-cb { width: 32px; padding: 4px 0 4px 8px; text-align: center; }
.office-routes-table .ort-cb input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: #1b5e20; }
.office-routes-table thead th input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: #1b5e20; }
.office-routes-table tr.kw-viaje-row.kw-viaje-selected,
.office-routes-table tr.kw-viaje-row.kw-viaje-selected td { background: #e8f5e9 !important; }
.office-routes-table tr.kw-viaje-row.kw-viaje-selected td:first-child { box-shadow: inset 4px 0 0 #1b5e20; }
.office-route-card.kw-viaje-selected { background: #e8f5e9; box-shadow: inset 4px 0 0 #1b5e20; }
.office-route-card .orc-cb { position: absolute; top: 8px; right: 8px; }
.office-route-card .orc-cb input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: #1b5e20; }
.office-route-card { position: relative; }


/* ===== v49 IMPORT EXCEL + VISTA SEMANAL + CANCELADOS ===== */
.office-day-import {
  padding: 9px 14px; background: #1565c0; color: #fff;
  border: none; border-radius: 10px; font-size: 12px; font-weight: 700;
  cursor: pointer; font-family: inherit; margin-left: 8px;
}
.office-day-import:hover { background: #0d47a1; }

/* Filas/cards canceladas: rojo claro + tachado */
.office-routes-table tr.kw-viaje-row td:has(.ort-est.cancelada),
.office-routes-table tr.kw-viaje-row:has(.ort-est.cancelada) td {
  background: #ffebee !important;
  text-decoration: line-through;
  color: #b71c1c;
}
.office-route-card:has(.orc-estado.cancelada) {
  background: #ffebee !important;
  text-decoration: line-through;
  color: #b71c1c;
}
.office-route-card:has(.orc-estado.cancelada) .orc-cliente,
.office-route-card:has(.orc-estado.cancelada) .orc-ruta {
  text-decoration: line-through;
}

/* Vista semana */
.kw-week-grid {
  display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr));
  gap: 6px; overflow-x: auto; padding: 6px 0; min-height: 60vh;
}
.kw-week-col {
  background: #f7f9f5; border: 1px solid #e0eee2; border-radius: 10px;
  padding: 8px 6px; min-width: 150px; display: flex; flex-direction: column; gap: 6px;
}
.kw-week-col.is-today { background: #e8f5e9; border-color: #2e7d32; }
.kw-week-col.is-weekend { background: #f5f5f0; }
.kw-week-head {
  position: sticky; top: 0; background: inherit;
  display: flex; align-items: center; gap: 4px;
  padding: 4px; border-bottom: 1px solid #e0eee2; margin-bottom: 4px;
  z-index: 1;
}
.kw-week-dia { font-size: 11px; font-weight: 700; color: #1b5e20; text-transform: uppercase; }
.kw-week-fecha { font-size: 11px; color: #6b8f72; flex: 1; }
.kw-week-cnt {
  background: #1b5e20; color: #fff; font-size: 10px; font-weight: 700;
  padding: 1px 7px; border-radius: 8px;
}
.kw-week-empty { font-size: 11px; color: #9aaa9d; text-align: center; padding: 14px 0; }
.kw-week-card {
  background: #fff; border: 1px solid #e0eee2; border-radius: 8px;
  padding: 6px 8px; cursor: pointer; transition: all .15s;
  font-size: 11px; line-height: 1.3;
}
.kw-week-card:hover { border-color: #2e7d32; transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,0.08); }
.kw-week-card-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3px; }
.kw-week-hora { font-weight: 700; color: #1b5e20; }
.kw-week-num { font-size: 9px; color: #6b8f72; }
.kw-week-cliente { margin: 2px 0; font-size: 10px; }
.kw-week-cliente .kw-cliente-pill { font-size: 10px; padding: 1px 5px; }
.kw-week-ruta { color: #4a6b53; font-size: 11px; font-weight: 600; }
.kw-week-cond { font-size: 10px; font-weight: 700; margin-top: 2px; }
.kw-week-card.is-cancelada {
  background: #ffebee !important;
  border-color: #ef9a9a;
  text-decoration: line-through;
}

@media (max-width: 768px) {
  .kw-week-grid { grid-template-columns: repeat(7, minmax(120px, 1fr)); }
}


/* ===== v52 Vista Hoja de trabajo + impresion ===== */
.kw-hoja-wrap { padding: 6px 0; }
.kw-hoja-toolbar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 8px 0 12px; border-bottom: 1px solid #e0eee2; margin-bottom: 16px;
}
.kw-hoja-btn {
  background: #1b5e20; color: #fff; border: none; border-radius: 8px;
  padding: 8px 14px; font-weight: 700; font-size: 12px; cursor: pointer;
  font-family: inherit;
}
.kw-hoja-btn:hover { background: #2e7d32; }
.kw-hoja-info { font-size: 11px; color: #6b8f72; flex: 1; text-align: right; font-style: italic; }
.kw-hoja-page {
  background: #fff; border: 1px solid #c8e6c9; border-radius: 12px;
  padding: 18px 22px; box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  max-width: 1100px; margin: 0 auto;
}
.kw-hoja-header {
  display: grid; grid-template-columns: 90px 1fr auto;
  align-items: center; gap: 14px; margin-bottom: 16px;
  padding-bottom: 12px; border-bottom: 2px solid #1b5e20;
}
.kw-hoja-logo img { max-width: 90px; max-height: 70px; object-fit: contain; }
.kw-hoja-title {
  font-size: 22px; font-weight: 800; color: #1b5e20;
  text-align: center; letter-spacing: 1.5px;
}
.kw-hoja-fecha { font-size: 13px; color: #1b5e20; text-align: right; }
.kw-hoja-table {
  width: 100%; border-collapse: collapse;
  font-size: 12px; font-family: 'Inter', 'Calibri', sans-serif;
}
.kw-hoja-table thead th {
  background: #e8f5e9; color: #1b5e20; font-weight: 700;
  border: 1px solid #1b5e20; padding: 10px 6px; text-align: center;
  font-size: 12px;
}
.kw-hoja-table tbody td {
  border: 1px solid #c8e6c9; padding: 8px 6px; vertical-align: middle;
  background: #fff;
}
.kw-hoja-table tbody tr:hover td { background: #f1f8e9; cursor: pointer; }
.kw-hoja-num { text-align: center; font-weight: 700; width: 40px; }
.kw-hoja-mat { font-family: monospace; font-weight: 700; line-height: 1.4; }
.kw-hoja-cancelada td { background: #ffebee !important; text-decoration: line-through; color: #b71c1c; }
.kw-hoja-empty { text-align: center; padding: 40px 20px; color: #6b8f72; font-style: italic; }
.kw-hoja-footer {
  margin-top: 18px; font-size: 10px; color: #9aaa9d;
  text-align: right; font-style: italic;
}

@media print {
  body * { visibility: hidden; }
  .no-print { display: none !important; }
  .kw-hoja-wrap, .kw-hoja-wrap * { visibility: visible; }
  .kw-hoja-wrap {
    position: absolute; top: 0; left: 0; width: 100%; padding: 0; margin: 0;
  }
  .kw-hoja-page {
    box-shadow: none; border: none; max-width: none;
    padding: 12px 16px;
  }
  .kw-hoja-table thead th { background: #e8f5e9 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .kw-hoja-cancelada td { background: #ffebee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  @page { size: A4 landscape; margin: 12mm; }
}

.kw-hoja-cb-col { width: 40px; text-align: center; padding: 4px !important; }
.kw-hoja-cb-col input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: #1b5e20; }
.kw-hoja-table tr.kw-viaje-selected td { background: #e8f5e9 !important; }
.kw-hoja-hora { font-weight: 700; color: #1b5e20; text-align: center; }

.kw-hoja-cliente { padding: 4px 6px !important; }
.kw-hoja-cliente .kw-cliente-pill { display: inline-block; max-width: 100%; }

.kw-hoja-empresa { font-size: 11px; color: #4a6b53; font-style: italic; max-width: 140px; }
.ort-emp { font-size: 11px; color: #4a6b53; font-style: italic; }


/* ===== v55 Modo oscuro automatico (sigue al sistema) ===== */
@media (prefers-color-scheme: dark) {
  body { background: #121e15 !important; color: #e8f5e9 !important; }
  .screen { background: #1a2e22 !important; color: #e8f5e9 !important; }
  .login-screen { background: linear-gradient(180deg, #061008 0%, #1a2e22 100%) !important; }
  .login-header h2 { color: #c8e6c9 !important; }
  .login-header p { color: #97bc62 !important; }
  .input-group input,
  .input-group textarea,
  .input-group select {
    background: #2a3d31 !important;
    border-color: #3d5240 !important;
    color: #e8f5e9 !important;
  }
  .input-group input:focus,
  .input-group textarea:focus,
  .input-group select:focus {
    border-color: #97bc62 !important;
  }
  .input-group label { color: #97bc62 !important; }
  .modal-overlay { background: rgba(0,0,0,0.7) !important; }
  .modal-content { background: #1f3326 !important; color: #e8f5e9 !important; }
  .modal-content h3 { color: #c8e6c9 !important; }
  .type-btn { background: #1f3326 !important; color: #e8f5e9 !important; border-color: #3d5240 !important; }
  .type-btn .type-info span { color: #c8e6c9 !important; }
  .type-btn .type-info small { color: #97bc62 !important; }
  #btnTypeRegistrarse { background: linear-gradient(135deg, #2e7d32, #1b5e20) !important; }
  #btnTypeRegistrarse .type-info span,
  #btnTypeRegistrarse .type-info small { color: #ffffff !important; }
  /* Office screens */
  .office-screen { background: #121e15 !important; }
  .office-tab { background: transparent; color: #97bc62 !important; }
  .office-tab.active { color: #c8e6c9 !important; border-color: #97bc62 !important; }
  .office-content { background: #1a2e22 !important; }
  .office-route-card { background: #1f3326 !important; color: #e8f5e9 !important; border-color: #3d5240 !important; }
  .office-route-card .orc-cliente,
  .office-route-card .orc-ruta { color: #e8f5e9 !important; }
  .office-routes-table { color: #e8f5e9 !important; }
  .office-routes-table thead th { background: #2a3d31 !important; color: #c8e6c9 !important; }
  .office-routes-table tbody td { background: #1f3326 !important; border-color: #3d5240 !important; }
  /* Hoja de trabajo */
  .kw-hoja-page { background: #1f3326 !important; border-color: #3d5240 !important; }
  .kw-hoja-title { color: #c8e6c9 !important; }
  .kw-hoja-fecha { color: #97bc62 !important; }
  .kw-hoja-table thead th { background: #2a3d31 !important; color: #c8e6c9 !important; border-color: #97bc62 !important; }
  .kw-hoja-table tbody td { background: #1f3326 !important; border-color: #3d5240 !important; color: #e8f5e9 !important; }
  /* Vista Semana */
  .kw-week-col { background: #1f3326 !important; border-color: #3d5240 !important; }
  .kw-week-card { background: #2a3d31 !important; border-color: #3d5240 !important; color: #e8f5e9 !important; }
  /* Stats / dashboard */
  .stat-card { background: #1f3326 !important; }
  /* Profile */
  .profile-menu-item { background: transparent !important; color: #e8f5e9 !important; }
  .profile-menu-item:hover { background: rgba(151,188,98,0.1) !important; }
  /* Tipo empresa cards */
  .kw-tipo-card { background: #1f3326 !important; border-color: #3d5240 !important; color: #e8f5e9 !important; }
  .kw-tipo-card:has(input:checked) { background: #2a3d31 !important; border-color: #97bc62 !important; }
  .kw-tipo-title { color: #c8e6c9 !important; }
  .kw-tipo-desc { color: #97bc62 !important; }
  /* Print debe quedar SIEMPRE en blanco */
  @media print {
    body, .screen, .modal-content, .kw-hoja-page, .kw-hoja-table tbody td {
      background: #fff !important; color: #000 !important;
    }
    .kw-hoja-title { color: #1b5e20 !important; }
    .kw-hoja-table thead th { background: #e8f5e9 !important; color: #1b5e20 !important; }
  }
}


/* ===================== v76 perfil pro ===================== */

/* Fondo de pantalla con un suave degradado verde Kanwork */
.profile-screen {
  background: linear-gradient(180deg, #e8f5e9 0%, #f1f8e9 60%, #fafafa 100%) !important;
}

/* Esconder stats (Viajes / Rating / Puntualidad) para usuarios oficina */
body.role-oficina #profileStats { display: none !important; }

/* Centrar y ancho máximo en pantallas grandes (desktop / tablet) */
.profile-scroll {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 18px 100px;
}
.profile-header-section {
  max-width: 720px;
  margin: 0 auto;
}

/* Tarjetas con sombra suave y mejor contraste */
.profile-menu-item {
  background: #fff !important;
  border: 1px solid #e0eee2 !important;
  border-radius: 14px !important;
  box-shadow: 0 1px 3px rgba(27,94,32,0.06), 0 0 0 1px rgba(27,94,32,0.02);
  transition: all 0.18s ease;
  padding: 14px 16px !important;
  margin-bottom: 8px;
}
.profile-menu-item:hover {
  box-shadow: 0 4px 12px rgba(27,94,32,0.12);
  border-color: #c8e6c9 !important;
  transform: translateY(-1px);
}
.profile-menu-item:active {
  transform: scale(0.99);
  box-shadow: 0 1px 2px rgba(27,94,32,0.08);
}

/* Iconos con fondo verde tenue para los que no llevan color custom */
.profile-menu-item .pmi-icon {
  background: linear-gradient(135deg, #f1f8e9, #e8f5e9) !important;
  border-radius: 10px !important;
}
.profile-menu-item .pmi-icon svg { fill: #2e7d32 !important; }

.profile-menu-item .profile-menu-icon {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  font-size: 18px;
}

/* Cabeceras de sección dentro del menú */
.profile-section-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: #6b8f72;
  letter-spacing: 0.6px;
  padding: 16px 4px 8px;
  margin: 0;
  border-bottom: 1px solid rgba(27,94,32,0.08);
  margin-bottom: 10px;
}

/* Logout button: refuerzo visual */
.logout-btn {
  max-width: 720px;
  margin: 16px auto 0;
}

/* En pantallas grandes (>= 900px), tarjetas en 2 columnas */
@media (min-width: 900px) {
  .profile-screen { padding-top: 30px !important; }
  .profile-scroll {
    max-width: 880px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 14px;
    row-gap: 0;
  }
  /* La cabecera y los títulos de sección ocupan toda la fila */
  .profile-section-title { grid-column: 1 / -1; }
  .logout-btn { grid-column: 1 / -1; max-width: none; }
  .profile-header-section { max-width: 880px; padding: 16px 18px 8px; }
  .profile-menu-item { margin-bottom: 0; }
}


/* ===================== v77 perfil orden ===================== */

/* Forzar columna única en cualquier tamaño: más limpio y sin overlaps */
@media (min-width: 900px) {
  .profile-scroll {
    display: flex !important;
    flex-direction: column !important;
    max-width: 560px !important;
    column-gap: 0 !important;
    row-gap: 0 !important;
  }
  .profile-menu-item { margin-bottom: 8px !important; }
  .profile-section-title { grid-column: auto !important; }
  .logout-btn { grid-column: auto !important; }
}

/* Altura mínima homogénea para todas las tarjetas */
.profile-menu-item {
  min-height: 60px;
  align-items: center;
}

/* Refuerzo de orden visual: secciones bien separadas */
.profile-section-title {
  margin-top: 22px !important;
  margin-bottom: 12px !important;
  padding-bottom: 6px !important;
}
.profile-section-title:first-child {
  margin-top: 6px !important;
}

/* Quitar el padding hardcoded del wrap install-app que descuadraba */
#profileMenuInstallApp {
  padding: 14px 16px !important;
}

/* Cabecera del perfil: chip de rol con tipografía consistente */
.profile-header-section .profile-role {
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* v78: ocultar fila Concepto / Carga del trip detail */
#tdCargaRow, .dr-row:has(#tdCarga) { display: none !important; }

/* v79: la regla v78 que ocultaba autonomo-only fue revertida */

/* ===================== v80 sin conductores en autonomos ===================== */
/* El autónomo no tiene conductores aparte de él mismo. Ocultar UI de gestión. */
body.tipo-autonomo .office-tab[data-tab="conductores"],
body.tipo-autonomo #officeTabConductores,
body.tipo-autonomo #topConductoresList,
body.tipo-autonomo [data-i18n="tabs.drivers"],
body.tipo-autonomo #officeBtnNewConductor,
body.tipo-autonomo button[onclick*="openCrearConductor"],
body.tipo-autonomo .conductor-only { display: none !important; }


/* ===================== v81 hoja agenda ===================== */

/* Esconder vista "Hoja" del toggle de Tráfico para autónomos (no la usan) */
body.tipo-autonomo .office-view-btn[data-view="hoja"] { display: none !important; }

/* Esconder "Conductor asignado" y "Permiso circulación" en form vehículo
   para autónomos: no aplican a un único conductor que es él mismo */
body.tipo-autonomo #vhConductorWrap,
body.tipo-autonomo #vhPermVenc,
body.tipo-autonomo #vhPermVencLabel { display: none !important; }
body.tipo-autonomo #vhPermVenc + button { display: none !important; }

/* Agenda más compacta en móvil */
@media (max-width: 480px) {
  .office-agenda-bar { padding: 4px 6px !important; gap: 4px !important; }
  .office-agenda-nav { width: 24px !important; height: 36px !important; font-size: 16px !important; }
  .office-agenda-today { padding: 0 6px !important; height: 36px !important; font-size: 10px !important; }
  .office-agenda-jump { height: 36px !important; padding: 0 4px !important; font-size: 10px !important; max-width: 30px !important; }
  .agenda-day { min-width: 44px !important; padding: 2px 4px 2px !important; }
  .agenda-day .ad-dn { font-size: 8px !important; }
  .agenda-day .ad-dd { font-size: 12px !important; }
  .agenda-day .ad-cnt { font-size: 8px !important; min-width: 12px !important; padding: 0 3px !important; }
  .office-agenda-strip { gap: 3px !important; }
}

/* En móvil, esconder la fecha picker tipo input[type="date"] del jump (ocupa mucho)
   y dejar solo el icono. El usuario puede usar prev/next. */
@media (max-width: 480px) {
  .office-agenda-jump { width: 32px !important; }
}

/* v82 fila viaje cerrado: no clickeable */
.kw-viaje-row.kw-viaje-locked { cursor: default !important; opacity: 0.85; }
.kw-viaje-row.kw-viaje-locked:hover { background: inherit !important; }


/* ===================== v87 hoja empresa css ===================== */
/* Columna Empresa visible en pantalla; oculta al imprimir */
@media print {
  .kw-no-export { display: none !important; }
}

/* ===== SPLASH TECH MODERNO (v94) ===== */
/* Sobreescribe el splash antiguo de los CSS .splash y .splash-* anteriores */
.screen.splash {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(45,190,92,0.30) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 100%, rgba(31,154,72,0.30) 0%, transparent 60%),
    linear-gradient(180deg, #346A4A 0%, #4A8A65 50%, #2D5A3F 100%) !important;
  justify-content: flex-start; align-items: center;
}
.kw-splash-tech {
  position: relative;
  flex: 1; width: 100%;
  display: flex; flex-direction: column; align-items: center;
  padding: 30px 24px 50px;
  box-sizing: border-box;
}
.kw-wordmark {
  font-family: 'Inter','Helvetica Neue',Arial,sans-serif;
  font-size: 56px; font-weight: 800;
  letter-spacing: -2.5px; color: #FFFFFF;
  line-height: 1; margin-bottom: 16px;
  background: linear-gradient(180deg, #FFFFFF 0%, #C8E6D6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-top: 24px;
}
.kw-dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: #1F9A48; border-radius: 50%;
  margin-left: 6px;
  box-shadow: 0 0 12px rgba(31,154,72,0.6), 0 0 24px rgba(31,154,72,0.3);
  animation: kwPulseDot 2s ease-in-out infinite;
  vertical-align: 0.4em;
}
@keyframes kwPulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}
.kw-kangaroo {
  width: 130px; height: auto;
  margin-top: 24px; margin-bottom: 0;
  filter: drop-shadow(0 8px 24px rgba(243,198,18,0.4))
          drop-shadow(0 2px 6px rgba(0,0,0,0.3));
  border-radius: 0; background: transparent;
}
.kw-enter-btn {
  margin-top: 140px;
  padding: 11px 36px;
  background: linear-gradient(180deg, #5DD9F2 0%, #2BA8D9 100%);
  border: none; border-radius: 11px;
  color: #FFFFFF;
  font-size: 14px; font-weight: 700;
  cursor: pointer; letter-spacing: 0.3px;
  font-family: 'Inter', sans-serif;
  box-shadow: 0 4px 16px rgba(43,168,217,0.5),
              0 2px 6px rgba(0,0,0,0.25),
              inset 0 1px 0 rgba(255,255,255,0.4);
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
  transition: all 0.2s ease;
}
.kw-enter-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(43,168,217,0.65), 0 4px 10px rgba(0,0,0,0.3);
}
.kw-tagline-bottom {
  margin-top: auto; padding-top: 30px;
  font-size: 13px; font-weight: 600;
  letter-spacing: 2.5px; text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
/* Body y phone-frame al verde luminoso para que envuelva */
body { background: #346A4A !important; }
.phone-frame { background: #346A4A !important; }
