﻿:root{
  /* Base look (como referencia Persyvex): fondo gris suave + cards blancas */
  --bg:#f6f7f9;
  --text:#111827;
  --muted:#6b7280;
  --border:#e9edf3;
  --card:#ffffff;

  /* Brand */
  --red:#d0021b;

  /* Shape + shadow (muy sutil, elegante) */
  --radius:12px;
  --shadow: 0 1px 1px rgba(16,24,40,.04), 0 8px 22px rgba(16,24,40,.06);

  /* Typography */
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.login-page{min-height:100%;background:#eef1f5;display:grid;place-items:center;padding:24px}
.login-shell{width:min(100%,420px)}
.login-panel{background:#fff;border:1px solid #dde3eb;border-top:4px solid var(--red);border-radius:14px;box-shadow:0 18px 50px rgba(17,24,39,.12);padding:34px}
.login-brand{height:46px;margin-bottom:30px}
.login-brand img{display:block;width:100%;height:100%;object-fit:contain;object-position:left center}
.login-panel h1{font-size:24px;line-height:1.2;margin:0 0 8px}
.login-panel>p{color:var(--muted);line-height:1.55;margin:0 0 24px}
.login-form{display:grid;gap:8px}
.login-form label{font-size:14px;font-weight:700;margin-top:8px}
.login-form input{width:100%;height:44px;border:1px solid #cfd6e0;border-radius:9px;padding:0 12px;font:inherit;color:var(--text);background:#fff}
.login-form input:focus{outline:3px solid rgba(208,2,27,.14);border-color:var(--red)}
.login-form .btn{height:44px;margin-top:16px;justify-content:center}
.login-error{border:1px solid #fecaca;background:#fff1f2;color:#9f1239;border-radius:9px;padding:10px 12px;margin-bottom:16px}
@media (max-width:480px){.login-panel{padding:26px 22px}.login-page{padding:14px}}

.wrap{
  max-width: 1220px;
  margin: 22px auto;
  padding: 0 22px;
}

/* Header top row */
.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding: 16px 18px;
  border:1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.brandmark{
  display:block;
  flex:0 0 260px;
  width:260px;
  height:34px;
  text-decoration:none;
  background: url('/static/logo.svg?v=20260317-2') left center / contain no-repeat;
}

.sr-only{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0, 0, 0, 0);
  white-space:nowrap;
  border:0;
}

.top-actions{ display:flex; gap:10px; align-items:center; }

.quick-order-form{
  display:flex;
  align-items:center;
  gap:8px;
}

.quick-order-input{
  width:130px;
  padding: 10px 12px;
  border-radius: 10px;
  border:1px solid #dbe1ea;
  font-size:14px;
  background:#fff;
}

.quick-order-input:focus{
  outline:none;
  border-color: rgba(208,2,27,.40);
  box-shadow: 0 0 0 4px rgba(208,2,27,.08);
}

.quick-order-form .btn{
  padding: 10px 12px;
}

@media (max-width: 900px){
  .topbar{ flex-wrap:wrap; gap:10px; }
  .brandmark{ flex-basis:220px; width:220px; height:28px; }
  .top-actions{ width:100%; justify-content:flex-end; }
}

/* Tabs row (debajo, con underline en activo) */
.tabsbar{
  margin-top: 10px;
  border:1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.nav{
  display:flex;
  gap: 18px;
  align-items:center;
  padding: 12px 16px 0 16px;
  border-bottom: 1px solid var(--border);
}

.navlink{
  text-decoration:none;
  color:#6b7280;
  padding: 12px 2px;
  font-weight:600;
  font-size:14px;
}

.navlink:hover{ color:#374151; }

.navlink.active{
  color: var(--red);
  box-shadow: inset 0 -2px 0 var(--red);
}

/* Main content card */
.card{
  margin-top: 16px;
  padding: 18px;
  border:1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

h1{
  margin:0;
  font-size:22px;
  line-height:1.2;
  font-weight:700;
  letter-spacing:-.2px;
}

.muted{ color:var(--muted); font-size:14px; line-height:1.45; }
.mono{ font-family: var(--mono); }

/* Table */
.tablewrap{ overflow:auto; }

.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
}

.table thead th{
  background:#f8fafc;
  color:#6b7280;
  font-weight:700;
  font-size:12px;
  letter-spacing:.6px;
  text-transform:uppercase;
  border-bottom:1px solid var(--border);
  padding: 12px 12px;
}

.client-table thead th{
  font-size:10px;
  padding:10px 8px;
  letter-spacing:.5px;
}

.table td{
  border-bottom:1px solid var(--border);
  padding: 14px 12px;
  font-size:14px;
  color:#111827;
  vertical-align:middle;
}

.table tbody tr:hover td{ background:#fafafa; }

.table td strong{ font-weight:600; }

.center{ text-align:center; }

/* Buttons */
.btn,
.action-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding: 10px 14px;
  border-radius: 10px;
  border:1px solid #dbe1ea;
  text-decoration:none;
  cursor:pointer;
  font-weight:600;
  font-size:14px;
  background:#fff;
  color:#374151;
  line-height:1;
  transition: background .12s ease, border-color .12s ease, filter .12s ease, transform .04s ease;
}

.btn:hover,
.action-btn:hover{
  background:#f9fafb;
  border-color:#cfd7e3;
}

.btn:active,
.action-btn:active{ transform: translateY(1px); }

.btn.primary{
  background: var(--red);
  border-color: var(--red);
  color:#fff;
  box-shadow: 0 8px 18px rgba(208,2,27,.14);
}

.btn.primary:hover{ filter: brightness(.96); }

.btn.secondary{ background:#fff; }

.status-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:2px 7px;
  border-radius:999px;
  border:1px solid transparent;
  font-size:10px;
  font-weight:700;
  letter-spacing:.2px;
  text-transform:uppercase;
  white-space:nowrap;
  line-height:1;
}

.status-pending{
  background:#fef3c7;
  color:#92400e;
  border-color:#fcd34d;
}

.status-scheduled{
  background:#dbeafe;
  color:#1d4ed8;
  border-color:#93c5fd;
}

.status-delivered{
  background:#dcfce7;
  color:#166534;
  border-color:#86efac;
}

.status-fechar{
  background:#fce7f3;
  color:#be185d;
  border-color:#f9a8d4;
}

.status-meta{
  margin-top:4px;
  font-size:12px;
}

.order-id-block{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:5px;
}

.queue-status-badges{
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
}

.bulk-toolbar{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin: 12px 0 14px;
  padding: 12px 14px;
  border:1px solid var(--border);
  border-radius: 12px;
  background:#f8fafc;
}

.bulk-count{
  color:#4b5563;
  font-size:13px;
  font-weight:700;
}

.bulk-inline{
  display:inline-flex;
  align-items:center;
  gap:8px;
  color:#4b5563;
  font-size:13px;
  font-weight:600;
}

.bulk-inline input[type="date"],
.bulk-toolbar input[type="date"]{
  padding: 9px 12px;
  border-radius: 10px;
  border:1px solid #dbe1ea;
  font-size:14px;
  background:#fff;
}

.row-select{
  width:16px;
  height:16px;
  cursor:pointer;
}


/* Forms */
.pagehead{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  margin-bottom: 14px;
}

.head-actions{ display:flex; gap:10px; }

.formlist{
  display:flex;
  flex-direction:column;
  gap: 10px;
  margin-top: 14px;
}

.row{
  display:grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  padding: 12px 12px;
  border:1px solid var(--border);
  border-radius: 12px;
  background:#fff;
}

.label{
  color:#374151;
  font-weight:700;
  font-size:13px;
  padding-top: 8px;
}

.field input, select{
  width:100%;
  padding: 10px 12px;
  border-radius: 10px;
  border:1px solid #dbe1ea;
  font-size:14px;
  background:#fff;
}

.field input::placeholder{ color:#9aa4b2; }

.field input:focus, select:focus{
  outline:none;
  border-color: rgba(208,2,27,.40);
  box-shadow: 0 0 0 4px rgba(208,2,27,.08);
}

.actions.bottom{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top: 10px;
}

.foot{
  margin-top: 14px;
  text-align:center;
  color: var(--muted);
  font-size: 12px;
}


.section-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:16px;
  flex-wrap:wrap;
  margin-bottom:16px;
}

.page-subtitle{
  margin:6px 0 0 0;
}

.toolbar-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:14px;
}

.inline-form{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}

.field-input,
.form-field input,
.form-field select,
.form-field textarea{
  min-height:42px;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid #dbe1ea;
  font-size:14px;
  background:#fff;
  color:#111827;
  width:100%;
}

.field-input:focus,
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus{
  outline:none;
  border-color: rgba(208,2,27,.22);
  box-shadow: 0 0 0 4px rgba(208,2,27,.08);
}

.btn-sm{
  padding:8px 12px;
  font-size:13px;
  border-radius:10px;
}

.btn-danger-soft{
  background:#fff;
  border-color:#fecaca;
  color:#b91c1c;
}

.btn-danger-soft:hover{
  background:#fef2f2;
  border-color:#fca5a5;
}

.actions-inline{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}

.client-actions{
  gap:4px;
  flex-wrap:nowrap;
  white-space:nowrap;
  justify-content:flex-end;
}


.client-actions form{
  display:inline-flex !important;
}

.client-actions .btn-sm{
  padding:4px 6px;
  font-size:9px;
  min-height:26px;
  min-width:auto;
  border-radius:8px;
}


.client-table td:last-child{
  width:250px;
  min-width:250px;
  white-space:nowrap;
}



.client-table td:nth-child(5){
  width:48px;
  white-space:nowrap;
  text-align:center;
}


@media (max-width: 1100px){
  .clients-toolbar{
    flex-wrap:wrap;
  }

  .clients-search-form{
    flex-wrap:wrap;
  }

  .clients-search-input{
    width:260px;
    min-width:260px;
  }

  .client-actions{
    flex-wrap:wrap;
  }

  .client-phone{
    width:auto;
    max-width:none;
  }

  .client-table td:last-child{
    width:auto;
    min-width:0;
  }

  .client-table td:last-child{
    width:auto;
    min-width:0;
  }
}

.note-card{
  padding:12px 14px;
  margin-bottom:14px;
}

.geo-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:28px;
  padding:3px 6px;
  border-radius:999px;
  border:1px solid transparent;
  font-size:9px;
  font-weight:700;
  letter-spacing:.02em;
  text-transform:uppercase;
}


.geo-pill.ok{
  color:#166534;
  background:#f0fdf4;
  border-color:#bbf7d0;
}

.geo-pill.no{
  color:#991b1b;
  background:#fef2f2;
  border-color:#fecaca;
}

.form-grid-2{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:14px 16px;
}

.form-field{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.form-field label,
.form-field-title{
  font-size:13px;
  font-weight:700;
  color:#374151;
}

.form-field-wide{
  grid-column:1 / -1;
}

.client-table td{
  vertical-align:top;
  padding:10px 8px;
  font-size:12px;
  line-height:1.3;
}

.client-table .mono{
  font-size:11px;
}


.clients-head{
  margin-bottom:10px;
}

.clients-toolbar{
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  flex-wrap:nowrap;
}



.clients-search-form{
  flex-wrap:nowrap;
  min-width:0;
  align-items:center;
  gap:6px;
}


.clients-search-input{
  width:300px;
  min-width:300px;
}



.clients-new-btn{
  white-space:nowrap;
}

.client-address{
  max-width:330px;
  font-size:11px;
  line-height:1.2;
}

.client-phone{
  max-width:60px;
  width:60px;
  font-size:9px !important;
  line-height:1.1;
  white-space:normal;
  word-break:break-word;
}



.client-code-meta{
  display:block;
  margin-top:3px;
  font-size:12px;
  color:#6b7280;
}

.filter-pills{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:14px;
}

.bulk-toolbar{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  padding:12px 14px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#f8fafc;
}

.bulk-toolbar .bulk-count{
  font-size:13px;
  font-weight:700;
}

.bulk-toolbar .bulk-inline{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size:13px;
}

.bulk-toolbar input[type="date"]{
  min-width:145px;
}

@media (max-width: 900px){
  .form-grid-2{
    grid-template-columns: 1fr;
  }
}

/* Final authoritative layout for Clients list */
.clients-toolbar{
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  flex-wrap:nowrap;
}

.clients-search-form{
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:nowrap;
  min-width:0;
}

.clients-search-input{
  width:180px;
  min-width:180px;
}

.clients-new-btn{
  white-space:nowrap;
}

.client-table{
  table-layout:fixed;
}

.client-table thead th{
  font-size:10px;
  padding:10px 8px;
  letter-spacing:.5px;
}

.client-table td{
  vertical-align:top;
  padding:10px 8px;
  font-size:12px;
  line-height:1.25;
}

.client-table .mono{
  font-size:11px;
}

.client-table th:nth-child(1),
.client-table td:nth-child(1){
  width:20%;
}

.client-table th:nth-child(2),
.client-table td:nth-child(2){
  width:5%;
}

.client-table th:nth-child(3),
.client-table td:nth-child(3){
  width:27%;
}

.client-table th:nth-child(4),
.client-table td:nth-child(4){
  width:9%;
}

.client-table th:nth-child(5),
.client-table td:nth-child(5){
  width:4%;
  text-align:center;
  white-space:nowrap;
}

.client-table th:nth-child(6),
.client-table td:nth-child(6){
  width:14%;
}

.client-table th:nth-child(7),
.client-table td:nth-child(7){
  width:21%;
  min-width:180px;
}

.client-address{
  font-size:10px;
  line-height:1.15;
  color:#334155;
  word-break:break-word;
}

.client-phone{
  width:60px;
  max-width:60px;
  font-size:10px !important;
  line-height:1.15;
  color:#475569;
  white-space:normal;
  word-break:break-word;
}

.client-extra-info{
  font-size:10px;
  line-height:1.15;
  color:#475569;
  word-break:break-word;
}

.geo-pill{
  min-width:24px;
  padding:2px 5px;
  font-size:9px;
}

.client-table td:last-child,
.client-table th:last-child{
  vertical-align:middle;
  text-align:center;
}

.client-actions{
  display:inline-grid !important;
  grid-template-columns:repeat(4, max-content);
  align-items:center;
  justify-content:center;
  column-gap:3px;
  row-gap:0;
  white-space:nowrap;
  margin:0 auto;
}

.client-actions > a,
.client-actions > form{
  display:flex !important;
  align-items:center;
  justify-content:center;
  margin:0;
}

.client-actions form{
  margin:0 !important;
}

.client-actions .btn-sm,
.client-actions form .btn-sm{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:26px;
  min-height:26px;
  line-height:1;
  padding:0 7px;
  min-width:0;
  font-size:9px;
  border-radius:8px;
}

@media (max-width: 1100px){
  .clients-toolbar,
  .clients-search-form{
    flex-wrap:wrap;
  }

  .clients-search-input{
    width:240px;
    min-width:240px;
  }

  .client-table{
    table-layout:auto;
  }

  .client-table th:nth-child(7),
  .client-table td:nth-child(7){
    width:auto;
    min-width:0;
  }

  .client-actions{
    flex-wrap:wrap;
  }

  .client-phone{
    width:auto;
    max-width:none;
  }
}

/* Planner */
.planner-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin-bottom:16px;
  flex-wrap:wrap;
}

.planner-tools{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:nowrap;
  justify-content:flex-end;
}

.planner-holiday-form,
.planner-month-form{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:nowrap;
}

.planner-tool-label{
  font-size:12px;
}

.planner-tools .btn{
  white-space:nowrap;
}

.planner-holiday-btn.is-remove{
  border-color:#fecaca;
  color:#b91c1c;
  background:#fff;
}

.grid-month{
  display:grid;
  grid-template-columns: repeat(7, 1fr);
  gap:10px;
}

.dow{
  font-size:12px;
  color:#6b7280;
  padding:0 2px;
}

.day{
  background:white;
  border:1px solid #e5e7eb;
  border-radius:14px;
  padding:12px;
  min-height:110px;
}

.day.holiday-day{
  border-color:#fca5a5;
  background:#fff5f5;
}

.day.empty{
  background:transparent;
  border:0;
}

.day-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}

.day-num{
  font-size:14px;
  font-weight:600;
  color:#111827;
}

.pill{
  font-size:12px;
  padding:4px 8px;
  border-radius:999px;
  border:1px solid #e5e7eb;
  color:#111827;
  background:#f9fafb;
  white-space:nowrap;
}

.day-body{
  margin-top:10px;
}

.holiday-tag{
  color:#b91c1c;
  font-size:12px;
  font-weight:800;
  letter-spacing:0.03em;
  margin-bottom:8px;
}

.planner-long-alert{
  display:inline-flex;
  align-items:center;
  gap:6px;
  margin-bottom:8px;
  padding:4px 8px;
  border-radius:999px;
  background:#fff1f2;
  border:1px solid #fb7185;
  color:#9f1239;
  font-size:11px;
  font-weight:800;
  letter-spacing:0.02em;
  box-shadow:0 4px 12px rgba(225, 29, 72, 0.12);
}

.planner-long-icon{
  font-size:14px;
  line-height:1;
}

.planner-route-link{
  display:inline-flex;
  align-items:center;
  gap:6px;
}

.planner-route-warn{
  color:#ca8a04;
  font-size:13px;
  line-height:1;
  flex:0 0 auto;
}

.primary-link{
  color:#b91c1c;
  text-decoration:none;
  font-weight:600;
  font-size:13px;
}

.primary-link:hover{
  text-decoration:underline;
}

.primary-link:visited{
  color:#b91c1c;
}

.primary-link-complete{
  color:#15803d;
}

.primary-link-complete:hover{
  color:#166534;
}

.primary-link-complete:visited{
  color:#15803d;
}

.primary-link-contracted{
  color:#2563eb;
}

.primary-link-contracted:hover{
  color:#1d4ed8;
}

.primary-link-contracted:visited{
  color:#2563eb;
}

.planner-route-link.primary-link-contracted,
.planner-route-link.primary-link-contracted span{
  color:#2563eb;
}

.planner-route-link.primary-link-contracted:hover,
.planner-route-link.primary-link-contracted:hover span{
  color:#1d4ed8;
}

.planner-route-link.primary-link-contracted:visited,
.planner-route-link.primary-link-contracted:visited span{
  color:#2563eb;
}

.planner-route-link.primary-link-complete,
.planner-route-link.primary-link-complete span{
  color:#15803d;
}

.planner-route-link.primary-link-complete:hover,
.planner-route-link.primary-link-complete:hover span{
  color:#166534;
}

.planner-route-link.primary-link-complete:visited,
.planner-route-link.primary-link-complete:visited span{
  color:#15803d;
}

@media (max-width: 1100px){
  .planner-tools{
    justify-content:flex-start;
    flex-wrap:wrap;
  }

  .planner-holiday-form,
  .planner-month-form{
    flex-wrap:wrap;
  }
}

/* Route day */
.route-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.route-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.route-summary-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.route-summary-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #4b5563;
  font-size: 14px;
  font-weight: 600;
}

.route-summary-name-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

.route-summary-dual-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.route-summary-name-line{
  flex:1 1 420px;
}

.route-summary-input {
  width: 100px;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid #d6deea;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
}

.route-summary-input-agency {
  width: 150px;
}

.route-summary-input-name{
  width:min(100%, 280px);
}

.route-contracted-btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-weight:700;
}

.route-contracted-btn.is-active{
  border-color:#60a5fa;
  background:#2563eb;
  color:#fff;
  box-shadow:0 8px 18px rgba(37, 99, 235, 0.20);
}

.route-contracted-btn.is-active:hover{
  background:#1d4ed8;
  color:#fff;
}

.route-contracted-check{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:20px;
  height:20px;
  border-radius:999px;
  background:#16a34a;
  color:#fff;
  font-size:13px;
  line-height:1;
}

.route-summary-total strong {
  font-size: 16px;
  color: #111827;
}

.route-submit-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.route-primary-actions {
  margin-bottom: 6px;
}

.route-bulk-actions {
  justify-content: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
}

.route-bulk-actions.is-hidden {
  display: none;
}

.route-bulk-actions .bulk-count {
  font-size: 13px;
  font-weight: 700;
}

.route-bulk-actions .bulk-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.route-bulk-actions input[type="date"] {
  min-width: 140px;
}

.holiday-route-alert {
  margin-bottom: 14px;
  padding: 11px 14px;
  border: 1px solid #fecaca;
  border-radius: 12px;
  background: #fef2f2;
  color: #991b1b;
  font-weight: 700;
}

.drag-handle {
  cursor: grab;
  user-select: none;
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  display: inline-block;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(0,0,0,0.03);
}

.dragging {
  opacity: 0.5;
}

.drop-target {
  outline: 2px dashed rgba(0,0,0,0.25);
  outline-offset: -6px;
}

.order-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.12);
  background: rgba(0,0,0,0.03);
  font-weight: 700;
}

