/*
 * brain-skin.css - PATRIMONIO surface, Brain look & feel (login + interior).
 * Source of truth for the look: pedromujica.com_brain (hub.css, gate.php) and its style handoff brief.
 * Palette: blue / red / black / gray only. No orange, no brown.
 * Cover URL comes from the --cover custom property set inline on <body> (carries the ?v= cache buster).
 */
:root {
  --accent: #4A8FE7;
  --accent-deep: #1f4fa8;
  --accent-soft: #bcd8ff;
  --red: #c0392b;
  --red-soft: #ffb4b4;
  --fg: #d6dbe3;
  --fg-cold: #eef2f8;
  --muted: rgba(214, 219, 227, 0.72);
  --line: rgba(255, 255, 255, .07);
  --line-soft: rgba(255, 255, 255, .11);
  --glow: rgba(74, 143, 231, 0.35);
  --panel: linear-gradient(160deg, rgba(10, 13, 20, 0.92), rgba(6, 8, 13, 0.9));
  --veil: .70;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html { overscroll-behavior-y: none; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  font-family: "Outfit", "Segoe UI", sans-serif;
  color: var(--fg);
  line-height: 1.55;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, var(--veil)), rgba(0, 0, 0, var(--veil))),
    var(--cover) center center / cover fixed no-repeat;
}
a { color: inherit; }

/* ---- Login ------------------------------------------------------------------------------------------------------ */
body.page-login {
  --veil: .30;
  --fg: #eef2f8;
  --muted: rgba(238, 242, 248, 0.72);
  font-family: "DM Sans", sans-serif;
  display: grid; place-items: center; padding: 1.5rem;
}
.login-wrap { width: min(440px, 100%); }
.login-card {
  background: linear-gradient(160deg, rgba(14, 18, 28, 0.94), rgba(8, 10, 16, 0.92));
  border: 1px solid var(--line); border-radius: 18px; padding: 1.75rem 1.5rem 1.4rem;
  box-shadow: 0 24px 60px rgba(0,0,0,0.45), 0 0 0 1px rgba(74, 143, 231, 0.12);
}
.logo-row { display: flex; align-items: center; justify-content: center; gap: 1.2rem; margin: 0 0 1.1rem; }
.logo-pm { display: block; height: 150px; width: auto; max-width: 200px; margin: 0; object-fit: contain; }
.logo-circle { display: block; width: 136px; height: 136px; object-fit: contain; }
.login-card h1 {
  font-family: "Outfit", "Segoe UI", sans-serif;
  font-size: clamp(1.15rem, 4.2vw, 1.45rem); font-weight: 800;
  text-align: center; margin: 0 0 .55rem; line-height: 1.35; letter-spacing: .18em; text-transform: uppercase;
}
.login-links { margin: 0; font-size: .82rem; font-weight: 600; text-align: center; }
.login-links a { color: var(--accent); text-underline-offset: 3px; }
.divider { height: 1px; background: var(--line); margin: 1.1rem 0 1rem; }
.login-title {
  font-size: .78rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 .75rem; text-align: center;
}
.login-card label { display: block; font-size: .82rem; color: var(--muted); margin: 0 0 .35rem; }
.login-row { display: flex; gap: .55rem; flex-wrap: wrap; align-items: stretch; }
.login-card input[type="password"] {
  flex: 1 1 180px; min-width: 0; margin: 0; padding: .85rem .95rem; border-radius: 10px;
  border: 1px solid rgba(255,255,255,.14); background: rgba(0,0,0,0.35);
  color: #fff; font: inherit;
}
.login-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(74, 143, 231, 0.25); }
.login-card button[type="submit"] {
  flex: 0 0 auto; margin: 0; padding: .85rem 1.15rem; border: none; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #111; font: inherit; font-weight: 700; cursor: pointer;
}
.login-card .error { color: var(--red-soft); font-size: .9rem; text-align: center; margin: 0 0 .85rem; min-height: 1.2em; }
.login-wrap .pm-foot { text-align: center; margin: 1rem auto; font-size: .82rem; opacity: .8; }
.login-wrap .pm-foot a { color: var(--accent); text-decoration: underline; }

/* ---- Interior: layout and header ---------------------------------------------------------------------------------- */
.wrap { width: min(80vw, calc(100% - 2.4rem)); margin: 0 auto; padding: 1.4rem 0 3rem; }
header {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 0.85rem 0 1.15rem; border-bottom: 1px solid var(--line); margin-bottom: 0.4rem;
}
.brand { display: flex; align-items: center; gap: 1rem; }
.brand-link { display: inline-flex; align-items: center; gap: .7rem; color: inherit; text-decoration: none; }
.brand-pm { height: 88px; width: auto; display: block; }
.brand-circle { width: 64px; height: 64px; object-fit: contain; display: block; }
.brand strong {
  display: block; font-family: "Outfit", "Segoe UI", sans-serif; font-weight: 800;
  font-size: 1.75rem; letter-spacing: .04em; line-height: 1.1; text-transform: uppercase;
}
.hub-header-actions { display: flex; align-items: center; gap: 0.85rem; }
.logout-form { margin: 0; }
.logout {
  border: 1px solid var(--line-soft); background: rgba(0,0,0,.5); color: #fff;
  border-radius: 999px; padding: .4rem .95rem; font-size: .78rem; cursor: pointer;
  font-family: inherit; font-weight: 600;
}
.logout:hover { border-color: var(--accent); }
@media (max-width: 560px) { .brand-pm { height: 72px; } }
@media (max-width: 520px) { .brand strong { font-size: 1.25rem; } }

