/* Gestor de avisos · Electroclisa
   Mismo lenguaje visual que el planificador de Rutas: barra lateral azul
   marino, fondo gris claro, tarjetas blancas y naranja Electroclisa. */

:root {
  --navy: #0b1f3a;
  --navy-2: #13294a;
  --navy-3: #1c3558;
  --ink: #10233f;
  --muted: #667085;
  --faint: #98a2b3;
  --line: #e6eaf0;
  --line-2: #d5dbe4;
  --canvas: #f4f7fb;
  --paper: #ffffff;
  --soft: #f8fafc;
  --orange: #f58220;
  --orange-dark: #c65300;
  --orange-deep: #a64200;
  --orange-soft: #fff4ea;
  --orange-line: #fcd9b8;
  --red: #b42318;
  --red-soft: #fef3f2;
  --red-line: #fecdca;
  --blue: #2f5f98;
  --blue-soft: #eef4fb;
  --shadow-sm: 0 1px 2px rgba(16, 35, 63, .06);
  --shadow: 0 8px 24px rgba(16, 35, 63, .08);
  --shadow-lg: 0 20px 48px rgba(16, 35, 63, .18);
  --radius: 14px;
  --radius-sm: 10px;
  --control-h: 42px;
  --sidebar-w: 248px;
  --gutter: 32px;
  --font: "Open Sans", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--canvas); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