.warn {
  color: #b45309;
  font-weight: 700;
}

.route-day-table {
  width: 100%;
  table-layout: fixed;
}

.route-day-table th {
  font-size: 10px;
  letter-spacing: 0.04em;
  padding: 10px 4px;
}

.route-day-table td {
  vertical-align: top;
  padding: 12px 4px;
  font-size: 11px;
  line-height: 1.35;
}

.route-day-table .status-badge {
  font-size: 8px;
  padding: 2px 6px;
}

.route-day-table .status-meta {
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.2;
}

.route-day-table .btn.secondary {
  padding: 7px 6px;
  font-size: 10px;
}

.route-compact {
  font-size: 11px;
  line-height: 1.35;
  word-break: break-word;
}

.order-id-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.route-col-pedido { width: 9%; }
.route-col-ref { width: 8%; }
.route-col-client { width: 13%; }
.route-col-address { width: 17%; }
.route-col-phone {
  width: 5.5%;
  font-size: 8.5px;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.15;
}

.route-col-packages {
  width: 3%;
  white-space: nowrap;
  text-align: center;
}

.route-col-km { width: 5%; }
.route-col-time { width: 7%; }
.route-col-day { width: 4%; }
.route-col-visit-time { width: 7%; }

.route-subline {
  margin-top: 4px;
  font-size: 10px;
  opacity: 0.72;
}

