/* ==========================================================
   Azulito — Components (buttons, nav, forms, generic)
   ========================================================== */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--r-full);
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease), box-shadow var(--dur) var(--ease), color var(--dur) var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn--sm { padding: 8px 14px; font-size: 14px; }
.btn--md { padding: 10px 18px; font-size: 15px; }
.btn--lg { padding: 14px 24px; font-size: 16px; }

.btn--primary {
  background: var(--olimar);
  color: white;
  box-shadow: var(--shadow-md);
}
.btn--primary:hover { background: var(--olimar-ink); box-shadow: var(--shadow-lg); }

.btn--ghost {
  background: var(--paper);
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn--ghost:hover { border-color: var(--olimar); color: var(--olimar); }

.btn--ghost-light {
  background: rgba(255,255,255,.14);
  color: white;
  border: 1.5px solid rgba(255,255,255,.3);
  backdrop-filter: blur(8px);
}
.btn--ghost-light:hover { background: rgba(255,255,255,.22); }

.btn--azul {
  background: var(--azulito);
  color: white;
  box-shadow: var(--shadow-water);
}
.btn--azul:hover { background: var(--azulito-deep); }

/* ---------- Icons ---------- */
.icon { flex-shrink: 0; stroke-linejoin: round; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.badge--azul   { background: color-mix(in oklab, var(--azulito) 15%, transparent); color: var(--olimar); }
.badge--coral  { background: color-mix(in oklab, var(--coral) 20%, transparent);   color: var(--coral-deep); }
.badge--sunny  { background: color-mix(in oklab, var(--sunny) 32%, transparent);   color: #8A6A00; }
.badge--leaf   { background: color-mix(in oklab, var(--leaf) 22%, transparent);    color: #2D6F42; }

html[data-theme="dark"] .badge--sunny { color: #E8C665; }
html[data-theme="dark"] .badge--leaf  { color: #9FD7B0; }
html[data-theme="dark"] .badge--coral { color: var(--coral); }
html[data-theme="dark"] .badge--azul  { color: var(--azulito); }

/* ---------- Avatar ---------- */
.avatar {
  border-radius: var(--r-full);
  color: white;
  font-weight: 700;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  background: var(--paper);
  color: var(--text);
  padding: 12px 18px;
  border-radius: var(--r-full);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  z-index: 1000;
  font-weight: 500;
  animation: toastIn .4s var(--ease-out);
}
.toast--success { color: #2D6F42; }
.toast--error { color: #B03A3A; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 20px); } }

/* ---------- Theme toggle ---------- */
.theme-toggle {
  width: 40px; height: 40px;
  border-radius: var(--r-full);
  border: 1.5px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  display: grid; place-items: center;
  transition: all var(--dur) var(--ease);
}
.theme-toggle:hover { border-color: var(--olimar); color: var(--olimar); }

/* ---------- Public nav ---------- */
.pnav {
  position: sticky; top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
.pnav__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.pnav__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
}
.pnav__wordmark { font-size: 24px; letter-spacing: -0.03em; color: var(--olimar); font-weight: 600; }
.pnav__links {
  display: flex;
  gap: 28px;
  align-items: center;
  flex: 1;
  justify-content: center;
}
.pnav__links a, .pnav__links button {
  font-size: 15px;
  color: var(--text-muted);
  font-weight: 500;
  transition: color var(--dur) var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pnav__links a:hover, .pnav__links button:hover { color: var(--olimar); }
.pnav__chat-link { color: var(--azulito-deep) !important; font-weight: 600 !important; }
.pnav__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pnav__burger {
  display: none;
  width: 40px; height: 40px;
  border-radius: var(--r-full);
  color: var(--text);
  border: 1.5px solid var(--border);
  align-items: center; justify-content: center;
}

@media (max-width: 900px) {
  .pnav__links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--bg-elev);
    flex-direction: column;
    padding: 24px;
    border-bottom: 1px solid var(--border);
    display: none;
  }
  .pnav__links.is-open { display: flex; }
  .pnav__burger { display: inline-flex; }
  .pnav__actions .btn { display: none; }
  .pnav__actions .btn:last-of-type { display: inline-flex; }
}

/* ---------- Forms / fields ---------- */
.field { display: block; margin-bottom: 16px; }
.field__label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.field__control {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--paper);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.field__control:focus-within {
  border-color: var(--azulito);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--azulito) 18%, transparent);
}
.field.is-error .field__control { border-color: var(--cherry); }
.field__icon {
  padding: 0 10px 0 14px;
  color: var(--text-subtle);
  display: inline-flex;
}
.field__control input {
  flex: 1;
  border: 0; background: transparent;
  padding: 12px 14px 12px 0;
  font-size: 16px;
  outline: none;
}
.field__pwd {
  padding: 0 14px;
  color: var(--text-subtle);
  display: inline-flex;
}
.field__pwd:hover { color: var(--olimar); }
.field__hint { display: block; margin-top: 6px; font-size: 13px; color: var(--text-subtle); }
.field__err { display: block; margin-top: 6px; font-size: 13px; color: var(--cherry); font-weight: 500; }
.field__select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: var(--paper);
  font-size: 16px;
  color: var(--text);
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235A7380' stroke-width='2'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  outline: none;
}
.field__select:focus { border-color: var(--azulito); box-shadow: 0 0 0 4px color-mix(in oklab, var(--azulito) 18%, transparent); }

.checkbox {
  display: inline-flex; align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
}
.checkbox input { width: 16px; height: 16px; accent-color: var(--olimar); }
.checkbox--lg { font-size: 15px; line-height: 1.45; align-items: flex-start; }
.checkbox--lg input { margin-top: 4px; }

/* ---------- Side nav private ---------- */
.priv-side {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 240px;
  background: var(--paper);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  z-index: 30;
}
.priv-side__brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px 18px;
  font-size: 22px;
  color: var(--olimar);
}
.priv-side__nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.priv-side__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 15px;
  transition: all var(--dur) var(--ease);
}
.priv-side__item:hover { background: var(--bg-elev-2); color: var(--text); }
.priv-side__item.is-active {
  background: color-mix(in oklab, var(--azulito) 14%, transparent);
  color: var(--olimar);
  font-weight: 600;
}
.priv-side__foot {
  border-top: 1px solid var(--border-soft);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.priv-side__user {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px;
}
.priv-side__user-name { font-size: 14px; font-weight: 600; }
.priv-side__user-sub  { font-size: 12px; color: var(--text-subtle); }
.priv-side__foot-actions { display: flex; gap: 8px; padding: 0 4px; }
.priv-side__logout {
  flex: 1;
  padding: 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-full);
  color: var(--text-muted);
  display: inline-flex; align-items: center; justify-content: center;
}
.priv-side__logout:hover { color: var(--cherry); border-color: var(--cherry); }

/* Private mobile bottom bar */
.priv-bbar {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--paper);
  border-top: 1px solid var(--border);
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  z-index: 30;
  justify-content: space-around;
}
.priv-bbar__item {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px;
  padding: 8px 12px;
  font-size: 11px;
  color: var(--text-subtle);
  font-weight: 500;
  min-width: 60px;
}
.priv-bbar__item.is-active { color: var(--olimar); }
.priv-bbar__item.is-active .icon { color: var(--azulito-deep); }

@media (max-width: 880px) {
  .priv-side { display: none; }
  .priv-bbar { display: flex; }
}

/* ---------- Admin side nav ---------- */
.admin-side {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 260px;
  background: var(--paper);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  z-index: 30;
}
.admin-side__brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 14px;
}
.admin-side__title { font-size: 19px; color: var(--olimar); letter-spacing: -0.02em; }
.admin-side__sub { font-size: 11px; color: var(--text-subtle); text-transform: uppercase; letter-spacing: 0.08em; }
.admin-side__nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.admin-side__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14.5px;
  position: relative;
  text-align: left;
  transition: all var(--dur) var(--ease);
}
.admin-side__item:hover:not(:disabled) { background: var(--bg-elev-2); color: var(--text); }
.admin-side__item.is-active {
  background: color-mix(in oklab, var(--azulito) 14%, transparent);
  color: var(--olimar);
  font-weight: 600;
}
.admin-side__item.is-disabled { opacity: .5; cursor: not-allowed; }
.admin-side__lock { margin-left: auto; }
.admin-side__foot {
  border-top: 1px solid var(--border-soft);
  padding-top: 14px;
}
.admin-side__user {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
  padding: 0 6px;
}
.admin-side__user-name { font-size: 13.5px; font-weight: 600; }
.admin-side__user-sub  { font-size: 11.5px; color: var(--text-subtle); }
.admin-side__foot-actions { display: flex; gap: 8px; padding: 0 4px; }
.admin-side__logout { flex: 1; padding: 8px; border: 1.5px solid var(--border); border-radius: var(--r-full); color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; }

/* ---------- Shared section ---------- */
.section { padding: var(--sp-24) 24px; }
.section--tinted { background: var(--bg-elev-2); }
.section--olimar {
  background: linear-gradient(160deg, var(--olimar) 0%, var(--olimar-ink) 100%);
  color: white;
}
.section__inner { max-width: 1200px; margin: 0 auto; }
.section__inner--narrow { max-width: 760px; }
.section__head { max-width: 720px; margin-bottom: 48px; }
.section__head--light { color: rgba(255,255,255,.95); }
.section__title { font-size: clamp(32px, 4vw, 52px); margin: 12px 0 16px; }
.section__lede { font-size: 18px; color: var(--text-muted); line-height: 1.55; }
.section--olimar .section__lede { color: rgba(255,255,255,.75); }
.eyebrow__dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: var(--r-full);
  background: var(--azulito);
  margin-right: 6px;
}
.eyebrow--light { color: rgba(255,255,255,.85); }

.grid-2 {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 60px;
  align-items: start;
}
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; gap: 40px; } }

.cards-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
@media (max-width: 980px) { .cards-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .cards-4 { grid-template-columns: 1fr; } }