a { color: var(--orange-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hidden, .role-hidden { display: none !important; }
:focus-visible { outline: 3px solid rgba(245, 130, 32, .45); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* ---------- Estructura ---------- */
.app-shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 22px 14px 16px; background: var(--navy); color: #fff; overflow-y: auto; z-index: 30; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 6px; }
.brand-mark, .login-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--orange); color: #fff; font-weight: 700; font-size: 15px; flex: none; }
.brand strong { display: block; font-size: 16px; }
.brand span { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #9fb0c8; }
.brand .sidebar-close { display: none; margin-left: auto; color: #fff; }
.sidebar nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 42px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: #c9d4e3; font-size: 14px; font-weight: 500; text-align: left; transition: background .15s, color .15s; }
.nav-item:hover { background: var(--navy-2); color: #fff; }
.nav-item.active { background: var(--navy-3); color: #fff; font-weight: 600; }
.nav-item.active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--orange); }
.nav-item svg { width: 19px; height: 19px; opacity: .9; }
.nav-badge { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--orange); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.nav-sep { height: 1px; margin: 10px 8px; background: rgba(255, 255, 255, .08); }
.sidebar-status { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 12px; background: var(--navy-2); border: 1px solid rgba(255, 255, 255, .06); }
.sidebar-status strong { display: block; font-size: 12px; }
.sidebar-status small { display: block; font-size: 11px; color: #9fb0c8; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); flex: none; }
.status-dot.offline { background: #f04438; }
.sidebar-profile { display: flex; align-items: center; gap: 10px; padding: 12px 6px 0; border-top: 1px solid rgba(255, 255, 255, .08); }
.sidebar-profile > div { min-width: 0; flex: 1; }
.sidebar-profile > div > * { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-profile strong { font-size: 13px; }
.sidebar-profile > div > span, .sidebar-profile > div > small { font-size: 11px; color: #9fb0c8; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--orange); color: #fff; font-size: 12px; font-weight: 700; flex: none; }
#logout-button { border: 0; border-radius: 8px; padding: 7px 10px; background: var(--navy-3); color: #fff; font-size: 12px; font-weight: 600; }
#logout-button:hover { background: #28436b; }
.sidebar-scrim { position: fixed; inset: 0; background: rgba(11, 31, 58, .45); z-index: 25; }

.workspace { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 12px var(--gutter); background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar > div { flex: 1; min-width: 0; }
.topbar h1 { font-size: 22px; line-height: 1.2; }
.eyebrow { display: block; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--orange-dark); }
.today { font-size: 13px; color: var(--muted); white-space: nowrap; }
.today::first-letter { text-transform: uppercase; }
.topbar .menu-button { display: none; margin-left: -8px; }
.content { width: 100%; max-width: 1200px; margin: 0 auto; padding: 28px var(--gutter) 64px; }
.view { display: none; }
.view.active { display: block; animation: fade .18s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h2 { font-size: 24px; line-height: 1.25; }
.page-head p { margin-top: 4px; color: var(--muted); }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- Tarjetas ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 22px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h3 { font-size: 16px; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.two-col .card + .card, .review-layout .card + .card { margin-top: 0; }
.hint { font-size: 13px; color: var(--muted); }
.kicker { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--orange-dark); }

/* ---------- Controles ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--control-h); padding: 0 18px; border: 1px solid transparent; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, box-shadow .15s; }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--orange-dark); color: #fff; box-shadow: 0 1px 2px rgba(198, 83, 0, .25); }
.btn-primary:hover { background: var(--orange-deep); }
.btn-secondary { background: var(--paper); border-color: var(--line-2); color: var(--ink); }
.btn-secondary:hover { border-color: var(--faint); background: var(--soft); }
.btn-ghost { background: transparent; color: var(--muted); padding: 0 12px; }
.btn-ghost:hover { background: var(--canvas); color: var(--ink); }
.btn-danger { background: var(--paper); border-color: var(--red-line); color: var(--red); }
.btn-danger:hover { background: var(--red-soft); }
.btn-danger-solid { background: var(--red); color: #fff; }
.btn-danger-solid:hover { background: #912018; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.link-btn { border: 0; background: none; padding: 0; color: var(--orange-dark); font-size: 13px; font-weight: 600; text-decoration: none; }
.link-btn:hover { text-decoration: underline; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); }
.icon-btn:hover { background: var(--canvas); color: var(--ink); }

input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea { width: 100%; min-height: var(--control-h); padding: 9px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--paper); font-size: 14px; transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(245, 130, 32, .16); }
select { appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; margin: 0; accent-color: var(--orange-dark); flex: none; cursor: pointer; }
input[type=date] { min-width: 0; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink); }
.field.missing > span::after { content: "Pendiente"; margin-left: 8px; padding: 1px 7px; border-radius: 999px; background: var(--orange-soft); color: var(--orange-deep); font-size: 11px; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; margin-top: 18px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 0; }
.span-2, .field.wide { grid-column: 1 / -1; }
.check-line { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; cursor: pointer; }
.search-row { display: flex; gap: 10px; align-items: center; }
.search-box { position: relative; display: flex; align-items: center; flex: 1; min-width: 0; }
.search-box svg { position: absolute; left: 12px; color: var(--faint); pointer-events: none; }
.search-box input { padding-left: 38px !important; }
.grow { flex: 1; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.toolbar select { width: auto; min-width: 170px; }
.toolbar .search-box { min-width: 240px; }
.date-field { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.date-field input { width: 150px; }
.split-control { display: inline-flex; align-items: stretch; }
.split-control select { width: auto; border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: 0; }
.split-control .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; }

.tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.tabs button { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 0; background: none; color: var(--muted); font-size: 14px; font-weight: 600; }
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--ink); }
.tabs button.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--orange); }
.tab-count { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--canvas); color: var(--muted); font-size: 12px; text-align: center; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--canvas); color: var(--muted); }
.pill-orange { background: var(--orange-soft); color: var(--orange-deep); }
.pill-red { background: var(--red-soft); color: var(--red); }
.pill-blue { background: var(--blue-soft); color: var(--blue); }
.pill-navy { background: var(--navy); color: #fff; }

.alert { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid; font-size: 14px; }
.alert svg { margin-top: 2px; }
.alert-danger { background: var(--red-soft); border-color: var(--red-line); color: #7a271a; }
.alert-warn { background: var(--orange-soft); border-color: var(--orange-line); color: var(--orange-deep); }
.alert strong { display: block; }

/* ---------- Inicio ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow-sm); text-align: left; transition: border-color .15s, box-shadow .15s, transform .15s; }
.kpi:hover { border-color: var(--orange-line); box-shadow: var(--shadow); transform: translateY(-1px); }
.kpi strong { font-size: 30px; line-height: 1.1; font-weight: 700; }
.kpi span { font-size: 13px; color: var(--muted); }
.kpi.alert-kpi strong { color: var(--orange-dark); }
.notice-bar { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 16px; padding: 14px 18px; border: 1px solid var(--orange-line); border-radius: var(--radius); background: var(--orange-soft); color: var(--orange-deep); font-size: 14px; font-weight: 600; text-align: left; }
.notice-bar span { flex: 1; }
.row-list { display: flex; flex-direction: column; font-size: 14px; color: var(--muted); }
.row-link { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 4px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; }
.row-link:first-child { border-top: 0; }
.row-link:hover { background: var(--soft); }
.row-link > div { flex: 1; min-width: 0; }
.row-link strong, .row-link small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-link strong { color: var(--ink); font-size: 14px; }
.row-link small { color: var(--muted); font-size: 12px; }
.row-link > svg { color: var(--faint); }

/* ---------- Listas tipo tabla ---------- */
.list-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 16px 0 8px; font-size: 13px; color: var(--muted); }
.list-meta .bulk { display: inline-flex; align-items: center; gap: 12px; }
.table-head { display: grid; gap: 14px; padding: 10px 14px; border-radius: 8px; background: var(--soft); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.table-list { display: flex; flex-direction: column; }
.table-head:has(+ .table-list > .empty-state) { display: none; }
.trow { display: grid; gap: 14px; align-items: center; padding: 14px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s; }
.trow:hover { background: var(--soft); }
.trow:last-child { border-bottom: 0; }
.trow > * { min-width: 0; }
.trow .main strong { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow .main small, .trow .sub { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow .text { font-size: 13px; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.trow .label { display: none; }
.trow .chev { color: var(--faint); justify-self: end; }
.trow .row-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.trow.archived { background: var(--soft); }
.trow.overdue .when { color: var(--red); font-weight: 600; }
.intake-cols { grid-template-columns: 96px minmax(0, 2.2fr) minmax(0, 1.6fr) 150px 130px 24px; }
.task-cols { grid-template-columns: 22px minmax(0, 1.6fr) minmax(0, 2fr) 150px 130px 24px; }
.review-cols { grid-template-columns: 22px minmax(0, 1.8fr) minmax(0, 2fr) 150px 90px 24px; }
.admin-cols { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.6fr) minmax(0, 1.4fr) 110px; }
.user-cols { grid-template-columns: minmax(0, 1.4fr) 150px minmax(0, 1.2fr) 110px; }
.empty-state { padding: 36px 16px; text-align: center; color: var(--muted); font-size: 14px; }
.empty-state strong { display: block; color: var(--ink); margin-bottom: 4px; }
.empty-state .btn { margin-top: 14px; }
.is-error { color: var(--red); }
.pagination { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.pagination:empty { display: none; }
.pagination button { min-height: 34px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--paper); font-size: 13px; font-weight: 600; }
.pagination button:disabled { opacity: .45; cursor: default; }

/* ---------- Nuevo aviso ---------- */
.stepper-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stepper { display: flex; gap: 6px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.stepper::-webkit-scrollbar { display: none; }
.stepper button { display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.stepper button span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--canvas); font-size: 12px; }
.stepper button em { font-style: normal; }
.stepper button.done span { background: var(--navy); color: #fff; }
.stepper button.active { border-color: var(--orange); color: var(--ink); background: var(--paper); box-shadow: inset 0 0 0 1px var(--orange); }
.stepper button.active span { background: var(--orange-dark); color: #fff; }
.call-stage { display: none; }
.call-stage.active { display: block; animation: fade .18s ease-out; }
.call-card { max-width: none; margin: 0; padding: 30px; }
.call-card blockquote { margin: 10px 0 0; font-size: 22px; line-height: 1.4; font-weight: 600; color: var(--ink); }
.call-card .help { margin-top: 6px; color: var(--muted); font-size: 14px; }
.stage-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.actions-right { display: flex; gap: 8px; }
.safety-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 22px; }
.choice-big { display: flex; flex-direction: column; gap: 4px; padding: 20px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--paper); text-align: left; transition: border-color .15s, background .15s; }
.choice-big strong { font-size: 17px; }
.choice-big small { font-size: 13px; color: var(--muted); }
.choice-big:hover { border-color: var(--orange); background: var(--paper); }
.choice-big.danger:hover, .choice-big.danger.selected { border-color: var(--red); background: var(--red-soft); }
.choice-big.selected { border-color: var(--orange); background: var(--paper); box-shadow: inset 0 0 0 1px var(--orange); }
.risk-panel { margin-top: 18px; }
.risk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.check-card { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); font-size: 14px; cursor: pointer; }
.check-card:has(input:checked) { border-color: var(--red); background: var(--red-soft); }

.lookup-line { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--soft); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.lookup-line.found { background: var(--paper); border-color: var(--line); color: var(--ink); }
.lookup-line.found svg { color: var(--orange-dark); }
.lookup-line strong { color: var(--ink); }
.lookup-line small { display: block; color: var(--muted); }
.result-list { display: flex; flex-direction: column; margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.result-list:empty { display: none; }
.result-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 18px; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line); background: var(--paper); text-align: left; }
.result-row:last-child { border-bottom: 0; }
.result-row:hover { background: var(--soft); }
.result-row strong { display: block; font-size: 14px; }
.result-row small { display: block; font-size: 12px; color: var(--muted); }
.result-row .code { font-size: 12px; font-weight: 600; color: var(--orange-dark); }
.result-row svg { color: var(--faint); }
.result-note { padding: 12px 14px; font-size: 13px; color: var(--muted); background: var(--soft); }

.selected-customer { margin-top: 16px; padding: 18px; border: 1px solid var(--line); border-left: 3px solid var(--orange); border-radius: var(--radius); background: #fff; }
.selected-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.selected-head strong { font-size: 17px; display: block; }
.selected-head small { color: var(--muted); font-size: 12px; }
.selected-head .actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.pick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.pick-group h4 { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.choice-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); cursor: pointer; }
.choice-row + .choice-row { margin-top: 8px; }
.choice-row:has(input:checked), .choice-row.selected { border-color: var(--orange); background: var(--paper); box-shadow: inset 0 0 0 1px var(--orange); }
.choice-row input { margin-top: 2px; }
.choice-row strong { display: block; font-size: 14px; }
.choice-row small { display: block; font-size: 12px; color: var(--muted); }
.more-toggle { margin-top: 8px; font-size: 13px; }
.more-toggle summary { cursor: pointer; color: var(--orange-dark); font-weight: 600; list-style: none; }
.more-toggle summary::-webkit-details-marker { display: none; }
.more-toggle[open] summary { margin-bottom: 8px; }

.diagnostic-head { display: flex; align-items: center; gap: 16px; }
.diagnostic-head .progress { flex: 1; }
.progress { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: inherit; background: var(--orange); transition: width .25s ease; }
.diagnostic-answer { margin-top: 20px; }
.answer-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.answer-option { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 12px 16px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--paper); font-size: 14px; font-weight: 600; text-align: left; transition: border-color .15s, background .15s; }
.answer-option:hover { border-color: var(--orange); }
.answer-option.selected { border-color: var(--orange); background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1px var(--orange); }
.answer-option .tick { display: grid; place-items: center; width: 20px; height: 20px; border: 1.5px solid var(--line-2); border-radius: 6px; font-size: 12px; color: transparent; flex: none; }
.answer-option.selected .tick { background: var(--orange-dark); border-color: var(--orange-dark); color: #fff; }
.spoken-input { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.dictation-button { border: 1px solid var(--line-2); border-radius: 999px; padding: 6px 14px; background: var(--paper); font-size: 13px; font-weight: 600; color: var(--muted); }
.answered { margin: 12px 0 0; }
#view-crear .review-layout { max-width: 1100px; margin: 0 auto; }
.wide-stage .stepper-row { max-width: 1100px; }
.answered div { display: flex; flex-wrap: wrap; gap: 6px; }
.answered span { padding: 4px 10px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.answered b { color: var(--ink); font-weight: 600; }

.file-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; margin-top: 20px; padding: 28px 16px; border: 2px dashed var(--line-2); border-radius: var(--radius); background: var(--soft); text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.file-drop:hover, .file-drop.has-file { border-color: var(--orange); background: var(--paper); }
.file-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-drop svg { width: 26px; height: 26px; color: var(--orange-dark); }
.file-drop small { font-size: 12px; color: var(--muted); }

.review-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.review-layout .call-card { max-width: none; margin: 0; }
.review-layout h3 { margin-top: 6px; font-size: 20px; }
.final-editors section { margin-top: 20px; }
.final-editors h4 { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.final-edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; margin-top: 14px; }
.final-checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.final-checks label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
fieldset.field { border: 0; padding: 0; margin: 0; }
fieldset.field legend { font-size: 13px; font-weight: 600; margin-bottom: 8px; padding: 0; }
.summary-card { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 14px; }
.quality { display: flex; justify-content: space-between; align-items: baseline; }
.quality span { font-size: 13px; color: var(--muted); }
.quality strong { font-size: 26px; }
.readiness { font-size: 13px; color: var(--muted); }
.readiness.ok { color: var(--blue); font-weight: 600; }
.readiness.risk { color: var(--red); font-weight: 600; }
.summary-details summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--orange-dark); }
.summary-preview { margin: 10px 0 6px; padding: 14px; max-height: 320px; overflow: auto; border-radius: var(--radius-sm); background: var(--soft); border: 1px solid var(--line); font: 12px/1.55 ui-monospace, "Cascadia Mono", Consolas, monospace; white-space: pre-wrap; word-break: break-word; color: var(--ink); }
.saved-card { max-width: 680px; margin: 0 auto; text-align: center; padding: 34px; }
.saved-check { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--orange-soft); color: var(--orange-dark); }
.saved-check svg { width: 28px; height: 28px; }
.saved-card h3 { margin-top: 14px; font-size: 22px; }
.saved-card p { margin-top: 6px; color: var(--muted); }
.saved-card .summary-preview { text-align: left; margin-top: 18px; }
.saved-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 20px; }

/* ---------- Clientes ---------- */
.customer-results { margin-top: 16px; }
.customer-detail .card-head { align-items: center; }
.customer-detail h3 { font-size: 20px; }
.customer-detail .code { font-size: 12px; font-weight: 700; color: var(--orange-dark); letter-spacing: .04em; }
.detail-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.detail-block { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; }
.detail-block h4 { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.detail-item { padding: 10px 0; border-top: 1px solid var(--line); }
.detail-item:first-of-type { border-top: 0; padding-top: 0; }
.detail-item strong { display: block; font-size: 14px; }
.detail-item small { display: block; font-size: 13px; color: var(--muted); }
.detail-item .pill { margin-top: 4px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; }

/* ---------- Revisar partes ---------- */
.import-card { margin-bottom: 16px; }
.batch-line { margin-bottom: 14px; font-size: 13px; color: var(--muted); }
.batch-line strong { color: var(--ink); }
.queue-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.queue-tabs::-webkit-scrollbar { display: none; }
.queue-tabs button { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.queue-tabs button small { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--canvas); font-size: 12px; text-align: center; }
.queue-tabs button.active { border-color: var(--navy); background: var(--navy); color: #fff; }
.queue-tabs button.active small { background: var(--orange); color: #fff; }
.file-status { margin-top: 12px; font-size: 13px; color: var(--muted); }
.file-status:empty { display: none; }
.file-status.error { color: var(--red); }
.import-preview { margin-top: 14px; padding: 14px; border-radius: var(--radius-sm); background: var(--soft); font-size: 13px; }
.preview-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
.preview-metrics div { padding: 10px; border-radius: 8px; background: var(--paper); border: 1px solid var(--line); text-align: center; }
.preview-metrics strong { display: block; font-size: 18px; }
.preview-metrics span { font-size: 11px; color: var(--muted); }
.preview-metrics .has-errors { border-color: var(--red-line); color: var(--red); }
.preview-errors { margin: 8px 0 0; padding-left: 18px; color: var(--red); }

/* ---------- Guía ---------- */
.guide-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: start; }
.guide-index { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 2px; padding: 10px; }
.guide-index a { padding: 9px 12px; border-radius: 8px; color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; }
.guide-index a:hover { background: var(--soft); color: var(--ink); }
.guide-index a.active { background: var(--orange-soft); color: var(--orange-deep); }
.guide-body { display: flex; flex-direction: column; gap: 12px; }
.guide-item { padding: 0; margin: 0 !important; }
.guide-item summary { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; cursor: pointer; font-size: 16px; font-weight: 600; list-style: none; }
.guide-item summary::-webkit-details-marker { display: none; }
.guide-item summary::after { content: ""; width: 10px; height: 10px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; margin-right: 4px; }
.guide-item[open] summary::after { transform: rotate(-135deg); }
.guide-item[open] summary { border-bottom: 1px solid var(--line); }
.guide-item ol { margin: 0; padding: 18px 22px 6px 44px; }
.guide-item li { margin-bottom: 10px; font-size: 14px; }
.guide-item li::marker { color: var(--orange-dark); font-weight: 700; }
.guide-item .hint { padding: 0 22px 18px; }

/* ---------- Cajón lateral ---------- */
.drawer-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(11, 31, 58, .4); }
.drawer { position: fixed; top: 0; right: 0; z-index: 50; display: flex; flex-direction: column; width: min(620px, 100%); height: 100%; background: var(--paper); box-shadow: var(--shadow-lg); transform: translateX(105%); transition: transform .22s ease; visibility: hidden; }
.drawer.open { transform: none; visibility: visible; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 18px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 18px; }
.drawer-body h3 { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.drawer-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.drawer-meta div, .detail-grid div { padding: 12px; border-radius: var(--radius-sm); background: var(--soft); min-width: 0; }
.drawer-meta small, .detail-grid small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.drawer-meta strong, .detail-grid strong { display: block; margin-top: 2px; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.drawer-form { display: flex; flex-direction: column; gap: 14px; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.drawer-section { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; }
.drawer-section > h3 { display: flex; justify-content: space-between; align-items: center; }
.entity { padding: 14px 0; border-top: 1px dashed var(--line-2); }
.entity:first-of-type { border-top: 0; padding-top: 0; }
.entity-title { font-size: 13px; font-weight: 600; margin-bottom: 10px; color: var(--ink); }
.attachment-links { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; }
.attachment-links a { padding: 6px 12px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); text-decoration: none; }
.timeline ul { margin: 0; padding: 0; list-style: none; font-size: 13px; }
.timeline li { padding: 8px 0; border-top: 1px solid var(--line); }
.timeline li strong { margin-right: 6px; }
.timeline li span { color: var(--muted); }
.source-details summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--orange-dark); }
.source-details p { margin-top: 8px; font-size: 13px; white-space: pre-wrap; }
.change-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.change-table th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.change-table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.change-table del { color: var(--faint); }
.change-group { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; }
.change-group header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.change-group header strong { flex: 1; }

/* ---------- Varios ---------- */
.back-to-top { position: fixed; right: 24px; bottom: 24px; z-index: 35; display: grid; place-items: center; width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--navy); color: #fff; box-shadow: var(--shadow); transition: transform .15s, background .15s; }
.back-to-top:hover { background: var(--orange-dark); transform: translateY(-2px); }
.back-to-top svg { width: 20px; height: 20px; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 70; max-width: min(520px, calc(100% - 32px)); padding: 12px 18px; border-radius: 12px; background: var(--navy); color: #fff; font-size: 14px; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--red); }
.confirm-overlay, .login-overlay { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(11, 31, 58, .5); }
.login-overlay { background: var(--navy); }
.confirm-modal, .login-modal { width: min(440px, 100%); padding: 28px; border-radius: 18px; background: var(--paper); box-shadow: var(--shadow-lg); }
.confirm-modal h2 { font-size: 18px; }
.confirm-modal p { margin-top: 8px; color: var(--muted); font-size: 14px; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.login-modal { display: flex; flex-direction: column; gap: 14px; }
.login-modal h2 { font-size: 22px; }
.login-modal p { color: var(--muted); font-size: 14px; margin-top: -8px; }
.login-error { padding: 10px 12px; border-radius: 8px; background: var(--red-soft); color: var(--red); font-size: 13px; }

/* ---------- Paso entre aplicaciones ---------- */

/* ---------- Tarjetas para elegir ---------- */
.card-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.card-choices:empty { display: none; }
#call-candidates { margin-top: 12px; }
.choice-card { display: flex; flex-direction: column; gap: 2px; min-height: 64px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); text-align: left; box-shadow: var(--shadow-sm); transition: border-color .15s, background .15s, box-shadow .15s; }
.choice-card:hover { border-color: var(--orange-line); box-shadow: var(--shadow); }
.choice-card.selected { border-color: var(--orange); background: var(--paper); box-shadow: inset 0 0 0 1px var(--orange); }
.choice-card strong { font-size: 14px; line-height: 1.3; }
.choice-card small { font-size: 12px; color: var(--muted); }
.choice-card.other { border-style: dashed; box-shadow: none; }
.choice-card .result-note { grid-column: 1 / -1; }
.call-customer { margin-top: 14px; padding: 16px; border: 1px solid var(--line); border-left: 4px solid var(--orange); border-radius: var(--radius); background: var(--paper); }
.call-customer .code { display: block; font-size: 12px; font-weight: 600; color: var(--orange-dark); }
.call-customer .selected-head strong { font-size: 16px; }
.choice-title { margin: 16px 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.caller-fields { margin-top: 16px; }
.call-search { margin-top: 4px; }
.optional-booking { margin-top: 4px; }
.optional-booking .form-grid { margin-top: 10px; }
.kpi small { font-size: 12px; color: var(--faint); }
.detail-lines { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 4px; }
.detail-line { font-size: 13px; color: var(--ink); }
.detail-line b { margin-right: 6px; font-weight: 600; color: var(--muted); }
.detail-line a { color: var(--ink); text-decoration: none; border-bottom: 1px dotted var(--faint); }

/* ---------- Nuevo aviso a lo ancho ---------- */
#intake-form { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; max-width: 1180px; margin: 0 auto; }
#intake-form > .stepper-row { grid-column: 1 / -1; }
#intake-form > .call-stage { grid-column: 1; grid-row: 2; }
#intake-form > .live-summary { grid-column: 2; grid-row: 2; position: sticky; top: 92px; }
#intake-form.wide-stage > .call-stage { grid-column: 1 / -1; }
#intake-form.wide-stage > .live-summary { display: none; }
#view-crear .review-layout, .wide-stage .stepper-row { max-width: none; }
.live-summary h4 { margin-bottom: 10px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.live-summary dl { display: grid; gap: 10px; margin: 0; }
.live-summary dl > div { display: grid; gap: 1px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.live-summary dl > div:last-child { border-bottom: 0; padding-bottom: 0; }
.live-summary dt { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); }
.live-summary dd { margin: 0; font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
.live-summary .pill { justify-self: start; }
.card-choices { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
/* Datos ya rellenos: el valor con su origen y «Cambiar» */
.filled-field .filled-value { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--control-h); padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--soft); }
.filled-field strong { display: block; font-size: 14px; }
.filled-field small { display: block; font-size: 12px; color: var(--muted); }
/* ¿Quién atiende al técnico? */
.attend-same small { display: block; font-size: 12px; color: var(--muted); }
.attend-same strong { font-size: 15px; color: var(--navy); }
button.choice-row { width: 100%; margin-top: 8px; text-align: left; }
.attend-other { border-style: dashed; }
.attend-other.selected { border-style: solid; }
.attend-list { margin: 8px 0 0 14px; padding-left: 12px; border-left: 2px solid var(--line); }
/* Inicio para quien coge el teléfono */
.home-call { padding: 26px 28px; border-left: 4px solid var(--orange); }
.home-call h3 { margin: 4px 0 14px; font-size: 22px; color: var(--navy); }
.home-call .search-box { min-height: 54px; }
.home-call .search-box input { font-size: 18px; }
.home-call .btn { min-height: 54px; padding: 0 22px; font-size: 15px; }
.home-call .hint { margin-top: 10px; }
.home-dk-line { margin-bottom: 14px; color: var(--muted); }
.home-dk-line strong { font-size: 28px; color: var(--navy); margin-right: 4px; }
.home-dk.is-pending .home-dk-line strong { color: var(--orange-dark); }
.home-extra { margin-top: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.muted { color: var(--muted); font-weight: 500; }

.template-line { margin-top: 8px; font-size: 13px; }

/* ---------- Tablet ---------- */
@media (max-width: 1100px) {
  :root { --gutter: 24px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-layout { grid-template-columns: 1fr; }
  #intake-form { grid-template-columns: minmax(0, 1fr); }
  #intake-form > .live-summary { display: none; }
  .summary-card { position: static; }
  .intake-cols { grid-template-columns: 90px minmax(0, 2fr) minmax(0, 1.4fr) 140px 24px; }
  .intake-cols > :nth-child(5) { display: none; }
}

/* ---------- Móvil ---------- */
@media (max-width: 860px) {
  :root { --gutter: 16px; }
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .22s ease; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .brand .sidebar-close, .topbar .menu-button { display: inline-grid; }
  .topbar { min-height: 60px; padding: 8px var(--gutter); }
  .topbar h1 { font-size: 18px; }
  .topbar .eyebrow, .today { display: none; }
  .topbar h1 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar > div { min-width: 0; flex: 1; }
  .card-choices { grid-template-columns: minmax(0, 1fr); }
  .content { padding: 18px var(--gutter) 88px; }
  .page-head { align-items: stretch; flex-direction: column; }
  .page-head h2 { font-size: 21px; }
  .head-actions { width: 100%; }
  .head-actions > .btn, .head-actions > .split-control { flex: 1 1 auto; }
  .split-control select { flex: 1; }
  .card { padding: 16px; }
  .two-col, .detail-sections, .pick-grid, .form-grid, .form-grid.three, .final-edit-grid, .safety-choice, .risk-grid, .detail-grid, .row2 { grid-template-columns: minmax(0, 1fr); }
  .kpi { padding: 16px; }
  .kpi strong { font-size: 26px; }
  .toolbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .toolbar > * { grid-column: span 2; }
  .toolbar > select, .toolbar > .date-field { grid-column: span 1; }
  .toolbar > #intake-erp-filter { grid-column: span 2; }
  .toolbar select, .toolbar .search-box { width: 100%; min-width: 0; }
  .date-field { flex-direction: column; align-items: stretch; gap: 2px; font-size: 12px; }
  .date-field input { width: 100%; }
  .trow > .chev { display: none; }
  .search-row { flex-wrap: wrap; }
  .search-row .search-box { flex-basis: 100%; }
  .search-row .btn { flex: 1; }
  .stepper-row { flex-direction: column; align-items: stretch; }
  .stepper button { padding: 6px 10px 6px 6px; }
  .stepper button:not(.active) em { display: none; }
  .call-card { padding: 20px 16px; }
  .call-card blockquote { font-size: 19px; }
  .stage-actions { position: sticky; bottom: 0; margin: 20px -16px -20px; padding: 12px 16px; background: rgba(255, 255, 255, .97); border-radius: 0 0 var(--radius) var(--radius); }
  .answer-options { grid-template-columns: 1fr; }
  .selected-head { flex-direction: column; }
  .selected-head .actions { justify-content: flex-start; }
  .table-head { display: none; }
  .trow { grid-template-columns: 1fr auto !important; gap: 4px 12px; padding: 14px 4px; }
  .trow > * { grid-column: 1; }
  .trow > .chev, .trow > .aside { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .trow > .select { grid-column: 2; grid-row: 1; justify-self: end; }
  .trow .row-actions { grid-column: 1 / -1; justify-content: flex-start; margin-top: 8px; }
  .trow .label { display: inline; color: var(--muted); font-size: 12px; margin-right: 4px; }
  .trow .hide-mobile { display: none; }
  .drawer-meta { grid-template-columns: 1fr 1fr; }
  .guide-layout { grid-template-columns: 1fr; }
  .guide-index { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .guide-index a { white-space: nowrap; }
  .queue-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); padding: 0 var(--gutter) 2px; }
  .preview-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .back-to-top { right: 16px; bottom: 16px; }
  .list-meta { align-items: flex-start; flex-direction: column; }
}

/* Selector de apps: siempre en el menú lateral, bajo la marca, igual en Avisos, Rutas y Contratos. */
.app-switch { width: 100%; display: flex; gap: 4px; margin: -6px 0 0; padding: 4px; border-radius: 11px; background: rgba(255,255,255,.06); flex: none; }
.app-switch > * { flex: 1 1 0; min-width: 0; min-height: 36px; display: grid; place-items: center; border-radius: 8px; color: #d9e5f3; font-size: 13px; font-weight: 600; text-decoration: none; }
.app-switch a:hover { background: rgba(255,255,255,.08); color: #fff; }
.app-switch [aria-current] { background: var(--orange); color: #fff; cursor: default; }

/* Paso «Cliente»: lo decidido al descolgar, resumido. */
.picked-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--orange); border-radius: var(--radius-sm); background: var(--paper); }
.picked-row span { display: grid; gap: 2px; min-width: 0; }
.picked-row strong { overflow-wrap: anywhere; }
.picked-row small { color: var(--muted); font-size: 12.5px; }
.picked-row .link-btn { flex: none; }
.contract-note { margin: 10px 0 0; }

/* Correo de envío */
.mail-banner { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; padding: 18px 22px; border: 2px solid var(--orange-line); border-radius: var(--radius); background: var(--orange-soft); color: var(--orange-deep); }
.mail-banner strong { display: block; font-size: 17px; margin-bottom: 2px; }
.mail-banner div { flex: 1; min-width: 220px; font-size: 14px; }
.mail-form { display: grid; gap: 14px; max-width: 460px; }
.mail-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.mail-status { padding: 12px 14px; border-radius: 10px; background: var(--orange-soft); color: var(--orange-deep); font-weight: 600; font-size: 14px; }
.mail-status.ok { background: #e8f7f1; color: #157257; }
.mail-banner > svg { width: 26px; height: 26px; flex: none; }
