/* ============================================================
   PELU Dashboard — css/dashboard.css
   Tema claro · prefijo db- · aislado de styles.css/section.css
   ============================================================ */

/* ── Design Tokens ──────────────────────────────────────────── */
:root {
  --db-bg:          #e8eef8;
  --db-surface:     rgba(255, 255, 255, 0.86);
  --db-surface-alt: rgba(246, 250, 255, 0.88);
  --db-border:      rgba(130, 160, 200, 0.34);
  --db-border-dark: rgba(96, 129, 172, 0.5);

  --db-green:   #39b54a;
  --db-blue:    #1456d8;
  --db-purple:  #662d91;
  --db-orange:  #f15a24;
  --db-yellow:  #e6b800;
  --db-red:     #ef4444;

  --db-cat-corte:   #3b82f6;
  --db-cat-tinte:   #8b5cf6;
  --db-cat-barba:   #ef4444;
  --db-cat-estetica:#f59e0b;
  --db-cat-pack:    #10b981;

  --db-text:        #15253d;
  --db-text-2:      #1f3456;
  --db-text-muted:  #5d7396;
  --db-text-light:  #8ea0bc;

  --db-topbar-h: 64px;
  --db-topbar-offset: 14px;
  --db-main-offset: calc(var(--db-topbar-h) + var(--db-topbar-offset) + 18px);
  --db-header-band-h: clamp(230px, 38vh, 360px);
  --db-gap:      14px;
  --db-radius:   12px;
  --db-radius-lg:16px;
  --db-radius-sm: 8px;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }

body {
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  color: var(--db-text);
  background:
    radial-gradient(circle at 6% -14%, rgba(123, 223, 255, 0.42), transparent 30%),
    radial-gradient(circle at 82% 4%, rgba(196, 138, 255, 0.3), transparent 30%),
    radial-gradient(circle at 44% 22%, rgba(104, 246, 210, 0.24), transparent 34%),
    linear-gradient(180deg, #071730 0%, #0b2242 28%, #15375c 54%, #dae6f4 100%);
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: none; background: none; cursor: pointer; }
p, h1, h2, h3 { margin: 0; }

.db-ambient-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--db-header-band-h);
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.db-ambient-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 23, 48, 0) 0%, rgba(11, 29, 56, 0.05) 58%, rgba(218, 230, 244, 0.95) 100%);
}

.db-ambient-glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(64px);
  opacity: 0.7;
}

.db-ambient-glow--one {
  width: 280px;
  height: 220px;
  top: 10px;
  left: -80px;
  background: rgba(122, 234, 255, 0.58);
}

.db-ambient-glow--two {
  width: 330px;
  height: 260px;
  top: -30px;
  right: -90px;
  background: rgba(200, 145, 255, 0.52);
}

.db-ambient-glow--three {
  width: 380px;
  height: 210px;
  top: 120px;
  left: 36%;
  transform: translateX(-50%);
  background: rgba(94, 244, 203, 0.34);
}

.db-decor-cloud {
  position: absolute;
  inset: 0;
}

.db-decor-float {
  position: absolute;
  width: var(--size, 64px);
  height: auto;
  transform: translate3d(-50%, -50%, 0) rotate(var(--float-rot, 0deg));
  transform-origin: center;
  animation-name: db-decor-float;
  animation-duration: var(--float-duration, 24s);
  animation-delay: var(--float-delay, 0s);
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 14px 20px rgba(10, 25, 56, 0.16));
  will-change: transform;
}

@keyframes db-decor-float {
  0%,
  100% {
    transform: translate3d(-50%, -50%, 0) rotate(var(--float-rot, 0deg));
  }
  50% {
    transform: translate3d(calc(-50% + var(--drift-x, 0px)), calc(-50% + var(--drift-y, -18px)), 0)
      rotate(calc(var(--float-rot, 0deg) + 8deg));
  }
}

/* ── Topbar ─────────────────────────────────────────────────── */
.db-topbar {
  position: fixed;
  top: var(--db-topbar-offset);
  left: var(--db-topbar-offset);
  right: var(--db-topbar-offset);
  height: var(--db-topbar-h);
  background: linear-gradient(132deg, rgba(255, 255, 255, 0.92), rgba(240, 247, 255, 0.78));
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 20px;
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  box-shadow: 0 18px 38px rgba(10, 30, 62, 0.2);
  z-index: 200;
  display: flex;
  align-items: center;
  padding: 0 22px;
  gap: 20px;
}

