/* brand.css — sistema visual compartido de arnauserver.me (admin, blog, status, proyectos).
   Mismos tokens que el portfolio: Fraunces + Inter, acento dorado, modo claro/oscuro. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --serif: 'Fraunces', 'Playfair Display', Georgia, serif;
  --sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:  ui-monospace, SFMono-Regular, 'JetBrains Mono', Menlo, monospace;
  --nav-h: 64px;
  --r: 18px;
  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --pop:  cubic-bezier(0.34, 1.56, 0.64, 1);

  --bg: #ffffff; --bg-soft: #f5f5f7; --bg-inv: #0a0a0c; --surface: #ffffff;
  --border: #e6e6ea; --border-2: #d1d1d6;
  --text: #0a0a0c; --text-1: #1d1d1f; --text-2: #4b4b50; --text-3: #8e8e93; --text-4: #c7c7cc;
  --accent: #b8843d; --accent-2: #e8c690; --accent-soft: rgba(184, 132, 61, 0.10);
  --ok: #2f8f5b; --ok-soft: rgba(47, 143, 91, 0.12);
  --warn: #b7791f; --warn-soft: rgba(183, 121, 31, 0.12);
  --bad: #c0392b; --bad-soft: rgba(192, 57, 43, 0.12);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 8px 28px rgba(0,0,0,0.08);
  --shadow-lg: 0 32px 80px rgba(0,0,0,0.12), 0 4px 16px rgba(0,0,0,0.06);
  --nav-bg: rgba(255, 255, 255, 0.78);
  --grid-line: rgba(0, 0, 0, 0.045);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0a0c; --bg-soft: #131317; --bg-inv: #f5f5f7; --surface: #16161b;
    --border: #26262d; --border-2: #3a3a42;
    --text: #f5f5f7; --text-1: #f5f5f7; --text-2: #c1c1c8; --text-3: #8e8e93; --text-4: #4b4b50;
    --accent: #e8c690; --accent-2: #c8a165; --accent-soft: rgba(232, 198, 144, 0.10);
    --ok: #5ccf8f; --ok-soft: rgba(92, 207, 143, 0.12);
    --warn: #e8b45a; --warn-soft: rgba(232, 180, 90, 0.12);
    --bad: #ff7a6b; --bad-soft: rgba(255, 122, 107, 0.12);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.4); --shadow: 0 8px 28px rgba(0,0,0,0.45);
    --shadow-lg: 0 32px 80px rgba(0,0,0,0.55), 0 4px 16px rgba(0,0,0,0.35);
    --nav-bg: rgba(10, 10, 12, 0.72); --grid-line: rgba(255, 255, 255, 0.04);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0a0c; --bg-soft: #131317; --bg-inv: #f5f5f7; --surface: #16161b;
  --border: #26262d; --border-2: #3a3a42;
  --text: #f5f5f7; --text-1: #f5f5f7; --text-2: #c1c1c8; --text-3: #8e8e93; --text-4: #4b4b50;
  --accent: #e8c690; --accent-2: #c8a165; --accent-soft: rgba(232, 198, 144, 0.10);
  --ok: #5ccf8f; --ok-soft: rgba(92, 207, 143, 0.12);
  --warn: #e8b45a; --warn-soft: rgba(232, 180, 90, 0.12);
  --bad: #ff7a6b; --bad-soft: rgba(255, 122, 107, 0.12);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4); --shadow: 0 8px 28px rgba(0,0,0,0.45);
  --shadow-lg: 0 32px 80px rgba(0,0,0,0.55), 0 4px 16px rgba(0,0,0,0.35);
  --nav-bg: rgba(10, 10, 12, 0.72); --grid-line: rgba(255, 255, 255, 0.04);
  color-scheme: dark;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
body {
  font-family: var(--sans); background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  line-height: 1.55; overflow-x: hidden;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
::selection { background: var(--accent); color: var(--bg); }
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ── Nav ── */
.b-nav {
  position: sticky; top: 0; z-index: 100; height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 clamp(16px, 4vw, 40px);
  background: var(--nav-bg); backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.b-logo {
  font-family: var(--serif); font-size: 18px; font-weight: 500; letter-spacing: -0.02em;
  color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 10px;
  white-space: nowrap;
}
.b-logo::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 12px var(--accent);
}
.b-logo small { font-family: var(--sans); font-size: 12px; color: var(--text-3); font-weight: 500; letter-spacing: 0.02em; }
.b-links { display: flex; align-items: center; gap: 4px; list-style: none; }
.b-links a, .b-links button {
  font: 500 14px/1 var(--sans); color: var(--text-2); text-decoration: none; background: none; border: 0;
  padding: 9px 12px; border-radius: 980px; cursor: pointer; transition: color .2s, background .2s;
}
.b-links a:hover, .b-links button:hover { color: var(--text); background: var(--bg-soft); }
.b-links a[aria-current="page"], .b-links button[aria-current="page"] { color: var(--text); background: var(--accent-soft); }
.b-icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--border); background: transparent; color: var(--text-2); cursor: pointer; flex: none;
}
.b-icon-btn:hover { color: var(--text); border-color: var(--border-2); }

/* ── Layout ── */
.b-wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }
.b-page { padding: clamp(28px, 5vw, 56px) 0 80px; }
.b-eyebrow {
  font: 600 11.5px/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 14px; display: inline-flex; align-items: center; gap: 10px;
}
.b-eyebrow::before { content: ''; width: 22px; height: 1px; background: var(--accent); }
.b-h1 { font: 400 clamp(34px, 5vw, 54px)/1.05 var(--serif); letter-spacing: -0.03em; }
.b-h1 em { font-style: italic; color: var(--accent); }
.b-h2 { font: 400 clamp(24px, 3vw, 30px)/1.15 var(--serif); letter-spacing: -0.02em; }
.b-h3 { font: 600 15px/1.3 var(--sans); letter-spacing: -0.01em; }
.b-lead { font-size: clamp(16px, 1.6vw, 18px); color: var(--text-2); max-width: 62ch; margin-top: 14px; }
.b-muted { color: var(--text-3); }
.b-small { font-size: 13px; }
.b-mono { font-family: var(--mono); font-size: 12.5px; }

