:root {
  color-scheme: dark;
  /* Un solo sistema, sacado del logo: fondo de tinta, blanco, grises de ciudad y el verde de GTA World. */
  --bg: #0a0a0a;
  --surface: #161616;
  --raised: #2a2a2a;
  --fill: rgba(255, 255, 255, .07);
  --fill-strong: rgba(255, 255, 255, .14);
  --line: rgba(255, 255, 255, .09);
  --text: #f2f2f2;
  --text-2: #a3a3a3;
  --text-3: #767676;
  --accent: #4caf50;
  --accent-hover: #5cbf60;
  --accent-text: #6fcf73;
  --on-accent: #0a0a0a;
  --green: #6fcf73;
  --gray: #8a8a8a;
  --red: #ff5c5c;
  --nav: rgba(10, 10, 10, .78);
  --shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 8px 24px rgba(0, 0, 0, .5);
  --shadow-lift: 0 0 0 1px rgba(255, 255, 255, .12), 0 24px 48px rgba(0, 0, 0, .7);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --r: 18px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--fill-strong) transparent; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.47 var(--font);
  letter-spacing: -.022em;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; border-radius: 8px; }
a { color: var(--accent-text); text-decoration: none; text-underline-offset: .2em; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Navegación global ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  height: 52px;
  display: flex; align-items: center; gap: 28px;
  padding: 0 max(22px, calc((100vw - 1180px) / 2));
  background: var(--nav);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
  font-size: 13px; letter-spacing: -.01em;
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; font-size: 15px; }
.brand:hover { text-decoration: none; }
.brand img { height: 40px; width: auto; }
.nav-links { display: flex; gap: 24px; }
.nav-links a { color: var(--text-2); }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--text); font-weight: 500; }
.nav-end { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.ghost {
  border: 0; background: none; color: var(--text-2);
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
}
.ghost:hover { color: var(--text); background: var(--fill); }
.me { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 4px 4px 4px 10px; border-radius: 999px; }
.me:hover { background: var(--fill); }
.me-text { display: grid; text-align: right; line-height: 1.2; }
.me-name { font-weight: 500; color: var(--text); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--fill-strong); object-fit: cover; }
.rank { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 12px; }
.rank::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--rank, var(--gray)); }
.menu {
  position: absolute; top: 48px; right: max(22px, calc((100vw - 1180px) / 2));
  min-width: 220px; padding: 6px;
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lift);
  font-size: 14px;
}
.menu p { margin: 0; padding: 10px 12px 8px; color: var(--text-2); font-size: 12px; }
.menu button { width: 100%; text-align: left; padding: 8px 12px; border: 0; border-radius: 8px; background: none; }
.menu button:hover { background: var(--fill); }

/* ---------- Página ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 0 22px 120px; }
.hero { padding: 72px 0 36px; }
.hero h1 {
  margin: 0; max-width: 22ch;
  font-size: clamp(40px, 6vw, 64px); line-height: 1.05; letter-spacing: -.035em; font-weight: 600;
  text-wrap: balance;
}
.hero h1 span { color: var(--text-3); }
.hero-sub { margin: 18px 0 0; color: var(--text-2); font-size: 19px; }

.toolbar {
  position: sticky; top: 52px; z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 14px 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.segmented { display: inline-flex; padding: 2px; border-radius: 10px; background: var(--fill); }
.segmented button {
  border: 0; background: none; padding: 6px 18px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: var(--text-2);
  transition: background .25s var(--ease), color .25s var(--ease), box-shadow .25s var(--ease);
}
.segmented [aria-pressed="true"] { background: var(--raised); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
.search {
  flex: 1 1 260px; max-width: 380px;
  display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px; border-radius: 10px;
  background: var(--fill); color: var(--text-3);
}
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 15px; color: var(--text); }
.search input::placeholder { color: var(--text-3); }
.search:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 40%, transparent); }
.toolbar .btn { margin-left: auto; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 0 28px; }
.chip {
  border: 1px solid var(--line); background: var(--surface);
  padding: 6px 14px; border-radius: 999px;
  font-size: 13px; color: var(--text);
  transition: background .2s, color .2s, border-color .2s;
}
.chip:hover { border-color: var(--text-3); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip-sep { width: 1px; align-self: stretch; margin: 4px 4px; background: var(--line); }
.count { color: var(--text-2); font-size: 14px; margin: 0 0 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 18px; border-radius: 999px;
  border: 0; background: var(--accent); color: var(--on-accent);
  font-size: 15px; font-weight: 600; white-space: nowrap;
  transition: background .2s, transform .2s var(--ease);
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.secondary { background: var(--fill); color: var(--text); box-shadow: none; font-weight: 500; }
.btn.secondary:hover { background: var(--fill-strong); }
.btn.danger { background: none; color: var(--red); box-shadow: none; font-weight: 500; }
.btn.danger:hover { background: color-mix(in srgb, var(--red) 12%, transparent); }
.btn.danger.armed { background: var(--red); color: var(--on-accent); }
.btn.large { min-height: 48px; padding: 0 28px; font-size: 17px; }

/* ---------- Galería ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.tile {
  display: flex; flex-direction: column; text-align: left;
  padding: 0; border: 0; border-radius: var(--r); overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
  animation: rise .6s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 30ms);
}
.tile:hover { transform: translateY(-4px) scale(1.01); box-shadow: var(--shadow-lift); }
.tile:active { transform: scale(.99); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.tile-img { position: relative; aspect-ratio: 16 / 10; background: var(--fill); overflow: hidden; }
.tile-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.tile:hover .tile-img img { transform: scale(1.04); }
.tile-img .placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); }
.tile-img .placeholder .icon { width: 40px; height: 40px; stroke-width: 1.2; }
.tile-body { padding: 16px 18px 20px; display: grid; gap: 4px; }
.tile-meta { font-size: 12px; color: var(--text-2); display: flex; gap: 6px; flex-wrap: wrap; }
.tile-name { font-size: 19px; font-weight: 600; letter-spacing: -.02em; line-height: 1.25; }
.tile-owner { font-size: 14px; color: var(--text-2); }
.status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; letter-spacing: 0;
  color: var(--s);
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status[data-s="activo"] { --s: var(--green); }
.status[data-s="libre"] { --s: var(--text); }
.status[data-s="inactivo"] { --s: var(--gray); }
.tile-img .status {
  position: absolute; top: 12px; left: 12px;
  padding: 4px 10px 4px 8px; border-radius: 999px;
  background: rgba(0, 0, 0, .55); color: #fff;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.tile-img .status::before { background: var(--s); box-shadow: 0 0 0 2px rgba(255, 255, 255, .15); }
.tile-img .status[data-s="activo"] { --s: #4caf50; }
.tile-img .status[data-s="libre"] { --s: #ffffff; }
.tile-img .status[data-s="inactivo"] { --s: #98989d; }

.empty { padding: 96px 0; text-align: center; }
.empty h2 { margin: 0; font-size: 28px; font-weight: 600; letter-spacing: -.03em; }
.empty p { margin: 8px auto 24px; color: var(--text-2); max-width: 44ch; }

/* ---------- Ficha (sheet) ---------- */
dialog.sheet {
  margin: 0 0 0 auto; padding: 0; border: 0;
  width: min(560px, 100vw); height: 100dvh; max-height: none; max-width: none;
  background: var(--bg); color: var(--text);
  box-shadow: -1px 0 0 var(--line), -24px 0 64px rgba(0, 0, 0, .6);
  overflow: auto; overscroll-behavior: contain;
}
dialog.sheet[open] { animation: sheet-in .5s var(--ease); }
dialog.sheet::backdrop { background: rgba(0, 0, 0, .6); animation: fade .4s var(--ease); }
@keyframes sheet-in { from { transform: translateX(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.sheet-bar {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 56px; padding: 0 16px 0 24px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.sheet-bar h2 { margin: 0; font-size: 15px; font-weight: 600; opacity: var(--bar-title, 0); transition: opacity .2s; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-cover { margin: 0 24px; aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; background: var(--fill); position: relative; }
.sheet-cover.bare { aspect-ratio: 3 / 1; }
.sheet-cover img { width: 100%; height: 100%; object-fit: cover; }
.sheet-head { padding: 24px 24px 8px; }
.sheet-head h1 { margin: 6px 0 0; font-size: 34px; line-height: 1.1; letter-spacing: -.03em; font-weight: 600; text-wrap: balance; }
.sheet-head p { margin: 6px 0 0; color: var(--text-2); font-size: 15px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 24px 8px; }
.section { padding: 0 24px; margin-top: 28px; }
.section h3 { margin: 0 0 8px 16px; font-size: 13px; font-weight: 400; color: var(--text-2); text-transform: uppercase; letter-spacing: .02em; }
.group { background: var(--surface); border-radius: 12px; overflow: hidden; }
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 46px; padding: 10px 16px; font-size: 15px;
}
.row + .row { box-shadow: inset 0 1px 0 var(--line); margin-left: 16px; padding-left: 0; }
.row dt, .row > label { color: var(--text); flex: none; }
.row dd { margin: 0; color: var(--text-2); text-align: right; min-width: 0; overflow-wrap: anywhere; }
.row input, .row select, .row textarea {
  flex: 1; min-width: 0; border: 0; background: none; outline: none;
  text-align: right; color: var(--text-2); font-size: 15px; padding: 4px 0;
}
.row input:focus, .row select:focus, .row textarea:focus { color: var(--text); }
.row input::placeholder, .row textarea::placeholder { color: var(--text-3); opacity: .7; }
.row select {
  appearance: none; cursor: pointer; text-align-last: right; padding-right: 18px;
  background: no-repeat right center / 10px url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 10 16%27 fill=%27none%27 stroke=%27%2386868b%27 stroke-width=%271.6%27 stroke-linecap=%27round%27%3E%3Cpath d=%27M2 6l3-3 3 3M2 10l3 3 3-3%27/%3E%3C/svg%3E");
}
.row input, .row textarea { caret-color: var(--accent); }
.row.stack { display: grid; gap: 6px; }
.row.stack textarea { text-align: left; resize: vertical; min-height: 80px; line-height: 1.45; }
.row.stack dd { text-align: left; white-space: pre-wrap; }
.dropzone { display: flex; gap: 12px; align-items: center; justify-content: flex-end; }
.dropzone label { color: var(--accent-text); cursor: pointer; font-size: 15px; }
.form-error { margin: 16px 24px 0; padding: 12px 16px; border-radius: 12px; background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); font-size: 14px; }
.form-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 24px; position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); }

/* ---------- Historial ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.day { margin: 40px 0 12px; font-size: 21px; font-weight: 600; letter-spacing: -.02em; }
.day:first-child { margin-top: 0; }
.event { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; padding: 14px 18px; }
.event + .event { box-shadow: inset 0 1px 0 var(--line); }
.event-what { font-size: 15px; }
.event-what strong { font-weight: 600; }
.event-time { color: var(--text-2); font-size: 13px; }
.event-diff { grid-column: 1 / -1; display: grid; gap: 2px; font-size: 13px; color: var(--text-2); }
.event-diff del { color: var(--text-3); }
.event-diff ins { text-decoration: none; color: var(--text); }
.event .rank { font-size: 12px; margin-left: 6px; }
.sheet .event { padding: 12px 16px; }

/* ---------- Rangos ---------- */
.perm-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.perm-table th { font-size: 12px; font-weight: 500; color: var(--text-2); padding: 14px 8px; text-align: center; white-space: nowrap; }
.perm-table th:first-child, .perm-table td:first-child { text-align: left; padding-left: 18px; }
.perm-table td { padding: 10px 8px; text-align: center; border-top: 1px solid var(--line); }
.perm-table tr.boss td { color: var(--text-2); }
.role-name { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; }
.role-name i { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--gray)); flex: none; }
.scroll-x { overflow-x: auto; }
.switch {
  appearance: none; margin: 0; cursor: pointer;
  width: 40px; height: 24px; border-radius: 999px;
  background: var(--fill-strong); position: relative;
  transition: background .25s var(--ease);
  vertical-align: middle;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .2);
  transition: transform .3s var(--ease);
}
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(16px); }
.switch:disabled { opacity: .5; cursor: default; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.option-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px; }
.option-list .chip { display: inline-flex; align-items: center; gap: 4px; padding-right: 6px; }
.option-list .chip button { border: 0; background: none; color: var(--text-3); width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; padding: 0; }
.option-list .chip button:hover { background: var(--fill); color: var(--red); }
.option-add { display: flex; gap: 8px; padding: 0 16px 16px; }
.option-add input { flex: 1; min-width: 0; height: 36px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--fill); outline: none; }
.h2 { margin: 64px 0 6px; font-size: 28px; font-weight: 600; letter-spacing: -.03em; }
.h2 + p { margin: 0 0 20px; color: var(--text-2); max-width: 65ch; }


