:root {
  color-scheme: dark;
  --theme-name: "Graphite";
  --ink: #f0f4f6;
  --muted: #b9c6cf;
  --line: rgba(183, 196, 207, 0.28);
  --surface: rgba(30, 43, 53, 0.76);
  --surface-strong: rgba(21, 31, 40, 0.86);
  --surface-soft: rgba(42, 57, 69, 0.58);
  --page: #22313d;
  --page-end: #151f28;
  --page-mid: #2a343d;
  --green: #2f9e74;
  --red: #d8616e;
  --yellow: #ffc857;
  --teal: #8fc2e8;
  --blue: #8fc2e8;
  --charcoal: #f4f8fb;
  --brand-mark-bg: #8fc2e8;
  --brand-mark-soft: #d6e4ee;
  --brand-mark-ink: #151f28;
  --status-online: #2f9e74;
  --sidebar-bg: rgba(21, 31, 40, 0.78);
  --sidebar-ink: #f0f4f6;
  --sidebar-muted: #b9c6cf;
  --sidebar-active-bg: rgba(47, 158, 116, 0.16);
  --sidebar-active-border: rgba(47, 158, 116, 0.48);
  --sidebar-card-bg: rgba(42, 57, 69, 0.54);
  --input-bg: rgba(21, 31, 40, 0.82);
  --shadow: 0 20px 58px rgba(0, 0, 0, 0.34);
}

html[data-theme="silver"],
html[data-theme="light"] {
  color-scheme: light;
  --theme-name: "Silver";
  --ink: #18222b;
  --muted: #44515c;
  --line: #7e8b96;
  --surface: rgba(232, 236, 239, 0.76);
  --surface-strong: rgba(240, 242, 244, 0.88);
  --surface-soft: rgba(199, 208, 216, 0.60);
  --page: #d8dee4;
  --page-end: #c7d0d8;
  --page-mid: #e2e6ea;
  --green: #2f9e74;
  --red: #d8616e;
  --yellow: #ffc857;
  --teal: #2f5f86;
  --blue: #2f5f86;
  --charcoal: #172636;
  --brand-mark-bg: #2f5f86;
  --brand-mark-soft: #d6e4ee;
  --brand-mark-ink: #ffffff;
  --status-online: #2f9e74;
  --sidebar-bg: rgba(199, 208, 216, 0.76);
  --sidebar-ink: #18222b;
  --sidebar-muted: #44515c;
  --sidebar-active-bg: rgba(47, 95, 134, 0.14);
  --sidebar-active-border: rgba(47, 95, 134, 0.38);
  --sidebar-card-bg: rgba(232, 236, 239, 0.72);
  --input-bg: rgba(238, 241, 243, 0.86);
  --shadow: 0 18px 46px rgba(27, 38, 48, 0.18);
}

html[data-theme="graphite"],
html[data-theme="dark"] {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, var(--page), var(--page-mid) 46%, var(--page-end));
  background-attachment: fixed;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

body:not(.is-authenticated) .app-shell {
  display: none;
}

body.is-authenticated .login-screen {
  display: none;
}

.is-hidden {
  display: none !important;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0)),
    var(--page);
}

.login-panel {
  width: min(100%, 980px);
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.login-brand {
  grid-column: 1 / -1;
  color: var(--ink);
}

.login-brand .brand span {
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.login-form input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
}

.login-error {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
}

.login-users {
  display: grid;
  gap: 10px;
  grid-column: 2;
}

.account-badge {
  display: grid;
  min-width: 190px;
  gap: 2px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.account-badge strong,
.account-badge span {
  display: block;
}

.account-badge strong {
  font-size: 13px;
}

.account-badge span {
  color: var(--muted);
  font-size: 12px;
}

.app-shell {
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr);
  min-height: 100vh;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 42%);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px 18px;
  color: var(--sidebar-ink);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
}

.brand-home {
  width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.brand-home:hover .brand-mark,
.brand-home:focus-visible .brand-mark {
  background: var(--brand-mark-soft);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--brand-mark-ink);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 24px rgba(8, 22, 38, 0.20);
  font-weight: 900;
  letter-spacing: 0;
}

