/* ==========================================================================
   Kreatik OS — components.css
   Cards, botones, formularios, modal, historial, tabla de cotización.
   ========================================================================== */

/* ---------- Custom scrollbar for tables ---------- */
.table-scroll {
  overflow-x: auto;
  border-radius: var(--radius);
}
.table-scroll::-webkit-scrollbar {
  height: 8px;
}
.table-scroll::-webkit-scrollbar-track {
  background: var(--surface-2);
  border-radius: 10px;
}
.table-scroll::-webkit-scrollbar-thumb {
  background: #3a3e4a;
  border-radius: 10px;
}
.table-scroll::-webkit-scrollbar-thumb:hover {
  background: #4a4e5a;
}
.table-scroll {
  scrollbar-width: thin;
  scrollbar-color: #3a3e4a var(--surface-2);
}

/* ---------- Card ---------- */
.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
}

.card-tight { padding: 16px 18px; }

.card-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 3px;
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.section-heading {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-heading::before {
  content: '';
  width: 3px; height: 12px;
  background: var(--accent);
  border-radius: 2px;
}

/* ---------- Stat card (dashboard) ---------- */
.stat-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--surface-1), var(--surface-0));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 20px 18px;
  box-shadow: var(--shadow-card);
  transition: border-color var(--fast) var(--ease), transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--stat-icon-color, var(--accent)), transparent);
  opacity: 0.7;
}
.stat-card:hover {
  border-color: #2a2e3a;
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}
.stat-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.stat-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--stat-icon-bg, var(--accent-soft));
  color: var(--stat-icon-color, var(--accent));
  flex-shrink: 0;
}
.stat-icon i { font-size: 15px; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-bottom: 0; }
.stat-value { font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.stat-value.accent { color: var(--accent-2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-primary);
  transition: all var(--fast) var(--ease);
  white-space: nowrap;
}
.btn:hover { background: var(--surface-hover); border-color: #2c303c; }
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 0 var(--accent-glow);
}
.btn-primary:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
  box-shadow: 0 0 18px var(--accent-glow);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--surface-1); color: var(--text-primary); }

.btn-danger { color: var(--danger); }
.btn-danger:hover { background: rgba(248,113,113,0.1); border-color: rgba(248,113,113,0.3); }

.btn-success {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
  box-shadow: 0 0 0 0 rgba(52,211,153,0.3);
}
.btn-success:hover {
  background: #2bbf84;
  border-color: #2bbf84;
  box-shadow: 0 0 18px rgba(52,211,153,0.3);
}

.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn-xs { padding: 4px 8px; font-size: 11px; }
.btn-block { width: 100%; }
.btn-icon { padding: 10px; position: relative; font-size: 17px; }

/* ---------- Tabs / mode switch ---------- */
.tab-group {
  display: flex;
  gap: 6px;
  background: var(--surface-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 18px;
}
.tab-btn {
  flex: 1;
  padding: 8px 10px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--fast) var(--ease);
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active {
  background: var(--accent-soft);
  color: var(--accent-2);
  box-shadow: inset 0 0 0 1px rgba(59,130,246,0.3);
}

/* ---------- Result panel (calculadora) ---------- */
.result-panel {
  background: linear-gradient(180deg, var(--surface-1), var(--surface-0));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: sticky;
  top: 0;
}

.result-label {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.result-price-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.result-price-usd {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
  text-shadow: 0 0 30px var(--accent-glow);
}

.result-price-sub {
  font-size: 13.5px;
  color: var(--text-secondary);
}

.result-bs {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 6px;
}

.breakdown-list {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.breakdown-list div {
  font-size: 12.5px;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
}

/* ---------- Cotización table ---------- */
.quote-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 8px;
}
.quote-table td {
  padding: 10px 4px;
  border-bottom: 1px solid var(--border-soft);
  max-width: 250px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.quote-table td.td-expanded {
  white-space: normal;
  overflow: visible;
  max-width: none;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  position: relative;
  z-index: 2;
}
.quote-table tr:last-child td { border-bottom: none; }
.quote-table .qt-label { color: var(--text-secondary); }
.quote-table .qt-value { text-align: right; font-weight: 500; }
.quote-table .qt-total td {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
  padding-top: 14px;
  border-top: 1px solid var(--border);
  border-bottom: none;
}

/* ---------- Monthly chart (dashboard) ---------- */
.monthly-chart {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  height: 190px;
  padding-top: 26px;
  margin-top: 8px;
}

.month-bar-group {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}

.month-bar-value {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  white-space: nowrap;
}

.month-bar-track {
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  flex: 1;
}

.month-bar {
  width: 60%;
  min-height: 6px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, #323a4a, #1c212b);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
  transition: transform var(--fast) var(--ease), background var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.month-bar-group:hover .month-bar { transform: scaleY(1.02); }

.month-bar-group.current .month-bar {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 16px var(--accent-glow);
}
.month-bar-group.current .month-bar-value { color: var(--accent-2); }

.month-bar-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 10px;
  text-transform: capitalize;
}
.month-bar-group.current .month-bar-label { color: var(--text-primary); font-weight: 600; }

/* ---------- Anillos de estado (dashboard) ---------- */
.ring-grid {
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  flex-wrap: wrap;
  row-gap: 20px;
  padding: 8px 0 6px;
}
.ring-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.ring {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: conic-gradient(var(--ring-color) calc(var(--pct) * 3.6deg), var(--surface-2) 0deg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.6s var(--ease);
  box-shadow: 0 0 0 1px var(--border);
}
.ring::before {
  content: '';
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: var(--surface-0);
  box-shadow: inset 0 1px 4px rgba(0,0,0,0.55), 0 0 0 1px var(--border-soft);
}
.ring-value {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
}
.ring-label {
  font-size: 11.5px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.5;
}
.ring-label strong { color: var(--text-primary); font-size: 12.5px; }

/* ---------- Resumen de módulo (Inicio) ---------- */
.resumen-modulo-body {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}
.resumen-donut-wrap { flex-shrink: 0; }
.ring.resumen-donut {
  width: 128px;
  height: 128px;
  box-shadow: 0 0 0 2px var(--border);
}
.ring.resumen-donut .ring-value {
  font-size: 22px;
}
.resumen-modulo-stats {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.resumen-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
}
.resumen-stat-row:last-child { border-bottom: none; padding-bottom: 0; }
.resumen-stat-label { font-size: 12.5px; color: var(--text-secondary); }
.resumen-stat-value { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--text-primary); }
.resumen-stat-value.accent { color: var(--accent-2); }

/* ---------- Botones grandes de navegación (Cotizaciones) ---------- */
.nav-card-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow-card);
  transition: border-color var(--fast) var(--ease), transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.nav-card-btn:hover {
  border-color: #2a2e3a;
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}
.nav-card-text { display: flex; flex-direction: column; gap: 2px; }
.nav-card-title { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--text-primary); }
.nav-card-sub { font-size: 12px; color: var(--text-muted); }

/* ---------- History list ---------- */
.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--fast) var(--ease);
}
.history-item:hover { border-color: #2c303c; }
.history-item + .history-item { margin-top: 10px; }
.history-item--selectable { cursor: pointer; }
.history-item--selectable:hover { border-color: var(--accent); background: var(--accent-soft); }
.history-item--selectable.selected { border-color: var(--accent); background: var(--accent-soft); }
.history-check {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.history-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}
.history-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 24px;
}

/* --- Header card (Planeación de contenido) --- */
.lc-header-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
}
.lc-header-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
}
.lc-header-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* --- Toolbar (tabs + month + view toggle) --- */
.lc-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* --- Tabs de cuenta (prominent) --- */
.lc-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 0;
}
.lc-tab {
  padding: 8px 18px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
}
.lc-tab:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: rgba(255,255,255,0.08);
}
.lc-tab--active {
  background: rgba(99,140,255,0.12);
  color: var(--accent);
  border-color: rgba(99,140,255,0.3);
}

/* --- Month selector (pill style) --- */
.lc-month-selector {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  margin-right: auto;
}
.lc-month-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}
.lc-month-btn:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: rgba(255,255,255,0.08);
}
.lc-month-pill {
  padding: 6px 20px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.lc-month-pill:hover {
  background: var(--surface-2);
  border-color: rgba(99,140,255,0.3);
  color: var(--accent);
}
.lc-month-pill .fi {
  font-size: 11px;
  opacity: 0.5;
  transition: transform 0.2s;
}
.lc-month-pill:hover .fi {
  opacity: 0.8;
  transform: rotate(180deg);
}

/* --- View toggle --- */
.lc-view-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.lc-view-toggle .lc-vt-btn {
  padding: 7px 16px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 5px;
}
.lc-view-toggle .lc-vt-btn + .lc-vt-btn {
  border-left: 1px solid var(--border);
}
.lc-view-toggle .lc-vt-btn:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text);
}
.lc-view-toggle .lc-vt-btn--active {
  background: rgba(99,140,255,0.12);
  color: var(--accent);
}

/* --- Tabla inline --- */
.lc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.lc-table th {
  text-align: left;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  white-space: nowrap;
  cursor: grab;
  user-select: none;
  transition: background 0.15s, color 0.15s;
  border-bottom: 1px solid var(--border);
}
.lc-table td {
  padding: 8px 10px;
  vertical-align: middle;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
  min-height: 36px;
  position: relative;
  border-right: 1px solid var(--border);
}
.lc-table td:last-child {
  border-right: none;
}
.lc-table th:active {
  cursor: grabbing;
}
.lc-table th.lc-dragging {
  opacity: 0.4;
  background: rgba(99,140,255,0.08);
}
.lc-table th.lc-drag-over {
  background: rgba(99,140,255,0.15);
  color: var(--accent);
  box-shadow: inset 2px 0 0 var(--accent);
}
.lc-table th {
  position: relative;
}
.lc-th-resize {
  position: absolute;
  top: 0;
  right: 0;
  width: 5px;
  height: 100%;
  cursor: col-resize;
  z-index: 2;
}
.lc-th-resize:hover,
.lc-th-resize.lc-th-resizing {
  background: var(--accent);
}
.lc-th-label {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lc-th-label[contenteditable="true"] {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
  padding: 1px 4px;
  margin: -1px -4px;
  cursor: text;
  background: var(--surface-2);
  color: var(--text-primary);
  min-width: 30px;
  white-space: nowrap;
}
.lc-th-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}
.lc-table th:hover .lc-th-actions {
  opacity: 1;
}
.lc-th-action-btn {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 10px;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s, color 0.15s;
}
.lc-th-action-btn:hover {
  background: var(--danger);
  color: #fff;
}
.lc-hidden-cols-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.lc-hidden-cols-bar:empty {
  display: none;
}
.lc-hidden-col-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.lc-hidden-col-tag:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.lc-hidden-col-tag i {
  font-size: 9px;
}
.lc-table tbody tr {
  border-bottom: 1px solid var(--border);
}
.lc-table tbody tr.lc-add-row {
  border-bottom: none;
}
.lc-table tbody tr.lc-add-row td {
  border-bottom: none;
  border-right: none;
  padding: 6px 10px;
}
.lc-add-btn {
  color: var(--text-muted);
  font-size: 12px;
}
.lc-add-btn:hover {
  color: var(--accent);
}

