:root {
  --bg-main: #070b12;
  --bg-sidebar: #0b111b;
  --bg-card: rgba(17, 24, 39, 0.72);
  --bg-card-solid: #111827;
  --border: rgba(255, 255, 255, 0.08);
  --text-main: #f4f7fb;
  --text-muted: #9ca3af;
  --green: #22c55e;
  --green-dark: #15803d;
  --yellow: #eab308;
  --red: #ef4444;
  --blue: #38bdf8;
  --radius: 16px;
  --sidebar-width: 260px;
  --topbar-height: 72px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(circle at 35% 0%, rgba(34, 197, 94, 0.08), transparent 32%), var(--bg-main);
  color: var(--text-main);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

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

button {
  cursor: pointer;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  background: linear-gradient(180deg, rgba(11, 17, 27, 0.98), rgba(7, 11, 18, 0.96));
  border-right: 1px solid var(--border);
  padding: 18px 12px;
  z-index: 30;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  color: var(--green);
  font-size: 23px;
  font-weight: 800;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
}

.sidebar-close {
  display: none;
  margin-left: auto;
}

.nav {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #cbd5e1;
  background: transparent;
  text-align: left;
  transition: 160ms ease;
}

.nav-item span {
  width: 22px;
  color: #dbeafe;
  font-size: 15px;
}

.nav-item:hover,
.nav-item.active {
  color: var(--green);
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 28px rgba(34, 197, 94, 0.04);
}

.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 22px 0 26px;
  background: rgba(7, 11, 18, 0.82);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  z-index: 20;
  min-width: 0;
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

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

.content {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  padding: calc(var(--topbar-height) + 22px) 22px 26px;
}

.page-shell {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
}

.card {
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.82), rgba(11, 17, 27, 0.76));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.25);
  padding: 18px;
  min-width: 0;
}

.card h2,
.card h3 {
  margin: 0 0 14px;
}

.muted {
  color: var(--text-muted);
}

.grid {
  display: grid;
  gap: 18px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.btn,
.icon-button {
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--text-main);
  background: rgba(15, 23, 42, 0.72);
  padding: 0 16px;
  transition: 160ms ease;
  white-space: nowrap;
}

.icon-button {
  width: 38px;
  padding: 0;
}

.btn:hover,
.icon-button:hover {
  transform: translateY(-1px);
  border-color: rgba(34, 197, 94, 0.35);
}

.btn-green {
  background: linear-gradient(180deg, #22c55e, #14803a);
  border-color: rgba(34, 197, 94, 0.55);
}

.btn-yellow {
  color: #fef3c7;
  background: rgba(234, 179, 8, 0.12);
  border-color: rgba(234, 179, 8, 0.55);
}

.btn-red {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.58);
}

.btn-blue {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.42);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.72);
  font-size: 14px;
}

.status-pill i {
  width: 9px;
  height: 9px;
  border-radius: 99px;
  background: var(--red);
  box-shadow: 0 0 18px currentColor;
}

.status-pill.online {
  color: var(--green);
}

.status-pill.online i {
  background: var(--green);
}

.status-pill.offline {
  color: #fca5a5;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

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

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

.field input,
.field select,
.field textarea,
.content input:not([type="file"]),
.content select,
.content textarea {
  width: 100%;
  min-height: 40px;
  color: var(--text-main);
  background: rgba(7, 11, 18, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 12px;
  outline: none;
}

.field textarea {
  min-height: 140px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(34, 197, 94, 0.65);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.08);
}

.table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.table th,
.table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 12px 10px;
  text-align: left;
  vertical-align: middle;
}

.table th {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: #dbeafe;
  background: rgba(148, 163, 184, 0.08);
  font-size: 12px;
}

.badge.green {
  color: var(--green);
  border-color: rgba(34, 197, 94, 0.32);
  background: rgba(34, 197, 94, 0.1);
}

.badge.red {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.1);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar select,
.toolbar input {
  width: auto;
  min-width: 150px;
}

.toast-host {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 10px;
  z-index: 50;
}

.toast {
  width: min(360px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
}

.toast.success {
  border-color: rgba(34, 197, 94, 0.42);
}

.toast.error {
  border-color: rgba(239, 68, 68, 0.45);
}

.footer {
  max-width: 1440px;
  margin: 28px auto 0;
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 13px;
}

.mobile-menu,
.overlay {
  display: none;
}
