:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #0f766e;
  --brand-strong: #115e59;
  --ok: #166534;
  --err: #991b1b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.m-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #042f2e;
  color: #fff;
  border-bottom: 1px solid #134e4a;
}
.m-nav__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.m-logo-link { color: #fff; font-weight: 700; }
.m-nav__menu { display: flex; gap: 0.9rem; }
.m-nav-link { color: #ccfbf1; }
.m-cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #fff;
  background: #115e59;
  border: 1px solid #0f766e;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
}
.m-cart-badge {
  min-width: 1.35rem;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  background: #14b8a6;
  text-align: center;
}

/* Ma Tribu: meme teinte de nav que la landing SC */
.m-nav--tribu {
  background: #faf6f0;
  color: #1a1a18;
  border-bottom: 1px solid #e8ddd0;
}
.m-nav--tribu .m-logo-link {
  color: #1a1a18;
}

.page,
.admin-main {
  max-width: 1120px;
  margin: 1.25rem auto;
  padding: 1rem;
}

.flash-messages {
  max-width: 1120px;
  margin: 0.8rem auto;
  padding: 0 1rem;
}
.flash-messages__item {
  padding: 0.65rem 0.8rem;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  background: #fff;
  border: 1px solid var(--line);
}
.flash-error { border-color: #fecaca; color: var(--err); }
.flash-success { border-color: #bbf7d0; color: var(--ok); }

.admin-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 62px);
}
.admin-sidebar {
  background: #042f2e;
  color: #fff;
  border-right: 1px solid #134e4a;
}
.admin-sidebar__inner { padding: 1rem; }
.admin-logo { color: #fff; font-weight: 700; display: inline-block; margin-bottom: 1rem; }
.admin-nav { display: grid; gap: 0.45rem; }
.admin-nav__link {
  color: #ccfbf1;
  background: #134e4a;
  border: 1px solid #0f766e;
  border-radius: 0.55rem;
  padding: 0.5rem 0.65rem;
}

section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 1rem;
  margin-bottom: 1rem;
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}
.kpi-card {
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-radius: 0.65rem;
  padding: 0.75rem;
}
.kpi-label {
  color: var(--muted);
  font-size: 0.84rem;
  margin: 0 0 0.25rem;
}
.kpi-value {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.75rem;
}
.btn-link {
  display: inline-block;
  border: 1px solid #5eead4;
  background: #ccfbf1;
  color: #134e4a;
  border-radius: 0.5rem;
  padding: 0.45rem 0.65rem;
}
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}
th, td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 0.55rem 0.5rem;
}
th { font-size: 0.9rem; color: var(--muted); }
td pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.82rem;
  line-height: 1.35;
}

input, textarea, select, button {
  font: inherit;
}
input, textarea, select {
  width: 100%;
  max-width: 420px;
  padding: 0.5rem 0.6rem;
  border: 1px solid #99f6e4;
  border-radius: 0.5rem;
}
button {
  border: 0;
  background: var(--brand);
  color: #fff;
  border-radius: 0.55rem;
  padding: 0.55rem 0.8rem;
  cursor: pointer;
}
button:hover { background: var(--brand-strong); }

.site-footer {
  margin-top: 2rem;
  background: #1a1a18;
  color: #f5f5f5;
  border-top: 4px solid var(--brand);
  padding: 28px 0 30px;
}
.site-footer .page { margin-top: 0; margin-bottom: 0; text-align: center; max-width: 1120px; }
.site-footer-title { margin: 0 0 8px; font-size: 1.1rem; font-weight: 800; }
.site-footer-title-link { color: #f5f5f5; text-decoration: underline; text-underline-offset: 4px; }
.site-footer-title-link:hover { color: #9bd7cc; }
.site-footer-brand-green { color: #1a6b5e; }
.site-footer-copy { margin: 0 0 14px; color: #c2c2bf; line-height: 1.45; }
.site-footer-social-title { margin: 0 0 8px; color: #d8d5cf; font-weight: 700; font-size: 0.92rem; }
.site-footer-socials { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.site-footer-social-link {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #f5f5f5;
  text-decoration: none;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.site-footer-social-link:hover { transform: translateY(-1px); background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.35); }
.site-footer-social-icon { width: 18px; height: 18px; display: inline-flex; }
.site-footer-social-icon svg { width: 18px; height: 18px; fill: currentColor; }
.site-footer-social-fallback { font-size: 12px; font-weight: 800; }
.site-footer-links { display: flex; justify-content: center; gap: 0.9rem; flex-wrap: wrap; margin-bottom: 10px; }
.site-footer-links a { color: #f5f5f5; font-weight: 700; font-size: 0.9rem; }
.site-footer-links a:hover { color: #9bd7cc; }
.site-footer-legal { margin: 0; color: #bdb9b2; font-size: 0.88rem; }

@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { border-right: 0; border-bottom: 1px solid #134e4a; }
}
