/* Complementos a Tailwind — agenda, admin shell, modo oscuro */

.hidden {
  display: none !important;
}

/* ── Modo oscuro (componentes custom) ── */
.dark body {
  color: #fafaf9;
}

.dark .card {
  background: #1c1917;
  border-color: #292524;
  color: #fafaf9;
}

.dark .stat {
  background: #1c1917;
  border-color: #292524;
}

.dark .stat strong {
  color: #2dd4bf;
}

.dark .admin-main {
  background: #0c0a09;
}

.dark .table-wrap,
.dark table:not(.table-wrap table) {
  background: #1c1917;
  border-color: #292524;
}

.dark .table-wrap th,
.dark table:not(.table-wrap table) th {
  background: #292524;
  color: #a8a29e;
  border-color: #44403c;
}

.dark .table-wrap td,
.dark table:not(.table-wrap table) td {
  color: #e7e5e4;
  border-color: #292524;
}

.dark .toolbar h2,
.dark .toolbar h3 {
  color: #fafaf9;
}

.dark .form-grid label {
  color: #d6d3d1;
}

.dark .form-grid input,
.dark .form-grid textarea,
.dark .form-grid select {
  background: #292524;
  border-color: #44403c;
  color: #fafaf9;
}

.dark .form-grid input:focus,
.dark .form-grid textarea:focus,
.dark .form-grid select:focus {
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.25);
}

.dark .hint {
  color: #a8a29e;
}

.dark .legacy-login,
.dark .legacy-login summary {
  color: #a8a29e;
}

.dark .form-section {
  border-color: #292524;
}

.dark .form-section h2 {
  color: #fafaf9;
}

.dark .slug-field span {
  color: #a8a29e;
}

.dark .agenda-day {
  background: #1c1917;
  border-color: #292524;
}

.dark .agenda-day-head small {
  color: #a8a29e;
}

.dark .agenda-slot {
  background: #292524;
  color: #a8a29e;
}

.dark .agenda-slot.closed {
  background: rgba(127, 29, 29, 0.25);
  color: #fca5a5;
}

.dark .agenda-item {
  background: #292524;
  border-color: #44403c;
}

.dark .agenda-item small {
  color: #a8a29e;
}

.dark .message.inbound {
  background: rgba(8, 145, 178, 0.15);
  border-color: rgba(8, 145, 178, 0.3);
  color: #e7e5e4;
}

.dark .message.outbound {
  background: #292524;
  border-color: #44403c;
  color: #e7e5e4;
}

.dark .pill-success {
  background: rgba(6, 95, 70, 0.35);
  color: #6ee7b7;
}

.dark .pill-warning {
  background: rgba(146, 64, 14, 0.35);
  color: #fcd34d;
}

.dark .pill-danger {
  background: rgba(153, 27, 27, 0.35);
  color: #fca5a5;
}

.dark .pill-brand {
  background: rgba(15, 118, 110, 0.35);
  color: #5eead4;
}

.dark .pill-neutral {
  background: #292524;
  color: #a8a29e;
}

.dark .code-tag {
  background: #292524;
  color: #d6d3d1;
}

.dark .info-box {
  background: rgba(15, 118, 110, 0.12) !important;
  border-color: rgba(45, 212, 191, 0.2) !important;
}

.dark .price {
  color: #2dd4bf;
}

.dark .btn.ghost {
  border-color: #44403c;
  color: #e7e5e4;
}

.dark .btn.ghost:hover {
  background: #292524;
}

.dark #login-view .card {
  background: #1c1917;
  border-color: #292524;
}

.dark #login-view .card h1 {
  color: #fafaf9;
}

.dark .register-actions p {
  color: #a8a29e;
}

/* Admin layout */
.admin-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

@media (min-width: 1024px) {
  .admin-shell {
    flex-direction: row;
  }
}

