/* =====================================================================
   L&J Traslados · Design System
   Paleta extraída del logo: turquesa (#00C8CC) sobre negro (#05070A),
   con plata (#C0C6C8) como color de apoyo. Dark por defecto (el logo es
   oscuro), light disponible con selector. Mobile-first.
   ===================================================================== */

/* ---------- Tokens ---------- */
:root[data-theme="dark"] {
  --bg-primary:    #05070A;
  --bg-secondary:  #0C1218;
  --bg-tertiary:   #131B23;
  --surface:       #0F171F;
  --surface-2:     #16202A;
  --border:        #1E2A34;
  --border-strong: #2A3945;
  --text-primary:  #EEF3F6;
  --text-secondary:#9BA9B4;
  --text-muted:    #5E6E7A;
  --accent:        #00C8CC;
  --accent-hover:  #22E4E8;
  --accent-soft:   rgba(0,200,204,0.12);
  --accent-text:   #04141A;
  --silver:        #C0C6C8;
  --danger:        #E8586A;
  --danger-soft:   rgba(232,88,106,0.12);
  --success:       #33C48D;
  --success-soft:  rgba(51,196,141,0.12);
  --warning:       #E9A63D;
  --warning-soft:  rgba(233,166,61,0.12);
  --shadow:        rgba(0,0,0,0.55);
  --ripple:        rgba(255,255,255,0.22);
}
:root[data-theme="light"] {
  --bg-primary:    #FFFFFF;
  --bg-secondary:  #F2F5F7;
  --bg-tertiary:   #E7ECEF;
  --surface:       #FFFFFF;
  --surface-2:     #F7F9FA;
  --border:        #D5DDE2;
  --border-strong: #BCC7CE;
  --text-primary:  #08131A;
  --text-secondary:#48575F;
  --text-muted:    #7B8A93;
  --accent:        #008A8E;
  --accent-hover:  #006E72;
  --accent-soft:   rgba(0,138,142,0.10);
  --accent-text:   #FFFFFF;
  --silver:        #5A6B74;
  --danger:        #C0392B;
  --danger-soft:   rgba(192,57,43,0.10);
  --success:       #157A4A;
  --success-soft:  rgba(21,122,74,0.10);
  --warning:       #B06A0A;
  --warning-soft:  rgba(176,106,10,0.10);
  --shadow:        rgba(15,30,40,0.10);
  --ripple:        rgba(0,0,0,0.14);
}

/* ---------- Reset ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
input, textarea, select, [contenteditable="true"] {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overscroll-behavior-y: none;
  transition: background .25s ease, color .25s ease;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4 { font-weight: 600; margin: 0; line-height: 1.25; }
h1 { font-size: 28px; } h2 { font-size: 22px; } h3 { font-size: 18px; } h4 { font-size: 15px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

.label {
  font-size: 12px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-muted); font-weight: 600;
}
.muted { color: var(--text-muted); }
.tq { color: var(--accent); }

/* ---------- Ripple ---------- */
.ripple { position: relative; overflow: hidden; }
.ripple-wave {
  position: absolute; border-radius: 50%;
  background: var(--ripple); transform: scale(0);
  animation: ripple-anim .6s linear; pointer-events: none;
}
@keyframes ripple-anim { to { transform: scale(4); opacity: 0; } }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.2rem; border-radius: 10px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; letter-spacing: .01em;
  transition: background .18s ease, border-color .18s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }
.btn i { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface-2); color: var(--text-primary); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--border-strong); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text-primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-lg { padding: .95rem 1.5rem; font-size: 15px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- Formularios ---------- */
.field { margin-bottom: 1.1rem; }
.field label { display: block; margin-bottom: .4rem; font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.field label .req { color: var(--danger); }
.input, .select, .textarea {
  width: 100%; padding: .7rem .85rem; font-size: 15px;
  background: var(--bg-secondary); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: 10px; outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.textarea { resize: vertical; min-height: 84px; }
.password-field { position: relative; }
.password-field .input { padding-right: 2.6rem; }
.toggle-password {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-muted);
  display: inline-flex; padding: .35rem; border-radius: 8px;
}
.toggle-password i { width: 19px; height: 19px; }

/* ---------- Cards / superficies ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 1.35rem;
}
.card-hover { transition: border-color .18s ease, transform .18s ease; }
.card-hover:hover { border-color: var(--accent); transform: translateY(-2px); }

/* Stat tile (KPI) */
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 1.15rem 1.25rem; position: relative; overflow: hidden;
}
.stat::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent);
}
.stat .stat-ico {
  width: 38px; height: 38px; border-radius: 10px; display: inline-flex;
  align-items: center; justify-content: center; background: var(--accent-soft);
  color: var(--accent); margin-bottom: .7rem;
}
.stat .stat-ico i { width: 20px; height: 20px; }
.stat .stat-num { font-size: 30px; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.stat .stat-lbl { font-size: 12.5px; color: var(--text-muted); margin-top: .35rem; text-transform: uppercase; letter-spacing: .05em; }
.stat.is-warning::before { background: var(--warning); }
.stat.is-warning .stat-ico { background: var(--warning-soft); color: var(--warning); }
.stat.is-success::before { background: var(--success); }
.stat.is-success .stat-ico { background: var(--success-soft); color: var(--success); }
.stat.is-silver::before { background: var(--silver); }
.stat.is-silver .stat-ico { background: color-mix(in srgb, var(--silver) 16%, transparent); color: var(--silver); }

.grid { display: grid; gap: 1rem; }
.grid-stats { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .22rem .6rem; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
}
.badge-accent  { background: var(--accent-soft);  color: var(--accent); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger  { background: var(--danger-soft);  color: var(--danger); }
.badge-muted   { background: var(--bg-tertiary);  color: var(--text-muted); }

/* Estado vacío */
.empty-state { text-align: center; padding: 3rem 1.5rem; }
.empty-state .empty-ico {
  width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 1.1rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.empty-state .empty-ico i { width: 30px; height: 30px; }
.empty-state h3 { margin-bottom: .4rem; }
.empty-state p { color: var(--text-muted); margin: 0 0 1.3rem; }

/* ---------- Toast ---------- */
#toast-stack {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 9999;
  display: flex; flex-direction: column; gap: .5rem; align-items: center;
  pointer-events: none; width: max-content; max-width: 92vw;
}
.toast {
  padding: .7rem 1.15rem; border-radius: 10px; font-size: 14px; font-weight: 500;
  color: #fff; box-shadow: 0 8px 24px var(--shadow);
  animation: toast-in .25s ease; display: flex; align-items: center; gap: .5rem;
}
.toast i { width: 18px; height: 18px; }
.toast-error   { background: var(--danger); }
.toast-success { background: var(--success); }
.toast-warning { background: var(--warning); color: #1a1200; }
.toast-info    { background: var(--surface-2); color: var(--text-primary); border: 1px solid var(--border); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Modal ---------- */
.modal-wrapper {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 1rem; animation: fade .2s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: 16px; width: 100%; max-width: 560px; max-height: 90vh;
  display: flex; flex-direction: column; box-shadow: 0 24px 60px var(--shadow);
}
.modal-head {
  padding: 1.1rem 1.35rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-head h3 { font-size: 17px; }
.modal-close { background: none; border: none; color: var(--text-muted); display: inline-flex; padding: .3rem; border-radius: 8px; }
.modal-body { flex: 1; overflow-y: auto; padding: 1.35rem; }
.modal-footer {
  padding: 1rem 1.35rem; border-top: 1px solid var(--border);
  display: flex; gap: .75rem; justify-content: flex-end;
}

/* =====================================================================
   Splash
   ===================================================================== */
#splash {
  position: fixed; inset: 0; z-index: 10000; background: var(--bg-primary);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1.4rem; transition: opacity .5s ease;
}
#splash .splash-glow {
  position: absolute; width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 62%);
  filter: blur(10px); pointer-events: none;
}
#splash img { width: min(230px, 62vw); height: auto; position: relative; z-index: 1;
  animation: splash-pulse 2.6s ease-in-out infinite; }
@keyframes splash-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.04); } }
#splash .splash-name { font-size: 19px; font-weight: 600; letter-spacing: .04em; position: relative; z-index: 1; }
#splash .splash-tag { font-size: 11.5px; text-transform: uppercase; letter-spacing: .16em; color: var(--accent); margin-top: -.7rem; position: relative; z-index: 1; }
#splash .splash-track { width: 210px; height: 3px; background: var(--bg-tertiary); border-radius: 3px; overflow: hidden; position: relative; z-index: 1; }
#splash .splash-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-hover)); transition: width .1s linear; }

