:root {
  --bg: #0a0a0c;
  --bg-2: #0f0f12;
  --panel: #141418;
  --panel-2: #1a1a1f;
  --hover: #1f1f25;
  --line: #24242b;
  --line-2: #2e2e36;
  --text: #ececf0;
  --text-2: #b9bac3;
  --muted: #7d7e89;
  --red: #e3172d;
  --red-2: #ff3a4e;
  --red-soft: rgba(227, 23, 45, .12);
  --red-line: rgba(227, 23, 45, .45);
  --silver: #c8cbd2;
  --green: #2fd17a;
  --head: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  --body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", Consolas, ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--red-2); }
button { font: inherit; color: inherit; }
::selection { background: var(--red); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a2a31; border-radius: 10px; border: 2px solid var(--bg-2); }
::-webkit-scrollbar-track { background: transparent; }

/* =========================== LOGIN =========================== */
.login-page {
  display: grid; place-items: center; padding: 16px; min-height: 100%;
  overflow: hidden; position: relative;
}
.login-bg {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(227, 23, 45, .28), transparent 70%),
    radial-gradient(40% 40% at 50% 110%, rgba(227, 23, 45, .14), transparent 70%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.018) 0 2px, transparent 2px 14px),
    var(--bg);
}
.login-card {
  width: 100%; max-width: 400px; text-align: center;
  background: linear-gradient(180deg, rgba(26,26,31,.92), rgba(16,16,19,.95));
  border: 1px solid var(--line-2); border-top: 2px solid var(--red);
  border-radius: 14px; padding: 36px 32px 26px;
  box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 0 1px rgba(0,0,0,.4);
  backdrop-filter: blur(6px);
  animation: rise .5s ease-out both;
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.login-logo {
  width: 132px; height: 132px; object-fit: contain;
  filter: drop-shadow(0 8px 28px rgba(227, 23, 45, .45));
}
.login-card h1 {
  font: 700 26px/1.1 var(--head); text-transform: uppercase; letter-spacing: .06em;
  margin: 14px 0 6px;
}
.login-sub { color: var(--muted); margin: 0; }
.login-error {
  display: flex; gap: 8px; align-items: center; text-align: left;
  background: var(--red-soft); border: 1px solid var(--red-line); color: #ffb9c0;
  padding: 10px 12px; border-radius: 8px; margin: 18px 0 0; font-size: 13px;
}
.btn-discord {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 24px; padding: 13px 16px; border-radius: 9px;
  background: linear-gradient(180deg, var(--red-2), var(--red));
  color: #fff; text-decoration: none;
  font: 700 15px var(--head); text-transform: uppercase; letter-spacing: .06em;
  box-shadow: 0 8px 24px rgba(227, 23, 45, .35), inset 0 1px 0 rgba(255,255,255,.2);
  transition: transform .12s, box-shadow .12s, filter .12s;
}
.btn-discord:hover { transform: translateY(-1px); filter: brightness(1.08); box-shadow: 0 12px 30px rgba(227, 23, 45, .45), inset 0 1px 0 rgba(255,255,255,.2); }
.btn-discord:active { transform: none; }
.login-foot {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 12px;
}

/* =========================== LAYOUT =========================== */
.layout { display: flex; height: 100vh; height: 100dvh; }

.sidebar {
  width: 264px; flex-shrink: 0; display: flex; flex-direction: column;
  background: var(--bg-2); border-right: 1px solid var(--line);
}
.brand {
  display: flex; align-items: center; gap: 12px; padding: 18px 18px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(227,23,45,.10), transparent);
}
.brand img { width: 44px; height: 44px; object-fit: contain; filter: drop-shadow(0 2px 8px rgba(227,23,45,.4)); }
.brand-name { font: 700 17px/1.1 var(--head); text-transform: uppercase; letter-spacing: .05em; }
.brand-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