/* --- Celdas inline --- */
.lc-cell-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
  cursor: pointer;
}
.lc-cell-text:hover {
  background: rgba(255,255,255,0.04);
}
.lc-cell-text.expanded {
  white-space: normal;
  overflow: visible;
  max-width: none;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  position: relative;
  z-index: 2;
}
.lc-cell-select {
  white-space: nowrap;
}
.lc-cell-select:hover {
  background: rgba(255,255,255,0.04);
}

/* --- Celdas botón (formato, estado, fecha) --- */
.lc-btn-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lc-btn-cell:hover {
  background: rgba(99,140,255,0.08);
  border-color: rgba(99,140,255,0.25);
}
.lc-btn-cell .lc-btn-icon {
  font-size: 11px;
  flex-shrink: 0;
  opacity: 0.7;
}
.lc-btn-cell .lc-btn-label {
  overflow: hidden;
  text-overflow: ellipsis;
}
.lc-btn-cell .lc-btn-chevron {
  font-size: 9px;
  opacity: 0.4;
  margin-left: 2px;
  flex-shrink: 0;
}
.lc-btn-cell.lc-btn-cell--format {
  border-left: 3px solid var(--cell-color, var(--border));
}
.lc-btn-cell.lc-btn-cell--estado {
  border-left: 3px solid var(--cell-color, var(--border));
}
.lc-btn-cell.lc-btn-cell--fecha {
  border-left: 3px solid var(--accent);
}
.lc-cell-date {
  white-space: nowrap;
}
.lc-cell-date:hover {
  background: rgba(255,255,255,0.04);
}
.lc-cell-active {
  background: rgba(99,140,255,0.08) !important;
}

/* --- Input inline --- */
.lc-inline-input {
  background: var(--bg-input);
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  padding: 4px 8px;
  outline: none;
  box-shadow: 0 0 0 2px rgba(99,140,255,0.2);
}
.lc-inline-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(99,140,255,0.3);
}

/* --- Dropdown flotante --- */
.lc-dropdown {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  animation: lc-dd-in 0.12s ease;
}
@keyframes lc-dd-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.lc-dropdown-item {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px 10px;
  border: none;
  background: none;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  border-radius: 4px;
  text-align: left;
}
.lc-dropdown-item:hover {
  background: rgba(255,255,255,0.06);
}
.lc-dropdown-item--active {
  background: rgba(99,140,255,0.1);
}
.lc-dropdown-add {
  border-top: 1px solid var(--border);
  margin-top: 2px;
  padding-top: 6px;
}
.lc-dd-edit-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}
.lc-dropdown-item:hover .lc-dd-edit-btn {
  opacity: 1;
}
.lc-dd-edit-btn:hover {
  color: var(--text);
  background: rgba(255,255,255,0.08);
}

/* --- Editor de opciones --- */
.lc-dropdown--editor {
  padding: 12px;
  min-width: 220px;
}
.lc-dd-editor-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.lc-color-palette {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.lc-color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.15s;
}
.lc-color-swatch:hover {
  transform: scale(1.15);
}
.lc-color-swatch--active {
  border-color: var(--text);
  transform: scale(1.2);
  box-shadow: 0 0 0 2px var(--bg-card);
}
.lc-dd-editor-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  margin-top: 10px;
}
.lc-dd-del-btn:hover {
  color: var(--danger) !important;
  background: rgba(248,113,113,0.12) !important;
}

/* --- Confirmación visual de guardado --- */
.lc-cell-saved {
  background: rgba(16,185,129,0.08) !important;
  transition: background 0.3s;
}

/* --- Copy cell --- */
.lc-copy-cell {
  max-width: 220px;
  font-size: 13px;
  line-height: 1.5;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lc-inspo-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 12px;
}
.lc-inspo-link:hover {
  text-decoration: underline;
}

/* --- View toggle (Tabla | Kanban | Calendario) --- */
/* --- Stat cards con donuts --- */
.lc-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.lc-stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.15s;
}
.lc-stat-card:hover {
  border-color: rgba(255,255,255,0.08);
}
.lc-stat-donut {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}
.lc-stat-donut circle {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: center;
}
.lc-stat-donut .lc-donut-bg {
  stroke: rgba(255,255,255,0.06);
}
.lc-stat-donut .lc-donut-fill {
  transition: stroke-dashoffset 0.5s ease;
}
.lc-stat-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lc-stat-num {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
}
.lc-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* --- Detalle slide-over --- */
.lc-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.lc-detail-overlay--open {
  opacity: 1;
  pointer-events: auto;
}
.lc-detail-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(560px, 92vw);
  height: 100%;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  z-index: 1001;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
}
.lc-detail-panel--open {
  transform: translateX(0);
}
.lc-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.lc-detail-back {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.lc-detail-back:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text);
}
.lc-detail-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}
.lc-detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
}
.lc-detail-field {
  margin-bottom: 20px;
}
.lc-detail-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.lc-detail-field .lc-detail-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s;
}
.lc-detail-field .lc-detail-input:focus {
  border-color: var(--accent);
}
.lc-detail-field textarea.lc-detail-input {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}
.lc-detail-field--small {
  display: inline-block;
  width: calc(50% - 10px);
  margin-right: 16px;
}
.lc-detail-footer {
  flex-shrink: 0;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  z-index: 2;
}
.lc-detail-footer .btn {
  width: 100%;
}

/* --- Calendario --- */
.lc-calendar {
  margin-bottom: 16px;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 0;
  overflow: hidden;
}
.lc-cal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.lc-cal-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.lc-cal-month-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  min-width: 140px;
  text-align: center;
}
.lc-cal-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all 0.15s;
}
.lc-cal-nav-btn:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border-color: rgba(255,255,255,0.12);
}
.lc-cal-clear-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: rgba(99,140,255,0.1);
  color: var(--accent);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.lc-cal-clear-pill:hover {
  background: rgba(99,140,255,0.18);
}
.lc-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.lc-cal-weekday {
  text-align: center;
  padding: 10px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.lc-cal-day {
  min-height: 90px;
  padding: 6px 8px;
  background: rgba(255,255,255,0.015);
  border: 1px solid transparent;
  border-radius: 0;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  display: flex;
  flex-direction: column;
}
.lc-cal-day:hover {
  background: rgba(255,255,255,0.04);
}
.lc-cal-day--other {
  opacity: 0.25;
}
.lc-cal-day--today {
  background: rgba(99,140,255,0.08);
}
.lc-cal-day--today .lc-cal-day-num {
  background: linear-gradient(135deg, #638cff, #818cf8);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}
.lc-cal-day--selected {
  background: rgba(99,140,255,0.12) !important;
  border-color: var(--accent) !important;
  border-radius: 8px;
}
.lc-cal-day-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.lc-cal-day-events {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow: hidden;
}
.lc-cal-event-badge {
  font-size: 10px;
  font-weight: 500;
  color: var(--text);
  background: rgba(255,255,255,0.06);
  border-left: 3px solid var(--accent);
  border-radius: 3px;
  padding: 2px 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}
.lc-cal-event-more {
  font-size: 9px;
  color: var(--text-muted);
  padding: 1px 5px;
  font-weight: 500;
}

/* --- Calendar Popup --- */
.lc-cal-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.2s;
}
.lc-cal-popup-overlay--open {
  opacity: 1;
}
.lc-cal-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 380px;
  max-width: 90vw;
  max-height: 80vh;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  z-index: 9999;
  opacity: 0;
  transition: all 0.2s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  isolation: isolate;
}
.lc-cal-popup--open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.lc-cal-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.lc-cal-popup-date {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.lc-cal-popup-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.08);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.15s;
  flex-shrink: 0;
}
.lc-cal-popup-close:hover {
  background: rgba(239,68,68,0.2);
  color: var(--danger);
  border-color: rgba(239,68,68,0.3);
}
.lc-cal-popup-body {
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-card);
}
.lc-cal-popup-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.lc-cal-popup-card:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.1);
}
.lc-cal-popup-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.lc-cal-popup-card-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.lc-cal-popup-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.lc-cal-popup-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