.brand-mark img {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.brand strong,
.brand span,
.sidebar-status strong,
.sidebar-status span {
  display: block;
}

.brand strong {
  font-size: 18px;
}

.brand span,
.sidebar-status span {
  color: var(--sidebar-muted);
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 18px;
}

.nav-section {
  display: grid;
  gap: 8px;
}

.nav-section-title {
  margin: 0 0 2px;
  padding: 0 12px;
  color: var(--sidebar-muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--sidebar-ink);
  background: transparent;
  text-align: left;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.nav-item.sync-attention::after {
  content: "!";
  position: absolute;
  right: 10px;
  top: 50%;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: var(--red);
  font-size: 12px;
  font-weight: 950;
  transform: translateY(-50%);
}

.nav-item:hover,
.nav-item.active {
  border-color: var(--sidebar-active-border);
  background: var(--sidebar-active-bg);
}

.nav-item:hover {
  transform: translateX(2px);
}

.nav-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--sidebar-ink);
  background: rgba(255, 255, 255, 0.10);
  font-size: 0;
}

.nav-item.active .nav-icon {
  border-color: var(--sidebar-active-border);
  background: rgba(47, 158, 116, 0.18);
}

.nav-icon::before,
.nav-icon::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}

.nav-icon::before {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 4px;
  opacity: 0.92;
}

.nav-icon::after {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.nav-item[data-view="home"] .nav-icon::before {
  border-radius: 50%;
}

.nav-item[data-view="home"] .nav-icon::after {
  width: 12px;
  height: 2px;
  border-radius: 999px;
  transform: translateY(8px);
}

.nav-item[data-view="companyprofiles"] .nav-icon::before,
.nav-item[data-view="enterprise"] .nav-icon::before {
  width: 15px;
  height: 12px;
  border-radius: 3px;
}

.nav-item[data-view="companyprofiles"] .nav-icon::after,
.nav-item[data-view="enterprise"] .nav-icon::after {
  width: 10px;
  height: 2px;
  border-radius: 999px;
  transform: translateY(1px);
}

.nav-item[data-view="access"] .nav-icon::before,
.nav-item[data-view="users"] .nav-icon::before,
.nav-item[data-view="loginlogs"] .nav-icon::before {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: translateY(-4px);
}

.nav-item[data-view="access"] .nav-icon::after,
.nav-item[data-view="users"] .nav-icon::after,
.nav-item[data-view="loginlogs"] .nav-icon::after {
  width: 16px;
  height: 7px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 9px 9px;
  background: transparent;
  transform: translateY(7px);
}

.nav-item[data-view="phones"] .nav-icon::before {
  width: 11px;
  height: 17px;
  border-radius: 4px;
}

.nav-item[data-view="phones"] .nav-icon::after {
  width: 4px;
  height: 2px;
  border-radius: 999px;
  transform: translateY(6px);
}

.nav-item[data-view="schedulers"] .nav-icon::before,
.nav-item[data-view="logs"] .nav-icon::before {
  border-radius: 50%;
}

.nav-item[data-view="schedulers"] .nav-icon::after,
.nav-item[data-view="logs"] .nav-icon::after {
  width: 7px;
  height: 2px;
  border-radius: 999px;
  transform: rotate(35deg) translate(2px, -1px);
}

.nav-item[data-view="urgencylogs"] .nav-icon::before {
  width: 13px;
  height: 16px;
  border-radius: 4px;
}

.nav-item[data-view="urgencylogs"] .nav-icon::after {
  width: 8px;
  height: 2px;
  border-radius: 999px;
  transform: translateY(-2px);
}

.nav-item[data-view="maps"] .nav-icon::before {
  width: 16px;
  height: 16px;
  border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
}

.nav-item[data-view="maps"] .nav-icon::after {
  transform: translateY(-2px);
}

.nav-item[data-view="plans"] .nav-icon::before {
  width: 16px;
  height: 12px;
  border-radius: 3px;
  transform: skewX(-8deg);
}

.nav-item[data-view="emailrelay"] .nav-icon::before {
  width: 16px;
  height: 12px;
  border-radius: 3px;
}

.nav-item[data-view="emailrelay"] .nav-icon::after {
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-left: 0;
  border-bottom: 0;
  border-radius: 0;
  background: transparent;
  transform: rotate(135deg) translate(-1px, 2px);
}

.nav-item[data-view="holiday"] .nav-icon::before {
  width: 16px;
  height: 14px;
  border-radius: 3px;
}

.nav-item[data-view="holiday"] .nav-icon::after {
  width: 12px;
  height: 2px;
  border-radius: 999px;
  transform: translateY(-4px);
}

.nav-item[data-view="payloads"] .nav-icon::before,
.nav-item[data-view="serverstatus"] .nav-icon::before,
.nav-item[data-view="translations"] .nav-icon::before {
  width: 16px;
  height: 12px;
  border-radius: 3px;
}

.nav-item[data-view="payloads"] .nav-icon::after,
.nav-item[data-view="serverstatus"] .nav-icon::after,
.nav-item[data-view="translations"] .nav-icon::after {
  width: 7px;
  height: 7px;
  border: 2px solid currentColor;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
  background: transparent;
  transform: rotate(135deg);
}

.sidebar-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--sidebar-card-bg);
  backdrop-filter: blur(14px);
}

