/* ==========================================================================
   AION 2 Bot · Panel — basado en el handoff de diseño (sistema Nocturne)
   ========================================================================== */

:root {
  /* Base Nocturne */
  --color-text: #e9e9ed;
  --color-neutral-100: #f3f5fe;
  --color-neutral-200: #e4e7f5;
  --color-neutral-300: #cfd3e5;
  --font-body: "Inter", system-ui, sans-serif;

  /* Panel */
  --pg: oklch(0.15 0.01 275);
  --side: oklch(0.17 0.011 275);
  --card: oklch(0.195 0.012 275);
  --card2: oklch(0.225 0.014 275);
  --line: oklch(0.29 0.014 275);
  --mut: oklch(0.68 0.015 275);
  --dim: oklch(0.54 0.015 275);
  --acc: oklch(0.6 0.2 275);
  --acc-hi: oklch(0.68 0.18 275);
  --acc-glow: oklch(0.55 0.22 275 / 0.5);
  --ok: oklch(0.76 0.15 150);
  --err: oklch(0.7 0.17 25);

  /* Tipos de evento */
  --boss: oklch(0.68 0.18 28);
  --rift: oklch(0.7 0.14 255);
  --fest: oklch(0.8 0.13 78);
  --siege: oklch(0.75 0.15 52);
  --event: oklch(0.74 0.11 200);
  --reset: oklch(0.75 0.13 150);
  --other: oklch(0.68 0.015 275);

  --focus: inset 0 0 0 1px var(--acc), 0 0 0 3px oklch(0.6 0.2 275 / 0.22);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--pg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--acc-hi); text-decoration: none; }
a:hover { color: var(--color-text); }
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.hidden { display: none !important; }
.contents { display: contents; }
.mut { color: var(--mut); }
.dim { color: var(--dim); }
.small { font-size: 11px; }
.mobile-only { display: none !important; }
select option, select optgroup { background: oklch(0.2 0.012 275); color: var(--color-text); }
input::placeholder, textarea::placeholder { color: oklch(0.48 0.015 275); }

/* ---------- Marca ---------- */
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.brand-tile {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 16px; color: oklch(0.97 0.01 275);
  background: linear-gradient(140deg, var(--acc-hi), oklch(0.38 0.2 275));
  box-shadow: 0 0 18px var(--acc-glow), inset 0 1px 0 oklch(0.8 0.1 275 / 0.5);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; gap: 2px; }