.sidebar {
  background: linear-gradient(180deg, #1c1917 0%, #292524 100%);
  color: #e7e5e4;
  padding: 1.25rem;
  flex-shrink: 0;
}

@media (min-width: 1024px) {
  .sidebar {
    width: 16rem;
    min-height: 100vh;
    position: sticky;
    top: 0;
    align-self: flex-start;
  }
}

@media (max-width: 1023px) {
  .sidebar {
    position: fixed;
    z-index: 50;
    top: 0;
    left: 0;
    bottom: 0;
    width: 16.5rem;
    max-width: 85vw;
    transform: translateX(-105%);
    transition: transform 220ms ease;
    box-shadow: none;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.35);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(12, 10, 9, 0.55);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
  }

  .sidebar-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
  }
}

/* Stats con icono */
.stat-card {
  position: relative;
  overflow: hidden;
}

.stat-card .stat-icon-wrap {
  position: absolute;
  top: 0.875rem;
  right: 0.875rem;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 118, 110, 0.1);
  color: #0f766e;
}

.dark .stat-card .stat-icon-wrap {
  background: rgba(45, 212, 191, 0.12);
  color: #2dd4bf;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e7e5e4;
}

.dark .admin-topbar {
  border-color: #292524;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  border: 1px solid #e7e5e4;
  background: #ffffff;
  color: #57534e;
  cursor: pointer;
  transition: background 150ms, border-color 150ms, color 150ms;
}

.theme-toggle:hover {
  background: #fafaf9;
  border-color: #d6d3d1;
}

.dark .theme-toggle {
  background: #292524;
  border-color: #44403c;
  color: #d6d3d1;
}

.dark .theme-toggle:hover {
  background: #44403c;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

/* Dashboard charts */
.dashboard-charts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1.25rem;
}

@media (min-width: 768px) {
  .dashboard-charts {
    grid-template-columns: repeat(2, 1fr);
  }
}

.chart-card {
  display: flex;
  flex-direction: column;
  min-height: 17rem;
  padding: 1.125rem 1.25rem !important;
}

.chart-card-wide {
  grid-column: 1 / -1;
}

.chart-card h3 {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #1c1917;
  letter-spacing: -0.01em;
}

.dark .chart-card h3 {
  color: #fafaf9;
}

.chart-wrap {
  position: relative;
  flex: 1;
  min-height: 11.5rem;
}

.chart-wrap-doughnut {
  min-height: 13rem;
  max-width: 18rem;
  margin: 0 auto;
  width: 100%;
}

.sidebar h1 {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  color: #fafaf9;
  letter-spacing: -0.02em;
}

.sidebar nav {
  display: grid;
  gap: 0.25rem;
  margin-top: 0.5rem;
}

@media (max-width: 1023px) {
  .sidebar nav {
    grid-template-columns: repeat(2, 1fr);
  }
}

.sidebar nav button {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-align: left;
  background: transparent;
  border: none;
  color: #a8a29e;
  padding: 0.625rem 0.75rem;
  border-radius: 0.625rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 150ms, color 150ms;
}

.sidebar nav button .nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
  flex-shrink: 0;
}

.sidebar nav button .nav-label {
  flex: 1;
  min-width: 0;
}

.sidebar nav button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fafaf9;
}

.sidebar nav button.active {
  background: rgba(15, 118, 110, 0.35);
  color: #ffffff;
  font-weight: 600;
}

.sidebar nav button.hidden {
  display: none;
}

.admin-main {
  flex: 1;
  padding: 1.25rem 1.5rem 2.5rem;
  background: #fafaf9;
  min-width: 0;
}

.role-badge {
  display: inline-block;
  margin: 0 0 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #44403c;
  color: #e7e5e4;
}

.tenant-picker {
  display: block;
  margin-bottom: 1rem;
  font-size: 0.8rem;
  color: #a8a29e;
}