.status-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--yellow);
}

.status-dot.online {
  background: var(--status-online);
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
}

h2 {
  margin-bottom: 5px;
  font-size: 21px;
}

h3 {
  margin-bottom: 14px;
  font-size: 16px;
}

p {
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: end;
  gap: 12px;
}

.theme-toggle-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  font-size: 12px;
  font-weight: 900;
}

.theme-toggle-track {
  position: relative;
  width: 42px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
}

.theme-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.24);
  transition: transform 160ms ease;
}

html[data-theme="graphite"] .theme-toggle-thumb,
html[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(18px);
}

.context-bar {
  display: flex;
  align-items: end;
  gap: 12px;
  justify-content: flex-start;
  margin: -8px 0 14px;
}

.context-bar label {
  display: grid;
  gap: 5px;
  min-width: 260px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.device-sync-button {
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 950;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.device-card-sync-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 950;
}

.device-sync-button.needs-sync,
.device-card-sync-button.needs-sync {
  border-color: rgba(216, 97, 110, 0.65);
  background: var(--red);
}

.device-sync-button.is-synced,
.device-card-sync-button.is-synced {
  border-color: rgba(47, 158, 116, 0.76);
  background: var(--green);
}

select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--input-bg);
  color: var(--ink);
}

.primary-button,
.secondary-button {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 14px;
  border: 1px solid transparent;
  font-weight: 800;
}

.primary-button {
  color: #ffffff;
  background: var(--green);
}

.primary-button.danger-button {
  background: var(--red);
}

.secondary-button {
  color: var(--ink);
  background: var(--surface-soft);
  border-color: var(--line);
}

.mode-banner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.mode-banner strong,
.mode-banner span {
  display: block;
}

.mode-banner strong {
  margin-bottom: 4px;
  font-size: 18px;
}

