/* AMADEUSE OS · Bot Dashboard
   Palette: deep shell #11131A · surface #1a1c26 · light #f7f8fc · accent pink #ff8dcc */

:root {
  --bg: #11131A;
  --bg-elev: #161822;
  --surface: #1a1c26;
  --surface-2: #222433;
  --border: rgba(247, 248, 252, 0.08);
  --border-strong: rgba(247, 248, 252, 0.14);
  --text: #f7f8fc;
  --muted: rgba(247, 248, 252, 0.58);
  --muted-2: rgba(247, 248, 252, 0.38);
  --pink: #ff8dcc;
  --pink-soft: rgba(255, 141, 204, 0.16);
  --pink-glow: rgba(255, 141, 204, 0.35);
  --warn: #ffc857;
  --danger: #ff6b8a;
  --ok: #6ef0b5;
  --radius: 16px;
  --radius-sm: 10px;
  --sidebar-w: 260px;
  --topbar-h: 64px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --font: "Satoshi", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  overflow-x: hidden;
}

button, input, textarea {
  font: inherit;
  color: inherit;
}

a {
  color: var(--pink);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* Ambient orbs — Amadeuse OS glass feel */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}
.bg-orb-a {
  width: 420px;
  height: 420px;
  top: -120px;
  right: -80px;
  background: radial-gradient(circle, rgba(255, 141, 204, 0.28), transparent 70%);
}
.bg-orb-b {
  width: 380px;
  height: 380px;
  bottom: -100px;
  left: -60px;
  background: radial-gradient(circle, rgba(120, 140, 255, 0.18), transparent 70%);
}

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-h);
  backdrop-filter: blur(18px) saturate(1.2);
  background: rgba(17, 19, 26, 0.78);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  height: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: linear-gradient(135deg, #ff8dcc, #c084fc 60%, #7dd3fc);
  color: #11131A;
  box-shadow: 0 0 24px var(--pink-glow);
  flex-shrink: 0;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}
