:root {
  --bg: #0b0f1f;
  --panel: #141a31;
  --panel-2: #1c2443;
  --line: rgba(255,255,255,.10);
  --text: #f6f7ff;
  --muted: #aeb5d0;
  --accent: #7868e6;
  --accent-2: #ff6f61;
  --ok: #31c48d;
  --warn: #f7b955;
  --danger: #ef5b6b;
  --shadow: 0 18px 45px rgba(0,0,0,.28);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(120,104,230,.22), transparent 30%),
    radial-gradient(circle at 85% 10%, rgba(255,111,97,.14), transparent 28%),
    var(--bg);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.hidden { display: none !important; }

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(11,15,31,.86);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--accent), #4d3fbe);
  box-shadow: 0 10px 25px rgba(120,104,230,.35);
  font-weight: 900;
}
.brand h1, .brand p { margin: 0; }
.brand h1 { font-size: 19px; letter-spacing: .04em; }
.brand p { color: var(--muted); font-size: 12px; }

.page { width: min(1440px, 100%); margin: 0 auto; padding: 24px; }
.card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(28,36,67,.94), rgba(20,26,49,.94));
  box-shadow: var(--shadow);
}
.card-pad { padding: 22px; }
.section-title { margin: 0 0 16px; font-size: 21px; }
.subtle { color: var(--muted); }

.btn {
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #fff;
  background: var(--accent);
  font-weight: 750;
  transition: transform .15s ease, filter .15s ease, opacity .15s ease;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.secondary { background: var(--panel-2); border-color: var(--line); }
.btn.danger { background: var(--danger); }
.btn.warn { background: #a66b11; }
.btn.ok { background: #16835d; }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.small { min-height: 34px; padding: 7px 11px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.field { display: grid; gap: 7px; }
.field label { color: var(--muted); font-size: 13px; font-weight: 700; }
.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  color: var(--text);
  background: rgba(7,10,23,.6);
  outline: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(120,104,230,.18); }
.select option { color: #111; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 9px; border-radius: 999px;
  background: rgba(120,104,230,.16); color: #d9d5ff;
  font-size: 12px; font-weight: 750;
}
.badge.ok { background: rgba(49,196,141,.15); color: #8fe4c2; }
.badge.warn { background: rgba(247,185,85,.15); color: #ffd58e; }
.badge.danger { background: rgba(239,91,107,.15); color: #ffadb7; }

.notice {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(120,104,230,.11); color: #d8d5ff;
}
.error { color: #ffadb7; }
.success { color: #8fe4c2; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; }
table { width: 100%; border-collapse: collapse; min-width: 850px; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
tr:last-child td { border-bottom: 0; }

.modal {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center; padding: 20px;
  background: rgba(3,5,13,.78); backdrop-filter: blur(10px);
}
.modal-card { width: min(720px, 100%); max-height: 90vh; overflow: auto; }

@media (max-width: 760px) {
  .topbar { padding: 12px 14px; }
  .page { padding: 14px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .card-pad { padding: 16px; }
}
