/* Killas · Panel de soporte — tema oscuro inspirado en Discord */
:root {
  --bg-0: #1e1f22;
  --bg-1: #2b2d31;
  --bg-2: #313338;
  --bg-3: #383a40;
  --bg-4: #404249;
  --line: #3f4147;
  --line-soft: #35373c;
  --text: #dbdee1;
  --text-strong: #f2f3f5;
  --muted: #949ba4;
  --faint: #6d6f78;
  --accent: #5865f2;
  --accent-hover: #4752c4;
  --accent-soft: rgba(88, 101, 242, .16);
  --green: #23a55a;
  --green-soft: rgba(35, 165, 90, .16);
  --yellow: #f0b232;
  --yellow-soft: rgba(240, 178, 50, .16);
  --red: #f23f43;
  --red-soft: rgba(242, 63, 67, .15);
  --orange: #f0a020;
  --blue: #00a8fc;
  --note: #f0b232;
  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 8px 24px rgba(0, 0, 0, .35);
  --font: "gg sans", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: Consolas, "Cascadia Mono", "SFMono-Regular", Menlo, monospace;
  --sidebar-w: 240px;
  --topbar-h: 56px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg-2);
  color: var(--text);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: #00a8fc; text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--text-strong); margin: 0; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 650; }
h4 { font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); }
p { margin: 0 0 8px; }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: #fff; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--bg-0) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--bg-0); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }

/* ───────────── Botones ───────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 6px 14px;
  border: 0; border-radius: var(--radius-sm);
  background: var(--bg-4); color: var(--text-strong);
  font: 500 14px/1.2 var(--font); cursor: pointer; white-space: nowrap;
  transition: background .12s, opacity .12s;
  text-decoration: none;
}
.btn:hover { background: #4e5058; text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #1a8b4b; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #c7302f; }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--bg-3); }
.btn-outline { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--text); }
.btn-outline:hover { background: var(--bg-3); }
.btn-sm { min-height: 28px; padding: 3px 10px; font-size: 13px; }
.btn-xs { min-height: 24px; padding: 2px 8px; font-size: 12px; }
.btn-icon { width: 34px; padding: 0; }
.btn-block { width: 100%; }
.btn .spin { width: 14px; height: 14px; }
.btn-discord { background: #5865f2; color: #fff; min-height: 42px; font-size: 15px; }
.btn-discord:hover { background: var(--accent-hover); }

/* ───────────── Formularios ───────────── */
input[type="text"], input[type="search"], input[type="number"], input[type="password"], input[type="url"],
input[type="date"], input[type="datetime-local"], input[type="time"], input:not([type]), select, textarea {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  background: var(--bg-0);
  color: var(--text-strong);
  border: 1px solid var(--bg-0);
  border-radius: var(--radius-sm);
  font: 14px/1.4 var(--font);
  transition: border-color .12s;
}
input:hover, select:hover, textarea:hover { border-color: #111214; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
textarea { min-height: 90px; resize: vertical; }
select { cursor: pointer; }
select[multiple] { min-height: 120px; padding: 4px; }
input[type="color"] { width: 44px; height: 36px; padding: 2px; background: var(--bg-0); border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; cursor: pointer; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[readonly] { color: var(--muted); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > label, .field-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); }
.field .hint, .hint { font-size: 12.5px; color: var(--muted); }
.field-inline { flex-direction: row; align-items: center; gap: 10px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check-list { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.input-group { display: flex; gap: 6px; align-items: center; }
.input-group > input, .input-group > select { flex: 1; min-width: 0; }
.color-field { display: flex; gap: 6px; align-items: center; }
.color-field input[type="text"] { width: 110px; font-family: var(--mono); }

/* Interruptor */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 40px; height: 24px; border-radius: 12px; background: #80848e; position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + .track { opacity: .5; }

/* ───────────── Login ───────────── */
.login-screen {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(1200px 600px at 20% -10%, rgba(88, 101, 242, .35), transparent 60%),
              radial-gradient(900px 500px at 110% 110%, rgba(35, 165, 90, .18), transparent 60%), var(--bg-0);
}
.login-card { width: 100%; max-width: 420px; background: var(--bg-2); border-radius: 12px; padding: 32px 28px; box-shadow: var(--shadow); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.login-card .sub { color: var(--muted); margin-bottom: 22px; }
.login-divider { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12px; text-transform: uppercase; margin: 18px 0; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.login-error { background: var(--red-soft); color: #ffb3b5; border-left: 3px solid var(--red); padding: 10px 12px; border-radius: var(--radius-sm); margin-bottom: 16px; }
.login-foot { margin-top: 20px; font-size: 12px; color: var(--faint); text-align: center; }
.logo-mark { width: 44px; height: 44px; border-radius: 12px; background: var(--accent); display: grid; place-items: center; font-size: 22px; flex: none; color: #fff; font-weight: 800; }

/* ───────────── Layout ───────────── */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  background: var(--bg-1); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 40;
}
.sidebar-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 10px; border-bottom: 1px solid var(--bg-0); min-height: var(--topbar-h); }
.sidebar-head .logo-mark { width: 34px; height: 34px; font-size: 16px; border-radius: 10px; }
.brand-name { font-weight: 800; color: var(--text-strong); font-size: 15px; line-height: 1.1; }
.brand-sub { font-size: 11.5px; color: var(--muted); }
.guild-switch { padding: 10px 10px 4px; }
.guild-switch select { background: var(--bg-0); font-weight: 600; }
.guild-card { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; background: var(--bg-0); }
.guild-card img, .guild-icon { width: 26px; height: 26px; border-radius: 50%; flex: none; background: var(--bg-3); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.guild-card .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { padding: 8px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-section { font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .03em; padding: 12px 10px 4px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px;
  color: var(--muted); font-weight: 500; text-decoration: none;
}
.nav a .ico { width: 22px; text-align: center; font-size: 16px; flex: none; }
.nav a:hover { background: var(--bg-3); color: var(--text); }
.nav a.active { background: var(--bg-4); color: var(--text-strong); }
.nav a .count { margin-left: auto; background: var(--red); color: #fff; border-radius: 10px; padding: 0 6px; font-size: 11px; font-weight: 700; min-width: 18px; text-align: center; }
.sidebar-foot { padding: 10px; border-top: 1px solid var(--bg-0); background: #232428; display: flex; align-items: center; gap: 8px; }
.sidebar-foot .who { flex: 1; min-width: 0; }
.sidebar-foot .who .n { font-weight: 600; color: var(--text-strong); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot .who .s { font-size: 11.5px; color: var(--muted); }

.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; overflow: hidden; position: relative; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 24px; height: 24px; font-size: 11px; }
.avatar-lg { width: 64px; height: 64px; font-size: 24px; }
.avail-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; background: var(--faint); }
.avail-dot.available { background: var(--green); }
.avail-dot.busy { background: var(--yellow); }
.avail-dot.offline { background: var(--red); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h); display: flex; align-items: center; gap: 10px; padding: 0 16px;
  background: var(--bg-2); border-bottom: 1px solid var(--bg-0);
  position: sticky; top: 0; z-index: 30; box-shadow: 0 1px 0 rgba(0,0,0,.2);
}
.topbar .menu-btn { display: none; }
.topbar .title { font-weight: 700; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.topbar .spacer { flex: 1; }
.top-search { position: relative; width: min(360px, 40vw); }
.top-search input { background: var(--bg-0); min-height: 32px; padding-left: 30px; font-size: 13px; }
.top-search .ico { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 13px; pointer-events: none; }
.avail-select { display: flex; align-items: center; gap: 6px; background: var(--bg-0); border-radius: 16px; padding: 2px 4px 2px 10px; }
.avail-select select { background: transparent; border: 0; min-height: 28px; padding: 2px 4px; width: auto; font-size: 13px; }
.bell { position: relative; }
.bell .badge-count { position: absolute; top: 1px; right: 0; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 9px; padding: 0 5px; min-width: 17px; text-align: center; line-height: 16px; border: 2px solid var(--bg-2); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; }
.live-dot.on { background: var(--red); box-shadow: 0 0 0 0 rgba(242,63,67,.6); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(242,63,67,.55); } 70% { box-shadow: 0 0 0 7px rgba(242,63,67,0); } 100% { box-shadow: 0 0 0 0 rgba(242,63,67,0); } }

.view { padding: 20px 24px 60px; max-width: 1400px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .grow { flex: 1; min-width: 200px; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.backlink { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.backlink:hover { color: var(--text); text-decoration: none; }

.scrim { display: none; }

/* ───────────── Tarjetas / grids ───────────── */
.card { background: var(--bg-1); border-radius: var(--radius); padding: 16px; min-width: 0; }
.card + .card { margin-top: 14px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { flex: 1; min-width: 0; }
.card-flat { background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 12px; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.split-wide { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.strong { color: var(--text-strong); font-weight: 600; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.text-green { color: #57f287; } .text-red { color: #ff8a8c; } .text-yellow { color: var(--yellow); }
.pre-wrap { white-space: pre-wrap; word-break: break-word; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--bg-1); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; text-decoration: none; color: inherit; border: 1px solid transparent; }
a.kpi:hover { border-color: var(--line); text-decoration: none; }
.kpi .label { font-size: 12px; color: var(--muted); font-weight: 600; display: flex; gap: 6px; align-items: center; }
.kpi .value { font-size: 26px; font-weight: 750; color: var(--text-strong); line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi .foot { font-size: 12px; color: var(--faint); }

/* ───────────── Badges / pills ───────────── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; background: var(--bg-4); color: var(--text); white-space: nowrap; line-height: 18px; }
.badge-accent { background: var(--accent-soft); color: #aab3ff; }
.badge-green { background: var(--green-soft); color: #6ee49a; }
.badge-yellow { background: var(--yellow-soft); color: #f7cf7a; }
.badge-red { background: var(--red-soft); color: #ff9c9e; }
.badge-grey { background: var(--bg-3); color: var(--muted); }
.badge-outline { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; border-radius: 4px; background: var(--bg-3); color: var(--text); font-size: 12px; line-height: 20px; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }

/* ───────────── Tabs ───────────── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { background: none; border: 0; color: var(--muted); padding: 9px 12px; font: 600 13.5px var(--font); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; margin-bottom: -1px; display: inline-flex; gap: 6px; align-items: center; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text-strong); border-bottom-color: var(--accent); }
.tab .n { background: var(--bg-4); border-radius: 8px; padding: 0 6px; font-size: 11px; }
.seg { display: inline-flex; background: var(--bg-0); border-radius: 6px; padding: 2px; gap: 2px; flex-wrap: wrap; }
.seg button { background: none; border: 0; color: var(--muted); padding: 5px 10px; border-radius: 4px; font: 600 13px var(--font); cursor: pointer; }
.seg button.active { background: var(--bg-4); color: var(--text-strong); }

/* ───────────── Tablas ───────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); font-weight: 700; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: rgba(255, 255, 255, .025); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.ref { font-family: var(--mono); font-weight: 600; color: var(--text-strong); white-space: nowrap; }

/* Listas */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 4px; border-bottom: 1px solid var(--line-soft); min-width: 0; }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { min-width: 0; }
a.list-item { color: inherit; text-decoration: none; }
a.list-item:hover { background: rgba(255,255,255,.02); }
.list-item.unread { background: var(--accent-soft); border-radius: 6px; }
.feed { max-height: 420px; overflow-y: auto; }
.feed .list-item { font-size: 13px; padding: 7px 4px; }
.feed .time { font-family: var(--mono); color: var(--faint); font-size: 12px; flex: none; }
.feed .new { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: var(--accent-soft); } to { background: transparent; } }

/* Filtros */
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; align-items: end; margin-bottom: 14px; }
.filters .field { margin: 0; }
.filters .field > label { font-size: 11px; }
.filters .actions { display: flex; gap: 6px; align-items: center; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

/* Estados vacíos / carga */
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty .big { font-size: 34px; margin-bottom: 8px; }
.empty .t { color: var(--text-strong); font-weight: 600; margin-bottom: 4px; font-size: 15px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px; color: var(--muted); }
.spin { width: 20px; height: 20px; border: 2.5px solid rgba(255,255,255,.15); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--bg-3) 25%, var(--bg-4) 50%, var(--bg-3) 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 4px; height: 14px; }
@keyframes sk { to { background-position: -200% 0; } }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 6px; background: var(--bg-3); border-left: 3px solid var(--faint); font-size: 13.5px; margin-bottom: 12px; }
.notice.info { border-color: var(--accent); background: var(--accent-soft); }
.notice.warn { border-color: var(--yellow); background: var(--yellow-soft); }
.notice.danger { border-color: var(--red); background: var(--red-soft); }
.notice.ok { border-color: var(--green); background: var(--green-soft); }

/* ───────────── Ticket ───────────── */
.ticket-header { background: var(--bg-1); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.ticket-header .top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.ticket-header .subject { color: var(--muted); margin-bottom: 10px; }
.meta-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px 16px; }
.meta-grid .k { font-size: 11.5px; color: var(--faint); text-transform: uppercase; font-weight: 700; letter-spacing: .02em; }
.meta-grid .v { color: var(--text-strong); font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.report-banner { display: flex; gap: 12px; align-items: center; background: linear-gradient(90deg, rgba(242,63,67,.25), rgba(242,63,67,.08)); border: 1px solid rgba(242,63,67,.45); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; }
.report-banner .ico { font-size: 26px; }
.report-banner .who { font-size: 18px; font-weight: 800; color: #fff; }
.actionbar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }

.chat { display: flex; flex-direction: column; gap: 2px; max-height: 62vh; overflow-y: auto; padding: 8px 4px; }
.msg { display: flex; gap: 12px; padding: 6px 10px; border-radius: 6px; }
.msg:hover { background: rgba(0,0,0,.08); }
.msg .body { min-width: 0; flex: 1; }
.msg .head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.msg .author { font-weight: 600; color: var(--text-strong); }
.msg.staff .author { color: #aab3ff; }
.msg .when { font-size: 11.5px; color: var(--faint); }
.msg .content { white-space: normal; word-wrap: break-word; overflow-wrap: anywhere; }
.msg .orig { margin-top: 4px; font-size: 12.5px; color: var(--muted); border-left: 2px solid var(--line); padding-left: 8px; }
.msg .atts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.msg.system { padding: 3px 10px; color: var(--muted); font-size: 13px; }
.msg.system .content { font-style: italic; }
.msg.note { background: rgba(240, 178, 50, .08); border-left: 3px solid var(--note); border-radius: 0 6px 6px 0; }
.msg.note .note-label { font-size: 11px; font-weight: 800; color: var(--note); letter-spacing: .03em; }
.msg.deleted .content { text-decoration: line-through; opacity: .6; }
.day-sep { display: flex; align-items: center; gap: 8px; color: var(--faint); font-size: 12px; font-weight: 600; margin: 10px 0 4px; }
.day-sep::before, .day-sep::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.composer { background: var(--bg-1); border-radius: var(--radius); padding: 12px; margin-top: 12px; }
.composer textarea { min-height: 72px; background: var(--bg-3); border-color: var(--bg-3); }
.composer.note textarea { background: rgba(240,178,50,.07); border-color: rgba(240,178,50,.3); }
.composer .foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.side-panel .card { padding: 14px; }
.side-panel h3 { margin-bottom: 8px; }
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 12px; font-size: 13px; }
.tl-item::before { content: ""; position: absolute; left: -17px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--bg-4); border: 2px solid var(--bg-1); }
.tl-item.accent::before { background: var(--accent); }
.tl-item .t { color: var(--faint); font-size: 11.5px; }
.diff { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; font-family: var(--mono); font-size: 12px; }
.diff .b { background: var(--red-soft); color: #ffb3b5; padding: 0 5px; border-radius: 3px; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.diff .a { background: var(--green-soft); color: #9ff0bf; padding: 0 5px; border-radius: 3px; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.ev-card { background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.ev-card .ico { font-size: 22px; }

/* ───────────── Vista previa de Discord ───────────── */
.dc-preview { background: #313338; border-radius: var(--radius); padding: 14px 14px 14px 12px; border: 1px solid var(--line-soft); }
.dc-msg { display: flex; gap: 14px; }
.dc-msg .avatar { width: 40px; height: 40px; }
.dc-msg .body { min-width: 0; flex: 1; }
.dc-msg .name { font-weight: 600; color: var(--text-strong); display: flex; align-items: center; gap: 6px; }
.dc-bot-tag { background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; border-radius: 3px; padding: 0 4px; line-height: 15px; }
.dc-msg .ts { color: var(--faint); font-size: 12px; font-weight: 400; }
.dc-content { margin: 2px 0 4px; }
.dc-embed {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px 16px;
  max-width: 520px; background: #2b2d31; border-left: 4px solid #1e1f22; border-radius: 4px;
  padding: 8px 16px 16px 12px; margin-top: 6px; font-size: 14px;
}
.dc-embed.has-thumb { grid-template-columns: minmax(0, 1fr) auto; }
.dc-embed .e-main { grid-column: 1; grid-row: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
.dc-embed .e-author { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--text-strong); }
.dc-embed .e-author img { width: 24px; height: 24px; border-radius: 50%; }
.dc-embed .e-title { font-weight: 700; color: var(--text-strong); font-size: 15.5px; }
.dc-embed .e-desc { color: var(--text); font-size: 14px; }
.dc-embed .e-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
.dc-embed .e-field { grid-column: 1 / -1; min-width: 0; }
.dc-embed .e-field.inline { grid-column: auto; }
.dc-embed .e-field .fn { font-weight: 700; color: var(--text-strong); font-size: 13.5px; margin-bottom: 2px; }
.dc-embed .e-field .fv { font-size: 13.5px; }
.dc-embed .e-thumb { grid-column: 2; grid-row: 1; padding-top: 8px; }
.dc-embed .e-thumb img { width: 80px; height: 80px; object-fit: cover; border-radius: 4px; }
.dc-embed .e-image { grid-column: 1 / -1; }
.dc-embed .e-image img { max-width: 100%; max-height: 300px; border-radius: 4px; display: block; }
.dc-embed .e-footer { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.dc-embed .e-footer img { width: 20px; height: 20px; border-radius: 50%; }
.dc-md strong { color: var(--text-strong); }
.dc-md .u { text-decoration: underline; }
.dc-md .s { text-decoration: line-through; }
.dc-md code { background: #1e1f22; border-radius: 3px; padding: 1px 4px; font-size: 85%; }
.dc-md pre { background: #1e1f22; border: 1px solid #1a1b1e; border-radius: 4px; padding: 8px; margin: 4px 0; white-space: pre-wrap; overflow-x: auto; }
.dc-md pre code { background: none; padding: 0; }
.dc-md blockquote { margin: 2px 0; padding: 0 0 0 12px; border-left: 4px solid #4e5058; }
.dc-md .subtext { font-size: 12px; color: var(--muted); display: block; }
.dc-md .h1 { font-size: 20px; font-weight: 700; color: var(--text-strong); display: block; margin: 4px 0; }
.dc-md .h2 { font-size: 17px; font-weight: 700; color: var(--text-strong); display: block; margin: 4px 0; }
.dc-md .h3 { font-size: 15px; font-weight: 700; color: var(--text-strong); display: block; margin: 4px 0; }
.dc-md .spoiler { background: #1e1f22; color: transparent; border-radius: 3px; cursor: pointer; }
.dc-md .spoiler:hover { color: inherit; }
.mention { background: rgba(88, 101, 242, .3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; font-weight: 500; }
.dc-time { background: rgba(255,255,255,.06); border-radius: 3px; padding: 0 2px; }
.dc-components { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; max-width: 520px; }
.dc-row { display: flex; flex-wrap: wrap; gap: 8px; }
.dc-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 2px 16px; border-radius: 3px; font-size: 14px; font-weight: 500; color: #fff; background: #4e5058; cursor: default; user-select: none; }
.dc-btn.s1 { background: #5865f2; }
.dc-btn.s2 { background: #4e5058; }
.dc-btn.s3 { background: #248046; }
.dc-btn.s4 { background: #da373c; }
.dc-btn.s5 { background: #4e5058; }
.dc-btn.disabled { opacity: .5; }
.dc-select { width: 100%; max-width: 420px; background: #1e1f22; border: 1px solid #1e1f22; border-radius: 4px; padding: 8px 12px; display: flex; justify-content: space-between; align-items: center; color: var(--muted); cursor: pointer; }
.dc-select-menu { background: #2b2d31; border: 1px solid #1e1f22; border-radius: 4px; max-width: 420px; margin-top: 4px; }
.dc-opt { display: flex; gap: 10px; padding: 8px 12px; align-items: center; }
.dc-opt + .dc-opt { border-top: 1px solid #1e1f22; }
.dc-opt .d { font-size: 12px; color: var(--muted); }
.sig-example { background: var(--bg-0); border-radius: 6px; padding: 10px 12px; font-size: 14px; }

/* ───────────── Modal ───────────── */
.modal-root { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .7); animation: fade .12s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--bg-2); border-radius: 10px; width: 100%; max-width: 480px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: var(--shadow); animation: pop .14s ease-out; }
.modal.wide { max-width: 760px; }
.modal.xwide { max-width: 1000px; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.modal-head { padding: 18px 18px 6px; display: flex; align-items: flex-start; gap: 10px; }
.modal-head h2 { flex: 1; }
.modal-body { padding: 8px 18px 16px; overflow-y: auto; }
.modal-foot { padding: 12px 18px; background: var(--bg-1); border-radius: 0 0 10px 10px; display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.secret-blocks { font-family: var(--mono); font-size: 17px; letter-spacing: .08em; background: var(--bg-0); border-radius: 6px; padding: 12px; text-align: center; word-break: break-all; color: var(--text-strong); }
.code-input { font-family: var(--mono); font-size: 24px !important; letter-spacing: .5em; text-align: center; }
.member-results { display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow-y: auto; margin-top: 8px; }
.member-results button { display: flex; align-items: center; gap: 10px; padding: 7px 8px; background: none; border: 0; border-radius: 6px; color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.member-results button:hover, .member-results button:focus-visible { background: var(--bg-4); }

/* ───────────── Toasts ───────────── */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--bg-0); color: var(--text-strong); border-left: 4px solid var(--accent); padding: 10px 14px; border-radius: 6px; box-shadow: var(--shadow); font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start; animation: slidein .18s ease-out; cursor: pointer; }
.toast.ok { border-color: var(--green); }
.toast.error { border-color: var(--red); }
.toast.warn { border-color: var(--yellow); }
.toast .t { font-weight: 700; }
.toast.out { opacity: 0; transform: translateX(20px); transition: all .2s; }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }

/* ───────────── Gráficas ───────────── */
.chart { width: 100%; height: auto; display: block; }
.chart .bar { fill: var(--accent); }
.chart .bar:hover { fill: #7984f5; }
.chart .axis { fill: var(--faint); font-size: 10px; font-family: var(--font); }
.chart .grid-line { stroke: var(--line-soft); stroke-width: 1; }
.chart .val { fill: var(--muted); font-size: 10px; font-family: var(--font); }
.hbar { display: grid; grid-template-columns: minmax(90px, 160px) 1fr 44px; gap: 8px; align-items: center; font-size: 13px; padding: 3px 0; }
.hbar .track { display: block; height: 10px; background: var(--bg-3); border-radius: 5px; overflow: hidden; }
.hbar .fill { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.hbar .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }

/* ───────────── Configuración ───────────── */
.cfg-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: start; }
.cfg-nav { background: var(--bg-1); border-radius: var(--radius); padding: 6px; position: sticky; top: calc(var(--topbar-h) + 12px); max-height: calc(100vh - var(--topbar-h) - 24px); overflow-y: auto; }
.cfg-nav a { display: flex; gap: 8px; align-items: center; padding: 7px 10px; border-radius: 5px; color: var(--muted); font-size: 13.5px; text-decoration: none; }
.cfg-nav a:hover { background: var(--bg-3); color: var(--text); }
.cfg-nav a.active { background: var(--bg-4); color: var(--text-strong); font-weight: 600; }
.cfg-nav .grp { font-size: 10.5px; font-weight: 800; color: var(--faint); text-transform: uppercase; padding: 10px 10px 3px; letter-spacing: .04em; }
.cfg-nav-mobile { display: none; margin-bottom: 12px; }
.cfg-section { background: var(--bg-1); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.cfg-section > h2 { margin-bottom: 4px; }
.cfg-section > .desc { color: var(--muted); margin-bottom: 16px; }
.cfg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.cfg-grid .full { grid-column: 1 / -1; }
.savebar {
  position: sticky; bottom: 12px; z-index: 20; margin-top: 16px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--bg-0); border-radius: var(--radius); padding: 10px 14px; box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.savebar .msg { flex: 1; min-width: 160px; font-size: 13.5px; }
.savebar.dirty { border-color: var(--yellow); }
.lang-tabs { display: flex; gap: 2px; margin-bottom: 6px; flex-wrap: wrap; }
.lang-tabs button { background: var(--bg-3); border: 0; color: var(--muted); padding: 3px 9px; border-radius: 4px; font: 600 12px var(--font); cursor: pointer; }
.lang-tabs button.active { background: var(--accent); color: #fff; }
.lang-tabs button.empty-lang { opacity: .6; font-style: italic; }
.builder-item { background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: var(--radius); margin-bottom: 10px; }
.builder-item > .bi-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 10px 12px; cursor: pointer; user-select: none; }
.builder-item > .bi-head .t { flex: 1; min-width: 140px; font-weight: 600; color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.builder-item > .bi-body { padding: 4px 12px 12px; border-top: 1px solid var(--line-soft); }
.builder-item.disabled > .bi-head .t { opacity: .55; }
.sub-item { background: var(--bg-1); border-radius: 6px; padding: 10px; margin-bottom: 8px; border: 1px solid var(--line-soft); }
.chip-select { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 14px; background: var(--bg-3); color: var(--text); font-size: 13px; border: 1px solid transparent; cursor: pointer; user-select: none; font-family: var(--font); }
.chip:hover { border-color: var(--line); }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: #fff; }
.chip .x { opacity: .6; }
.picker { position: relative; }
.picker-box { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; background: var(--bg-0); border-radius: var(--radius-sm); padding: 4px 6px; min-height: 36px; }
.picker-box input { background: transparent; border: 0; min-height: 26px; padding: 2px 4px; flex: 1; min-width: 100px; width: auto; }
.picker-box input:focus { border: 0; }
.picker-drop { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--bg-0); border: 1px solid var(--line); border-radius: 6px; max-height: 240px; overflow-y: auto; z-index: 60; box-shadow: var(--shadow); }
.picker-drop button { display: flex; width: 100%; gap: 8px; align-items: center; padding: 7px 10px; background: none; border: 0; color: var(--text); font: 13.5px var(--font); text-align: left; cursor: pointer; }
.picker-drop button:hover, .picker-drop button.hl { background: var(--bg-4); }
.picker-drop .grp { font-size: 11px; color: var(--faint); padding: 6px 10px 2px; text-transform: uppercase; font-weight: 700; }
.pchip { display: inline-flex; align-items: center; gap: 4px; background: var(--bg-3); border-radius: 4px; padding: 1px 4px 1px 8px; font-size: 13px; }
.pchip button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 4px; font-size: 14px; line-height: 1; }
.pchip button:hover { color: var(--text-strong); }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 6px; }
.perm-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; padding: 8px 10px; background: var(--bg-2); border-radius: 6px; font-size: 13px; }
.perm-row .grow { min-width: 170px; }
.perm-row .tri { margin-left: auto; }
.perm-row .k { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.tri { display: inline-flex; background: var(--bg-0); border-radius: 5px; padding: 2px; flex: none; }
.tri button { background: none; border: 0; color: var(--faint); padding: 2px 7px; border-radius: 3px; cursor: pointer; font: 600 11.5px var(--font); }
.tri button.on.inh { background: var(--bg-4); color: var(--text); }
.tri button.on.grant { background: var(--green); color: #fff; }
.tri button.on.deny { background: var(--red); color: #fff; }
.eff { width: 18px; text-align: center; flex: none; }
.rule { background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 12px; margin-bottom: 12px; }
.rule-step { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px 0; border-top: 1px dashed var(--line); }
.rule-step:first-of-type { border-top: 0; }
.rule-step .lbl { font-weight: 800; font-size: 12px; letter-spacing: .04em; padding-top: 8px; }
.rule-step .lbl.when { color: #aab3ff; } .rule-step .lbl.if { color: var(--yellow); } .rule-step .lbl.then { color: #6ee49a; }
.rule-line { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.rule-line > select, .rule-line > input { width: auto; min-width: 120px; flex: 1; }
.day-row { display: grid; grid-template-columns: 110px 60px 1fr 1fr; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.kv { display: grid; grid-template-columns: 160px minmax(0,1fr); gap: 6px 12px; font-size: 13.5px; }
.kv .k { color: var(--muted); }
.json { font-family: var(--mono); font-size: 12px; background: var(--bg-0); border-radius: 6px; padding: 10px; white-space: pre-wrap; word-break: break-word; max-height: 360px; overflow: auto; }

/* ───────────── Mantenimiento / servicios ───────────── */
.progress { position: relative; height: 12px; background: var(--bg-0); border-radius: 6px; overflow: hidden; }
.progress .fill { height: 100%; background: linear-gradient(90deg, var(--yellow), #f7d774); border-radius: 6px; transition: width .3s; }
.progress .lbl { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 10px; font-weight: 700; color: var(--text-strong); }
.progress.big { height: 22px; border-radius: 11px; }
.progress.big .lbl { font-size: 12px; }
.mnt-status { border-radius: var(--radius); padding: 20px; background: var(--bg-1); border: 1px solid var(--line); }
.mnt-status.ok { border-left: 5px solid var(--green); }
.mnt-status.active { border-left: 5px solid var(--yellow); background: linear-gradient(90deg, rgba(240,178,50,.12), var(--bg-1) 60%); }
.mnt-status .big-ico { font-size: 38px; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.svc { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line-soft); }
.svc:last-child { border-bottom: 0; }
.svc .st { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--faint); }
.svc .st.up { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.svc .st.down { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.cb-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 44px; padding: 6px; border: 1px dashed var(--line); border-radius: 6px; background: var(--bg-2); }
.cb-row.over { border-color: var(--accent); background: var(--accent-soft); }
.cb-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 8px; border-radius: 4px; background: var(--bg-4); font-size: 13px; cursor: grab; user-select: none; }
.cb-chip.dragging { opacity: .4; }
.cb-chip button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 3px; font-size: 12px; }
.cb-chip button:hover { color: var(--text-strong); }

/* Acción sensible */
.sensitive-confirm { border: 1px solid rgba(242,63,67,.5); background: linear-gradient(180deg, rgba(242,63,67,.14), rgba(242,63,67,.04)); border-radius: var(--radius); padding: 16px; }
.sensitive-confirm .sc-title { font-size: 18px; font-weight: 800; color: #ff9c9e; margin-bottom: 6px; }
.sensitive-confirm .sc-what { font-size: 17px; font-weight: 700; color: var(--text-strong); margin-top: 4px; }

/* ───────────── Responsive ───────────── */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .split-wide { grid-template-columns: minmax(0, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 35; }
  .topbar .menu-btn { display: inline-flex; }
  .cfg-layout { grid-template-columns: minmax(0, 1fr); }
  .cfg-nav { display: none; }
  .cfg-nav-mobile { display: block; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .view { padding: 16px 16px 60px; }
}
@media (max-width: 640px) {
  #mnt-badge { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
  .top-search { display: none; }
  .topbar .search-btn { display: inline-flex !important; }
  .topbar { padding: 0 10px; gap: 6px; }
  .avail-select .lbl { display: none; }
  .grid-2, .grid-3, .grid-4, .cfg-grid { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 10px 12px; }
  .kpi .value { font-size: 21px; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dc-embed.has-thumb { grid-template-columns: minmax(0, 1fr) 64px; }
  .dc-embed .e-thumb img { width: 64px; height: 64px; }
  .dc-embed .e-fields { grid-template-columns: minmax(0, 1fr); }
  .day-row { grid-template-columns: 1fr 50px; }
  .day-row input { grid-column: span 1; }
  .rule-step { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .rule-step .lbl { padding-top: 0; }
  .kv { grid-template-columns: minmax(0, 1fr); }
  .kv .k { margin-top: 6px; }
  .hbar { grid-template-columns: 90px 1fr 36px; }
  .savebar { padding: 8px 10px; bottom: 8px; }
  .savebar .msg { font-size: 12.5px; min-width: 0; flex-basis: 100%; }
  .savebar .btn { flex: 1; }
  .toasts { left: 16px; right: 16px; max-width: none; }
  .modal-root { padding: 8px; }
  .table.responsive thead { display: none; }
  .table.responsive tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  .table.responsive td { display: flex; gap: 10px; border: 0; padding: 3px 8px; }
  .table.responsive td::before { content: attr(data-l); color: var(--faint); font-size: 11.5px; min-width: 88px; text-transform: uppercase; font-weight: 700; padding-top: 2px; }
  .table.responsive td.num { text-align: left; }
}
.search-btn { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Acceso: idioma y acceso de emergencia */
.login-card { position: relative; }
.login-lang { position: absolute; top: 14px; right: 14px; }
.lang-select { width: auto; min-height: 30px; padding: 3px 8px; font-size: 13px; background: var(--bg-0); }
.login-emergency { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.login-emergency summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.login-emergency summary:hover { color: var(--text); }
@media (max-width: 640px) { .login-lang { position: static; margin: -6px 0 12px; } }

/* Panel lateral (drawer) */
.modal-root.drawer-root { place-items: stretch end; padding: 0; }
.modal.drawer { max-width: 460px; height: 100vh; max-height: 100vh; border-radius: 0; animation: drawer-in .18s ease-out; }
.modal.drawer .modal-foot { border-radius: 0; }
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } }
@media (max-width: 640px) { .modal.drawer { max-width: 100%; } }

/* Gráfica de dos series */
.chart .bar.join { fill: var(--accent); }
.chart .bar.leave { fill: #e8833a; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: -1px; }
.mtype { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.warn-age { color: var(--yellow); font-weight: 700; }

/* Respuesta de Discord (vista previa de menciones) */
.dc-reply { background: #313338; border-radius: var(--radius); border: 1px solid var(--line-soft); padding: 10px 14px 4px; }
.dc-reply .dc-preview { border: 0; padding: 4px 0 10px; background: transparent; }
.dc-reply-ref { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-left: 22px; min-width: 0; }
.dc-reply-ref .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-reply-ref .curve { width: 26px; height: 12px; border-left: 2px solid #4e5058; border-top: 2px solid #4e5058; border-top-left-radius: 6px; margin-top: 8px; flex: none; margin-left: -6px; }

/* Aviso global (raid) */
.global-banner:empty { display: none; }
.global-banner { padding: 12px 24px 0; max-width: 1400px; width: 100%; margin: 0 auto; }
.global-banner .notice { margin: 0; }
@media (max-width: 900px) { .global-banner { padding: 12px 16px 0; } }

/* Comunidad: mapa de calor, barras por hora, cohortes */
.heat-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.heat { border-collapse: separate; border-spacing: 2px; width: 100%; min-width: 560px; table-layout: fixed; }
.heat th { font: 600 11px var(--font); color: var(--faint, var(--muted)); text-align: center; padding: 0; }
.heat thead th:first-child, .heat tbody th { width: 44px; text-align: right; padding-right: 6px; text-transform: capitalize; }
.heat td { height: 20px; border-radius: 3px; background: color-mix(in srgb, var(--accent) calc(var(--a, 0) * 100%), var(--bg-0)); }
.heat td:hover { outline: 1px solid var(--text-strong); }
.hour-bars { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 2px; align-items: end; height: 80px; }
.hour-bars .hb { height: 100%; display: flex; align-items: flex-end; }
.hour-bars .hb span { display: block; width: 100%; background: var(--accent); border-radius: 2px 2px 0 0; opacity: .75; }
.hour-bars .hb.peak span { background: var(--yellow); opacity: 1; }
.hour-axis { display: flex; justify-content: space-between; margin-top: 4px; }
.cohort-cell { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.cohort-bar { flex: 1; height: 8px; background: var(--bg-0); border-radius: 4px; overflow: hidden; display: block; }
.cohort-bar span { display: block; height: 100%; background: var(--green); border-radius: 4px; }
.mood { margin-left: 4px; }

/* Votaciones del Staff */
.vote-opts { display: grid; gap: 8px; }
.vote-opt { display: block; width: 100%; text-align: left; background: var(--bg-0); border: 1px solid var(--line-soft, var(--line)); border-radius: 8px; padding: 9px 12px; color: var(--text); font: inherit; }
.vote-btn { cursor: pointer; }
.vote-btn:hover { border-color: var(--accent); }
.vote-btn.mine { border-color: var(--accent); background: var(--accent-soft); }
.vote-opt .progress { height: 6px; }

/* Referidos */
.ref-layout { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.row-pending td { background: var(--yellow-soft); }
@media (max-width: 1000px) { .ref-layout { grid-template-columns: minmax(0, 1fr); } }

/* Encuestas de opinión */
.survey-q { border: 1px solid var(--line-soft, var(--line)); }
.survey-opts { margin-top: 8px; display: grid; gap: 8px; }
.survey-opt { background: var(--bg-0); border-radius: 8px; padding: 8px 10px; }
.survey-opt .field { margin-bottom: 0; }
/* En rejillas la separación la da el gap, no el margen entre tarjetas */
.grid > .card + .card, .ref-layout > .card + .card { margin-top: 0; }

/* Market */
.market-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.market-grid > .card + .card { margin-top: 0; }
.mk-card.mk-reported { border-left: 3px solid var(--red); }
.mk-icon { width: 48px; height: 48px; flex: none; image-rendering: pixelated; border-radius: 6px; background: var(--bg-0); object-fit: contain; }
.mk-icon-empty { display: inline-grid; place-items: center; font-size: 22px; }
.mk-name { overflow-wrap: anywhere; }
.mk-price { font-weight: 700; color: var(--yellow); margin: 2px 0; }
.mk-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.mk-opts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.mk-opt { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: var(--bg-0); }
.mk-opt.tier-common { color: var(--text); }
.mk-opt.tier-rare { color: #7db4ff; box-shadow: inset 0 0 0 1px rgba(88, 140, 255, .35); }
.mk-opt.tier-legendary { color: #ffb259; box-shadow: inset 0 0 0 1px rgba(255, 160, 40, .45); }
@media (max-width: 640px) { .market-grid { grid-template-columns: minmax(0, 1fr); } }
