    :root {
      --brand:#e34a36;
      --brand-dark:#bf3325;
      --ink:#111827;
      --muted:#6b7280;
      --line:#e5e7eb;
      --soft:#f8fafc;
      --panel:#ffffff;
      --warning:#fff7ed;
      --danger:#b91c1c;
    }

    * {
      box-sizing:border-box;
      margin:0;
      padding:0;
      font-family:Inter, Arial, sans-serif;
    }

    body {
      min-height:100vh;
      background:var(--soft);
      color:var(--ink);
    }

    button {
      border:0;
      cursor:pointer;
      font-weight:800;
      transition:.18s ease;
    }

    input, select {
      width:100%;
      height:46px;
      border:1px solid #d1d5db;
      border-radius:6px;
      padding:0 14px;
      font-size:14px;
      outline:none;
      background:#fff;
      color:var(--ink);
    }

    input:focus, select:focus {
      border-color:var(--brand);
      box-shadow:0 0 0 3px rgba(227,74,54,.10);
    }

    label {
      display:block;
      font-size:11px;
      font-weight:850;
      color:#4b5563;
      margin-bottom:7px;
      text-transform:uppercase;
      letter-spacing:.055em;
    }

    .login-screen {
      min-height:100vh;
      display:flex;
      align-items:center;
      justify-content:center;
      padding:24px;
      background:#101419;
    }

    .login-card {
      width:100%;
      max-width:500px;
      background:#fff;
      border-radius:10px;
      overflow:hidden;
      box-shadow:0 20px 50px rgba(0,0,0,.28);
    }

    .login-header {
      background:#111827;
      color:white;
      padding:34px 34px 30px;
    }

    .login-logo {
      width:280px;
      max-width:100%;
      display:block;
      margin-bottom:28px;
    }

    .badge {
      display:inline-flex;
      align-items:center;
      padding:5px 9px;
      border-radius:4px;
      background:var(--brand);
      color:white;
      font-size:10px;
      font-weight:800;
      line-height:1;
      text-transform:uppercase;
      letter-spacing:.06em;
    }

    .dark-badge {
      background:var(--ink);
    }

    .soft-badge {
      background:var(--warning);
      color:#9a3412;
      border-radius:4px;
      padding:5px 9px;
      font-size:10px;
      font-weight:800;
      text-transform:uppercase;
      letter-spacing:.06em;
    }

    .login-header h1 {
      font-size:30px;
      margin-top:18px;
      letter-spacing:-.025em;
      font-weight:850;
    }

    .login-header p {
      color:#cbd5e1;
      margin-top:10px;
      line-height:1.55;
      font-size:14px;
    }

    .login-body {
      padding:30px;
    }

    .field {
      margin-bottom:18px;
      position:relative;
    }

    .primary-btn, .save-btn, .add-client-btn {
      height:48px;
      border-radius:6px;
      background:var(--brand);
      color:white;
      font-size:15px;
      font-weight:850;
      padding:0 18px;
    }

    .primary-btn:hover, .save-btn:hover, .add-client-btn:hover {
      background:var(--brand-dark);
    }

    .primary-btn {
      width:100%;
    }

    .secondary-btn {
      height:48px;
      border-radius:6px;
      background:white;
      border:1px solid var(--brand);
      color:var(--brand);
      padding:0 18px;
    }

    .secondary-btn:hover {
      background:var(--warning);
    }

    .hint-box {
      margin-top:16px;
      background:#f9fafb;
      border:1px solid var(--line);
      border-radius:6px;
      padding:14px;
      color:var(--muted);
      font-size:12px;
      line-height:1.5;
    }

    .app {
      display:none;
      padding:24px 18px 52px;
    }

    .container {
      max-width:1200px;
      margin:auto;
    }

    .topbar {
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:18px;
      margin-bottom:24px;
      padding:12px 14px;
      background:#fff;
      border:1px solid var(--line);
      border-radius:8px;
    }

    .logout {
      background:var(--brand);
      border-radius:6px;
      padding:11px 17px;
      color:white;
      white-space:nowrap;
    }

    .topbar-center {
      flex:1;
      display:flex;
      justify-content:center;
    }

    .portal-title {
      color:#374151;
      font-size:13px;
      font-weight:800;
      letter-spacing:.04em;
      text-transform:uppercase;
    }

    .portal-logo {
      width:230px;
      max-width:40vw;
      display:block;
    }

    .hero {
      padding:18px 2px 22px;
      border-bottom:1px solid var(--line);
      margin-bottom:2px;
    }

    .hero h2 {
      font-size:clamp(30px,4vw,46px);
      line-height:1.08;
      letter-spacing:-.035em;
      font-weight:850;
      max-width:820px;
    }

    .hero p {
      margin-top:14px;
      color:var(--muted);
      max-width:790px;
      line-height:1.55;
      font-size:16px;
    }

    .eyebrow {
      display:block;
      color:var(--brand);
      font-size:12px;
      font-weight:850;
      text-transform:uppercase;
      letter-spacing:.08em;
      margin-bottom:10px;
    }

    .tabs {
      display:none;
      gap:10px;
      margin-top:24px;
      flex-wrap:wrap;
    }

    .tab {
      background:white;
      border:1px solid var(--line);
      border-radius:6px;
      padding:10px 14px;
      color:#374151;
      font-weight:800;
    }

    .tab.active {
      background:var(--brand);
      color:white;
      border-color:var(--brand);
    }

    .portal, .admin-section {
      display:none;
    }

    .portal.active, .admin-section.active {
      display:block;
    }

    .grid {
      display:grid;
      grid-template-columns:1.75fr .9fr;
      gap:18px;
      margin-top:22px;
    }

    .admin-grid {
      display:grid;
      grid-template-columns:.86fr 1.62fr;
      gap:18px;
      margin-top:22px;
    }

    .card {
      background:var(--panel);
      border:1px solid var(--line);
      border-radius:10px;
      box-shadow:0 8px 24px rgba(17,24,39,.05);
      padding:24px;
    }

    .section-title {
      display:flex;
      align-items:center;
      gap:10px;
      margin-bottom:18px;
      font-size:16px;
      font-weight:850;
      letter-spacing:-.01em;
      color:var(--ink);
    }

    .orange-dot {
      width:3px;
      height:18px;
      background:var(--brand);
    }

    .three-cols {
      display:grid;
      grid-template-columns:repeat(3,1fr);
      gap:14px;
    }

    .client-details {
      display:grid;
      grid-template-columns:1fr 1fr;
      gap:12px;
    }

    .required:after {
      content:" *";
      color:var(--brand);
    }

    .locked-client {
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:14px;
      background:var(--ink);
      color:white;
      border-radius:6px;
      padding:16px;
      margin-bottom:22px;
    }

    .locked-client small {
      display:block;
      color:#f59e0b;
      font-weight:900;
      text-transform:uppercase;
      font-size:11px;
      letter-spacing:.06em;
      margin-bottom:5px;
    }

    .locked-client strong {
      font-size:18px;
    }

    .locked-client span {
      color:#d1d5db;
      font-size:13px;
    }

    .route-search-card {
      border:1px solid var(--line);
      background:#fff;
      border-radius:10px;
      padding:8px 16px;
      margin-bottom:14px;
    }

    .route-node {
      display:grid;
      grid-template-columns:18px 1fr;
      gap:12px;
      align-items:center;
    }

    .route-node .field {
      margin-bottom:0;
    }

    .route-node input {
      border:none;
      box-shadow:none;
      padding-left:0;
      height:54px;
    }

    .route-node input:focus {
      box-shadow:none;
    }

    .route-node label {
      margin-bottom:0;
      color:var(--muted);
    }

    .node-dot {
      width:10px;
      height:10px;
      border-radius:50%;
      display:block;
      margin-left:4px;
    }

    .origin-dot {
      background:var(--ink);
    }

    .dest-dot {
      background:var(--brand);
    }

    .route-divider {
      height:1px;
      background:#eef2f7;
      margin:2px 0 2px 30px;
    }

    .suggestions {
      position:absolute;
      z-index:50;
      width:100%;
      background:white;
      border:1px solid var(--line);
      border-radius:6px;
      box-shadow:0 14px 40px rgba(31,41,55,.12);
      overflow:hidden;
      margin-top:8px;
      display:none;
    }

    .suggestions div {
      padding:13px 15px;
      border-bottom:1px solid #f3f4f6;
      cursor:pointer;
      font-size:14px;
    }

    .suggestions div:hover {
      background:var(--warning);
    }

    .suggestions strong {
      display:block;
      color:var(--ink);
    }

    .suggestions span {
      color:var(--muted);
      font-size:12px;
    }

    .quick-options {
      display:flex;
      gap:10px;
      flex-wrap:wrap;
      margin-top:14px;
    }

    .quick-option {
      background:#fff;
      border:1px solid var(--line);
      border-radius:8px;
      padding:12px 14px;
      text-align:left;
      min-width:150px;
    }

    .quick-option strong {
      display:block;
      font-size:14px;
      color:var(--ink);
    }

    .quick-option span {
      display:block;
      font-size:12px;
      color:var(--muted);
      margin-top:2px;
    }

    .quick-option.active {
      border-color:var(--brand);
      background:var(--brand);
    }

    .quick-option.active strong,
    .quick-option.active span {
      color:white;
    }

    .compact-title {
      margin-top:22px;
      margin-bottom:10px;
    }

    .map-box {
      margin-top:20px;
      border-radius:8px;
      overflow:hidden;
      border:1px solid var(--line);
      position:relative;        /* contexto para Leaflet */
    }

    #routeMap {
      height:320px;
      min-height:320px;
      width:100%;
      display:block;
      z-index:1;
    }

    .route-info {
      background:var(--ink);
      padding:14px 16px;
      color:white;
    }

    .route-cards {
      display:grid;
      grid-template-columns:1fr 1fr;
      gap:16px;
    }

    .route-card {
      background:rgba(255,255,255,.06);
      border:1px solid rgba(255,255,255,.13);
      border-radius:6px;
      padding:17px;
    }

    .route-card small {
      color:#f59e0b;
      display:block;
      margin-bottom:5px;
      font-weight:900;
    }

    .quote-card {
      position:sticky;
      top:20px;
    }

    .muted {
      color:var(--muted);
      font-size:13px;
      line-height:1.5;
    }

    .breakdown {
      margin-top:18px;
      border-top:1px solid var(--line);
      padding-top:14px;
    }

    .row {
      display:flex;
      justify-content:space-between;
      gap:20px;
      padding:11px 0;
      font-size:14px;
      border-bottom:1px solid #eef2f7;
    }

    .row span {
      color:#4b5563;
    }

    .row strong {
      text-align:right;
      font-weight:850;
      color:var(--ink);
    }

    .total-row {
      font-size:18px;
      font-weight:950;
      border-bottom:0;
    }

    .disclaimer {
      margin-top:18px;
      padding:13px;
      background:var(--warning);
      border:1px solid #fed7aa;
      border-radius:6px;
      color:#9a3412;
      font-size:12px;
      line-height:1.5;
    }

    .next-step-copy {
      visibility:hidden;
      margin-top:14px;
      color:var(--muted);
      font-size:12px;
      line-height:1.45;
    }

    .client-list {
      display:flex;
      flex-direction:column;
      gap:12px;
    }

    .client-btn {
      border:1px solid var(--line);
      background:white;
      border-radius:6px;
      padding:14px;
      text-align:left;
      color:var(--ink);
    }

    .client-btn.active {
      border-color:var(--brand);
      background:var(--warning);
    }

    .client-btn strong {
      display:block;
    }

    .client-btn span {
      display:block;
      color:var(--muted);
      font-size:12px;
      margin-top:4px;
    }

    .add-client-btn {
      width:100%;
      margin-bottom:16px;
    }

    .admin-panel-title {
      font-size:24px;
      font-weight:950;
      letter-spacing:-.025em;
      margin-bottom:6px;
    }

    .formula-box {
      background:var(--ink);
      color:white;
      border-radius:6px;
      padding:18px;
      margin-top:20px;
    }

    .formula-box p {
      color:#d1d5db;
      font-size:13px;
      line-height:1.5;
      margin-top:8px;
    }

    .tariff-preview {
      display:grid;
      grid-template-columns:repeat(4,1fr);
      gap:12px;
      margin-top:20px;
    }

    .metric {
      background:#f9fafb;
      border:1px solid var(--line);
      border-radius:6px;
      padding:15px;
    }

    .metric small {
      display:block;
      color:var(--muted);
      font-size:11px;
      font-weight:900;
      text-transform:uppercase;
      margin-bottom:6px;
    }

    .metric strong {
      font-size:20px;
    }

    .admin-actions {
      display:flex;
      gap:12px;
      margin-top:20px;
      flex-wrap:wrap;
    }

    .toast {
      position:fixed;
      right:20px;
      bottom:20px;
      background:var(--ink);
      color:white;
      padding:14px 18px;
      border-radius:6px;
      box-shadow:0 14px 40px rgba(0,0,0,.18);
      display:none;
      z-index:100;
    }

    @media(max-width:980px) {
      .grid,.admin-grid,.three-cols,.route-cards,.tariff-preview,.client-details {
        grid-template-columns:1fr;
      }
      .quote-card {
        position:relative;
        top:0;
      }
      .topbar {
        align-items:flex-start;
      }
      .topbar-center {
        display:none;
      }
      .portal-logo {
        max-width:180px;
      }
      .logout {
        margin-right:auto;
      }
      .hero h2 {
        font-size:34px;
      }
      .card {
        padding:20px;
      }
    }

    /* Ocultar panel de instrucciones de Leaflet Routing Machine */
    .leaflet-routing-container {
      display:none !important;
    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
/* ═══ LOGIN TWO-COLUMN REDESIGN ═══ */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  background: #0a0a0f;
}
.login-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 64px;
  background: #0a0a0f;
  border-right: 1px solid #1e1e2e;
}
.login-logo-left { width: 180px; margin-bottom: 48px; }
.login-headline {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  line-height: 1.1;
  color: #ffffff;
  margin: 0 0 20px;
  letter-spacing: -1px;
}
.login-sub {
  font-size: 1rem;
  color: #6b7280;
  line-height: 1.7;
  max-width: 420px;
  margin: 0 0 36px;
}
.login-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.login-tags span {
  border: 1px solid #2a2a3e;
  color: #a0a0b8;
  padding: 7px 16px;
  border-radius: 50px;
  font-size: 0.82rem;
  background: #13131f;
}
.login-right {
  width: 460px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 48px;
  background: #0d0d1a;
}
.login-card {
  width: 100%;
  max-width: 360px;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}