.route-col-actions {
  width: 4%;
  white-space: nowrap;
  text-align: center;
}

.route-col-km,
.route-col-time,
.route-col-packages,
.route-col-day,
.route-col-visit-time {
  text-align: center;
}

.route-day-table th.route-col-phone,
.route-day-table td.route-col-phone {
  padding-right: 16px;
}

.route-day-table th.route-col-packages,
.route-day-table td.route-col-packages {
  padding-left: 16px;
}

.route-inline-select,
.route-inline-time,
.route-inline-num {
  width: 100%;
  min-height: 28px;
  padding: 4px 2px;
  font-size: 10px;
}

@media (max-width: 960px) {
  .route-head {
    flex-direction: column;
    align-items: stretch;
  }

  .route-actions,
  .route-submit-actions {
    justify-content: flex-start;
  }
}

/* Edit order */
.edit-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:2px;
}

.edit-title-wrap{
  min-width:0;
}

.order-number{
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:8px;
  font-size:28px;
  font-weight:800;
  letter-spacing:.2px;
}

.head-actions{
  display:flex;
  align-items:flex-start;
  gap:8px;
  flex-wrap:wrap;
}

.delivery-quick{
  display:flex;
  align-items:flex-start;
  gap:6px;
  flex-wrap:wrap;
}