/* ---------- Tickets ---------- */
.ticket-row {
  width: 100%; display: flex; align-items: center; gap: 16px;
  padding: 14px 18px; border: 0; background: none; text-align: left;
  transition: background .2s;
}
.ticket-row + .ticket-row { box-shadow: inset 0 1px 0 var(--line); }
.ticket-row:hover { background: var(--fill); }
.ticket-id { width: 52px; flex: none; color: var(--text-2); font-size: 15px; }
.ticket-main { flex: 1; min-width: 0; display: grid; }
.ticket-main strong { font-weight: 600; font-size: 15px; }
.ticket-main span { color: var(--text-2); font-size: 13px; }
.ticket-side { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; color: var(--text-2); font-size: 13px; }
.pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; background: var(--fill); color: var(--text); font-size: 12px; font-weight: 500; white-space: nowrap; }
.pill.accent { background: var(--accent); color: var(--on-accent); font-weight: 600; }

.thread { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.bubble { max-width: 85%; display: grid; gap: 4px; }
.bubble p { margin: 0; padding: 12px 16px; border-radius: 18px; background: var(--surface); font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.theirs p { border-bottom-left-radius: 6px; }
.bubble.mine { justify-self: end; text-align: right; }
.bubble.mine p { background: color-mix(in srgb, var(--accent) 26%, var(--surface)); border-bottom-right-radius: 6px; text-align: left; }
.bubble.internal p { background: none; border: 1.5px dashed var(--fill-strong); color: var(--text-2); }
.bubble-who { font-size: 12px; font-weight: 600; color: var(--text-2); padding: 0 6px; }
.bubble-meta { font-size: 12px; color: var(--text-2); padding: 0 6px; }
.dm { color: var(--green); }
.dm.fail { color: var(--red); }
.reply {
  position: sticky; bottom: 0; margin-top: 24px; padding: 12px 24px 20px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.reply textarea {
  width: 100%; resize: vertical; min-height: 72px; padding: 12px 14px;
  border: 0; border-radius: 14px; background: var(--surface); outline: none; font-size: 15px; line-height: 1.45;
  caret-color: var(--accent-text);
}
.reply textarea:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); }
.reply-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.internal-toggle { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); cursor: pointer; }