.db-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.db-brand img {
  filter: none !important; /* override el filtro invert de styles.css si aplica */
}

.db-brand-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: brightness(0) !important;
}

.db-brand-wordmark {
  height: 14px;
  width: auto;
  filter: brightness(0) !important;
}

.db-brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f2d55;
}

.db-topbar-divider {
  width: 1px;
  height: 28px;
  background: linear-gradient(180deg, rgba(102, 130, 167, 0), rgba(102, 130, 167, 0.72), rgba(102, 130, 167, 0));
  flex-shrink: 0;
}

.db-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.db-navlink {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--db-radius-sm);
  font-size: 13px;
  color: var(--db-text-muted);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.db-navlink i,
.db-navlink img {
  width: 15px;
  height: 15px;
}

.db-nav-custom-icon {
  object-fit: contain;
  flex-shrink: 0;
}

.db-navlink:hover {
  background: rgba(13, 72, 169, 0.08);
  color: #0d3c7d;
}

.db-navlink.active {
  background: linear-gradient(135deg, rgba(43, 113, 243, 0.18), rgba(114, 227, 255, 0.26));
  color: var(--db-blue);
  font-weight: 500;
  box-shadow: inset 0 0 0 1px rgba(34, 109, 222, 0.2);
}

.db-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

.db-btn-new {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--db-radius-sm);
  background: linear-gradient(135deg, #1657d8, #1f88e8);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 16px rgba(17, 86, 204, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.db-btn-new:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 20px rgba(17, 86, 204, 0.36);
  filter: brightness(1.04);
}
.db-btn-new i { width: 14px; height: 14px; }

.db-btn-client-app {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--db-radius-sm);
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.22);
  color: var(--db-text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s, transform .15s;
  white-space: nowrap;
}
.db-btn-client-app:hover {
  background: rgba(255,255,255,.22);
  transform: translateY(-1px);
}
.db-btn-client-app i { width: 14px; height: 14px; }

.db-avatar-chip {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1351ca, #1f9ae7);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(20, 86, 193, 0.34);
}

/* ── Main Layout ────────────────────────────────────────────── */
.db-layout {
  margin-top: var(--db-main-offset);
  height: calc(100vh - var(--db-main-offset) - 10px);
  display: grid;
  grid-template-columns: 370px 1fr;
  gap: var(--db-gap);
  padding: var(--db-gap) calc(var(--db-gap) + 2px) 10px;
  overflow: hidden;
  position: relative;
  z-index: 2;
}

/* ── Panels base ────────────────────────────────────────────── */
.db-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(244, 249, 255, 0.76));
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: var(--db-radius-lg);
  box-shadow: 0 16px 34px rgba(16, 44, 82, 0.14);
  backdrop-filter: blur(10px) saturate(125%);
  -webkit-backdrop-filter: blur(10px) saturate(125%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.db-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(122, 154, 196, 0.24);
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0));
}

.db-panel-header h2 {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Reservas panel ─────────────────────────────────────────── */
.db-panel--reservas {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--db-border) transparent;
}

.db-panel--reservas .db-panel-header {
  position: sticky;
  top: 0;
  background: var(--db-surface);
  z-index: 10;
}

.db-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--db-blue);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

/* Search box */
.db-search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--db-radius-sm);
  border: 1px solid rgba(118, 149, 191, 0.28);
  background: rgba(239, 245, 255, 0.62);
  width: 160px;
}

.db-search-box i { width: 13px; height: 13px; color: var(--db-text-muted); flex-shrink: 0; }

.db-search-box input {
  border: none;
  background: transparent;
  font: inherit;
  font-size: 12px;
  color: var(--db-text);
  width: 100%;
  outline: none;
}
.db-search-box input::placeholder { color: var(--db-text-muted); }

/* Category filter pills */
.db-cat-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--db-border);
  flex-shrink: 0;
}
.db-cat-filters::-webkit-scrollbar { display: none; }

.db-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
  background: rgba(236, 243, 255, 0.72);
  color: var(--db-text-muted);
  border-color: rgba(124, 157, 199, 0.28);
}

.db-cat-pill.active {
  color: var(--pill-color);
  background: var(--pill-bg);
  border-color: var(--pill-color);
}

.db-cat-pill:hover {
  transform: translateY(-1px);
}