.delivery-toggle{
  display:flex;
  align-items:center;
  gap:6px;
  white-space:nowrap;
}

.delivery-toggle input{
  width:16px;
  height:16px;
  margin:0;
}

.delivery-date-wrap{
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width:138px;
  font-size:12px;
}

.delivery-date-wrap input{
  min-width:138px;
  max-width:138px;
  min-height:32px;
  padding:6px 8px;
}

.order-status-meta{
  margin-top:6px;
  font-size:13px;
}

.order-form{
  margin-top:18px;
}

.whatsapp-inline-form{
  display:flex;
  align-items:center;
  gap:8px;
  flex:1;
  min-width:0;
  max-width:720px;
}

.whatsapp-inline-label{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:12px;
  font-weight:800;
  color:#334155;
  letter-spacing:.04em;
  text-transform:uppercase;
  white-space:nowrap;
}

.whatsapp-mini-icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:16px;
  height:16px;
  border-radius:999px;
  background:#25d366;
  color:#fff;
  flex:0 0 auto;
}

.whatsapp-mini-icon svg{
  width:11px;
  height:11px;
}

.whatsapp-inline-input{
  width:100%;
  min-width:0;
  min-height:36px;
  padding:7px 10px;
  border:1px solid #d6deea;
  border-radius:8px;
  background:#fff;
  font:inherit;
}

.whatsapp-inline-input:focus{
  outline:none;
  border-color:#93c5fd;
  box-shadow:0 0 0 3px rgba(147,197,253,.18);
}

.whatsapp-inline-btn{
  min-height:36px;
  white-space:nowrap;
}

@media (max-width: 980px){
  .whatsapp-inline-form{
    flex-direction:column;
    align-items:stretch;
    max-width:none;
  }
}

.form-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:14px 22px;
}

