* { margin: 0; padding: 0; box-sizing: border-box; }

/* PAGE TABS (sub-tabs within each page) */
.page-tabs {
  border-bottom: 2px solid #e2e8f0;
  gap: 2px;
  margin-bottom: 12px;
}
.page-tabs .nav-link {
  border: none;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  padding: 8px 18px;
  margin-bottom: -2px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  background: transparent;
  transition: all 0.2s;
}
.page-tabs .nav-link:hover { color: #e94560; background: #f8fafc; }
.page-tabs .nav-link.active {
  border: none;
  border-bottom: 3px solid #e94560;
  color: #1a1a2e;
  background: transparent;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
  min-height: 100vh;
}

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 200px;
  background: #fff;
  padding: 0;
  border-right: 1px solid #e2e8f0;
  box-shadow: 2px 0 12px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 16px 16px 12px;
  flex-shrink: 0;
}

.sidebar-header .logo-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.sidebar .logo-dot {
  width: 10px;
  height: 10px;
  background: #e94560;
  border-radius: 50%;
  flex-shrink: 0;
}

.sidebar h1 {
  font-size: 18px;
  font-weight: 800;
  color: #1a1a2e;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.sidebar .subtitle {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
  padding-left: 20px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px 16px;
  border-top: 1px solid #e2e8f0;
  font-size: 11px;
  color: #94a3b8;
  text-align: center;
}

.sidebar-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  color: #334155;
}