/* Reservation groups */
.db-group-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--db-text-muted);
  position: sticky;
  top: 130px;
  background: var(--db-surface);
  z-index: 5;
}

.db-group-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.db-group-dot--hoy     { background: var(--db-green); }
.db-group-dot--tomorrow { background: var(--db-blue); }
.db-group-dot--later   { background: var(--db-text-light); }

/* Reserva row */
.db-reserva-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: start;
  gap: 10px;
  padding: 10px 16px 10px 12px;
  border-bottom: 1px solid var(--db-border);
  border-left: 4px solid var(--row-color, transparent);
  cursor: pointer;
  transition: background 0.12s;
}

.db-reserva-row:hover { background: rgba(235, 243, 255, 0.82); }
.db-reserva-row:last-child { border-bottom: none; }

.db-client-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  border: 1.5px solid;
  overflow: hidden;
}

.db-client-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.db-row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.db-client-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--db-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.db-service-name {
  font-size: 12px;
  color: var(--db-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.db-contact-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 3px;
}

.db-contact-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  color: var(--db-text-muted);
}
.db-contact-item i { width: 10px; height: 10px; }

.db-row-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.db-hora-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--db-text);
  background: var(--db-bg);
  border: 1px solid var(--db-border);
  padding: 2px 7px;
  border-radius: 6px;
}

.db-cat-tag {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 999px;
}

.db-status-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
}

.db-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.db-status-dot--green  { background: var(--db-green); }
.db-status-dot--yellow { background: var(--db-yellow); }

/* ── Right stack ────────────────────────────────────────────── */
.db-right-stack {
  display: grid;
  grid-template-rows: 1fr 1fr;
  grid-template-columns: 1fr 1fr;
  gap: var(--db-gap);
  min-height: 0;
}

/* Calendar panel: full width top row */
.db-panel--calendar {
  grid-column: 1 / -1;
  grid-row: 1;
}

/* Messages: bottom left */
.db-panel--messages {
  grid-column: 1;
  grid-row: 2;
}

/* Stats: bottom right */
.db-panel--stats {
  grid-column: 2;
  grid-row: 2;
}

/* ── Calendar ────────────────────────────────────────────────── */
.db-cal-inner {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 10px 14px 12px;
  gap: 8px;
  overflow: hidden;
}

.db-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.db-cal-header h2 {
  font-size: 13px;
  font-weight: 600;
}

.db-cal-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.db-cal-nav button {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--db-border);
  background: var(--db-bg);
  color: var(--db-text-muted);
  transition: background 0.12s;
}
.db-cal-nav button:hover { background: var(--db-border); }
.db-cal-nav button i { width: 14px; height: 14px; }

.db-cal-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
}

.db-cal-dow span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--db-text-muted);
  padding: 2px 0;
}

.db-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  flex: 1;
}

.db-cal-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 0;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  color: var(--db-text);
  transition: background 0.12s;
  position: relative;
}

.db-cal-day:hover { background: var(--db-bg); }

.db-cal-day.other-month {
  color: var(--db-text-light);
}

.db-cal-day.today .db-day-num {
  background: var(--db-blue);
  color: #fff;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.db-cal-day.selected .db-day-num {
  background: #e8f0fe;
  color: var(--db-blue);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.db-cal-day.today.selected .db-day-num {
  background: var(--db-blue);
  color: #fff;
}

.db-day-num {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.db-day-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--db-green);
}

/* ── Messages ────────────────────────────────────────────────── */
.db-msg-list {
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--db-border) transparent;
}

.db-msg-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--db-border);
  cursor: pointer;
  transition: background 0.12s;
}
.db-msg-row:hover { background: var(--db-surface-alt); }
.db-msg-row:last-child { border-bottom: none; }

.db-msg-channel {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
  overflow: hidden;
}

.db-msg-channel--instagram { background: #fce4ec; color: #e91e63; }
.db-msg-channel--whatsapp  { background: #e8f5e9; color: #25d366; }
.db-msg-channel--web       { background: #e3f2fd; color: var(--db-blue); }

.db-channel-icon-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  border-radius: 6px;
}

.db-msg-body { flex: 1; min-width: 0; }

.db-msg-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--db-text);
}