/* --- Kanban --- */
.lc-kanban {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 12px;
  min-height: 400px;
}
.lc-kanban-col {
  min-width: 240px;
  max-width: 280px;
  flex: 1;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
}
.lc-kanban-col--drag-over {
  border-color: var(--accent);
  background: rgba(99,140,255,0.04);
}
.lc-kanban-col-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.lc-kanban-col-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  flex: 1;
}
.lc-kanban-col-count {
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 11px;
  color: var(--text-muted);
}
.lc-kanban-cards {
  flex: 1;
  padding: 8px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 60px;
}
.lc-kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: grab;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.lc-kanban-card:active {
  cursor: grabbing;
}
.lc-kanban-card:hover {
  border-color: rgba(255,255,255,0.1);
}
.lc-kanban-card.lc-dragging {
  opacity: 0.5;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.lc-kanban-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.lc-kanban-card-contenido {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.lc-kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.lc-kanban-card-fecha {
  font-size: 11px;
  color: var(--text-muted);
}

.history-item--highlight {
  border-color: var(--accent-2) !important;
  box-shadow: 0 0 0 2px rgba(99, 140, 255, 0.25);
  animation: highlight-fade 3s ease forwards;
}
@keyframes highlight-fade {
  0%   { box-shadow: 0 0 0 2px rgba(99, 140, 255, 0.4); }
  70%  { box-shadow: 0 0 0 2px rgba(99, 140, 255, 0.15); }
  100% { box-shadow: none; }
}

.history-main { 
  flex: 1;
  min-width: 0;
}
.history-title {
  font-weight: 600;
  font-size: 13.5px;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.history-title.expanded {
  white-space: normal;
  overflow: visible;
}
.history-meta {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.history-meta.expanded {
  white-space: normal;
  overflow: visible;
}
.history-actions { display: flex; gap: 6px; flex-shrink: 0; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  background: var(--surface-2);
  color: var(--text-secondary);
}
.badge-accent { background: var(--accent-soft); color: var(--accent-2); }
.badge-success { background: rgba(52,211,153,0.12); color: var(--success); }
.badge-warning { background: rgba(251,191,36,0.12); color: var(--warning); }
.badge-danger { background: rgba(248,113,113,0.12); color: var(--danger); }
.badge-muted { background: var(--surface-2); color: var(--text-muted); }

/* ---- Estado pill (preview modal) ---- */
.estado-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.estado-pill-icon {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7px;
}
.estado-pill.estado-activa {
  background: rgba(59,130,246,0.12);
  color: #60a5fa;
}
.estado-pill.estado-activa .estado-pill-icon { background: #3b82f6; color: #fff; }
.estado-pill.estado-pausada {
  background: rgba(251,191,36,0.12);
  color: #fbbf24;
}
.estado-pill.estado-pausada .estado-pill-icon { background: #f59e0b; color: #fff; }
.estado-pill.estado-terminada {
  background: rgba(52,211,153,0.12);
  color: #34d399;
}
.estado-pill.estado-terminada .estado-pill-icon { background: #10b981; color: #fff; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 30px; margin-bottom: 10px; opacity: 0.6; }

/* ---------- Modal (Vista previa) ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  z-index: 600;
  overflow-y: auto;
  animation: fadeIn var(--normal) var(--ease);
}
.modal-overlay.hidden { display: none; }

/* Preview modal: toolbar stays fixed at top, content scrolls below */
#modal-preview {
  padding: 0;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}
#modal-preview > #preview-toolbar-container {
  position: relative;
  z-index: 10;
}
#modal-preview > .doc-sheet-scroll {
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex: 1;
  min-height: 0;
}

.modal-toolbar {
  width: 100%;
  max-width: 820px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 16px auto 0;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  flex-shrink: 0;
}

/* ---------- Document Toolbar (reemplaza modal-toolbar para visores) ---------- */
.doc-toolbar {
  width: 100%;
  max-width: 820px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 56px;
  margin: 12px auto 0;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 14px;
  flex-shrink: 0;
  box-sizing: border-box;
  gap: 12px;
}
.doc-toolbar-left,
.doc-toolbar-center,
.doc-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.doc-toolbar-left { flex-shrink: 0; }
.doc-toolbar-center { flex: 1; justify-content: center; }
.doc-toolbar-right { flex-shrink: 0; }

.doc-toolbar-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 6px;
}
.doc-toolbar-status {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  min-width: 80px;
  text-align: center;
  user-select: none;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover {
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--accent);
}

#btn-abrir-papelera.active {
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--accent);
}
#btn-abrir-papelera #papelera-contador:not(:empty) {
  font-weight: 700;
  margin-left: 2px;
}

/* Historial: chips de estado — estilo minimalista profesional */
.hist-chips-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.hist-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  user-select: none;
  transition: all var(--fast) ease;
}
.hist-chip:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}
.hist-chip:active {
  transform: scale(0.98);
}
.hist-chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: all var(--fast) ease;
}

/* --- Todos --- */
.hist-chip[data-estado=""] {
  border-color: var(--border);
  color: var(--text-secondary);
}
.hist-chip[data-estado=""]:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}
.hist-chip[data-estado=""].active {
  background: var(--surface-2);
  border-color: var(--text-muted);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* --- Vigente --- */
.hist-chip[data-estado="vigente"] {
  border-color: rgba(59, 130, 246, 0.25);
  color: var(--accent-2);
  background: rgba(59, 130, 246, 0.04);
}
.hist-chip[data-estado="vigente"] .hist-chip-dot {
  background: var(--accent-2);
}
.hist-chip[data-estado="vigente"]:hover {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(59, 130, 246, 0.08);
  color: var(--accent-2);
}
.hist-chip[data-estado="vigente"].active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}
.hist-chip[data-estado="vigente"].active .hist-chip-dot {
  background: #fff;
}

/* --- Aprobada --- */
.hist-chip[data-estado="aprobada"] {
  border-color: rgba(16, 185, 129, 0.25);
  color: var(--success);
  background: rgba(16, 185, 129, 0.04);
}
.hist-chip[data-estado="aprobada"] .hist-chip-dot {
  background: var(--success);
}
.hist-chip[data-estado="aprobada"]:hover {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.08);
  color: var(--success);
}
.hist-chip[data-estado="aprobada"].active {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}
.hist-chip[data-estado="aprobada"].active .hist-chip-dot {
  background: #fff;
}

/* --- Cancelada --- */
.hist-chip[data-estado="cancelada"] {
  border-color: rgba(239, 68, 68, 0.25);
  color: var(--danger);
  background: rgba(239, 68, 68, 0.04);
}
.hist-chip[data-estado="cancelada"] .hist-chip-dot {
  background: var(--danger);
}
.hist-chip[data-estado="cancelada"]:hover {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.08);
  color: var(--danger);
}
.hist-chip[data-estado="cancelada"].active {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}
.hist-chip[data-estado="cancelada"].active .hist-chip-dot {
  background: #fff;
}

/* --- Vencida --- */
.hist-chip[data-estado="vencida"] {
  border-color: rgba(245, 158, 11, 0.25);
  color: var(--warning);
  background: rgba(245, 158, 11, 0.04);
}
.hist-chip[data-estado="vencida"] .hist-chip-dot {
  background: var(--warning);
}
.hist-chip[data-estado="vencida"]:hover {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.08);
  color: var(--warning);
}
.hist-chip[data-estado="vencida"].active {
  background: var(--warning);
  border-color: var(--warning);
  color: #fff;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}
.hist-chip[data-estado="vencida"].active .hist-chip-dot {
  background: #fff;
}

/* Motivo de cancelación en la tarjeta del historial */
.hist-motivo-tag {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--danger);
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 6px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Diálogo de motivo de cancelación */
.motivo-lista {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}
.motivo-op {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  transition: all var(--fast) ease;
}
.motivo-op:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}
.motivo-op input[type="radio"] {
  accent-color: var(--accent);
}

.hist-filtros-controles {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

/* Historial: encabezados de mes colapsables */
.hist-mes-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  margin: 10px 0 6px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
}
.hist-mes-header:first-child {
  margin-top: 0;
}
.hist-mes-header:hover {
  border-color: var(--accent);
}
.hist-mes-chevron {
  color: var(--text-muted);
  transition: transform .15s ease;
  flex-shrink: 0;
}
.hist-mes-header.collapsed .hist-mes-chevron {
  transform: rotate(-90deg);
}
.hist-mes-titulo {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
.hist-mes-meta {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
}

/* Historial: etiqueta de marca junto al cliente */
.hist-marca-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 600;
  vertical-align: middle;
}

.doc-sheet {
  width: 100%;
  max-width: 820px;
  background: #ffffff;
  color: #1a1a1a;
  border-radius: 10px;
  padding: 52px 52px;
  font-family: 'Inter', sans-serif;
  margin: 0 auto 40px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.doc-sheet-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px;
  display: flex;
  justify-content: center;
}

