:root {
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: #172033;
  background: #f3f6fb;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

body { margin: 0; min-width: 320px; -webkit-text-size-adjust: 100%; }

.shell { max-width: 1320px; margin: 0 auto; padding: 40px 24px 72px; }
.topbar, .section-heading, .dialog-heading, .toolbar, .dialog-actions, .inline-fields {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.topbar { margin-bottom: 32px; }
.eyebrow { color: #2563eb; font-size: 12px; font-weight: 800; letter-spacing: .14em; margin: 0 0 8px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(26px, 4vw, 36px); }
h2 { font-size: 20px; margin-bottom: 8px; }
.muted { color: #667085; }
.small { font-size: 13px; }
.panel, .table-wrap {
  background: #fff;
  border: 1px solid #e3e8f0;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgb(22 34 56 / 5%);
}
.login-panel { max-width: 460px; padding: 28px; }
form { display: grid; gap: 12px; }
label { font-size: 14px; font-weight: 700; }
input, select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #ccd4e0;
  border-radius: 8px;
  background: #fff;
  color: inherit;
  font: inherit;
  padding: 8px 11px;
}
input:focus, select:focus { outline: 3px solid rgb(37 99 235 / 18%); border-color: #2563eb; }
.button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  min-height: 40px;
  padding: 9px 14px;
}
.button.primary { color: #fff; background: #2458d3; }
.button.primary:hover { background: #1948b7; }
.button.secondary { color: #25324a; background: #edf1f7; }
.button.secondary:hover { background: #e0e7f1; }
.button.danger { color: #a32020; background: #feecec; }
.button.small-button { min-height: 32px; padding: 6px 9px; font-size: 13px; }
.hidden { display: none !important; }
.error { min-height: 20px; color: #b42318; margin: 0; font-size: 14px; }
.section-heading { align-items: flex-end; margin-bottom: 18px; }
.section-heading h2 { margin-bottom: 5px; }
.section-heading p { margin-bottom: 0; }
.toolbar { flex-wrap: wrap; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; min-width: 920px; text-align: right; width: 100%; }
th, td { border-bottom: 1px solid #edf0f5; padding: 14px 16px; vertical-align: middle; }
th { color: #596579; background: #f9fafc; font-size: 13px; white-space: nowrap; }
td { font-size: 14px; }
tbody tr:last-child td { border-bottom: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.status { display: inline-flex; border-radius: 999px; padding: 4px 9px; font-size: 12px; font-weight: 700; }
.status.active { color: #027a48; background: #e7f8ef; }
.status.suspended { color: #b42318; background: #feecec; }
.empty { padding: 24px; text-align: center; color: #667085; }
.notice { margin: 0 0 16px; border-radius: 8px; padding: 12px 14px; background: #eaf3ff; color: #1849a9; }
.notice.error-notice { background: #fff0ef; color: #a32020; }
.dialog {
  width: min(520px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  border: 0;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 24px 70px rgb(16 24 40 / 25%);
}
.dialog::backdrop { background: rgb(16 24 40 / 52%); }
.dialog form { gap: 10px; }
.dialog-heading { margin-bottom: 14px; }
.dialog-heading h2 { margin: 0; }
.dialog-heading p { margin: 5px 0 0; }
.icon-button { background: none; border: 0; cursor: pointer; color: #667085; font-size: 26px; line-height: 1; }
.inline-fields { justify-content: flex-start; }
.inline-fields input { flex: 1; }
.inline-fields select { width: 130px; }
.dialog-actions { justify-content: flex-start; margin-top: 6px; }
.wide-dialog { width: min(820px, calc(100vw - 28px)); }
.device-list, .audit-list { display: grid; gap: 10px; }
.device-card, .audit-card { border: 1px solid #e3e8f0; border-radius: 9px; padding: 12px; }
.device-card code { display: block; direction: ltr; text-align: left; overflow-wrap: anywhere; margin: 8px 0; }
.device-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.audit-card { font-size: 14px; }
.audit-card time { display: block; color: #667085; font-size: 12px; margin-top: 5px; }
.code-value { display: block; direction: ltr; overflow-wrap: anywhere; background: #f2f5fa; border-radius: 8px; padding: 14px; margin: 12px 0; font-size: 15px; }

@media (max-width: 760px) {
  .shell { padding: 24px 14px 48px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .toolbar { justify-content: flex-start; }
  .topbar { align-items: flex-start; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
}