.form-column{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.form-row{
  display:grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap:9px;
  align-items:center;
}

.form-row-label{
  font-size:12px;
  font-weight:700;
  color:#4b5563;
}

.form-row-control{
  min-width:0;
}

.form-row-control input,
.form-row-control select{
  width:100%;
  min-height:32px;
  padding:6px 9px;
  border:1px solid #d6deea;
  border-radius:8px;
  background:#fff;
  box-shadow:none;
}

.form-row-control input:focus,
.form-row-control select:focus{
  outline:none;
  border-color:#93c5fd;
  box-shadow:0 0 0 3px rgba(147,197,253,.18);
}

.client-hint{
  font-size:12px;
  margin-top:6px;
}

.habitual-card{
  margin-top:12px;
  padding:12px 14px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fafafa;
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
}

.habitual-title{
  font-size:12px;
  color:#6b7280;
  text-transform:uppercase;
  letter-spacing:.05em;
}

.habitual-text{
  margin-top:4px;
}

.habitual-meta{
  margin-top:6px;
  font-size:13px;
}

.order-actions{
  margin-top:14px;
  display:flex;
  gap:8px;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
}

.edit-main-btn{
  min-width:76px;
  min-height:34px;
  padding:8px 12px;
}

.edit-main-btn-save{
  color:#166534;
  border-color:#86efac;
  background:#fff;
  box-shadow:none;
}

.edit-main-btn-save:hover{
  background:#f0fdf4;
  border-color:#86efac;
}

.edit-main-btn-danger{
  color:#b91c1c;
  border-color:#fecaca;
  background:#fff;
}

.edit-main-btn-danger:hover{
  background:#fef2f2;
  border-color:#fca5a5;
}

.edit-back-btn{
  min-height:34px;
  padding:8px 14px;
}

.packages-card .table th{
  font-size:11px;
  color:#64748b;
  letter-spacing:.03em;
}

.packages-card .table td{
  padding-top:10px;
  padding-bottom:10px;
  font-size:12px;
  line-height:1.2;
  color:#475569;
}

.packages-card .table td.mono{
  font-size:12px;
}

.section-title{
  font-size:20px;
}

.packages-card hr{
  margin:18px 0;
}

.packages-card .secondary,
.packages-card .primary,
.packages-card .btn{
  min-height:32px;
  padding:7px 12px;
}

.pkg-actions-cell{
  text-align:right;
}

.pkg-row-actions{
  display:inline-flex;
  justify-content:flex-end;
  gap:6px;
  width:100%;
}

.pkg-row-btn{
  min-height:28px;
  padding:6px 10px;
  font-size:12px;
}

.pkg-row-btn-danger{
  color:#b91c1c;
  border-color:#fecaca;
  background:#fff;
}

.pkg-row-btn-danger:hover{
  background:#fef2f2;
  border-color:#fca5a5;
}

.packages-card input,
.packages-card select{
  min-height:34px;
  padding:7px 10px;
  border:1px solid #d6deea;
  border-radius:8px;
}

.rowgrid{
  display:grid;
  grid-template-columns: repeat(7, minmax(0,1fr));
  gap:10px;
}

.rowgrid label{
  display:flex;
  flex-direction:column;
  gap:6px;
}

@media (max-width: 980px){
  .edit-head{
    align-items:stretch;
    flex-direction:column;
  }

  .head-actions{
    justify-content:space-between;
    align-items:center;
  }

  .form-grid{
    grid-template-columns: 1fr;
    gap:12px;
  }

  .habitual-card{
    flex-direction:column;
  }
}

@media (max-width: 720px){
  .form-row{
    grid-template-columns: 1fr;
    gap:6px;
  }

  .rowgrid{
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
}


/* Orders page */
.orders-head{
  margin-bottom:10px;
}

.orders-toolbar-row{
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  flex-wrap:nowrap;
}

.orders-search-form{
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:nowrap;
  min-width:0;
}

.orders-search-input{
  width:280px;
  min-width:280px;
}

.orders-filter-select{
  width:110px;
  min-width:110px;
}

.orders-date-input{
  width:145px;
  min-width:145px;
}

.orders-clear-btn{
  white-space:nowrap;
}

.orders-results-inline{
  margin-left:8px;
  font-size:12px;
  white-space:nowrap;
}

.orders-bulk-actions{
  margin-top:0;
  margin-bottom:12px;
}

.queue-table{
  table-layout:fixed;
}

.queue-table thead th{
  font-size:10px;
  padding:10px 8px;
  letter-spacing:.5px;
}

.queue-table td{
  vertical-align:top;
  padding:9px 8px;
  font-size:12px;
  line-height:1.2;
}

.queue-table .mono{
  font-size:11px;
}

.queue-table th:nth-child(1),
.queue-table td:nth-child(1){
  width:4%;
}

.queue-table th:nth-child(2),
.queue-table td:nth-child(2){
  width:15%;
}

.queue-table th:nth-child(3),
.queue-table td:nth-child(3){
  width:16%;
}

.queue-table th:nth-child(4),
.queue-table td:nth-child(4){
  width:22%;
}

.queue-table th:nth-child(5),
.queue-table td:nth-child(5){
  width:9%;
}

.queue-table th:nth-child(6),
.queue-table td:nth-child(6){
  width:23%;
}

.queue-table th:nth-child(7),
.queue-table td:nth-child(7){
  width:11%;
  min-width:92px;
}

.queue-table td:nth-child(3){
  font-size:11px;
  line-height:1.15;
  color:#334155;
  word-break:break-word;
}

.queue-table td:nth-child(4){
  font-size:11px;
  line-height:1.15;
}

.queue-table td:nth-child(4) strong{
  font-weight:700;
}

.queue-table .order-id-block{
  gap:3px;
}

.queue-table .queue-status-badges{
  gap:4px;
}

.queue-table .status-meta{
  margin-top:3px;
  font-size:11px;
}

.queue-table form{
  gap:6px !important;
}

.queue-table input[type="date"]{
  min-height:30px;
  padding:5px 8px;
  font-size:12px;
}

.queue-table .btn{
  min-height:30px;
  padding:6px 10px;
}

.orders-table{
  table-layout:fixed;
}

.orders-table thead th{
  font-size:10px;
  padding:10px 8px;
  letter-spacing:.5px;
}

.orders-table td{
  vertical-align:top;
  padding:10px 8px;
  font-size:12px;
  line-height:1.25;
}

.orders-table .mono{
  font-size:11px;
}

.orders-table th:nth-child(1),
.orders-table td:nth-child(1){
  width:4%;
}

.orders-table th:nth-child(2),
.orders-table td:nth-child(2){
  width:12%;
}

.orders-table th:nth-child(3),
.orders-table td:nth-child(3){
  width:17%;
}

.orders-table th:nth-child(4),
.orders-table td:nth-child(4){
  width:22%;
}

.orders-table th:nth-child(5),
.orders-table td:nth-child(5){
  width:11%;
}

.orders-table th:nth-child(6),
.orders-table td:nth-child(6),
.orders-table th:nth-child(7),
.orders-table td:nth-child(7){
  width:12%;
}

.orders-table th:nth-child(8),
.orders-table td:nth-child(8){
  width:10%;
  min-width:90px;
}

.orders-ref{
  font-size:11px;
  line-height:1.15;
  color:#334155;
  word-break:break-word;
}

.orders-client{
  font-size:11px;
  line-height:1.15;
}

.orders-date-cell{
  white-space:nowrap;
}

.orders-table td:last-child,
.orders-table th:last-child{
  vertical-align:middle;
  text-align:center;
}

.orders-actions{
  display:inline-grid !important;
  grid-template-columns:repeat(1, max-content);
  align-items:center;
  justify-content:center;
  margin:0 auto;
}

.orders-actions > a,
.orders-actions > form{
  display:flex !important;
  align-items:center;
  justify-content:center;
  margin:0;
}

.orders-actions .btn-sm,
.orders-actions form .btn-sm{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:26px;
  min-height:26px;
  line-height:1;
  padding:0 7px;
  min-width:0;
  font-size:9px;
  border-radius:8px;
}

@media (max-width: 1100px){
  .orders-toolbar-row,
  .orders-search-form{
    flex-wrap:wrap;
  }

  .orders-search-input{
    width:240px;
    min-width:240px;
  }

  .orders-table{
    table-layout:auto;
  }

  .orders-results-inline{
    margin-left:0;
  }
}


.route-flags{
  display:flex;
  flex-wrap:wrap;
  gap:4px;
  margin-top:5px;
}

.route-flag{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:2px 6px;
  border-radius:999px;
  border:1px solid transparent;
  font-size:9px;
  font-weight:700;
  line-height:1;
}

.route-flag-alert{
  color:#9a3412;
  background:#fff7ed;
  border-color:#fdba74;
}

.route-flag-info{
  color:#1d4ed8;
  background:#eff6ff;
  border-color:#bfdbfe;
}

.orders-order-cell{
  min-width:120px;
}

.orders-flags{
  margin-top:4px;
}

.route-flag-client{
  color:#7c2d12;
  background:#ffedd5;
  border-color:#fdba74;
}

.route-flag-geo{
  color:#475569;
  background:#f1f5f9;
  border-color:#cbd5e1;
}

.route-flag-holiday{
  color:#991b1b;
  background:#fee2e2;
  border-color:#fca5a5;
}

.route-flag-long{
  color:#7c2d12;
  background:#fef3c7;
  border-color:#f59e0b;
}

.attachment-upload-form {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.attachment-hidden-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}





/* Statistics page */
.stats-head,
.stats-subhead{
  margin-bottom:10px;
}

.stats-kpi-grid{
  display:grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap:10px;
  margin-bottom:18px;
}

.stats-kpi-card{
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  padding:12px 14px;
}

.stats-kpi-label{
  color:#6b7280;
  font-size:10px;
  font-weight:700;
  letter-spacing:.45px;
  text-transform:uppercase;
  margin-bottom:6px;
}

.stats-kpi-value{
  color:#111827;
  font-size:16px;
  line-height:1.15;
  font-weight:700;
}

.stats-toolbar-row{
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  margin-bottom:14px;
}

.stats-month-head,
.stats-client-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.stats-month-controls,
.stats-client-controls{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.stats-client-label{
  font-size:12px;
}

.stats-client-select{
  width:150px;
  min-width:150px;
}

.stats-filter-form{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:nowrap;
}

.stats-filter-select{
  min-width:0;
}

.stats-filter-select-year{
  width:92px;
  min-width:92px;
}

.stats-filter-select-month{
  width:170px;
  min-width:170px;
}

.stats-filter-form .btn{
  white-space:nowrap;
}

.stats-table td,
.stats-table th{
  white-space:nowrap;
}

.stats-table thead th{
  padding:10px 12px;
  font-size:11px;
}

.stats-table td{
  padding:10px 12px;
  font-size:13px;
  line-height:1.15;
}

.stats-table td:first-child,
.stats-table th:first-child{
  white-space:normal;
}

.stats-row-selected td{
  background:#fff7ed;
}

@media (max-width: 1200px){
  .stats-kpi-grid{
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px){
  .stats-filter-form{
    flex-wrap:wrap;
  }

  .stats-client-head{
    align-items:flex-start;
    flex-direction:column;
  }

  .stats-kpi-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px){
  .stats-kpi-grid{
    grid-template-columns: 1fr;
  }
}




.backup-status-line{
  margin:10px 0 0 0;
  font-size:13px;
  line-height:1.35;
}

.backup-status-line.is-ok{
  color:#166534;
}

.backup-status-line.is-warning{
  color:#92400e;
}

.backup-status-path{
  color:#64748b;
  font-size:12px;
}


.stats-month-head,
.stats-client-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.stats-month-controls,
.stats-client-controls{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.stats-client-label{
  font-size:12px;
}

.stats-client-select{
  width:150px;
  min-width:150px;
}

.stats-month-table{
  table-layout:fixed;
}

.stats-month-table th:nth-child(1),
.stats-month-table td:nth-child(1){ width:14%; }

.stats-month-table th:nth-child(2),
.stats-month-table td:nth-child(2),
.stats-month-table th:nth-child(3),
.stats-month-table td:nth-child(3),
.stats-month-table th:nth-child(4),
.stats-month-table td:nth-child(4),
.stats-month-table th:nth-child(5),
.stats-month-table td:nth-child(5),
.stats-month-table th:nth-child(6),
.stats-month-table td:nth-child(6){
  width:8%;
}

.stats-month-table th:nth-child(7),
.stats-month-table td:nth-child(7),
.stats-month-table th:nth-child(8),
.stats-month-table td:nth-child(8){
  width:13%;
}

.stats-month-table th:nth-child(9),
.stats-month-table td:nth-child(9){
  width:25%;
}

.stats-month-chart-cell{
  padding-left:10px !important;
  padding-right:10px !important;
}

.stats-month-bar-track{
  position:relative;
  width:100%;
  height:12px;
  border-radius:999px;
  background:#e9eef6;
  overflow:hidden;
}

.stats-month-bar-fill{
  height:100%;
  min-width:0;
  border-radius:999px;
  background:linear-gradient(90deg, #ef4444 0%, #f97316 100%);
}

@media (max-width: 900px){
  .stats-month-head,
  .stats-client-head{
    align-items:flex-start;
    flex-direction:column;
  }
}


.stats-client-table{
  table-layout:fixed;
}

.stats-client-table th:nth-child(1),
.stats-client-table td:nth-child(1){ width:28%; }

.stats-client-table th:nth-child(2),
.stats-client-table td:nth-child(2),
.stats-client-table th:nth-child(3),
.stats-client-table td:nth-child(3),
.stats-client-table th:nth-child(4),
.stats-client-table td:nth-child(4){
  width:9%;
}

.stats-client-table th:nth-child(5),
.stats-client-table td:nth-child(5){
  width:14%;
}

.stats-client-table th:nth-child(6),
.stats-client-table td:nth-child(6){
  width:21%;
}

.stats-client-table th:nth-child(7),
.stats-client-table td:nth-child(7){
  width:10%;
}

.stats-client-chart-cell{
  padding-left:10px !important;
  padding-right:10px !important;
}

.stats-client-bar-track{
  position:relative;
  width:100%;
  height:12px;
  border-radius:999px;
  background:#edf2f7;
  overflow:hidden;
}

.stats-client-bar-fill{
  height:100%;
  min-width:0;
  border-radius:999px;
  background:linear-gradient(90deg, #ef4444 0%, #f97316 100%);
}


.stats-client-table-top10 thead th{
  padding-top:8px;
  padding-bottom:8px;
}

.stats-client-table-top10 td{
  padding-top:8px;
  padding-bottom:8px;
}


.persyvex-head{
  gap:12px;
  align-items:flex-start;
}

.persyvex-toolbar{
  justify-content:flex-end;
  gap:10px;
}

.persyvex-upload-form{
  gap:10px;
}

.persyvex-filter-form{
  gap:8px;
}

.persyvex-filter-label{
  white-space:nowrap;
}

.persyvex-filter-select{
  width:140px;
  min-width:140px;
}

.persyvex-file-input{
  width:260px;
  min-width:260px;
}

.persyvex-note{
  padding:10px 12px;
  margin-bottom:12px;
}

.persyvex-table{
  table-layout:fixed;
}

.persyvex-table thead th{
  font-size:10px;
  padding:6px 4px;
  letter-spacing:.5px;
}

.persyvex-table td{
  padding:4px 3px;
  font-size:11px;
  line-height:1.02;
  vertical-align:top;
}

.persyvex-table th:nth-child(1),
.persyvex-table td:nth-child(1){
  width:9%;
}

.persyvex-table th:nth-child(2),
.persyvex-table td:nth-child(2){
  width:20%;
}

.persyvex-table th:nth-child(3),
.persyvex-table td:nth-child(3){
  width:15%;
}

.persyvex-table th:nth-child(4),
.persyvex-table td:nth-child(4){
  width:10%;
}

.persyvex-table th:nth-child(5),
.persyvex-table td:nth-child(5){
  width:10%;
}

.persyvex-table th:nth-child(6),
.persyvex-table td:nth-child(6){
  width:8%;
}

.persyvex-table th:nth-child(7),
.persyvex-table td:nth-child(7){
  width:9%;
  text-align:center;
}

.persyvex-table th:nth-child(8),
.persyvex-table td:nth-child(8){
  width:16%;
}

.persyvex-table th:nth-child(9),
.persyvex-table td:nth-child(9){
  width:3%;
  white-space:nowrap;
  text-align:center;
}

.persyvex-cell-input{
  min-height:24px;
  padding:3px 5px;
  font-size:10px;
  line-height:1;
}

.persyvex-cell-textarea{
  min-height:30px;
  padding:3px 5px;
  font-size:10px;
  line-height:1.05;
  resize:vertical;
}

.persyvex-table input[type="date"].persyvex-cell-input{
  width:100%;
  min-width:0;
  max-width:none;
  padding:2px 4px;
  font-size:10px;
}

.persyvex-status-select{
  font-weight:700;
}

.persyvex-status-recibido{
  background:#eff6ff;
  border-color:#93c5fd;
  color:#1d4ed8;
}

.persyvex-status-procesado{
  background:#fef9c3;
  border-color:#fcd34d;
  color:#a16207;
}

.persyvex-status-en-produccion{
  background:#ecfdf5;
  border-color:#86efac;
  color:#15803d;
}

.persyvex-bottom-actions{
  margin-top:10px;
}

.persyvex-row-check{
  width:14px;
  height:14px;
  margin:0;
}

.persyvex-enrutar-btn{
  min-height:24px;
  padding:4px 8px;
  font-size:10px;
  white-space:nowrap;
}

.persyvex-text-clip{
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:3;
  line-clamp:3;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:normal;
  word-break:break-word;
  line-height:1.05;
  max-height:3.15em;
}

@media (max-width: 1100px){
  .persyvex-toolbar{
    justify-content:flex-start;
  }

  .persyvex-file-input{
    width:220px;
    min-width:220px;
  }

  .persyvex-table{
    table-layout:auto;
  }
}

.processed-head{
  align-items:center;
  margin-bottom:12px;
}

.processed-head-copy{
  display:flex;
  align-items:baseline;
  gap:14px;
  flex-wrap:wrap;
}

.processed-status-grid{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-bottom:14px;
}

.processed-status-card{
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  padding:10px 12px;
}

.processed-status-label{
  color:#6b7280;
  font-size:12px;
  font-weight:700;
  letter-spacing:.02em;
  text-transform:none;
  white-space:nowrap;
}

.processed-status-line{
  display:flex;
  align-items:baseline;
  gap:12px;
  flex-wrap:wrap;
}

.processed-status-value{
  color:#111827;
  font-size:15px;
  line-height:1.2;
  font-weight:700;
}

.processed-status-help{
  margin:0;
  flex:1 1 320px;
}

.processed-status-url{
  font-size:14px;
  word-break:break-word;
}

.processed-table td,
.processed-table th{
  vertical-align:top;
}

.processed-level{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:68px;
  padding:4px 8px;
  border-radius:999px;
  border:1px solid transparent;
  font-size:10px;
  font-weight:800;
  letter-spacing:.04em;
  line-height:1;
}

.processed-level-success{
  background:#dcfce7;
  border-color:#86efac;
  color:#166534;
}

.processed-level-info{
  background:#dbeafe;
  border-color:#93c5fd;
  color:#1d4ed8;
}

.processed-level-error{
  background:#fee2e2;
  border-color:#fca5a5;
  color:#991b1b;
}

@media (max-width: 960px){
  .processed-head{
    align-items:flex-start;
  }

  .processed-head-copy{
    flex-direction:column;
    gap:4px;
    align-items:flex-start;
  }
}

.theme-toggle{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:40px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid #d6deea;
  background:#fff;
  color:#64748b;
  cursor:pointer;
  transition:background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .04s ease;
}

.theme-toggle:hover{
  background:#f8fafc;
  border-color:#cbd5e1;
  color:#334155;
}

.theme-toggle:focus-visible{
  outline:none;
  border-color:rgba(208,2,27,.40);
  box-shadow:0 0 0 4px rgba(208,2,27,.08);
}

.theme-toggle:active{
  transform:translateY(1px);
}

.theme-toggle-track{
  position:relative;
  width:42px;
  height:24px;
  border-radius:999px;
  background:#cbd5e1;
  transition:background .18s ease;
  flex:0 0 auto;
}

.theme-toggle-thumb{
  position:absolute;
  top:3px;
  left:3px;
  width:18px;
  height:18px;
  border-radius:999px;
  background:#fff;
  box-shadow:0 1px 3px rgba(15,23,42,.25);
  transition:transform .18s ease;
}

.theme-toggle-icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:16px;
  height:16px;
  line-height:1;
  font-size:16px;
  flex:0 0 auto;
}

.theme-toggle-icon-sun{
  color:#f59e0b;
}

.theme-toggle-icon-moon{
  color:#6366f1;
}

html.theme-dark{
  color-scheme:dark;
  --bg:#0b1118;
  --text:#e7edf5;
  --muted:#98a6b8;
  --border:#283446;
  --card:#121b25;
  --shadow:0 1px 1px rgba(0,0,0,.28), 0 14px 28px rgba(0,0,0,.32);
}

html.theme-dark body{
  background:
    radial-gradient(circle at top left, rgba(59,130,246,.12), transparent 28%),
    radial-gradient(circle at top right, rgba(239,68,68,.10), transparent 24%),
    var(--bg);
  color:var(--text);
}

html.theme-dark .topbar,
html.theme-dark .tabsbar,
html.theme-dark .card,
html.theme-dark .row,
html.theme-dark .day,
html.theme-dark .stats-kpi-card,
html.theme-dark .bulk-toolbar,
html.theme-dark .route-bulk-actions,
html.theme-dark .processed-status-card,
html.theme-dark .habitual-card,
html.theme-dark .note-card,
html.theme-dark .day.empty{
  background:var(--card);
  border-color:var(--border);
  box-shadow:var(--shadow);
}

html.theme-dark .nav{
  border-bottom-color:var(--border);
}

html.theme-dark .tabsbar{
  background:rgba(18,27,37,.92);
}

html.theme-dark .muted,
html.theme-dark .page-subtitle,
html.theme-dark .status-meta,
html.theme-dark .client-code-meta,
html.theme-dark .client-hint,
html.theme-dark .habitual-title,
html.theme-dark .habitual-meta,
html.theme-dark .route-subline,
html.theme-dark .backup-status-path,
html.theme-dark .stats-kpi-label,
html.theme-dark .processed-status-label,
html.theme-dark .planner-tool-label,
html.theme-dark .orders-results-inline,
html.theme-dark .persyvex-filter-label,
html.theme-dark .backup-status-line.is-warning{
  color:var(--muted);
}

html.theme-dark .navlink{
  color:#aeb9c7;
}

html.theme-dark .navlink:hover{
  color:#e2e8f0;
}

html.theme-dark .navlink.active{
  color:#ff7b8c;
  box-shadow:inset 0 -2px 0 #ff536d;
}

html.theme-dark .btn,
html.theme-dark .action-btn,
html.theme-dark .theme-toggle{
  background:#1a2430;
  border-color:#314154;
  color:#e2e8f0;
}

html.theme-dark .btn:hover,
html.theme-dark .action-btn:hover,
html.theme-dark .theme-toggle:hover{
  background:#202c3a;
  border-color:#43566f;
}

html.theme-dark .btn.primary{
  background:#e11d48;
  border-color:#e11d48;
  color:#fff;
  box-shadow:0 10px 20px rgba(225,29,72,.22);
}

html.theme-dark .btn.primary:hover{
  background:#f43f5e;
  border-color:#f43f5e;
}

html.theme-dark .btn-danger-soft,
html.theme-dark .edit-main-btn-danger,
html.theme-dark .pkg-row-btn-danger,
html.theme-dark .planner-holiday-btn.is-remove{
  background:#2a161a;
  border-color:#7f1d1d;
  color:#fca5a5;
}

html.theme-dark .btn-danger-soft:hover,
html.theme-dark .edit-main-btn-danger:hover,
html.theme-dark .pkg-row-btn-danger:hover,
html.theme-dark .planner-holiday-btn.is-remove:hover{
  background:#351b21;
  border-color:#b91c1c;
}

html.theme-dark .edit-main-btn-save{
  background:#12261b;
  border-color:#166534;
  color:#86efac;
}

html.theme-dark .edit-main-btn-save:hover{
  background:#16301f;
  border-color:#15803d;
}

html.theme-dark .quick-order-input,
html.theme-dark .field input,
html.theme-dark select,
html.theme-dark .bulk-inline input[type="date"],
html.theme-dark .bulk-inline select,
html.theme-dark .field-input,
html.theme-dark .form-field input,
html.theme-dark .form-field select,
html.theme-dark .form-field textarea,
html.theme-dark .bulk-toolbar input[type="date"],
html.theme-dark .route-summary-input,
html.theme-dark .route-inline-select,
html.theme-dark .route-inline-time,
html.theme-dark .route-inline-num,
html.theme-dark .form-row-control input,
html.theme-dark .form-row-control select,
html.theme-dark .packages-card input,
html.theme-dark .packages-card select{
  background:#0f1722;
  border-color:#334155;
  color:#e5edf5;
}

html.theme-dark .quick-order-input::placeholder,
html.theme-dark .field input::placeholder,
html.theme-dark .form-field input::placeholder,
html.theme-dark .form-field textarea::placeholder,
html.theme-dark .packages-card input::placeholder{
  color:#7f8ea3;
}

html.theme-dark .quick-order-input:focus,
html.theme-dark .field input:focus,
html.theme-dark select:focus,
html.theme-dark .bulk-inline input[type="date"]:focus,
html.theme-dark .bulk-inline select:focus,
html.theme-dark .field-input:focus,
html.theme-dark .form-field input:focus,
html.theme-dark .form-field select:focus,
html.theme-dark .form-field textarea:focus,
html.theme-dark .bulk-toolbar input[type="date"]:focus,
html.theme-dark .route-summary-input:focus,
html.theme-dark .route-inline-select:focus,
html.theme-dark .route-inline-time:focus,
html.theme-dark .route-inline-num:focus,
html.theme-dark .form-row-control input:focus,
html.theme-dark .form-row-control select:focus,
html.theme-dark .packages-card input:focus,
html.theme-dark .packages-card select:focus{
  border-color:#60a5fa;
  box-shadow:0 0 0 4px rgba(96,165,250,.16);
}

html.theme-dark .label,
html.theme-dark .form-field label,
html.theme-dark .form-field-title,
html.theme-dark .form-row-label,
html.theme-dark .route-summary-line,
html.theme-dark .day-num,
html.theme-dark .stats-kpi-value,
html.theme-dark .processed-status-value,
html.theme-dark .client-address,
html.theme-dark .orders-ref,
html.theme-dark .orders-client,
  html.theme-dark .route-compact,
  html.theme-dark .route-col-phone,
  html.theme-dark .order-number,
  html.theme-dark .section-title{
    color:var(--text);
  }

html.theme-dark .queue-table td:nth-child(3),
html.theme-dark .queue-table td:nth-child(4){
  color:var(--text);
}

html.theme-dark .table thead th,
html.theme-dark .table td,
html.theme-dark .table tbody tr:hover td,
html.theme-dark .stats-row-selected td{
  border-bottom-color:var(--border);
}

html.theme-dark .table thead th{
  background:#17212d;
  color:#9fb0c4;
}

html.theme-dark .table td{
  color:#e5edf5;
}

html.theme-dark .table tbody tr:hover td{
  background:#16212c;
}

html.theme-dark .dow,
html.theme-dark .pill,
html.theme-dark .bulk-count,
html.theme-dark .bulk-inline,
html.theme-dark .client-phone,
html.theme-dark .client-extra-info,
html.theme-dark .orders-date-cell{
  color:#c4ceda;
}

html.theme-dark .route-submit-actions .bulk-inline,
html.theme-dark .route-bulk-actions .bulk-inline,
html.theme-dark .route-bulk-actions .bulk-count{
  color:#d3dbe6;
}

html.theme-dark .route-bulk-actions{
  background:#16202b;
  border-color:#334155;
}

html.theme-dark .route-submit-actions .btn:disabled,
html.theme-dark .route-bulk-actions .btn:disabled{
  background:#18222d;
  border-color:#2a3646;
  color:#73839a;
  box-shadow:none;
  cursor:not-allowed;
}

html.theme-dark .route-submit-actions .btn:disabled:hover,
html.theme-dark .route-bulk-actions .btn:disabled:hover{
  background:#18222d;
  border-color:#2a3646;
  color:#73839a;
}

html.theme-dark .pill,
html.theme-dark .geo-pill.no,
html.theme-dark .route-contracted-check,
html.theme-dark .drag-handle,
html.theme-dark .order-badge,
html.theme-dark .stats-month-bar-track,
html.theme-dark .stats-client-bar-track{
  background:#1b2633;
  border-color:#344256;
}

html.theme-dark .day.holiday-day{
  background:#22181b;
  border-color:#7f1d1d;
}

html.theme-dark .holiday-tag{
  color:#fca5a5;
}

html.theme-dark .day.empty{
  background:transparent;
  box-shadow:none;
}

html.theme-dark .primary-link{
  color:#f87171;
}

html.theme-dark .primary-link:hover{
  color:#fca5a5;
}

html.theme-dark .primary-link:visited{
  color:#fb7185;
}

html.theme-dark .primary-link-complete,
html.theme-dark .planner-route-link.primary-link-complete,
html.theme-dark .planner-route-link.primary-link-complete span{
  color:#4ade80;
}

html.theme-dark .primary-link-complete:hover,
html.theme-dark .planner-route-link.primary-link-complete:hover,
html.theme-dark .planner-route-link.primary-link-complete:hover span{
  color:#86efac;
}

html.theme-dark .primary-link-contracted,
html.theme-dark .planner-route-link.primary-link-contracted,
html.theme-dark .planner-route-link.primary-link-contracted span{
  color:#60a5fa;
}

html.theme-dark .primary-link-contracted:hover,
html.theme-dark .planner-route-link.primary-link-contracted:hover,
html.theme-dark .planner-route-link.primary-link-contracted:hover span{
  color:#93c5fd;
}

html.theme-dark .status-pending{
  background:#3f2c0f;
  color:#fcd34d;
  border-color:#92400e;
}

html.theme-dark .status-scheduled{
  background:#12263f;
  color:#93c5fd;
  border-color:#1d4ed8;
}

html.theme-dark .status-delivered{
  background:#11261b;
  color:#86efac;
  border-color:#15803d;
}

html.theme-dark .status-fechar{
  background:#321225;
  color:#f9a8d4;
  border-color:#be185d;
}

html.theme-dark .whatsapp-inline-label{
  color:#f8fafc;
}

html.theme-dark .whatsapp-inline-input{
  background:#0f1722;
  color:var(--text);
  border-color:#334155;
}

html.theme-dark .whatsapp-inline-input::placeholder{
  color:#7f8ea3;
}

html.theme-dark .whatsapp-inline-input:focus{
  border-color:#60a5fa;
  box-shadow:0 0 0 3px rgba(96,165,250,.18);
}

html.theme-dark .processed-level-success{
  background:#11261b;
  border-color:#15803d;
  color:#86efac;
}

html.theme-dark .processed-level-info{
  background:#111f3f;
  border-color:#1d4ed8;
  color:#93c5fd;
}

html.theme-dark .processed-level-error{
  background:#2a1217;
  border-color:#b91c1c;
  color:#fca5a5;
}

html.theme-dark .route-flag-alert{
  color:#fdba74;
  background:#2a1c10;
  border-color:#9a3412;
}

html.theme-dark .route-flag-info{
  color:#93c5fd;
  background:#111f3f;
  border-color:#1d4ed8;
}

html.theme-dark .route-flag-client{
  color:#fdba74;
  background:#2b1e14;
  border-color:#c2410c;
}

html.theme-dark .route-flag-geo{
  color:#cbd5e1;
  background:#17212d;
  border-color:#475569;
}

html.theme-dark .route-flag-holiday{
  color:#fca5a5;
  background:#2a1217;
  border-color:#b91c1c;
}

html.theme-dark .route-flag-long{
  color:#fcd34d;
  background:#35260f;
  border-color:#a16207;
}

html.theme-dark .persyvex-status-recibido{
  background:#112742;
  border-color:#2563eb;
  color:#93c5fd;
}

html.theme-dark .persyvex-status-procesado{
  background:#3a3210;
  border-color:#ca8a04;
  color:#fde68a;
}

html.theme-dark .persyvex-status-en-produccion{
  background:#10281b;
  border-color:#16a34a;
  color:#86efac;
}

html.theme-dark .theme-toggle-track{
  background:#334155;
}

html.theme-dark .theme-toggle-thumb{
  transform:translateX(18px);
  background:#f8fafc;
}

html.theme-dark .theme-toggle{
  color:#d7e1ec;
}

html.theme-dark .theme-toggle:hover{
  color:#f8fafc;
}

@media (max-width: 900px){
  .theme-toggle{
    order:-1;
  }
}


.transport-filter-form{
  gap:12px;
  align-items:center;
  margin-bottom:16px;
  flex-wrap:wrap;
}

.transport-summary{
  display:flex;
  gap:14px;
  flex-wrap:wrap;
  align-items:center;
}

.transport-check{
  display:inline-flex;
  gap:6px;
  align-items:center;
  color:var(--muted);
  font-size:14px;
  font-weight:600;
}

.transport-table{
  table-layout:fixed;
}

.transport-col-check{
  width:42px;
}

.transport-table th:nth-child(2),
.transport-table td:nth-child(2){ width:13%; }

.transport-table th:nth-child(3),
.transport-table td:nth-child(3){ width:23%; }

.transport-table th:nth-child(4),
.transport-table td:nth-child(4),
.transport-table th:nth-child(5),
.transport-table td:nth-child(5),
.transport-table th:nth-child(7),
.transport-table td:nth-child(7){ width:13%; }

.transport-table th:nth-child(6),
.transport-table td:nth-child(6){ width:19%; }

@media print {
  .print-hide,
  .topbar,
  .tabsbar,
  .foot,
  .flash {
    display:none !important;
  }

  body,
  .wrap,
  .card {
    background:#fff !important;
    box-shadow:none !important;
    margin:0 !important;
    padding:0 !important;
  }

  .tablewrap{
    overflow:visible !important;
  }
}
.session-user{font-weight:700;color:var(--text,#1f2937);white-space:nowrap}
.admin-page{display:grid;gap:22px}
.admin-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:20px}
.admin-heading h1{margin:2px 0 4px}
.eyebrow{margin:0;text-transform:uppercase;letter-spacing:.12em;font-size:11px;font-weight:800;color:#64748b}
.admin-create{display:grid;grid-template-columns:1.2fr 1fr 1.2fr auto;gap:12px;align-items:end;padding:18px;border:1px solid #dde3ea;border-radius:14px;background:#f8fafc}
.admin-create div{display:grid;gap:6px}.admin-create label,.activity-filter label{font-size:12px;font-weight:800;color:#52647a;text-transform:uppercase;letter-spacing:.05em}
.admin-create input,.admin-user-actions input,.activity-filter select{height:42px;border:1px solid #cfd8e3;border-radius:9px;padding:0 12px;background:#fff;color:#172033}
.admin-list{display:grid;gap:10px}.admin-user{display:flex;justify-content:space-between;align-items:center;gap:18px;padding:14px 16px;border:1px solid #dde3ea;border-radius:12px}
.admin-user-main,.admin-user-actions,.admin-user-actions form{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.admin-user-main>span:not(.status-pill){color:#64748b}
.status-pill{padding:4px 8px;border-radius:999px;background:#eef2f7;color:#46566c;font-size:12px;font-weight:700}.status-pill.ok{background:#dcfce7;color:#166534}.status-pill.off{background:#fee2e2;color:#991b1b}
.activity-filter{display:flex;align-items:center;gap:10px}.activity-filter select{min-width:260px}.activity-table-wrap{overflow:auto;border:1px solid #dde3ea;border-radius:12px}.activity-table{width:100%;border-collapse:collapse;font-size:13px}.activity-table th,.activity-table td{text-align:left;padding:11px 12px;border-bottom:1px solid #e8edf3;white-space:nowrap}.activity-table th{background:#f8fafc;color:#52647a;font-size:11px;text-transform:uppercase;letter-spacing:.06em}.activity-table code{font-size:12px}
.activity-table .activity-details{white-space:normal;min-width:320px;max-width:620px;line-height:1.45;color:#52647a;overflow-wrap:anywhere}
html.theme-dark .admin-create,html.theme-dark .activity-table th{background:#172033}html.theme-dark .admin-create,html.theme-dark .admin-user,html.theme-dark .activity-table-wrap{border-color:#344155}html.theme-dark .admin-create input,html.theme-dark .admin-user-actions input,html.theme-dark .activity-filter select{background:#111827;border-color:#46566c;color:#e5e7eb}html.theme-dark .session-user{color:#e5e7eb}
@media(max-width:900px){.admin-create{grid-template-columns:1fr 1fr}.admin-user{align-items:flex-start;flex-direction:column}}
@media(max-width:600px){.admin-create{grid-template-columns:1fr}.admin-heading{flex-direction:column}.admin-user-actions form{width:100%}.admin-user-actions input{flex:1;min-width:0}}
