:root {
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #18243d;
  background: #f4f6fa;
  font-size: 16px;
  line-height: 1.5;
  color-scheme: light;
  --ink: #18243d;
  --muted: #52617a;
  --line: #dce3ef;
  --blue: #244eb7;
  --blue-light: #eaf0ff;
  --navy: #17254a;
  --danger: #9d283e;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.95rem, 4vw, 2.6rem); line-height: 1.12; letter-spacing: -.045em; }
h1[tabindex="-1"]:focus { outline: none; }
h2 { font-size: 1.15rem; line-height: 1.35; letter-spacing: -.02em; }
h3 { font-size: 1rem; }
p { color: var(--muted); }
p + p, h2 + p, h3 + p { margin-top: .55rem; }
a { color: var(--blue); }
button, input, textarea, select { font: inherit; }
button {
  min-height: 42px;
  padding: 8px 15px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--blue);
  color: white;
  cursor: pointer;
  font-weight: 650;
  font-size: .9rem;
  line-height: 1.3;
}
button:hover { filter: brightness(.93); }
button:disabled { opacity: .55; cursor: default; }
:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid #658bef;
  outline-offset: 3px;
}
.secondary { color: var(--ink); background: white; border-color: #cbd6e8; }
.danger { background: var(--danger); }
.danger-outline { color: var(--danger); background: #fff; border-color: #e5b5c0; }
.text-button { min-height: 36px; background: transparent; color: var(--blue); padding: 6px 4px; }

.topbar { background: #fff; border-bottom: 1px solid var(--line); }
.topbar-inner {
  max-width: 1490px;
  margin-inline: auto;
  padding: 12px clamp(16px, 3vw, 36px);
  min-height: 69px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--navy); text-decoration: none; font-size: 1.2rem; font-weight: 750; letter-spacing: -.04em; }
.account { position: relative; min-width: 0; max-width: min(330px, 40vw); margin-inline-start: auto; }
.account > summary {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 8px 4px 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  font-size: .86rem;
  font-weight: 650;
  list-style: none;
}
.account > summary::-webkit-details-marker { display: none; }
#identity { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: grid; place-items: center; flex: 0 0 30px; aspect-ratio: 1; border-radius: 7px; background: var(--blue-light); color: var(--blue); font-size: .72rem; }
.chevron { width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); flex: 0 0 7px; margin: 0 3px; }
.account-menu {
  position: absolute;
  z-index: 4;
  inset-block-start: calc(100% + 9px);
  inset-inline-end: 0;
  display: grid;
  gap: 7px;
  width: min(290px, calc(100vw - 32px));
  padding: 16px;
  overflow-wrap: anywhere;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 30px #17254a20;
}
.account-menu span { color: var(--muted); font-size: .86rem; margin-bottom: 4px; }
.account-menu button { text-align: left; }

.portal { max-width: 1490px; min-height: calc(100vh - 70px); margin-inline: auto; padding: 25px clamp(16px, 3vw, 36px) 40px; }
.main-nav {
  display: flex;
  align-self: stretch;
  align-items: center;
  gap: clamp(12px, 2vw, 26px);
  margin-inline-start: clamp(4px, 2vw, 24px);
}
.main-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 4px 0 2px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--blue); }
.main-nav a[aria-current="page"] { border-bottom-color: var(--blue); }
.company-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 16px; max-width: 850px; }
.company-form label { margin-bottom: 0; }
.company-form .muted-note, .company-form .actions { grid-column: 1 / -1; margin-top: 0; }
#companyList { margin-top: 12px; }
#companyList td:nth-child(2), #enrollmentServer { overflow-wrap: anywhere; }
.company-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.tab { min-width: 0; }
.title, .actions, .search, .pages { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.title { justify-content: space-between; }
.page-title { align-items: flex-end; margin: 2px 0 21px; gap: 16px; }
.page-title p { margin-top: 7px; }
.card { border: 1px solid var(--line); border-radius: 15px; background: #fff; margin: 0 0 16px; padding: clamp(16px, 2.6vw, 24px); box-shadow: 0 2px 6px #17254a06; }
.narrow { max-width: 585px; }
#login { max-width: 450px; margin: clamp(34px, 9vh, 100px) auto; padding: 30px; }
#settings { width: 100%; margin: clamp(8px, 3vw, 32px) auto 16px; }
#login form, #settings form, #accounts form { margin-top: 20px; }
#login h1 { margin: 6px 0 12px; }
.eyebrow { font-size: .73rem; font-weight: 750; color: var(--blue); letter-spacing: .08em; }
.index-card { padding: 0; }
.index-toolbar, .index-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 16px 20px;
}
.index-toolbar p, .index-footer p { font-size: .83rem; }
.index-footer { border-top: 1px solid var(--line); }
.index-footer .pages { margin: 0; }
.search { margin: 14px 0; }
.index-toolbar .search { margin: 0; }
.search input { width: auto; flex: 1 1 160px; min-width: 0; margin: 0; }
#deviceList .table-wrap { min-height: 104px; }
.device-list thead { background: #f6f8fd; }
.device-list th:first-child, .device-list td:first-child { padding-left: 20px; }
.device-list th:last-child, .device-list td:last-child { padding-right: 20px; text-align: right; }
.device-list tbody tr:last-child td { border-bottom: 0; }
.device-list tbody tr:hover { background: #fafbfe; }
.device-list td { vertical-align: middle; }
.device-list td:nth-child(4) { font-variant-numeric: tabular-nums; color: var(--muted); }
.device-cell { display: grid; gap: 2px; min-width: 0; }
.device-cell strong, .device-header h1 { overflow-wrap: anywhere; }
.device-cell span:not(.badge) { font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }
.device-cell .badge { justify-self: start; }
.device-header-status { margin-top: 8px; }
.remote-state small { color: var(--muted); font-size: .75rem; }
#kioskAvailability:empty { display: none; }
.mobile-last-contact { display: none; font-size: .72rem; color: var(--muted); }
.empty-state, .device-list > p { padding: 25px 20px; }
.row-link { white-space: nowrap; color: var(--blue); }
.row-link::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 8px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: translateY(-1px) rotate(45deg);
}

.back-link { margin-bottom: 12px; }
.back-link::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 9px 0 2px;
  border-left: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-1px) rotate(45deg);
}
.detail-nav { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 17px; overflow: auto; }
.detail-nav button { background: transparent; color: var(--muted); white-space: nowrap; border-radius: 8px 8px 0 0; border-bottom: 3px solid transparent; padding-inline: 13px; }
.detail-nav button[aria-pressed="true"] { background: #fff; color: var(--blue); border-bottom-color: var(--blue); }
.detail-nav button:focus-visible { outline-offset: -3px; }
.supervision-card dl { max-width: 560px; }
#deviceSupervision { margin-top: 14px; }
#deviceSupervision dl { margin: 14px 0; }
.muted-note { color: var(--muted); font-size: .82rem; }
.actions { margin-top: 14px; }
.release-card { border-top: 3px solid #ba5d70; }
.release-card > p { max-width: 70ch; }
.release-card .table-wrap { margin-top: 14px; }
.release-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.release-actions button { min-height: 36px; }
#managementReleaseStatus:not(:empty) { margin-top: 14px; }
#kioskResult:not(:empty) { margin-top: 12px; }

label { display: block; margin-bottom: 16px; color: var(--ink); font-size: .9rem; font-weight: 650; }
input, textarea, select { display: block; width: 100%; min-width: 0; margin-top: 6px; border: 1px solid #b9c6da; border-radius: 8px; padding: 9px 11px; background: #fff; color: var(--ink); }
textarea { resize: vertical; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 175px), 1fr)); gap: 12px; align-items: end; margin-top: 14px; }
.grid button { margin-bottom: 16px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .89rem; }
th, td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 700; font-size: .75rem; letter-spacing: .015em; }
td button { padding: 6px 11px; }
.table-wrap { overflow-x: auto; }
.pages { justify-content: flex-end; margin-top: 12px; color: var(--muted); font-size: .83rem; }
.pages button { min-height: 34px; padding: 6px 10px; font-size: .83rem; }
.badge { display: inline-block; padding: 4px 9px; border-radius: 20px; background: #edf1f8; color: #384e70; font-size: .79rem; font-weight: 620; }
.good { background: #e1f3ea; color: #226344; }
.bad { background: #fae8ed; color: #8c2a3e; }
.warning { background: #fff0d4; color: #75510c; }
.callout { margin-top: 16px; padding: 17px; border: 1px solid #c6d6f7; border-radius: 10px; background: #f0f5ff; }
.callout p + button { margin-top: 10px; }
#androidPreparationQr { display: block; width: min(100%, 300px); height: auto; margin: 12px 0; background: white; }
#androidPreparationSearch { margin-top: 12px; }
#androidPreparationSearch input { max-width: 300px; }
.code, code { font-family: Consolas, monospace; overflow-wrap: anywhere; }
.code { font-size: 1.125rem; color: #2148a4; user-select: all; }
code { font-size: .82rem; }
#notice { display: none; }
#notice:not(:empty) { display: block; margin: 0 0 15px; padding: 12px 15px; border-radius: 9px; background: var(--blue-light); color: #23458b; }
#notice.error:not(:empty) { background: #fae8ed; color: #8c2a3e; }
dialog { width: min(535px, calc(100vw - 30px)); max-height: 90vh; padding: 24px; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); }
dialog::backdrop { background: #131e39a8; }
dialog .actions { justify-content: flex-end; }
dialog label { margin-top: 15px; }
dialog button + label { margin-top: 12px; }
summary { cursor: pointer; font-weight: 650; }
dl { display: grid; grid-template-columns: minmax(105px, 1fr) minmax(0, 1.15fr); gap: 8px 14px; font-size: .86rem; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
#customers > .title { margin-bottom: 13px; }

@media (max-width: 760px) {
  .portal { padding-top: 14px; }
  .topbar-inner { flex-wrap: wrap; }
  .main-nav { order: 1; flex: 1 0 100%; margin-inline-start: 0; gap: clamp(9px, 2.8vw, 24px); flex-wrap: wrap; }
  .main-nav a { min-height: 36px; font-size: .85rem; }
}
@media (max-width: 550px) {
  .topbar-inner { gap: 8px; min-height: 60px; }
  .brand { font-size: 1.06rem; gap: 5px; }
  .brand img { width: 32px; height: 32px; }
  .index-toolbar, .index-footer { padding: 13px; }
  .index-toolbar .search { width: 100%; }
  .device-list thead, .device-list td:nth-child(4) { display: none; }
  .device-list td:first-child { padding-left: 12px; }
  .device-list td:last-child { padding-right: 12px; }
  .device-list td { padding: 12px 5px; }
  .mobile-last-contact { display: block; }
  .row-link { padding: 5px 7px; }
  .row-link::after { display: none; }
  .badge { font-size: .73rem; padding: 4px 7px; }
  .detail-nav button { padding-inline: 9px; font-size: .83rem; }
  .page-title { align-items: flex-start; }
  .company-form { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
