/* ============================================================
   GATD App Design System — premium dark + gold
   Shared by: cross-neuro-audit, networking-registro, networking-admin
   ============================================================ */

:root {
  --bg: #05070e;
  --bg-2: #090d18;
  --surface: rgba(255, 255, 255, 0.038);
  --surface-2: rgba(255, 255, 255, 0.06);
  --line: rgba(201, 162, 75, 0.18);
  --line-soft: rgba(255, 255, 255, 0.09);
  --text: #eef1f8;
  --muted: #98a0b4;
  --gold: #d8b765;
  --gold-deep: #b9933f;
  --grad-gold: linear-gradient(135deg, #f3e0a8 0%, #d8b765 45%, #b9933f 100%);
  --grad-gold-soft: linear-gradient(135deg, rgba(243, 224, 168, 0.16), rgba(185, 147, 63, 0.1));
  --ok: #46d39a;
  --warn: #f3c04a;
  --err: #f0706a;
  --radius: 20px;
  --radius-sm: 13px;
  --shadow: 0 24px 70px -24px rgba(0, 0, 0, 0.75);
  --shadow-gold: 0 14px 36px -12px rgba(201, 162, 75, 0.45);
  --font-head: "Sora", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  min-height: 100vh;
  padding: 34px 18px 70px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(900px 480px at 78% -8%, rgba(201, 162, 75, 0.14), transparent 60%),
    radial-gradient(1000px 520px at 10% 4%, rgba(56, 80, 140, 0.16), transparent 58%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 60%);
  background-attachment: fixed;
}

.wrap { max-width: 600px; margin: 0 auto; }
.wrap.wrap--wide { max-width: 1140px; }

/* ---- Brand header ---- */
.app-head {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 22px;
}
.app-head img {
  width: 46px; height: 46px;
  border-radius: 13px;
  object-fit: cover;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-gold);
}
.app-head .brand-name { font-family: var(--font-head); font-weight: 800; font-size: 16px; letter-spacing: -0.01em; line-height: 1.1; }
.app-head .brand-sub { color: var(--muted); font-size: 12px; letter-spacing: 0.02em; }

/* ---- Eyebrow badge ---- */
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--line);
  background: var(--grad-gold-soft);
  padding: 7px 14px; border-radius: 999px;
  backdrop-filter: blur(6px);
}

h1 {
  font-family: var(--font-head);
  font-size: clamp(23px, 5vw, 30px);
  font-weight: 800; letter-spacing: -0.02em; line-height: 1.12;
  margin: 18px 0 6px;
}
.sub { color: var(--muted); font-size: 14.5px; line-height: 1.6; margin: 0 0 24px; max-width: 60ch; }

/* ---- Glass card ---- */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 18px;
  backdrop-filter: blur(16px) saturate(120%);
  box-shadow: var(--shadow);
  animation: riseIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.card::before {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 1px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, transparent, rgba(216, 183, 101, 0.55), transparent);
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Form fields ---- */
label {
  display: block;
  font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); margin: 16px 0 7px;
}
input, select, textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 13px 15px; font-size: 16px; font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
input::placeholder, textarea::placeholder { color: #5e6678; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 0 3px rgba(216, 183, 101, 0.16);
}
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus,
textarea:-webkit-autofill, select:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px rgba(8, 10, 18, 0.98) inset;
  caret-color: var(--text);
  transition: background-color 9999s ease-in-out 0s;
}
select { appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: calc(100% - 20px) center, calc(100% - 14px) center;
  background-size: 6px 6px, 6px 6px; background-repeat: no-repeat;
  padding-right: 38px;
}
textarea { min-height: 120px; resize: vertical; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 7px; }
.row { display: flex; gap: 13px; }
.row > div { flex: 1; }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }
.consent { display: flex; align-items: flex-start; gap: 11px; margin-top: 18px; }
.consent input { width: auto; margin-top: 3px; accent-color: var(--gold); }
.consent label { margin: 0; color: var(--text); font-size: 13px; text-transform: none; letter-spacing: 0; font-weight: 400; }