.brand-text strong {
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}
.brand-text span {
  font-size: 0.72rem;
  color: var(--muted);
}
.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--muted);
}
.live-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted-2);
  display: inline-block;
}
.live-pill.ok .dot { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.live-pill.err .dot { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.live-pill.ok { color: var(--ok); }
.live-pill.err { color: var(--danger); }

/* Shell */
.shell {
  position: relative;
  z-index: 1;
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  min-height: calc(100vh - var(--topbar-h));
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: rgba(22, 24, 34, 0.55);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow: auto;
}
.nav {
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.nav-label {
  margin: 0.9rem 0.6rem 0.35rem;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 600;
}
.nav-label:first-child { margin-top: 0.2rem; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.7rem 0.75rem;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover {
  background: rgba(247, 248, 252, 0.05);
  color: var(--text);
}
.nav-item.active {
  background: var(--pink-soft);
  color: var(--pink);
  font-weight: 600;
}
.nav-ico {
  width: 1.4rem;
  text-align: center;
  opacity: 0.9;
}
.sidebar-foot {
  margin-top: auto;
  padding: 1rem 1.1rem 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--muted);
}
.sidebar-foot p { margin: 0 0 0.25rem; }
.sidebar-foot a { font-weight: 600; }

.sidebar-overlay {
  display: none;
}

/* Main */
.main {
  flex: 1;
  min-width: 0;
  padding: 1.25rem 1.25rem 3rem;
}

.view[hidden] { display: none !important; }

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.page-head h1 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.muted { color: var(--muted); margin: 0.25rem 0 0; }
.page-head .muted { font-size: 0.9rem; }

.chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
}
.chip.pink {
  background: var(--pink-soft);
  border-color: rgba(255, 141, 204, 0.35);
  color: var(--pink);
}

/* Stats */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.stat-card {
  background: linear-gradient(165deg, var(--surface) 0%, var(--bg-elev) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.05rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-height: 100px;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: "";
  position: absolute;
  inset: auto -20% -40% auto;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(255, 141, 204, 0.06);
}
.stat-card.pink { border-color: rgba(255, 141, 204, 0.28); }
.stat-card.pink .stat-value { color: var(--pink); }
.stat-card.warn .stat-value { color: var(--warn); }
.stat-card.danger .stat-value { color: var(--danger); }
.stat-label {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.stat-value {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.stat-sub {
  font-size: 0.75rem;
  color: var(--muted-2);
}

/* Panels */
.panels-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}
.panel-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.panel-h h2, .panel > h2 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 650;
}
.panel-h h2 { margin: 0; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
  transition: transform 0.12s, background 0.15s, border-color 0.15s;
}
.btn:hover { border-color: rgba(255, 141, 204, 0.4); }
.btn:active { transform: scale(0.98); }
.btn.primary {
  background: linear-gradient(135deg, #ff8dcc, #e879c0);
  color: #1a1020;
  border-color: transparent;
  box-shadow: 0 6px 20px var(--pink-glow);
}
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--muted);
}
.btn.sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
}
.menu-btn {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
}
.menu-btn span {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* Toolbar */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 0.9rem;
  align-items: center;
}
.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.seg-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8rem;
}
.seg-btn.active {
  background: var(--pink-soft);
  color: var(--pink);
}
.search-wrap {
  flex: 1;
  min-width: 180px;
}
.search-wrap input,
.form input,
.form textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  outline: none;
  transition: border-color 0.15s;
}
.search-wrap input:focus,
.form input:focus,
.form textarea:focus {
  border-color: rgba(255, 141, 204, 0.5);
  box-shadow: 0 0 0 3px var(--pink-soft);
}
.form textarea { resize: vertical; min-height: 80px; }
.form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
}
.form label span {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.form-status.ok { color: var(--ok); }
.form-status.err { color: var(--danger); }

/* Lists */
.list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.list.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}
.row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem;
  align-items: start;
  padding: 0.75rem 0.8rem;
  border-radius: 12px;
  background: var(--bg-elev);
  border: 1px solid transparent;
  transition: border-color 0.15s;
}
.row:hover { border-color: var(--border); }
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--surface-2), #2a2d40);
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--pink);
  flex-shrink: 0;
}
.row-body { min-width: 0; }
.row-title {
  font-weight: 650;
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.row-meta {
  font-size: 0.72rem;
  color: var(--muted-2);
  margin-top: 0.1rem;
}
.row-content {
  margin-top: 0.3rem;
  font-size: 0.86rem;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 5.5em;
  overflow: hidden;
}
.row-content.full { max-height: none; }
.badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
}
.badge.bot { background: rgba(125, 211, 252, 0.15); color: #7dd3fc; }
.badge.del { background: rgba(255, 107, 138, 0.15); color: var(--danger); }
.badge.edit { background: rgba(255, 200, 87, 0.15); color: var(--warn); }
.badge.ban { background: rgba(255, 107, 138, 0.2); color: var(--danger); }
.badge.ok { background: rgba(110, 240, 181, 0.15); color: var(--ok); }
.row-time {
  font-size: 0.72rem;
  color: var(--muted-2);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Card items (sanctions / tickets) */
.card-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: var(--shadow);
}
.card-item h3 {
  margin: 0;
  font-size: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.card-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}
.proof-list {
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.proof-list li {
  font-size: 0.8rem;
  padding: 0.45rem 0.6rem;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Pager */
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.pager .info {
  font-size: 0.8rem;
  color: var(--muted);
  min-width: 8rem;
  text-align: center;
}

/* Links page */
.link-card .big-link {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0.5rem 0;
  word-break: break-all;
}
.api-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}
.api-list code {
  color: var(--pink);
  font-size: 0.85rem;
}
.code {
  margin: 0;
  padding: 0.85rem;
  background: var(--bg);
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 0.78rem;
  overflow: auto;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-all;
}

.empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted-2);
  font-size: 0.9rem;
}
.loading {
  opacity: 0.55;
  pointer-events: none;
}

/* Modal */
.modal {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: min(720px, calc(100vw - 1.5rem));
  width: 100%;
}
.modal::backdrop {
  background: rgba(8, 9, 14, 0.72);
  backdrop-filter: blur(6px);
}
.modal-card {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: min(80vh, 700px);
}
.modal-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}
.modal-card header h2 {
  margin: 0;
  font-size: 1rem;
}
.transcript {
  margin: 0;
  padding: 1rem;
  overflow: auto;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
  flex: 1;
}

/* Mobile */
@media (max-width: 960px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .panels-2 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .menu-btn { display: flex; }
  .sidebar {
    position: fixed;
    left: 0;
    top: var(--topbar-h);
    z-index: 60;
    width: min(300px, 86vw);
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow);
    height: calc(100vh - var(--topbar-h));
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: var(--topbar-h) 0 0 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 55;
  }
  .sidebar-overlay[hidden] { display: none; }
  .main { padding: 1rem 0.85rem 4rem; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 0.55rem; }
  .stat-card { min-height: 88px; padding: 0.85rem; }
  .stat-value { font-size: 1.35rem; }
  .row {
    grid-template-columns: auto 1fr;
  }
  .row-time {
    grid-column: 2;
    justify-self: start;
  }
  .brand-text span { display: none; }
}

@media (max-width: 400px) {
  .stat-grid { grid-template-columns: 1fr; }
  .live-pill span:not(.dot) { display: none; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--surface-2);
  border-radius: 10px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: #35384a; }