.doc-sheet h1, .doc-sheet h2, .doc-sheet h3 { font-family: 'Inter', sans-serif; color: #111; }
.doc-sheet [contenteditable="true"]:hover { outline: 1px dashed #93c5fd; outline-offset: 2px; }
.doc-sheet [contenteditable="true"]:focus { outline: 1px solid #3b82f6; outline-offset: 2px; }

.doc-readonly [contenteditable="true"] {
  pointer-events: none;
  user-select: none;
  cursor: default;
}
.doc-readonly [contenteditable="true"]:hover { outline: none; background: transparent; }

.doc-editing { position: relative; }
.doc-editing::before {
  content: 'Modo edición activo';
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  display: block;
  background: #fef3c7;
  color: #92400e;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  padding: 6px 0;
  z-index: 10;
  border-bottom: 1px solid #fcd34d;
  pointer-events: none;
}
.doc-editing [contenteditable="true"] {
  cursor: text;
  min-height: 1em;
}
.doc-editing [contenteditable="true"]:hover {
  outline: 2px dashed #60a5fa;
  outline-offset: 2px;
  background: rgba(59, 130, 246, 0.04);
}
.doc-editing [contenteditable="true"]:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
  background: rgba(59, 130, 246, 0.06);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* ---------- Páginas del documento ---------- */
.doc-page {
  position: relative;
  padding-bottom: 0;
  margin-bottom: 36px;
  border-bottom: 2px dashed #e2e2e2;
  min-height: 700px;
  aspect-ratio: 8.5 / 11;
  overflow: hidden;
}
.doc-page:last-child { border-bottom: none; margin-bottom: 0; }

/* ---------- Header de cada página (logo + PROPUESTA DE TRABAJO + fechas) ---------- */
.doc-page-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 0;
  margin-bottom: 30px;
}
.doc-page-header img { width: 48px; height: 48px; object-fit: contain; flex-shrink: 0; }
.doc-page-header-right { text-align: right; flex-shrink: 0; }
.doc-page-header-label { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #9ca3af; margin-bottom: 4px; }
.doc-page-header-dates { border-collapse: collapse; font-size: 11px; margin-left: auto; }
.doc-page-header-dates td { border: 1px solid #ccc; padding: 3px 10px; }
.doc-page-header-dates td:first-child { font-weight: 700; background: #f5f5f5; text-transform: uppercase; letter-spacing: 0.03em; color: #333; }
.doc-page-header-dates td:last-child { color: #555; }

/* ---------- Footer de página ---------- */
.doc-page-footer {
  position: absolute;
  bottom: 0;
  left: 52px;
  right: 52px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  font-size: 11px;
  color: #888;
  line-height: 1.5;
  font-family: 'Inter', sans-serif;
}
.doc-page-footer strong { color: #222; font-weight: 700; letter-spacing: 0.01em; }
.doc-page-footer-left { flex-shrink: 0; }
.doc-page-footer-right {
  font-size: 10px;
  color: #999;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: right;
  flex-shrink: 0;
}
.doc-page-number {
  position: absolute;
  bottom: 0;
  right: 0;
  font-size: 10px;
  color: #999;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- Portada (página 1) ---------- */
.doc-cover { min-height: 700px; padding-top: 10px; }
.doc-cover-header-label { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #9ca3af; margin-bottom: 4px; }
.doc-cover-header-dates { border-collapse: collapse; font-size: 11px; }
.doc-cover-header-dates td { border: 1px solid #ccc; padding: 3px 10px; }
.doc-cover-header-dates td:first-child { font-weight: 700; background: #f5f5f5; text-transform: uppercase; letter-spacing: 0.03em; color: #333; }
.doc-cover-header-dates td:last-child { color: #555; }

.doc-cover-title { font-size: 46px; font-weight: 800; line-height: 1.05; color: #111; margin-top: 40px; }
.doc-cover-servicio {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 30px;
  padding: 10px 16px;
  background: #2D50E9;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  width: 100%;
}
.doc-cover-servicio-label { white-space: nowrap; }
.doc-cover-servicio-value { flex: 1; }

.doc-cover-client-table { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 13px; }
.doc-cover-client-table td { border: 1px solid #e5e7eb; padding: 10px 14px; }
.doc-cover-client-table td.k { background: #2D50E9; color: #fff; font-weight: 700; width: 120px; }

/* ---------- Section titles ---------- */
.doc-section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; margin: 26px 0 8px; color: #111; border-bottom: 2px solid #111; padding-bottom: 4px; }
.doc-p { font-size: 12.5px; line-height: 1.65; color: #333; margin-bottom: 8px; }
.doc-list { margin-bottom: 8px; }
.doc-list li { margin-bottom: 6px; }

/* ---------- Tabla de cotización ---------- */
.doc-quote-title { font-size: 26px; font-weight: 800; color: #333; margin-bottom: 18px; }
.doc-quote-banner { display: flex; align-items: stretch; margin-bottom: 18px; font-size: 13px; font-weight: 700; }
.doc-quote-banner-label { background: #2D50E9; color: #fff; padding: 12px 18px; white-space: nowrap; }
.doc-quote-banner-value { background: #BFBFBF; color: #333; padding: 12px 18px; flex: 1; text-transform: uppercase; }
.doc-quote-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 6px; }
.doc-quote-table th, .doc-quote-table td { border: 1px solid #e5e7eb; padding: 8px 10px; text-align: left; }
.doc-quote-table th { background: #404040; color: #fff; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.doc-quote-table th:last-child { background: #2D50E9; }
.doc-quote-table td.num { text-align: right; }
.doc-quote-table tr.total td { font-weight: 700; background: #f1f5f9; }
.doc-quote-items-cell { vertical-align: top; padding: 10px 14px !important; }
.doc-quote-items-list { margin: 0; padding-left: 18px; font-size: 12px; line-height: 1.7; }
.doc-quote-items-list li { margin-bottom: 2px; }
.doc-quote-total-cell {
  vertical-align: middle;
  text-align: right !important;
  font-size: 22px;
  font-weight: 800;
  color: #111;
}

.doc-resumen-table { margin-top: 20px; }
.doc-resumen-table th { background: #404040 !important; color: #fff !important; }
.doc-resumen-table td { background: #D9D9D9; }
.doc-resumen-table tr.total td:first-child { background: #2D50E9 !important; color: #fff !important; }
.doc-resumen-table tr.total td:last-child { background: #7F7F7F !important; color: #fff !important; }

/* ---------- Tabla de Alcance ---------- */
.doc-alcance-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 6px; }
.doc-alcance-table th { background: #2D50E9; color: #fff; padding: 9px 12px; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.doc-alcance-table td { border: 1px solid #e5e7eb; padding: 9px 12px; vertical-align: top; }
.doc-alcance-table td.entregable { background: #AEAAAA; color: #1a1a1a; font-weight: 600; width: 34%; }
.doc-alcance-table td.detalle { background: #D9D9D9; color: #333; }

/* ---------- Términos ---------- */
.doc-terms-block { margin-top: 12px; }
.doc-terms-title { font-size: 12.5px; margin-bottom: 2px; margin-top: 14px; color: #111; }
.doc-terms { font-size: 11px; line-height: 1.7; color: #444; white-space: pre-wrap; margin-bottom: 4px; }

/* ---------- Próximos pasos ---------- */
.doc-steps-list { padding-left: 20px; margin-bottom: 12px; }
.doc-steps-list li { margin-bottom: 8px; font-size: 12.5px; line-height: 1.5; }

/* ---------- Firmas ---------- */
.doc-signatures { display: flex; gap: 40px; margin-top: 40px; }
.doc-signature-col { flex: 1; }
.doc-sig-title { font-size: 13px; font-weight: 800; text-transform: uppercase; margin-bottom: 18px; color: #111; letter-spacing: 0.03em; }
.doc-sig-field { font-size: 11px; color: #666; text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 4px; margin-top: 14px; }
.doc-sig-line { border-bottom: 1px solid #333; height: 1px; margin-bottom: 4px; }
.doc-sig-firma { position: relative; margin-top: 4px; }
.doc-sig-firma .doc-sig-line { position: absolute; bottom: 45px; left: 0; right: 0; }
.doc-sig-firma img { position: relative; z-index: 1; display: block; margin-top: -12px; margin-bottom: -4px; margin-left: 30px; }

@media print {
  html, body {
    overflow: visible !important;
    height: auto !important;
    background: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .app-shell,
  .toast,
  .notif-panel,
  .lc-detail-overlay,
  .lc-detail-panel,
  .modal-overlay,
  .cp-detail-overlay,
  .cp-detail-panel {
    display: none !important;
  }

  #modal-preview {
    position: static !important;
    display: block !important;
    width: 100% !important;
    background: none !important;
    overflow: visible !important;
    padding: 0 !important;
  }
  #modal-preview > .modal-toolbar { display: none !important; }
  #modal-preview > .doc-sheet-scroll {
    overflow: visible !important;
    padding: 0 !important;
    display: block !important;
    justify-content: stretch !important;
  }

  .doc-sheet {
    display: block !important;
    background: #fff !important;
    color: #1a1a1a !important;
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }

  .doc-page {
    display: block !important;
    width: 100% !important;
    height: 279mm !important;
    min-height: auto !important;
    padding: 52px 52px 40px !important;
    box-sizing: border-box !important;
    position: relative !important;
    page-break-after: always !important;
    page-break-inside: avoid !important;
    margin-bottom: 0 !important;
    border-bottom: none !important;
    aspect-ratio: auto !important;
    overflow: hidden !important;
  }
  .doc-page:last-child { page-break-after: avoid !important; }
  .doc-page:empty { display: none !important; }

  .doc-page-header {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 16px !important;
    margin-top: 0 !important;
    margin-bottom: 30px !important;
  }
  .doc-page-header img {
    display: block !important;
    visibility: visible !important;
    width: 48px !important;
    height: 48px !important;
    object-fit: contain !important;
    flex-shrink: 0 !important;
  }
  .doc-page-header-right {
    text-align: right !important;
    flex-shrink: 0 !important;
    margin-left: auto !important;
  }
  .doc-page-footer {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-end !important;
  }
  .doc-signatures {
    display: flex !important;
    flex-direction: row !important;
    gap: 40px !important;
    margin-top: 40px !important;
  }
  .doc-signature-col { flex: 1 !important; }
}

@page {
  size: letter;
  margin: 0;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: all var(--normal) var(--ease);
  z-index: 12000;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast--error {
  border-color: var(--danger);
  background: var(--surface-2);
  color: var(--danger);
}
.toast--exito {
  border-color: var(--success);
  background: var(--surface-2);
  color: var(--success);
}
.confirm-box {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 380px;
  width: 100%;
  box-sizing: border-box;
  margin: auto;
  box-shadow: var(--shadow-card);
}

/* ---------- Brand Form Modal (wider layout) ---------- */
#modal-marca > .confirm-box {
  max-width: 460px;
}
@media (min-width: 768px) {
  #modal-marca > .confirm-box {
    max-width: 780px;
    padding: 28px 32px;
  }
}

.brand-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
.brand-form-grid > .col-span-2 {
  grid-column: span 2;
}
.brand-form-grid > .col-full {
  grid-column: 1 / -1;
}

.brand-form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

@media (max-width: 767px) {
  .brand-form-grid {
    grid-template-columns: 1fr;
  }
  .brand-form-grid > .col-span-2,
  .brand-form-grid > .col-full {
    grid-column: span 1;
  }
}
.confirm-box .grid-2 {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.confirm-box input,
.confirm-box select,
.confirm-box textarea {
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}
.confirm-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
}
.confirm-message {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
}
.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.confirm-actions .btn-primary.danger-variant {
  background: var(--danger);
  border-color: var(--danger);
}
/* ---------- Tarjetas de marca ---------- */
.marca-card {
  position: relative;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--fast) var(--ease), transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
  box-shadow: var(--shadow-card);
}
.marca-card:hover {
  border-color: color-mix(in srgb, var(--marca-color, var(--accent)) 35%, var(--border));
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover), 0 0 30px -12px var(--marca-color, var(--accent));
}
.marca-card-accent {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  opacity: 0.8;
}
.marca-card-body {
  padding: 16px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.marca-card-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.marca-card-icono {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}
.marca-card-head {
  flex: 1;
  min-width: 0;
}
.marca-card-nombre {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.marca-card-cliente {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.marca-card-metas {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}
.marca-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.marca-meta i {
  font-size: 10px;
  color: var(--text-muted);
  width: 12px;
  text-align: center;
}
.marca-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
}
.marca-card-monto {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--accent-2);
}
.marca-card-links {
  display: flex;
  gap: 4px;
}
.marca-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--surface-0);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  cursor: default;
  text-decoration: none;
  transition: all var(--fast) var(--ease);
}
.marca-link:hover {
  color: var(--accent-2);
  border-color: rgba(59,130,246,0.3);
  background: var(--accent-soft);
}
a.marca-link {
  cursor: pointer;
  color: var(--text-muted);
}
a.marca-link:hover {
  color: var(--accent-2);
}

/* ---------- Selector de íconos (Marcas) ---------- */
.icon-picker {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}
.icon-picker-option {
  width: 100%;
  aspect-ratio: 1;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-0);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--fast) var(--ease);
}
.icon-picker-option:hover { border-color: #2c303b; }
.icon-picker-option { color: var(--text-secondary); font-size: 15px; }
.icon-picker-option.selected { color: var(--accent-2); }
.icon-picker-option.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

/* ---------- Toolbar de Marcas ---------- */
.marcas-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  box-shadow: var(--shadow-card);
}
.marcas-toolbar-search {
  position: relative;
  flex: 1;
  max-width: 260px;
}
.marcas-toolbar-search i {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--text-muted);
  pointer-events: none;
}
.marcas-toolbar-search input {
  width: 100%;
  padding-left: 30px;
  height: 34px;
  font-size: 12.5px;
}
.marcas-toolbar-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.marcas-filter-select {
  height: 34px;
  font-size: 12px;
  padding: 4px 28px 4px 10px;
  min-width: 120px;
  background-size: 8px 5px;
}
/* ---------- Icon + Color row (marca form) ---------- */
.marca-icono-color-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.marca-icono-preview {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: var(--accent-soft);
  color: var(--accent-2);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.marca-color-divider {
  width: 1px;
  height: 26px;
  background: var(--border);
  flex-shrink: 0;
}
.marca-color-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 5px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-0);
  color: var(--text-secondary);
  font-size: 12.5px;
  cursor: pointer;
  transition: all var(--fast) var(--ease);
  flex-shrink: 0;
  position: relative;
}
.marca-color-btn:hover {
  border-color: #2c303b;
  background: var(--surface-hover);
}
.marca-color-btn-swatch {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  flex-shrink: 0;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}
.marca-color-wrap {
  position: relative;
}
.marca-color-popup {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 100;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  min-width: 200px;
}
.marca-color-popup.hidden {
  display: none;
}
.marca-color-popup-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.marca-color-popit {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: all var(--fast) var(--ease);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.marca-color-popit:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.marca-color-popit.selected {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 2px var(--surface-1), 0 0 0 4px currentColor;
  transform: scale(1.1);
}
.marca-color-popup-footer {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  gap: 6px;
  align-items: center;
}
.marca-color-hex-input {
  flex: 1;
  height: 30px;
  font-size: 12px;
  padding: 4px 8px;
  text-align: center;
  font-family: monospace;
  text-transform: uppercase;
}
/* ---------- Icon picker modal ---------- */
.icon-picker-modal-box {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  max-width: 420px;
  width: 100%;
  margin: auto;
  box-shadow: var(--shadow-card);
}
.icon-picker-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.icon-picker-modal-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.icon-picker-modal-grid .icon-picker-option {
  width: 100%;
  aspect-ratio: 1;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-0);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--fast) var(--ease);
  color: var(--text-secondary);
}
.icon-picker-modal-grid .icon-picker-option:hover {
  border-color: #2c303b;
  background: var(--surface-hover);
  color: var(--text-primary);
}
.icon-picker-modal-grid .icon-picker-option.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-2);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.marca-preview-box {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  max-width: 520px;
  width: 100%;
  box-sizing: border-box;
  margin: auto;
  box-shadow: var(--shadow-card);
  text-align: left;
}

.marca-preview-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}
.marca-preview-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.marca-preview-headtext { flex: 1; min-width: 0; }
.marca-preview-nombre {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
}
.marca-preview-cliente {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.marca-preview-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}
.marca-preview-stat {
  background: var(--surface-0);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.marca-preview-stat-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.marca-preview-stat-value {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.marca-preview-timeline {
  margin-bottom: 22px;
}
.marca-preview-timeline-track {
  position: relative;
  height: 4px;
  border-radius: 4px;
  background: var(--surface-2);
  margin: 22px 6px 10px;
}
.marca-preview-timeline-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  border-radius: 4px;
  background: var(--marca-color, var(--accent));
}
.marca-preview-timeline-dot {
  position: absolute;
  top: 50%;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--marca-color, var(--accent));
  border: 2px solid var(--surface-1);
  transform: translate(-50%, -50%);
}
.marca-preview-timeline-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}
.marca-preview-timeline-labels span b { color: var(--text-secondary); font-weight: 600; }

.marca-preview-section-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.marca-preview-contacts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}
.marca-preview-contact-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-0);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 10px 14px;
}
.marca-preview-contact-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
.marca-preview-contact-text { min-width: 0; }
.marca-preview-contact-label { font-size: 10.5px; color: var(--text-muted); }
.marca-preview-contact-value { font-size: 13px; color: var(--text-primary); word-break: break-word; }

.marca-preview-extra-block {
  background: var(--surface-0);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.marca-preview-extra-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 6px;
}
.marca-preview-extra-title i { color: var(--marca-color, var(--accent)); }
.marca-preview-extra-text {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  white-space: pre-wrap;
}

.marca-preview-cotizaciones {
  margin-bottom: 14px;
}
.marca-preview-cot-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  margin-bottom: 4px;
}
.marca-preview-cot-item:last-child {
  margin-bottom: 0;
}
.marca-preview-cot-info {
  flex: 1;
  min-width: 0;
}
.marca-preview-cot-proyecto {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}
.marca-preview-cot-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

.marcas-yearly-grid {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding-top: 20px;
  min-height: 140px;
}
.marcas-year-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.marcas-year-bar {
  width: 100%;
  max-width: 40px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 60%, transparent));
  transition: height var(--fast) var(--ease);
  min-height: 6px;
}
.marcas-year-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-display);
}
.marcas-year-label {
  font-size: 11px;
  color: var(--text-muted);
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  flex-shrink: 0;
}

/* ---- Top clientes row ---- */
.top-cliente-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
}
.top-cliente-row:last-child { border-bottom: none; }
.top-cliente-pos {
  width: 22px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  flex-shrink: 0;
}
.top-cliente-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.top-cliente-info {
  flex: 1;
  min-width: 0;
}
.top-cliente-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-cliente-monto {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-2);
  font-family: var(--font-display);
  flex-shrink: 0;
}
/* ---- Distribución ---- */
.distrib-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.distrib-label {
  width: 80px;
  font-size: 12px;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.distrib-bar-track {
  flex: 1;
  height: 6px;
  border-radius: 4px;
  background: var(--surface-2);
  overflow: hidden;
}
.distrib-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width var(--fast) var(--ease);
}
.distrib-count {
  width: 28px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
  flex-shrink: 0;
}

/* ---------- Notification badge ---------- */
.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  border-radius: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}

/* ---------- Notification slide panel ---------- */
.notif-panel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.notif-panel-overlay:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
}
.notif-panel-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.notif-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  max-width: 92vw;
  height: 100%;
  background: var(--surface-1);
  border-left: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(0,0,0,0.4);
  transform: translateX(100%);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  isolation: isolate;
}
.notif-panel:not(.hidden) {
  transform: translateX(0);
}
.notif-panel.hidden {
  transform: translateX(100%);
}
.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.notif-panel-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.notif-panel-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.notif-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
}
.notif-empty {
  padding: 32px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  margin-bottom: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  opacity: 0;
  transform: translateY(-8px);
  animation: notifStaggerIn 0.3s ease forwards;
  transition: background 0.2s, border-color 0.2s;
  overflow: hidden;
}
.notif-item:hover {
  background: var(--surface-hover);
  border-color: var(--border);
}
.notif-item.dismissing {
  opacity: 0;
  transform: translateX(60px);
  margin-bottom: -8px;
  border-color: transparent;
  transition: opacity 0.3s ease, transform 0.3s ease, margin 0.3s ease, border-color 0.3s ease;
}
@keyframes notifStaggerIn {
  to { opacity: 1; transform: translateY(0); }
}
.notif-item-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 15px;
}
.notif-item--info .notif-item-icon { background: rgba(59,130,246,0.15); color: #3b82f6; }
.notif-item--success .notif-item-icon { background: rgba(16,185,129,0.15); color: #10b981; }
.notif-item--warning .notif-item-icon { background: rgba(245,158,11,0.15); color: #f59e0b; }
.notif-item--danger .notif-item-icon { background: rgba(239,68,68,0.15); color: #ef4444; }
.notif-item-content {
  flex: 1;
  min-width: 0;
}
.notif-item-titulo {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}
.notif-item--danger .notif-item-titulo { color: #ef4444; }
.notif-item--success .notif-item-titulo { color: #10b981; }
.notif-item--warning .notif-item-titulo { color: #f59e0b; }
.notif-item-detalle {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.4;
}
.notif-item-fecha {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  opacity: 0.6;
}
.notif-clickable { cursor: pointer; }
.notif-clickable:hover { background: var(--surface-2); }
.notif-item-close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
  margin-top: 1px;
}
.notif-item-close:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
}
.notif-no-leida {
  border-color: rgba(59,130,246,0.25);
}

/* ---------- Floating notification alert ---------- */
.notif-aviso {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 2000;
  max-width: 380px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
  pointer-events: auto;
  cursor: pointer;
  animation: avisoIn 0.35s ease forwards;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.notif-aviso.hidden {
  display: none;
}
.notif-aviso.salir {
  animation: avisoOut 0.3s ease forwards;
}
.notif-aviso--success { border-left-color: var(--success); }
.notif-aviso--warning { border-left-color: #f59e0b; }
.notif-aviso--danger { border-left-color: var(--danger); }
.notif-aviso--info { border-left-color: var(--accent); }
.notif-aviso-icon {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 14px;
}
.notif-aviso--success .notif-aviso-icon { background: rgba(52,211,153,0.12); color: var(--success); }
.notif-aviso--warning .notif-aviso-icon { background: rgba(245,158,11,0.12); color: #f59e0b; }
.notif-aviso--danger .notif-aviso-icon { background: rgba(248,113,113,0.12); color: var(--danger); }
.notif-aviso--info .notif-aviso-icon { background: rgba(99,140,255,0.12); color: var(--accent); }
.notif-aviso-texto {
  flex: 1;
  min-width: 0;
}
.notif-aviso-titulo {
  font-weight: 600;
  margin-bottom: 2px;
}
.notif-aviso-detalle {
  font-size: 12px;
  color: var(--text-secondary);
}

@keyframes avisoIn {
  0% { opacity: 0; transform: translateX(40px); }
  100% { opacity: 1; transform: translateX(0); }
}
@keyframes avisoOut {
  0% { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(40px); }
}

/* ---------- Modal box small ---------- */
.modal-box-sm {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 480px;
  max-width: 94vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  padding: 24px 28px;
}

/* ---------- Registro de trabajo ---------- */
.registro-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.registro-group {
  margin-bottom: 18px;
}
.registro-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-0);
  cursor: pointer;
  user-select: none;
  margin-bottom: 8px;
  transition: background var(--fast) var(--ease);
}
.registro-group-header:hover {
  background: var(--surface-2);
}
.registro-group-header .fi {
  font-size: 12px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}
.registro-group-header.collapsed .fi {
  transform: rotate(-90deg);
}
.registro-group-header span {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.registro-group-count {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: auto;
}
.registro-body {
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.registro-body.collapsed {
  max-height: 0 !important;
}
.registro-table {
  width: 100%;
  border-collapse: collapse;
}
.registro-table th {
  text-align: left;
  padding: 8px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg-card);
}
.registro-table td {
  padding: 10px;
  font-size: 13px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s;
}
.registro-table td:not(.registro-cell-actions) {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.registro-table td.td-expanded {
  white-space: normal;
  overflow: visible;
  max-width: none;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  position: relative;
  z-index: 2;
}
.registro-table tr:last-child td {
  border-bottom: none;
}
.registro-table tr:hover td {
  background: var(--surface-0);
}
/* --- LC Table grid --- */
.lc-table-grid {
  display: flex;
  gap: 0;
}
.lc-table-scroll {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
}
.lc-table-scroll .lc-table {
  width: 100%;
}
.lc-cell-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}
.lc-actions-header {
  padding: 8px 10px;
  min-height: 36px;
}
.lc-act-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: none;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.lc-act-btn:hover {
  background: rgba(99,140,255,0.12);
  color: var(--accent);
}
.lc-act-btn--danger:hover {
  background: rgba(248,113,113,0.12) !important;
  color: var(--danger) !important;
}
.lc-row-add {
  padding: 10px 14px;
}
.registro-cell-actions {
  white-space: nowrap;
  display: flex;
  gap: 4px;
}
.registro-empty {
  padding: 32px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* Badges de estado para registro */
.badge-estado {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.badge-estado--sin_empezar {
  background: var(--surface-2);
  color: var(--text-muted);
}
.badge-estado--en_curso {
  background: rgba(99,140,255,0.12);
  color: var(--accent-2);
}
.badge-estado--terminado {
  background: rgba(52,211,153,0.12);
  color: var(--success);
}
.badge-estado--anulada {
  background: rgba(248,113,113,0.12);
  color: var(--danger);
}

/* ---------- Servicios y Precios ---------- */
.sp-pilar-block {
  margin-bottom: 20px;
  padding: 16px;
  background: var(--surface-1);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.sp-pilar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 15px;
}
.sp-pilar-header i { font-size: 16px; color: var(--accent); }
.sp-pilar-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 2px 8px;
  border-radius: 10px;
}
.sp-pilar-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.sp-niveles-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sp-nivel-card {
  background: var(--surface-0);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.sp-nivel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
}
.sp-nivel-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 5px;
}
.sp-nivel-num i { font-size: 12px; }
.sp-nivel-header .btn { margin-left: auto; }
.sp-nivel-body {
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 12px;
}
.sp-nivel-field-full { grid-column: 1 / -1; }
.sp-nivel-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.sp-nivel-field input,
.sp-nivel-field textarea {
  width: 100%;
  padding: 6px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-body);
}
.sp-nivel-field input:focus,
.sp-nivel-field textarea:focus { border-color: var(--accent); outline: none; }
.sp-nivel-field textarea { resize: vertical; min-height: 48px; }
.sp-nivel-precio-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.sp-nivel-precio-icon {
  position: absolute;
  left: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--success);
  pointer-events: none;
}
.sp-nivel-precio-wrap input {
  padding-left: 24px !important;
  font-weight: 600;
}
.sp-nivel-readonly {
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
}
.sp-nivel-readonly-price {
  font-weight: 700;
  font-size: 16px;
  color: var(--success);
}
.sp-nivel-readonly-price .sp-price-icon {
  font-size: 14px;
}
.sp-nivel-readonly-desc {
  color: var(--text-secondary);
  white-space: pre-wrap;
}
.sp-text-muted {
  color: var(--text-muted);
  font-style: italic;
}
.sp-nivel-editing {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.sp-catalogo-precio-cell {
  font-weight: 600;
  color: var(--success);
}
.badge-muted {
  background: var(--surface-2);
  color: var(--text-muted);
}
.sp-catalogo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.sp-catalogo-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.sp-catalogo-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: pointer;
}
.sp-catalogo-table td:not(.sp-cell-acciones) {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sp-catalogo-table td.td-expanded {
  white-space: normal;
  overflow: visible;
  max-width: none;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  position: relative;
  z-index: 2;
}
.sp-catalogo-table tr:hover td { background: var(--surface-1); }
.sp-catalogo-table td input {
  width: 90px;
  padding: 4px 8px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-0);
  color: var(--text-primary);
  font-size: 13px;
}
.sp-catalogo-table td input:focus { border-color: var(--accent); outline: none; }
.sp-toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  cursor: pointer;
}
.sp-toggle input { opacity: 0; width: 0; height: 0; }
.sp-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--surface-2);
  border-radius: 20px;
  transition: background 0.2s;
}
.sp-toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  top: 2px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
}
.sp-toggle input:checked + .sp-toggle-slider { background: var(--success); }
.sp-toggle input:checked + .sp-toggle-slider::before { transform: translateX(16px); }
.sp-cell-acciones {
  white-space: nowrap;
}
.sp-cell-acciones .btn { padding: 4px 8px; font-size: 11px; }
.sp-empty-catalogo {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ---------- Pendientes ---------- */
.pendientes-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.pendiente-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  margin-bottom: 8px;
  transition: all 0.2s;
  background: var(--surface-2);
}
.pendiente-item:hover { border-color: var(--border); }
.pendiente-item.completado { opacity: 0.5; }
.pendiente-item.completado .pendiente-texto { text-decoration: line-through; }
.pendiente-item.dismissing {
  opacity: 0;
  transform: translateX(50px);
  max-height: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-color: transparent;
  overflow: hidden;
  transition: all 0.35s ease;
}
.pendiente-check {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.pendiente-check input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--success);
  cursor: pointer;
}
.pendiente-texto {
  flex: 1;
  font-size: 13.5px;
  color: var(--text-primary);
  min-width: 0;
  line-height: 1.4;
}
.pendiente-delete {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 15px;
  padding: 4px;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}
.pendiente-item:hover .pendiente-delete { opacity: 1; }
.pendiente-delete:hover { color: var(--danger); }

/* ---------- Proyectos Kreatik ---------- */
.pk-item {
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border-soft);
  margin-bottom: 10px;
  transition: border-color 0.2s;
  background: var(--surface-2);
}
.pk-item:hover { border-color: var(--border); }
.pk-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.pk-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.pk-item-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
}
.pk-item-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.pk-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--surface-hover);
  border-radius: 3px;
  overflow: hidden;
}
.pk-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
}