.db-msg-preview {
  font-size: 11px;
  color: var(--db-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.db-msg-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.db-msg-time {
  font-size: 10px;
  color: var(--db-text-muted);
}

.db-msg-badge {
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--db-blue);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Statistics ──────────────────────────────────────────────── */
.db-stats-inner {
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--db-border) transparent;
  padding: 10px 14px;
}

.db-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.db-kpi-card {
  background: var(--db-bg);
  border: 1px solid var(--db-border);
  border-radius: var(--db-radius);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.db-kpi-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--db-surface);
  margin-bottom: 4px;
}
.db-kpi-icon i { width: 14px; height: 14px; }

.db-kpi-value {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--db-text);
}

.db-kpi-label {
  font-size: 10px;
  color: var(--db-text-muted);
  font-weight: 500;
}

.db-kpi-change {
  font-size: 10px;
  font-weight: 600;
  margin-top: 2px;
}
.db-kpi-change.up   { color: var(--db-green); }
.db-kpi-change.down { color: var(--db-red); }

.db-services-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--db-text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.db-service-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.db-service-bar-label {
  width: 60px;
  font-size: 11px;
  color: var(--db-text-muted);
  text-align: right;
  flex-shrink: 0;
}

.db-service-bar-track {
  flex: 1;
  height: 8px;
  background: var(--db-bg);
  border-radius: 4px;
  overflow: hidden;
}

.db-service-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.db-service-bar-pct {
  width: 28px;
  font-size: 11px;
  font-weight: 600;
  color: var(--db-text-muted);
  text-align: left;
  flex-shrink: 0;
}

/* ── Detail slide-over ───────────────────────────────────────── */
.db-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.28);
  z-index: 300;
  transition: opacity 0.2s;
}
.db-overlay.open { display: block; }

.db-detail-panel {
  position: fixed;
  top: calc(var(--db-topbar-h) + var(--db-topbar-offset) + 4px);
  right: 0;
  bottom: 0;
  width: 360px;
  background: var(--db-surface);
  border-left: 1px solid var(--db-border);
  z-index: 400;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.db-detail-panel.open { transform: translateX(0); }

.db-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--db-border);
  flex-shrink: 0;
}

.db-detail-header h3 {
  font-size: 14px;
  font-weight: 600;
}

.db-detail-close {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--db-bg);
  transition: background 0.12s;
}
.db-detail-close:hover { background: var(--db-border); }
.db-detail-close i { width: 15px; height: 15px; }

.db-detail-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.db-detail-client {
  display: flex;
  align-items: center;
  gap: 12px;
}

.db-detail-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  border: 2px solid;
  flex-shrink: 0;
  overflow: hidden;
}

.db-detail-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.db-detail-client-info { flex: 1; }
.db-detail-client-name { font-size: 15px; font-weight: 700; }
.db-detail-client-sub  { font-size: 12px; color: var(--db-text-muted); margin-top: 2px; }

.db-detail-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.db-detail-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--db-text-muted);
}

.db-detail-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--db-text);
}
.db-detail-field i { width: 14px; height: 14px; color: var(--db-text-muted); flex-shrink: 0; }

.db-detail-actions {
  display: flex;
  gap: 8px;
  padding: 14px 16px;
  border-top: 1px solid var(--db-border);
  flex-shrink: 0;
}

.db-detail-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px;
  border-radius: var(--db-radius-sm);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.12s;
}
.db-detail-btn i { width: 14px; height: 14px; }

.db-detail-btn--primary {
  background: var(--db-blue);
  color: #fff;
}
.db-detail-btn--primary:hover { background: #004fc4; }

.db-detail-btn--danger {
  background: #fef2f2;
  color: var(--db-red);
}
.db-detail-btn--danger:hover { background: #fee2e2; }

/* ── Toast ───────────────────────────────────────────────────── */
.db-toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.db-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--db-text);
  color: #fff;
  border-radius: var(--db-radius);
  font-size: 13px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  animation: db-toast-in 0.2s ease;
}

.db-toast.success { background: var(--db-green); }
.db-toast.error   { background: var(--db-red);   }
.db-toast i { width: 15px; height: 15px; }

@keyframes db-toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── stat period label ──────────────────────────────────────── */
.db-stat-period {
  font-size: 11px;
  color: var(--db-text-muted);
}

.db-link-sm {
  font-size: 11px;
  color: var(--db-blue);
  font-weight: 500;
}
.db-link-sm:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════════════════════
   SUB-PAGE SHELL (shared por todas las páginas secundarias)
   ══════════════════════════════════════════════════════════════ */