/* ── Grid & cards ── */
.b-grid { display: grid; gap: 16px; }
.b-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.b-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.b-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .b-grid-3, .b-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .b-grid-2, .b-grid-3, .b-grid-4 { grid-template-columns: minmax(0, 1fr); } }
.b-span-2 { grid-column: span 2; }
@media (max-width: 640px) { .b-span-2 { grid-column: auto; } }
.b-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 20px; min-width: 0; box-shadow: var(--shadow-sm);
}
.b-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.b-stat-label { font: 500 12px/1.2 var(--sans); color: var(--text-3); letter-spacing: 0.02em; }
.b-stat { font: 400 32px/1.1 var(--serif); letter-spacing: -0.02em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.b-stat small { font: 500 13px var(--sans); color: var(--text-3); margin-left: 4px; }
.b-sub { font-size: 12.5px; color: var(--text-3); margin-top: 6px; }

/* ── Buttons, inputs, chips ── */
.b-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 980px; border: 1px solid transparent;
  font: 500 14px/1 var(--sans); letter-spacing: -0.01em; cursor: pointer; text-decoration: none;
  transition: transform .2s var(--ease), box-shadow .2s, background .2s, border-color .2s, color .2s, opacity .2s;
}
.b-btn-primary { background: var(--text); color: var(--bg); }
.b-btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.b-btn-ghost { background: transparent; color: var(--text); border-color: var(--border-2); }
.b-btn-ghost:hover { border-color: var(--text-3); }
.b-btn-danger { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.b-btn-sm { padding: 7px 14px; font-size: 13px; }
.b-btn:disabled { opacity: .45; cursor: default; transform: none; box-shadow: none; }
.b-input, .b-select {
  width: 100%; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border-2);
  background: var(--bg); color: var(--text); font: 14px/1.4 var(--sans);
}
.b-input::placeholder { color: var(--text-3); }
.b-label { display: block; font: 500 12.5px var(--sans); color: var(--text-2); margin-bottom: 6px; }
.b-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font: 500 12px/1.3 var(--sans); background: var(--bg-soft); color: var(--text-2); white-space: nowrap;
}
.b-chip.ok { background: var(--ok-soft); color: var(--ok); }
.b-chip.warn { background: var(--warn-soft); color: var(--warn); }
.b-chip.bad { background: var(--bad-soft); color: var(--bad); }
.b-chip.accent { background: var(--accent-soft); color: var(--accent); }
.b-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-4); flex: none; display: inline-block; }
.b-dot.ok { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.b-dot.bad { background: var(--bad); box-shadow: 0 0 0 4px var(--bad-soft); }
.b-dot.warn { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }

/* ── Tables & lists ── */
.b-table-wrap { overflow-x: auto; }
.b-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.b-table th { text-align: left; font: 600 11.5px var(--sans); letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-3); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.b-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; color: var(--text-1); }
.b-table tr:last-child td { border-bottom: 0; }
.b-table td.num, .b-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.b-bars { display: grid; gap: 10px; }
.b-bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: 13px; }
.b-bar-row .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-1); }
.b-bar-row .val { color: var(--text-3); font-variant-numeric: tabular-nums; }
.b-bar-track { grid-column: 1 / -1; height: 6px; border-radius: 6px; background: var(--bg-soft); overflow: hidden; }
.b-bar-fill { height: 100%; border-radius: 6px; background: var(--accent); }
.b-pre {
  font: 12.5px/1.55 var(--mono); background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px; overflow: auto; white-space: pre-wrap; word-break: break-word; max-height: 560px;
}

/* ── Charts (SVG) ── */
.b-chart { width: 100%; height: auto; display: block; overflow: visible; }
.b-chart .grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 4; }
.b-chart .tick { fill: var(--text-3); font: 10.5px var(--sans); }
.b-chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.b-chart .area { fill: var(--accent-soft); }
.b-chart .bar { fill: var(--accent); }
.b-chart .bar-2 { fill: var(--text-4); }
.b-chart .ok { fill: var(--ok); }
.b-chart .down { fill: var(--bad); }
.b-chart .none { fill: var(--border); }
.b-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--text-3); margin-top: 10px; }
.b-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ── Footer ── */
.b-footer {
  border-top: 1px solid var(--border); padding: 28px clamp(16px, 4vw, 40px); color: var(--text-3);
  font-size: 13px; display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between;
}
.b-footer a { color: var(--text-2); text-decoration: none; }
.b-footer a:hover { color: var(--accent); }

/* ── Utilities ── */
.b-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.b-between { justify-content: space-between; }
.b-mt { margin-top: 16px; } .b-mt-lg { margin-top: 32px; }
.b-hide { display: none !important; }
.b-skel { background: linear-gradient(90deg, var(--bg-soft), var(--border), var(--bg-soft)); background-size: 200% 100%;
  animation: b-skel 1.4s infinite; border-radius: 8px; min-height: 14px; }
@keyframes b-skel { to { background-position: -200% 0; } }
.b-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: var(--bg-inv); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-size: 14px;
  box-shadow: var(--shadow-lg); transition: opacity .25s, transform .3s var(--ease); z-index: 300; max-width: calc(100vw - 32px);
}
.b-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