/* ---------- Página pública ---------- */
.cat-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.cat {
  display: flex; align-items: center; gap: 16px; text-align: left;
  padding: 22px 22px 22px 24px; border: 0; border-radius: var(--r);
  background: var(--surface); box-shadow: var(--shadow);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
  animation: rise .6s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms);
}
.cat:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.cat:hover .icon { color: var(--text); transform: translateX(3px); }
.cat .icon { color: var(--text-3); transition: transform .4s var(--ease), color .2s; }
.cat-text { flex: 1; display: grid; gap: 4px; }
.cat-text strong { font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.cat-text span { color: var(--text-2); font-size: 15px; }
.callout { padding: 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.callout p { margin: 0; color: var(--text-2); max-width: 52ch; }
.btn.discord { background: #5865f2; color: #fff; box-shadow: none; }
.btn.discord:hover { background: #4752c4; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.steps li { counter-increment: s; color: var(--text-2); font-size: 15px; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 32px; height: 32px; margin-bottom: 14px; border-radius: 50%; background: var(--text); color: var(--surface); font-weight: 600; font-size: 14px; }
.steps strong { display: block; color: var(--text); font-size: 17px; margin-bottom: 4px; }
.foot { max-width: 1180px; margin: 0 auto; padding: 32px 22px 48px; display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); color: var(--text-2); font-size: 13px; }
#who { gap: 12px; }

/* ---------- Cuentas ---------- */
.muted { color: var(--text-2); font-weight: 400; font-size: 13px; }
.inline-add { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.inline-add input, .inline-add select, .pw-inline {
  height: 36px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line); outline: none; font-size: 15px; min-width: 0;
}
.inline-add input:not([type=color]) { flex: 1 1 160px; }
.inline-add input[type=color] { width: 44px; padding: 4px; cursor: pointer; }
.inline-add input:focus, .pw-inline:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); }
.user-row { flex-wrap: wrap; }
.user-ctrls { display: flex; align-items: center; gap: 12px; }
.cat-row input { text-align: left !important; color: var(--text) !important; }
.cat-row input[data-f=name] { flex: 0 1 240px; font-weight: 600; }
.cat-row input[data-f=description] { color: var(--text-2) !important; }
.row .btn + .btn { margin-left: auto; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 32px; z-index: 50;
  transform: translate(-50%, 20px); opacity: 0;
  padding: 12px 20px; border-radius: 999px;
  background: var(--text); color: var(--bg); font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lift);
  transition: transform .5s var(--ease), opacity .3s;
  pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.error { background: var(--red); color: var(--on-accent); }

/* ---------- Login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 32px 22px; text-align: center; }
.login-card { width: min(400px, 100%); }
.login-logo { width: 220px; height: auto; margin: 0 auto 28px; }
.login h1 { margin: 0; font-size: clamp(40px, 8vw, 56px); line-height: 1.05; letter-spacing: -.035em; font-weight: 600; }
.login h1 span { display: block; color: var(--text-3); }
.login p { color: var(--text-2); margin: 14px auto 32px; max-width: 36ch; }
.login form { text-align: left; display: grid; gap: 20px; }
.login .row label { width: 96px; }
.login .row input { text-align: left; color: var(--text); }
.login .btn { width: 100%; }
.login small { display: block; margin-top: 24px; color: var(--text-2); font-size: 12px; max-width: 40ch; margin-inline: auto; }
.login .form-error { margin: 0 0 24px; }

/* ---------- Móvil ---------- */
@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav { gap: 16px; padding: 0 16px; }
  .nav-links { gap: 16px; }
  .brand span:last-child, .me-text { display: none; }
  main { padding: 0 16px 96px; }
  .hero { padding: 40px 0 24px; }
  .hero-sub { font-size: 17px; }
  .toolbar { gap: 10px; }
  .search { order: 3; max-width: none; flex-basis: 100%; }
  .grid { grid-template-columns: 1fr; gap: 16px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 4px 16px 24px; scrollbar-width: none; }
  .chip { flex: none; }
  .hero h1 { font-size: 36px; }
  .sheet-head h1 { font-size: 28px; }
  .section, .actions, .sheet-head { padding-inline: 16px; }
  .sheet-cover { margin: 0 16px; }
  .menu { right: 16px; }
  .ticket-row { flex-wrap: wrap; }
  .ticket-side { width: 100%; justify-content: flex-start; padding-left: 68px; }
  .cat-list { grid-template-columns: 1fr; }
  .reply { padding-inline: 16px; }
  .me-name { display: none; }
  .foot { padding-inline: 16px; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Tipos por categoría ---------- */
.settings-grid .wide { grid-column: 1 / -1; }
.wide .option-add input[name=code] { flex: 0 0 90px; }
.wide .row { justify-content: space-between; }
.nav-staff { display: inline-flex; align-items: center; gap: 16px; padding-left: 20px; border-left: 1px solid var(--line); }
.nav-staff a { color: var(--text-2); }
.nav-out { color: var(--text-2) !important; }
@media (max-width: 720px) { .nav-staff .pill, .nav-out { display: none; } }
.filter-select { max-width: 300px; }
@media (max-width: 720px) { .filter-select { order: 4; max-width: none; flex: 1 1 100%; } }

/* ---------- Ticket a pantalla completa ---------- */
dialog.sheet.full { width: 100vw; box-shadow: none; }
dialog.sheet.full[open] { animation: full-in .5s var(--ease); }
@keyframes full-in { from { opacity: 0; transform: translateY(16px) scale(.99); } }
.sheet.full .sheet-bar { padding-inline: max(16px, calc((100vw - 1080px) / 2)); border-bottom: 1px solid var(--line); }
.sheet.full .wrap { max-width: 1080px; margin: 0 auto; padding-bottom: 40px; }
.sheet.full .sheet-head h1 { font-size: clamp(28px, 4vw, 44px); }
.ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 8px 32px; align-items: start; }
.ticket-side-panel { position: sticky; top: 72px; padding-top: 24px; }
.ticket-side-panel .actions, .ticket-side-panel .section { padding-inline: 0; }
.ticket-side-panel .actions { padding-top: 0; }
.ticket-side-panel .section:first-of-type { margin-top: 16px; }
.ticket-chat .reply { border-radius: 0 0 var(--r) var(--r); }
@media (max-width: 900px) {
  .ticket-layout { grid-template-columns: 1fr; }
  .ticket-side-panel { position: static; order: -1; padding: 0 16px; }
}

/* Entradas animadas: mensajes y campos del formulario */
.bubble { animation: bubble-in .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 35ms); }
@keyframes bubble-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.stagger > * { animation: rise .5s var(--ease) both; }
.stagger > :nth-child(2) { animation-delay: 60ms; }
.stagger > :nth-child(3) { animation-delay: 120ms; }
.stagger > :nth-child(4) { animation-delay: 180ms; }
.req { color: var(--accent-text); }
.row.invalid { background: color-mix(in srgb, var(--red) 10%, transparent); }
.row.invalid label { color: var(--red); }
.rules dd { color: var(--text-2); }