.brand-name { font-family: Cinzel, serif; font-weight: 600; font-size: 16px; letter-spacing: 0.06em; }
.brand-sub { font-size: 10px; color: var(--fest); letter-spacing: 0.18em; text-transform: uppercase; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 13px; font-weight: 500; padding: 9px 14px; border-radius: 8px; border: 0; cursor: pointer;
  white-space: nowrap; text-decoration: none;
}
.btn i { font-size: 15px; }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn-primary {
  color: oklch(0.98 0.01 275); background: var(--acc);
  box-shadow: inset 0 0 0 1px var(--acc-hi), 0 6px 20px var(--acc-glow);
}
.btn-primary:hover { background: var(--acc-hi); color: oklch(0.98 0.01 275); }
.btn-primary:active { background: oklch(0.52 0.2 275); }
.btn-secondary { color: var(--color-text); background: var(--card2); box-shadow: inset 0 0 0 1px var(--line); padding: 9px 16px; }
.btn-secondary:hover { box-shadow: inset 0 0 0 1px var(--acc); color: var(--color-text); }
.btn.small { padding: 6px 10px; font-size: 12px; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px;
  border: 0; border-radius: 8px; background: none; color: var(--mut); cursor: pointer; font-size: 12px;
}
.btn-ghost i { font-size: 15px; }
.btn-ghost:hover { background: var(--card2); color: var(--color-text); }
.btn-ghost.icon { width: 30px; padding: 0; justify-content: center; }
.btn-ghost.danger { color: var(--dim); }
.btn-ghost.danger:hover { background: oklch(0.7 0.17 25 / 0.14); color: var(--err); }
.btn-discord { background: #5865f2; color: #fff; padding: 11px 18px; font-size: 14px; box-shadow: 0 6px 20px rgb(88 101 242 / 0.35); }
.btn-discord:hover { background: #4752c4; color: #fff; }
.align-end { align-self: flex-end; }

/* ---------- Formularios ---------- */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--mut); }
.field-row { display: flex; }
.field-row > :first-child { flex: 1; }
.field-value { color: var(--color-text); font-variant-numeric: tabular-nums; }
.help { font-size: 11px; color: var(--dim); line-height: 1.5; }
input:not([type="checkbox"]):not([type="range"]):not([type="color"]), textarea, select {
  width: 100%; background: var(--pg); border: 0; box-shadow: inset 0 0 0 1px var(--line); border-radius: 8px;
  padding: 9px 12px; color: var(--color-text); font: inherit; font-size: 13px; outline: none;
}
textarea { line-height: 1.5; resize: vertical; padding: 10px 12px; }
input:focus, textarea:focus, select:focus { box-shadow: var(--focus); }
input[type="color"] { width: 100%; height: 38px; padding: 3px; border: 0; border-radius: 8px; background: var(--pg); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; }
input[type="range"] { width: 100%; accent-color: var(--acc); margin: 2px 0; }
.range-ends { display: flex; justify-content: space-between; font-size: 11px; color: var(--dim); }
.select { position: relative; }
.select select { appearance: none; padding-right: 32px; cursor: pointer; }
.select > .ph-caret-down { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--mut); }
.select.has-icon select { padding-left: 32px; }
.select .lead { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--mut); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.form-error { color: var(--err); font-size: 12px; }
.form-error:empty { display: none; }

/* Switch */
.switch { position: relative; display: inline-block; width: 30px; height: 17px; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch-track { position: absolute; inset: 0; border-radius: 17px; background: var(--line); transition: background 0.15s; }
.switch-track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%;
  background: var(--color-neutral-100); transition: left 0.15s;
}
.switch input:checked + .switch-track { background: var(--acc); }
.switch input:checked + .switch-track::after { left: 15px; }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px oklch(0.6 0.2 275 / 0.35); }
.switch-label { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--mut); cursor: pointer; }
.switch-label:hover { color: var(--color-text); }
.switch-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; cursor: pointer;
  background: var(--pg); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; color: var(--color-text);
}
.switch-row > span:first-child { flex: 1; }
.switch-row:hover { box-shadow: inset 0 0 0 1px var(--dim); }

