/* Quotex Admin — premium dark control panel */
:root {
  --bg: #0a0e15;
  --bg-glow: rgba(79,140,255,.06);
  --surface: #111823;
  --surface-2: #182130;
  --surface-3: #212c3d;
  --border: #212c3b;
  --border-2: #2c3a4e;
  --text: #e8eef6;
  --muted: #8b98ab;
  --muted-2: #64708200;
  --primary: #4f8cff;
  --primary-2: #7a6bff;
  --primary-soft: rgba(79,140,255,.14);
  --success: #34d17e;
  --success-soft: rgba(52,209,126,.13);
  --warning: #eab646;
  --warning-soft: rgba(234,182,70,.13);
  --danger: #f76a68;
  --danger-soft: rgba(247,106,104,.13);
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 12px 30px rgba(0,0,0,.28);
  --sidebar-w: 232px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: ui-sans-serif, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(1100px 520px at 100% -8%, var(--bg-glow), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(122,107,255,.05), transparent 60%),
    var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* ---------- layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 18px 14px; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; font-size: 15.5px; padding: 6px 8px 20px; }
.brand .logo {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px;
  box-shadow: 0 4px 12px rgba(79,140,255,.35);
}
.brand .sub { color: var(--muted); font-weight: 600; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav a {
  position: relative; padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--muted); font-weight: 500; transition: background .12s, color .12s;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--primary-soft); color: #cfe0ff; }
.nav a.active::before {
  content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
}
.spacer { flex: 1; }
.logout button { width: 100%; }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 15px 24px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
  background: rgba(10,14,21,.72); backdrop-filter: blur(10px);
}
.page-title { font-size: 17px; font-weight: 650; margin: 0; }
.topbar .meta { color: var(--muted); font-size: 12.5px; }
.badge-mode { color: var(--warning); background: var(--warning-soft); border: 1px solid rgba(234,182,70,.25); padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
main { padding: 24px; max-width: 1200px; width: 100%; margin: 0 auto; }
h1 { font-size: 20px; margin: 0 0 2px; letter-spacing: -.01em; }
h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 28px 0 12px; font-weight: 600; }

/* ---------- stat cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.card {
  background: linear-gradient(180deg, var(--surface), rgba(79,140,255,.03));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.card::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, var(--primary), transparent 70%); opacity: .5; }
.card .lbl { color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.card .num { font-size: 27px; font-weight: 700; margin-top: 10px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.card .num.accent { background: linear-gradient(135deg, #7fb0ff, var(--primary-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- panels & tables ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-top: 12px; box-shadow: var(--shadow); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; color: var(--muted); font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: .05em; padding: 12px 15px;
  background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap;
}
td { padding: 12px 15px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td, table tr:last-child td { border-bottom: 0; }
table tr:hover td { background: rgba(255,255,255,.018); }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12px; color: var(--muted); word-break: break-all; }
.count { color: var(--muted); font-size: 13px; margin: 2px 0 0; }

/* ---------- status pills ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px;
  border-radius: 999px; font-size: 11.5px; font-weight: 600; line-height: 1.5;
  border: 1px solid transparent; text-transform: capitalize; white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-success { color: #57e0a0; background: var(--success-soft); border-color: rgba(52,209,126,.25); }
.pill-warning { color: #f2ce6f; background: var(--warning-soft); border-color: rgba(234,182,70,.25); }
.pill-danger  { color: #ff9c9a; background: var(--danger-soft);  border-color: rgba(247,106,104,.25); }
.pill-info    { color: #9db8ff; background: var(--primary-soft);  border-color: rgba(79,140,255,.25); }
.pill-neutral { color: var(--muted); background: var(--surface-3); border-color: var(--border-2); }

/* ---------- forms & buttons ---------- */
input, select, button, textarea {
  font: inherit; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  padding: 8px 11px; font-size: 13px; outline: none;
}
input::placeholder { color: var(--muted); opacity: .7; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
button { cursor: pointer; font-weight: 600; background: var(--surface-3); }
button:hover { border-color: var(--primary); color: #fff; }
button.primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); border: 0; color: #fff; }
button.primary:hover { filter: brightness(1.08); }
button.danger { color: #ff9c9a; border-color: rgba(247,106,104,.3); background: var(--danger-soft); }
button.danger:hover { background: rgba(247,106,104,.22); color: #fff; border-color: var(--danger); }
form.inline { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.muted { color: var(--muted); }
.ok { color: var(--success); } .error { color: var(--danger); }
.pager { display: flex; gap: 8px; margin-top: 16px; }
.pager a { padding: 7px 13px; border: 1px solid var(--border-2); border-radius: var(--radius-sm); color: var(--muted); font-size: 13px; }
.pager a:hover { border-color: var(--primary); color: var(--text); }

/* ---------- login ---------- */
.login-body { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.login-box { width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 32px 30px; box-shadow: var(--shadow); }
.login-box .brand { justify-content: center; padding: 0 0 20px; font-size: 17px; }
.login-box form { display: flex; flex-direction: column; gap: 12px; }
.login-box input { padding: 12px 14px; }
.login-box button { padding: 12px; margin-top: 4px; }
.login-sub { text-align: center; color: var(--muted); font-size: 12.5px; margin: 0 0 20px; }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: auto; flex: none; height: auto; position: sticky; top: 0; z-index: 10;
    flex-direction: row; align-items: center; gap: 8px; padding: 10px 12px; overflow-x: auto;
  }
  .brand { padding: 0 6px 0 2px; white-space: nowrap; font-size: 14px; }
  .brand .sub { display: none; }
  .nav { flex-direction: row; }
  .nav a { padding: 7px 11px; white-space: nowrap; }
  .nav a.active::before { display: none; }
  .spacer { flex: none; }
  .logout { margin-left: auto; } .logout button { width: auto; }
  .topbar { padding: 12px 16px; }
  main { padding: 16px; }
  input, select, button { font-size: 16px; }  /* avoid iOS zoom */
}