/* =====================================================================
   Layout de la app: topbar + sidebar + contenido + footer mobile
   ===================================================================== */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  height: 62px; display: flex; align-items: center; gap: 1rem;
  padding: 0 1.25rem; border-bottom: 1px solid var(--border);
  background: var(--bg-primary); position: sticky; top: 0; z-index: 40;
}
.topbar .brand { display: flex; align-items: center; gap: .6rem; }
.topbar .brand img { height: 30px; width: auto; }
.topbar .brand b { font-size: 15px; letter-spacing: .01em; }
.topbar .brand .sub { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); }
.topbar .spacer { flex: 1; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-secondary);
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { color: var(--text-primary); border-color: var(--border-strong); }
.icon-btn i { width: 19px; height: 19px; }
.user-chip { display: flex; align-items: center; gap: .55rem; padding: .3rem .3rem .3rem .7rem; }
.user-chip .u-name { font-size: 13px; font-weight: 600; }
.user-chip .u-rol { font-size: 11px; color: var(--text-muted); text-transform: capitalize; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft);
  color: var(--accent); display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}

.app-body { flex: 1; display: flex; min-height: 0; }

.sidebar {
  width: 236px; flex-shrink: 0; border-right: 1px solid var(--border);
  padding: 1.1rem .8rem; background: var(--bg-primary);
  display: flex; flex-direction: column; gap: .2rem;
}
.sidebar .nav-sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--text-muted); margin: 1rem .7rem .4rem; font-weight: 700; }
.nav-item {
  display: flex; align-items: center; gap: .7rem; padding: .62rem .75rem;
  border-radius: 10px; color: var(--text-secondary); font-size: 14px; font-weight: 500;
}
.nav-item i { width: 19px; height: 19px; flex-shrink: 0; }
.nav-item:hover { background: var(--surface-2); color: var(--text-primary); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.content { flex: 1; min-width: 0; padding: 1.75rem 1.5rem; max-width: 1280px; margin: 0 auto; width: 100%; }
.page-head { margin-bottom: 1.5rem; }
.page-head h1 { font-size: 24px; }
.page-head p { color: var(--text-muted); margin: .3rem 0 0; font-size: 14px; }

/* Footer mobile nativo */
.app-footer-nav { display: none; }
.menu-full-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.menu-full-item {
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  padding: 1.1rem .5rem; border-radius: 14px; background: var(--surface-2);
  border: 1px solid var(--border); color: var(--text-primary); font-size: 12px; font-weight: 500; text-align: center;
}
.menu-full-item i { width: 24px; height: 24px; color: var(--accent); }

@media (max-width: 900px) {
  .sidebar { display: none; }
  .content { padding: 1.25rem 1rem; padding-bottom: 88px; }
  .app-footer-nav {
    position: fixed; bottom: 0; left: 0; right: 0; height: 64px; z-index: 999;
    display: flex; background: var(--bg-primary); border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .app-footer-nav .fn-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; font-size: 10px; color: var(--text-muted); font-weight: 500;
  }
  .app-footer-nav .fn-item i { width: 21px; height: 21px; }
  .app-footer-nav .fn-item.active { color: var(--accent); }
  .topbar .user-chip .u-info { display: none; }
}

/* =====================================================================
   HOME institucional
   ===================================================================== */
.home { max-width: 1180px; margin: 0 auto; }
.home-nav {
  display: flex; align-items: center; gap: 1rem; padding: 1rem 1.5rem;
  position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg-primary) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.home-nav .brand { display: flex; align-items: center; gap: .6rem; }
.home-nav .brand img { height: 34px; }
.home-nav .brand b { font-size: 16px; }
.home-nav .spacer { flex: 1; }

.hero {
  padding: 4.5rem 1.5rem 3.5rem; max-width: 1180px; margin: 0 auto;
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 2.5rem; align-items: center;
}
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .8rem;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent);
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 1.2rem;
}
.hero h1 { font-size: clamp(30px, 5vw, 46px); letter-spacing: -.02em; line-height: 1.08; }
.hero h1 .grad { background: linear-gradient(100deg, var(--accent), var(--accent-hover)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 17px; color: var(--text-secondary); margin: 1.2rem 0 2rem; max-width: 34rem; }
.hero .cta-row { display: flex; gap: .8rem; flex-wrap: wrap; }
.hero-visual {
  position: relative; aspect-ratio: 1; border-radius: 24px; border: 1px solid var(--border);
  background:
    radial-gradient(circle at 30% 25%, var(--accent-soft), transparent 55%),
    var(--surface);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.hero-visual img { width: 62%; filter: drop-shadow(0 12px 40px var(--accent-soft)); animation: splash-pulse 4s ease-in-out infinite; }
.hero-visual .ring { position: absolute; border: 1px solid var(--border-strong); border-radius: 50%; opacity: .5; }
.hero-visual .ring.r1 { inset: 12%; }
.hero-visual .ring.r2 { inset: 26%; }

.section { max-width: 1180px; margin: 0 auto; padding: 3rem 1.5rem; }
.section-title { text-align: center; margin-bottom: 2.2rem; }
.section-title h2 { font-size: 28px; }
.section-title p { color: var(--text-muted); margin-top: .5rem; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.1rem; }
.feature {
  padding: 1.5rem; border-radius: 16px; border: 1px solid var(--border); background: var(--surface);
  transition: border-color .18s ease, transform .18s ease;
}
.feature:hover { border-color: var(--accent); transform: translateY(-3px); }
.feature .f-ico {
  width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 1rem;
}
.feature .f-ico i { width: 23px; height: 23px; }
.feature h4 { font-size: 16px; margin-bottom: .45rem; }
.feature p { color: var(--text-secondary); font-size: 14px; margin: 0; }

.home-cta {
  max-width: 1000px; margin: 1rem auto 3rem; padding: 3rem 2rem; text-align: center;
  border-radius: 22px; border: 1px solid var(--border);
  background: radial-gradient(circle at 50% 0%, var(--accent-soft), transparent 60%), var(--surface);
}
.home-cta h2 { font-size: 26px; }
.home-cta p { color: var(--text-secondary); margin: .6rem auto 1.6rem; max-width: 32rem; }

.home-foot { text-align: center; padding: 2rem 1.5rem 3rem; color: var(--text-muted); font-size: 13px; border-top: 1px solid var(--border); }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; padding: 2.5rem 1.25rem; gap: 2rem; text-align: center; }
  .hero .cta-row { justify-content: center; }
  .hero p.lead { margin-left: auto; margin-right: auto; }
  .hero-visual { max-width: 320px; margin: 0 auto; }
  .home-nav .hide-sm { display: none; }
}

