:root {
  /* Paleta corporativa AIRIN Technologies */
  --brand: #0d4d70;        /* azul marino corporativo */
  --brand-dark: #063049;   /* azul más oscuro (degradados/hover) */
  --brand-teal: #1f9ca0;   /* teal secundario */
  --brand-accent: #f2a01d; /* naranja de acento */
}

.app-navbar {
  background-color: var(--brand);
  position: relative;
  z-index: 1030;
}
/* Asegura que los menús desplegables del navbar queden por encima de
   cualquier elemento con position: sticky del contenido (ej. el panel
   "Resumen" en editar cotización, que usa sticky-lg-top). */
.app-navbar .dropdown-menu {
  z-index: 1055;
}

.navbar-logo {
  height: 38px;
  width: auto;
  max-width: 170px;
  object-fit: contain;
  display: block;
}

/* Logo de marca AIRIN por defecto (empresa sin logo / superadmin).
   El logo tiene fondo blanco, así que lo mostramos en una "tarjetita"
   blanca redondeada para que se vea limpio sobre el navbar de color. */
.navbar-brand-logo {
  height: 40px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  background: #fff;
  padding: 3px 8px;
  border-radius: 8px;
  display: block;
}

.btn-brand {
  background-color: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn-brand:hover {
  background-color: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
}

.text-brand { color: var(--brand); }

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
}

.login-card {
  max-width: 420px;
  width: 100%;
  border: none;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.login-logo {
  max-width: 220px;
  max-height: 120px;
  object-fit: contain;
}

.stat-card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.stat-card .stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--brand);
}

/* Overlay de carga global */
#app-loader {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
#app-loader.activo { display: flex; }
#app-loader .loader-box {
  background: #fff;
  padding: 24px 32px;
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  text-align: center;
}
#app-loader .spinner-border { color: var(--brand); width: 2.5rem; height: 2.5rem; }
#app-loader .loader-msg { margin-top: 12px; font-weight: 600; color: var(--brand-dark); }

/* Botón en estado ocupado */
.btn.cargando { pointer-events: none; opacity: 0.75; }

/* Badge del negocio activo en el navbar */
.negocio-badge {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
}
.nav-link:hover .negocio-badge { background: rgba(255, 255, 255, 0.28); }

/* Toast transitorio al cambiar de negocio */
.toast-negocio {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%) translateY(-14px);
  background: var(--brand-dark);
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  font-weight: 500;
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast-negocio.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast-negocio i { font-size: 1.1rem; }
@media (prefers-reduced-motion: reduce) {
  .toast-negocio { transition: opacity 0.2s ease; }
}

/* Vista de agenda: grilla horaria por columna (día actual) */
.agenda-grid {
  display: flex;
  align-items: flex-start;
  overflow-x: auto;
}
.agenda-col-header {
  font-weight: 600;
  font-size: 0.82rem;
  padding: 8px 6px;
  text-align: center;
  border-bottom: 2px solid var(--brand);
  background: #fff;
  position: sticky;
  top: 0;
}
.agenda-time-col {
  flex: 0 0 52px;
  position: relative;
}
.agenda-time-body {
  position: relative;
}
.agenda-hora-label {
  position: absolute;
  right: 8px;
  transform: translateY(-50%);
  font-size: 0.7rem;
  color: #8a8a8a;
  white-space: nowrap;
}
.agenda-col {
  flex: 1 1 0;
  min-width: 150px;
  border-left: 1px solid #eee;
  display: flex;
  flex-direction: column;
}
.agenda-col-body {
  display: grid;
  position: relative;
}
.agenda-slot {
  border-top: 1px dashed rgba(0, 0, 0, 0.07);
  cursor: pointer;
}
.agenda-slot:hover {
  background: rgba(13, 77, 112, 0.06);
}
.agenda-evento {
  grid-column: 1;
  margin: 1px 4px;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.72rem;
  line-height: 1.2;
  overflow: hidden;
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  z-index: 1;
}
.agenda-evento-hora { font-weight: 700; margin-right: 4px; }
.agenda-evento-titulo,
.agenda-evento-servicio {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agenda-evento-servicio { opacity: 0.85; }
.agenda-evento-pendiente { background: #6c757d; }
.agenda-evento-confirmada { background: var(--brand); }
.agenda-evento-completada { background: #198754; }
.agenda-evento-cancelada { background: #adb5bd; text-decoration: line-through; opacity: 0.75; }

.agenda-col-hoy .agenda-col-header {
  background: color-mix(in srgb, var(--brand) 10%, white);
}

/* Vista de agenda: calendario mensual */
.agenda-mes-cabecera,
.agenda-mes-semana {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.agenda-mes-cabecera {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #8a8a8a;
  border-bottom: 1px solid #eee;
}
.agenda-mes-cabecera > div { padding: 8px 0; }
.agenda-mes-celda {
  min-height: 96px;
  border-top: 1px solid #f0f0f0;
  border-left: 1px solid #f0f0f0;
  padding: 4px 6px;
  font-size: 0.72rem;
  color: inherit;
  text-decoration: none;
  display: block;
}
.agenda-mes-semana > .agenda-mes-celda:last-child { border-right: 1px solid #f0f0f0; }
.agenda-mes-celda:hover { background: rgba(13, 77, 112, 0.05); }
.agenda-mes-celda.fuera-de-mes { color: #bbb; }
.agenda-mes-fecha {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  font-weight: 600;
  margin-bottom: 4px;
  border-radius: 50%;
}
.agenda-mes-celda.es-hoy .agenda-mes-fecha { background: var(--brand); color: #fff; }
.agenda-mes-evento {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.agenda-mes-mas { font-size: 0.68rem; color: #8a8a8a; }
.agenda-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.agenda-dot-pendiente { background: #6c757d; }
.agenda-dot-confirmada { background: var(--brand); }
.agenda-dot-completada { background: #198754; }
.agenda-dot-cancelada { background: #adb5bd; }
