:root {
  --bg: #111315;
  --panel: #181b1f;
  --panel-strong: #20242a;
  --line: #343a42;
  --muted: #9aa3af;
  --text: #f6f7f2;
  --amber: #f3a712;
  --teal: #37b7a5;
  --green: #62c370;
  --red: #f07167;
  --blue: #79a8ff;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    radial-gradient(circle at 10% 0%, rgba(243, 167, 18, 0.16), transparent 34rem),
    radial-gradient(circle at 90% 18%, rgba(55, 183, 165, 0.12), transparent 30rem),
    var(--bg);
  background-size: 56px 56px, 56px 56px, 100% 100%, 100% 100%, 100% 100%;
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

.shell {
  margin: 0 auto;
  max-width: 1440px;
  padding: 28px;
}

.boot-card,
.login-card,
.panel,
.stat,
.row-card {
  border: 1px solid var(--line);
  background: rgba(24, 27, 31, 0.9);
  box-shadow: var(--shadow);
}

.boot-card,
.login-card {
  margin: 12vh auto 0;
  max-width: 520px;
  padding: 32px;
}

.eyebrow {
  margin: 0;
  color: var(--amber);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.login-card h1,
.boot-card h1,
.page-title h1 {
  margin: 12px 0;
  max-width: 760px;
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 0.98;
}

.login-card p,
.boot-card p,
.muted {
  color: var(--muted);
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field span {
  color: #d6d9de;
  font-size: 12px;
  font-weight: 750;
}

.input,
.select,
.textarea {
  min-height: 42px;
  width: 100%;
  border: 1px solid #3f4650;
  border-radius: 8px;
  background: #11151a;
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

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

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(243, 167, 18, 0.18);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--amber);
  color: #15110a;
  font-weight: 850;
  padding: 9px 14px;
}

.btn.secondary {
  border-color: var(--line);
  background: #222831;
  color: var(--text);
}

.btn.danger {
  background: #3a1d21;
  color: #ffd7d3;
  border-color: rgba(240, 113, 103, 0.5);
}

.btn.ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
}

.icon-btn {
  width: 40px;
  min-width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #222831;
  color: var(--text);
  font-size: 20px;
  font-weight: 850;
}

.icon-btn.mini {
  width: 34px;
  min-width: 34px;
  height: 34px;
  font-size: 15px;
  line-height: 1;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #d5dbe3;
  background: rgba(17, 21, 26, 0.72);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 760;
}

.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 12px rgba(98, 195, 112, 0.8);
}

.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
}

.nav {
  position: sticky;
  top: 18px;
  height: fit-content;
  border: 1px solid var(--line);
  background: rgba(24, 27, 31, 0.88);
  padding: 14px;
}

.nav-group + .nav-group {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #2b3138;
}

.nav-group > span {
  display: block;
  margin: 0 0 8px 2px;
  color: var(--amber);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav button {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-weight: 800;
  padding: 10px 12px;
}

.nav button.active {
  background: var(--panel-strong);
  color: var(--text);
  box-shadow: inset 3px 0 0 var(--amber);
}

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

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stat {
  padding: 18px;
}

.stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

.panel {
  padding: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.panel-head h2 {
  margin: 0;
  font-size: 22px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin: 18px 0 12px;
}

.section-head h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.list-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 240px);
  gap: 10px;
  align-items: center;
  margin: 0 0 12px;
}

.list-toolbar .input,
.list-toolbar .select {
  min-height: 40px;
}

.list-toolbar .input:only-child {
  grid-column: 1 / -1;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid #2f363e;
  background: rgba(17, 21, 26, 0.62);
  padding: 6px;
}

.tabs button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
}

.tabs button.active {
  background: var(--amber);
  color: #15110a;
}

.tab-panel {
  display: grid;
  gap: 12px;
}

.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  gap: 12px;
}

.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));
}

.form {
  display: grid;
  gap: 12px;
  border: 1px solid #2f363e;
  background: rgba(17, 21, 26, 0.72);
  padding: 14px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  border: 0;
  background: rgba(5, 8, 12, 0.58);
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 21;
  width: min(620px, 100vw);
  height: 100vh;
  overflow: auto;
  border-left: 1px solid var(--line);
  background: #181b1f;
  box-shadow: var(--shadow);
  padding: 22px;
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.drawer-head h2 {
  margin: 8px 0 0;
  font-size: 24px;
}

.drawer .grid-2,
.drawer .grid-3,
.drawer .grid-4 {
  grid-template-columns: 1fr;
}

.picker-field {
  align-content: start;
}

.picker-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 30px;
  align-items: center;
}

.picker-options {
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
  border: 1px solid #2f363e;
  background: rgba(17, 21, 26, 0.72);
  padding: 8px;
}

.picker-option {
  display: grid;
  gap: 3px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 8px 10px;
}

.picker-option:hover,
.picker-option.active {
  border-color: rgba(243, 167, 18, 0.45);
  background: rgba(243, 167, 18, 0.12);
}

.picker-option small {
  color: var(--muted);
  font-size: 12px;
}

.list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

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

.row-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  box-shadow: none;
}

.row-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.row-actions {
  justify-content: flex-end;
  align-items: center;
}

.row-title {
  display: grid;
  gap: 3px;
}

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

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  border: 1px solid #3d444d;
  border-radius: 999px;
  color: #d9dee7;
  background: #151a20;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
}

.status-operational {
  color: #c8f5cf;
  border-color: rgba(98, 195, 112, 0.45);
}

.status-needs-review {
  color: #ffe4a5;
  border-color: rgba(243, 167, 18, 0.55);
}

.status-maintenance {
  color: #cfe0ff;
  border-color: rgba(121, 168, 255, 0.5);
}

.status-offline {
  color: #ffd2cd;
  border-color: rgba(240, 113, 103, 0.55);
}

.hidden {
  display: none !important;
}

.empty {
  border: 1px dashed #48515c;
  color: var(--muted);
  padding: 18px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  max-width: 420px;
  border: 1px solid var(--line);
  background: #151a20;
  color: var(--text);
  box-shadow: var(--shadow);
  padding: 13px 15px;
}

@media (max-width: 980px) {
  .shell {
    padding: 18px;
  }

  .layout,
  .grid-2,
  .grid-3,
  .grid-4,
  .list-toolbar,
  .stats {
    grid-template-columns: 1fr;
  }

  .nav {
    position: static;
  }

  .topbar,
  .panel-head,
  .section-head,
  .row-top {
    flex-direction: column;
  }

  .compact-list,
  .tabs {
    grid-template-columns: 1fr;
  }
}