/* ---------- Modal forms spacing ---------- */
.modal-box-sm .field-label {
  margin-bottom: 6px;
  display: block;
}
.modal-box-sm input[type="text"],
.modal-box-sm input[type="number"],
.modal-box-sm input[type="date"],
.modal-box-sm select,
.modal-box-sm textarea {
  width: 100%;
  padding: 10px 12px;
}
.modal-box-sm textarea {
  resize: vertical;
  min-height: 60px;
}
.modal-box-sm .grid-2 {
  gap: 14px;
}

/* ---------- Custom tooltips ---------- */
[data-tip] {
  cursor: pointer;
}
/* Tooltips now rendered via JS as fixed-position DOM element on <body> */

/* ---------- LC Multiline cells (Notion-style expand) ---------- */
.lc-cell-multiline {
  position: relative;
  max-width: 220px;
  cursor: pointer;
}
.lc-cell-multiline:hover {
  background: rgba(255,255,255,0.03);
}
.lc-cell-multiline-content {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
  max-height: calc(1.5em * 1);
  font-size: 13px;
}
.lc-cell-multiline-placeholder {
  color: var(--text-muted);
}

/* ---------- LC Content Preview Modal ---------- */
.lc-content-modal-box {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  animation: fadeIn var(--normal) var(--ease);
}
.lc-content-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.lc-content-modal-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.lc-content-modal-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: none;
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  transition: background 0.15s, color 0.15s;
}
.lc-content-modal-close:hover {
  background: var(--danger);
  color: #fff;
}
.lc-content-modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
  font-size: 13.5px;
  color: var(--text-primary);
}
.lc-content-modal-body .lc-content-modal-placeholder {
  color: var(--text-muted);
  font-style: italic;
}