.sidebar-user-info {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-logout {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  transition: 0.15s;
  font-weight: 600;
  white-space: nowrap;
}

.btn-logout:hover { background: #dc2626; color: #fff; }

nav {
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: transparent;
  border: none;
  color: #64748b;
  padding: 9px 12px;
  text-align: left;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.2s;
  position: relative;
}

.nav-btn::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px;
  height: 20px;
  background: #e94560;
  border-radius: 0 3px 3px 0;
  transition: transform 0.2s;
}

.nav-btn:hover {
  background: #f8fafc;
  color: #1a1a2e;
}

.nav-btn:hover::before {
  transform: translateY(-50%) scaleY(0.6);
}

.nav-btn.active {
  background: #fff1f3;
  color: #e94560;
  font-weight: 600;
}

.nav-btn.active::before {
  transform: translateY(-50%) scaleY(1);
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.nav-btn:hover .nav-icon { opacity: 1; }
.nav-btn.active .nav-icon { opacity: 1; }

.nav-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.content {
  flex: 1;
  padding: 24px 28px;
  overflow-y: auto;
  background: #f8fafc;
}

.page { display: none; }
.page.active { display: block; }

.page-header {
  padding: 12px 0;
  margin-bottom: 16px;
}

.page-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a2e;
}

.page-desc {
  font-size: 13px;
  color: #64748b;
  margin-top: 4px;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  border: 1px solid #e2e8f0;
}

.form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.field {
  flex: 1;
  min-width: 180px;
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.field input, .field select {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  color: #1a1a2e;
  background: #f8fafc;
  outline: none;
  transition: all 0.2s;
}

.field input:focus, .field select:focus {
  border-color: #e94560;
  box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
  background: #fff;
}

.btn-primary {
  background: #e94560;
  color: #fff;
  border: none;
  padding: 10px 28px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 4px;
}

.btn-primary:hover {
  background: #d63851;
  box-shadow: 0 4px 12px rgba(233, 69, 96, 0.35);
  transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover { background: #e2e8f0; }

.btn-danger {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-danger:hover { background: #fee2e2; }
.btn-edit-historial { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; border-radius: 6px; padding: 4px 10px; font-size: 11px; cursor: pointer; transition: 0.15s; white-space: nowrap; font-weight:600; }
.btn-edit-historial:hover { background: #2563eb; color: #fff; }

.btn-edit { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; border-radius: 6px; padding: 4px 10px; font-size: 11px; cursor: pointer; transition: 0.15s; white-space: nowrap; font-weight: 600; }
.btn-edit:hover { background: #2563eb; color: #fff; }
.btn-eliminar { background: #fef2f2; color: #dc2626; border-color: #fecaca; margin-left: 8px; }
.btn-eliminar:hover { background: #dc2626; color: #fff; }
.rol-select { padding: 4px 6px; border-radius: 6px; border: 1px solid #e2e8f0; font-size: 12px; background: #fff; color: #334155; }
.rol-select:disabled { opacity: 0.5; cursor: not-allowed; }
.subtotal-row { background: #f8fafc; border-top: 2px solid #e2e8f0; }
.subtotal-row td { padding: 6px 10px !important; font-size: 12px; }
.total-row { background: #f0f9ff; border-top: 3px double #2563eb; }
.total-row td { padding: 8px 10px !important; font-size: 13px; }
.fecha-extra-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.fecha-extra-input { padding: 5px 8px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 13px; }
.btn-fecha-remove { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; border-radius: 6px; padding: 2px 8px; font-size: 12px; cursor: pointer; }
.btn-fecha-remove:hover { background: #dc2626; color: #fff; }

.busqueda-card {
  background: #fff;
  border-radius: 14px;
  padding: 16px 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  border: 1px solid #e2e8f0;
  margin-bottom: 16px;
}

.busqueda-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.busqueda-input-group {
  flex: 1;
  min-width: 250px;
}

.busqueda-input-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.busqueda-row {
  display: flex;
  gap: 10px;
}

.busqueda-row input {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  color: #1a1a2e;
  background: #f8fafc;
  outline: none;
  transition: all 0.2s;
  min-width: 120px;
}

.busqueda-row input:focus {
  border-color: #e94560;
  box-shadow: 0 0 0 4px rgba(233, 69, 96, 0.1);
  background: #fff;
}

.busqueda-row .btn-primary {
  padding: 10px 22px;
  font-size: 14px;
  white-space: nowrap;
}

.busqueda-divider {
  width: 1px;
  height: 50px;
  background: #e2e8f0;
  flex-shrink: 0;
}

.busqueda-opciones {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.toggle-wrap { display: flex; align-items: center; }

.toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.toggle-label input { display: none; }

.toggle-switch {
  width: 44px;
  height: 24px;
  background: #cbd5e1;
  border-radius: 12px;
  position: relative;
  transition: background 0.25s;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform 0.25s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle-label input:checked + .toggle-switch { background: #e94560; }
.toggle-label input:checked + .toggle-switch::after { transform: translateX(20px); }

.toggle-text {
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  white-space: nowrap;
}

.restantes-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 6px 12px;
}

.restantes-label {
  font-size: 13px;
  color: #b91c1c;
  font-weight: 500;
}

.restantes-num {
  font-size: 18px;
  font-weight: 800;
  color: #dc2626;
}

.resultado { margin-top: 0; display: none; }
.resultado.visible { display: block; }

.result-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid #e2e8f0;
}

.result-table th {
  background: #1a1a2e;
  color: #fff;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 12px;
  text-align: left;
}

.result-table td {
  padding: 6px 10px;
  font-size: 14px;
  border-bottom: 1px solid #f1f5f9;
}

.result-table tr:last-child td { border-bottom: none; }

.result-table td.label {
  color: #64748b;
  font-weight: 500;
  width: 55%;
}

.result-table td.valor {
  color: #1a1a2e;
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.result-table td.valor.accent { color: #059669; }
.result-table td.valor.warn { color: #d97706; }
.result-table td.valor.danger { color: #dc2626; }
.result-table td.valor.info { color: #2563eb; }
.result-table td.valor.total { color: #1a1a2e; font-size: 14px; }
.result-table td.valor.accent.total { color: #059669; font-size: 14px; }
.result-table.compact td { padding: 6px 12px; }
.result-table.compact td.label { width: 40%; }
.result-table td.valor.strong { font-size: 16px; }

.pct-info {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
  margin-left: 6px;
  white-space: nowrap;
}

.sin2x1 {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

.vsep { color: #e2e8f0; }

.var-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin: 0 2px;
  white-space: nowrap;
}
.var-chip b { font-size: 11px; }
.var-up { background: #dcfce7; color: #15803d; }
.var-down { background: #fee2e2; color: #b91c1c; }
.var-igual { background: #f1f5f9; color: #475569; }

.tipo-label {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 8px;
  vertical-align: middle;
}
.tipo-label.ord { background: #dbeafe; color: #1d4ed8; }
.tipo-label.extra { background: #f3e8ff; color: #7c3aed; }

.result-table td.total-row {
  border-top: 2px solid #e2e8f0;
  font-weight: 700;
  font-size: 14px;
  padding-top: 8px;
}
.result-table td.total-final {
  border-top: 3px double #1a1a2e;
  font-size: 14px;
}

.result-table .section-row td {
  background: #f8fafc;
  font-weight: 700;
  color: #1a1a2e;
  padding: 6px 10px;
  border-bottom: 2px solid #e2e8f0;
}

.historial-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  max-height: none;
}
.historial-wrapper.proy-scroll {
  max-height: 500px;
}

.loading { color: #94a3b8; padding: 12px 0; }

.historial-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.historial-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 10px;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
  text-align: left;
}

.historial-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
}

.historial-table tr:hover td { background: #f8fafc; }

.tipo-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.tipo-badge.ordinario { background: #dbeafe; color: #1d4ed8; }
.tipo-badge.extraordinario { background: #f3e8ff; color: #7c3aed; }
.tipo-badge.admin-rol { background: #dcfce7; color: #15803d; }

.tag-falta-minimos {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  background: #fee2e2;
  color: #b91c1c;
  margin-left: 5px;
}

.monto { font-weight: 600; font-variant-numeric: tabular-nums; }
.monto.pos { color: #059669; }
.monto.neg { color: #dc2626; }

.paginacion {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.page-btn {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  color: #475569;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  min-width: 38px;
  text-align: center;
}

.page-btn:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.page-btn.active {
  background: #e94560;
  color: #fff;
  border-color: #e94560;
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.page-info {
  font-size: 12px;
  color: #94a3b8;
  margin-left: 8px;
}

.nav-tabs {
  border-bottom: 2px solid #e2e8f0;
  gap: 4px;
  padding: 0;
  margin-bottom: 14px;
}
.nav-tabs .nav-link {
  border: none;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  padding: 10px 18px;
  margin-bottom: -2px;
  transition: all 0.2s;
  background: transparent;
}
.nav-tabs .nav-link:hover {
  border-color: transparent;
  background: #f8fafc;
  isolation: auto;
}
.nav-tabs .nav-link.active {
  border: none;
  border-bottom: 3px solid var(--bs-nav-tabs-link-active-color, #e94560);
  background: transparent;
}

.pct-below {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: #94a3b8;
  margin-top: 2px;
  line-height: 1.3;
}

.mes-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.mes-tab {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  color: #475569;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.mes-tab:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.mes-tab.active {
  background: #e94560;
  color: #fff;
  border-color: #e94560;
}

.config-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.config-table thead th {
  text-align: left;
  padding: 8px 10px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-bottom: 2px solid #e2e8f0;
}
.config-table thead th:first-child { border-radius: 8px 0 0 0; }
.config-table thead th:last-child { border-radius: 0 8px 0 0; }
.config-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s;
}
.config-table tbody tr:hover { background: #f8fafc; }
.config-table tbody tr:last-child { border-bottom: none; }
.config-table td {
  padding: 6px 10px;
  vertical-align: middle;
}
.config-label {
  font-weight: 600;
  color: #1a1a2e;
  white-space: nowrap;
}
.config-input {
  width: 90px;
  padding: 7px 10px;
  border: 1.5px solid #e2e8f0;
  border-radius: 6px;
  font-size: 13px;
  color: #1a1a2e;
  text-align: right;
  outline: none;
  font-family: inherit;
}
.config-input:focus {
  border-color: #e94560;
  box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.08);
}
.config-input-monto {
  width: 140px;
  padding: 7px 10px;
  border: 1.5px solid #e2e8f0;
  border-radius: 6px;
  font-size: 13px;
  color: #1a1a2e;
  text-align: right;
  outline: none;
  font-family: inherit;
}
.config-input-monto:focus {
  border-color: #e94560;
  box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.08);
}
.config-select {
  width: 180px;
  padding: 7px 10px;
  border: 1.5px solid #e2e8f0;
  border-radius: 6px;
  font-size: 13px;
  color: #1a1a2e;
  background: #fff;
  outline: none;
  font-family: inherit;
}
.config-select:focus {
  border-color: #e94560;
  box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.08);
}
.config-na {
  color: #94a3b8;
  font-size: 13px;
  text-align: center;
}
.config-iva {
  font-size: 13px;
  color: #64748b;
  white-space: nowrap;
}
.config-solo td {
  padding: 10px 12px;
}
.config-solo .config-label {
  font-size: 14px;
}
.btn-guardar-config {
  background: #059669;
  color: #fff;
  border: none;
  padding: 10px 28px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 14px;
  transition: all 0.2s;
}

.btn-guardar-config:hover {
  background: #047857;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
}

.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: #059669;
  color: #fff;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  display: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  animation: slideUp 0.3s ease;
  z-index: 200;
}

.toast.error { background: #dc2626; }

@keyframes slideUp {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.checkbox-wrap input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #e94560;
  cursor: pointer;
}

.checkbox-label {
  font-size: 14px;
  color: #475569;
  cursor: pointer;
}

.card-header-hist {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.resumen-card { border-top: 3px solid #2563eb; }
.resumen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.resumen-item { padding: 10px 14px; background: #f8fafc; border-radius: 8px; border: 1px solid #e2e8f0; }
.resumen-item.cons { border-left: 3px solid #d97706; }
.resumen-item.prob { border-left: 3px solid #2563eb; }
.resumen-item.opt { border-left: 3px solid #059669; }
.resumen-label { display: block; font-size: 11px; color: #64748b; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 4px; }
.resumen-val { display: block; font-size: 20px; font-weight: 700; color: #1a1a2e; font-variant-numeric: tabular-nums; }

.proy-tabla-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.proy-esc-labels { display: flex; gap: 12px; }
.esc-label { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 4px; }
.esc-label.cons { background: #fffbeb; color: #d97706; }
.esc-label.prob { background: #eff6ff; color: #2563eb; }
.esc-label.opt { background: #ecfdf5; color: #059669; }

.proy-table th { font-size: 11px; }
.proy-table th.esc-cons { color: #d97706; }
.proy-table th.esc-prob { color: #2563eb; }
.proy-table th.esc-opt { color: #059669; }
.proy-table td.esc-cons { color: #92400e; }
.proy-table td.esc-opt { color: #065f46; }

.proy-totals { display: flex; gap: 20px; justify-content: flex-end; margin-top: 12px; padding-top: 10px; border-top: 1px solid #e2e8f0; font-size: 13px; color: #475569; }
.proy-totals strong { color: #1a1a2e; font-size: 14px; }

.info-toggle { width: 100%; padding: 10px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: #475569; transition: all 0.2s; font-family: inherit; }
.info-toggle:hover { background: #f1f5f9; color: #1a1a2e; }

.help-icon { cursor: help; margin-left: 4px; font-size: 12px; color: #94a3b8; display: inline-block; vertical-align: middle; }
.help-icon:hover { color: #64748b; }

.tag-2x1 { display: inline-block; font-size: 9px; font-weight: 700; color: #fff; background: #94a3b8; border-radius: 3px; padding: 1px 4px; margin-left: 4px; vertical-align: middle; line-height: 1.2; }
.ant-badge { display: inline-block; font-size: 9px; font-weight: 600; color: #d97706; background: #fffbeb; border: 1px solid #fde68a; border-radius: 3px; padding: 0 4px; margin-left: 2px; vertical-align: middle; line-height: 1.3; cursor: help; }

.dc { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; margin-bottom: 16px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.dc-header { display: flex; align-items: center; gap: 10px; padding: 14px 18px; background: #f8fafc; border-bottom: 1px solid #e2e8f0; }
.dc-icon { font-size: 22px; line-height: 1; }
.dc-title { font-size: 16px; font-weight: 700; color: #1a1a2e; margin: 0; }
.dc-body { padding: 16px 18px; font-size: 14px; line-height: 1.6; color: #334155; }
.dc-body p { margin: 0 0 10px 0; }
.dc-body p:last-child { margin-bottom: 0; }
.dc-body code { background: #f1f5f9; padding: 1px 5px; border-radius: 4px; font-size: 13px; color: #e94560; }
.fm { background: #f8fafc; border-left: 3px solid #2563eb; padding: 8px 14px; margin: 8px 0; font-family: 'Courier New', monospace; font-size: 13px; color: #1a1a2e; border-radius: 0 6px 6px 0; }
.dh { font-size: 14px; font-weight: 600; color: #1a1a2e; margin: 14px 0 6px 0; }
.dh:first-of-type { margin-top: 4px; }
.dt { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 13px; }
.dt th { background: #f1f5f9; color: #475569; font-weight: 600; text-align: left; padding: 7px 10px; border-bottom: 2px solid #e2e8f0; }
.dt td { padding: 7px 10px; border-bottom: 1px solid #f1f5f9; }

.resumen-pozos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 28px; }
.r-pozo { background: #fff; border-radius: 16px; padding: 24px 20px 20px; text-align: center; box-shadow: 0 4px 12px rgba(0,0,0,0.06); display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; overflow: hidden; }
.r-pozo::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; }
.r-pozo-excedente::before { background: linear-gradient(90deg, #059669, #34d399); }
.r-pozo-pozo::before { background: linear-gradient(90deg, #2563eb, #60a5fa); }
.rp-icon { font-size: 28px; line-height: 1; margin-bottom: 2px; }
.rp-label { font-size: 11px; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: 0.6px; }
.rp-val { font-size: 30px; font-weight: 800; color: #1a1a2e; font-variant-numeric: tabular-nums; line-height: 1.2; margin: 4px 0; }
.r-pozo-excedente .rp-val { color: #059669; }
.r-pozo-pozo .rp-val { color: #2563eb; }
.rp-pct { font-size: 12px; color: #94a3b8; font-weight: 500; }
.rp-sub { font-size: 12px; color: #64748b; margin-top: 6px; padding-top: 8px; border-top: 1px solid #f1f5f9; width: 100%; }
.rp-sub strong { color: #1a1a2e; }

.resumen-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.r-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 14px 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.r-card-wide { grid-column: 1 / -1; }
.r-card-total { background: #f0f9ff; border-color: #93c5fd; }
.r-card-comision { background: #f0fdf4; border-color: #86efac; grid-column: 1 / -1; }
.r-card-excedente { background: #f5f3ff; border-color: #c4b5fd; }
.r-card-sub { background: #f8fafc; border-color: #e2e8f0; }
.r-card-sec { grid-column: 1 / -1; padding: 8px 16px; background: transparent; border: none; box-shadow: none; }
.r-card-sec.r-card-ord { border-bottom: 3px solid #059669; }
.r-card-sec.r-card-ext { border-bottom: 3px solid #7c3aed; }
.r-label { display: block; font-size: 11px; color: #64748b; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 4px; }
.r-val { display: block; font-size: 18px; font-weight: 700; color: #1a1a2e; font-variant-numeric: tabular-nums; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.info-item { padding: 6px 10px; background: #f8fafc; border-radius: 6px; }
.info-label { display: block; font-size: 11px; color: #94a3b8; font-weight: 500; }
.info-val { display: block; font-size: 14px; color: #1a1a2e; font-weight: 600; }

.result-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.eq-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.eq-card.pos { border-left: 4px solid #059669; }
.eq-card.neg { border-left: 4px solid #dc2626; }
.eq-card.neutral { border-left: 4px solid #2563eb; background: #eff6ff; }

.eq-label {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.eq-val {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.eq-sub {
  font-size: 12px;
  color: #94a3b8;
}

.historial-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.proy-select {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  color: #1a1a2e;
  background: #f8fafc;
  outline: none;
  transition: all 0.2s;
  min-width: 200px;
  cursor: pointer;
  font-family: inherit;
}
.proy-select:focus {
  border-color: #e94560;
  box-shadow: 0 0 0 4px rgba(233, 69, 96, 0.1);
  background: #fff;
}

.historial-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 18px; }
.hist-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 14px 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.hc-label { display: block; font-size: 11px; color: #64748b; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 4px; }
.hc-val { display: block; font-size: 20px; font-weight: 700; color: #1a1a2e; font-variant-numeric: tabular-nums; }

.btn-export {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #059669;
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-export:hover {
  background: #047857;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
  transform: translateY(-1px);
}

.btn-export:active { transform: translateY(0); }

.export-icon {
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 20px;
}

.modal-overlay.visible { display: flex; }

.modal-card {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  text-align: center;
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from { transform: translateY(20px) scale(0.96); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-icon {
  font-size: 36px;
  margin-bottom: 12px;
  line-height: 1;
}

.modal-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 6px;
}

.modal-desc {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 14px;
  line-height: 1.4;
}

.modal-card input[type="password"],
.modal-card input[type="text"] {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 16px;
  outline: none;
  transition: all 0.2s;
  margin-bottom: 6px;
}

.modal-card input[type="password"]:focus,
.modal-card input[type="text"]:focus {
  border-color: #e94560;
  box-shadow: 0 0 0 4px rgba(233, 69, 96, 0.1);
}

.modal-error {
  font-size: 12px;
  color: #dc2626;
  display: none;
  margin-bottom: 8px;
}

.modal-error.visible { display: block; }

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.modal-actions .btn-secondary,
.modal-actions .btn-primary {
  flex: 1;
  text-align: center;
}

@media (max-width: 768px) {
  .sidebar { width: 64px; }
  .sidebar-header { padding: 12px 8px; }
  .sidebar h1 { font-size: 13px; letter-spacing: 0; }
  .sidebar .logo-dot { display: none; }
  .sidebar .subtitle, .sidebar-footer, .nav-label { display: none; }
  nav { padding: 6px 6px; }
  .nav-btn { justify-content: center; padding: 10px; }
  .nav-btn::before { display: none; }
  .nav-icon { width: 22px; height: 22px; }
  .content { padding: 16px; }
  .config-grid { grid-template-columns: 1fr; }
  .busqueda-inner { flex-direction: column; align-items: stretch; gap: 12px; }
  .busqueda-divider { width: 100%; height: 1px; }
  .busqueda-opciones { justify-content: space-between; }
  .busqueda-row input { font-size: 16px; }
  .historial-header { flex-direction: column; }
  .btn-export { width: 100%; justify-content: center; }
}
