/* =====================================================================
   Cortinas Montes — UI (oscuro, acento lima, superficies redondeadas)
   ===================================================================== */
:root {
  --bg: #0b0d10;
  --surface: #15181c;
  --surface-2: #1c2025;
  --surface-3: #252a30;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --text: #f2f4f5;
  --muted: #8d959e;
  --lime: #b5f23d;
  --lime-2: #9fdc22;
  --lime-ink: #0d1003;
  --danger: #ff5f57;
  --warn: #ffb547;
  --info: #6cb8ff;
  --paper: #ffffff;
  --paper-2: #f3f4f6;
  --paper-text: #14171a;
  --paper-muted: #7b838b;
  --paper-line: #eceef1;
  --r-xl: 28px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-pill: 999px;
  --shadow: 0 20px 50px rgba(0, 0, 0, .35);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: radial-gradient(1200px 600px at 10% -10%, #1d232b 0%, transparent 60%),
              radial-gradient(900px 500px at 100% 0%, #18201a 0%, transparent 55%),
              var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0; }
small { font-size: 12px; }
.muted { color: var(--muted); }
.ico { flex: none; }
[hidden] { display: none !important; }

.app { max-width: 1480px; margin: 0 auto; padding: 18px 24px 48px; }

/* ---------- Barra superior ---------- */
.topbar { display: flex; align-items: center; gap: 18px; margin-bottom: 26px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; }
.brand-icon { width: 56px; height: 56px; border-radius: 13px; flex-shrink: 0; display: block; }
.login-card .brand-icon { width: 96px; height: 96px; border-radius: 22px; }
.pillnav {
  display: flex; align-items: center; gap: 2px; padding: 5px;
  background: var(--paper); border-radius: var(--r-pill); color: var(--paper-text);
  overflow-x: auto; scrollbar-width: none; margin-left: 8px;
}
.pillnav::-webkit-scrollbar { display: none; }
.pillnav a { padding: 9px 16px; border-radius: var(--r-pill); font-size: 13px; font-weight: 500; white-space: nowrap; color: #4b525a; display: flex; align-items: center; gap: 6px; }
.pillnav a:hover { color: var(--paper-text); background: var(--paper-2); }
.pillnav a.is-active { background: var(--lime); color: var(--lime-ink); font-weight: 600; }
.pillnav a.is-active i { width: 6px; height: 6px; border-radius: 50%; background: var(--lime-ink); }
.pillnav .pill-icon { width: 36px; height: 36px; padding: 0; justify-content: center; background: #15181c; color: #fff; border: 3px solid #cfd3d8; }
.pillnav .pill-icon:hover { background: #2a2f35; color: #fff; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-2); background: transparent; color: var(--text); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-3); }
.badge { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--lime); color: var(--lime-ink); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

.avatar {
  --hue: 200;
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #111;
  background: hsl(var(--hue) 70% 78%);
  border: 2px solid rgba(255, 255, 255, .9);
}
.avatar-lg { width: 42px; height: 42px; font-size: 14px; }
.user-menu { position: relative; }
.user-btn { background: none; border: 0; padding: 0; cursor: pointer; }
.popover {
  display: none; position: absolute; right: 0; top: 52px; z-index: 40; width: 230px;
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow);
}
.popover.is-open { display: grid; gap: 4px; }
.popover small { color: var(--muted); margin-bottom: 10px; }

/* ---------- Encabezado de página ---------- */
.page-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-title h1 { font-size: 40px; font-weight: 400; letter-spacing: -.02em; line-height: 1.1; }
.page-title p { color: var(--muted); margin-top: 4px; }
.page-actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: var(--r-pill);
  border: 1px solid var(--line-2); background: transparent; color: var(--text);
  font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap;
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.is-busy { opacity: .55; pointer-events: none; }
.btn-primary { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); }
.btn-primary:hover { background: var(--lime-2); }
.btn-light { background: var(--paper); color: var(--paper-text); border-color: var(--paper); }
.btn-light:hover { background: #e8eaed; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #e94c44; }
.btn-ghost-danger { color: #ff8b85; border-color: rgba(255, 95, 87, .4); }
.btn-ghost-danger:hover { background: rgba(255, 95, 87, .12); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- Tarjetas y estadísticas ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 22px; }
.card + .card { margin-top: 16px; }
.card h3 { font-size: 15px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-title h3 { margin: 0; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: 20px 22px; display: flex; flex-direction: column; gap: 6px; min-width: 0;
}
.stat-label { color: var(--muted); font-size: 13px; }
.stat-value { font-size: 30px; font-weight: 400; letter-spacing: -.02em; line-height: 1.15; overflow-wrap: anywhere; }
.stat-value small { font-size: 15px; color: var(--muted); margin-right: 3px; }
.stat-sub { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.stat.is-accent { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }
.stat.is-accent .stat-label, .stat.is-accent .stat-sub, .stat.is-accent small { color: rgba(13, 16, 3, .7); }
.stat.is-alert .stat-value { color: #ff8b85; }

.bar { height: 8px; border-radius: 6px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.bar > i {
  display: block; height: 100%; border-radius: 6px; background: var(--lime);
  background-image: repeating-linear-gradient(-45deg, rgba(0,0,0,.12) 0 4px, transparent 4px 8px);
}
.bar.is-low > i { background-color: var(--warn); }

/* ---------- Chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip-neutral { background: var(--surface-3); color: var(--text); border: 1px solid var(--line-2); }
.chip-ok { background: var(--lime); color: var(--lime-ink); }
.chip-danger { background: rgba(255, 95, 87, .16); color: #ff8b85; border: 1px solid rgba(255, 95, 87, .35); }
.chip-warn { background: rgba(255, 181, 71, .15); color: var(--warn); border: 1px solid rgba(255, 181, 71, .35); }
.chip-muted { background: transparent; color: var(--muted); border: 1px solid var(--line-2); }
.count { display: inline-flex; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; align-items: center; justify-content: center; font-size: 11px; background: rgba(255,255,255,.12); }

/* ---------- Filtros / pestañas ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar .label { font-weight: 600; margin-right: 6px; }
.search { position: relative; flex: 1 1 220px; max-width: 320px; }
.search input[type=search] { padding-left: 42px; }
.search .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.tabs { display: inline-flex; gap: 4px; padding: 5px; background: #0f1215; border-radius: var(--r-pill); border: 1px solid var(--line); flex-wrap: wrap; }
.tabs a { height: 34px; padding: 0 14px; border-radius: var(--r-pill); display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--muted); }
.tabs a:hover { color: var(--text); }
.tabs a.is-active { background: var(--lime); color: var(--lime-ink); font-weight: 600; }
.tabs a.is-active .count { background: var(--lime-ink); color: var(--lime); }

/* ---------- Panel dividido (lista blanca + detalle oscuro) ---------- */
.split {
  display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 18px;
  background: var(--paper); color: var(--paper-text); border-radius: var(--r-xl); padding: 18px;
  min-height: 520px;
}
.paper-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 6px 14px; gap: 10px; }
.paper-head h2 { font-size: 16px; font-weight: 600; }
.list { display: flex; flex-direction: column; gap: 4px; max-height: 760px; overflow-y: auto; padding-right: 4px; }
.row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 18px; color: var(--paper-text);
}
.row:hover { background: var(--paper-2); }
.row-main { display: flex; flex-direction: column; min-width: 0; }
.row-main b { font-weight: 700; font-size: 13px; }
.row-main small { color: var(--paper-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-chip .chip { background: var(--paper-2); color: #555c63; border: 1px solid var(--paper-line); height: 24px; font-size: 11px; }
.row-amount { font-size: 15px; font-weight: 500; white-space: nowrap; text-align: right; }
.row-amount small { font-size: 11px; color: var(--paper-muted); }
.row.is-selected { background: #15181c; color: #fff; }
.row.is-selected .row-main small, .row.is-selected .row-amount small { color: #a3abb3; }
.row.is-selected .row-chip .chip { background: #fff; color: #111; border-color: #fff; }
.list-empty { padding: 40px 10px; text-align: center; color: var(--paper-muted); }
.list-empty .ico { opacity: .4; margin-bottom: 8px; }

.detail { background: #15181c; color: var(--text); border-radius: 24px; padding: 24px; min-width: 0; }
.detail-head { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 18px; }
.detail-head .kicker { color: var(--muted); font-size: 12px; display: block; margin-bottom: 4px; }
.detail-head .folio { font-size: 30px; font-weight: 500; letter-spacing: -.02em; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.detail-head .folio small { color: var(--muted); font-size: 18px; }
.detail-head .who { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.detail-head .who b { display: block; font-size: 14px; }
.detail-head .who small { color: var(--muted); }
.section { margin-top: 22px; }
.section > h4 { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 10px; text-transform: uppercase; letter-spacing: .06em; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile { background: var(--surface-2); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; position: relative; min-height: 86px; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; }
.tile .tile-value { font-size: 20px; font-weight: 500; letter-spacing: -.01em; }
.tile .tile-value small { font-size: 12px; color: var(--muted); }
.tile .tile-label { color: var(--muted); font-size: 12px; }
.tile .tile-arrow { position: absolute; top: 12px; right: 12px; color: var(--muted); }
.tile.is-accent { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }
.tile.is-accent .tile-label, .tile.is-accent small { color: rgba(13, 16, 3, .7); }
.tile.is-warn { border-color: rgba(255, 181, 71, .45); }

.bottom-bar {
  margin-top: 22px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 22px;
  padding: 14px 16px 14px 22px; display: flex; align-items: center; gap: 26px; flex-wrap: wrap;
}
.bottom-bar .sum span { display: block; color: var(--muted); font-size: 12px; }
.bottom-bar .sum b { font-size: 20px; font-weight: 500; }
.bottom-bar .sum b small { font-size: 12px; color: var(--muted); }
.bottom-bar .btn-row { margin-left: auto; }

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 18px; }
.kv div span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.kv div b { font-weight: 600; overflow-wrap: anywhere; }

/* ---------- Candados y progreso ---------- */
.gate { background: var(--surface-2); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; }
.gate-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.gate-count { margin-left: auto; font-size: 12px; color: var(--muted); }
.gate ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.gate li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.gate li .ico { width: 20px; height: 20px; padding: 3px; border-radius: 50%; }
.gate li.ok .ico { background: var(--lime); color: var(--lime-ink); }
.gate li.no { color: #ffb3ae; }
.gate li.no .ico { background: rgba(255, 95, 87, .18); color: var(--danger); }

.stepper { list-style: none; display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 0; padding: 0; }
.stepper li { display: flex; flex-direction: column; gap: 6px; font-size: 11px; color: var(--muted); }
.stepper li span { height: 6px; border-radius: 4px; background: var(--surface-3); font-size: 0; }
.stepper li.done span { background: var(--lime); }
.stepper li.current span { background: linear-gradient(90deg, var(--lime) 50%, var(--surface-3) 50%); }
.stepper li.current em { color: var(--text); font-weight: 600; }
.stepper em { font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stepper.is-blocked li.current span { background: var(--danger); }

/* ---------- Formularios ---------- */
.form-grid { display: grid; gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12px; color: var(--muted); font-weight: 600; }
.field > span em { color: var(--danger); font-style: normal; }
.field .hint { font-size: 11px; color: var(--muted); }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=password],
input[type=date], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; height: 44px; padding: 0 16px; border-radius: var(--r-pill);
  border: 1px solid var(--line-2); background: #0f1215; color: var(--text);
  font: inherit; font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; min-height: 90px; padding: 12px 16px; border-radius: 18px; resize: vertical; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238d959e' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }
input:focus, select:focus, textarea:focus { border-color: var(--lime); box-shadow: 0 0 0 3px rgba(181, 242, 61, .15); }
input[type=file] { font: inherit; font-size: 12px; color: var(--muted); max-width: 100%; }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; font-size: 12px; height: 34px; padding: 0 14px; margin-right: 10px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: var(--surface-3); color: var(--text); cursor: pointer; }
.input-group { display: flex; gap: 8px; }
.input-group input { flex: 1; }

.check { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--lime); flex: none; }
.check:has(input:checked) { border-color: rgba(181, 242, 61, .5); }
.check small { display: block; color: var(--muted); }
.checks { display: grid; gap: 8px; }

.seg { display: inline-flex; padding: 4px; background: #0f1215; border: 1px solid var(--line-2); border-radius: var(--r-pill); }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; height: 34px; align-items: center; padding: 0 18px; border-radius: var(--r-pill); font-weight: 600; font-size: 13px; color: var(--muted); }
.seg input:checked + span { background: var(--lime); color: var(--lime-ink); }
.seg input:focus-visible + span { outline: 2px solid var(--lime); }

.form-errors:empty { display: none; }
.form-errors { margin-top: 12px; }
.form-errors .err { padding: 12px 16px; border-radius: 16px; background: rgba(255, 95, 87, .12); border: 1px solid rgba(255, 95, 87, .35); color: #ffc1bd; }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 16px; font-size: 13px; }
.badge-danger { background: var(--danger); color: #fff; }
.material-check .checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px; }
.material-check .check { padding: 8px 12px; font-size: 13px; }
/* Avisos importantes (Dirección / Finanzas): arriba de cada pantalla hasta que se atienden */
.alerts-strip { display: grid; gap: 8px; margin: -6px 0 18px; }
.notice { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 16px; font-size: 13.5px; color: var(--text); text-decoration: none; border: 1px solid; }
.notice > span { flex: 1; min-width: 0; }
.notice em { font-style: normal; font-weight: 700; font-size: 12px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .1); white-space: nowrap; }
.notice:hover em { background: rgba(255, 255, 255, .2); }
.notice.is-warn { background: rgba(255, 181, 71, .12); border-color: rgba(255, 181, 71, .45); color: #ffd699; }
.notice.is-info { background: rgba(181, 242, 61, .08); border-color: rgba(181, 242, 61, .35); color: #dff7b0; }
.notice.is-danger { background: rgba(255, 95, 87, .14); border-color: rgba(255, 95, 87, .55); color: #ffc2bf; }
.alert-warn { background: rgba(255, 181, 71, .12); border: 1px solid rgba(255, 181, 71, .4); color: #ffd699; }
.alert-danger { background: rgba(255, 95, 87, .12); border: 1px solid rgba(255, 95, 87, .4); color: #ffc1bd; }
.alert-info { background: rgba(108, 184, 255, .1); border: 1px solid rgba(108, 184, 255, .35); color: #bfe0ff; }
.alert-ok { background: rgba(181, 242, 61, .1); border: 1px solid rgba(181, 242, 61, .4); color: #dcf9a6; }

.calc { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.calc div { background: #0f1215; border: 1px dashed var(--line-2); border-radius: 16px; padding: 10px 14px; }
.calc span { display: block; color: var(--muted); font-size: 11px; }
.calc b { font-size: 18px; font-weight: 600; }
.calc .is-total { background: var(--lime); color: var(--lime-ink); border: 0; }
.calc .is-total span { color: rgba(13, 16, 3, .7); }

/* Firma */
.sig { display: grid; gap: 8px; }
.sig canvas { width: 100%; height: 180px; background: #fff; border-radius: 18px; touch-action: none; cursor: crosshair; display: block; }
.sig-actions { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; border-radius: 16px; border: 1px solid var(--line); }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 10px 14px; background: var(--surface-2); white-space: nowrap; }
.table td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.table td.num, .table th.num { text-align: right; white-space: nowrap; }

/* ---------- Miniaturas ---------- */
.thumbs { display: flex; gap: 12px; flex-wrap: wrap; }
.thumb { width: 130px; height: 100px; border-radius: 16px; overflow: hidden; position: relative; background: var(--surface-2); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 11px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb em { position: absolute; left: 6px; bottom: 6px; font-style: normal; font-size: 10px; background: rgba(0,0,0,.65); color: #fff; padding: 2px 8px; border-radius: 10px; }
.thumb.is-empty { border-style: dashed; }

/* ---------- Kanban ---------- */
/* Columnas blancas (como los paneles de lista) sobre el fondo oscuro */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 10px; scrollbar-color: #5d6670 transparent; }
.kcol { background: var(--paper); color: var(--paper-text); border: 1px solid var(--paper); border-radius: 24px; padding: 14px; display: flex; flex-direction: column; gap: 10px; min-height: 340px; }
.kcol-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 6px; }
.kcol-head b { font-size: 13px; }
.kcol-head small { color: var(--paper-muted); }
.kcol-head .count { margin-left: auto; background: var(--paper-2); color: var(--paper-text); }
.kcol.is-e99 { border-color: rgba(217, 48, 37, .45); background: linear-gradient(180deg, #fdecea, var(--paper) 140px); }
.kcol.is-e07 { border-color: var(--lime-2); box-shadow: inset 0 3px 0 var(--lime); }
.kcard { display: block; background: var(--paper-2); color: var(--paper-text); border: 1px solid var(--paper-line); border-radius: 18px; padding: 12px 14px; transition: border-color .15s, transform .15s, box-shadow .15s; }
.kcard:hover { border-color: var(--lime-2); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0, 0, 0, .08); }
.kcard-top { display: flex; justify-content: space-between; align-items: center; gap: 6px 8px; margin-bottom: 6px; flex-wrap: wrap; }
.kcard-top b { font-size: 13px; }
.kcard p { color: var(--paper-muted); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kcard-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 12px; color: var(--paper-muted); gap: 8px; }
.kcard-foot span:last-child { color: var(--paper-text); font-weight: 600; }
.kcard.is-stale { border-color: #f0b34a; background: #fff8ec; }
.kcard .chip-danger { background: #fdecea; color: #c5221f; border-color: #f4b4ae; }
.kcard .sla { color: #3d7c00; }
.kcard .sla.is-near { color: #b26a00; }
.kcard .sla.is-late { color: #d93025; }
.kcol-empty { color: var(--paper-muted); font-size: 12px; text-align: center; padding: 24px 0; border: 1px dashed #d5d9de; border-radius: 16px; }

/* ---------- SLA ---------- */
.sla { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--lime); white-space: nowrap; }
.sla.is-late { color: var(--danger); }
.sla.is-near { color: var(--warn); }
.row .sla { color: #3d7c00; }
.row .sla.is-late { color: #d93025; }
.row .sla.is-near { color: #b26a00; }
.row.is-selected .sla { color: var(--lime); }
.sla-big { font-size: 28px; font-weight: 500; }

/* ---------- Línea de tiempo ---------- */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { position: relative; padding: 0 0 16px 22px; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--lime); }
.timeline li::after { content: ""; position: absolute; left: 8px; top: 18px; bottom: 0; width: 1px; background: var(--line-2); }
.timeline li:last-child::after { display: none; }
.timeline li.to-e99::before { background: var(--danger); }
.timeline small { color: var(--muted); display: block; }

/* ---------- Pareto / barras ---------- */
.hbars { display: grid; gap: 12px; }
.hbar { display: grid; grid-template-columns: 220px minmax(0, 1fr) 110px; gap: 14px; align-items: center; font-size: 13px; }
.hbar .track { height: 26px; background: var(--surface-2); border-radius: 10px; overflow: hidden; position: relative; }
.hbar .track i { display: block; height: 100%; background: var(--lime); border-radius: 10px; }
.hbar .track i.is-tail { background: #5d6670; }
.hbar .val { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.hbar .val b { color: var(--text); }
.funnel { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.funnel div { background: var(--surface-2); border-radius: 16px; padding: 12px 14px; border: 1px solid var(--line); }
.funnel span { display: block; font-size: 11px; color: var(--muted); }
.funnel b { font-size: 24px; font-weight: 500; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(5, 6, 8, .7); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-card { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-xl); padding: 24px; display: grid; gap: 16px; box-shadow: var(--shadow); }
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { display: flex; align-items: center; gap: 8px; font-size: 18px; }
.modal-card form { display: grid; gap: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: grid; gap: 10px; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--paper); color: var(--paper-text); padding: 12px 16px; border-radius: 16px; box-shadow: var(--shadow); font-weight: 600; display: flex; gap: 10px; align-items: center; animation: toast-in .2s ease-out; }
.toast.is-error { background: #2a1513; color: #ffc1bd; border: 1px solid rgba(255, 95, 87, .5); }
.toast .ico { flex: none; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Vacíos / login ---------- */
.empty-state { text-align: center; padding: 60px 20px; display: grid; justify-items: center; gap: 12px; color: var(--muted); }
.empty-state h2 { color: var(--text); font-size: 20px; }
.detail .empty-state { padding: 80px 20px; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 34px; display: grid; gap: 18px; box-shadow: var(--shadow); }
.login-card h1 { font-size: 30px; font-weight: 400; }

/* ---------- Varios ---------- */
.two-col { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.divider { height: 1px; background: var(--line); margin: 22px 0; }
.link { color: var(--lime); font-weight: 600; }
.link:hover { text-decoration: underline; }
.mono { font-variant-numeric: tabular-nums; }
.text-right { text-align: right; }
.stack { display: grid; gap: 14px; }

/* ---------- Cotizador ---------- */
.cot-inputs { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.cot-inputs .field { flex: 1 1 180px; max-width: 260px; }
.cot-x { color: var(--muted); padding-top: 38px; }
.cot-m2 { display: flex; flex-direction: column; gap: 6px; min-width: 130px; }
.cot-m2 span { font-size: 12px; color: var(--muted); font-weight: 600; }
.cot-m2 b { height: 44px; display: flex; align-items: center; font-size: 22px; font-weight: 500; }
.cot-inputs .btn { margin-top: 25px; height: 44px; }
.cot-grid { margin-top: 16px; }
.cot-grid > .card, .card { min-width: 0; }
.cot-grid .card + .card { margin-top: 0; }
.cot-grid .card { margin-bottom: 16px; }
.tier { display: inline-flex; padding: 1px 7px; border-radius: 8px; font-size: 11px; font-weight: 700; background: var(--surface-3); color: var(--text); }
.tier-publico { background: var(--lime); color: var(--lime-ink); }
.price-table td { padding: 8px 10px; }
.pick {
  font: inherit; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text);
  background: transparent; border: 1px solid transparent; border-radius: 12px; padding: 8px 10px; cursor: pointer; white-space: nowrap;
}
.pick:hover { border-color: var(--line-2); background: var(--surface-2); }
.pick.is-picked { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }
.cot-share-row { display: grid; grid-template-columns: minmax(220px, 1.2fr) 1fr 1fr auto auto; gap: 14px; align-items: end; }
.price-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.price-groups .card + .card { margin-top: 0; }
.price-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 12px; align-items: center; font-size: 13px; }
.price-row code { font-size: 11px; color: var(--muted); }
.price-row input { height: 38px; text-align: right; }

/* ---------- Cotizador integrado en Comercial ---------- */
.qmatrix { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 12px; }
.qm-block { display: grid; gap: 6px; min-width: 0; }
.qm-block > b { font-size: 13px; }
.qm-table th, .qm-table td { padding: 6px 8px; }
.qm-table th { font-size: 11px; }
.qm-table td:first-child { font-size: 12px; white-space: nowrap; }
.qm-table .pick { font-size: 13px; padding: 6px 8px; }

/* ---------- Cliente que regresa (alta de prospecto) ---------- */
.client-match { margin-top: 14px; display: grid; gap: 10px; padding: 14px 16px; border-radius: 16px; background: rgba(181, 242, 61, .08); border: 1px solid rgba(181, 242, 61, .4); font-size: 13px; }
.cm-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cm-head .link { margin-left: auto; }
.cm-stats { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); }
.cm-stats b { color: var(--text); }
.cm-orders { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.cm-orders li { padding: 6px 10px; border-radius: 10px; background: rgba(0, 0, 0, .25); }
.cm-notes { color: var(--muted); }
.client-match .btn { justify-self: start; }

/* ---------- Liberar OP: anticipo sí / no ---------- */
.deposit-row { flex: 1 1 100%; display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.deposit-row .field { flex: 0 1 220px; }

/* ---------- Selector de agenda ---------- */
.slot-picker { display: grid; gap: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 18px; padding: 14px; }
.sp-head { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.sp-head .field { flex: 1 1 200px; }
.sp-info { color: var(--muted); font-size: 12px; padding-bottom: 12px; }
.sp-days, .sp-times { display: flex; gap: 6px; flex-wrap: wrap; }
.sp-days { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
.sp-day, .sp-time { font: inherit; cursor: pointer; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); border-radius: 12px; }
.sp-day { display: flex; flex-direction: column; align-items: center; padding: 8px 12px; font-weight: 700; font-size: 13px; white-space: nowrap; flex: none; }
.sp-day small { font-weight: 500; color: var(--muted); font-size: 11px; }
.sp-time { padding: 8px 12px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sp-day:hover, .sp-time:hover { border-color: var(--lime); }
.sp-day.is-on, .sp-time.is-on { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }
.sp-day.is-on small { color: rgba(13, 16, 3, .7); }
.sp-chosen:empty, .sp-current:empty { display: none; }
.sp-chosen { font-size: 13px; padding: 8px 12px; border-radius: 12px; background: rgba(181, 242, 61, .1); border: 1px solid rgba(181, 242, 61, .35); }

/* ---------- Agenda (semana) ---------- */
.agenda-week { width: 100%; border-collapse: separate; border-spacing: 6px; table-layout: fixed; min-width: 980px; }
.agenda-week th { font-size: 12px; color: var(--muted); font-weight: 600; text-align: left; padding: 4px 6px; }
.agenda-week th.is-today { color: var(--lime); }
.agenda-week td { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 8px; vertical-align: top; font-size: 12px; }
.agenda-week td.who { background: transparent; border: 0; font-weight: 700; font-size: 13px; width: 150px; }
.agenda-week td.who small { display: block; color: var(--muted); font-weight: 500; }
.agenda-week td.off { background: repeating-linear-gradient(-45deg, var(--surface-2) 0 8px, #191c20 8px 16px); color: var(--muted); }
.ag-hours { color: var(--muted); font-size: 11px; margin-bottom: 6px; }
.ag-free { color: var(--lime); font-size: 11px; margin-top: 6px; }
.ag-item { display: block; border-radius: 10px; padding: 6px 8px; margin-bottom: 4px; background: #23303f; border-left: 3px solid var(--info); }
.ag-item.inst { background: #2a2f1f; border-left-color: var(--lime); }
.ag-item.done { opacity: .55; }
.ag-item.is-conflict { background: rgba(255, 95, 87, .15); border-left-color: var(--danger); }
.ag-item b { display: block; }
.ag-block { display: block; border-radius: 10px; padding: 5px 8px; margin-bottom: 4px; background: rgba(255, 181, 71, .14); color: #ffd699; }
.ag-head-block { display: block; font-weight: 500; color: #ffd699; font-size: 11px; }

/* ---------- Mi página (panel del vendedor) ---------- */
.slug-prefix { display: inline-flex; align-items: center; padding: 0 4px 0 2px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.media-row { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 16px; align-items: start; }
.media-preview { border-radius: 16px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; }
.media-preview img { width: 100%; height: 100%; object-fit: cover; }
.media-wide { aspect-ratio: 2 / 1; }
.media-round { width: 120px; height: 120px; border-radius: 50%; }
.avatar-xl { width: 120px; height: 120px; font-size: 36px; border: 0; }
.gallery-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.gallery-item { background: var(--surface-2); border: 1px solid var(--line); border-radius: 18px; padding: 10px; display: grid; gap: 8px; }
.gallery-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; }
.gallery-item input[type=text] { height: 38px; font-size: 13px; }
.gallery-item .icon-btn { width: 38px; height: 38px; }
.gallery-tools { justify-content: space-between; }
.gallery-tools .btn-ghost-danger { margin-left: auto; }
.text-right.hint { align-self: flex-end; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
  .list { max-height: 360px; }
  .two-col { grid-template-columns: 1fr; }
  .hbar { grid-template-columns: 140px minmax(0, 1fr) 90px; }
  .grid-2.cot-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .app { padding: 12px 16px 40px; }
  .topbar { flex-wrap: wrap; gap: 10px; }
  .pillnav { order: 3; width: 100%; margin-left: 0; }
  .page-title h1 { font-size: 30px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 16px; border-radius: 22px; }
  .stat-value { font-size: 22px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2.cot-grid { grid-template-columns: minmax(0, 1fr); }
  .price-table small { display: none; }
  .price-table td, .price-table th { padding: 8px 6px; }
  .pick { padding: 6px 4px; font-size: 13px; }
  .split { padding: 10px; border-radius: 22px; }
  .detail { padding: 16px; border-radius: 18px; }
  .detail-head .folio { font-size: 24px; }
  .detail-head .who { margin-left: 0; }
  .stepper { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .stepper em { display: none; }
  .hbar { grid-template-columns: 1fr; gap: 4px; }
  .hbar .val { text-align: left; }
  .bottom-bar .btn-row { margin-left: 0; width: 100%; }
  .cot-x { display: none; }
  .cot-inputs .field { max-width: none; }
  .cot-share-row { grid-template-columns: 1fr; }
  .price-groups { grid-template-columns: 1fr; }
  .media-row { grid-template-columns: 1fr; }
}

/* ---------- Impresión (hoja de despiece, acta) ---------- */
@media print {
  body { background: #fff; color: #000; }
  .topbar, .page-actions, .no-print, .toasts, .btn, .split > .paper-col { display: none !important; }
  .split { display: block; padding: 0; }
  .detail, .card, .tile, .gate, .calc div { background: #fff !important; color: #000 !important; border: 1px solid #ccc !important; }
  .table th { background: #eee; color: #000; }
  .muted, .tile-label, .kv div span { color: #444 !important; }
}

/* Expediente (Entregadas) en pantalla */
.dossier-screen .dx-sec { margin-top: 18px; }
.dossier-screen .dx-sec:first-child { margin-top: 0; }
.dossier-screen .dx-sec h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--lime); margin: 0 0 8px; }
.dossier-screen table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dossier-screen th, .dossier-screen td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.dossier-screen .dx-kv th { width: 30%; color: var(--muted); font-weight: 500; }
.dossier-screen .dx-tbl th { color: var(--muted); font-weight: 600; }
.dossier-screen .num { text-align: right; white-space: nowrap; }
.dossier-screen .dx-img { display: inline-block; width: 200px; margin: 10px 10px 0 0; vertical-align: top; }
.dossier-screen .dx-img img { width: 100%; height: 150px; object-fit: cover; border-radius: 12px; background: #fff; }
.dossier-screen .dx-img small { display: block; color: var(--muted); margin-top: 4px; }
.filters .chip { text-decoration: none; }
/* Dashboard de Dirección y KPIs */
.dash-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.dash-card {
  display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 22px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl);
}
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-6 { grid-column: span 6; } .span-8 { grid-column: span 8; }
.dash-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.dash-value { font-size: 30px; font-weight: 500; letter-spacing: -.02em; overflow-wrap: anywhere; }
.dash-value small { font-size: 15px; }
.dash-sub { font-size: 12px; color: var(--muted); }
.dash-card.is-lime { background: var(--lime); border-color: transparent; color: var(--lime-ink); }
.dash-card.is-lime .dash-value { font-size: 44px; }
.dash-card.is-paper { background: var(--paper); border-color: transparent; color: var(--paper-text); }
.dash-card.is-lime .dash-label, .dash-card.is-lime .dash-sub { color: rgba(13, 16, 3, .72); }
.dash-card.is-paper .dash-label, .dash-card.is-paper .dash-sub { color: var(--paper-muted); }
.dash-card.is-alert { border-color: var(--danger); }
.dash-card.is-alert .dash-value { color: var(--danger); }
.dash-bars { display: flex; align-items: stretch; gap: 8px; height: 150px; margin-top: auto; padding-top: 14px; }
.dash-bars > div { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.dash-bars small { font-size: 11px; white-space: nowrap; }
.dash-bars span { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.dash-bars i { display: block; width: 100%; min-height: 3px; border-radius: 10px; background: var(--lime); }
.dash-bars > div:last-child i { background: var(--text); }
.dash-bars em { font-size: 11px; font-style: normal; opacity: .75; }
.is-lime .dash-bars i { background: rgba(13, 16, 3, .28); }
.is-lime .dash-bars > div:last-child i { background: var(--lime-ink); }
.dash-ring { position: relative; width: 116px; margin: 8px auto; }
.dash-ring svg { display: block; transform: rotate(-90deg); }
.dash-ring circle { fill: none; stroke: var(--surface-3); stroke-width: 3.2; }
.dash-ring .val { stroke: var(--lime); stroke-linecap: round; }
.dash-ring.is-low .val { stroke: var(--warn); }
.dash-ring b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 600; }
.dash-flow { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.dash-flow > div { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); border-top: 3px solid var(--surface-3); }
.dash-flow > .is-on { border-top-color: var(--lime); }
.dash-flow b { font-size: 20px; }
.dash-flow small { font-size: 11px; color: var(--muted); }
@media (max-width: 1100px) {
  .span-3, .span-4 { grid-column: span 6; } .span-6, .span-8 { grid-column: span 12; }
  .dash-flow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .span-3, .span-4 { grid-column: span 12; }
  .dash-card.is-lime .dash-value { font-size: 32px; }
  .dash-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Celular: objetivos táctiles cómodos (44 px) */
@media (max-width: 720px) {
  .pillnav a, .tabs a, .btn, .btn-sm, .chip[href], .icon-btn { min-height: 44px; display: inline-flex; align-items: center; }
  .pill-icon { flex: none; min-width: 44px; justify-content: center; }
  .icon-btn { min-width: 44px; justify-content: center; }
  input:not([type=hidden]):not([type=checkbox]):not([type=radio]), select, textarea { min-height: 44px; font-size: 16px; }
  .link { display: inline-block; padding: 12px 0; }
}@media (max-width: 720px) {
  .input-group { flex-wrap: wrap; }
  .input-group input { min-width: 0; flex-basis: 100%; }
  .input-group .btn { width: 100%; justify-content: center; }
  .slug-prefix { overflow-wrap: anywhere; min-width: 0; }
}@media (max-width: 1100px) { .two-col { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) { .slug-prefix { white-space: normal; } }@media (max-width: 720px) {
  .media-row { grid-template-columns: minmax(0, 1fr); }
  .stack { min-width: 0; }
  input[type=file] { max-width: 100%; }
}@media (max-width: 720px) {
  .btn-row { flex-wrap: wrap; min-width: 0; max-width: 100%; }
  .btn-row form { min-width: 0; max-width: 100%; }
  .btn-row input { min-width: 0; max-width: 100%; }
}@media (max-width: 720px) { .card-title { flex-wrap: wrap; } .card-title > * { min-width: 0; max-width: 100%; } }
@media (max-width: 720px) { input[type=file] { width: 100%; min-width: 0; } .media-row > *, .stack > * { min-width: 0; max-width: 100%; } }

/* Calendario de citas */
.cal { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.cal-grid small { color: var(--muted); padding: 4px 0; }
.cal button:not(.btn) { min-height: 40px; border: 0; border-radius: 10px; background: var(--surface-3); color: var(--text); font: inherit; cursor: pointer; }
.cal button:disabled { opacity: .3; cursor: default; }
.cal button.is-on { background: var(--lime); color: var(--lime-ink); font-weight: 700; }
.cal-times { display: grid; grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 4px; margin-top: 10px; max-height: 150px; overflow-y: auto; }.field:has(.cal) { grid-column: 1 / -1; }

/* Campo: panel de captura del técnico en fondo blanco (redefine la paleta oscura solo aquí) */
.detail-light {
  --surface: #ffffff; --surface-2: #f3f4f6; --surface-3: #e5e7eb;
  --line: #e2e5e9; --line-2: #cfd4da; --text: #14171a; --muted: #5f6770;
  background: #ffffff; color: var(--text);
}
.detail-light input:not([type=checkbox]):not([type=radio]), .detail-light select, .detail-light textarea {
  background: #ffffff; color: var(--text); border-color: var(--line-2);
}
.detail-light input::placeholder, .detail-light textarea::placeholder { color: #8a929b; }
.detail-light .folio, .detail-light .who b, .detail-light .tile, .detail-light .tile-value, .detail-light label, .detail-light .field > span { color: var(--text); }
.detail-light .section h4, .detail-light h4 { color: var(--text); font-weight: 800; font-size: 15px; }
.detail-light .section h4 small { font-weight: 500; }
.detail-light .bottom-bar { background: #ffffff; border-color: var(--line); color: var(--text); }
.detail-light .link { color: #3f7d00; }
.detail-light .btn:not(.btn-primary) { background: #ffffff; color: var(--text); border-color: var(--line-2); }
.detail-light .seg label span { color: var(--text); }
.detail-light canvas { background: #f3f4f6; }.detail-light .calc, .detail-light .calc > div:not(.is-total) { background: #f3f4f6; color: var(--text); border-color: var(--line); }
.detail-light .calc > div:not(.is-total) span, .detail-light .calc > div:not(.is-total) b { color: var(--text); }
.detail-light .seg { background: #f3f4f6; border: 1px solid var(--line-2); }
.detail-light .seg label span { color: var(--text); }
.detail-light .seg input:checked + span { background: var(--lime); color: var(--lime-ink); }
.detail-light form .hint { display: block; margin-bottom: 8px; }
/* Visita no atendida en su fecha: advertencia amarilla que resalta */
.chip.chip-missed { background: #ffd400; color: #1a1600; border-color: #d9b400; font-weight: 800; }
.kcard.is-missed, .row:has(.chip-missed) { background: #fff3a6; border: 2px solid #ffd400; color: #1a1600; animation: missed-pulse 1.6s ease-in-out infinite; }
.kcard.is-missed p, .kcard.is-missed .kcard-foot, .row:has(.chip-missed) small { color: #4d4300; }
@keyframes missed-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 212, 0, .75); } 50% { box-shadow: 0 0 0 7px rgba(255, 212, 0, 0); } }
@media (prefers-reduced-motion: reduce) { .kcard.is-missed, .row:has(.chip-missed) { animation: none; } }