/* ---------- LC Copy-on-hover icon ---------- */
.lc-cell-text,
.lc-cell-multiline {
  position: relative;
}
.lc-copy-icon {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  border: none;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 10px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
  z-index: 3;
  pointer-events: none;
}
.lc-cell-text:hover .lc-copy-icon,
.lc-cell-multiline:hover .lc-copy-icon {
  opacity: 1;
  pointer-events: auto;
}
.lc-copy-icon:hover {
  background: var(--accent);
  color: #fff;
}
.lc-copy-icon.copied {
  background: var(--success);
  color: #fff;
}

/* ---------- LC Row drag handle ---------- */
.lc-grip {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 24px;
  cursor: grab;
  color: var(--text-muted);
  opacity: 0.3;
  transition: opacity 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
  user-select: none;
  font-size: 10px;
  letter-spacing: 1px;
}
.lc-grip:hover {
  opacity: 0.8;
  color: var(--text-secondary);
}
.lc-grip:active {
  cursor: grabbing;
}
.lc-table tbody tr.dragging {
  opacity: 0.4;
  background: rgba(99,140,255,0.06);
}
.lc-table tbody tr.drag-over {
  box-shadow: inset 0 -2px 0 var(--accent);
}

/* ---------- LC Duplicate button in actions ---------- */
.lc-act-btn--duplicate:hover {
  background: rgba(99,140,255,0.12) !important;
  color: var(--accent) !important;
}

/* ---------- LC Schema — Cell types ---------- */
.lc-cell-checkbox {
  text-align: center;
  cursor: pointer;
  width: 40px;
}
.lc-cell-checkbox .lc-checkbox {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 1.5px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  transition: background 0.15s, border-color 0.15s;
  cursor: pointer;
}
.lc-cell-checkbox .lc-checkbox:hover {
  border-color: var(--accent);
}
.lc-cell-checkbox .lc-checkbox--checked {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.lc-cell-checkbox .lc-checkbox--checked::after {
  content: '';
  display: block;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}
.lc-cell-url {
  max-width: 220px;
}
.lc-cell-url a {
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  font-size: 13px;
}
.lc-cell-url a:hover {
  text-decoration: underline;
}
.lc-cell-url .lc-url-edit {
  display: none;
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: none;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 9px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.lc-cell-url:hover .lc-url-edit {
  display: inline-flex;
}
.lc-cell-number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------- LC Schema — Tag chip ---------- */
.lc-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
}
.lc-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  align-items: center;
}
.lc-tag-row:empty::before {
  content: '\2014';
  color: var(--text-muted);
}
.lc-tag-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 10px;
  cursor: pointer;
  opacity: 0.6;
  padding: 0;
  margin-left: 1px;
}
.lc-tag-remove:hover {
  opacity: 1;
  background: rgba(0,0,0,0.15);
}

