/* Sistema de Leads PRO · RED BLAK
   Estética fiel al diseño Claude Design de Adrián (mismo lenguaje visual que kpis.rblak.com). */

:root {
  --bg: #fafafb;
  --surface: #ffffff;
  --surface-muted: #f4f4f6;
  --seg-bg: #f1f0ec;
  --border: #e6e7ec;
  --border-soft: #eff0f3;
  --text: #111318;
  --text-2: #555a64;
  --text-3: #808692;
  --indigo: #39429b;
  --indigo-soft: #eef0ff;
  --indigo-border: #4d58b8;
  --green: #147f4c;
  --green-bg: #eaf7f0;
  --amber: #9a6700;
  --amber-bg: #fff8e1;
  --amber-border: #f0d78c;
  --red: #b42318;
  --red-bg: #fef3f2;
  --blue-bg: #eef4ff;
  --blue: #274799;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 14px;
  --shadow-xs: 0 1px 2px rgba(17, 19, 24, 0.04);
  --shadow-sm: 0 2px 8px rgba(17, 19, 24, 0.06);
  --shadow-md: 0 10px 30px rgba(17, 19, 24, 0.14);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.num { font-variant-numeric: tabular-nums; }

/* Modo discreción (difumina nombres y teléfonos) */
body.modo-discrecion .sensible {
  filter: blur(5px);
  user-select: none;
  transition: filter 0.15s ease;
}
body.modo-discrecion .sensible:hover {
  filter: blur(0);
}

/* Layout principal */
.app-shell {
  display: grid;
  grid-template-columns: 224px 1fr;
  min-height: 100vh;
}

/* Barra lateral izquierda */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand-link {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 10px 18px;
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
}
.brand-wordmark {
  font-size: 19px;
  letter-spacing: -0.03em;
  line-height: 1;
}
.brand-wordmark .red { font-weight: 400; }
.brand-wordmark .blak { font-weight: 800; }
.brand-sub {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-3);
  text-transform: uppercase;
}

.nav-group-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-3);
  text-transform: uppercase;
  padding: 8px 10px 6px;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.nav-item:hover {
  background: #f5f6f8;
  color: var(--text);
}
.nav-item.active {
  background: #eff0f3;
  color: var(--text);
  font-weight: 600;
}

.sidebar-spacer { flex: 1; }

.sync-status {
  margin: 0 6px 10px;
  padding: 7px 10px;
  border-radius: 9px;
  background: #f6f7f9;
  border: 1px solid var(--border-soft);
  font-size: 11px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 7px;
}
.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #147f4c;
  flex: none;
}
.sync-dot.local { background: #d97706; }

/* Menú de cuenta inferior */
.account-box {
  position: relative;
  border-top: 1px solid var(--border-soft);
  padding-top: 10px;
}

.account-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.account-btn:hover { background: #f5f6f8; }

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #17181c;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex: none;
}
.account-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}
.avisos-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
}

.account-menu {
  position: absolute;
  bottom: 52px;
  left: 4px;
  right: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  box-shadow: var(--shadow-md);
  padding: 6px;
  z-index: 40;
}
.account-menu[hidden] { display: none; }
.account-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  text-align: left;
}
.account-menu-item:hover { background: #f4f5f7; }

/* Contenido principal */
.main-content {
  padding: 28px 36px 88px;
  max-width: 1340px;
  width: 100%;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.page-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.page-title {
  margin: 0;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
}
.page-subtitle {
  margin: 6px 0 0;
  font-size: 13.5px;
  color: var(--text-2);
}

/* Segmented controls (Cierre/Exclientes/Referidos, Venta/Valor, Tabla/Tablero) */
.segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--seg-bg);
  border-radius: 10px;
}
.seg-btn {
  border: 0;
  background: transparent;
  padding: 6px 13px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.12s ease;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

/* Pill buttons (7/30/90d, Ver por, Closers) */
.pills-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pills-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-right: 4px;
}
.pill-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s ease;
}
.pill-btn:hover {
  border-color: #cfd3dc;
  color: var(--text);
}
.pill-btn.active {
  background: var(--indigo-soft);
  border-color: var(--indigo-border);
  color: var(--indigo);
  font-weight: 600;
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-xs);
}
.kpi-label {
  font-size: 12.5px;
  color: var(--text-2);
  margin-bottom: 6px;
}
.kpi-value {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  line-height: 1.15;
}
.kpi-sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-3);
}