/* Confirmación con check dibujado */
.done { min-height: 70vh; display: grid; place-content: center; justify-items: center; text-align: center; gap: 12px; padding: 40px 16px; }
.done h1 { margin: 12px 0 0; font-size: clamp(32px, 5vw, 48px); letter-spacing: -.03em; }
.done p { margin: 0 0 16px; color: var(--text-2); max-width: 46ch; }
.done-check { width: 88px; height: 88px; fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.done-check circle { stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw .7s var(--ease) forwards; }
.done-check path { stroke-dasharray: 36; stroke-dashoffset: 36; animation: draw .45s .55s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.done > :not(svg) { animation: rise .6s .4s var(--ease) both; }

/* ---------- Fotos ---------- */
.picker { display: grid; gap: 10px; }
.picker-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pick-btn { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: var(--fill); color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer; transition: background .2s; }
.pick-btn:hover { background: var(--fill-strong); }
.pick-btn:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); }
.pick-hint { font-size: 13px; color: var(--text-2); }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumbs:empty { display: none; }
.thumb { position: relative; width: 84px; height: 84px; border-radius: 12px; overflow: hidden; background: var(--fill); animation: pop .35s var(--ease); }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: opacity .3s, filter .3s; }
.thumb.uploading img { opacity: .45; filter: blur(1px); }
.thumb.uploading::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .18) 50%, transparent 70%); background-size: 200% 100%; animation: shimmer 1.1s linear infinite; }
.thumb.leaving { animation: pop .2s reverse forwards; }
.thumb-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .7); color: #fff; font-size: 14px; line-height: 1; display: grid; place-items: center; padding: 0; }
@keyframes pop { from { opacity: 0; transform: scale(.85); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
form.dropping, .att-add.dropping { outline: 2px dashed var(--accent); outline-offset: 4px; border-radius: 14px; }
.reply .picker { margin-top: 10px; }
.gallery { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.bubble.mine .gallery { justify-content: flex-end; }
.shot { padding: 0; border: 0; border-radius: 12px; overflow: hidden; width: 140px; height: 104px; background: var(--fill); cursor: zoom-in; transition: transform .3s var(--ease); }
.shot:hover { transform: scale(1.03); }
.shot img { width: 100%; height: 100%; object-fit: cover; }
dialog.lightbox { margin: auto; padding: 0; border: 0; background: none; max-width: 94vw; max-height: 94vh; display: grid; gap: 12px; justify-items: center; overflow: visible; }
dialog.lightbox:not([open]) { display: none; }
dialog.lightbox[open] { animation: pop .3s var(--ease); }
dialog.lightbox::backdrop { background: rgba(0, 0, 0, .88); }
dialog.lightbox img { max-width: 94vw; max-height: 84vh; border-radius: 12px; cursor: zoom-out; }

/* ---------- Notas internas, enlaces y fotos del negocio ---------- */
.att-list { list-style: none; margin: 0; padding: 0; }
.att { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; animation: rise .4s var(--ease) both; }
.att + .att { box-shadow: inset 0 1px 0 var(--line); }
.att-kind { flex: none; width: 58px; font-size: 12px; font-weight: 600; color: var(--accent-text); padding-top: 2px; }
.att-body { flex: 1; min-width: 0; display: grid; gap: 4px; font-size: 15px; }
.att-body p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.att-body a { overflow-wrap: anywhere; }
.att-meta { font-size: 12px; color: var(--text-2); }
.att-empty { padding: 14px 16px; color: var(--text-2); font-size: 14px; }
.att-add { display: grid; gap: 10px; padding: 14px 16px 16px; border-top: 1px solid var(--line); }
.att-fields { display: grid; gap: 8px; }
.att-fields[hidden] { display: none; }
.att-fields textarea, .att-fields input:not([type=file]) {
  width: 100%; border: 0; border-radius: 10px; background: var(--fill); padding: 9px 12px; outline: none; font-size: 15px; resize: vertical;
}
.att-fields textarea:focus, .att-fields input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); }
.att-foot { display: flex; justify-content: flex-end; }
.segmented.small button { padding: 4px 14px; font-size: 13px; }
.segmented.small { justify-self: start; }

/* ---------- Buscador global ---------- */
.kbd-search { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px 0 10px; border: 0; border-radius: 8px; background: var(--fill); color: var(--text-2); font-size: 13px; }
.kbd-search:hover { background: var(--fill-strong); color: var(--text); }
kbd { font: 500 11px/1 var(--font); padding: 3px 6px; border-radius: 5px; background: var(--fill-strong); color: var(--text-2); }
dialog.palette { margin: 12vh auto auto; padding: 0; border: 0; width: min(640px, calc(100vw - 32px)); background: var(--surface); color: var(--text); border-radius: 18px; box-shadow: var(--shadow-lift); overflow: hidden; }
dialog.palette[open] { animation: palette-in .3s var(--ease); }
@keyframes palette-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
dialog.palette::backdrop { background: rgba(0, 0, 0, .55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.search.big { max-width: none; height: 56px; margin: 0; border-radius: 0; background: none; padding: 0 18px; border-bottom: 1px solid var(--line); }
.search.big input { font-size: 18px; }
.search.big:focus-within { box-shadow: none; }
.palette-list { list-style: none; margin: 0; padding: 6px; max-height: 52vh; overflow: auto; }
.palette-list [role=option] { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.palette-list [role=option] > span:first-child { display: grid; min-width: 0; }
.palette-list [role=option] strong { font-weight: 600; font-size: 15px; }
.palette-list [role=option] span span { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-list [aria-selected=true] { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.palette-h { padding: 10px 12px 4px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.palette-empty { padding: 28px 12px; text-align: center; color: var(--text-2); }
.palette-foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-2); }

/* ---------- Editor de categorías ---------- */
.cat-inputs { flex: 1; display: grid; grid-template-columns: 220px 1fr; gap: 4px 12px; }
.cat-inputs .cat-fields { grid-column: 1 / -1; font-size: 13px !important; color: var(--accent-text) !important; }
@media (max-width: 720px) {
  .kbd-search span, .kbd-search kbd { display: none; }
  .cat-inputs { grid-template-columns: 1fr; }
  .shot { width: 110px; height: 82px; }
}

/* Encabezados del panel de administración: formales y compactos */
.hero.admin { padding: 48px 0 24px; }
.hero.admin h1 { font-size: clamp(30px, 4vw, 40px); line-height: 1.1; max-width: none; }
.hero.admin .hero-sub { margin-top: 8px; font-size: 16px; max-width: 70ch; }

/* ---------- Desplegables: todos con el tema oscuro y la misma flecha ---------- */
select { color-scheme: dark; }
select option { background-color: #1c1c1c; color: #f2f2f2; padding: 6px 10px; }
select option:checked { background-color: #2e4a2f; color: #ffffff; }
select optgroup { background-color: #121212; color: #a3a3a3; font-style: normal; font-weight: 600; }
select:disabled { opacity: .5; cursor: default; }
.filter-select, .inline-add select, .user-ctrls select {
  appearance: none; -webkit-appearance: none;
  height: 36px; padding: 0 34px 0 12px; border: 0; border-radius: 10px;
  background: var(--fill) no-repeat right 12px center / 10px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 16' fill='none' stroke='%23a3a3a3' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M2 6l3-3 3 3M2 10l3 3 3-3'/%3E%3C/svg%3E");
  color: var(--text); font-size: 14px; cursor: pointer; transition: background-color .2s;
}
.filter-select:hover, .inline-add select:hover, .user-ctrls select:hover { background-color: var(--fill-strong); }
.filter-select:focus-visible, .inline-add select:focus-visible, .user-ctrls select:focus-visible {
  outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent);
}
.inline-add select { box-shadow: inset 0 0 0 1px var(--line); background-color: var(--surface); }
.user-ctrls select { height: 32px; border-radius: 8px; }
.row select:focus-visible { outline: none; color: var(--text); }
.no-dm .dm-only { display: none; }

/* ---------- Ancho completo: todo usa la pantalla entera ---------- */
:root { --gutter: clamp(16px, 3vw, 56px); }
main { max-width: none; padding: 0 var(--gutter) 120px; }
.nav { padding: 0 var(--gutter); }
.menu { right: var(--gutter); }
.foot { max-width: none; padding: 32px var(--gutter) 48px; }
.sheet.full .sheet-bar { padding-inline: var(--gutter); }
.sheet.full .wrap { max-width: 1600px; padding-inline: var(--gutter); }
.ticket-layout { grid-template-columns: minmax(0, 1fr) clamp(320px, 26vw, 420px); }
.grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.cat-list { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
dialog.sheet:not(.full) { width: min(640px, 100vw); }

/* ---------- Pequeños comunes ---------- */
.pill.blue { background: color-mix(in srgb, #5aa9ff 22%, transparent); color: #a9d0ff; }
.pill.tiny { padding: 1px 7px; font-size: 11px; margin-left: 6px; vertical-align: middle; }
.pill.area-pm { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent-text); }
.pill.area-rpqm { background: color-mix(in srgb, #4f8fd6 24%, transparent); color: #9cc6f5; }
.pill.area-mapping { background: color-mix(in srgb, #2fc6d6 22%, transparent); color: #8de6ef; }
.pill.area-event { background: color-mix(in srgb, #c98ae8 24%, transparent); color: #e1bdf3; }
.btn.small { min-height: 30px; padding: 0 12px; font-size: 13px; }
.link { border: 0; background: none; padding: 0; color: var(--accent-text); text-align: left; font-size: inherit; }
.link:hover { text-decoration: underline; }
.nowrap { white-space: nowrap; }
.small { font-size: 13px; }
.group.pad { padding: 14px 16px; display: grid; gap: 10px; }
.chips.tight { padding: 0; gap: 6px; }
.chip.mini { padding: 3px 9px; font-size: 12px; }
.chip:disabled { opacity: .5; cursor: default; }
.actions.tight { padding: 0; gap: 6px; }
.toolbar .count { margin: 0 0 0 auto; }
.load-more { display: flex; justify-content: center; padding: 20px 0; }
.or { display: flex; align-items: center; gap: 12px; margin: 22px 0; color: var(--text-2); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.login .btn.discord { width: 100%; }
.row.hint { min-height: 0; padding-top: 0; }

/* ---------- Registro de actividad ---------- */
.table-wrap { overflow-x: auto; }
.log-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.log-table th { position: sticky; top: 0; text-align: left; font-size: 12px; font-weight: 500; color: var(--text-2); padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.log-table td { padding: 12px 16px; vertical-align: top; border-top: 1px solid var(--line); }
.log-table tbody tr:hover { background: var(--fill); }
.log-table td:nth-child(1) { width: 120px; }
.log-table td:nth-child(2) { width: 200px; }
.log-table td:nth-child(3) { width: 170px; }
.log-detail { display: grid; gap: 2px; font-size: 13px; color: var(--text-2); }
.log-detail del { color: var(--text-3); }
.log-detail ins { text-decoration: none; color: var(--text); }

/* ---------- Rendimiento ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 28px; }
.kpi { background: var(--surface); border-radius: var(--r); padding: 18px 20px; display: grid; gap: 4px; box-shadow: var(--shadow); }
.kpi span { font-size: 13px; color: var(--text-2); }
.kpi strong { font-size: 34px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; }
.kpi em { font-style: normal; font-size: 13px; color: var(--text-2); }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.person { background: var(--surface); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow); animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms); }
.person header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.person header > div { flex: 1; min-width: 0; }
.person h3 { margin: 0; font-size: 17px; font-weight: 600; }
.person-rank { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); font-size: 13px; font-weight: 600; flex: none; }
.person:nth-child(1) .person-rank { background: var(--accent); color: var(--on-accent); }
.person dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.person dl div { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--fill); font-size: 13px; }
.person dl div.zero { opacity: .45; }
.person dt { color: var(--text-2); }
.person dd { margin: 0; font-weight: 600; }

/* ---------- Guías ---------- */
.guides { display: grid; grid-template-columns: clamp(260px, 22vw, 340px) minmax(0, 1fr); gap: 24px; align-items: start; }
.guide-nav { position: sticky; top: 72px; display: grid; gap: 12px; max-height: calc(100dvh - 96px); overflow: auto; padding-right: 4px; }
.guide-nav .search { max-width: none; }
.guide-nav .chips { padding: 0; }
.guide-nav h3 { margin: 14px 0 4px; font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .03em; }
.guide-link { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; font-size: 14px; color: var(--text); }
.guide-link:hover { background: var(--fill); }
.guide-link[aria-current=true] { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--text); font-weight: 600; }
.guide-read { padding: clamp(20px, 3vw, 40px); min-height: 60vh; }
.guide-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.guide-head h2 { margin: 10px 0 4px; font-size: clamp(26px, 3vw, 36px); letter-spacing: -.03em; font-weight: 600; }
.guide-head p { margin: 0; }
.prose { max-width: 80ch; font-size: 16px; line-height: 1.6; }
.prose h2, .prose h3, .prose h4 { margin: 1.6em 0 .5em; letter-spacing: -.02em; line-height: 1.25; }
.prose h2 { font-size: 24px; } .prose h3 { font-size: 19px; } .prose h4 { font-size: 16px; }
.prose p { margin: .5em 0; }
.prose ul, .prose ol { margin: .5em 0; padding-left: 1.4em; }
.prose li { margin: .25em 0; }
.prose ul.quoted, .prose blockquote { border-radius: 10px; background: var(--fill); }
.prose blockquote { margin: .6em 0; padding: 10px 14px; }
.prose ul.quoted { padding: 10px 14px 10px 2em; }
.prose code { font: 13px/1.4 ui-monospace, "Cascadia Mono", Consolas, monospace; background: var(--fill-strong); padding: 2px 6px; border-radius: 6px; }
.prose pre { background: #050505; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; overflow: auto; }
.prose pre code { background: none; padding: 0; white-space: pre-wrap; }
.prose a { overflow-wrap: anywhere; }
.guide-images { margin-top: 24px; }
.guide-images .gallery { gap: 12px; }
.guide-images .shot { width: auto; height: auto; max-width: min(100%, 720px); aspect-ratio: auto; }
.guide-images .shot img { height: auto; max-height: 520px; object-fit: contain; background: #050505; }
.guide-edit textarea { min-height: 360px; font: 14px/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace; }
.thumbs.keep:empty { display: none; }

/* ---------- Tickets por área ---------- */
.ticket-area { flex: none; width: 74px; }
.ticket-main strong { font-size: 15px; }
.shared { font-size: 12px; color: #8de6ef; }
.area-line { margin: 0; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.linked { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.linked > div:first-child { display: grid; }
.link-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.link-results button { width: 100%; display: grid; text-align: left; border: 0; background: var(--fill); border-radius: 10px; padding: 8px 12px; }
.link-results button:hover { background: var(--fill-strong); }
.close-box .group { margin-top: 12px; }
.close-box textarea { width: 100%; border: 0; border-radius: 10px; background: var(--fill); padding: 9px 12px; outline: none; resize: vertical; font-size: 14px; }
h3 .req { font-size: 11px; text-transform: none; letter-spacing: 0; margin-left: 6px; }

/* ---------- Rangos ---------- */
.perm-table th { white-space: normal; min-width: 64px; line-height: 1.2; }
.perm-table td:first-child { white-space: nowrap; }
.area-toggles { display: flex; gap: 4px; justify-content: center; }
.user-id { display: flex; align-items: center; gap: 10px; }
.cat-inputs { grid-template-columns: minmax(180px, 260px) 1fr 200px auto; align-items: center; }
.cat-inputs select { border: 0; background: var(--fill); border-radius: 8px; padding: 6px 10px; color: var(--text); }

@media (max-width: 900px) {
  .guides { grid-template-columns: 1fr; }
  .guide-nav { position: static; max-height: none; }
  .cat-inputs { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .ticket-area { width: auto; }
  .log-table td:nth-child(5), .log-table th:nth-child(5) { display: none; }
  .person dl { grid-template-columns: 1fr; }
}

/* ---------- Avatares con punto de conectado ---------- */
.ava { position: relative; display: inline-block; width: 32px; height: 32px; flex: none; }
.ava img, .ava-empty { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; background: var(--fill-strong); }
.ava.lg { width: 72px; height: 72px; }
.ava.xl { width: 96px; height: 96px; }
.ava .dot {
  position: absolute; right: -1px; bottom: -1px; width: 32%; height: 32%; min-width: 10px; min-height: 10px;
  border-radius: 50%; background: #3fd06a; box-shadow: 0 0 0 2.5px var(--surface);
}
button.me .ava { width: 28px; height: 28px; }

/* ---------- Perfil ---------- */
.profile { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.profile .group h3 { margin: 0; font-size: 15px; font-weight: 600; }
.profile-card { grid-column: 1 / -1; display: flex !important; align-items: center; gap: 20px; }
.profile-card h2 { margin: 0; font-size: 28px; font-weight: 600; letter-spacing: -.03em; }
.profile-card p { margin: 4px 0 0; }
.profile-head { display: flex; align-items: center; gap: 18px; }
.profile-head h1 { margin: 0; }
.photo-choices { display: flex; gap: 24px; }
.photo-choices figure { margin: 0; display: grid; justify-items: center; gap: 6px; }
.linked-acc { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.linked-acc + .linked-acc { border-top: 1px solid var(--line); }
.linked-acc > div { display: grid; gap: 2px; }
.profile .row, .sheet .group.pad .row { padding-inline: 0; margin-left: 0; }
.profile .row + .row { margin-left: 0; }
.gtaw-btn { width: 100%; margin-top: 10px; }

/* ---------- Equipo ---------- */
.team { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; align-items: start; }
.team-rank { padding: 16px 18px; animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms); }
.team-rank header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.team-rank .on { color: #3fd06a; font-weight: 600; }
.team-rank ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.team-rank li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; background: var(--fill); font-size: 14px; min-width: 0; }
.team-rank li span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-rank li.no-web { opacity: .55; }
.team-rank li .ava { width: 28px; height: 28px; }
.team-rank li .dot { box-shadow: 0 0 0 2px var(--fill); }

/* Staff conectado (página pública) */
.online-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.online-list li { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); animation: pop .4s var(--ease) both; }
.online-list li > span:last-child { display: grid; line-height: 1.2; }
.online-list strong { font-size: 14px; font-weight: 600; }
.online-list .ava { width: 36px; height: 36px; }

/* ---------- Rangos por nivel ---------- */
#roles.group { padding: 4px 0; }
.rank-row { display: grid; grid-template-columns: minmax(220px, 1.2fr) 220px auto minmax(180px, 1fr) 32px; align-items: center; gap: 10px 16px; padding: 12px 18px; }
.rank-row + .rank-row { border-top: 1px solid var(--line); }
.rank-row.boss { opacity: .85; }
.rank-name { display: flex; align-items: center; gap: 4px; min-width: 0; }
.rank-row .filter-select { max-width: none; width: 100%; }
.rank-row .area-toggles { justify-content: flex-start; }
.rank-adv { grid-column: 1 / -1; }
.rank-adv summary { cursor: pointer; font-size: 13px; color: var(--text-2); width: max-content; }
.rank-adv summary:hover { color: var(--text); }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 16px; padding: 12px 0 4px; }
@media (max-width: 1000px) { .rank-row { grid-template-columns: 1fr auto; } .rank-row .level-desc { grid-column: 1 / -1; } }

/* ---------- Staff conectado: botón en la barra y lista en orden ---------- */
.who { display: flex; align-items: center; gap: 12px; }
.online-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px 0 10px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text);
  font-size: 13px; font-weight: 500; transition: border-color .2s, background .2s;
}
.online-btn:hover { border-color: var(--fill-strong); background: var(--raised); }
.online-btn .live { width: 8px; height: 8px; border-radius: 50%; background: #3fd06a; box-shadow: 0 0 0 3px rgba(63, 208, 106, .18); }
.online-btn.none { color: var(--text-2); }
.online-btn.none .live { background: var(--gray); box-shadow: none; }

dialog.staff-pop {
  position: fixed; inset: 60px var(--gutter) auto auto; margin: 0; padding: 0; z-index: 30;
  width: min(380px, calc(100vw - 32px)); max-height: min(70vh, 560px); overflow: auto;
  border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-lift);
}
dialog.staff-pop[open] { animation: palette-in .3s var(--ease); }
.staff-pop header { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 10px 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
.staff-pop h2 { margin: 0; font-size: 15px; font-weight: 600; }
.staff-pop ol { list-style: none; margin: 0; padding: 6px; counter-reset: s; }
.staff-pop li {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 12px; animation: rise .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 35ms);
}
.staff-pop li + li { box-shadow: inset 0 1px 0 var(--line); }
.staff-pop li:hover { background: var(--fill); }
.staff-pop .ava { width: 36px; height: 36px; }
.staff-pop .who-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.staff-pop .rank { font-size: 12px; white-space: nowrap; }
.staff-pop .empty-pop { display: block; padding: 18px 12px; color: var(--text-2); font-size: 14px; animation: none; }
.staff-pop > p { margin: 0; padding: 4px 18px 14px; }
@media (max-width: 720px) { .online-btn span { display: none; } .online-btn { padding: 0 10px; } }

/* Links del PCU que salen de GTA World */
.pcu-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pcu-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: 10px; background: var(--fill); font-size: 13px; }
.pcu-list a, .pcu-link a { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.pcu-link { font-size: 14px; text-align: right; }
.cat-inputs { grid-template-columns: minmax(180px, 260px) 1fr 200px auto 240px; }

/* ---------- Ficha del negocio: ventana centrada ---------- */
dialog.sheet:not(.full) {
  margin: auto; width: min(880px, calc(100vw - 32px)); height: auto; max-height: min(92dvh, 1040px);
  border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 40px 100px rgba(0, 0, 0, .75);
}
dialog.sheet:not(.full)[open] { animation: pop-in .35s var(--ease); }
@keyframes pop-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }
dialog.sheet::backdrop { backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.sheet:not(.full) .sheet-bar { border-radius: 22px 22px 0 0; }
.sheet:not(.full) #sheet-form { display: grid; grid-template-columns: 1fr 1fr; padding-bottom: 8px; }
.sheet:not(.full) #sheet-form > * { grid-column: 1 / -1; }
.sheet:not(.full) #sheet-form > .section.half { grid-column: auto; }
.sheet:not(.full) #sheet-form > .section.half + .section.half { padding-left: 0; }
.sheet:not(.full) .sheet-cover { aspect-ratio: 21 / 9; }
@media (max-width: 760px) {
  dialog.sheet:not(.full) { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; }
  .sheet:not(.full) #sheet-form { display: block; }
  .sheet:not(.full) #sheet-form > .section.half + .section.half { padding-left: 16px; }
}

/* ---------- Equipo agrupado por área ---------- */
.team { display: grid; gap: 28px; grid-template-columns: 1fr; }
.team-group { animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms); }
.team-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 4px 10px; }
.team-group-head h2 { margin: 0; font-size: 21px; font-weight: 600; letter-spacing: -.02em; }
.team-group .on, .team-row .on { color: #3fd06a; font-weight: 600; }
.team-row { display: grid; grid-template-columns: minmax(220px, 280px) 1fr; gap: 16px; align-items: start; padding: 14px 18px; }
.team-row + .team-row { border-top: 1px solid var(--line); }
.team-rank-name { display: grid; gap: 4px; padding-top: 6px; }
.team-row ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.team-row li { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 999px; background: var(--fill); font-size: 14px; max-width: 240px; }
.team-row li span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-row li.no-web { opacity: .55; }
.team-row li .ava { width: 26px; height: 26px; }
.team-row li .dot { box-shadow: 0 0 0 2px var(--fill); }
@media (max-width: 760px) { .team-row { grid-template-columns: 1fr; gap: 10px; } }

/* ---------- Ajustes ---------- */
.settings-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; margin-bottom: 16px; align-items: start; }
#settings .group h3 { margin: 0; font-size: 17px; font-weight: 600; }
#settings .row { padding-inline: 0; margin-left: 0; }
.internal-toggle.big { font-size: 15px; color: var(--text); font-weight: 500; }
.reqs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.reqs li { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 8px 12px; border-radius: 10px; background: var(--fill); }
.reqs li.ok .icon { color: #3fd06a; }
.reqs li.no .icon { color: var(--red); }
.reqs li.no span { color: var(--text-2); }
.dc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 4px 24px; }
.dc-grid .row label { flex: 1; }
.dc-grid .filter-select { max-width: 260px; }

/* Tickets cerrados (página pública) */
.closed-banner { grid-column: 1 / -1; display: grid; gap: 4px; padding: 18px 22px; border-radius: var(--r); background: color-mix(in srgb, #f0b429 12%, var(--surface)); border: 1px solid color-mix(in srgb, #f0b429 35%, transparent); }
.closed-banner strong { font-size: 17px; color: #f6cf6b; }
.closed-banner span { color: var(--text-2); font-size: 15px; }
.cat.is-closed { opacity: .5; cursor: not-allowed; }
.cat.is-closed:hover { transform: none; box-shadow: var(--shadow); }

/* ---------- Cupos: lista pública ---------- */
dialog.slots-pop {
  margin: auto; padding: 0; width: min(1080px, calc(100vw - 32px)); max-height: min(88dvh, 900px); overflow: auto;
  border: 1px solid var(--line); border-radius: 22px; background: var(--bg); color: var(--text); box-shadow: 0 40px 100px rgba(0, 0, 0, .75);
}
dialog.slots-pop[open] { animation: pop-in .35s var(--ease); }
dialog.slots-pop::backdrop { background: rgba(0, 0, 0, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.slots-pop header { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 20px 20px 14px 24px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.slots-pop h2 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.slots-pop header p { margin: 4px 0 0; }
.slots-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; padding: 18px 24px 8px; }
.slot-card { display: grid; gap: 10px; padding: 14px 16px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); animation: rise .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 15ms); }
.slot-card.full { opacity: .55; }
.slot-card strong { font-size: 15px; font-weight: 600; }
.slot-vals { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.slot-val { display: grid; gap: 1px; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 14%, transparent); }
.slot-val b { font-size: 22px; font-weight: 600; line-height: 1.1; color: var(--accent-text); }
.slot-val small { font-size: 11px; color: var(--text-2); }
.slot-val.zero { background: var(--fill); }
.slot-val.zero b { color: var(--text-3); }
.slot-val.none { background: var(--fill); }
.slot-val.none b { font-size: 14px; color: var(--text); padding: 4px 0 3px; }
.slots-note { padding: 6px 24px 22px; margin: 0; }

/* ---------- Cupos: tabla del panel ---------- */
.hint-bar { margin-bottom: 14px; padding: 12px 16px; border-radius: 12px; background: color-mix(in srgb, #f0b429 12%, var(--surface)); border: 1px solid color-mix(in srgb, #f0b429 30%, transparent); font-size: 14px; color: var(--text-2); }
.hint-bar strong { color: #f6cf6b; }
.slot-row { display: grid; grid-template-columns: minmax(200px, 1.2fr) minmax(220px, 1fr) 150px 150px 32px; align-items: center; gap: 12px; padding: 10px 18px; }
.slot-row + .slot-row { border-top: 1px solid var(--line); }
.slot-row.head { font-size: 12px; color: var(--text-2); font-weight: 500; padding-block: 12px; }
.slot-row > input, .slot-row > select { height: 34px; border: 0; border-radius: 8px; background: var(--fill); padding: 0 10px; color: var(--text); font-size: 14px; outline: none; min-width: 0; }
.slot-row > input:focus, .slot-row > select:focus, .stepper input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); }
.stepper { display: inline-flex; align-items: center; gap: 4px; padding: 2px; border-radius: 10px; background: var(--fill); width: max-content; }
.stepper .ghost { width: 30px; height: 30px; border-radius: 8px; }
.stepper input { width: 48px; height: 30px; border: 0; border-radius: 6px; background: var(--surface); color: var(--text); text-align: center; font-size: 15px; font-weight: 600; outline: none; }
.slots-actions { margin-top: 14px; }
@media (max-width: 900px) { .slot-row { grid-template-columns: 1fr 1fr; } .slot-row.head { display: none; } }
.slot-zone { display: grid; gap: 4px; }
.slot-count { font-size: 12px; color: var(--text-2); }
.slot-count .on { color: #3fd06a; }
.slot-count .off { color: var(--text-3); }
.slot-row { grid-template-columns: minmax(200px, 1.1fr) minmax(220px, 1fr) 190px 190px 32px; }

/* ---------- Vista previa de mensajes de Discord ---------- */
.dc-previews { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; align-items: start; }
.dc-previews figure { margin: 0; display: grid; gap: 8px; }
.dc-previews figcaption { font-size: 13px; font-weight: 600; }
.dc-msg { background: #313338; color: #dbdee1; border-radius: 12px; padding: 14px 16px; font: 14px/1.4 "gg sans", "Segoe UI", system-ui, sans-serif; letter-spacing: 0; }
.dc-author { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.dc-author img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: #1e1f22; }
.dc-author strong { color: #f2f3f5; font-weight: 600; }
.dc-app { background: #5865f2; color: #fff; font-size: 10px; font-weight: 600; padding: 1px 5px; border-radius: 4px; }
.dc-embed { position: relative; background: #2b2d31; border-left: 4px solid var(--c); border-radius: 4px; padding: 10px 14px 12px; max-width: 520px; }
.dc-embed h4 { margin: 2px 70px 8px 0; color: #f2f3f5; font-size: 15px; font-weight: 700; }
.dc-thumb { position: absolute; top: 10px; right: 12px; width: 64px; height: 64px; object-fit: contain; }
.dc-desc { font-size: 14px; line-height: 1.4; max-width: none; padding-right: 70px; }
.dc-desc p { margin: 2px 0; }
.dc-desc blockquote { margin: 4px 0; padding: 0 0 0 10px; border-left: 4px solid #4e5058; border-radius: 0; background: none; }
.dc-desc a { color: #00a8fc; }
.dc-foot { margin: 8px 0 0; font-size: 12px; color: #b5bac1; }
.dc-select { display: flex; justify-content: space-between; align-items: center; max-width: 520px; margin-top: 8px; padding: 10px 12px; border-radius: 6px; background: #1e1f22; color: #b5bac1; }
.dc-button { display: inline-block; margin: 8px 8px 0 0; padding: 7px 14px; border-radius: 6px; background: #4e5058; color: #fff; font-weight: 500; }
.md-gap { display: block; height: 8px; }
.dc-desc .md-gap { height: 6px; }
.dc-embed + .dc-embed { margin-top: 4px; }
.dc-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 16px; margin-top: 8px; padding-right: 0; }
.dc-field { min-width: 0; font-size: 13px; line-height: 1.35; }
.dc-field.wide { grid-column: 1 / -1; }
.dc-field b { display: block; color: #f2f3f5; font-weight: 600; margin-bottom: 2px; }
.dc-field .prose { font-size: 13px; line-height: 1.35; max-width: none; }
.dc-field .prose p { margin: 0; }
.dc-embed h4 + .dc-fields { margin-top: 4px; }
.dc-button { display: inline-flex; align-items: center; gap: 6px; }
.dc-button .icon { width: 13px; height: 13px; }
.dc-previews { grid-template-columns: repeat(auto-fit, minmax(520px, 1fr)); }

/* Cartel del panel: tickets web apagados */
.staff-banner { position: sticky; top: 52px; z-index: 8; display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; padding: 10px var(--gutter); background: color-mix(in srgb, #f0b429 16%, var(--bg)); border-bottom: 1px solid color-mix(in srgb, #f0b429 40%, transparent); font-size: 14px; color: var(--text-2); text-align: center; }
.staff-banner strong { color: #f6cf6b; }
#t-power { margin-left: 8px; }
.staff-link { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px 0 4px; border-radius: 999px; border: 1px solid var(--line); color: var(--text); font-size: 13px; font-weight: 500; }
.staff-link:hover { background: var(--fill); text-decoration: none; }
@media (max-width: 720px) { .staff-link span:last-child { display: none; } .staff-link { padding: 0 4px; } }

/* ---------- Registros (ausencias, casos RPQM, staff, eventos) ---------- */
.segmented .seg-link { display: inline-flex; align-items: center; padding: 6px 16px; border-radius: 8px; color: var(--text-2); font-size: 14px; }
.segmented .seg-link:hover { color: var(--text); text-decoration: none; }
.segmented .seg-link[aria-current="page"] { background: var(--raised); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
.rec-row { display: grid; grid-template-columns: minmax(180px, 1.4fr) repeat(calc(var(--cols) - 1), minmax(0, 1fr)) 200px; gap: 16px; align-items: center; width: 100%; padding: 14px 18px; border: 0; background: none; text-align: left; font-size: 14px; }
.rec-row + .rec-row { box-shadow: inset 0 1px 0 var(--line); }
button.rec-row:hover { background: var(--fill); }
.rec-row.head { padding-block: 10px; color: var(--text-3); font-size: 12px; font-weight: 500; }
.rec-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-title { font-weight: 600; font-size: 15px; }
.pad-s { padding: 18px; margin: 0; }
.empty.small { padding: 56px 16px; }
.empty.small h2 { font-size: 21px; }
.pill.tone-green { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent-text); }
.pill.tone-gold { background: color-mix(in srgb, #f0b429 18%, transparent); color: #f6cf6b; }
.pill.tone-red { background: color-mix(in srgb, var(--red) 18%, transparent); color: #ff9a9a; }
.pill.tone-blue { background: color-mix(in srgb, #5aa9ff 22%, transparent); color: #a9d0ff; }
.pill.tone-mute { background: var(--fill); color: var(--text-2); }
.prop-pick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.prop-pick input { flex: 1 1 220px; text-align: left !important; }
.chip-x { margin-left: 4px; padding: 0 2px; border: 0; background: none; color: var(--text-2); font-size: 15px; line-height: 1; }
.chip-x:hover { color: var(--text); }
@media (max-width: 720px) {
  .rec-row { grid-template-columns: 1fr auto; gap: 4px 12px; }
  .rec-row.head { display: none; }
  .rec-row > span:not(:first-child):not(:last-child) { display: none; }
}

/* ---------- Respaldo antes de liberar ---------- */
.field { width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: var(--fill); color: var(--text); resize: vertical; }
.field::placeholder { color: var(--text-3); }

/* ---------- Edición en bloque ---------- */
.bulk-bar { position: sticky; bottom: 16px; z-index: 6; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 16px 0 0; padding: 12px 16px; border-radius: 14px; background: color-mix(in srgb, var(--raised) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--shadow-lift); font-size: 14px; }
.bulk-bar strong { margin-right: auto; }
.bulk-bar .filter-select { max-width: 220px; }
.tile .pick { position: absolute; z-index: 2; top: 12px; right: 12px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: rgba(0, 0, 0, .55); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .7); color: var(--on-accent); }
.tile { position: relative; }
.tile.picked { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.tile.picked .pick { background: var(--accent); box-shadow: none; }
@media (max-width: 720px) { .bulk-bar .filter-select { max-width: none; flex: 1 1 100%; } }

/* ---------- Campana de avisos ---------- */
.bell { position: relative; display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: none; color: var(--text-2); }
.bell:hover { background: var(--fill); color: var(--text); }
.bell-n { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; line-height: 17px; text-align: center; }
.notif-pop { position: absolute; top: 48px; right: calc(var(--gutter) + 48px); z-index: 20; width: min(380px, calc(100vw - 32px)); max-height: 70vh; overflow: auto; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-lift); }
.notif-pop header { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 16px 8px; }
.notif-pop ul { list-style: none; margin: 0; padding: 0 6px 6px; }
.notif-pop li a { display: grid; gap: 2px; padding: 10px; border-radius: 10px; color: var(--text-2); font-size: 14px; }
.notif-pop li a:hover { background: var(--fill); text-decoration: none; }
.notif-pop li.unread a { color: var(--text); }
.notif-pop li.unread a span::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--accent); vertical-align: middle; }
.notif-pop > p { padding: 0 16px 16px; margin: 0; }
@media (max-width: 720px) { .notif-pop { right: 16px; } }

/* ---------- Ajustes: preguntas frecuentes ---------- */
.faq-edit { display: grid; gap: 8px; }
.faq-row { display: grid; grid-template-columns: minmax(200px, 1fr) 2fr auto; gap: 8px; align-items: start; }
.faq-row input, .faq-row textarea { padding: 8px 10px; border: 0; border-radius: 8px; background: var(--fill); color: var(--text); resize: vertical; }
@media (max-width: 720px) { .faq-row { grid-template-columns: 1fr auto; } .faq-row textarea { grid-column: 1; } }

/* ---------- Web pública: eventos y preguntas frecuentes ---------- */
#eventos, #faq { margin-top: 88px; }
.events { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 10px; }
.event-card { display: flex; align-items: center; gap: 18px; padding: 14px 18px; border-radius: var(--r); background: var(--surface); }
.event-card time { flex: none; width: 52px; display: grid; justify-items: center; line-height: 1.1; }
.event-card time b { font-size: 24px; font-weight: 600; }
.event-card time span { color: var(--accent-text); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.event-card div { flex: 1; min-width: 0; display: grid; }
.event-card strong { font-weight: 600; }
.event-card div span { color: var(--text-2); font-size: 14px; }
.faq { margin-top: 24px; border-radius: var(--r); background: var(--surface); overflow: hidden; }
.faq-item + .faq-item { box-shadow: inset 0 1px 0 var(--line); }
.faq-item summary { display: flex; justify-content: space-between; gap: 16px; padding: 18px 22px; font-weight: 600; cursor: pointer; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--text-3); font-weight: 400; font-size: 22px; line-height: 1; transition: transform .3s var(--ease); }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-a { padding: 0 22px 18px; color: var(--text-2); max-width: 72ch; }
.faq-a p { margin: 0 0 10px; }
.btn.secondary[aria-pressed="true"] { background: var(--text); color: var(--bg); }

/* ---------- Rangos y permisos ---------- */
.rank-head, .rank-none summary { display: flex; align-items: baseline; gap: 10px; padding: 14px 18px 10px; }
.rank-none { box-shadow: inset 0 1px 0 var(--line); }
.rank-none summary { cursor: pointer; list-style: none; }
.rank-none summary::-webkit-details-marker { display: none; }
.rank-none summary::after { content: "+"; margin-left: auto; color: var(--text-3); font-size: 20px; line-height: 1; }
.rank-none[open] summary::after { content: "−"; }
.rank-line { display: grid; grid-template-columns: minmax(200px, 1.2fr) 170px 1fr auto; gap: 16px; align-items: center; width: 100%; padding: 12px 18px; border: 0; background: none; text-align: left; box-shadow: inset 0 1px 0 var(--line); }
.rank-line:hover { background: var(--fill); }
.rank-line .pill { justify-self: start; }
.rank-edit { display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); font-size: 13px; }
.rank-edit .icon { transform: rotate(-90deg); }
.rank-line:hover .rank-edit { color: var(--text); }
.level-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.level-card { position: relative; display: grid; gap: 4px; padding: 14px 16px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; transition: box-shadow .2s, background .2s; }
.level-card:hover { background: var(--raised); }
.level-card input { position: absolute; opacity: 0; pointer-events: none; }
.level-card strong { font-size: 15px; font-weight: 600; }
.level-card span { color: var(--text-2); font-size: 13px; line-height: 1.4; }
.level-card:has(input:checked) { box-shadow: inset 0 0 0 2px var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.level-card:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }
.level-card:has(input:disabled) { cursor: default; opacity: .6; }
.perm-group + .perm-group { margin-top: 14px; }
.perm-group h4 { margin: 0 0 6px 4px; color: var(--text-3); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.perm-line > span { display: grid; gap: 2px; padding-right: 16px; }
.perm-line strong { font-weight: 500; font-size: 15px; }
label.row { cursor: pointer; }
.rank-summary { grid-template-columns: auto 1fr; align-items: baseline; background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.rank-summary span { color: var(--text-2); }
.user-row { flex-wrap: wrap; }
.user-rights { flex-basis: 100%; padding: 4px 0 6px; }
.user-rights p { margin: 0 0 2px; font-size: 14px; }
@media (max-width: 720px) {
  .rank-line { grid-template-columns: 1fr auto; gap: 4px 12px; }
  .rank-line > .muted { grid-column: 1 / -1; grid-row: 3; }
  .rank-summary { grid-template-columns: 1fr; }
}
/* Los interruptores dentro de una fila no heredan el estilo de los campos de texto. */
.row input.switch { flex: none; padding: 0; background: var(--fill-strong); }
.row input.switch:checked { background: var(--accent); }
/* Barra del panel en el móvil: los enlaces se desplazan de lado y la búsqueda, la campana y el perfil quedan siempre visibles. */
.nav-links { min-width: 0; }
@media (max-width: 900px) {
  .nav { gap: 14px; }
  .nav-links { flex: 1; overflow-x: auto; scrollbar-width: none; white-space: nowrap; mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-end { flex: none; gap: 8px; }
  .rank-edit { display: none; }
}
.profile-rank { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: 14px; }

/* ---------- Liberar y seguimiento ---------- */
.free-box { gap: 18px; }
.free-step { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; }
.free-step > div { display: grid; gap: 8px; min-width: 0; }
.free-n { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--fill-strong); font-size: 13px; font-weight: 600; }
.free-step .segmented { justify-self: start; flex-wrap: wrap; }
.free-diff { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.free-diff > div { padding: 10px 12px; border-radius: 10px; background: var(--fill); }
.free-diff p { margin: 6px 0 0; font-size: 13px; color: var(--text-2); }
.free-check { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--text-3); }
.free-check .done { color: var(--accent-text); }
.free-check .ready { color: var(--accent-text); font-weight: 600; }
.free-check .missing { color: #f6cf6b; font-weight: 600; }
.free-check .wait { color: var(--text-2); }
.free-box .picker { border: 1px dashed var(--line); border-radius: 12px; padding: 10px; }
.free-box .picker.dropping, #free-box.dropping .picker { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
@media (max-width: 720px) { .free-diff { grid-template-columns: 1fr; } }

/* ---------- Ajustes: cada apartado es un cuadro aparte ---------- */
#settings > section.group, .settings-cols > section.group {
  padding: 22px 24px 24px; gap: 14px; margin-bottom: 28px;
  border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface); box-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 12px 32px rgba(0, 0, 0, .35);
}
.settings-cols { gap: 24px; margin-bottom: 28px; }
.settings-cols > section.group { margin-bottom: 0; height: 100%; }
#settings .group h3 { font-size: 19px; letter-spacing: -.02em; padding-bottom: 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
#settings .group > p.muted { margin: 0; line-height: 1.5; }
#settings .dc-grid { gap: 2px 32px; padding: 6px 0; }
#settings .actions.tight { padding: 4px 0 0; }
#settings > .h2 { margin-top: 48px; }
@media (max-width: 720px) { #settings > section.group, .settings-cols > section.group { padding: 18px 16px 20px; } }

/* «Reclamado por …»: el nombre en el color del rango de quien lo reclamó. */
.pill.claimed b, .claimed-name { color: var(--c, var(--text)); font-weight: 600; }
.pill.claimed { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c, transparent) 45%, transparent); }

/* Abrir o cerrar categorías desde Tickets. */
.cat-switches { margin-bottom: 14px; }
.cat-switches-head { display: grid; gap: 2px; padding-bottom: 6px; }
.cat-switches .row > span:first-child { flex: 1; display: inline-flex; align-items: center; gap: 8px; }
.cat-state { font-size: 13px; font-weight: 600; }
.cat-state.on { color: var(--accent-text); }
.cat-state.off { color: var(--red); }