.tenant-picker select {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.5rem 0.65rem;
  border-radius: 0.625rem;
  border: 1px solid #57534e;
  background: #292524;
  color: #fafaf9;
  font-size: 0.875rem;
}

.legacy-login {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: #78716c;
}

.legacy-login summary {
  cursor: pointer;
  color: #57534e;
}

/* Agenda semanal */
.agenda-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.75rem;
}

.agenda-day {
  background: #ffffff;
  border: 1px solid #e7e5e4;
  border-radius: 1rem;
  padding: 0.875rem;
  min-height: 11rem;
  box-shadow: 0 4px 20px -4px rgba(28, 25, 23, 0.06);
}

.agenda-day.is-today {
  border-color: #0f766e;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.15);
}

.agenda-day-head {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
  font-size: 0.875rem;
}

.agenda-day-head small {
  color: #78716c;
  font-weight: 600;
}

.agenda-slot {
  font-size: 0.75rem;
  color: #78716c;
  margin-bottom: 0.5rem;
  padding: 0.35rem 0.5rem;
  background: #fafaf9;
  border-radius: 0.5rem;
}

.agenda-slot.closed {
  background: #fef2f2;
  color: #991b1b;
}

.agenda-item {
  border: 1px solid #e7e5e4;
  border-radius: 0.625rem;
  padding: 0.5rem 0.625rem;
  margin-bottom: 0.4rem;
  cursor: pointer;
  background: #fff;
  transition: border-color 150ms;
}

.agenda-item:hover {
  border-color: #0f766e;
}

.agenda-item strong {
  display: block;
  font-size: 0.8125rem;
}

.agenda-item small {
  color: #78716c;
  font-size: 0.75rem;
}

.agenda-item.status-confirmed {
  border-left: 3px solid #059669;
}
.agenda-item.status-scheduled {
  border-left: 3px solid #d97706;
}
.agenda-item.status-completed {
  border-left: 3px solid #6b7280;
}
.agenda-item.status-cancelled {
  opacity: 0.55;
  border-left: 3px solid #dc2626;
}

/* Tablas — inputs inline */
#availability-table input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: #0f766e;
  cursor: pointer;
}

#availability-table input[type="time"] {
  width: auto;
  min-width: 7.5rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.8125rem;
}

#availability-table td {
  vertical-align: middle;
}

/* Registro */
.form-section {
  margin-bottom: 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e7e5e4;
}

.form-section:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.form-section h2 {
  margin: 0 0 0.75rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: #1c1917;
}

.slug-field {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.slug-field span {
  color: #78716c;
  font-size: 0.875rem;
  white-space: nowrap;
}

.slug-field input {
  flex: 1;
}

.register-actions {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.register-actions p {
  margin: 0;
  color: #78716c;
  font-size: 0.875rem;
}

/* Site header gradient overlay */
.site-header {
  background: linear-gradient(135deg, #134e4a 0%, #0f766e 50%, #0d9488 100%);
  color: white;
  position: relative;
  overflow: hidden;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

.site-header > .container {
  position: relative;
  z-index: 1;
}

.site-header h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.site-header p {
  margin: 0;
  opacity: 0.92;
  max-width: 52ch;
  font-size: 1.05rem;
  line-height: 1.55;
}

.site-header.compact {
  padding: 1.5rem 0 2.25rem;
}

.site-header:not(.compact) {
  padding: 2rem 0 3rem;
}

.top-nav a:not(.btn) {
  color: white;
  font-weight: 600;
  text-decoration: none;
  opacity: 0.95;
  transition: opacity 150ms;
}

.top-nav a:not(.btn):hover {
  opacity: 1;
  text-decoration: underline;
}

.dark .site-header {
  background: linear-gradient(135deg, #042f2e 0%, #134e4a 50%, #115e59 100%);
}

footer.container,
footer.container p {
  transition: color 150ms;
}

.dark footer.container {
  color: #78716c;
  border-color: #292524;
}