/* Cards genéricas */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-xs);
  margin-bottom: 18px;
}
.card-title {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.card-title .muted {
  font-weight: 400;
  color: var(--text-2);
  margin-left: 6px;
  font-size: 13.5px;
}

/* Gráfica de barras de Funnel */
.funnel-chart {
  display: grid;
  gap: 14px;
  align-items: end;
  padding-top: 8px;
}
.funnel-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.funnel-step-pct {
  height: 24px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--indigo);
  margin-bottom: 6px;
}
.funnel-bar-wrap {
  height: 184px;
  display: flex;
  align-items: flex-end;
}
.funnel-bar {
  width: 100%;
  border-radius: 7px 7px 2px 2px;
  background: var(--indigo);
  min-height: 8px;
  transition: height 0.25s ease;
}
.funnel-bar.out-of-scale {
  height: 100% !important;
  background: #ffffff;
  border: 1.5px dashed #cfd4df;
  border-radius: 7px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10px;
  font-size: 11px;
  color: var(--text-3);
}
.funnel-count {
  margin-top: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.funnel-stage-name {
  font-size: 12.5px;
  color: var(--text-2);
  margin-top: 2px;
}

.dato-footer {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
}
.dato-footer strong {
  color: var(--text-2);
  font-weight: 600;
}

/* Tablas */
.table-wrap { overflow-x: auto; }
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.data-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data-table th.right,
table.data-table td.right {
  text-align: right;
}
table.data-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}
table.data-table tr.total-row td {
  font-weight: 700;
  background: #fafbfe;
}
table.data-table tbody tr:hover {
  background: #fafbfe;
}
.cell-sub-pct {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-3);
  margin-top: 2px;
}

/* Leads Toolbar y Badges */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.search-input {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 9px;
  padding: 7px 12px;
  min-width: 240px;
  font-size: 13px;
  outline: none;
}
.search-input:focus {
  border-color: var(--indigo-border);
  box-shadow: 0 0 0 3px rgba(57, 66, 155, 0.1);
}