.db-subpage {
  margin-top: var(--db-main-offset);
  height: calc(100vh - var(--db-main-offset) - 10px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 2;
}

.db-subpage-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--db-border);
  background: var(--db-surface);
  flex-shrink: 0;
}

.db-subpage-title {
  font-size: 15px;
  font-weight: 700;
  flex: 1;
  display: inline-flex;
  align-items: center;
}

.db-subpage-body {
  flex: 1;
  overflow: hidden;
  padding: var(--db-gap);
}

/* ══════════════════════════════════════════════════════════════
   MENSAJES  — layout dos columnas
   ══════════════════════════════════════════════════════════════ */
.db-msg-layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  height: 100%;
  background: var(--db-surface);
  border: 1px solid var(--db-border);
  border-radius: var(--db-radius-lg);
  overflow: hidden;
}

.db-msg-sidebar {
  border-right: 1px solid var(--db-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.db-msg-sidebar-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--db-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.db-msg-tabs {
  display: flex;
  gap: 4px;
}

.db-msg-tab {
  flex: 1;
  padding: 5px 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  color: var(--db-text-muted);
  transition: background .12s, color .12s;
  border: 1px solid var(--db-border);
}
.db-msg-tab.active { background: var(--db-blue); color: #fff; border-color: var(--db-blue); }

.db-conv-list {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--db-border) transparent;
}

.db-conv-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--db-border);
  cursor: pointer;
  transition: background .12s;
  position: relative;
}
.db-conv-item:hover { background: var(--db-surface-alt); }
.db-conv-item.active { background: #e8f0fe; }
.db-conv-item:last-child { border-bottom: none; }

.db-conv-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--db-bg);
  border: 1.5px solid var(--db-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--db-text-muted);
  flex-shrink: 0;
  overflow: hidden;
}