/* ---------- Tarjetas y piezas comunes ---------- */
.card { background: var(--card); box-shadow: inset 0 0 0 1px var(--line); border-radius: 12px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.card-title { font-size: 14px; font-weight: 500; flex: 1; white-space: nowrap; }
.card-heading { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; }
.card-heading i { font-size: 18px; color: var(--acc-hi); }
.card-heading.small { gap: 8px; }
.card-heading.small i { font-size: 16px; }
.tag { font-size: 11px; padding: 1px 7px; border-radius: 5px; align-self: flex-start; white-space: nowrap; }
.tile { display: grid; place-items: center; flex-shrink: 0; border-radius: 9px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--card2); box-shadow: inset 0 0 0 1px var(--line); flex-shrink: 0; }
.side-sep { height: 1px; flex-shrink: 0; background: linear-gradient(90deg, transparent, var(--line) 30%, var(--line) 70%, transparent); }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; position: relative; overflow: hidden; }
.login-glow { position: absolute; width: 640px; height: 480px; border-radius: 50%; background: radial-gradient(closest-side, oklch(0.45 0.2 275 / 0.35), transparent); top: -200px; right: -160px; pointer-events: none; }
.login-card {
  position: relative; width: 100%; max-width: 380px; padding: 28px; border-radius: 16px;
  background: var(--card); box-shadow: inset 0 0 0 1px var(--line), 0 24px 60px rgb(0 0 0 / 0.35);
  display: flex; flex-direction: column; gap: 22px;
}
.brand-lg { padding: 0; }
.brand-lg .brand-tile { width: 40px; height: 40px; font-size: 20px; border-radius: 11px; }
.brand-lg .brand-name { font-size: 20px; }
.login-copy { display: flex; flex-direction: column; gap: 6px; }
.login-copy h1 { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.login-copy p { font-size: 13px; color: var(--mut); line-height: 1.5; }
.login-copy strong { color: var(--color-text); font-weight: 500; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; background: var(--pg); }
.sidebar {
  width: 236px; flex-shrink: 0; display: flex; flex-direction: column; gap: 22px; padding: 22px 16px;
  background: var(--side); box-shadow: inset -1px 0 0 var(--line);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side-label { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); padding: 0 10px 8px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px;
  font-size: 13px; color: var(--mut); cursor: pointer;
}
.nav-item > span:first-of-type { flex: 1; }
.nav-item i { font-size: 16px; }
.nav-item:hover { background: var(--card2); color: var(--color-text); }
.nav-item.active { background: var(--card2); color: var(--color-text); box-shadow: inset 0 0 0 1px var(--line), inset 2px 0 0 var(--acc); }
.nav-count { font-size: 11px; min-width: 20px; text-align: center; padding: 1px 6px; border-radius: 5px; background: var(--line); color: var(--color-text); }
.nav-alert { width: 7px; height: 7px; border-radius: 50%; background: var(--err); box-shadow: 0 0 8px var(--err); }
.servers { display: flex; flex-direction: column; gap: 4px; }
.server-list { display: flex; flex-direction: column; gap: 6px; }
.server {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  background: var(--card); box-shadow: inset 0 0 0 1px var(--line);
}
.server-icon { width: 28px; height: 28px; border-radius: 8px; background: var(--card2); display: grid; place-items: center; font-size: 14px; color: var(--color-neutral-300); overflow: hidden; flex-shrink: 0; }
.server-icon img { width: 100%; height: 100%; object-fit: cover; }
.server-text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.server-name { font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-sub { font-size: 11px; color: var(--dim); }
.side-ghost { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--mut); padding: 8px 10px; border-radius: 8px; }
.side-ghost i { font-size: 16px; }
.side-ghost:hover { background: var(--card2); color: var(--color-text); }
.side-spacer { flex: 1; }
.me { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.me-name { font-size: 13px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.main-glow {
  position: absolute; right: -120px; top: -180px; width: 560px; height: 440px; border-radius: 50%;
  background: radial-gradient(closest-side, oklch(0.45 0.2 275 / 0.3), transparent); pointer-events: none;
}
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 12px 28px; min-height: 58px;
  box-shadow: inset 0 -1px 0 var(--line); position: relative;
}
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--dim); flex: 1; min-width: 0; }
.crumbs > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs i { font-size: 11px; flex-shrink: 0; }
.crumb-cur { color: var(--color-text); }
.clock { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.3; font-variant-numeric: tabular-nums; font-size: 13px; }
.clock-server { font-size: 11px; color: var(--dim); white-space: nowrap; }
.vdiv { width: 1px; height: 28px; background: var(--line); }
.bot-chip { display: flex; align-items: center; gap: 10px; }
.avatar-wrap { position: relative; }
.status-dot { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: var(--dim); box-shadow: 0 0 0 2px var(--pg); }
.status-dot.on { background: var(--ok); }
.status-dot.off { background: var(--err); }
.bot-chip-text { display: flex; flex-direction: column; line-height: 1.3; font-size: 13px; }
.bot-state { font-size: 11px; color: var(--dim); }
.bot-state.on { color: var(--ok); }
.bot-state.off { color: var(--err); }