/* ---- Menu: rounded pills, 1.5rem gap before the first card ------------------------------------------------------- */
.hub-nav { padding: .75rem 1rem; margin-bottom: 1.5rem; }
.hub-nav-links { display: flex; flex-wrap: wrap; gap: .4rem; }
.hub-nav-link {
  display: inline-flex; align-items: center;
  padding: .32rem .62rem; border-radius: 999px;
  border: 1px solid var(--line); font-size: .72rem; font-weight: 600;
  text-decoration: none; color: var(--muted);
}
.hub-nav-link:hover { border-color: var(--accent); color: var(--fg); }
.hub-nav-active { background: rgba(74,143,231,.06); border-color: rgba(74,143,231,.45); color: var(--fg); }

/* ---- Panels and cards ------------------------------------------------------------------------------------------- */
.panel {
  border: 1px solid var(--line); border-radius: 18px; padding: 1.25rem 1.35rem;
  background: var(--panel); backdrop-filter: blur(4px);
  box-shadow: 0 18px 40px rgba(0,0,0,.28); margin-bottom: 1rem;
  scroll-margin-top: 1.25rem;
}
.panel h2 {
  margin: 0 0 .35rem; font-size: 1.2rem; font-weight: 700;
  font-family: "Source Serif 4", Georgia, serif;
}
.panel > p { margin: 0 0 1rem; color: var(--muted); font-size: .92rem; }
.panel strong { color: var(--fg-cold); }
.lead { font-size: 1rem; color: var(--muted); margin: 0 0 .6rem; }
.meta { font-size: .82rem; color: var(--muted); margin: 0 0 .5rem; }
.stats { display: flex; flex-wrap: wrap; gap: .5rem; margin: .8rem 0 0; }
.stat {
  border: 1px solid var(--line); border-radius: 999px;
  padding: .3rem .8rem; font-size: .8rem; background: rgba(0,0,0,.4);
}
.stat strong { color: var(--accent); }
.badge {
  display: inline-block; font-size: .64rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; padding: .12rem .5rem; border-radius: 999px;
  border: 1px solid var(--line-soft); margin-bottom: .55rem; color: var(--muted);
}
.badge.ok { color: #9de6a8; border-color: rgba(120,220,140,.5); background: rgba(62,207,142,.1); }
.badge.open { color: var(--accent-soft); border-color: rgba(74,143,231,.55); background: rgba(74,143,231,.14); }
.badge.pause { color: var(--muted); border-color: var(--line-soft); background: rgba(255,255,255,.04); }
.item-list { margin: 0 0 1rem; padding-left: 1.15rem; }
.item-list li { color: var(--muted); font-size: .9rem; margin: .35rem 0; }
.item-list li::marker { color: var(--accent); }
.path {
  font-family: ui-monospace, Consolas, monospace; font-size: .78rem;
  color: rgba(238, 242, 248, .5); word-break: break-all; margin: .2rem 0;
}
.link-list, .file-list, .gasto-list { list-style: none; margin: 0; padding: 0; }
.link-list li, .file-list li, .gasto-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .6rem 0; border-top: 1px solid var(--line); flex-wrap: nowrap;
}
.link-list li:first-child, .file-list li:first-child, .gasto-list li:first-child { border-top: none; }
.file-meta { color: var(--muted); font-size: .82rem; }
.file-name { font-weight: 600; word-break: break-word; color: var(--fg); }
.group-label {
  margin: 1.1rem 0 .35rem; font-size: .72rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent); font-weight: 700;
}
.empty-note { color: var(--muted); margin: 0; }
.case h3 { margin: 1.1rem 0 .3rem; font-size: .98rem; font-weight: 700; color: var(--fg-cold); }
.case .meta a, .panel .meta a { color: var(--accent-soft); }
.case-table { width: 100%; border-collapse: collapse; font-size: .88rem; margin: .3rem 0 1rem; }
.case-table th, .case-table td { text-align: left; padding: .45rem .5rem; border-top: 1px solid var(--line); color: var(--muted); }
.case-table th { color: var(--fg); font-weight: 600; border-top: none; }
.case-table tr:first-child td { border-top: 1px solid var(--line-soft); }
.coming { border-style: dashed; }
.coming h2 { letter-spacing: .04em; }
.steps { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 720px) { .steps { grid-template-columns: 1fr; } }
.steps ul { margin: 0; padding-left: 1.15rem; }
.steps li { color: var(--muted); font-size: .9rem; margin: .35rem 0; }
.steps .done li::marker { color: #9de6a8; }
.steps .next li::marker { color: var(--accent); }

/* ---- Buttons: icon-only, round, 28px (meaning lives in the tooltip) ----------------------------------------------- */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 1.75rem; height: 1.75rem; padding: 0; border-radius: 999px;
  border: 1px solid var(--line-soft); background: rgba(0,0,0,.5); color: var(--muted);
  text-decoration: none; cursor: pointer; line-height: 1;
}
.icon-btn:hover { border-color: var(--accent); color: var(--fg); }
.icon-btn svg { display: block; flex-shrink: 0; }

/* ---- Footer ----------------------------------------------------------------------------------------------------- */
footer { margin-top: 1.4rem; color: var(--muted); font-size: .82rem; }
footer .pm-foot { text-align: center; margin: 1rem auto; font-size: .82rem; opacity: .8; }
footer .pm-foot a { color: var(--accent); text-decoration: underline; }

/* w80-cards: cards keep about their width on wide screens; the 80% container gains columns (2026-10-17). */
@media (min-width: 900px) {
  .steps { grid-template-columns: repeat(auto-fill, minmax(min(100%, 387px), 1fr)); }
}