.lead-name-btn {
  border: 0;
  background: transparent;
  padding: 0;
  font-weight: 600;
  color: var(--indigo);
  cursor: pointer;
  text-align: left;
}
.lead-name-btn:hover { text-decoration: underline; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-neutral { background: #f1f2f5; color: #3c414d; }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-indigo { background: var(--indigo-soft); color: var(--indigo); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-blue { background: var(--blue-bg); color: var(--blue); }

.score-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 3px 7px;
  border-radius: 7px;
  font-weight: 700;
  font-size: 12.5px;
  background: #f1f2f5;
  color: var(--text);
}
.score-pill.high { background: var(--indigo-soft); color: var(--indigo); }

/* Ficha del lead */
.ficha-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.95fr);
  gap: 18px;
  align-items: start;
}
.back-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 9px;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 16px;
}
.back-btn:hover { background: #f6f7f9; }

.ficha-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.ficha-name {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.ficha-meta {
  font-size: 13px;
  color: var(--text-2);
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.tl-item {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 12px;
  align-items: start;
}
.tl-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 5px;
  background: #5b616e;
}
.tl-dot.programado { background: #fff; border: 2px solid var(--indigo); }
.tl-dot.llamada { background: #8c5a2b; }
.tl-dot.positivo { background: #147f4c; }
.tl-top {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-3);
}
.tl-title {
  margin: 4px 0 3px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}
.tl-ref {
  border: 0;
  background: transparent;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--indigo);
  text-decoration: underline;
  cursor: pointer;
}

.score-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
.score-big {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.kv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
}
.kv-row + .kv-row { border-top: 1px solid var(--border-soft); }

/* Setup Secuencias */
.seq-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.seq-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.seq-filter-label {
  font-size: 12.5px;
  color: var(--text-2);
}

.traffic-toggle-btn {
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
}
.traffic-toggle-btn:hover { background: #f0f1f4; color: var(--text); }

.traffic-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}
.traffic-rule {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fafafb;
  border: 1px solid var(--border-soft);
}
.traffic-rule-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
}
.traffic-rule-help {
  font-size: 11.5px;
  color: var(--text-3);
}
.traffic-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
}
.mini-num {
  width: 56px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  font-weight: 600;
  text-align: center;
}
.progress-track {
  height: 7px;
  background: #e6e7ec;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
}
.progress-fill {
  height: 100%;
  background: var(--indigo);
  border-radius: 999px;
}

.valor-banner {
  background: #f4f7ff;
  border: 1px solid #d9e2ff;
  border-radius: 11px;
  padding: 10px 14px;
  font-size: 13px;
  color: #24356b;
  margin-bottom: 14px;
}

.seq-cards-row {
  display: flex;
  align-items: stretch;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.seq-card {
  flex: 1 1 240px;
  max-width: 310px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.12s ease;
  position: relative;
}
.seq-card:hover { border-color: #c5cad8; }
.seq-card.active {
  border-color: var(--indigo-border);
  background: #fbfcff;
  box-shadow: 0 0 0 1px var(--indigo-border);
}
.seq-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.seq-letter {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #17181c;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.seq-card-name {
  font-weight: 700;
  font-size: 14px;
  flex: 1;
}
.seq-card-sub {
  font-size: 12px;
  color: var(--text-2);
}
.seq-card-lift {
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
  margin-top: 2px;
}
.add-circle-btn {
  width: 42px;
  height: 42px;
  align-self: center;
  border: 1px dashed #cfd3dc;
  background: var(--surface);
  border-radius: 11px;
  font-size: 20px;
  color: var(--text-2);
  cursor: pointer;
}
.add-circle-btn:hover { border-color: var(--indigo); color: var(--indigo); }

/* Flow horizontal */
.flow-strip {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  overflow-x: auto;
  padding: 10px 4px 6px;
}
.flow-node {
  min-width: 148px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
}
.flow-node:hover { background: #f7f8fb; }
.flow-node.active {
  background: #f5f6ff;
  border-color: #d6dbfc;
}
.step-num-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #2b2f38;
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
}
.step-num-dot.active { background: var(--indigo); }

/* Cards editables de pasos */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.step-card.active {
  border-color: var(--indigo-border);
  box-shadow: 0 0 0 1px rgba(77, 88, 184, 0.25);
}
.step-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.select-sm, .input-sm, .textarea-sm {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 6px 9px;
  font-size: 12.5px;
  outline: none;
}
.select-sm:focus, .input-sm:focus, .textarea-sm:focus {
  border-color: var(--indigo-border);
}
.textarea-sm {
  width: 100%;
  min-height: 78px;
  resize: vertical;
  line-height: 1.45;
}
.step-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
}
.step-metric-box {
  background: #fafafb;
  border-radius: 8px;
  padding: 7px 9px;
}
.step-metric-label { font-size: 11px; color: var(--text-3); }
.step-metric-val { font-size: 13.5px; font-weight: 700; color: var(--text); }
.step-metric-pct { font-size: 11px; color: var(--text-2); margin-left: 4px; }

.step-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.icon-btn {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 7px;
  padding: 4px 8px;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
}
.icon-btn:hover { background: #f3f4f7; color: var(--text); }
.icon-btn.danger:hover { background: var(--red-bg); color: var(--red); border-color: #f4c7c3; }

/* Closer */
.construction-banner {
  background: #fffbea;
  border: 1px solid var(--amber-border);
  border-radius: 13px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.construction-icon { font-size: 28px; line-height: 1; }
.construction-pill {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 6px;
  background: #17181c;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.kanban-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(215px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.kanban-col {
  background: #f6f6f8;
  border: 1px solid var(--border-soft);
  border-radius: 13px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.kanban-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 13px;
}
.kanban-col-sub {
  font-size: 11.5px;
  color: var(--text-2);
  margin-top: 2px;
}
.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-xs);
}
.kanban-card-title { font-weight: 700; font-size: 13.5px; }
.kanban-card-meta { font-size: 11.5px; color: var(--text-2); }
.kanban-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--border-soft);
}

.dot-alerta {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 5px;
}
.dot-alerta.verde { background: #16a34a; }
.dot-alerta.ambar { background: #d97706; }
.dot-alerta.rojo { background: #dc2626; }

/* Botón flotante Reportar (idéntico al diseño de Adrián y kpis.rblak.com) */
.floating-report {
  position: fixed;
  right: 24px;
  bottom: 22px;
  z-index: 50;
  background: #111318;
  color: #ffffff;
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.floating-report:hover { background: #232630; }

/* Modales */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 19, 24, 0.42);
  display: grid;
  place-items: center;
  z-index: 80;
  padding: 16px;
}
.modal-backdrop[hidden] { display: none; }
.modal-box {
  background: var(--surface);
  border-radius: 15px;
  border: 1px solid var(--border);
  width: 100%;
  max-width: 480px;
  padding: 22px;
  box-shadow: var(--shadow-md);
}
.modal-title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
}
.modal-sub {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--text-2);
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}
.form-field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}
.btn-primary {
  border: 0;
  background: var(--indigo);
  color: #fff;
  border-radius: 9px;
  padding: 8px 15px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary:hover { background: #2e3685; }
.btn-secondary {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 9px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.btn-secondary:hover { background: #f5f6f8; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #17181c;
  color: #fff;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13px;
  z-index: 90;
  box-shadow: var(--shadow-md);
}
.toast[hidden] { display: none; }

@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .main-content { padding: 18px 16px 88px; }
  .ficha-grid { grid-template-columns: 1fr; }
}