.screen { padding: 26px 28px 48px; display: flex; flex-direction: column; gap: 16px; position: relative; }
.screen.narrow { max-width: 920px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; }
.page-title { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 4px; }
.page-title h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.page-sub { font-size: 13px; color: var(--mut); }
.section-title { margin: 8px 0 0; font-size: 16px; font-weight: 600; }

/* ---------- Inicio ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.stat { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden; }
.stat-next { box-shadow: inset 0 0 0 1px var(--acc); }
.stat-glow { position: absolute; right: -40px; bottom: -60px; width: 200px; height: 140px; border-radius: 50%; background: radial-gradient(closest-side, var(--acc-glow), transparent); pointer-events: none; }
.stat-label { font-size: 12px; color: var(--mut); position: relative; }
.stat-big { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.next-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; position: relative; }
.next-meta { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.next-meta > :first-child { font-size: 12px; white-space: nowrap; }
.next-meta > :last-child { font-size: 11px; white-space: nowrap; }
.stat-row { display: flex; align-items: center; gap: 10px; }
.stat-row i { font-size: 18px; }
.stat-sub { font-size: 11px; color: var(--mut); white-space: nowrap; }

.row-wrap { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; }
.timeline-card { flex: 999 1 520px; min-width: 0; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; }
.legend span { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--mut); }
.legend i { width: 7px; height: 7px; border-radius: 2px; display: inline-block; }
.tl-pad { padding: 0 22px; overflow: hidden; }
.tl { position: relative; height: 188px; }
.tl-line { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed var(--line); }
.tl-hour { position: absolute; top: 0; transform: translateX(-50%); font-size: 11px; font-variant-numeric: tabular-nums; color: var(--dim); background: var(--card); padding: 0 4px; }
.tl-hour.cur { color: var(--color-text); }
.tl-now { position: absolute; top: 18px; bottom: 0; width: 2px; margin-left: -1px; background: var(--color-text); opacity: 0.9; }
.tl-now-dot { position: absolute; top: 16px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--color-text); box-shadow: 0 0 10px var(--color-text); }
.tl-chip {
  position: absolute; margin-left: 4px; display: flex; align-items: center; gap: 6px; padding: 4px 8px 4px 4px;
  border-radius: 7px; white-space: nowrap; font-size: 12px; color: var(--color-text);
}
.tl-chip.compact { gap: 0; padding-right: 4px; }
.tl-chip.flip { margin-left: -4px; transform: translateX(-100%); }
.tl-chip b { font-size: 10px; padding: 2px 5px; border-radius: 4px; color: oklch(0.16 0.01 275); font-weight: 600; font-variant-numeric: tabular-nums; }

.bosses-card { flex: 1 1 280px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.bosses-card .card-head { padding-bottom: 2px; }
.boss-list { display: flex; flex-direction: column; gap: 8px; }
.boss { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 9px; background: var(--card2); }
.boss .tile { width: 34px; height: 34px; border-radius: 8px; font-size: 17px; }
.boss-text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.35; }
.boss-text > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.boss-text > :first-child { font-size: 13px; font-weight: 500; }
.boss-text > :last-child { font-size: 11px; color: var(--mut); }
.pill-rel { font-size: 11px; padding: 3px 8px; border-radius: 6px; background: var(--pg); white-space: nowrap; }
.empty-note { font-size: 12px; color: var(--dim); padding: 6px 2px; }

.kanban { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; align-items: start; }
.k-col { display: flex; flex-direction: column; gap: 8px; }
.k-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 9px; box-shadow: inset 0 0 0 1px var(--line); }
.k-count { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 5px; }
.k-title { font-size: 13px; font-weight: 500; flex: 1; }
.k-head i { font-size: 15px; }
.k-card { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 10px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.k-card:hover { box-shadow: inset 0 0 0 1px var(--dim); }
.k-top { display: flex; align-items: center; gap: 8px; }
.k-date { font-size: 11px; padding: 2px 7px; border-radius: 5px; background: var(--card2); color: var(--mut); font-variant-numeric: tabular-nums; }
.k-rel { font-size: 11px; white-space: nowrap; margin-left: auto; }
.k-name { font-size: 14px; font-weight: 500; }
.k-bar { height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.k-bar > div { height: 100%; border-radius: 3px; }

/* ---------- Eventos ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filter {
  display: flex; align-items: center; gap: 6px; border: 0; font-size: 12px; padding: 6px 11px; border-radius: 7px;
  cursor: pointer; background: transparent; color: var(--mut);
}
.filter:hover { color: var(--color-text); background: var(--card2); }
.filter.active { background: var(--card2); color: var(--color-text); box-shadow: inset 0 0 0 1px var(--line); }
.filter .dot { width: 7px; height: 7px; border-radius: 2px; }
.filter .n { color: var(--dim); }
.ev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.ev-card { display: flex; flex-direction: column; gap: 14px; padding: 16px; }
.ev-card:hover { box-shadow: inset 0 0 0 1px var(--dim); }
.ev-head { display: flex; align-items: flex-start; gap: 12px; }
.ev-head .tile { width: 36px; height: 36px; font-size: 18px; }
.ev-title { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.ev-title > :first-child { font-size: 14px; font-weight: 600; }
.ev-meta { display: flex; flex-direction: column; gap: 7px; font-size: 12px; color: var(--mut); }
.ev-meta > div { display: flex; align-items: center; gap: 8px; }
.ev-meta i { font-size: 14px; color: var(--dim); flex-shrink: 0; }
.ev-meta .strong { color: var(--color-text); }
.ev-card.off .ev-head, .ev-card.off .ev-meta { opacity: 0.45; }
.ev-foot { display: flex; align-items: center; gap: 4px; padding-top: 12px; box-shadow: inset 0 1px 0 var(--line); margin-top: auto; }
.ev-foot .switch-label { font-size: 12px; gap: 8px; padding: 4px 6px 4px 0; flex: 1; }
.ev-foot .btn-ghost { height: 28px; padding: 0 9px; border-radius: 7px; }
.ev-foot .btn-ghost.icon { width: 28px; padding: 0; font-size: 14px; }
.ev-empty { grid-column: 1 / -1; padding: 28px; text-align: center; color: var(--dim); }

/* ---------- Anuncio ---------- */
.announce-layout { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.announce-forms { flex: 1 1 420px; max-width: 620px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.form-card { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.form-foot .switch-label { flex: 1; }
.preview { flex: 1 1 300px; max-width: 440px; position: sticky; top: 20px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.preview-label { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.dc-msg { padding: 16px; border-radius: 12px; background: oklch(0.22 0.008 265); box-shadow: inset 0 0 0 1px var(--line); display: flex; gap: 12px; }
.dc-avatar { width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; object-fit: cover; background: linear-gradient(140deg, oklch(0.45 0.1 330), oklch(0.32 0.1 275)); }
.dc-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.dc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.dc-name { font-weight: 600; }
.dc-bot { font-size: 10px; font-weight: 600; padding: 1px 4px; border-radius: 3px; background: var(--acc); color: oklch(0.98 0.01 275); }
.dc-time { font-size: 11px; color: var(--dim); }
.dc-mention { align-self: flex-start; font-size: 13px; padding: 0 3px; border-radius: 3px; background: oklch(0.6 0.2 275 / 0.3); color: oklch(0.85 0.08 275); }
.dc-embed { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 4px; background: oklch(0.19 0.008 265); box-shadow: inset 3px 0 0 var(--acc); }
.dc-embed-title { font-size: 14px; font-weight: 600; word-break: break-word; }
.dc-embed-msg { font-size: 13px; line-height: 1.5; color: var(--color-neutral-200); white-space: pre-wrap; word-break: break-word; }
.dc-embed-msg.empty { color: var(--dim); }

/* ---------- Ajustes ---------- */
.settings { display: flex; flex-direction: column; gap: 16px; }
.settings-card { display: flex; flex-wrap: wrap; gap: 12px 32px; padding: 20px; }
.settings-desc { flex: 1 1 200px; max-width: 240px; display: flex; flex-direction: column; gap: 6px; }
.settings-desc .desc { font-size: 12px; color: var(--mut); line-height: 1.5; }
.settings-fields { flex: 999 1 360px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.voice-fields { display: flex; flex-direction: column; gap: 14px; transition: opacity 0.15s; }
.voice-fields.off { opacity: 0.45; }
.vars { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 11px; color: var(--dim); }
.vars code { font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--card2); color: var(--mut); cursor: pointer; }
.vars code:hover { color: var(--color-text); box-shadow: inset 0 0 0 1px var(--acc); }

/* Selector de voz */
.voice-picker { position: relative; }
.vp-current {
  display: flex; align-items: center; gap: 10px; background: var(--pg); box-shadow: inset 0 0 0 1px var(--line);
  border-radius: 8px; padding: 7px 10px 7px 7px; cursor: pointer; outline: none;
}
.vp-current:hover, .vp-current[aria-expanded="true"] { box-shadow: inset 0 0 0 1px var(--dim); }
.vp-current:focus-visible { box-shadow: var(--focus); }
.vp-current-label { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.vp-current-label strong { font-size: 13px; font-weight: 600; color: var(--color-text); white-space: nowrap; }
.vp-desc { font-size: 12px; color: var(--mut); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vp-caret { color: var(--mut); }
.vp-model { font-size: 10px; padding: 1px 6px; border-radius: 5px; background: var(--card2); color: var(--mut); white-space: nowrap; }
.vp-model.hd { background: oklch(0.6 0.2 275 / 0.18); color: var(--acc-hi); }
.vp-play {
  width: 28px; height: 28px; flex-shrink: 0; display: grid; place-items: center; border: 0; border-radius: 7px;
  background: var(--card2); color: var(--color-text); cursor: pointer; font-size: 12px; padding: 0;
}
.vp-play:hover, .vp-play.playing { background: var(--acc); }
.vp-play.loading i { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.vp-panel {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px);
  background: var(--card); border-radius: 10px; overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--line), 0 18px 40px rgb(0 0 0 / 0.5);
}
.vp-filters { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; padding: 8px; box-shadow: inset 0 -1px 0 var(--line); }
.vp-filters input, .vp-filters select { padding-top: 7px !important; padding-bottom: 7px !important; font-size: 12px !important; }
.vp-list { list-style: none; margin: 0; padding: 4px; max-height: 340px; overflow-y: auto; }
.vp-group {
  position: sticky; top: -4px; z-index: 1; background: var(--card); padding: 10px 8px 4px;
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim);
}
.vp-item { display: flex; align-items: center; gap: 10px; padding: 5px 8px 5px 5px; border-radius: 7px; cursor: pointer; }
.vp-item:hover { background: var(--card2); }
.vp-item.selected { background: oklch(0.6 0.2 275 / 0.14); box-shadow: inset 2px 0 0 var(--acc); }
.vp-item-name { font-size: 13px; font-weight: 500; flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.vp-item .ph-check { color: var(--acc-hi); }
.vp-empty { padding: 14px; color: var(--dim); font-size: 12px; }

/* ---------- Historial ---------- */
.table-card { overflow-x: auto; }
.hist-row {
  display: grid; grid-template-columns: 110px minmax(0, 1fr) 90px minmax(0, 1.6fr); gap: 16px; align-items: center;
  padding: 14px 18px; font-size: 13px; min-width: 640px;
}
.hist-head { padding: 11px 18px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); box-shadow: inset 0 -1px 0 var(--line); }
#hist-body .hist-row:hover { background: var(--card2); }
.hist-when { display: flex; flex-direction: column; gap: 2px; font-variant-numeric: tabular-nums; }
.hist-when > :last-child, .hist-ev-text > :last-child { font-size: 11px; color: var(--dim); }
.hist-ev { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hist-ev .tile { width: 28px; height: 28px; border-radius: 7px; font-size: 14px; }
.hist-ev-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hist-state { display: flex; align-items: flex-start; gap: 10px; }
.pill { flex-shrink: 0; display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 6px; }
.pill.err { background: oklch(0.7 0.17 25 / 0.14); color: var(--err); }
.pill.ok { background: oklch(0.76 0.15 150 / 0.14); color: var(--ok); }
.hist-err { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hist-err > span { font-size: 12px; color: var(--mut); line-height: 1.45; }
.link-btn { align-self: flex-start; display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--acc-hi); }
.hist-empty { padding: 28px 18px; color: var(--dim); text-align: center; }

/* ---------- Diálogo de evento ---------- */
.dialog {
  padding: 0; border: 0; border-radius: 14px; background: var(--card); color: var(--color-text);
  width: min(680px, calc(100vw - 24px)); max-height: calc(100vh - 24px);
  box-shadow: inset 0 0 0 1px var(--line), 0 30px 80px rgb(0 0 0 / 0.55);
}
.dialog::backdrop { background: oklch(0.1 0.01 275 / 0.7); backdrop-filter: blur(3px); }
.dialog-form { display: flex; flex-direction: column; max-height: calc(100vh - 24px); }
.dialog-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 14px; box-shadow: inset 0 -1px 0 var(--line); }
.dialog-head h2 { font-size: 16px; font-weight: 600; flex: 1; }
.dialog-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; box-shadow: inset 0 1px 0 var(--line); }
.day-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.day-chip { position: relative; }
.day-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.day-chip span {
  display: block; font-size: 12px; padding: 6px 11px; border-radius: 7px; color: var(--mut);
  background: var(--pg); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer;
}
.day-chip input:checked + span { background: oklch(0.6 0.2 275 / 0.18); color: var(--color-text); box-shadow: inset 0 0 0 1px var(--acc); }
.day-chip input:focus-visible + span { box-shadow: var(--focus); }
.gen-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: var(--mut); margin-top: -4px; }
.gen-row input { width: 90px !important; padding: 6px 8px !important; }
.switches { display: flex; flex-wrap: wrap; gap: 10px 24px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(16px); z-index: 100;
  background: var(--card2); box-shadow: inset 0 0 0 1px var(--acc), 0 12px 30px rgb(0 0 0 / 0.45);
  padding: 10px 16px; border-radius: 10px; font-size: 13px; max-width: calc(100vw - 32px);
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; overflow-wrap: anywhere;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { box-shadow: inset 0 0 0 1px var(--err), 0 12px 30px rgb(0 0 0 / 0.45); }

/* ---------- Móvil: el menú lateral pasa a barra inferior ---------- */
@media (max-width: 760px) {
  .mobile-only { display: inline-flex !important; }
  .sidebar {
    position: fixed; z-index: 40; top: auto; bottom: 0; left: 0; right: 0; width: auto; height: auto;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); gap: 0; overflow: visible;
    box-shadow: inset 0 1px 0 var(--line);
  }
  .sidebar > :not(.nav) { display: none; }
  .nav { flex-direction: row; justify-content: space-around; }
  .nav .side-label { display: none; }
  .nav-item { flex-direction: column; gap: 3px; padding: 6px 4px; font-size: 10px; flex: 1; position: relative; }
  .nav-item > span:first-of-type { flex: none; }
  .nav-item i { font-size: 20px; }
  .nav-item.active { box-shadow: inset 0 0 0 1px var(--line), inset 0 2px 0 var(--acc); }
  .nav-count, .nav-alert { position: absolute; top: 3px; right: calc(50% - 22px); }
  .nav-count { font-size: 9px; min-width: 0; padding: 0 4px; }
  .main { padding-bottom: 72px; }
  .topbar { padding: 10px 16px; gap: 10px; }
  .crumbs #crumb-guild, .crumbs i, .vdiv, .bot-chip-text { display: none; }
  .crumb-cur { font-size: 15px; font-weight: 600; }
  .screen { padding: 20px 16px 32px; }
}