/* ---------- LC Schema — Multi-select dropdown ---------- */
.lc-multi-dd {
  min-width: 220px;
}
.lc-multi-dd-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 10px 4px;
  border-bottom: 1px solid var(--border);
  min-height: 36px;
}
.lc-multi-dd-tags:empty::before {
  content: 'Selecciona opciones...';
  color: var(--text-muted);
  font-size: 12px;
}

/* ---------- LC Schema — Status dropdown ---------- */
.lc-status-dd-group {
  padding: 6px 0 2px;
}
.lc-status-dd-group-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  padding: 4px 12px 2px;
}
.lc-status-dd-group .lc-dropdown-item {
  padding-left: 12px;
}

/* ---------- LC Schema — New/Edit column modal ---------- */
.lc-col-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 20px;
  z-index: 610;
  overflow-y: auto;
}
.lc-col-modal-box {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.lc-col-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.lc-col-modal-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}
.lc-col-modal-body {
  padding: 20px;
}
.lc-col-modal-body .field-label {
  margin-bottom: 6px;
}
.lc-col-modal-body input[type="text"],
.lc-col-modal-body select {
  width: 100%;
  margin-bottom: 14px;
}
.lc-col-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 14px;
}
.lc-col-type-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}
.lc-col-type-btn:hover {
  background: var(--surface-2);
}
.lc-col-type-btn.active {
  border-color: var(--accent);
  background: rgba(59,130,246,0.08);
  color: var(--accent);
}
.lc-col-type-btn i {
  font-size: 14px;
  width: 18px;
  text-align: center;
}
.lc-col-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

/* ---------- LC Schema — Option editor inline ---------- */
.lc-opt-list {
  margin-top: 8px;
}
.lc-opt-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 0;
}
.lc-opt-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
  cursor: pointer;
}
.lc-opt-name {
  flex: 1;
  font-size: 13px;
  color: var(--text);
}
.lc-opt-del {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 10px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.lc-opt-item:hover .lc-opt-del {
  display: inline-flex;
}
.lc-opt-del:hover {
  background: var(--danger);
  color: #fff;
}
.lc-opt-add-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 0;
}
.lc-opt-add-input {
  flex: 1;
  font-size: 13px;
  background: transparent;
  border: none;
  color: var(--text);
  outline: none;
}
.lc-opt-add-input::placeholder {
  color: var(--text-muted);
}
.lc-color-palette-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 6px 0;
}
.lc-color-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.lc-color-dot:hover {
  transform: scale(1.15);
}
.lc-color-dot.active {
  border-color: var(--text-primary);
}
.lc-color-dot-pick {
  position: absolute;
  z-index: 10;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  width: 220px;
}
.lc-add-col-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.lc-add-col-btn:hover {
  background: var(--surface-2);
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- Control de Pagos ---------- */
.badge-pago-completado {
  background: rgba(16,185,129,0.12);
  color: #10b981;
  border: 1px solid rgba(16,185,129,0.25);
}
.badge-pago-parcial {
  background: rgba(245,158,11,0.12);
  color: #f59e0b;
  border: 1px solid rgba(245,158,11,0.25);
}
.badge-sin-pagos {
  background: rgba(148,163,184,0.12);
  color: var(--text-muted);
  border: 1px solid rgba(148,163,184,0.25);
}
.cp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.cp-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.cp-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}
.cp-table tr:hover td {
  background: var(--surface-1);
}
.cp-empty {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-muted);
  font-size: 13px;
}
/* --- Control de Pagos: Panel gráfico --- */
.cp-month-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.cp-month-label {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 140px;
  text-align: center;
}
.cp-period-filter {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
}
.cp-period-btn {
  padding: 4px 12px !important;
  font-size: 12px !important;
  border-radius: 6px !important;
  font-weight: 500;
}
.cp-period-btn.active {
  background: var(--accent) !important;
  color: #fff !important;
  border-color: var(--accent) !important;
}
.cp-chart-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.cp-chart-card {
  background: linear-gradient(180deg, var(--surface-1), var(--surface-0));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}
.cp-chart-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}
.cp-chart-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.cp-chart-value {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}
.cp-chart-body {
  flex: 1;
  position: relative;
  min-height: 120px;
}
.cp-chart-body canvas {
  width: 100% !important;
  height: 100% !important;
}
.cp-chart-body--donut {
  display: flex;
  align-items: center;
  justify-content: center;
}
.cp-empty-chart {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 120px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}
.cp-table-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}
@media (max-width: 1100px) {
  .cp-chart-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .cp-chart-grid { grid-template-columns: 1fr; }
}
/* --- Dashboard: Greeting / Typewriter --- */
.db-greeting { margin-bottom: 24px; }
.db-greeting-text {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  display: inline;
}
.db-greeting-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: db-blink 0.7s step-end infinite;
}
@keyframes db-blink { 50% { opacity: 0; } }
.db-greeting-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}
/* --- Dashboard: Grid --- */
.db-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.db-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
.db-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 14px; }
/* --- Dashboard: Chart wrappers --- */
.db-chart-wrap { position: relative; height: 180px; }
.db-chart-wrap canvas { width: 100% !important; height: 100% !important; }
.db-chart-wrap--donut { height: 200px; display: flex; align-items: center; justify-content: center; }
.db-empty-chart {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 140px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}
/* --- Dashboard: Top Clientes --- */
.db-cliente-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-soft);
}
.db-cliente-row:last-child { border-bottom: none; }
.db-cliente-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.db-cliente-info { flex: 1; min-width: 0; }
.db-cliente-nombre {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.db-cliente-sub { font-size: 11px; color: var(--text-muted); }
.db-cliente-monto {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}
/* --- Dashboard: Compact lists --- */
.db-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13px;
}
.db-list-item:last-child { border-bottom: none; }
.db-list-item-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}
.db-list-item-meta { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
/* --- Dashboard: Widget pagos --- */
.db-pago-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13px;
}
.db-pago-row:last-child { border-bottom: none; }
.db-pago-label { color: var(--text-secondary); }
.db-pago-value { font-family: var(--font-display); font-weight: 700; color: var(--text-primary); }
/* --- Dashboard: Actividad reciente --- */
.db-actividad-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
}
.db-actividad-item:last-child { border-bottom: none; }
.db-actividad-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 12px;
}
.db-actividad-icon--success { background: rgba(52,211,153,0.14); color: var(--success); }
.db-actividad-icon--warning { background: rgba(251,191,36,0.14); color: var(--warning); }
.db-actividad-icon--info { background: rgba(59,130,246,0.14); color: var(--accent); }
.db-actividad-icon--danger { background: rgba(248,113,113,0.14); color: var(--danger); }
.db-actividad-body { flex: 1; min-width: 0; }
.db-actividad-titulo { font-size: 13px; color: var(--text-primary); }
.db-actividad-detalle { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.db-actividad-time { font-size: 11px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
/* --- Dashboard: Empty state per block --- */
.db-empty-block {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
}
.db-empty-block i { font-size: 20px; display: block; margin-bottom: 6px; opacity: 0.5; }

/* ---------- Autocomplete ---------- */
.autocomplete-sugerencias {
  position: fixed;
  z-index: 10000;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: 180px;
  overflow-y: auto;
  display: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.autocomplete-sugerencias .ac-item {
  padding: 9px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  transition: background var(--fast) var(--ease);
}
.autocomplete-sugerencias .ac-item:last-child { border-bottom: none; }
.autocomplete-sugerencias .ac-item:hover { background: var(--surface-hover); }
.autocomplete-sugerencias .ac-item .ac-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.autocomplete-sugerencias .ac-empty {
  padding: 12px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* ---------- Campos obligatorios ---------- */
.field-required-error {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.2) !important;
}
.field-required-error:focus {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.3) !important;
}
.lc-detail-input.field-required-error {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.2) !important;
}

/* Plantilla de cotización – editor en Configuración */
.plantilla-seccion-item {
  transition: opacity 0.2s, border-color 0.15s;
}
.plantilla-seccion-item:hover {
  border-color: var(--accent) !important;
}
.plantilla-seccion-item .drag-handle:hover {
  color: var(--accent);
}
#btn-restaurar-plantilla:hover {
  color: var(--danger);
}
#btn-add-pagina-custom:hover {
  border-color: var(--accent) !important;
  color: var(--accent);
}