/* =====================================================================
   Login
   ===================================================================== */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side {
  position: relative; overflow: hidden; padding: 3rem;
  display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(circle at 30% 20%, var(--accent-soft), transparent 55%), var(--bg-secondary);
  border-right: 1px solid var(--border);
}
.auth-side .brand { display: flex; align-items: center; gap: .7rem; }
.auth-side .brand img { height: 40px; }
.auth-side .brand b { font-size: 18px; }
.auth-side .side-copy h2 { font-size: 30px; line-height: 1.15; letter-spacing: -.02em; }
.auth-side .side-copy p { color: var(--text-secondary); margin-top: 1rem; max-width: 26rem; }
.auth-side .side-points { display: flex; flex-direction: column; gap: .8rem; margin-top: 1.6rem; }
.auth-side .side-points div { display: flex; align-items: center; gap: .6rem; font-size: 14px; color: var(--text-secondary); }
.auth-side .side-points i { width: 18px; height: 18px; color: var(--accent); }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 2rem 1.5rem; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card .logo-sm { display: none; }
.auth-card h1 { font-size: 24px; margin-bottom: .4rem; }
.auth-card .sub { color: var(--text-muted); font-size: 14px; margin-bottom: 1.8rem; }
.hint-box { margin-top: 1.4rem; padding: .8rem 1rem; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; color: var(--text-muted); }
.hint-box b { color: var(--text-secondary); }

