:root {
  --bg: #0b1220;
  --panel: #0f1a2e;
  --panel-2: #0c1628;
  --text: #e7eefc;
  --muted: #9fb1d1;
  --border: rgba(255, 255, 255, 0.1);
  --accent: #4f8cff;
  --danger: #ff4d6d;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --focus: 0 0 0 4px rgba(79, 140, 255, 0.25);
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica,
    Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  background: radial-gradient(1200px 700px at 20% 0%, #14264a 0%, var(--bg) 60%),
    radial-gradient(900px 600px at 80% 20%, #1a2f59 0%, transparent 55%);
  color: var(--text);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  background: rgba(8, 14, 26, 0.35);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.brand-badge {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2d5bff 0%, #61d0ff 100%);
  box-shadow: 0 8px 25px rgba(79, 140, 255, 0.25);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 13px;
}

.kbd {
  font-family: var(--mono);
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 22px 18px 26px;
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-body {
  padding: 18px;
}

.page-title {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.1px;
}

.page-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.label {
  color: var(--muted);
  font-size: 13px;
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(6, 11, 20, 0.45);
  color: var(--text);
  font-size: 14px;
}

.textarea {
  resize: vertical;
  min-height: 88px;
  font-family: var(--mono);
  font-size: 13px;
}

.row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.row > * {
  flex: 1;
}

.row .fit {
  flex: 0 0 auto;
}

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.03s ease, background 0.15s ease, border-color 0.15s ease;
  font-weight: 650;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.07);
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary {
  background: linear-gradient(135deg, rgba(79, 140, 255, 0.95), rgba(97, 208, 255, 0.85));
  border-color: rgba(97, 208, 255, 0.35);
  color: #061024;
}

.btn.danger {
  background: rgba(255, 77, 109, 0.12);
  border-color: rgba(255, 77, 109, 0.35);
  color: #ffd7df;
}

.console {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 12px;
  height: calc(100vh - 64px);
  padding: 14px;
}

.pane {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.pane-title {
  font-weight: 750;
  font-size: 13px;
  letter-spacing: 0.2px;
  color: var(--muted);
}

.pane-body {
  padding: 10px;
  overflow: auto;
  max-height: calc(100vh - 64px - 14px - 14px - 46px);
}

.list {
  display: grid;
  gap: 8px;
}

.item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.item.active {
  border-color: rgba(79, 140, 255, 0.4);
  background: rgba(79, 140, 255, 0.12);
}

.item-title {
  font-weight: 700;
  font-size: 13px;
}

.item-meta {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.empty {
  padding: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 50;
}

.modal {
  width: min(980px, 100%);
  max-height: min(92vh, 900px);
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(10, 16, 30, 0.96);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.modal-title {
  display: grid;
  gap: 2px;
}

.modal-title strong {
  font-size: 16px;
}

.modal-title span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
}

.modal-body {
  padding: 14px;
  overflow: auto;
}

.modal .page-subtitle {
  font-size: 14px;
  color: rgba(231, 238, 252, 0.78);
}

.modal .label {
  font-size: 14px;
  color: rgba(231, 238, 252, 0.78);
}

.modal .card {
  background: rgba(255, 255, 255, 0.04);
}

.modal .input,
.modal .select,
.modal .textarea {
  background: rgba(6, 11, 20, 0.8);
  border-color: rgba(255, 255, 255, 0.14);
}

.modal .textarea {
  font-size: 14px;
  line-height: 1.5;
  min-height: 340px;
}

@media (max-width: 980px) {
  .console {
    grid-template-columns: 1fr;
    height: auto;
  }
  .pane-body {
    max-height: none;
  }
}