/* Plantilla – editor de sección (página real) */
.pe-edit-overlay {
  z-index: 1100;
}
.pe-edit-shell {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg, #1a1a2e);
}
.pe-edit-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: var(--surface-1, #222);
  border-bottom: 1px solid var(--border, #333);
  flex-shrink: 0;
  z-index: 2;
}
.pe-edit-toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.pe-edit-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.pe-edit-scroll .doc-sheet {
  margin: 0 0 40px;
}

/* Términos – cláusulas en editor */
.pe-term-clause {
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 10px;
  transition: opacity 0.2s, border-color 0.15s, background 0.15s;
  position: relative;
}
.pe-term-clause:hover {
  border-color: #e5e7eb;
  background: #fafafa;
}
.pe-term-clause--inactive {
  opacity: 0.45;
}
.pe-term-clause--inactive:hover {
  opacity: 0.7;
}
.pe-term-clause-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}
.pe-term-clause-title {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.7;
  color: #444;
  white-space: pre-wrap;
  outline: none;
  flex: 1;
}
.pe-term-clause-title:focus {
  outline: 1px solid #3b82f6;
  outline-offset: 2px;
  border-radius: 2px;
}
.pe-term-clause-text {
  font-size: 11px;
  line-height: 1.7;
  color: #444;
  white-space: pre-wrap;
  outline: none;
}
.pe-term-clause-text:focus {
  outline: 1px solid #3b82f6;
  outline-offset: 2px;
  border-radius: 2px;
}
.pe-term-clause-controls {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.pe-term-btn {
  width: 24px;
  height: 24px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #fff;
  color: #666;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.pe-term-toggle-btn:hover {
  border-color: var(--accent, #3b82f6);
  color: var(--accent, #3b82f6);
  background: #eff6ff;
}
.pe-term-toggle-btn[data-active="true"] {
  color: #16a34a;
  border-color: #16a34a;
  background: #f0fdf4;
}
.pe-term-delete-btn:hover {
  border-color: #ef4444;
  color: #ef4444;
  background: #fef2f2;
}

/* Formato – toolbar */
.pe-format-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 14px;
  background: var(--surface-1, #1e1e2e);
  border-bottom: 1px solid var(--border, #333);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.pe-toolbar-group {
  display: flex;
  align-items: center;
  gap: 2px;
}
.pe-toolbar-sep {
  width: 1px;
  height: 22px;
  background: rgba(255,255,255,0.12);
  margin: 0 5px;
}
.pe-tb-btn {
  min-width: 30px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--text-primary, #ddd);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, border-color 0.12s;
  padding: 0 6px;
}
.pe-tb-btn:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.15);
}
.pe-tb-btn.active {
  background: rgba(255,255,255,0.15);
  border-color: var(--accent, #3b82f6);
  color: var(--accent, #3b82f6);
}
.pe-tb-wide {
  min-width: 48px;
  font-size: 12px;
  gap: 3px;
}

/* Dropdowns */
.pe-toolbar-dropdown { position: relative; }
.pe-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: #2a2a3e;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  padding: 4px;
  z-index: 20;
  min-width: 150px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.pe-dropdown-menu.open { display: block; }
.pe-dropdown-item {
  display: block;
  width: 100%;
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-primary, #ddd);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s;
  white-space: nowrap;
}
.pe-dropdown-item:hover { background: rgba(255,255,255,0.1); }

/* Color palette */
.pe-color-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: #2a2a3e;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  padding: 8px;
  z-index: 20;
  flex-direction: row;
  gap: 6px;
  flex-wrap: wrap;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.pe-color-menu.open { display: flex; }
.pe-color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.12s, transform 0.12s;
  padding: 0;
}
.pe-color-swatch:hover {
  border-color: var(--accent, #3b82f6);
  transform: scale(1.15);
}
.pe-color-preview {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: #111;
  border: 1px solid rgba(255,255,255,0.3);
  vertical-align: middle;
}
.pe-color-custom {
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  border: 1px dashed rgba(255,255,255,0.3) !important;
  border-radius: 50% !important;
}

/* Iconos de alineación (CSS puro) */
.pe-icon-align {
  display: inline-block;
  width: 14px;
  height: 12px;
  position: relative;
}
.pe-icon-align::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}
.pe-icon-align::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  top: 5px;
}
.pe-icon-align.pe-align-l::before, .pe-icon-align.pe-align-l::after { left: 0; right: 4px; }
.pe-icon-align.pe-align-c::before, .pe-icon-align.pe-align-c::after { left: 2px; right: 2px; margin: 0 auto; }
.pe-icon-align.pe-align-r::before, .pe-icon-align.pe-align-r::after { left: 4px; right: 0; }
.pe-icon-align.pe-align-f::before, .pe-icon-align.pe-align-f::after { left: 0; right: 0; }

/* Iconos de lista */
.pe-icon-list {
  display: inline-block;
  width: 14px;
  height: 12px;
  position: relative;
  font-size: 0;
}
.pe-icon-list::before, .pe-icon-list::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}
.pe-icon-list::before { top: 1px; }
.pe-icon-list::after { top: 7px; }
.pe-list-ul::before { left: 5px; width: 3px; height: 3px; border-radius: 50%; top: 0; }
.pe-list-ol::before { content: '1'; width: auto; height: auto; font-size: 9px; font-weight: 700; top: -1px; background: none; border-radius: 0; }

/* Tamaño de texto */
.pe-text-sm { font-size: 11px !important; line-height: 1.6; }
.pe-text-lg { font-size: 15px !important; line-height: 1.65; }
.pe-text-xl { font-size: 22px !important; font-weight: 700; line-height: 1.3; }

/* ---------- PDF Import Modal ---------- */
/* ========== Dark Glassmorphism Modals ========== */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: modalFadeIn 0.25s ease-out;
}
.modal-content {
  background: rgba(18, 18, 24, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  width: 100%; max-width: 680px; max-height: 90vh; overflow-y: auto; padding: 28px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6), 0 0 1px rgba(255,255,255,0.05) inset;
  animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal-content label {
  font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 4px; display: block;
}
.modal-content .input-field {
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.modal-content .input-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
.modal-content .btn {
  transition: all 0.2s ease-in-out;
}
.modal-content .btn:active {
  transform: scale(0.97);
}

.pdf-import-overlay {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: modalFadeIn 0.25s ease-out;
}
.pdf-import-box {
  background: rgba(18, 18, 24, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  width: 100%; max-width: 680px; max-height: 90vh; overflow-y: auto; padding: 28px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6), 0 0 1px rgba(255,255,255,0.05) inset;
  animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.pdf-import-title { font-weight: 600; font-size: 16px; color: var(--text); margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; }
.pdf-import-dropzone {
  border: 2px dashed var(--border); border-radius: 10px;
  padding: 40px 20px; text-align: center; cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.pdf-import-dropzone:hover, .pdf-import-dropzone.dragover {
  border-color: var(--accent); background: rgba(59,130,246,0.06);
}
.pdf-import-dropzone-icon { font-size: 32px; color: var(--text-muted); margin-bottom: 8px; }
.pdf-import-dropzone-text { font-size: 13px; color: var(--text-secondary); }
.pdf-import-dropzone-text strong { color: var(--accent); cursor: pointer; }
.pdf-import-spinner {
  display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 30px 0;
}
.pdf-import-spinner-ring {
  width: 36px; height: 36px; border: 3px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: pdfSpin 0.8s linear infinite;
}
@keyframes pdfSpin { to { transform: rotate(360deg); } }
.pdf-import-spinner-text { font-size: 13px; color: var(--text-secondary); }
.pdf-import-form { display: flex; flex-direction: column; gap: 12px; }
.pdf-import-form label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 4px; display: block; }
.pdf-import-form input, .pdf-import-form select {
  width: 100%; padding: 8px 12px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 13px; font-family: inherit;
  box-sizing: border-box;
}
.pdf-import-form input:focus, .pdf-import-form select:focus { outline: none; border-color: var(--accent); }
.pdf-import-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pdf-import-form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.pdf-import-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; border-top: 1px solid var(--border); padding-top: 16px; }
.pdf-import-file-info {
  display: flex; align-items: center; justify-content: space-between; padding: 8px 12px;
  background: var(--surface-2); border-radius: var(--radius-sm); margin-bottom: 12px;
  font-size: 12px; color: var(--text-secondary);
}
.pdf-import-file-info i { color: var(--danger); }
.pdf-import-section {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px; margin-top: 4px;
}
.pdf-import-section-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px;
}
.pdf-import-section-title {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted);
}
.pdf-import-items-table {
  width: 100%; border-collapse: collapse; font-size: 12px;
}
.pdf-import-items-table th {
  text-align: left; padding: 6px 8px; font-weight: 600; font-size: 11px; text-transform: uppercase;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
}
.pdf-import-items-table td {
  padding: 4px 6px; vertical-align: middle;
}
.pdf-import-items-table input {
  padding: 6px 8px; font-size: 12px;
}
.pdf-import-item-del {
  background: transparent; border: none; color: var(--danger); cursor: pointer; padding: 4px 6px;
  border-radius: 4px; display: inline-flex; align-items: center; justify-content: center;
}
.pdf-import-item-del:hover {
  background: rgba(239,68,68,0.1);
}
.pdf-import-add-item-btn {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 4px 8px;
  border-radius: 4px; background: transparent; border: 1px dashed var(--border); color: var(--accent);
  cursor: pointer; margin-top: 6px;
}
.pdf-import-add-item-btn:hover {
  background: rgba(59,130,246,0.08); border-color: var(--accent);
}
.pdf-import-totals-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-top: 8px;
}
.pdf-import-totals-card {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 12px;
}
.pdf-import-totals-card label {
  font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; margin-bottom: 4px; display: block;
}
.pdf-import-totals-card input {
  font-size: 13px; font-weight: 600; padding: 6px 8px;
}

.table-toolbar-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}
.flex-gap-2 { gap: 8px; }
.input-field {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
  color: var(--text);
  font-size: 12px;
  padding: 6px 10px;
  outline: none;
  transition: border-color 0.2s;
}
.input-field:focus { border-color: var(--accent); }
.input-sm { padding: 5px 8px; font-size: 11px; }

/* ==========================================================================
   Bento Layout — Nueva Propuesta
   ========================================================================== */

.bento-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  align-items: start;
}

.bento-left {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.bento-card {
  border-radius: var(--radius-lg);
  padding: 24px;
}

.bento-card .section-heading {
  font-size: 11px;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.bento-card .field-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.bento-card input,
.bento-card select,
.bento-card textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13px;
  width: 100%;
  box-sizing: border-box;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}

.bento-card input:hover,
.bento-card select:hover,
.bento-card textarea:hover {
  border-color: #2c303b;
}

.bento-card input:focus,
.bento-card select:focus,
.bento-card textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}

.bento-right {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ---------- Total acumulado (wallet style) ---------- */

#carrito-total-box {
  text-align: center;
  padding-bottom: 16px;
  margin-bottom: 0;
}

#carrito-total-box .total-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

#carrito-total-usd {
  font-family: var(--font-display);
  font-size: 2.5rem !important;
  font-weight: 700;
  color: var(--text-primary);
  text-shadow: 0 0 30px var(--accent-glow);
  line-height: 1.1;
}

#carrito-total-bs {
  font-size: 13px !important;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---------- Result panel enhancements ---------- */

.result-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.result-panel .breakdown-list {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 12px;
}

/* ---------- Carrito items (mini-cards) ---------- */

#carrito-lista .carrito-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  gap: 10px;
}

#carrito-lista .carrito-item:last-child {
  border-bottom: none;
}

#carrito-lista .carrito-item-info {
  flex: 1;
  min-width: 0;
}

#carrito-lista .carrito-item-label {
  font-size: 12.5px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#carrito-lista .carrito-item-price {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.prop-entregable-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.prop-entregable-row input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 13px;
}

.prop-entregable-row .prop-entregable-nombre {
  flex: 1;
}

.prop-entregable-row .prop-entregable-detalles {
  flex: 2;
}

.prop-entregable-row .prop-entregable-remove {
  flex-shrink: 0;
}

/* Punto de "respuesta nueva" en el botón Link del historial */
.link-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid var(--surface-1, #1a1c23);
  box-sizing: border-box;
}
.link-dot--ok { background: #34d399; }
.link-dot--alerta { background: #f59e0b; }
@media (prefers-reduced-motion: no-preference) {
  .link-dot { animation: link-dot-pulso 1.8s ease-in-out infinite; }
}
@keyframes link-dot-pulso {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* Contador discreto en la entrada del Historial del menú */
.nav-contador {
  margin-left: auto;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #3b82f6;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