.login-header { margin-bottom: 28px; }
.login-body .field { margin-bottom: 16px; }
@media (max-width: 768px) {
  .login-screen { flex-direction: column; }
  .login-left { padding: 40px 28px 32px; border-right: none; border-bottom: 1px solid #1e1e2e; }
  .login-logo-left { width: 130px; margin-bottom: 28px; }
  .login-headline { font-size: 2rem; }
  .login-right { width: 100%; padding: 32px 24px; }
}

/* ═══ LOGIN LIGHT THEME OVERRIDES ═══ */
.login-screen { background: #ebebе6; }
.login-left   { background: #ebebе6; border-right-color: #e0e0da; }
.login-right  { background: #ffffff; box-shadow: -4px 0 40px rgba(0,0,0,.10), 0 0 0 1px rgba(0,0,0,.04); }
.login-headline { color: #0a0a0f; }
.login-sub    { color: #6b7280; }
.login-tags span {
  background: #ffffff;
  border-color: #e0e0da;
  color: #374151;
}
.login-tags span:hover { border-color: #e8251a; color: #e8251a; transition: all .2s; }
.login-card   { background: transparent; }
.login-body input {
  background: #f8f8f5;
  border: 1px solid #d1d5db;
  color: #0a0a0f;
}
.login-body input:focus { border-color: #e8251a; outline: none; box-shadow: 0 0 0 3px rgba(232,37,26,.1); }
.login-body label { color: #374151; }
#forgotPasswordLink { color: #e8251a !important; }

/* ═══ LOGIN HEADER FIX — quitar fondo oscuro ═══ */
.login-right .login-header {
  background: transparent;
  color: #0a0a0f;
  padding: 0 0 24px 0;
  border-bottom: 1px solid #e5e5e0;
  margin-bottom: 24px;
}
.login-right .login-header h1,
.login-right .login-header h2 {
  color: #0a0a0f;
}
.login-right .login-header p {
  color: #6b7280;
}
.login-right .login-card {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
}


.login-value-list {
  list-style: none;
  padding: 0;
  margin: 32px 0 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.login-value-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: #4a4a42;
  font-size: 0.9rem;
  line-height: 1.5;
}
.login-value-list li svg {
  flex-shrink: 0;
  margin-top: 2px;
}
.login-value-list li span {
  font-weight: 400;
  letter-spacing: 0.01em;
}

.login-eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #e8251a;
  margin: 0 0 16px;
}

.login-value-list li span strong {
  color: #1a1a2e;
  font-weight: 700;
}
.login-value-list li span {
  color: #5a5a52;
}

@media print {
  body * { visibility: hidden; }
  #printFrame, #printFrame * { visibility: visible; }
  #printFrame {
    position: fixed !important;
    inset: 0 !important;
    background: #fff !important;
    z-index: 999999 !important;
    padding: 0 !important;
    margin: 0 !important;
  }
}