.nav-label {
  padding: 18px 20px 8px; color: var(--muted);
  font: 600 11px var(--head); text-transform: uppercase; letter-spacing: .14em;
}
.tabs { flex: 1; overflow-y: auto; padding: 4px 10px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-group {
  padding: 14px 10px 6px; color: var(--muted);
  font: 600 11px var(--head); text-transform: uppercase; letter-spacing: .14em;
}
.nav-group:first-child { padding-top: 8px; }
.tab {
  position: relative; display: flex; align-items: center; gap: 11px; width: 100%;
  text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 8px;
  color: var(--text-2); cursor: pointer; transition: background .12s, color .12s;
}
.tab-icon {
  width: 30px; height: 30px; flex-shrink: 0; display: grid; place-items: center;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 7px; font-size: 15px;
}
.tab-name { flex: 1; min-width: 0; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tab:hover { background: var(--hover); color: var(--text); }
.tab.active { background: var(--red-soft); color: #fff; }
.tab.active::before {
  content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px;
  background: var(--red); border-radius: 0 3px 3px 0; box-shadow: 0 0 12px var(--red);
}
.tab.active .tab-icon { border-color: var(--red-line); background: rgba(227,23,45,.18); }

.user {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-top: 1px solid var(--line); background: var(--bg);
}
.user img { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--line-2); }
.user-info { flex: 1; min-width: 0; }
.user-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-id { color: var(--muted); font: 11px var(--mono); }
.user form { margin: 0; }

.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px;
  background: none; border: 1px solid transparent; border-radius: 8px;
  color: var(--muted); cursor: pointer; transition: color .12s, background .12s, border-color .12s;
}
.icon-btn:hover { color: var(--text); background: var(--hover); }
.icon-btn.bordered { border-color: var(--line-2); background: var(--panel); }
.icon-btn.bordered:hover { border-color: var(--red-line); color: #fff; }
.icon-btn.spin svg { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.menu-btn { display: none; }
.scrim { display: none; }

/* =========================== MAIN =========================== */
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }

.topbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 14px 22px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
}
.title { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 180px; }
.title-icon {
  width: 40px; height: 40px; display: grid; place-items: center; font-size: 19px;
  background: var(--red-soft); border: 1px solid var(--red-line); border-radius: 10px;
}
.title > div { min-width: 0; }
.title h1 { margin: 0; font: 700 19px/1.15 var(--head); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.meta.error { color: #ff8d99; }

.actions { display: flex; align-items: center; gap: 10px; }
.search {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px; color: var(--muted);
  width: 300px; transition: border-color .12s, box-shadow .12s;
}
.search:focus-within { border-color: var(--red-line); box-shadow: 0 0 0 3px rgba(227,23,45,.12); color: var(--text); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--text); font: inherit; }
.search input::placeholder { color: var(--muted); }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; color: var(--muted); font-size: 13px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track {
  width: 34px; height: 20px; border-radius: 20px; background: var(--line-2); position: relative; transition: background .15s;
}
.switch-dot {
  position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; transition: transform .15s;
}
.switch input:checked + .switch-track { background: var(--red); }
.switch input:checked + .switch-track .switch-dot { transform: translateX(14px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--red-2); outline-offset: 2px; }
.switch-label { display: inline-flex; align-items: center; gap: 6px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.switch input:checked ~ .switch-label { color: var(--text); }
.switch input:checked ~ .switch-label .live-dot { background: var(--green); box-shadow: 0 0 0 0 rgba(47,209,122,.6); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(47,209,122,.55); } 100% { box-shadow: 0 0 0 8px rgba(47,209,122,0); } }

/* =========================== LISTA =========================== */
.list { flex: 1; overflow-y: auto; padding: 4px 22px 12px; }

.day {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px;
  padding: 14px 0 8px; background: var(--bg);
  font: 600 11px var(--head); text-transform: uppercase; letter-spacing: .14em; color: var(--muted);
}
.day::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.day b { color: var(--text-2); font-weight: 600; }

.row {
  display: grid; grid-template-columns: 92px 1fr auto; gap: 14px; align-items: start;
  padding: 10px 12px; margin: 0 -12px; border-radius: 8px;
  border-left: 2px solid transparent; transition: background .1s, border-color .1s;
}
.row:hover { background: var(--panel); border-left-color: var(--red); }
.row.new { animation: flash 2.2s ease-out; }
@keyframes flash { from { background: rgba(227,23,45,.16); } to { background: transparent; } }
.time { display: flex; align-items: center; gap: 8px; font: 500 12.5px/1.6 var(--mono); color: var(--muted); padding-top: 1px; white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: var(--line-2); }
.dot.green { background: var(--green); box-shadow: 0 0 8px rgba(47,209,122,.5); }
.dot.red { background: var(--red-2); box-shadow: 0 0 8px rgba(255,58,78,.5); }
.dot.amber { background: #f5b13d; box-shadow: 0 0 8px rgba(245,177,61,.5); }
.body { min-width: 0; color: var(--text); word-wrap: break-word; }
.label {
  display: inline-block; margin-right: 8px; padding: 1px 7px; border-radius: 5px; vertical-align: 1px;
  background: var(--panel-2); border: 1px solid var(--line-2);
  font: 600 10.5px var(--head); text-transform: uppercase; letter-spacing: .08em; color: var(--silver);
}
.text strong { color: #fff; }
.pid {
  display: inline-block; padding: 0 6px; margin: 0 1px; border-radius: 5px; cursor: pointer;
  background: var(--red-soft); border: 1px solid var(--red-line); color: #ffc2c8;
  font: 500 11.5px/1.55 var(--mono); vertical-align: 1px; transition: background .1s;
}
.pid:hover { background: rgba(227,23,45,.28); color: #fff; }
.fields { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.field {
  display: inline-flex; gap: 6px; max-width: 100%; padding: 3px 9px; border-radius: 6px;
  background: var(--panel-2); border: 1px solid var(--line); font-size: 12.5px;
}
.field-name { color: var(--muted); }
.field-value { color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.field.block { display: block; width: 100%; }
.footer-note { color: var(--muted); font-size: 12px; margin-top: 4px; }
.embed-img { display: block; max-width: min(420px, 100%); max-height: 260px; margin-top: 8px; border-radius: 8px; border: 1px solid var(--line); }
.attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.attachments img { max-width: 240px; max-height: 180px; border-radius: 8px; border: 1px solid var(--line); }
.file {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 6px;
  background: var(--panel-2); border: 1px solid var(--line-2); color: var(--text); text-decoration: none; font-size: 13px;
}
.file:hover { border-color: var(--red-line); }

/* Botões Discord / Steam */
.ids { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.idgroup { display: flex; align-items: center; gap: 5px; }
.idlabel {
  max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--muted); font-size: 11.5px; margin-right: 2px;
}
.idbtn {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px;
  border-radius: 6px; cursor: pointer; font: 600 11.5px var(--body);
  background: var(--panel-2); border: 1px solid var(--line-2); color: var(--text-2);
  transition: background .12s, border-color .12s, color .12s, transform .08s;
}
.idbtn:active:not(:disabled) { transform: scale(.96); }
.idbtn.discord:hover:not(:disabled) { background: rgba(88,101,242,.18); border-color: rgba(88,101,242,.6); color: #fff; }
.idbtn.steam:hover:not(:disabled) { background: rgba(102,192,244,.14); border-color: rgba(102,192,244,.55); color: #fff; }
.idbtn.discord svg { color: #8c96ff; }
.idbtn.steam svg { color: #66c0f4; }
.idbtn:disabled { opacity: .35; cursor: not-allowed; }
.idbtn.copied { background: rgba(47,209,122,.16); border-color: rgba(47,209,122,.6); color: #fff; }
.idbtn.copied svg { color: var(--green); }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translate(-50%, 20px);
  max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 10px 16px; border-radius: 9px; background: #1d1d23; border: 1px solid var(--line-2);
  border-left: 3px solid var(--green); color: var(--text); font-size: 13px;
  box-shadow: 0 12px 40px rgba(0,0,0,.5); opacity: 0; pointer-events: none;
  transition: opacity .18s, transform .18s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-left-color: var(--red-2); }

/* =========================== ADMIN =========================== */
.admin-link {
  display: flex; align-items: center; gap: 10px; margin: 6px 10px 10px; padding: 9px 10px; border-radius: 8px;
  color: var(--text-2); text-decoration: none; border: 1px dashed var(--line-2); font-weight: 500;
}
.admin-link:hover { color: #fff; border-color: var(--red-line); background: var(--red-soft); }
.user-role { color: var(--red-2); font: 600 10.5px var(--head); text-transform: uppercase; letter-spacing: .08em; }

.admin-page { min-height: 100%; background:
  radial-gradient(50% 30% at 50% 0%, rgba(227,23,45,.12), transparent 70%), var(--bg); }
.admin-top {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 16px 24px;
  border-bottom: 1px solid var(--line); background: rgba(15,15,18,.85); position: sticky; top: 0; z-index: 5;
  backdrop-filter: blur(8px);
}
.back {
  display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none;
  padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line-2); font-size: 13px;
}
.back:hover { color: #fff; border-color: var(--red-line); }
.admin-brand { display: flex; align-items: center; gap: 12px; }
.admin-brand img { width: 40px; height: 40px; object-fit: contain; }
.admin-brand h1 { margin: 0; font: 700 19px/1.1 var(--head); text-transform: uppercase; letter-spacing: .05em; }
.admin-main { max-width: 1100px; margin: 0 auto; padding: 22px 24px 60px; display: flex; flex-direction: column; gap: 18px; }

.card-section { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head h2 { margin: 0 0 3px; font: 700 15px var(--head); text-transform: uppercase; letter-spacing: .08em; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.section-head p { margin: 0; font-size: 13px; }

.btn-primary {
  background: linear-gradient(180deg, var(--red-2), var(--red)); color: #fff; border: 0; cursor: pointer;
  padding: 9px 16px; border-radius: 8px; font: 700 12.5px var(--head); text-transform: uppercase; letter-spacing: .07em;
  box-shadow: 0 6px 18px rgba(227,23,45,.25); white-space: nowrap;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:disabled { opacity: .6; cursor: wait; }
.btn-ghost.sm { padding: 6px 12px; font-size: 11px; }
.btn-ghost.danger:hover, .icon-btn.danger:hover { color: #fff; border-color: var(--red-line); background: var(--red-soft); }
.link { background: none; border: 0; color: var(--red-2); cursor: pointer; font-size: 12px; padding: 0; }
.link:hover { text-decoration: underline; }

.admin-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.admin-chip, .person { display: flex; align-items: center; gap: 10px; }
.admin-chip { padding: 8px 12px 8px 8px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; }
.admin-chip img, .person img { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line-2); }
.pname { font-weight: 600; }
.pid-mono { font: 11.5px var(--mono); color: var(--muted); }

.roles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.role-card {
  --c: #7d7e89; display: flex; flex-direction: column; gap: 10px;
  background: var(--panel); border: 1px solid var(--line-2); border-top: 3px solid var(--c); border-radius: 10px; padding: 14px;
}
.role-head { display: flex; align-items: center; gap: 8px; }
.role-head h3 { margin: 0; flex: 1; font: 700 15px var(--head); text-transform: uppercase; letter-spacing: .05em; }
.role-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.role-sub { color: var(--muted); font-size: 11.5px; margin-bottom: -4px; }
.role-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px; font-size: 12px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text-2);
}
.chip.strong { color: #fff; background: var(--red-soft); border-color: var(--red-line); font-weight: 600; }
.chip.warn { color: #f5b13d; border-color: rgba(245,177,61,.4); }
.chip i, .drow i { --c: #7d7e89; width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex-shrink: 0; }

.add-user { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.add-user input, .add-user select, .fld input, .small-input, .role-select select {
  height: 38px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2);
  background: var(--panel); color: var(--text); font: inherit; outline: none;
}
.add-user input { flex: 1; min-width: 220px; font-family: var(--mono); }
.add-user select { min-width: 160px; }
.add-user input:focus, .add-user select:focus, .fld input:focus, .small-input:focus, .role-select select:focus {
  border-color: var(--red-line); box-shadow: 0 0 0 3px rgba(227,23,45,.12);
}
select option { background: var(--panel); color: var(--text); }

.table-wrap { overflow-x: auto; }
table.users { width: 100%; border-collapse: collapse; }
table.users th {
  text-align: left; padding: 8px 10px; color: var(--muted); border-bottom: 1px solid var(--line);
  font: 600 11px var(--head); text-transform: uppercase; letter-spacing: .1em;
}
table.users td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.users tr:last-child td { border-bottom: 0; }
table.users tr:hover td { background: var(--panel); }
.right { text-align: right; }
.role-select { --c: #7d7e89; position: relative; display: inline-block; }
.role-select::before {
  content: ""; position: absolute; left: 11px; top: 50%; width: 9px; height: 9px; margin-top: -4.5px;
  border-radius: 50%; background: var(--c); pointer-events: none;
}
.role-select select { padding-left: 28px; min-width: 170px; cursor: pointer; }
.empty-sm { color: var(--muted); padding: 16px 4px; font-size: 13px; text-align: center; }

.history { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow-y: auto; }
.history li { display: flex; gap: 14px; padding: 8px 2px; border-bottom: 1px solid var(--line); font-size: 13px; }
.history li:last-child { border-bottom: 0; }
.history time { color: var(--muted); font: 12px var(--mono); white-space: nowrap; padding-top: 1px; }

.modal-back {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px;
  background: rgba(0,0,0,.65); backdrop-filter: blur(3px);
}
.modal-back[hidden] { display: none; }
.modal {
  width: 100%; max-width: 560px; max-height: calc(100dvh - 32px); overflow-y: auto;
  background: var(--bg-2); border: 1px solid var(--line-2); border-top: 2px solid var(--red);
  border-radius: 12px; padding: 20px 22px; box-shadow: 0 30px 80px rgba(0,0,0,.6);
  animation: rise .2s ease-out both;
}
.modal h3 { margin: 0 0 14px; font: 700 17px var(--head); text-transform: uppercase; letter-spacing: .06em; }
.fld { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; color: var(--text-2); font-size: 13px; font-weight: 500; }
.fld-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
  --c: #7d7e89; width: 28px; height: 28px; border-radius: 50%; background: var(--c); cursor: pointer;
  border: 2px solid transparent; box-shadow: inset 0 0 0 2px rgba(0,0,0,.25);
}
.swatch.on { border-color: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.15); }
.tab-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 12px; }
.tp-group { display: contents; }
.tp-title {
  grid-column: 1 / -1; margin-top: 6px; color: var(--muted);
  font: 600 10.5px var(--head); text-transform: uppercase; letter-spacing: .12em;
}
.check {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; cursor: pointer;
  color: var(--text-2); font-weight: 400;
}
.check:hover { background: var(--panel); color: var(--text); }
.check input { accent-color: var(--red); width: 15px; height: 15px; }
.drole-picker { max-height: 190px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 4px; }
.drow[hidden] { display: none; }
.small-input { height: 34px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

@media (max-width: 640px) {
  .admin-main { padding: 16px 16px 50px; }
  .admin-top { padding: 12px 16px; }
  .card-section { padding: 16px; }
  .hide-sm { display: none; }
  .role-select select { min-width: 130px; }
}
.offscreen { position: fixed; left: -9999px; top: 0; }

code { background: var(--panel-2); border: 1px solid var(--line); padding: 0 5px; border-radius: 4px; font: 12.5px var(--mono); }
pre {
  background: var(--panel-2); border: 1px solid var(--line); padding: 8px 10px; border-radius: 6px;
  overflow-x: auto; margin: 6px 0 0; font: 12.5px/1.5 var(--mono); white-space: pre-wrap;
}
.mention { background: rgba(88,101,242,.22); color: #c9cdfb; padding: 0 3px; border-radius: 4px; }
mark { background: rgba(255, 196, 0, .28); color: #fff; border-radius: 3px; padding: 0 1px; }

.empty { text-align: center; padding: 70px 16px; color: var(--muted); }
.empty-icon { font-size: 30px; opacity: .7; margin-bottom: 8px; }
.empty b { display: block; color: var(--text-2); font: 600 15px var(--head); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }

.skeleton { padding: 10px 0; }
.skel-row { display: grid; grid-template-columns: 92px 1fr; gap: 14px; padding: 12px 0; }
.skel { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--panel) 0%, var(--panel-2) 50%, var(--panel) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.skel-row .skel:first-child { width: 60px; }
.skel-row:nth-child(3n+1) .skel:last-child { width: 62%; }
.skel-row:nth-child(3n+2) .skel:last-child { width: 44%; }
.skel-row:nth-child(3n) .skel:last-child { width: 78%; }

.more { padding: 6px 22px 18px; text-align: center; }
.btn-ghost {
  background: var(--panel); border: 1px solid var(--line-2); color: var(--text-2);
  padding: 9px 18px; border-radius: 8px; cursor: pointer;
  font: 600 12px var(--head); text-transform: uppercase; letter-spacing: .08em;
}
.btn-ghost:hover { border-color: var(--red-line); color: #fff; }
.btn-ghost:disabled { opacity: .5; cursor: wait; }

/* =========================== MOBILE =========================== */
@media (max-width: 900px) {
  .search { width: 220px; }
}
@media (max-width: 760px) {
  .menu-btn { display: inline-grid; }
  .sidebar {
    position: fixed; z-index: 20; inset: 0 auto 0 0; width: 280px; max-width: 85vw;
    transform: translateX(-100%); transition: transform .22s ease;
  }
  .sidebar.open { transform: none; box-shadow: 20px 0 60px rgba(0,0,0,.6); }
  .scrim { position: fixed; inset: 0; z-index: 15; background: rgba(0,0,0,.55); }
  .sidebar.open + .scrim { display: block; }
  .topbar { padding: 12px 16px; gap: 10px; }
  .title { min-width: 0; }
  .actions { width: 100%; gap: 8px; }
  .search { flex: 1; width: auto; }
  .switch-label { display: none; }
  .list { padding: 0 16px 10px; }
  .row { grid-template-columns: 1fr auto; gap: 4px 10px; }
  .time { grid-column: 1; }
  .body { grid-column: 1 / -1; grid-row: 2; }
  .ids { grid-column: 1 / -1; grid-row: 3; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; }
  .ids:empty { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
