* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, "Noto Sans Hebrew", sans-serif;
  background: #f5f7fb;
  color: #152033;
}
button, input, select {
  font: inherit;
}
button {
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  background: #1d4ed8;
  color: white;
  cursor: pointer;
}
button.secondary {
  background: #e2e8f0;
  color: #152033;
}
button.danger {
  background: #dc2626;
}
[hidden] { display: none !important; }
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-box {
  width: min(420px, 100%);
  background: white;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, .08);
}
.login-box h1 { margin: 0 0 8px; }
label {
  display: grid;
  gap: 6px;
  color: #526176;
  font-size: 14px;
}
input, select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 12px;
  background: white;
  color: #152033;
}
form {
  display: grid;
  gap: 14px;
}
.error, .alert {
  margin-top: 12px;
  color: #b91c1c;
}
.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: white;
  border-bottom: 1px solid #dbe3ef;
}
.topbar span {
  margin-inline-start: 12px;
  color: #64748b;
}
.layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 64px);
}
.sidebar {
  background: #0f172a;
  padding: 18px;
  display: grid;
  align-content: start;
  gap: 8px;
}
.sidebar button {
  background: transparent;
  color: #cbd5e1;
  text-align: right;
}
.sidebar button.active {
  background: #1d4ed8;
  color: white;
}
.content {
  padding: 28px;
  overflow: auto;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 16px;
}
.stats article {
  background: white;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  padding: 22px;
}
.stats span {
  display: block;
  font-size: 34px;
  font-weight: 700;
}
.stats small { color: #64748b; }
.form-grid {
  margin: 18px 0;
  padding: 18px;
  background: white;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  align-items: end;
}
.table-wrap {
  margin-top: 18px;
  background: white;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}
th, td {
  padding: 12px;
  border-bottom: 1px solid #e2e8f0;
  text-align: right;
  white-space: nowrap;
}
th {
  background: #f8fafc;
  color: #475569;
}
.actions {
  display: flex;
  gap: 8px;
}
.pairing-code {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid #93c5fd;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
}
.pairing-code span {
  display: inline-block;
  margin: 0 8px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 1px;
}
.command-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}
.details {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.details div {
  background: white;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  padding: 14px;
}
.details strong,
.details span {
  display: block;
}
.details strong {
  color: #64748b;
  font-size: 13px;
  margin-bottom: 6px;
}
@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    grid-auto-flow: column;
    overflow: auto;
  }
  .stats, .form-grid, .details { grid-template-columns: 1fr; }
}