/* ---- Buttons ---- */
button {
  width: 100%; margin-top: 22px; padding: 15px;
  background: var(--grad-gold); color: #1c1402;
  border: none; border-radius: var(--radius-sm);
  font-family: var(--font-head); font-size: 15.5px; font-weight: 700; letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: var(--shadow-gold);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
button:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.05); box-shadow: 0 18px 44px -12px rgba(201, 162, 75, 0.6); }
button:active:not(:disabled) { transform: translateY(0); }
button:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
button.ghost {
  background: transparent; color: var(--gold);
  border: 1px solid var(--line); box-shadow: none;
}
button.ghost:hover:not(:disabled) { background: var(--grad-gold-soft); transform: none; }
/* Inline buttons inside the admin toolbar should size to content */
.toolbar button { width: auto; margin-top: 0; padding: 12px 18px; }

/* ---- Status line ---- */
.status { margin-top: 15px; font-size: 14px; min-height: 20px; line-height: 1.5; }
.status[data-tone="error"] { color: var(--err); }
.status[data-tone="success"] { color: var(--ok); }
.status[data-tone="neutral"] { color: var(--muted); }

.hidden { display: none !important; }
.foot { color: var(--muted); font-size: 12px; text-align: center; margin-top: 26px; line-height: 1.6; opacity: 0.8; }

/* ---- Diagnosis (cross-neuro) ---- */
.diag h2 { font-family: var(--font-head); font-size: 17px; margin: 0 0 14px; color: var(--gold); }
.diag p { font-size: 14.5px; line-height: 1.6; margin: 0 0 12px; }
.diag .k { color: var(--muted); display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 3px; }
.diag ul { margin: 6px 0 0; padding-left: 18px; }
.diag li { font-size: 14.5px; line-height: 1.6; margin-bottom: 7px; }
.sev { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: 0.02em; }
.sev-baja { background: rgba(70, 211, 154, 0.16); color: var(--ok); }
.sev-media { background: rgba(243, 192, 74, 0.16); color: var(--warn); }
.sev-alta, .sev-critica { background: rgba(240, 112, 106, 0.16); color: var(--err); }

/* ---- Success panel (registro) ---- */
.done h2 { font-family: var(--font-head); color: var(--gold); font-size: 19px; margin: 0 0 10px; }
.done p { font-size: 14.5px; line-height: 1.6; color: var(--text); }

/* ---- Admin toolbar / stats / table ---- */
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.toolbar > div { flex: 1; min-width: 160px; }
.toolbar > div:last-child { flex: 0 0 auto; display: flex; gap: 10px; }
.stats { display: flex; gap: 12px; flex-wrap: wrap; margin: 6px 0 18px; }
.stat {
  background: var(--surface-2); border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm); padding: 12px 18px; min-width: 92px;
}
.stat b { font-family: var(--font-head); color: var(--gold); font-size: 22px; display: block; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 12px; }
.group-h { margin: 24px 0 10px; font-family: var(--font-head); font-size: 15px; color: var(--gold); display: flex; gap: 9px; align-items: center; }
.group-h .pill { background: var(--grad-gold-soft); color: var(--gold); font-size: 12px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
tbody tr { transition: background 0.15s ease; }
tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
.estado { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.e-espera_pasiva { background: rgba(243, 192, 74, 0.16); color: var(--warn); }
.e-activa { background: rgba(70, 211, 154, 0.16); color: var(--ok); }
.e-suspendida { background: rgba(240, 112, 106, 0.16); color: var(--err); }
.muted { color: var(--muted); }
.wrap-scroll { overflow-x: auto; }

@media (max-width: 560px) {
  body { padding: 22px 14px 54px; }
  .card { padding: 19px; }
  .row { flex-direction: column; gap: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .card { animation: none; }
  button { transition: none; }
}