.db-conv-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.db-conv-channel-dot {
  position: absolute;
  left: 38px;
  top: 30px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--db-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7px;
  color: #fff;
  overflow: hidden;
}
.db-conv-channel-dot--whatsapp  { background: #25d366; }
.db-conv-channel-dot--instagram { background: #e91e63; }
.db-conv-channel-dot--web       { background: var(--db-blue); }

.db-conv-channel-dot .db-channel-icon-img {
  width: 9px;
  height: 9px;
  border-radius: 2px;
}

.db-conv-body { flex: 1; min-width: 0; }
.db-conv-name { font-size: 13px; font-weight: 600; color: var(--db-text); }
.db-conv-last {
  font-size: 11px;
  color: var(--db-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.db-conv-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.db-conv-time { font-size: 10px; color: var(--db-text-muted); }

/* chat main */
.db-chat-main { display: flex; flex-direction: column; overflow: hidden; }

.db-chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--db-border);
  flex-shrink: 0;
}

.db-chat-header-info { flex: 1; }
.db-chat-header-name { font-size: 14px; font-weight: 600; }
.db-chat-header-sub  { font-size: 11px; color: var(--db-text-muted); margin-top: 1px; }

.db-chat-header-sub .db-channel-icon-img {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  vertical-align: -2px;
  margin-right: 4px;
}

.db-chat-actions { display: flex; gap: 6px; }

.db-chat-action-btn {
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  background: var(--db-bg);
  border: 1px solid var(--db-border);
  transition: background .12s;
  color: var(--db-text-muted);
  white-space: nowrap;
}
.db-chat-action-btn:hover { background: var(--db-border); color: var(--db-text); }
.db-chat-action-btn i { width: 13px; height: 13px; }
.db-chat-action-btn--wa { background: #dcfce7; border-color: #86efac; color: #16a34a; }
.db-chat-action-btn--wa:hover { background: #bbf7d0; }

.db-chat-thread {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #f9fafb;
  scrollbar-width: thin;
  scrollbar-color: var(--db-border) transparent;
}

.db-bubble-row { display: flex; align-items: flex-end; gap: 6px; }
.db-bubble-row--out { flex-direction: row-reverse; }

.db-bubble {
  max-width: 72%;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
}
.db-bubble--in  { background: var(--db-surface); color: var(--db-text); border-bottom-left-radius: 4px; border: 1px solid var(--db-border); }
.db-bubble--out { background: var(--db-blue); color: #fff; border-bottom-right-radius: 4px; }

.db-bubble-time { font-size: 10px; opacity: 0.6; margin-top: 3px; }
.db-bubble-row--out .db-bubble-time { text-align: right; }

.db-chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--db-text-muted);
  font-size: 13px;
  background: #f9fafb;
}
.db-chat-empty i { width: 36px; height: 36px; opacity: 0.25; }

.db-chat-composer {
  padding: 10px 14px;
  border-top: 1px solid var(--db-border);
  display: flex;
  gap: 8px;
  align-items: flex-end;
  background: var(--db-surface);
  flex-shrink: 0;
}

.db-chat-input {
  flex: 1;
  min-height: 36px;
  max-height: 100px;
  padding: 7px 10px;
  border-radius: var(--db-radius-sm);
  border: 1px solid var(--db-border);
  background: var(--db-bg);
  font: inherit;
  font-size: 13px;
  resize: none;
  outline: none;
  overflow-y: auto;
}
.db-chat-input:focus { border-color: var(--db-blue); }

.db-chat-send {
  width: 36px;
  height: 36px;
  border-radius: var(--db-radius-sm);
  background: var(--db-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .12s;
}
.db-chat-send:hover { background: #004fc4; }
.db-chat-send:disabled { background: var(--db-border); cursor: default; }
.db-chat-send i { width: 15px; height: 15px; }

.db-date-divider {
  text-align: center;
  font-size: 10px;
  color: var(--db-text-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  margin: 6px 0;
  position: relative;
}
.db-date-divider::before, .db-date-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 60px);
  height: 1px;
  background: var(--db-border);
}
.db-date-divider::before { left: 0; }
.db-date-divider::after  { right: 0; }

/* ══════════════════════════════════════════════════════════════
   CLIENTES
   ══════════════════════════════════════════════════════════════ */
.db-clients-layout {
  display: grid;
  grid-template-columns: 270px 1fr;
  height: 100%;
  background: var(--db-surface);
  border: 1px solid var(--db-border);
  border-radius: var(--db-radius-lg);
  overflow: hidden;
}

.db-clients-sidebar {
  border-right: 1px solid var(--db-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.db-client-list {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--db-border) transparent;
}

.db-client-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--db-border);
  cursor: pointer;
  transition: background .12s;
}
.db-client-list-item:hover { background: var(--db-surface-alt); }
.db-client-list-item.active { background: #e8f0fe; }
.db-client-list-item:last-child { border-bottom: none; }

.db-client-list-info { flex: 1; min-width: 0; }
.db-client-list-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-client-list-sub  { font-size: 11px; color: var(--db-text-muted); margin-top: 1px; }

.db-client-detail-pane {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.db-client-profile {
  padding: 16px 18px;
  border-bottom: 1px solid var(--db-border);
  flex-shrink: 0;
}

.db-client-profile-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.db-client-big-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
  border: 2px solid;
  overflow: hidden;
}

.db-client-big-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.db-client-kpi-row {
  display: flex;
  gap: 12px;
}

.db-client-kpi {
  flex: 1;
  background: var(--db-bg);
  border: 1px solid var(--db-border);
  border-radius: var(--db-radius);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.db-client-kpi-val   { font-size: 16px; font-weight: 700; }
.db-client-kpi-label { font-size: 10px; color: var(--db-text-muted); }

.db-client-history {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px;
  scrollbar-width: thin;
  scrollbar-color: var(--db-border) transparent;
}

.db-client-history-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--db-text-muted);
  margin-bottom: 10px;
}

.db-visit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--db-border);
}
.db-visit-row:last-child { border-bottom: none; }

.db-visit-date { width: 80px; font-size: 11px; color: var(--db-text-muted); flex-shrink: 0; }
.db-visit-service { flex: 1; font-size: 13px; color: var(--db-text); }
.db-visit-price { font-size: 13px; font-weight: 600; color: var(--db-text); flex-shrink: 0; }
.db-visit-estado { flex-shrink: 0; }

.db-inline-icon {
  width: 12px;
  height: 12px;
  object-fit: contain;
  vertical-align: -2px;
  margin-right: 4px;
}

.db-client-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--db-text-muted);
  font-size: 13px;
}
.db-client-empty i { width: 36px; height: 36px; opacity: 0.25; }

/* ══════════════════════════════════════════════════════════════
   ESTADÍSTICAS
   ══════════════════════════════════════════════════════════════ */
.db-stats-page {
  height: 100%;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--db-border) transparent;
  padding: var(--db-gap);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--db-gap);
  align-content: start;
}

