/* Admin panel styles (v2.0) */
:root {
  --bg: #0d1117;
  --panel: #161b22;
  --panel2: #1c2330;
  --line: #2a3242;
  --text: #e6edf3;
  --muted: #8b98a9;
  --accent: #4a90e2;
  --gold: #ffd23b;
  --green: #3fb950;
  --red: #f85149;
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
}
h1, h2, h3 { margin: 0 0 12px; font-weight: 700; }
h2 { font-size: 20px; }
h3 { font-size: 15px; color: var(--muted); margin-top: 20px; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* layout */
#app { display: flex; min-height: 100vh; }
#sidebar {
  width: 220px; flex: 0 0 220px; background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 14px 10px; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 16px; padding: 6px 8px 16px; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.brand .ver { font-size: 11px; color: var(--muted); font-weight: 500; margin-left: auto; }
#sidebar nav { display: flex; flex-direction: column; gap: 3px; }
#sidebar nav button {
  text-align: left; background: transparent; color: var(--text); border: 0; padding: 9px 10px;
  border-radius: 8px; cursor: pointer; font-size: 13.5px;
}
#sidebar nav button:hover { background: var(--panel2); }
#sidebar nav button.active { background: var(--accent); color: #fff; }
#logout-btn { margin-top: auto; }

#content { flex: 1; padding: 20px 24px; max-width: 1700px; width: 100%; }
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.actions { display: flex; gap: 8px; align-items: center; }

/* controls */
input, select, textarea, button { font: inherit; }
input, select, textarea {
  background: var(--panel2); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 9px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { width: 100%; min-height: 70px; resize: vertical; }
label { display: block; font-size: 12.5px; color: var(--muted); }
label.block { display: block; margin: 10px 0; }
label.inline { display: flex; align-items: center; gap: 8px; color: var(--text); }
.inp-num { width: 72px; }

button { cursor: pointer; border-radius: 8px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); padding: 8px 12px; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { filter: brightness(1.1); }
button.ghost { background: transparent; }
button.danger { background: transparent; border-color: var(--red); color: var(--red); }
button.small { padding: 3px 7px; font-size: 12px; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: var(--panel); color: var(--muted); font-size: 12px; }
tbody tr:hover { background: rgba(255,255,255,0.03); }
tr.banned { opacity: 0.55; }
td input[type="text"] { min-width: 90px; }
.row-actions { display: flex; gap: 4px; flex-wrap: wrap; }

.icon-cell { display: flex; align-items: center; gap: 4px; }
.icon-cell img { width: 28px; height: 28px; object-fit: contain; background: rgba(255,255,255,0.04); border-radius: 6px; }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.card .num { font-size: 26px; font-weight: 800; color: var(--gold); }
.card .lbl { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* form grid */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 16px; margin: 10px 0; }
.form-grid label { display: flex; flex-direction: column; gap: 5px; }
.form-grid input { width: 100%; }

/* logs */
.loglist { list-style: none; padding: 0; margin: 0; }
.loglist li { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.loglist .ts { color: var(--muted); font-size: 11.5px; margin-right: 10px; }

/* login / toast */
.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 26px; width: 360px; max-width: 92vw; }
.panel input { width: 100%; margin: 8px 0 12px; }
.panel button { width: 100%; }
.error { color: var(--red); font-size: 13px; }
#toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--panel); border: 1px solid var(--accent); color: var(--text);
  padding: 10px 18px; border-radius: 10px; z-index: 100; box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

@media (max-width: 760px) {
  #app { flex-direction: column; }
  #sidebar { width: 100%; height: auto; position: static; flex-direction: column; }
  #sidebar nav { flex-direction: row; flex-wrap: wrap; }
  #sidebar nav button { flex: 1 0 auto; text-align: center; }
  #content { padding: 14px; }
}