@media (max-width: 820px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-card .logo-sm { display: flex; flex-direction: column; align-items: center; gap: .8rem; margin-bottom: 1.8rem; text-align: center; }
  .auth-card .logo-sm img { height: 56px; }
}

/* ---------- Theme toggle icon swap ---------- */
#theme-toggle .ic-dark { display: none; }
:root[data-theme="dark"] #theme-toggle .ic-dark { display: inline-flex; }
:root[data-theme="dark"] #theme-toggle .ic-light { display: none; }

/* util */
.flex { display: flex; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.gap-sm { gap: .5rem; } .gap { gap: 1rem; }
.mt { margin-top: 1rem; } .mt-lg { margin-top: 2rem; }
.wrap { flex-wrap: wrap; }

/* =====================================================================
   Listas / ABM (Fase 3)
   ===================================================================== */
.toolbar { display: flex; gap: .7rem; align-items: center; margin-bottom: 1.25rem; flex-wrap: wrap; }
.toolbar .search { position: relative; flex: 1; min-width: 200px; }
.toolbar .search i { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-muted); pointer-events: none; }
.toolbar .search .input { padding-left: 2.3rem; }
.filtros { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip { padding: .45rem .8rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); font-size: 12.5px; font-weight: 600; }
.chip.active { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

.list { display: flex; flex-direction: column; gap: .55rem; }
.list-row { display: flex; align-items: center; gap: .9rem; padding: .8rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; transition: border-color .16s ease; }
.list-row:hover { border-color: var(--border-strong); }
.lr-ico { width: 42px; height: 42px; border-radius: 11px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; background: var(--accent-soft); color: var(--accent); }
.lr-ico.sq i { width: 20px; height: 20px; }
.lr-ico.silver { background: color-mix(in srgb, var(--silver) 16%, transparent); color: var(--silver); }
.list-main { min-width: 0; flex: 1; }
.list-main .lm-title { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-main .lm-sub { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-meta { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.row-actions { display: flex; gap: .35rem; flex-shrink: 0; }
.row-actions .icon-btn { width: 34px; height: 34px; }
.row-actions .icon-btn i { width: 16px; height: 16px; }
.row-actions .icon-btn.danger:hover { color: var(--danger); border-color: var(--danger); }
@media (max-width: 640px) {
  .list-row { flex-wrap: wrap; }
  .list-meta { order: 3; width: 100%; justify-content: flex-start; }
  .list-main { flex: 1 1 55%; }
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 520px) { .form-grid { grid-template-columns: 1fr; } }
.form-sep { border-top: 1px solid var(--border); margin: .2rem 0 1.1rem; padding-top: 1rem; }
.form-sep .label { display: block; margin-bottom: .9rem; }

/* ---------- Viajes: ruta, mapa y buscador de dirección ---------- */
.via-ruta { display: inline-flex; align-items: center; gap: .35rem; min-width: 0; }
.via-ruta i { width: 15px; height: 15px; color: var(--accent); flex-shrink: 0; }
.list-main .lm-sub i { width: 13px; height: 13px; vertical-align: -2px; color: var(--text-muted); }

.input-geo { display: flex; gap: .5rem; align-items: stretch; }
.input-geo .input { flex: 1; }
.input-geo .btn { flex-shrink: 0; padding: 0 .8rem; }

.mapa-toggle { display: flex; gap: .5rem; margin: .8rem 0 .6rem; }
.mapa-toggle .chip { display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; }
.mapa-toggle .chip i { width: 15px; height: 15px; }

.viaje-mapa {
  height: 260px; width: 100%;
  border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; background: var(--bg-tertiary); z-index: 0;
}
.viaje-mapa .leaflet-control-attribution { font-size: 9px; }
.via-pin { background: transparent; border: 0; }

/* ---------- Fase 5: asignación ---------- */
.asig-head .via-ruta { font-weight: 600; font-size: 15px; }
.asig-head .via-ruta i { color: var(--accent); }
.cand-list { display: flex; flex-direction: column; gap: .5rem; }
.cand-row {
  display: flex; align-items: center; gap: .7rem; cursor: pointer;
  padding: .7rem .8rem; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); transition: border-color .15s, background .15s;
}
.cand-row:hover { border-color: var(--border-strong); }
.cand-row input { accent-color: var(--accent); width: 18px; height: 18px; flex-shrink: 0; }
.cand-row .cand-nom { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: .4rem; }
.cand-row .cand-sub { font-size: 12px; color: var(--text-muted); margin-top: .15rem; }
.cand-row .cand-sub i { width: 13px; height: 13px; vertical-align: -2px; }
.cand-row .badge { padding: .1rem .45rem; font-size: 10.5px; }

/* ---------- Fase 5: estado y viajes del chofer ---------- */
.estado-toggle { display: flex; gap: .6rem; margin-top: .3rem; }
.estado-toggle .btn { flex: 1; justify-content: center; }
.viaje-card { text-align: left; }
.viaje-card + .viaje-card { margin-top: .8rem; }
.via-ruta.big { font-size: 15px; font-weight: 600; margin: .6rem 0; display: flex; align-items: flex-start; gap: .35rem; flex-wrap: wrap; }
.via-ruta.big i { color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.viaje-datos { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; font-size: 13px; color: var(--text-secondary); }
.viaje-datos i { width: 14px; height: 14px; vertical-align: -2px; color: var(--text-muted); }
.viaje-datos a { color: var(--accent); text-decoration: none; }
.viaje-datos .sep { color: var(--text-muted); }
.viaje-obs { margin-top: .5rem; font-size: 12.5px; color: var(--text-muted); background: var(--bg-tertiary); padding: .5rem .7rem; border-radius: 8px; }
.viaje-obs i { width: 14px; height: 14px; vertical-align: -2px; }
.viaje-acciones { display: flex; gap: .6rem; margin-top: .8rem; flex-wrap: wrap; }
.viaje-acciones .btn { flex: 1; justify-content: center; min-width: 130px; }
.chofer-mapa { height: 180px; border-radius: 10px; overflow: hidden; margin-top: .8rem; border: 1px solid var(--border); z-index: 0; }

/* ---------- Fase 5: seguimiento en vivo ---------- */
.seg-wrap { display: flex; gap: 1rem; align-items: stretch; }
.seg-mapa { flex: 1; min-height: 520px; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--bg-tertiary); z-index: 0; }
.seg-side { width: 320px; flex-shrink: 0; display: flex; flex-direction: column; }
.seg-lista { display: flex; flex-direction: column; gap: .5rem; overflow-y: auto; }
.seg-item { display: flex; align-items: flex-start; gap: .65rem; padding: .65rem .75rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; }
.seg-item:hover { border-color: var(--border-strong); }
.seg-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--text-muted); flex-shrink: 0; margin-top: 4px; }
.seg-dot.on { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.seg-dot.ok { background: var(--success); }
.seg-nom { font-weight: 600; font-size: 14px; }
.seg-sub { margin-top: .25rem; }
.seg-sub .badge { padding: .1rem .45rem; font-size: 10.5px; }
.seg-ruta { font-size: 12px; color: var(--text-muted); margin-top: .3rem; }
.seg-pin, .seg-pin span { background: transparent; }
@media (max-width: 860px) {
  .seg-wrap { flex-direction: column; }
  .seg-side { width: 100%; }
  .seg-mapa { min-height: 340px; }
  .seg-lista { max-height: none; }
}

/* ---------- Fase 6: marketplace de viajes compartidos ---------- */
.chip .chip-count { display: inline-block; margin-left: .35rem; padding: 0 .4rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 700; min-width: 18px; text-align: center; }
.chip.active .chip-count { background: var(--accent); color: #05070A; }
.icon-btn.tq { color: var(--accent); }
.icon-btn.tq:hover { color: var(--accent-hover); border-color: var(--accent); }
.mk-note { display: flex; align-items: center; gap: .55rem; font-size: 13px; color: var(--text-secondary);
  background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: 10px; padding: .7rem .9rem; margin-bottom: 1rem; }
.mk-note i { width: 17px; height: 17px; color: var(--accent); flex-shrink: 0; }
.mk-card { display: flex; align-items: stretch; gap: 1rem; padding: 1rem 1.1rem; border: 1px solid var(--border);
  border-radius: 14px; background: var(--surface); }
.mk-card + .mk-card { margin-top: .75rem; }
.mk-card:hover { border-color: var(--border-strong); }
.mk-card-body { flex: 1; min-width: 0; }
.mk-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.mk-card .via-ruta { font-size: 15px; font-weight: 600; display: flex; align-items: flex-start; gap: .35rem; flex-wrap: wrap; }
.mk-card .via-ruta i[data-lucide="map-pin"] { color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.mk-card .via-ruta i[data-lucide="arrow-right"] { color: var(--text-muted); flex-shrink: 0; margin-top: 2px; }
.mk-badges { display: flex; gap: .4rem; flex-wrap: wrap; }
.mk-origen { display: flex; align-items: center; gap: .4rem; font-size: 12.5px; color: var(--text-muted); margin-top: .5rem; }
.mk-origen i { width: 14px; height: 14px; }
.mk-datos { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-top: .6rem; font-size: 13px; color: var(--text-secondary); }
.mk-datos span { display: inline-flex; align-items: center; gap: .35rem; }
.mk-datos i { width: 14px; height: 14px; color: var(--text-muted); }
.mk-obs { margin-top: .55rem; font-size: 12.5px; color: var(--text-muted); background: var(--bg-tertiary);
  padding: .5rem .7rem; border-radius: 8px; display: flex; align-items: flex-start; gap: .4rem; }
.mk-obs i { width: 14px; height: 14px; flex-shrink: 0; margin-top: 2px; }
.mk-card-acc { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: .5rem; flex-shrink: 0; }
.mk-card-acc .btn { white-space: nowrap; }
@media (max-width: 720px) {
  .mk-card { flex-direction: column; gap: .8rem; }
  .mk-card-acc { flex-direction: row; align-items: center; justify-content: flex-start; flex-wrap: wrap; }
  .mk-card-acc .btn { flex: 1; justify-content: center; }
}

/* ===== Fase 7 · Notificaciones ===== */
#notif-bell { position: relative; }
.notif-badge {
  position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px;
  padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 17px; text-align: center;
  box-shadow: 0 0 0 2px var(--surface);
}
.notif-list { display: flex; flex-direction: column; gap: .35rem; }
.notif-item {
  position: relative; display: flex; gap: .7rem; align-items: flex-start;
  padding: .7rem .8rem; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s;
}
.notif-item:hover { border-color: var(--border-strong); }
.notif-item.no-leida { background: var(--accent-soft); border-color: transparent; }
.notif-ico {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.notif-ico i { width: 18px; height: 18px; }
.notif-main { flex: 1; min-width: 0; }
.notif-top { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; }
.notif-top b { font-size: 14px; font-weight: 600; }
.notif-time { font-size: 11px; color: var(--text-muted); flex-shrink: 0; white-space: nowrap; }
.notif-main p { margin: .2rem 0 0; font-size: 13px; color: var(--text-secondary); line-height: 1.45; }
.notif-dot {
  position: absolute; top: .8rem; right: .7rem; width: 8px; height: 8px;
  border-radius: 50%; background: var(--accent); flex-shrink: 0;
}
#notif-modal-body { max-height: 60vh; overflow-y: auto; }

/* ===== Fase 8 · Reportes ===== */
.rep-filtros { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: 1.25rem; }
.rep-fecha { display: flex; flex-direction: column; gap: .3rem; }
.rep-fecha label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.rep-fecha .input { width: auto; }
.rep-filtros .btn { height: 42px; }

/* Barras horizontales */
.rep-bars { display: flex; flex-direction: column; gap: .55rem; }
.rep-bar-row { display: grid; grid-template-columns: 110px 1fr 44px; align-items: center; gap: .6rem; font-size: 13px; }
.rep-bar-lbl { color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rep-bar-track { height: 10px; background: var(--bg-tertiary); border-radius: 999px; overflow: hidden; }
.rep-bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--accent); min-width: 3px; transition: width .4s ease; }
.rep-bar-fill.ok { background: var(--success); }
.rep-bar-fill.warn { background: var(--warning); }
.rep-bar-fill.danger { background: var(--danger); }
.rep-bar-val { text-align: right; font-weight: 700; font-size: 13px; }

/* Serie por día (columnas) */
.rep-dias { display: flex; align-items: flex-end; gap: 4px; height: 150px; padding-top: .5rem; overflow-x: auto; }
.rep-dia { flex: 1 0 14px; min-width: 14px; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.rep-dia-fill { width: 70%; max-width: 22px; background: linear-gradient(to top, var(--accent), var(--accent-hover)); border-radius: 4px 4px 0 0; min-height: 4px; transition: height .4s ease; }
.rep-dia-lbl { font-size: 9px; color: var(--text-muted); white-space: nowrap; transform: rotate(-40deg); transform-origin: center; }

/* Ranking de choferes */
.rep-rank { display: flex; flex-direction: column; gap: .4rem; }
.rep-rank-row { display: flex; align-items: center; gap: .7rem; padding: .5rem .2rem; border-bottom: 1px solid var(--border); }
.rep-rank-pos { width: 24px; height: 24px; flex-shrink: 0; border-radius: 7px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.rep-rank-nom { flex: 1; font-size: 14px; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-rank-meta { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; }

/* Tabla por agencia */
.rep-tabla { display: flex; flex-direction: column; }
.rep-th, .rep-tr { display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: .5rem; padding: .55rem .2rem; align-items: center; }
.rep-th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); border-bottom: 1px solid var(--border-strong); }
.rep-tr { font-size: 13.5px; border-bottom: 1px solid var(--border); }
.rep-th span:not(:first-child), .rep-tr span:not(:first-child) { text-align: right; }

/* Export */
.rep-export { display: flex; gap: .6rem; flex-wrap: wrap; }

@media (max-width: 720px) {
  .rep-bar-row { grid-template-columns: 90px 1fr 38px; }
  .rep-export .btn { flex: 1; justify-content: center; }
  .rep-dia-lbl { display: none; }
}