.db-stats-panel {
  background: var(--db-surface);
  border: 1px solid var(--db-border);
  border-radius: var(--db-radius-lg);
  padding: 16px 18px;
}
.db-stats-panel--full { grid-column: 1 / -1; }

.db-stats-panel-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.db-stats-panel-title i { width: 14px; height: 14px; color: var(--db-blue); }

.db-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 130px;
}

.db-bar-chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}

.db-bar-chart-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height .6s ease;
}

.db-bar-chart-label { font-size: 10px; color: var(--db-text-muted); }
.db-bar-chart-val   { font-size: 10px; font-weight: 600; color: var(--db-text-muted); }

.db-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.db-table th {
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--db-text-muted);
  padding: 0 0 8px 0;
  border-bottom: 1px solid var(--db-border);
}
.db-table td {
  padding: 8px 0;
  border-bottom: 1px solid var(--db-border);
  color: var(--db-text);
}
.db-table tr:last-child td { border-bottom: none; }

/* ══════════════════════════════════════════════════════════════
   AJUSTES
   ══════════════════════════════════════════════════════════════ */
.db-settings-page {
  height: 100%;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--db-border) transparent;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 920px;
  margin: 0 auto;
  width: 100%;
}

.db-settings-section {
  background: var(--db-surface);
  border: 1px solid var(--db-border);
  border-radius: var(--db-radius-lg);
  overflow: hidden;
}

.db-settings-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--db-border);
  font-size: 15px;
  font-weight: 600;
}
.db-settings-section-header i { width: 16px; height: 16px; color: var(--db-blue); flex-shrink: 0; }

.db-settings-body {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.db-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.db-form-row--3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.db-form-field { display: flex; flex-direction: column; gap: 6px; }
.db-form-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--db-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.db-form-input, .db-form-select {
  padding: 9px 12px;
  border-radius: var(--db-radius-sm);
  border: 1px solid var(--db-border);
  background: var(--db-bg);
  font: inherit;
  font-size: 13px;
  color: var(--db-text);
  outline: none;
  transition: border-color .12s;
}
.db-form-input:focus, .db-form-select:focus { border-color: var(--db-blue); }

.db-save-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  border-radius: var(--db-radius-sm);
  background: var(--db-blue);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background .12s;
}
.db-save-btn:hover { background: #004fc4; }
.db-save-btn i { width: 14px; height: 14px; flex-shrink: 0; }

.db-service-catalog { display: flex; flex-direction: column; gap: 8px; }

.db-service-row {
  display: grid;
  grid-template-columns: 1fr 100px 110px 38px;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--db-bg);
  border: 1px solid var(--db-border);
  border-radius: var(--db-radius-sm);
}

.db-hours-grid {
  display: grid;
  grid-template-columns: 120px 1fr 1fr 60px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}
.db-hours-grid-hdr {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--db-text-muted);
  white-space: nowrap;
}

.db-toggle {
  -webkit-appearance: none;
  appearance: none;
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: var(--db-border);
  cursor: pointer;
  position: relative;
  transition: background .2s;
  flex-shrink: 0;
}
.db-toggle::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s;
}
.db-toggle:checked { background: var(--db-blue); }
.db-toggle:checked::after { transform: translateX(16px); }

/* ── Marketplace settings section ── */
.db-mp-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.db-mp-badge--on  { background: rgba(16,185,129,.15); color: #10b981; }
.db-mp-badge--off { background: rgba(107,114,128,.13); color: var(--db-text-muted); }

.db-mp-counter {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--db-bg);
  border: 1px solid var(--db-border);
  border-radius: var(--db-radius-sm);
}
.db-mp-counter-text { font-size: 13px; font-weight: 500; white-space: nowrap; }
.db-mp-progress {
  flex: 1;
  height: 6px;
  background: var(--db-border);
  border-radius: 3px;
  overflow: hidden;
}
.db-mp-progress-bar {
  height: 100%;
  background: var(--db-blue);
  border-radius: 3px;
  transition: width .35s ease;
}
.db-mp-progress-bar.full { background: #10b981; }

.db-mp-add-form {
  padding: 16px;
  background: var(--db-bg);
  border: 1px solid var(--db-border);
  border-radius: var(--db-radius-sm);
}
.db-mp-form-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--db-text-muted);
  margin-bottom: 14px;
}

