:root {
  font-family: system-ui, sans-serif;
  color: #0e0e35;
  background: #f2f6fb;
  font-synthesis: none;
  --line: #d7e3f1;
  --accent: #1964be;
  --accent-hover: #154f94;
  --accent-soft: #e8f2fd;
  --focus: #5da6ef;
  --highlight: #ffcb00;
  --muted: #4b5b75;
}
[hidden] { display: none !important; }
* { box-sizing: border-box; }
body { margin: 0; }
button, select, input { font: inherit; }
button, .button, select {
  display: inline-block; background: white; color: inherit; border: 1px solid #9ab2cf;
  border-radius: 8px; padding: .62rem .85rem; text-decoration: none;
}
button, .button, select { cursor: pointer; }
button:hover, .button:hover { border-color: var(--accent); background: var(--accent-soft); }
button:disabled, select:disabled { cursor: wait; opacity: .6; }
.primary, .primary:hover { background: var(--accent); color: white; border-color: var(--accent); }
.primary:hover { background: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .8rem;
  padding: 1rem max(1rem, calc((100% - 73rem) / 2)); border-bottom: 1px solid var(--line); background: white;
}
.brand { display: inline-flex; align-items: center; gap: .85rem; text-decoration: none; color: inherit; }
.brand img { display: block; width: clamp(8.5rem, 24vw, 11rem); height: auto; }
.brand span { border-left: 1px solid var(--line); padding-left: .75rem; font-size: .75rem; font-weight: 780; letter-spacing: .12em; }
.account, .actions, .token-row { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; }
.account { color: var(--muted); }
main { max-width: 75rem; margin: 0 auto; padding: clamp(1rem, 4vw, 3rem) 1rem; }
.intro, .detail { border: 1px solid var(--line); border-radius: 14px; background: white; padding: clamp(1rem, 4vw, 2.3rem); }
.intro { max-width: 35rem; margin: 7vh auto 0; border-top: 4px solid var(--highlight); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); font-weight: 740; letter-spacing: -.05em; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1rem; }
p, small { color: var(--muted); line-height: 1.5; }
.heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .9rem; margin-bottom: 1.1rem; }
nav { display: flex; gap: .45rem; border-bottom: 1px solid var(--line); margin-bottom: 1.6rem; padding-bottom: .6rem; }
nav button { border-color: transparent; background: transparent; }
nav button[aria-current] { background: var(--accent-soft); color: var(--accent-hover); font-weight: 690; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: white; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: .8rem .9rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); background: #f7faff; font-size: .83rem; }
tr:last-child td { border-bottom: 0; }
.device-link { border: 0; padding: 0; text-align: left; color: var(--accent); font-weight: 700; text-decoration: underline; }
td small { display: block; }
.status { white-space: nowrap; }
.online { color: #276141; font-weight: 700; }
.detail, .table-wrap + button { margin-top: 1rem; }
.records { padding-left: 1.25rem; }
.records li { margin-bottom: .55rem; }
.notice, .message { background: var(--accent-soft); border: 1px solid #b8d2ef; border-radius: 8px; padding: .8rem 1rem; margin: 0 0 1rem; }
.message[data-error] { background: #fff2ee; border-color: #e7bdb1; color: #713422; }
.token-row { margin-block: .5rem; }
.notification-form { display: grid; gap: .75rem; max-width: 40rem; }
.notification-form label { display: grid; gap: .25rem; }
.notification-form input, .notification-form textarea, #group-name { border: 1px solid #9ab2cf; border-radius: 8px; padding: .62rem; font: inherit; color: inherit; }
.filters { margin-block: .9rem; }
.ticket-codes { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.ticket-codes img { background: white; }
.ticket-codes dd { margin: 0 .7rem .5rem 0; font-family: ui-monospace, monospace; font-size: 1.25rem; font-weight: 740; }
.role-form { display: grid; gap: .55rem; justify-items: start; margin-top: .6rem; }
.role-form fieldset { display: grid; gap: .35rem; border: 1px solid var(--line); border-radius: 8px; }
td details summary { cursor: pointer; }
.checksum { overflow-wrap: anywhere; font-size: .85rem; }
.store-assignments-title { margin-block: 1.4rem .75rem; }
#store-assignment input, #store-assignment select { max-width: 100%; text-align: left; }
#store-assignments select { margin-right: .5rem; }
.device-identifiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .8rem; }
.device-identifiers dt { color: var(--muted); font-size: .84rem; }
.device-identifiers dd { margin: .25rem 0 0; font-weight: 700; overflow-wrap: anywhere; }
#device-inventory { margin-block: 1.25rem; }
#installed-search { border: 1px solid #9ab2cf; border-radius: 8px; padding: .5rem; font: inherit; color: inherit; }

.device-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-block: 1rem; }
.device-tabs button[aria-pressed="true"] { background: var(--navy, #153b76); color: #fff; }
#installed-status:empty { display: none; }

body { padding-bottom: env(safe-area-inset-bottom); }
.topbar { padding-top: calc(1rem + env(safe-area-inset-top)); }
main { padding-left: max(1rem, env(safe-area-inset-left)); padding-right: max(1rem, env(safe-area-inset-right)); }
nav { flex-wrap: wrap; }
.dashboard-banner { padding: clamp(1.15rem, 5vw, 2.5rem); background: #0e2350; color: #fff; border-radius: 18px; border-top: 4px solid var(--highlight); }
.dashboard-banner .heading { margin-bottom: 1.35rem; }
.dashboard-banner .heading button { background: transparent; color: #fff; border-color: #92a9cd; }
.dashboard-banner .heading button:hover { background: #263c68; }
.dashboard-search { display: grid; gap: .45rem; max-width: 45rem; }
.dashboard-search label { color: #e1efff; }
.dashboard-search > div { display: flex; gap: .5rem; }
.dashboard-search input { min-width: 0; flex: 1; padding: .7rem .8rem; border: 1px solid #9ab2cf; border-radius: 8px; background: white; color: #0e0e35; }
.dashboard-search button { background: var(--highlight); color: #0e0e35; border-color: var(--highlight); font-weight: 700; }
.dashboard-search button:hover { background: #ffdb50; }
.dashboard-stats, .dashboard-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin-block: 1rem; }
.dashboard-stats button, .dashboard-tile { display: flex; text-align: left; border-radius: 12px; border-color: var(--line); }
.dashboard-stats button { flex-direction: column; justify-content: space-between; gap: .35rem; padding: .9rem 1rem; }
.dashboard-stats span { color: var(--muted); font-size: .89rem; }
.dashboard-stats strong { font-size: clamp(1.5rem, 5vw, 2.15rem); }
.count-online::before, .count-offline::before { content: ""; display: inline-block; width: .52em; height: .52em; margin-right: .4em; border-radius: 50%; vertical-align: .12em; background: #21865b; }
.count-offline::before { background: #79869b; }
.dashboard-tile { align-items: center; gap: .65rem; min-height: 4.7rem; font-weight: 690; }
.tile-icon { display: grid; place-items: center; width: 2.7rem; height: 2.7rem; flex-shrink: 0; border-radius: 10px; background: var(--accent-soft); color: #19467e; }
.tile-icon svg { width: 1.45rem; height: 1.45rem; stroke: currentColor; stroke-width: 1.65; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.dashboard-tile[data-dashboard-go="notifications"] .tile-icon { background: #fff1b8; color: #604400; }
.search-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: .5rem; list-style: none; padding: 0; margin: .55rem 0 1rem; }
.search-list button { width: 100%; height: 100%; text-align: left; overflow-wrap: anywhere; }
.search-list small { display: block; }
#search-status:empty { display: none; }
.bulk-notification { scroll-margin-bottom: 1rem; }
.notification-form select, .notification-form input, .notification-form textarea { width: 100%; min-width: 0; }
#bulk-result { margin: 0; }
@media (max-width: 760px) {
  .dashboard-stats, .dashboard-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-tile { padding: .55rem; gap: .52rem; overflow-wrap: anywhere; }
  .notification-form textarea, input[type="search"], .notification-form input { font-size: 16px; }
  .topbar { padding-left: max(1rem, env(safe-area-inset-left)); padding-right: max(1rem, env(safe-area-inset-right)); }
}

.workspace-back { margin-bottom: 1rem; }

#device-support-panel .actions { margin-block: .85rem; }
.support-screen { display: grid; place-items: center; margin: .9rem 0 0; padding: .65rem; border-radius: 12px; background: #0e0e35; }
.support-screen img { display: block; max-width: 100%; max-height: 70vh; object-fit: contain; }
.support-screen img[data-control] { cursor: crosshair; touch-action: none; user-select: none; }
#support-feedback { margin-block: .5rem; }

.documentation-content { max-width: 67rem; line-height: 1.6; overflow-wrap: anywhere; }
.documentation-content h2 { margin: 1.45rem 0 .5rem; }
.documentation-content h3 { margin: 1rem 0 .35rem; }
.documentation-content p, .documentation-content ul, .documentation-content ol { margin: .55rem 0 .85rem; }
.documentation-content .table-wrap { margin-block: .85rem; }
.documentation-content th, .documentation-content td { vertical-align: top; }
.documentation-content table { min-width: 30rem; }
.documentation-content code { font-size: .9em; }
.documentation-content pre { padding: .85rem; border-radius: 8px; overflow: auto; background: #f2f6fb; }
.documentation-content a { color: var(--accent-hover); }
.support-system button { background: var(--accent-soft); }
