/* ── base.css — estilos globales del layout Django ── */

/* Puente de diseño: hereda tokens de style.css */
body {
  font-family: var(--font, 'Inter', system-ui, sans-serif);
  background: var(--bg, #f8f9fb);
  color: var(--text, #0f172a);
}
h1, h2, h3, h4 { color: var(--heading, #0f172a); font-family: var(--font, inherit); }
a { transition: color .15s; }

/* Clases de página Django */
.dj-page { max-width: 1200px; margin: 0 auto; padding: 2rem 24px; }
.dj-page-title { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; color: var(--heading, #0f172a); margin-bottom: .25rem; }
.dj-page-sub { color: #64748b; font-size: .9rem; margin-bottom: 2rem; }

/* ── Messages ── */
.dj-msgs {
  position: fixed; top: 56px; right: 16px;
  z-index: 1300; list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.dj-msg {
  padding: 10px 18px; border-radius: 8px; font-size: .875rem;
  box-shadow: 0 2px 10px rgba(0,0,0,.12); pointer-events: all;
  animation: djfade .25s ease;
}
.dj-msg.success { background: #d1fae5; color: #065f46; border-left: 4px solid #22c55e; }
.dj-msg.error   { background: #fee2e2; color: #991b1b; border-left: 4px solid #ef4444; }
.dj-msg.warning { background: #fef3c7; color: #92400e; border-left: 4px solid #f59e0b; }
.dj-msg.info    { background: #e0f2fe; color: #075985; border-left: 4px solid #0ea5e9; }
@keyframes djfade { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

/* ── Floating Nav Sidebar (NSB) ── */
.nsb-btn {
  position: fixed; bottom: 24px; right: 24px; z-index: 1300;
  width: 52px; height: 52px;
  background: var(--primary, #2b7a78); color: #fff;
  border: none; border-radius: 50%; font-size: 1.4rem; cursor: pointer;
  box-shadow: 0 4px 18px rgba(0,0,0,.25);
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s, box-shadow .2s;
}
.nsb-btn:hover { transform: scale(1.08); box-shadow: 0 6px 24px rgba(0,0,0,.3); }
.nsb-btn.open  { background: #1e293b; }

.nsb-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.35); z-index: 1299; backdrop-filter: blur(2px);
}
.nsb-overlay.open { display: block; }

.nsb-panel {
  position: fixed; top: 0; right: -340px; bottom: 0; width: 320px;
  background: #fff; z-index: 1300;
  box-shadow: -4px 0 32px rgba(0,0,0,.18);
  transition: right .28s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column; overflow: hidden;
}
.nsb-panel.open { right: 0; }

.nsb-head {
  background: linear-gradient(135deg, #14213d 0%, #0a9396 100%);
  color: #fff;
  padding: 18px 20px;
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.nsb-head-brand { display: flex; align-items: center; gap: 10px; }
.nsb-head-logo  { font-size: 1.6rem; }
.nsb-head-brand strong { display: block; font-size: .9rem; font-weight: 800; }
.nsb-head-brand span  { display: block; font-size: .68rem; opacity: .72; letter-spacing: .06em; margin-top: 1px; }
.nsb-close { background: rgba(255,255,255,.15); border: none; color: #fff; width: 30px; height: 30px; border-radius: 6px; font-size: 1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s; }
.nsb-close:hover { background: rgba(255,255,255,.28); }

.nsb-body { flex: 1; overflow-y: auto; padding: 14px 0; }
.nsb-section { padding: 2px 0 8px; }
.nsb-section-title { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: #94a3b8; padding: 8px 20px 4px; }

.nsb-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px; color: #334155; text-decoration: none;
  font-size: .88rem; font-weight: 500;
  transition: background .12s, color .12s, border-color .12s;
  border-left: 3px solid transparent;
}
.nsb-link:hover {
  background: #f0fdfc; color: #0a9396;
  border-left-color: #0a9396;
}
.nsb-link span { flex: 1; }
/* button que actúa como link (logout POST) */
.nsb-link--btn {
  width: 100%; background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: inherit;
}
.nsb-ico { width: 18px; height: 18px; flex-shrink: 0; stroke: #94a3b8; transition: stroke .12s; }
.nsb-link:hover .nsb-ico { stroke: #0a9396; }
.nsb-head-logo { stroke: rgba(255,255,255,.9); }
.nsb-divider { height: 1px; background: #f1f5f9; margin: 6px 0; }

/* WhatsApp CTA en sidebar */
.nsb-wa-cta {
  display: flex; align-items: center; gap: 12px;
  margin: 4px 16px 8px;
  background: #25D366; color: #fff;
  padding: 12px 16px; border-radius: 10px;
  font-size: .88rem; font-weight: 700; text-decoration: none;
  transition: background .15s;
}
.nsb-wa-cta:hover { background: #1ebe5c; }

/* User pill */
.nsb-user-pill {
  margin: 4px 16px 8px;
  background: #f0f9ff; border: 1px solid #bae6fd;
  border-radius: 8px; padding: 10px 14px;
  font-size: .85rem; font-weight: 700; color: #0369a1;
}

.nsb-foot {
  padding: 14px 20px; border-top: 1px solid #f1f5f9;
  display: flex; flex-direction: column; gap: 3px;
  font-size: .74rem; color: #94a3b8;
}