.db-mp-product-list { display: flex; flex-direction: column; gap: 8px; }

.db-mp-product-item {
  display: grid;
  grid-template-columns: 36px 1fr 90px 110px 36px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--db-bg);
  border: 1px solid var(--db-border);
  border-radius: var(--db-radius-sm);
}
.db-mp-product-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg,#1e40af22,#3b82f622);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
}
.db-mp-product-name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.db-mp-product-desc { font-size: 11px; color: var(--db-text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-mp-product-cat {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(59,130,246,.12);
  color: var(--db-blue);
  text-transform: capitalize;
}
.db-mp-product-price { font-size: 14px; font-weight: 700; text-align: right; }

/* ══════════════════════════════════════════════════════════════
   RESERVAS PAGE (full)
   ══════════════════════════════════════════════════════════════ */
.db-reservas-page {
  height: 100%;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--db-border) transparent;
  background: var(--db-surface);
  border: 1px solid var(--db-border);
  border-radius: var(--db-radius-lg);
  display: flex;
  flex-direction: column;
}

.db-reservas-page-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--db-border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* ══════════════════════════════════════════════════════════════
   MODAL
   ══════════════════════════════════════════════════════════════ */
.db-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 600;
  align-items: center;
  justify-content: center;
}
.db-modal-backdrop.open { display: flex; }

.db-modal {
  background: var(--db-surface);
  border-radius: var(--db-radius-lg);
  width: 480px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.22);
}

.db-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  border-bottom: 1px solid var(--db-border);
  position: sticky;
  top: 0;
  background: var(--db-surface);
  z-index: 1;
}
.db-modal-header h3 { font-size: 15px; font-weight: 700; }

.db-modal-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.db-modal-footer {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--db-border);
}

.db-btn-secondary {
  flex: 1;
  padding: 9px;
  border-radius: var(--db-radius-sm);
  font-size: 13px;
  font-weight: 500;
  background: var(--db-bg);
  border: 1px solid var(--db-border);
  transition: background .12s;
}
.db-btn-secondary:hover { background: var(--db-border); }

.db-btn-primary {
  flex: 1;
  padding: 9px;
  border-radius: var(--db-radius-sm);
  font-size: 13px;
  font-weight: 500;
  background: var(--db-blue);
  color: #fff;
  transition: background .12s;
}
.db-btn-primary:hover { background: #004fc4; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1280px) {
  .db-layout {
    grid-template-columns: 320px 1fr;
  }
}

@media (max-width: 1024px) {
  .db-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    height: auto;
    overflow: visible;
    padding-bottom: 24px;
  }

  .db-panel--reservas {
    overflow-y: visible;
    max-height: 70vh;
    overflow-y: auto;
  }

  .db-right-stack {
    grid-template-rows: auto auto auto;
    grid-template-columns: 1fr 1fr;
    min-height: 0;
  }

  .db-panel--calendar {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .db-panel--messages {
    grid-column: 1;
    grid-row: 2;
    min-height: 300px;
  }

  .db-panel--stats {
    grid-column: 2;
    grid-row: 2;
    min-height: 300px;
  }
}

@media (max-width: 720px) {
  :root {
    --db-topbar-h: 56px;
    --db-topbar-offset: 8px;
    --db-main-offset: calc(var(--db-topbar-h) + var(--db-topbar-offset) + 14px);
    --db-header-band-h: 210px;
  }

  .db-topbar {
    border-radius: 14px;
    padding: 0 12px;
    gap: 12px;
  }

  .db-nav { display: none; }
  .db-brand-wordmark { display: none; }
  .db-topbar-divider { display: none; }
  .db-btn-new span { display: none; }
  .db-btn-new { padding: 7px 9px; }

  .db-layout {
    margin-top: var(--db-main-offset);
    padding: 8px;
    gap: 8px;
  }

  .db-subpage {
    margin-top: var(--db-main-offset);
    height: calc(100vh - var(--db-main-offset) - 8px);
  }

  .db-detail-panel {
    top: calc(var(--db-topbar-h) + var(--db-topbar-offset));
  }

  .db-ambient-glow--three {
    width: 260px;
    left: 50%;
  }

  .db-right-stack {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }

  .db-panel--messages {
    grid-column: 1;
    grid-row: 2;
  }

  .db-panel--stats {
    grid-column: 1;
    grid-row: 3;
  }

  .db-detail-panel { width: 100%; }
}
