:root {
  --background: #faf9fd;
  --surface: #ffffff;
  --surface-soft: #f4f3f7;
  --text: #1a1c1e;
  --muted: #74777f;
  --outline: #c4c6cf;
  --primary: #002045;
  --primary-container: #1a365d;
  --secondary: #1960a3;
  --secondary-soft: #d3e4ff;
  --success: #137333;
  --success-soft: #e7f6ec;
  --warning: #9a5b00;
  --warning-soft: #fff4da;
  --error: #ba1a1a;
  --error-soft: #ffdad6;
  --process: #1960a3;
  --process-soft: #e8f2ff;
  --shadow: 0 4px 14px rgba(0, 32, 69, 0.06);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #f7fafc;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  padding-top: 64px;
  padding-bottom: 76px;
}

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

.hide {
  display: none !important;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  width: 100%;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-weight: 900;
  letter-spacing: -0.04em;
}

.brand .material-symbols-outlined {
  font-size: 20px;
}

.node-badge,
.step-pill,
.status-chip {
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.node-badge {
  padding: 5px 8px;
  color: var(--muted);
  background: var(--surface-soft);
}

main {
  max-width: 1120px;
  margin: 0 auto;
}

.view {
  padding: 24px;
}

.login-view {
  min-height: calc(100vh - 140px);
  display: grid;
  place-items: center;
}

.login-card {
  width: 100%;
  max-width: 380px;
}

.login-title {
  margin-bottom: 32px;
  text-align: center;
}

.login-title h1,
.dashboard-head h2,
.wizard-title-row h2,
.step-card h3 {
  margin: 0;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.login-title h1 {
  font-size: 30px;
  line-height: 38px;
}

.login-title p,
.muted,
.wizard-title-row p,
.step-card p,
.node-card p,
.summary-line span {
  color: var(--muted);
}

.form-stack {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 6px;
}

label span,
.section-label,
.field-label {
  color: #43474e;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 6px;
  outline: none;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 32, 69, 0.12);
}

.btn {
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 800;
  cursor: pointer;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.btn-primary {
  color: white;
  background: var(--primary-container);
  box-shadow: var(--shadow);
}

.btn-secondary {
  color: var(--primary);
  background: white;
  border-color: var(--outline);
}

.btn-danger {
  color: var(--error);
  background: var(--error-soft);
  border-color: #efaaa5;
}

.btn-ghost,
.link-button {
  color: var(--secondary);
  background: transparent;
}

.link-button {
  width: 100%;
  margin-top: 20px;
  border: 0;
  font-weight: 700;
}

.dashboard-view,
.wizard-view {
  display: grid;
  gap: 24px;
}

.dashboard-head,
.wizard-title-row,
.node-card-head,
.wifi-row,
.playlist-row,
.summary-line,
.check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-head h2 {
  font-size: 24px;
}

.avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: 2px solid var(--primary-container);
  border-radius: 999px;
  font-weight: 900;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.metric-card,
.node-card,
.step-card,
.panel-card {
  background: var(--surface);
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.metric-card {
  display: grid;
  gap: 3px;
  padding: 16px 8px;
  text-align: center;
}

.metric-card strong {
  color: var(--primary);
  font-size: 24px;
}

.metric-card span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.metric-alert strong {
  color: var(--error);
}

.filter-row {
  display: grid;
  grid-template-columns: 1fr 132px;
  gap: 8px;
}

.node-list {
  display: grid;
  gap: 12px;
}

.node-card-head {
  align-items: flex-start;
  padding: 16px;
  border-bottom: 1px solid #edf2f7;
}

.node-card h4 {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 20px;
}

.node-card p {
  margin: 2px 0;
  font-size: 14px;
}

.node-card-actions {
  padding: 16px;
  background: #fbfdff;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
}

.status-pending {
  color: var(--warning);
  background: var(--warning-soft);
}

.status-online {
  color: var(--success);
  background: var(--success-soft);
}

.status-alert {
  color: var(--error);
  background: var(--error-soft);
}

.wizard-view {
  padding: 0 0 24px;
}

.wizard-header {
  position: sticky;
  top: 64px;
  z-index: 40;
  padding: 16px 24px 12px;
  background: white;
  border-bottom: 1px solid #e2e8f0;
}

.wizard-title-row h2 {
  font-size: 20px;
}

.wizard-title-row p {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 700;
}

.step-pill {
  padding: 6px 10px;
  color: var(--primary);
  background: var(--secondary-soft);
}

.progress-track {
  height: 8px;
  margin-top: 16px;
  overflow: hidden;
  background: #edf2f7;
  border-radius: 999px;
}

.progress-bar {
  width: 11.111%;
  height: 100%;
  background: var(--secondary);
  transition: width 220ms ease;
}

.step-labels {
  display: flex;
  gap: 16px;
  padding-top: 14px;
  overflow-x: auto;
}

.step-labels span {
  flex: 0 0 auto;
  padding-bottom: 5px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.step-labels .active {
  color: var(--primary);
  border-color: var(--primary);
}

.step-content {
  padding: 24px;
}

.step-card {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.step-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  color: var(--primary);
  background: var(--secondary-soft);
  border-radius: 999px;
}

.step-icon .material-symbols-outlined {
  font-size: 34px;
}

.step-card h3,
.step-card > p {
  text-align: center;
}

.step-card h3 {
  font-size: 22px;
}

.step-card p {
  margin: 0;
  line-height: 1.45;
}

.info-grid {
  display: grid;
  gap: 10px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: var(--surface-soft);
  border-radius: 8px;
}

.info-item span:first-child {
  color: var(--muted);
  font-weight: 700;
}

.info-item strong {
  text-align: right;
}

.success-box,
.warning-box,
.error-box,
.process-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  font-weight: 800;
}

.success-box {
  color: var(--success);
  background: var(--success-soft);
  border: 1px solid #bbdfc5;
}

.warning-box {
  color: var(--warning);
  background: var(--warning-soft);
  border: 1px solid #f3d296;
}

.error-box {
  color: var(--error);
  background: var(--error-soft);
  border: 1px solid #efaaa5;
}

.process-box {
  color: var(--process);
  background: var(--process-soft);
  border: 1px solid #bdd8ff;
}

.wifi-list,
.playlist-list,
.checklist {
  display: grid;
  gap: 10px;
}

.wifi-row,
.playlist-row,
.check-row {
  padding: 14px;
  background: #fbfdff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.wifi-row.selected,
.playlist-row.selected {
  border-color: var(--secondary);
  box-shadow: 0 0 0 2px rgba(25, 96, 163, 0.12);
}

.wifi-row strong,
.playlist-row strong {
  display: block;
  color: var(--primary);
}

.wifi-row small,
.playlist-row small {
  color: var(--muted);
}

.map-placeholder {
  height: 150px;
  display: grid;
  place-items: center;
  color: var(--primary);
  background:
    linear-gradient(90deg, rgba(25, 96, 163, .08) 1px, transparent 1px),
    linear-gradient(rgba(25, 96, 163, .08) 1px, transparent 1px),
    #f8fbff;
  background-size: 20px 20px;
  border: 1px solid #dbe7f8;
  border-radius: 8px;
  font-weight: 900;
}

.wizard-actions {
  position: sticky;
  bottom: 76px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 24px;
  background: rgba(250, 249, 253, 0.94);
  border-top: 1px solid #e2e8f0;
  backdrop-filter: blur(8px);
}

.block-message {
  margin: 0 24px 16px;
}

.sim-actions {
  display: grid;
  gap: 8px;
  padding-top: 4px;
}

.wizard-action-right {
  display: flex;
  gap: 8px;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 50;
  width: 100%;
  height: 76px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: white;
  border-top: 1px solid #e2e8f0;
}

.bottom-nav button {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  color: var(--muted);
  background: transparent;
  border: 0;
}

.bottom-nav .active {
  color: var(--secondary);
  background: #eff6ff;
}

.bottom-nav small {
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

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

.summary-line {
  padding-bottom: 8px;
  border-bottom: 1px solid #edf2f7;
}

@media (min-width: 760px) {
  body {
    padding-bottom: 0;
  }

  .dashboard-view {
    grid-template-columns: 1fr;
  }

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

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

  .step-content {
    max-width: 760px;
    margin: 0 auto;
  }

  .bottom-nav {
    display: none;
  }

  .wizard-actions {
    bottom: 0;
  }
}