.mode-banner span {
  color: var(--muted);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.metric {
  min-height: 126px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
}

.metric strong {
  display: block;
  margin: 8px 0 2px;
  font-size: 34px;
}

.tile-ok {
  border-top: 5px solid var(--green);
}

.tile-warn {
  border-top: 5px solid var(--red);
}

.tile-calm {
  border-top: 5px solid var(--blue);
}

.tile-device {
  border-top: 5px solid var(--yellow);
}

.view-panel {
  display: none;
}

.active-view {
  display: block;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.section-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.compact-sync-key {
  display: grid;
  gap: 4px;
  min-width: 210px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.compact-sync-key input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--input-bg);
}

.section-header p {
  margin-bottom: 0;
}

.map-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.map-title-row h2 {
  margin: 0;
}

.enterprise-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.segmented-control,
.map-tools {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: nowrap;
}

.map-tools {
  justify-content: flex-start;
}

.map-tools label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.map-tools select {
  min-width: 170px;
}

.compact-map-action {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
  white-space: nowrap;
}

.map-status-grid {
  display: grid;
  grid-template-columns: minmax(230px, 300px) minmax(280px, 1fr) minmax(300px, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.map-status-grid h3 {
  margin-bottom: 10px;
}

.map-meta-list {
  display: grid;
  gap: 8px;
}

.map-meta-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.map-meta-list div:last-child {
  border-bottom: 0;
}

.map-meta-list strong {
  color: var(--ink);
  text-align: right;
}

.segment {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 800;
}

.segment.active {
  border-color: var(--green);
  color: #ffffff;
  background: var(--green);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

th[data-patrol-sort],
th[data-login-sort] {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

th[data-patrol-sort]:hover,
th[data-login-sort]:hover {
  color: var(--text);
}

.compact-filter-control {
  display: grid;
  gap: 6px;
  min-width: 180px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.compact-filter-control select {
  width: 100%;
}

.log-filter-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 0 0 8px;
  align-items: end;
}

.log-filter-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.log-filter-controls select,
.log-filter-controls input {
  width: 100%;
}

.switch-filter-control {
  position: relative;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.switch-filter-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: auto;
}

.switch-control-ui {
  position: relative;
  width: 42px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  transition: background 160ms ease, border-color 160ms ease;
}

.switch-control-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--muted);
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.22);
  transition: transform 160ms ease, background 160ms ease;
}

.switch-filter-control input:checked + .switch-control-ui {
  border-color: var(--green);
  background: var(--green);
}

.switch-filter-control input:checked + .switch-control-ui::after {
  background: #fff;
  transform: translateX(18px);
}

.attendance-gap-row td {
  background: rgba(216, 97, 110, 0.12);
}

.attendance-gap-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--red);
  background: rgba(216, 97, 110, 0.14);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.column-filter-row th {
  padding-top: 4px;
  vertical-align: middle;
}

.column-filter-row input {
  width: 100%;
  min-width: 82px;
  padding: 7px 8px;
  font-size: 12px;
  text-transform: none;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.activity-details {
  min-width: 260px;
}

.activity-details summary {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.activity-detail-grid {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 5px 10px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.activity-detail-grid span {
  color: var(--muted);
  font-weight: 800;
}

.activity-detail-grid strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.activity-checkpoints {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.activity-checkpoints em {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--teal);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.pill.ok {
  color: #d9f5e8;
  background: rgba(47, 158, 116, 0.28);
}

.pill.warn {
  color: #ffe6a3;
  background: rgba(255, 200, 87, 0.24);
}

.pill.bad {
  color: #ffd7dc;
  background: rgba(216, 97, 110, 0.24);
}

.text-ok {
  color: var(--green);
}

.text-warn {
  color: var(--yellow);
}

.text-bad {
  color: var(--red);
}

.access-layout,
.enterprise-layout,
.config-layout {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.access-layout,
.enterprise-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.enterprise-layout.security-provider-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.access-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.config-layout {
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr) minmax(280px, 420px);
}

.user-admin-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.user-admin-layout .setup-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.user-admin-layout .form-actions {
  grid-column: 1 / -1;
}

.patrol-users-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.patrol-user-form,
.patrol-login-settings-form,
.patrol-mobile-admin-form {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.patrol-user-form .form-actions,
.patrol-login-settings-form .primary-button,
.patrol-mobile-admin-form .primary-button,
.patrol-login-settings-form .form-message,
.patrol-mobile-admin-form .form-message {
  grid-column: 1 / -1;
}

.patrol-user-list {
  margin-top: 14px;
}

.patrol-user-card {
  gap: 8px;
}

.patrol-user-profile-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.patrol-user-identity {
  display: grid;
  gap: 4px;
}

.patrol-user-identity small {
  font-size: 12px;
}

.patrol-user-link-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.compact-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.patrol-user-text-link {
  white-space: nowrap;
}

.patrol-user-stat-column small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.enterprise-config-layout {
  grid-template-columns: minmax(0, 1fr);
}

.location-input-panel {
  margin-bottom: 14px;
}

.location-input-grid {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  align-items: end;
}

.location-input-grid .primary-button {
  grid-column: 1 / -1;
}

.schedulers-layout {
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
}

.holiday-sync-panel {
  grid-column: 1 / -1;
}

.compact-details {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.compact-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.compact-details > * + * {
  margin-top: 10px;
}

.company-app-panel {
  grid-column: 1 / -1;
}

.company-app-panel .setup-form {
  grid-template-columns: repeat(4, minmax(180px, 1fr)) auto;
  align-items: end;
}

.company-app-panel .primary-button {
  width: 100%;
}

.translation-layout {
  display: grid;
  grid-template-columns: minmax(230px, 310px) minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.plan-limits-layout {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.plan-limits-layout > .setup-panel {
  min-width: 0;
}

.incident-reports-layout {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 18px;
  align-items: start;
}

.incident-reports-stack {
  display: grid;
  gap: 14px;
}

.payloads-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.server-status-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.server-status-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
  align-items: start;
}

.server-status-layout > .setup-panel {
  min-width: 0;
}

.server-status-table {
  min-width: 760px;
}

.wide-server-status-table {
  min-width: 1080px;
}

.email-relay-layout {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.email-relay-layout > .setup-panel {
  min-width: 0;
}

.first-admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.first-admin-table-panel {
  min-width: 0;
}

.first-admin-input-panel {
  margin-bottom: 14px;
}

.first-admin-input-grid {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.first-admin-input-grid .form-actions {
  grid-column: 1 / -1;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-title-row h3 {
  margin-bottom: 0;
}

.first-admin-table {
  min-width: 1180px;
}

.table-input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--input-bg);
  color: var(--ink);
}

.table-input.input-conflict {
  border-color: var(--red);
  background: rgba(216, 97, 110, 0.12);
}

.login-url {
  display: inline-block;
  min-width: 170px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.row-action-buttons {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  white-space: nowrap;
}

.row-action-buttons .secondary-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-actions button {
  flex: 1;
}

.form-message {
  min-height: 18px;
  margin: 0;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
}

#mobileAdminPasswordStatus {
  color: var(--muted);
}

.schedule-group-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.schedule-group-card h4 {
  margin: 0;
  font-size: 14px;
}

.schedule-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.schedule-row.selected {
  border-color: var(--green);
  background: rgba(47, 158, 116, 0.14);
}

.schedule-row strong,
.schedule-row span,
.schedule-row small {
  display: block;
}

.schedule-row span,
.schedule-row small {
  color: var(--muted);
}

.file-action-button {
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}

.file-action-button input {
  display: none;
}

.translation-editor {
  min-width: 0;
}

.language-card {
  gap: 10px;
}

.language-card label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.language-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.code-owned-text {
  display: inline-block;
  color: var(--muted);
  font-weight: 800;
}

.compact-table table {
  min-width: 760px;
}

.holiday-preview {
  display: grid;
  gap: 12px;
}

.holiday-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}

.holiday-list div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.holiday-list span {
  color: var(--muted);
  font-size: 12px;
}

.setup-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.sync-api-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.8fr) minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin: 14px 0;
}

.sync-status {
  align-self: center;
  color: var(--muted);
  font-size: 13px;
}

.table-scroll {
  overflow-x: auto;
}

.nfc-sync-review {
  margin-top: 18px;
}

.setup-list,
.setup-form {
  display: grid;
  gap: 10px;
}

.setup-card {
  position: relative;
  display: grid;
  width: 100%;
  gap: 5px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  text-align: left;
}

.setup-card:hover,
.setup-card.selected {
  border-color: var(--green);
  background: rgba(47, 158, 116, 0.14);
}

.setup-card strong,
.setup-card span,
.setup-card small,
.setup-card em {
  display: block;
}

.setup-card .setup-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.setup-card .setup-card-title strong,
.setup-card .setup-card-title em {
  display: inline-flex;
}

.setup-card span,
.setup-card small {
  color: var(--muted);
}

.setup-card .setup-card-title {
  color: var(--ink);
}

.setup-card em {
  color: var(--teal);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.setup-card .pill {
  width: max-content;
}

.setup-card .card-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 4px;
}

.setup-card .mini-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.setup-card .mini-action.active {
  border-color: rgba(47, 158, 116, 0.7);
  background: rgba(47, 158, 116, 0.22);
  color: var(--ink);
}

.setup-card .mini-action.danger.active {
  border-color: rgba(216, 97, 110, 0.7);
  background: rgba(216, 97, 110, 0.24);
}

.setup-card .mini-action:hover {
  border-color: var(--green);
  color: var(--ink);
}

.setup-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.setup-form input[type="number"],
.setup-form input[type="password"],
.setup-form input[type="email"],
.setup-form input[type="time"],
.setup-form input[type="text"] {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--input-bg);
  color: var(--ink);
}

.setup-form .field-hint {
  min-height: 16px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.setup-form .field-hint.is-next-day {
  color: var(--teal);
}

.setup-form label.is-disabled {
  color: var(--muted);
}

.setup-form input:disabled {
  cursor: not-allowed;
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  opacity: 1;
}

.checkbox-row {
  grid-template-columns: 22px 1fr;
  align-items: center;
  min-height: 42px;
  padding: 0 2px;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
}

.payload-preview {
  min-height: 302px;
  max-height: 420px;
  margin: 0;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #dcebf0;
  background: var(--surface-strong);
  font-size: 12px;
  line-height: 1.55;
}

.entity-grid,
.device-grid {
  display: grid;
  gap: 14px;
}

.entity-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.device-grid {
  grid-template-columns: minmax(0, 1fr);
}

.device-management-card {
  gap: 8px;
}

.device-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.device-card-identity {
  display: grid;
  gap: 4px;
}

.device-card-identity small {
  font-size: 12px;
}

.device-sync-line {
  font-weight: 850;
}

.device-sync-line.needs-sync {
  color: var(--red);
}

.device-sync-line.is-synced {
  color: var(--green);
}

.pairing-layout {
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.pairing-qr {
  display: grid;
  place-items: center;
  min-height: 250px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.qr-card {
  display: grid;
  place-items: center;
  gap: 9px;
  width: min(100%, 330px);
  min-height: 280px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-align: center;
}

.qr-matrix {
  display: flex;
  width: min(280px, 100%);
  aspect-ratio: 1;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.qr-matrix img {
  display: block;
  width: 100%;
  height: 100%;
}

.qr-card span,
.qr-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.qr-card strong {
  overflow-wrap: anywhere;
}

.setup-code-card strong {
  color: var(--green);
  font-size: 24px;
  line-height: 1.2;
}

.compact-payload {
  min-height: 250px;
}

.copy-button {
  margin-top: 12px;
}

.phone-actions,
.phone-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.phone-actions {
  align-items: center;
  margin-bottom: 12px;
}

.phone-actions .copy-button {
  margin-top: 0;
}

.phone-card-actions {
  margin-top: 14px;
}

.phone-card-actions .secondary-button,
.phone-actions .secondary-button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.device-input-panel {
  margin-bottom: 14px;
}

.device-input-panel .setup-form {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  align-items: end;
}

.device-input-panel .primary-button {
  grid-column: 1 / -1;
}

.sync-diagnostics-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.sync-diagnostics-panel.is-hidden {
  display: none;
}

.sync-diagnostics-heading {
  align-items: center;
}

.sync-diagnostics-heading .secondary-button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.sync-diagnostics-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sync-diagnostics-step {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.sync-diagnostics-step strong,
.sync-diagnostics-step span,
.sync-diagnostics-step small {
  display: block;
}

.sync-diagnostics-step strong {
  color: var(--ink);
}

.sync-diagnostics-step small {
  margin-top: 3px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.sync-diagnostics-state {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sync-diagnostics-step.running .sync-diagnostics-state {
  color: var(--yellow);
}

.sync-diagnostics-step.ok .sync-diagnostics-state {
  color: var(--green);
}

.sync-diagnostics-step.error .sync-diagnostics-state {
  color: var(--red);
}

.sync-diagnostics-step.pending .sync-diagnostics-state {
  color: var(--muted);
}

.sync-diagnostics-payload {
  min-height: 98px;
  max-height: 180px;
  font-size: 11px;
}

.action-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(13, 24, 30, 0.42);
  backdrop-filter: blur(5px);
}

.action-dialog-overlay.is-hidden {
  display: none;
}

.action-dialog {
  width: min(100%, 460px);
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(8, 17, 22, 0.24);
}

.action-dialog h3,
.action-dialog p {
  margin: 0;
}

.action-dialog-message {
  color: var(--muted);
  line-height: 1.45;
}

.action-dialog-body {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.action-dialog-body.is-hidden {
  display: none;
}

.scan-feedback-card {
  display: grid;
  gap: 12px;
}

.scan-feedback-card .qr-card {
  width: 100%;
  min-height: 190px;
}

.scan-feedback-detail-grid {
  display: grid;
  grid-template-columns: minmax(90px, 0.7fr) minmax(0, 1.3fr);
  gap: 6px 10px;
}

.scan-feedback-detail-grid span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.scan-feedback-detail-grid strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.action-dialog-actions {
  margin-top: 0;
}

.selected-device {
  border-color: var(--green);
  background: rgba(47, 158, 116, 0.12);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.entity-card,
.device-card,
.checkpoint-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.entity-card,
.device-card {
  padding: 16px;
}

.entity-card header,
.device-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--blue);
  font-weight: 900;
}

.field-list {
  display: grid;
  gap: 8px;
}

.field-list div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.field-list strong {
  color: var(--ink);
  text-align: right;
}

.device-meter {
  height: 9px;
  margin: 12px 0;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.device-meter span {
  display: block;
  height: 100%;
  background: var(--green);
}

.designer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.map-workspace {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.map-workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.map-workspace-header strong {
  font-size: 19px;
}

.map-view-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}

.map-rotation-field {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.map-rotation-field input {
  width: 92px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--input-bg);
  color: var(--ink);
}

.icon-map-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.icon-map-button:hover:not(:disabled) {
  border-color: rgba(47, 158, 116, 0.65);
  background: rgba(47, 158, 116, 0.12);
}

.icon-map-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.icon-map-button.primary-icon {
  border-color: rgba(47, 158, 116, 0.8);
  background: var(--teal);
  color: white;
}

.icon-map-button.text-map-button {
  width: auto;
  min-width: 48px;
  padding: 0 10px;
  font-size: 12px;
}

.icon-map-button[aria-pressed="true"] {
  border-color: rgba(47, 158, 116, 0.95);
  background: var(--teal);
  color: #ffffff;
  box-shadow: 0 0 0 3px rgba(47, 158, 116, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.icon-map-button[aria-pressed="true"]:hover:not(:disabled) {
  background: #248a65;
  color: #ffffff;
}

.map-view-status,
.map-image-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.map-image-meta {
  margin-top: -6px;
}

.map-workspace-header span {
  color: var(--teal);
  font-weight: 800;
}

.map-canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  justify-self: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(117, 184, 255, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(117, 184, 255, 0.08) 1px, transparent 1px),
    var(--surface-strong);
  background-size: 48px 48px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 0 32px rgba(34, 54, 64, 0.18);
  touch-action: none;
  user-select: none;
}

.map-canvas.automatic-map {
  background: var(--surface-strong);
  touch-action: auto;
}

.automatic-map-layer {
  position: absolute;
  inset: 0;
}

.automatic-map-message {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  width: min(420px, calc(100% - 36px));
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  transform: translate(-50%, -50%);
}

.automatic-map-marker {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 3px solid #ffffff;
  border-radius: 999px;
  background: #d54747;
  box-shadow: 0 2px 8px rgba(10, 28, 36, 0.42);
  cursor: pointer;
}

.automatic-map-marker.ok {
  background: #2f9e74;
}

.automatic-map-marker.warn,
.automatic-map-marker.manual {
  background: #d6902f;
}

.automatic-map-marker.bad {
  background: #d54747;
}

.map-stage {
  position: absolute;
  inset: 0;
  transform-origin: center center;
}

.map-image-layer {
  position: absolute;
  inset: 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.map-canvas.has-imported-image {
  background-color: var(--surface-soft);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.map-canvas.has-background {
  background-color: var(--surface-soft);
}

.map-canvas.has-imported-image.has-background {
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.map-canvas.placing-nfc-anchor {
  cursor: crosshair;
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

.gps-accuracy-ring {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  width: var(--accuracy-diameter);
  height: var(--accuracy-diameter);
  aspect-ratio: 1;
  pointer-events: none;
  border: 1px solid rgba(40, 86, 102, 0.18);
  border-radius: 999px;
  background: rgba(40, 86, 102, 0.055);
  transform: translate(-50%, -50%);
}

.gps-accuracy-ring span {
  display: none;
}

.map-conversion-note {
  position: absolute;
  z-index: 3;
  left: 18px;
  right: 18px;
  top: 50%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  transform: translateY(-50%);
}

.map-placement-note {
  position: absolute;
  z-index: 4;
  left: 14px;
  right: 14px;
  bottom: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(19, 117, 112, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  pointer-events: none;
}

.checkpoint-pin {
  position: absolute;
  display: grid;
  place-items: center;
  z-index: 3;
  width: 28px;
  height: 28px;
  transform: translate(-50%, -50%);
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 1px rgba(28, 45, 56, 0.18), 0 5px 12px rgba(39, 52, 61, 0.22);
  cursor: pointer;
  touch-action: none;
  user-select: none;
}

.checkpoint-pin span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
}

.checkpoint-order-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  margin-left: 42px;
}

.checkpoint-order-actions .secondary-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.checkpoint-pin.ok {
  background: var(--green);
}

.checkpoint-pin.warn {
  background: var(--yellow);
}

.checkpoint-pin.manual {
  background: var(--teal);
}

.checkpoint-pin.bad {
  background: var(--red);
}

.checkpoint-panel {
  padding: 18px;
}

.checkpoint-list {
  display: grid;
  gap: 10px;
}

.checkpoint-item {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.order-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #ffffff;
  background: var(--blue);
  font-weight: 900;
}

.checkpoint-item strong,
.checkpoint-item span {
  display: block;
}

.checkpoint-item span {
  color: var(--muted);
  font-size: 13px;
}

.checkpoint-item small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.nfc-placement-actions {
  display: grid;
  gap: 6px;
  min-width: 150px;
}

.nfc-placement-actions span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.nfc-placement-actions .secondary-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .nav-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }

  .sidebar-status {
    display: none;
  }

  .summary-grid,
  .entity-grid,
  .device-grid,
  .pairing-layout,
  .access-layout,
  .enterprise-layout,
  .config-layout,
  .location-input-grid,
  .schedulers-layout,
  .company-app-panel .setup-form,
  .first-admin-input-grid,
  .first-admin-layout,
  .plan-limits-layout,
  .incident-reports-layout,
  .email-relay-layout,
  .payloads-layout,
  .server-status-layout,
  .translation-layout,
  .map-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .designer-layout {
    grid-template-columns: 1fr;
  }

  .device-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .login-screen {
    padding: 16px;
  }

  .login-panel {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .login-users {
    grid-column: auto;
  }

  .workspace {
    padding: 18px;
  }

  .topbar,
  .section-header,
  .topbar-actions,
  .segmented-control,
  .map-tools,
  .map-view-controls,
  .enterprise-actions,
  .mode-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .nav-list,
  .summary-grid,
  .entity-grid,
  .device-grid,
  .pairing-layout,
  .access-layout,
  .enterprise-layout,
  .config-layout,
  .location-input-grid,
  .schedulers-layout,
  .company-app-panel .setup-form,
  .first-admin-input-grid,
  .first-admin-layout,
  .plan-limits-layout,
  .incident-reports-layout,
  .email-relay-layout,
  .payloads-layout,
  .server-status-layout,
  .translation-layout,
  .map-status-grid {
    grid-template-columns: 1fr;
  }

  .patrol-user-link-grid {
    flex-direction: column;
    align-items: stretch;
  }

  .action-dialog-overlay {
    align-items: end;
    padding: 14px;
  }

  .action-dialog {
    width: 100%;
  }

  .nav-item {
    grid-template-columns: 28px 1fr;
  }

  .schedule-row {
    grid-template-columns: 1fr;
  }

  .phone-actions {
    grid-column: auto;
  }

}

.module-link {
  text-decoration: none;
}
