/* Estilos complementarios a Tailwind (CDN) para CuentasClaras */

body { background-color: #f6f7fb; }

/* --- Navegacion lateral --- */
.nav-section {
  padding: 1rem 0.75rem 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 0.7rem;
  border-radius: 0.55rem;
  font-size: 0.855rem;
  font-weight: 500;
  color: #b6c0d4;
  transition: background-color .15s ease, color .15s ease;
}
.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.nav-link-active {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  color: #fff;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.35);
}
.nav-link-active:hover {
  color: #fff;
}
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.4rem;
  border-radius: 9999px;
  font-size: 0.68rem;
  font-weight: 700;
}
.nav-badge-emerald { background-color: rgba(52, 211, 153, 0.18); color: #6ee7b7; }
.nav-badge-slate { background-color: rgba(148, 163, 184, 0.2); color: #cbd5e1; }
.nav-link-active .nav-badge { background-color: rgba(255, 255, 255, 0.22); color: #fff; }

/* --- Topbar: buscador, dropdowns, notificaciones --- */
.topbar-search {
  width: 15rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.6rem;
  padding: 0.45rem 0.75rem 0.45rem 2.25rem;
  font-size: 0.83rem;
  background-color: #f8fafc;
  color: #1e293b;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.topbar-search:focus {
  outline: none;
  border-color: #6366f1;
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.topbar-search-scope {
  border: 1px solid #e2e8f0;
  border-right: none;
  border-radius: 0.6rem 0 0 0.6rem;
  padding: 0.45rem 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
  background-color: #f1f5f9;
}
.topbar-search-scope:focus { outline: none; }
.topbar-search-group .topbar-search { border-radius: 0 0.6rem 0.6rem 0; }

.dropdown-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  z-index: 50;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.14);
  overflow: hidden;
  animation: dropdown-in .12s ease-out;
}
@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #334155;
  transition: background-color .12s ease;
}
.dropdown-item:hover { background-color: #f8fafc; }

.notif-badge {
  position: absolute;
  top: 0.15rem;
  right: 0.15rem;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.3rem;
  border-radius: 9999px;
  background-color: #e11d48;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}
.notif-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  color: #334155;
  transition: background-color .12s ease;
}
.notif-item:hover { background-color: #f8fafc; }
.notif-dot { width: 0.5rem; height: 0.5rem; border-radius: 9999px; flex-shrink: 0; }
.notif-dot-rose { background-color: #e11d48; }
.notif-dot-amber { background-color: #d97706; }
.notif-dot-slate { background-color: #94a3b8; }

/* --- Inputs / formularios --- */
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.25rem;
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  border: 1px solid #dbe1ea;
  border-radius: 0.6rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  background-color: #fff;
  color: #1e293b;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* --- Botones --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: 0.6rem;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background-color .15s ease, opacity .15s ease, box-shadow .15s ease, transform .1s ease;
  white-space: nowrap;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, #4f46e5, #4338ca); color: #fff; box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25); }
.btn-primary:hover:not(:disabled) { background: #4338ca; }
.btn-secondary { background-color: #fff; color: #334155; border: 1px solid #dbe1ea; }
.btn-secondary:hover:not(:disabled) { background-color: #f8fafc; }
.btn-danger { background-color: #fff; color: #e11d48; border: 1px solid #fecdd3; }
.btn-danger:hover:not(:disabled) { background-color: #fff1f2; }
.btn-emerald { background: linear-gradient(135deg, #10b981, #059669); color: #fff; box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25); }
.btn-emerald:hover:not(:disabled) { background: #059669; }
.btn-sm { padding: 0.32rem 0.7rem; font-size: 0.78rem; }
.btn-icon { padding: 0; width: 2.05rem; height: 2.05rem; flex-shrink: 0; }

/* --- Tarjetas --- */
.card {
  background: #fff;
  border: 1px solid #eaedf3;
  border-radius: 1rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.03);
}

/* Chip de icono de color para KPIs y paneles */
.icon-chip {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon-chip-emerald { background-color: #d1fae5; color: #059669; }
.icon-chip-blue { background-color: #dbeafe; color: #2563eb; }
.icon-chip-rose { background-color: #fee2e2; color: #dc2626; }
.icon-chip-amber { background-color: #fef3c7; color: #b45309; }
.icon-chip-violet { background-color: #ede9fe; color: #7c3aed; }
.icon-chip-slate { background-color: #f1f5f9; color: #475569; }

/* Indicador de tendencia */
.trend {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.76rem;
  font-weight: 700;
}
.trend-up { color: #059669; }
.trend-down { color: #dc2626; }
.trend-flat { color: #94a3b8; }

/* --- Tablas --- */
.table-erp { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.table-erp thead th {
  text-align: left;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  font-weight: 700;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid #eaedf3;
  background-color: #f8fafc;
  white-space: nowrap;
}
.table-erp tbody td {
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid #f2f4f8;
  color: #334155;
  vertical-align: middle;
}
.table-erp tbody tr:last-child td { border-bottom: none; }
.table-erp tbody tr:hover { background-color: #f8fafc; }

/* --- Badges de estado --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge-pendiente { background-color: #fef3c7; color: #92400e; }
.badge-parcial { background-color: #dbeafe; color: #1e40af; }
.badge-pagada { background-color: #dcfce7; color: #166534; }
.badge-vencida { background-color: #fee2e2; color: #991b1b; }
.badge-anulada { background-color: #e2e8f0; color: #475569; }

/* --- Actividad reciente --- */
.activity-item { display: flex; gap: 0.75rem; padding: 0.6rem 0; }
.activity-icon {
  width: 2rem; height: 2rem; border-radius: 9999px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}

/* --- Toasts --- */
.toast {
  min-width: 260px;
  max-width: 360px;
  padding: 0.75rem 1rem;
  border-radius: 0.7rem;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15);
  font-size: 0.85rem;
  font-weight: 500;
  color: #fff;
  animation: toast-in .18s ease-out;
}
.toast-success { background-color: #16a34a; }
.toast-error { background-color: #dc2626; }
.toast-info { background-color: #334155; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background-color: #cbd5e1; border-radius: 9999px; }

[v-cloak] { display: none !important; }

/* --- Combobox de busqueda (clientes/proveedores) --- */
.combo-panel {
  position: absolute;
  z-index: 40;
  margin-top: 0.25rem;
  width: 100%;
  max-height: 14rem;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #eaedf3;
  border-radius: 0.6rem;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
}
.combo-option { padding: 0.5rem 0.85rem; font-size: 0.85rem; cursor: pointer; }
.combo-option:hover, .combo-option.combo-option-active { background-color: #eef2ff; }

/* --- Modal --- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 1.5rem 1rem; overflow-y: auto; z-index: 50;
  backdrop-filter: blur(2px);
}
.modal-panel {
  background: #fff; border-radius: 1rem; width: 100%; max-width: 42rem;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.28); margin: auto 0;
}
