/* Transportes Azul — hoja de estilos propia (sin build, reemplaza Tailwind) */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; }
html { font-size: 16px; background: #f1f5f9; }
body {
  --app-watermark-image: none;
  position: relative;
  z-index: 0;
  background: transparent;
  color: #1e293b;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.45;
  font-size: 14px;
}
body::before,
.login-wrap::before,
.login-hero::before {
  content: "";
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(62vw, 720px);
  height: min(52vh, 420px);
  background: var(--app-watermark-image) center / contain no-repeat;
  opacity: .2;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 0;
}
body::before { z-index: -1; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }
h1, h2, h3, h4, p { margin: 0; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

svg.ic { width: 18px; height: 18px; flex-shrink: 0; display: inline-block; vertical-align: middle; position: relative; top: -1px; }
svg.ic-sm { width: 14px; height: 14px; }
svg.ic-lg { width: 30px; height: 30px; }

/* ───────────── Layout de panel admin ───────────── */
.sidebar {
  position: fixed; left: 0; top: 0; height: 100vh; width: 260px;
  background: #ffffff;
  color: #334155; display: flex; flex-direction: column;
  z-index: 40; overflow-y: auto;
  border-right: 1px solid #e7ebf0;
}
.sidebar-logo { display: flex; align-items: center; gap: .7rem; padding: 1.5rem 1.25rem .9rem; }
.sidebar-logo img { width: 42px; height: 42px; border-radius: .8rem; object-fit: cover; }
.sidebar-logo .icon-tile { width: 42px; height: 42px; border-radius: .8rem; background: linear-gradient(135deg,#3b82f6,#1d4ed8); display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; box-shadow: 0 6px 16px rgba(37,99,235,.25); }
.sidebar-logo .name { font-weight: 700; color: #1e293b; font-size: .98rem; line-height: 1.25; letter-spacing: -.01em; }
.sidebar-logo .sub { font-size: .72rem; color: #94a3b8; margin-top: .1rem; }
.sidebar-status { margin: .35rem 1.25rem 1.1rem; display: flex; align-items: center; gap: .55rem; font-size: .72rem; font-weight: 600; color: #15803d; background: #f0fdf4; border: 1px solid #bbf7d0; padding: .5rem .7rem; border-radius: .7rem; }
.status-dot { width: 7px; height: 7px; border-radius: 999px; background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.25); animation: pulse 2s ease-in-out infinite; flex-shrink: 0; }
@keyframes pulse { 0%,100% { transform: scale(1); opacity:1; } 50% { transform: scale(1.5); opacity:.6; } }
.nav { flex: 1; padding: .5rem .9rem; }
.nav a {
  display: flex; align-items: center; gap: .75rem; padding: .62rem .8rem; border-radius: .7rem;
  font-size: .85rem; font-weight: 500; color: #64748b; margin-bottom: .2rem; transition: background .12s, color .12s;
}
.nav a svg { opacity: .85; }
.nav a:hover { background: #eff6ff; color: #1d4ed8; }
.nav a.active { background: linear-gradient(135deg,#2563eb,#1d4ed8); color: #fff; box-shadow: 0 6px 16px rgba(37,99,235,.3); font-weight: 600; }
.nav a.active svg { opacity: 1; }
.nav a .badge-count { margin-left: auto; font-size: .68rem; font-weight: 700; background: #eff6ff; color: #2563eb; padding: .1rem .45rem; border-radius: 999px; }
.nav a.active .badge-count { background: rgba(255,255,255,.25); color: #fff; }
.nav-sep { border-top: 1px solid #eef1f5; margin: .9rem .2rem .4rem; padding-top: .7rem; }
.nav-sep-label { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; padding: 0 .8rem .5rem; }
.sidebar-footer { padding: 1rem 1.15rem; border-top: 1px solid #eef1f5; display: flex; align-items: center; gap: .65rem; font-size: .78rem; }
.sidebar-footer .avatar { width: 34px; height: 34px; }
.sidebar-footer form { margin-left: auto; }
.sidebar-footer button { background: none; border: none; color: #94a3b8; cursor: pointer; display: flex; padding: .35rem; border-radius: .5rem; }
.sidebar-footer button:hover { background: #f1f5f9; color: #1e293b; }

.header {
  position: fixed; top: 0; left: 260px; right: 0; height: 64px;
  background: rgba(255,255,255,.85); backdrop-filter: blur(10px); border-bottom: 1px solid #e2e8f0;
  display: flex; align-items: center; justify-content: space-between; padding: 0 1.75rem;
  z-index: 30;
}
.breadcrumb { font-size: .85rem; color: #94a3b8; }
.breadcrumb strong { color: #1e293b; font-weight: 600; }
.header-user { display: flex; align-items: center; gap: .65rem; font-size: .78rem; }
.header-user .name { font-weight: 600; color: #1e293b; }
.header-user .role { color: #94a3b8; }

.main { margin-left: 260px; padding-top: 64px; min-height: 100vh; }
.main-inner { padding: 1.75rem 2rem 3rem; max-width: 1400px; }

@media (max-width: 900px) {
  .sidebar { display: none; }
  .header { left: 0; }
  .main { margin-left: 0; }
  .main-inner { padding: 1.1rem; }
}

/* ───────────── Componentes ───────────── */
.card { background: #fff; border: 1px solid #e7ebf0; border-radius: 1rem; box-shadow: 0 1px 3px rgba(15,23,42,.04), 0 1px 2px rgba(15,23,42,.03); }
.card-hover { transition: transform .18s ease, box-shadow .18s ease; cursor: pointer; }
.card-hover:hover { transform: translateY(-3px); box-shadow: 0 16px 30px rgba(15,23,42,.09); }
.card-header { padding: 1.1rem 1.35rem; border-bottom: 1px solid #f1f5f9; font-weight: 650; font-size: .92rem; color: #0f172a; }
.card-body { padding: 1.25rem 1.35rem; }

.grid { display: grid; gap: 1.1rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-weight: 600; font-size: .83rem; border-radius: .7rem; border: none; cursor: pointer;
  padding: .6rem 1.05rem; transition: background .15s, opacity .15s, box-shadow .15s, transform .1s;
  line-height: 1.2;
}
.btn[hidden] { display: none; }
.campos-baja { display: contents; }
.campos-baja[hidden] { display: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
/* Verde = acción / aceptación (crear, guardar, confirmar, asignar...) */
.btn-primary { background: #16a34a; color: #fff; box-shadow: 0 2px 8px rgba(22,163,74,.28); }
.btn-primary:hover:not(:disabled) { background: #15803d; box-shadow: 0 4px 12px rgba(22,163,74,.35); }
/* Azul = informativo / siguiente paso (ver, abrir, navegar...) */
.btn-info { background: #2563eb; color: #fff; box-shadow: 0 2px 8px rgba(37,99,235,.28); }
.btn-info:hover:not(:disabled) { background: #1d4ed8; box-shadow: 0 4px 12px rgba(37,99,235,.35); }
.btn-secondary { background: #f1f5f9; color: #1e293b; }
.btn-secondary:hover:not(:disabled) { background: #e2e8f0; }
.btn-danger { background: #dc2626; color: #fff; box-shadow: 0 2px 8px rgba(220,38,38,.25); }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-outline { background: #fff; color: #2563eb; border: 1px solid #bfdbfe; }
.btn-outline:hover:not(:disabled) { background: #eff6ff; border-color: #93c5fd; }
.btn-ghost { background: none; color: #334155; }
.btn-ghost:hover:not(:disabled) { background: #f1f5f9; }
.btn-sm { padding: .4rem .75rem; font-size: .77rem; border-radius: .55rem; }
.btn-lg { padding: .8rem 1.3rem; font-size: .92rem; border-radius: .8rem; }
.btn-block { width: 100%; }

.badge { display: inline-flex; align-items: center; gap: .35rem; font-size: .71rem; font-weight: 650; padding: .22rem .65rem; border-radius: 999px; white-space: nowrap; letter-spacing: .01em; }
.badge-dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; flex-shrink: 0; }
.badge-default { background: #f1f5f9; color: #475569; }
.badge-success { background: #d1fae5; color: #047857; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-danger  { background: #fee2e2; color: #b91c1c; }
.badge-info    { background: #dbeafe; color: #1d4ed8; }
.badge-purple  { background: #ede9fe; color: #6d28d9; }
.badge-outline { background: #fff; color: #475569; border: 1px solid #cbd5e1; }

.avatar { border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; flex-shrink: 0; letter-spacing: -.02em; box-shadow: inset 0 0 0 2px rgba(255,255,255,.15); }
.avatar-xs { width: 24px; height: 24px; font-size: .58rem; }
.avatar-sm { width: 32px; height: 32px; font-size: .68rem; }
.avatar-md { width: 42px; height: 42px; font-size: .82rem; }
.avatar-lg { width: 50px; height: 50px; font-size: .95rem; }
.avatar-xl { width: 66px; height: 66px; font-size: 1.15rem; }
.av-0 { background: #3b82f6; } .av-1 { background: #10b981; } .av-2 { background: #a855f7; }
.av-3 { background: #f59e0b; } .av-4 { background: #ef4444; } .av-5 { background: #06b6d4; }
.av-6 { background: #ec4899; } .av-7 { background: #6366f1; }

.empty-state { text-align: center; padding: 4rem 1.5rem; color: #64748b; }
.empty-state .icon-tile { width: 68px; height: 68px; border-radius: 1.1rem; background: #f1f5f9; display: flex; align-items: center; justify-content: center; margin: 0 auto 1.1rem; color: #94a3b8; }
.empty-state h3 { margin: 0 0 .3rem; font-size: .98rem; color: #1e293b; font-weight: 650; }
.empty-state p { margin: 0; font-size: .85rem; max-width: 380px; margin-inline: auto; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.55); display: flex; align-items: center; justify-content: center; padding: 1.5rem; z-index: 100; animation: fadeIn .15s ease; }
.modal-overlay[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box { background: #fff; border-radius: 1.1rem; box-shadow: 0 30px 60px rgba(0,0,0,.3); width: 100%; max-height: 88vh; overflow-y: auto; }
.modal-sm { max-width: 420px; } .modal-md { max-width: 520px; } .modal-lg { max-width: 660px; } .modal-xl { max-width: 920px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.35rem; border-bottom: 1px solid #f1f5f9; }
.modal-header h3 { margin: 0; font-size: .96rem; font-weight: 650; }
.modal-close { background: #f1f5f9; border: none; cursor: pointer; color: #64748b; padding: .3rem; border-radius: .5rem; display: flex; }
.modal-close:hover { background: #e2e8f0; color: #1e293b; }
.modal-body { padding: 1.35rem; }

/* Formularios */
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-size: .78rem; font-weight: 650; color: #334155; margin-bottom: .4rem; }
.field input, .field textarea {
  width: 100%; padding: .62rem .8rem; border: 1px solid #d6dce4; border-radius: .65rem;
  font-size: .85rem; font-family: inherit; background: #fff; color: #1e293b;
}
.field select {
  width: 100%; padding: .62rem 2.2rem .62rem .8rem; border: 1px solid #d6dce4; border-radius: .65rem;
  font-size: .85rem; font-family: inherit; background: #fff; color: #1e293b;
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right .7rem center; background-size: 16px;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.field textarea { resize: vertical; min-height: 5rem; }
.field-hint { font-size: .73rem; color: #94a3b8; margin-top: .3rem; }
.field-error { font-size: .73rem; color: #dc2626; margin-top: .3rem; }

.flash { padding: .8rem 1.05rem; border-radius: .7rem; font-size: .85rem; margin-bottom: 1.1rem; font-weight: 500; }
.flash-success { background: #d1fae5; color: #047857; }
.flash-error { background: #fee2e2; color: #b91c1c; }
.flash-info { background: #eff6ff; color: #1d4ed8; }

/* Tabla */
table.table { width: 100%; border-collapse: collapse; font-size: .85rem; }
table.table th { text-align: left; font-size: .71rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #94a3b8; padding: .7rem 1.1rem; border-bottom: 1px solid #eef1f5; white-space: nowrap; }
table.table td { padding: .85rem 1.1rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
table.table tbody tr:hover { background: #f8fafc; }
table.table tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }

/* Tabs / filtros */
.tabs { display: flex; gap: .45rem; flex-wrap: wrap; }
.tab { padding: .5rem 1rem; border-radius: .7rem; font-size: .81rem; font-weight: 600; color: #64748b; background: #f1f5f9; border: none; cursor: pointer; transition: background .12s, color .12s; }
.tab:hover { background: #e2e8f0; }
.tab.active { background: #2563eb; color: #fff; box-shadow: 0 2px 8px rgba(37,99,235,.3); }

/* Zonas / racks / posiciones */
.zona-strip { height: 6px; border-radius: 1rem 1rem 0 0; }
.zona-strip.zona-blue{background:linear-gradient(90deg,#3b82f6,#60a5fa);} .zona-strip.zona-cyan{background:linear-gradient(90deg,#06b6d4,#22d3ee);}
.zona-strip.zona-amber{background:linear-gradient(90deg,#f59e0b,#fbbf24);} .zona-strip.zona-red{background:linear-gradient(90deg,#ef4444,#f87171);}
.zona-strip.zona-slate{background:linear-gradient(90deg,#64748b,#94a3b8);}
.zona-icon { width: 42px; height: 42px; border-radius: .9rem; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.zona-icon.zona-blue{background:#eff6ff;} .zona-icon.zona-cyan{background:#ecfeff;} .zona-icon.zona-amber{background:#fffbeb;}
.zona-icon.zona-red{background:#fef2f2;} .zona-icon.zona-slate{background:#f1f5f9;}
.occ-bar{height:9px;background:#f1f5f9;border-radius:999px;overflow:hidden;}
.occ-bar-fill{height:100%;background:linear-gradient(90deg,#2563eb,#3b82f6);border-radius:999px;}
.legend-row{display:flex;flex-wrap:wrap;gap:1.25rem;align-items:center;}
.legend-item{display:flex;align-items:center;gap:.5rem;font-size:.82rem;color:#475569;}
.legend-dot{width:14px;height:14px;border-radius:.35rem;display:inline-block;flex-shrink:0;}
.legend-libre{background:#e2e8f0;} .legend-ocupado{background:#3b82f6;} .legend-reservado{background:#f59e0b;} .legend-bloqueado{background:#1e293b;}
.zona-info-bar{display:flex;gap:1.5rem;flex-wrap:wrap;background:#f8fafc;border-radius:.8rem;padding:.9rem 1.1rem;margin-bottom:1.25rem;}
.zona-info-item .label{font-size:.7rem;color:#94a3b8;text-transform:uppercase;letter-spacing:.04em;font-weight:700;}
.zona-info-item .value{font-size:.88rem;font-weight:650;color:#1e293b;margin-top:.15rem;}
.rack-block{margin-bottom:1.4rem;}
.rack-title{font-size:.8rem;font-weight:700;color:#1e293b;margin-bottom:.55rem;display:flex;align-items:center;gap:.5rem;}
.rack-title .rack-cliente{font-size:.7rem;font-weight:600;color:#94a3b8;text-transform:none;letter-spacing:0;}
.pos-grid{display:flex;flex-wrap:wrap;gap:.4rem;}
.rack-level{display:flex;align-items:center;gap:.5rem;margin-bottom:.4rem;}
.rack-level-label{width:2.8rem;flex-shrink:0;font-size:.66rem;font-weight:700;color:#94a3b8;}
.rack-estiba .rack-level:last-of-type{border-bottom:3px solid #cbd5e1;padding-bottom:.4rem;}
details > summary{list-style:none;} details > summary::-webkit-details-marker{display:none;}
.pos-cell{
  width:38px;height:38px;border-radius:.5rem;border:none;cursor:pointer;font-size:.63rem;font-weight:700;
  color:#fff;display:flex;align-items:center;justify-content:center;transition:transform .1s;
}
.pos-cell:hover:not(:disabled){transform:scale(1.08);}
.pos-libre{background:#e2e8f0;color:#94a3b8;}
.pos-ocupado{background:#3b82f6;}
.pos-reservado{background:#f59e0b;}
.pos-bloqueado{background:#1e293b;opacity:.45;cursor:not-allowed;}
.cliente-chip{display:flex;align-items:center;justify-content:space-between;padding:.5rem .75rem;background:#f8fafc;border-radius:.6rem;margin-bottom:.4rem;font-size:.82rem;}
.rack-mini-list{font-size:.78rem;color:#64748b;}
.rack-mini-list div{display:flex;justify-content:space-between;padding:.25rem 0;border-bottom:1px solid #f1f5f9;}
.rack-mini-list div:last-child{border-bottom:none;}

/* Login */
.login-wrap { position: relative; isolation: isolate; min-height: 100vh; background: linear-gradient(180deg,#ffffff 0%,#eff6ff 100%); display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.login-wrap > * { position: relative; z-index: 1; }
.login-box { width: 100%; max-width: 400px; }
.login-logo { text-align: center; margin-bottom: 1.75rem; }
.login-logo .icon-tile { width: 68px; height: 68px; border-radius: 1.15rem; background: linear-gradient(135deg,#3b82f6,#1d4ed8); display: flex; align-items: center; justify-content: center; margin: 0 auto 1.1rem; color: #fff; box-shadow: 0 10px 26px rgba(37,99,235,.3); }
.login-logo img { width: 68px; height: 68px; border-radius: 1.15rem; object-fit: cover; margin: 0 auto 1.1rem; display: block; }
.login-logo h1 { color: #1e293b; font-size: 1.4rem; margin: 0; font-weight: 700; letter-spacing: -.01em; }
.login-logo p { color: #64748b; font-size: .84rem; margin: .35rem 0 0; }
.login-card { background: #fff; border: 1px solid #e7ebf0; border-radius: 1.15rem; padding: 1.75rem; box-shadow: 0 20px 45px rgba(15,23,42,.08); }
.login-card label { color: #475569; }
.login-card input { background: #fff; border: 1px solid #d6dce4; color: #1e293b; }
.login-card input:focus { border-color: #3b82f6; outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.login-hint { text-align: center; color: #94a3b8; font-size: .76rem; margin-top: 1.25rem; }

/* ───────────── Login "Elige tu área" (foto completa + tarjeta en vidrio) ───────────── */
.login-hero { position: relative; isolation: isolate; min-height: 640px; background-size: cover; background-position: center; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; }
.login-hero-vignette { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8,16,38,.3) 0%, rgba(8,16,38,.48) 36%, rgba(241,245,249,.6) 50%, rgba(248,250,252,.93) 62%, rgba(248,250,252,.98) 100%); pointer-events: none; z-index: 1; }
.login-hero-brand { position: relative; padding: 2rem 2.5rem; z-index: 2; }
.login-hero-brand h1 { color: #fff; font-size: clamp(1.4rem, 2.6vw, 2rem); font-weight: 800; margin: 0; letter-spacing: -.01em; text-shadow: 0 2px 10px rgba(0,0,0,.35); }
.login-hero-brand p { color: #dbeafe; font-size: .84rem; margin: .4rem 0 0; letter-spacing: .03em; text-transform: uppercase; text-shadow: 0 1px 6px rgba(0,0,0,.35); }

.login-hero-center { position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-end; padding: 2rem 6vw; z-index: 2; min-width: 0; }
.login-card-glass { width: 100%; max-width: 380px; min-width: 0; }
.login-card-glass h2 { font-size: 1.4rem; font-weight: 750; color: #0f172a; margin: 0 0 .25rem; }
.login-card-glass > p.text-muted { margin: 0 0 1.2rem; }

.login-logo-animated { width: 100%; max-width: 280px; min-width: 0; margin: 0 auto .8rem; }
.login-logo-animated img { width: 100%; max-width: 100%; min-width: 0; height: auto; display: block; filter: drop-shadow(0 10px 22px rgba(37,99,235,.25)); }

.acceso-directo { display: flex; align-items: center; gap: .5rem; font-size: .72rem; font-weight: 700; letter-spacing: .06em; color: #64748b; text-transform: uppercase; border-top: 1px solid rgba(15,23,42,.1); padding-top: 1.1rem; margin-bottom: 1rem; }
.acceso-directo .ic { width: 15px; height: 15px; color: #2563eb; }

.area-carousel-label { font-size: .72rem; font-weight: 700; letter-spacing: .08em; color: #94a3b8; padding: 1.2rem 1.5rem .8rem; background: #f8fafc; }
.area-carousel { overflow: hidden; background: #f8fafc; padding-bottom: 1.4rem; }
.area-carousel-track { display: flex; width: max-content; gap: 0; padding: 0; animation: carouselScroll 36s linear infinite; }
.area-carousel:hover .area-carousel-track { animation-play-state: paused; }
@keyframes carouselScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.login-footer { text-align: center; padding: 1rem; color: #94a3b8; font-size: .74rem; background: #f8fafc; }

.area-card { flex: 0 0 260px; border-radius: 0; padding: 1.15rem 1.3rem; color: #fff; text-decoration: none; display: block; transition: transform .15s ease, box-shadow .15s ease; }
.area-card:hover { transform: translateY(-4px); box-shadow: 0 16px 32px rgba(15,23,42,.22); }
.area-card-activa { outline: 3px solid rgba(255,255,255,.85); outline-offset: 2px; }
.area-elegida { text-align: center; font-size: .82rem; color: #334155; margin-bottom: .6rem; animation: fadeIn .2s ease; }
.area-elegida strong { color: #0f172a; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
#btn-entrar { transition: background .2s ease; }
.area-card-icon { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; background: rgba(255,255,255,.18); border-radius: .6rem; margin-bottom: .6rem; }
.area-card-icon .ic { width: 18px; height: 18px; }
.area-card-label { display: block; font-weight: 700; font-size: .95rem; }
.area-card-desc { display: block; font-size: .76rem; opacity: .85; margin-top: .25rem; line-height: 1.35; }

.clr-violeta { background: linear-gradient(135deg,#7c3aed,#5b21b6); }
.clr-indigo  { background: linear-gradient(135deg,#1e3a8a,#1e40af); }
.clr-teal    { background: linear-gradient(135deg,#0d9488,#0f766e); }
.clr-slate   { background: linear-gradient(135deg,#334155,#0f172a); }
.clr-emerald { background: linear-gradient(135deg,#059669,#047857); }
.clr-sky     { background: linear-gradient(135deg,#0284c7,#0369a1); }
.clr-rose    { background: linear-gradient(135deg,#e11d48,#be123c); }
.clr-amber   { background: linear-gradient(135deg,#d97706,#b45309); }
.clr-orange  { background: linear-gradient(135deg,#ea580c,#c2410c); }
.clr-fuchsia { background: linear-gradient(135deg,#c026d3,#a21caf); }

@media (max-width: 640px) {
  .login-hero-brand { display: none; }
}
@media (max-width: 900px) {
  .login-hero { min-height: 560px; }
  .login-hero-vignette { background: linear-gradient(0deg, rgba(8,16,38,.3) 0%, rgba(8,16,38,.48) 36%, rgba(241,245,249,.6) 50%, rgba(248,250,252,.93) 62%, rgba(248,250,252,.98) 100%); }
  .login-hero-center { padding: 1.5rem 1rem; justify-content: center; align-items: flex-end; }
  .area-card { flex-basis: 190px; }
}

.text-muted { color: #94a3b8; }
.text-sm { font-size: .85rem; }
.text-xs { font-size: .76rem; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1.1rem; } .mt-3 { margin-top: 1.75rem; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-1 { gap: .45rem; } .gap-2 { gap: .8rem; }

/* ───────────── Portales: app de choferes y portal de clientes (móvil primero) ───────────── */
body.portal { padding-bottom: 76px; }
.portal-w-md { max-width: 760px; margin-left: auto; margin-right: auto; }
.portal-w-lg { max-width: 1120px; margin-left: auto; margin-right: auto; }
.portal-top { position: sticky; top: 0; z-index: 30; background: #fff; color: #1e293b; border-bottom: 1px solid #e7ebf0; }
.portal-top-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 1rem; }
.portal-logo { width: 36px; height: 36px; border-radius: .7rem; object-fit: cover; }
.portal-logo-icon { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg,#3b82f6,#1d4ed8); color: #fff; }
.portal-empresa { font-weight: 700; font-size: .9rem; line-height: 1.2; color: #1e293b; }
.portal-sub { font-size: .7rem; color: #94a3b8; }
.portal-user { display: flex; align-items: center; gap: .5rem; font-size: .78rem; color: #64748b; }
.portal-user button { background: #f1f5f9; border: none; color: #475569; padding: .45rem; border-radius: .6rem; display: flex; cursor: pointer; }
.portal-nav { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid #e2e8f0; display: flex; justify-content: space-around; padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom)); z-index: 40; }
.portal-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .15rem; font-size: .66rem; font-weight: 600; color: #64748b; padding: .35rem .2rem; border-radius: .6rem; }
.portal-nav a.active { color: #2563eb; background: #eff6ff; }
.portal-main { padding: 1rem; }

@media (max-width: 640px) {
  body::before, .login-wrap::before, .login-hero::before { width: 84vw; height: 38vh; }
}
@media (min-width: 901px) {
  body.portal { padding-bottom: 0; }
  .portal-nav { position: static; background: none; border: none; padding: 0; gap: .3rem; justify-content: center; flex: 1; }
  .portal-nav a { flex: none; flex-direction: row; gap: .45rem; font-size: .8rem; color: #64748b; padding: .5rem .8rem; }
  .portal-nav a.active { background: #eff6ff; color: #2563eb; }
  .portal-main { padding: 1.5rem 1rem 3rem; }
}
@media (max-width: 900px) { .portal-user-name { display: none; } }

/* Tarjetas de viaje y pasos */
.viaje-card { display: block; background: #fff; border: 1px solid #e7ebf0; border-radius: 1rem; padding: 1rem; margin-bottom: .8rem; }
.viaje-card:active { background: #f8fafc; }
.viaje-tipo { display: inline-flex; align-items: center; gap: .3rem; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .2rem .55rem; border-radius: .5rem; }
.viaje-tipo-entrega { background: #dbeafe; color: #1d4ed8; }
.viaje-tipo-recoleccion { background: #fef3c7; color: #b45309; }
.ruta-linea { display: grid; grid-template-columns: 18px 1fr; gap: .1rem .6rem; margin-top: .7rem; font-size: .85rem; }
.ruta-dot { width: 12px; height: 12px; border-radius: 999px; margin-top: .25rem; border: 3px solid #2563eb; background: #fff; }
.ruta-dot.fin { border-color: #059669; background: #059669; }
.ruta-bar { width: 2px; background: #cbd5e1; margin: 0 auto; min-height: 14px; }
.pasos { list-style: none; margin: 0; padding: 0; }
.pasos li { display: flex; align-items: center; gap: .6rem; padding: .45rem 0; font-size: .85rem; color: #94a3b8; }
.pasos li .paso-dot { width: 22px; height: 22px; border-radius: 999px; border: 2px solid #cbd5e1; display: flex; align-items: center; justify-content: center; font-size: .7rem; flex-shrink: 0; }
.pasos li.hecho { color: #1e293b; } .pasos li.hecho .paso-dot { background: #059669; border-color: #059669; color: #fff; }
.pasos li.actual { color: #2563eb; font-weight: 700; } .pasos li.actual .paso-dot { border-color: #2563eb; }
.km-box { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; text-align: center; }
.km-box div { background: #f8fafc; border-radius: .7rem; padding: .6rem .3rem; }
.km-box .v { font-size: 1.05rem; font-weight: 700; } .km-box .l { font-size: .68rem; color: #64748b; }
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.check-grid label { display: flex; align-items: center; gap: .45rem; font-size: .85rem; font-weight: 500; background: #f8fafc; border-radius: .6rem; padding: .6rem .7rem; }
.check-grid input { width: 20px !important; height: 20px; }
.bitacora-item { display: flex; gap: .7rem; padding: .7rem 0; border-bottom: 1px solid #f1f5f9; }
.bitacora-item:last-child { border-bottom: none; }
.bitacora-ico { width: 32px; height: 32px; border-radius: .7rem; background: #f1f5f9; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bitacora-foto { max-width: 160px; border-radius: .6rem; margin-top: .4rem; border: 1px solid #e2e8f0; }
.stat-big { font-size: 1.5rem; font-weight: 700; }

/* ───────────── Atención a clientes (CRM) ───────────── */
.atencion-wrap { display: flex; gap: 1rem; height: calc(100vh - 64px - 3.5rem); align-items: stretch; }
.atencion-lista { width: 300px; flex-shrink: 0; display: flex; flex-direction: column; overflow: hidden; }
.atencion-tabs { display: flex; gap: .3rem; flex-wrap: wrap; padding: .9rem; border-bottom: 1px solid #f1f5f9; }
.atencion-tabs .tab { font-size: .72rem; padding: .35rem .6rem; }
.atencion-items { flex: 1; overflow-y: auto; }
.atencion-item { padding: .8rem .9rem; border-bottom: 1px solid #f1f5f9; cursor: pointer; }
.atencion-item:hover { background: #f8fafc; }
.atencion-item.activa { background: #eff6ff; }
.atencion-chat { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
#chat-activo { display: flex; flex-direction: column; height: 100%; }
#chat-activo[hidden] { display: none; }
.atencion-chat-header { padding: .9rem 1.1rem; border-bottom: 1px solid #f1f5f9; display: flex; align-items: center; justify-content: space-between; }
.atencion-mensajes { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .5rem; background: #f8fafc; }
.msg-burbuja { max-width: 70%; padding: .55rem .8rem; border-radius: .8rem; font-size: .85rem; }
.msg-entrante { align-self: flex-start; background: #fff; border: 1px solid #e7ebf0; }
.msg-saliente { align-self: flex-end; background: #dbeafe; color: #1e3a8a; }
.msg-autor { font-size: .68rem; font-weight: 700; opacity: .6; margin-bottom: .15rem; }
.atencion-input { display: flex; gap: .5rem; padding: .8rem; border-top: 1px solid #f1f5f9; }
.atencion-input input[type="text"] { flex: 1; padding: .6rem .8rem; border: 1px solid #d6dce4; border-radius: .65rem; font-size: .85rem; }
.atencion-input select { padding: .6rem .5rem; border: 1px solid #d6dce4; border-radius: .65rem; font-size: .8rem; }
.atencion-notas { width: 280px; flex-shrink: 0; display: flex; flex-direction: column; overflow: hidden; }
.atencion-notas[hidden] { display: none; }
@media (max-width: 900px) {
  .atencion-wrap { flex-direction: column; height: auto; }
  .atencion-lista, .atencion-notas { width: 100%; }
  .atencion-chat { height: 70vh; }
}

/* Tablero kanban del CRM (arrastrar y soltar tarjetas entre etapas) */
.kanban-wrap { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: .5rem; align-items: flex-start; }
.kanban-col { background: #f1f5f9; border-radius: 1rem; width: 250px; flex-shrink: 0; display: flex; flex-direction: column; max-height: calc(100vh - 64px - 7rem); }
.kanban-col-head { padding: .8rem .9rem .6rem; font-size: .78rem; font-weight: 700; color: #334155; display: flex; align-items: center; justify-content: space-between; }
.kanban-count { background: #e2e8f0; color: #475569; font-size: .68rem; font-weight: 700; padding: .05rem .5rem; border-radius: 999px; }
.kanban-cards { flex: 1; overflow-y: auto; padding: 0 .6rem .6rem; display: flex; flex-direction: column; gap: .55rem; min-height: 60px; transition: background .12s; border-radius: .6rem; }
.kanban-cards.kanban-sobre { background: #dbeafe; }
.kanban-card { background: #fff; border: 1px solid #e7ebf0; border-radius: .7rem; padding: .6rem .7rem; cursor: grab; box-shadow: 0 1px 2px rgba(15,23,42,.05); }
.kanban-card:active { cursor: grabbing; }
.kanban-card:hover { border-color: #93c5fd; box-shadow: 0 4px 10px rgba(37,99,235,.12); }
@media (max-width: 900px) {
  .kanban-wrap { flex-wrap: nowrap; }
}

/* Impresión (pase de visita, reporte diario de accesos) — se oculta todo el
   chrome del panel y solo queda el contenido a imprimir. */
.no-print { }
@media print {
  .sidebar, .header, .no-print { display: none !important; }
  .main { padding-left: 0 !important; padding-top: 0 !important; }
  body { background: #fff !important; }
}
.reporte-tabla { width: 100%; border-collapse: collapse; font-size: .82rem; }
.reporte-tabla th, .reporte-tabla td { border: 1px solid #cbd5e1; padding: .4rem .5rem; text-align: left; }
.reporte-tabla th { background: #f1f5f9; }
.reporte-tabla tr.fila-vacia td { height: 1.8rem; }

/* Almacén integral */
.almacen-hero { background: linear-gradient(125deg,#0f172a,#1e3a8a 58%,#1d4ed8); color:#fff; border-radius:1rem; padding:1.4rem 1.6rem; display:flex; align-items:center; justify-content:space-between; gap:1rem; margin-bottom:1rem; box-shadow:0 16px 34px rgba(30,58,138,.2); }
.almacen-hero h1 { font-size:1.65rem; margin:.15rem 0; }
.almacen-hero p { color:#bfdbfe; font-size:.85rem; }
.almacen-hero-code { border:1px solid rgba(255,255,255,.25); background:rgba(255,255,255,.1); border-radius:.7rem; padding:.65rem .9rem; font-size:.72rem; font-weight:800; letter-spacing:.08em; white-space:nowrap; }
.almacen-tabs { display:flex; gap:.35rem; overflow-x:auto; padding:.15rem 0 .8rem; scrollbar-width:thin; }
.almacen-tabs a { white-space:nowrap; padding:.52rem .8rem; border:1px solid #dbe3ed; background:#fff; color:#475569; border-radius:.65rem; font-size:.77rem; font-weight:650; }
.almacen-tabs a:hover { border-color:#93c5fd; color:#1d4ed8; }
.almacen-tabs a.active { background:#1e3a8a; border-color:#1e3a8a; color:#fff; box-shadow:0 4px 10px rgba(30,58,138,.2); }
.almac-stat { padding:1rem 1.1rem; border-top:3px solid #2563eb; }
.almac-stat span { display:block; color:#64748b; font-size:.72rem; text-transform:uppercase; letter-spacing:.04em; font-weight:700; }
.almac-stat strong { display:block; font-size:1.45rem; margin-top:.2rem; }
.operation-row { display:grid; grid-template-columns:2fr 1.2fr 1fr 1.15fr .85fr .65fr .65fr 1.1fr auto; gap:.45rem; align-items:center; padding:.65rem; background:#f8fafc; border:1px solid #e2e8f0; border-radius:.7rem; margin:.55rem 0; }
.operation-row input,.operation-row select { width:100%; min-width:0; padding:.52rem .58rem; border:1px solid #cbd5e1; border-radius:.5rem; background:#fff; font-size:.76rem; }
.operation-row.salida-row { grid-template-columns:2fr 1fr 1.5fr auto; }
.operation-row.maquila-row { grid-template-columns:2.6fr 1fr 1fr auto; }
.form-section-title { margin:1.2rem 0 .5rem; font-size:.78rem; color:#334155; text-transform:uppercase; letter-spacing:.05em; }
.almacen-location-layout { grid-template-columns:360px 1fr; align-items:start; }
.ubicacion-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(130px,1fr)); gap:.45rem; }
.ubicacion-cell { border:1px solid #dbe3ed; background:#fff; border-radius:.6rem; padding:.55rem; cursor:pointer; text-align:left; color:#334155; }
.ubicacion-cell strong,.ubicacion-cell span { display:block; }
.ubicacion-cell strong { font-size:.7rem; }
.ubicacion-cell span { color:#64748b; font-size:.65rem; margin-top:.15rem; }
.ubicacion-libre { border-left:4px solid #10b981; }
.ubicacion-ocupada { border-left:4px solid #2563eb; background:#eff6ff; }
.ubicacion-bloqueada { border-left:4px solid #dc2626; background:#fef2f2; }
.ubicacion-mantenimiento { border-left:4px solid #f59e0b; background:#fffbeb; }
@media (max-width:1100px) { .operation-row { grid-template-columns:repeat(3,1fr); } .operation-row.salida-row,.operation-row.maquila-row { grid-template-columns:repeat(2,1fr); } }
@media (max-width:700px) { .almacen-hero { align-items:flex-start; flex-direction:column; } .almacen-hero-code { white-space:normal; } .operation-row,.operation-row.salida-row,.operation-row.maquila-row { grid-template-columns:1fr; } .almacen-location-layout { grid-template-columns:1fr; } }
