:root {
  --bg: #49709c;
  --bg-2: #f0f9ff;
  --panel: #ffffff;
  --panel-2: #f0f9ff;
  --line: #94a3b8;
  --text: #000000;
  --muted: #000000;
  --accent: #0284c7;
  --accent-2: #7dd3fc;
  --ok: #16a34a;
  --warn: #d97706;
  --alert: #dc2626;
  --purple: #7c3aed;
  --radius: 16px;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
  color-scheme: light;
}

html, body {
  margin: 0;
  min-height: 100%;
  max-width: 100%;
  background: #49709c;
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

body {
  padding: 20px 16px 48px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  padding-bottom: max(48px, env(safe-area-inset-bottom));
}

img, video, canvas, svg { max-width: 100%; height: auto; }

.wrap { max-width: 1180px; margin: 0 auto; width: 100%; }

header.hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

header.hero h1 {
  margin: 0 0 6px;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  letter-spacing: -0.03em;
}

header.hero p { margin: 0; color: var(--muted); max-width: 640px; }

.chip {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: var(--accent);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
}

.card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
}

.card h2 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.sub { color: var(--muted); margin: 0 0 16px; font-size: 0.92rem; }

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #000000;
  margin: 0 0 6px;
}

input, select, button, textarea {
  width: 100%;
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid #94a3b8;
  background: #ffffff;
  color: #000000;
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.25;
  padding: 10px 12px;
  min-height: 40px;
}

input, select, button { white-space: nowrap; }
textarea { white-space: pre-wrap; min-height: 80px; resize: vertical; }
input[type="file"] { white-space: normal; }

input[type="date"] { color-scheme: light; }

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.sim-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
  margin-top: 12px;
}
.sim-modal-actions #saveSim,
.sim-modal-actions #saveEventSim {
  margin-left: auto;
}
.btn-delete-sim {
  background: #dc2626 !important;
  color: #ffffff !important;
  border: 1px solid #b91c1c !important;
  font-weight: 800;
}
.btn-delete-sim:hover {
  background: #b91c1c !important;
}

.row > * { flex: 1; min-width: 0; }

button {
  border: 0;
  background: #7dd3fc;
  color: #000000;
  font-weight: 800;
  cursor: pointer;
  margin-top: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-overflow: ellipsis;
}

button:hover { filter: brightness(1.08); }
button, a.btn-compact, a.button-link { touch-action: manipulation; }
button.secondary { background: #ffffff; color: #000000; border: 1px solid #334155; }
button.ok { background: #86efac; color: #000000; }
button.purple { background: #ddd6fe; color: #000000; }
button.ghost { background: #ffffff; color: #000000; border: 1px solid #334155; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-grid .full { grid-column: 1 / -1; }
.lookup-status {
  margin: 8px 0 0;
  font-size: 0.82rem;
  font-weight: 650;
  color: #15803d;
}
.import-check label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  cursor: pointer;
}
.import-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #38bdf8;
}

.sim-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.sim-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--panel-2);
  border: 1px solid #94a3b8;
  border-radius: 12px;
  padding: 12px;
}

.sim-card input { width: 18px; height: 18px; margin-top: 3px; flex: none; }
.sim-meta { min-width: 0; }
.sim-meta strong { display: block; font-size: 0.92rem; word-break: break-all; }
.sim-meta span { color: var(--muted); font-size: 0.78rem; }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 2px 8px;
  min-height: 20px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge-ok {
  background: #dcfce7;
  color: #000000;
  border-color: #86efac;
}
.badge-alert {
  background: #fee2e2;
  color: #000000;
  border-color: #fca5a5;
}
.badge-warn {
  background: #fef3c7;
  color: #000000;
  border-color: #fcd34d;
}
.badge-info {
  background: #e0f2fe;
  color: #000000;
  border-color: #7dd3fc;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 8px;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 transparent;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

th, td {
  text-align: left;
  padding: 12px 14px;
  border: 1px solid #94a3b8;
  background: #ffffff;
  color: #000000;
  font-size: 0.86rem;
  line-height: 1.4;
  vertical-align: middle;
}

th {
  color: #000000;
  background: #e0f2fe;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-top: 10px;
  padding-bottom: 10px;
}
td.mono {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.82rem;
  white-space: nowrap;
}

.actions {
  width: 1%;
  text-align: right;
  white-space: nowrap;
}
.actions button {
  width: auto;
  min-height: 32px;
  padding: 6px 12px;
  margin: 0;
  font-size: 0.75rem;
  font-weight: 650;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: #ffffff;
  border: 1px solid #0284c7;
  color: #000000;
  padding: 12px 14px;
  border-radius: 12px;
  display: none;
  z-index: 20;
  max-width: min(420px, calc(100% - 32px));
}

.audit-block { margin-top: 14px; }
.audit-block h3 { margin: 0 0 8px; color: var(--accent); }
.audit-list { display: grid; gap: 8px; }
.audit-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  background: var(--panel-2);
  border-radius: 10px;
  padding: 10px 12px;
  min-width: 0;
}
.audit-item > div { min-width: 0; flex: 1; }
.audit-item button,
.audit-item button.ghost {
  width: auto;
  min-width: 0;
  margin: 0;
  flex: 0 0 auto;
}
.discrepancy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.empty { color: var(--muted); font-size: 0.9rem; }

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.topnav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.topnav a.active, .topnav a:hover {
  color: var(--accent);
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.08);
}
a.nav-card { color: inherit; text-decoration: none; display: block; }
a.nav-card:hover { border-color: var(--accent); }

.pickup-list { display: grid; gap: 8px; margin-top: 14px; }
.pickup-list .ghost { width: auto; margin: 0; padding: 7px 10px; }

.pickup-panel {
  margin-top: 12px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.08);
}
.pickup-panel h4 { margin: 0 0 10px; color: #000000; }
.pickup-panel .audit-item { margin-bottom: 8px; }

@media (max-width: 900px) {
  .grid, .form-grid { grid-template-columns: 1fr; }
  header.hero { flex-direction: column; }
  .row { flex-direction: column; align-items: stretch; }
  body.view-admin {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }
  .admin-shell {
    grid-template-columns: 1fr;
    overflow: visible;
  }
  .admin-sidebar {
    position: relative;
    top: 0;
    height: auto;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }
  .admin-main {
    height: auto;
    overflow: visible;
  }
  .tech-nav {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}

body.view-tech {
  background: #49709c;
  padding: 0;
}
.tech-shell {
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
  padding: 28px 18px 48px;
  padding-left: max(18px, env(safe-area-inset-left));
  padding-right: max(18px, env(safe-area-inset-right));
  padding-bottom: max(48px, env(safe-area-inset-bottom));
}
.view-tech h1 {
  margin: 0 0 8px;
  font-size: 1.7rem;
}
.view-tech h2 {
  margin: 22px 0 8px;
  font-size: 1.05rem;
  color: #000000;
}
.tech-lead { color: var(--muted); margin: 0 0 16px; }
.tech-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
}
.tech-add-row input,
.tech-add-row textarea { flex: 1 1 160px; min-width: 0; }
.tech-add-row textarea { min-height: 84px; }
.tech-add-row button {
  width: auto;
  margin: 0;
  background: #7dd3fc;
  color: #000000;
}
.tech-extra-provider {
  width: auto;
  min-width: 120px;
  margin: 0;
}
.tech-submit {
  margin-top: 24px;
  padding: 18px;
  font-size: 1.15rem;
  background: #7dd3fc;
  color: #000000;
  border-radius: 14px;
}
.submit-confirm-card {
  width: min(420px, 100%);
}
.submit-confirm-card .tech-lead {
  margin-bottom: 0;
}
.submit-confirm-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.submit-confirm-actions button {
  flex: 1;
  margin: 0;
  min-height: 46px;
}
.view-tech .submit-confirm-actions .tech-submit {
  margin-top: 0;
}
.tech-page-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
}
.tech-page-tab {
  flex: 1 1 0;
  margin: 0;
  padding: 10px 12px;
  font-size: 0.95rem;
  background: #ffffff;
  color: #000000;
  border: 1px solid #334155;
  border-radius: 10px;
}
.tech-page-tab.active {
  background: #7dd3fc;
  border-color: #0369a1;
}
.tech-request-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}
.tech-request-form .tech-submit {
  margin-top: 12px;
}
.request-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.request-section-title {
  margin: 18px 0 8px;
  font-size: 1.05rem;
}
#requestsView .request-section-title:first-child {
  margin-top: 8px;
}
body.view-admin {
  padding: 0;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.admin-bar {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid #94a3b8;
  padding: 12px 20px;
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
  font-size: 0.9rem;
  position: relative;
  top: auto;
  z-index: 5;
  flex: 0 0 auto;
}
.admin-bar span { color: var(--muted); }

.admin-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  flex: 1 1 auto;
  min-height: 0;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}
.admin-sidebar {
  position: relative;
  top: auto;
  height: auto;
  max-height: none;
  align-self: stretch;
  overflow-x: hidden;
  overflow-y: auto;
  background: #f0f9ff;
  border-right: 1px solid var(--line);
  padding: 12px 10px 16px 12px;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 transparent;
  display: flex;
  flex-direction: column;
}
.admin-sidebar::-webkit-scrollbar {
  width: 6px;
}
.admin-sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.admin-sidebar::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 99px;
}
.admin-sidebar::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}
.admin-sidebar h2 {
  margin: 0 0 4px;
  font-size: 0.95rem;
  color: var(--accent);
}
.admin-sidebar .sub { margin-bottom: 12px; font-size: 0.8rem; }
.sidebar-block {
  background: #ffffff;
  border: 1px solid #94a3b8;
  border-radius: 18px;
  padding: 12px 10px;
  margin: 0 0 12px;
}
.admin-sidebar .sidebar-block:nth-child(2) {
  flex: 1 1 auto;
}
.sidebar-block:last-child {
  margin-bottom: 0;
}
.sidebar-block-bottom {
  margin-top: auto;
}
.sop-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.sop-toolbar input[type="search"] {
  flex: 1 1 220px;
  min-height: 36px;
}
.sop-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0 0 16px;
}
.sop-jump a {
  font-size: 0.82rem;
  font-weight: 600;
  color: #0369a1 !important;
}
.sop-item {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 0 14px 12px;
  margin: 0 0 10px;
}
.sop-item summary {
  cursor: pointer;
  font-weight: 700;
  padding: 12px 0;
  list-style: none;
}
.sop-item summary::-webkit-details-marker {
  display: none;
}
.sop-item summary::before {
  content: "▸ ";
  color: #0369a1;
}
.sop-item[open] summary::before {
  content: "▾ ";
}
.sop-item ol {
  margin: 0 0 8px 1.1rem;
  padding: 0;
}
.sop-item li {
  margin: 0 0 8px;
  line-height: 1.45;
}
.sop-item pre {
  margin: 8px 0 0;
  padding: 10px 12px;
  background: #f1f5f9;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.82rem;
}
.event-sims-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.event-sims-toolbar input,
.event-sims-toolbar select {
  min-height: 36px;
  flex: 1 1 180px;
}
.event-sims-table {
  width: 100%;
  border-collapse: collapse;
}
.event-sims-table th,
.event-sims-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 0.86rem;
}
.tab-content[hidden] {
  display: none !important;
}
#office-stock-section.tab-content.active,
#office-stock-section.tab-content:not([hidden]) {
  display: block;
}
.office-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.office-metric-card {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
}
.office-metric-card .label {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.office-metric-card strong {
  display: block;
  margin-top: 4px;
  font-size: 1.25rem;
}
.office-low-stock {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
  font-size: 0.9rem;
}
.office-stock-table {
  width: 100%;
  border-collapse: collapse;
}
.office-stock-table th,
.office-stock-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 0.86rem;
}
.office-stock-table select {
  min-height: 32px;
  max-width: 160px;
}
.sidebar-block h2 {
  margin: 0 0 8px;
  padding: 0 4px;
}
.tech-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tech-tab {
  width: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  background: #e0f2fe;
  padding: 10px 12px;
  font-size: 0.86rem;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 16px;
  min-height: 0;
  height: auto;
  white-space: normal;
  overflow: visible;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.tech-tab .nav-name {
  font-weight: 750;
  line-height: 1.2;
}
.tech-tab .nav-meta {
  color: #000000;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
.tech-tab .badge {
  margin-top: 1px;
}
.tech-tab:hover { background: #bae6fd; }
.tech-tab.active {
  background: #7dd3fc;
  border-color: #0284c7;
}
.tech-tab.active .nav-meta { color: #000000; }
.admin-main {
  padding: 20px 22px 48px;
  padding-left: max(22px, env(safe-area-inset-left));
  padding-right: max(22px, env(safe-area-inset-right));
  padding-bottom: max(48px, env(safe-area-inset-bottom));
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  flex: 1;
}
.admin-main .card,
.admin-main input,
.admin-main select,
.admin-main textarea,
.admin-main .table-wrap,
.admin-main table,
.admin-main #simSearch,
.admin-main #networkPanels {
  width: 100%;
  max-width: none;
}
.admin-main.panel-enter {
  animation: panelFade 0.28s ease;
}
@keyframes panelFade {
  from { opacity: 0.35; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.status-line {
  font-weight: 700;
  margin: 0 0 14px;
}
.network-card {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}
.network-card h3 {
  margin: 0 0 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
}
tr.row-expire td { background: #fee2e2; }
.login-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  padding-left: max(24px, env(safe-area-inset-left));
  padding-right: max(24px, env(safe-area-inset-right));
}
.login-card { width: min(420px, 100%); }
.login-card h1 { margin-top: 0; }
.login-card label[for="password"],
.login-card label[for="new_password"],
.login-card label[for="confirm_password"] { margin-top: 12px; }
.login-card button { margin-top: 16px; }
.login-error { color: #000000; font-weight: 700; }
.tech-userbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.tech-userbar a {
  width: auto;
  font-weight: 700;
  color: #000000;
}
.admin-bar a { color: var(--accent); }
.metric-grid {
  display: grid;
  gap: 8px;
  margin: 10px 0 4px;
}
.metric-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
}
.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.metric-card strong {
  font-size: 1.15rem;
}
#simSearch { margin-bottom: 14px; }
.dash-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.dash-hero .metric-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 92px;
}
.dash-hero .metric-card strong {
  font-size: 1.35rem;
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: 0.01em;
  color: #000000;
}
.dash-hero-net-labels {
  margin-top: 6px;
  font-style: normal;
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
@media (max-width: 1100px) {
  .dash-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .dash-cards { grid-template-columns: 1fr; }
}
.dash-table { min-width: 760px; }
.dash-table th,
.dash-table td {
  padding: 12px 14px;
  vertical-align: middle;
}
.dash-table th.dash-num,
.dash-table td.dash-num,
.dash-table th:nth-child(2),
.dash-table th:nth-child(3),
.dash-table th:nth-child(4),
.dash-table th:nth-child(5) {
  text-align: center;
}
.dash-num {
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  color: #000000;
}
.dash-status {
  white-space: nowrap;
  color: #000000;
  font-weight: 600;
}
.dash-cost { font-weight: 700; white-space: nowrap; }
.scanner-box {
  margin-top: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}
#reader { min-height: 180px; width: 100%; max-width: 100%; }
a.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 40px;
  border-radius: 8px;
  background: #ffffff;
  color: #000000;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 10px 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.35);
}
.modal[hidden] { display: none; }
.modal-card {
  width: min(720px, 100%);
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.45);
}
.modal-card h2 { margin-top: 0; }

.action-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  padding: 12px 0;
}
.btn-header-action,
.btn-portal-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  margin: 0;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background: #ffffff;
  color: #0f172a;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  flex: 0 0 auto;
  box-shadow: none;
  filter: none;
  overflow: visible;
  transition: background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.btn-header-action .btn-ico {
  width: 15px;
  height: 15px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn-header-action:hover,
.btn-header-action:focus-visible {
  background: #f1f5f9;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}
.btn-header-action-primary {
  background: #0f172a;
  color: #ffffff;
  border: none;
}
.btn-header-action-primary:hover,
.btn-header-action-primary:focus-visible {
  background: #1e293b;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}
.btn-portal-switch {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  font-weight: 600;
}
.btn-portal-switch:hover,
.btn-portal-switch:focus-visible {
  background: #bae6fd;
  color: #0369a1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}
.view-tech .btn-portal-switch { margin-bottom: 16px; }
.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  padding: 2px 6px;
  border-radius: 12px;
  background: #e2e8f0;
  color: #0f172a;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}
.count-pill[hidden] { display: none; }
.btn-compact {
  width: auto;
  min-height: 34px;
  padding: 6px 12px;
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  color: #000000;
}
a.btn-compact { display: inline-flex; }
.toolbar-date {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  min-width: 0;
}
.toolbar-date input {
  width: auto;
  height: 38px;
  min-height: 38px;
  padding: 4px 10px;
  border-radius: 8px;
}
.overview-head {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 20, 0.55);
  z-index: 24;
}
.drawer-backdrop[hidden] { display: none; }
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(460px, 100%);
  height: 100vh;
  z-index: 25;
  background: #f8fafc;
  border-left: 1px solid var(--line);
  padding: 18px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}
.drawer[hidden] { display: none; }
.drawer.open { display: block; transform: translateX(0); }
.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.drawer-head h2 { margin: 0; }

@media (max-width: 720px) {
  body {
    padding: 14px 12px 36px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    padding-bottom: max(36px, env(safe-area-inset-bottom));
  }
  body.view-admin {
    padding: 0;
  }
  .card { padding: 16px 14px; }
  .admin-bar {
    padding: 10px 12px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
  .admin-bar-meta { display: none; }
  .admin-sidebar {
    padding: 12px 10px 16px;
  }
  .admin-main {
    padding: 14px 12px 36px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }
  .tech-nav {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 6px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }
  .tech-tab {
    flex: 0 0 auto;
    width: 158px;
    min-height: 44px;
    scroll-snap-align: start;
  }
  .action-toolbar {
    align-items: center;
  }
  .btn-compact {
    flex: 1 1 calc(50% - 8px);
    justify-content: center;
    min-height: 44px;
  }
  .btn-header-action,
  .btn-portal-switch {
    height: auto;
    min-height: 0;
    flex: 0 1 auto;
  }
  .toolbar-date {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }
  .toolbar-date input {
    flex: 1;
    width: auto;
    min-width: 0;
    min-height: 44px;
  }
  .overview-head {
    flex-direction: column;
  }
  .status-line { font-size: 0.95rem; }
  .modal {
    padding: 0;
    place-items: stretch;
    align-items: stretch;
  }
  .modal-card {
    width: 100%;
    min-height: 100%;
    min-height: 100dvh;
    border-radius: 0;
    padding: 16px 14px max(16px, env(safe-area-inset-bottom));
    overflow-y: auto;
  }
  .drawer {
    width: 100%;
    height: 100%;
    height: 100dvh;
    padding: 16px 14px max(16px, env(safe-area-inset-bottom));
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }
  .table-wrap {
    overflow-x: visible;
    margin-left: -4px;
    margin-right: -4px;
  }
  .table-wrap table,
  table.dash-table,
  table {
    min-width: 0;
  }
  .table-wrap thead { display: none; }
  .table-wrap tbody { display: block; }
  .table-wrap tr {
    display: block;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 10px;
    padding: 6px 10px;
  }
  .table-wrap td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    padding: 8px 2px;
    border-bottom: 1px solid rgba(43, 59, 85, 0.65);
    white-space: normal;
    word-break: break-word;
    text-align: right;
  }
  .table-wrap td:last-child { border-bottom: 0; }
  .table-wrap td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex: 0 0 42%;
    max-width: 46%;
    text-align: left;
    white-space: normal;
  }
  .table-wrap td.empty,
  .table-wrap td[colspan] {
    display: block;
    text-align: left;
    border-bottom: 0;
  }
  .table-wrap td.empty::before,
  .table-wrap td[colspan]::before {
    content: none;
    display: none;
  }
  .table-wrap td.actions {
    width: 100%;
    text-align: left;
    white-space: normal;
  }
  .table-wrap td.actions button {
    width: auto;
    min-height: 40px;
  }
  .table-wrap td.mono {
    white-space: normal;
    word-break: break-all;
  }
  .table-wrap td.dash-num,
  .table-wrap td.dash-status,
  .table-wrap td.dash-cost {
    text-align: right;
  }
  .dash-status { white-space: normal; }
  .dash-cost { white-space: normal; }
  input, select, textarea, button {
    font-size: 16px;
    min-height: 44px;
  }
  .btn-compact { font-size: 0.85rem; }
}

@media (max-width: 480px) {
  header.hero h1 { font-size: 1.25rem; }
  .view-tech h1 { font-size: 1.4rem; }
  .tech-shell { padding-top: 18px; }
  .tech-add-row input { flex: 1 1 100%; }
  .tech-add-row button { flex: 1 1 calc(50% - 4px); }
  .sim-cards { grid-template-columns: 1fr; }
  .tech-tab { width: 148px; }
  .toast {
    left: 12px;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    max-width: none;
  }
  .actions button { width: 100%; }
}

@media (max-height: 500px) and (orientation: landscape) {
  .tech-shell { padding-top: 12px; padding-bottom: 16px; }
  .view-tech h1 { font-size: 1.25rem; }
  .admin-bar { position: static; }
}

/* Forced baby-blue theme — last so it wins over earlier dark rules */
html {
  color-scheme: light !important;
  background: #49709c !important;
}
html, body,
body.view-tech,
body.view-admin,
.login-shell,
.tech-shell,
.admin-shell,
.admin-main {
  background: #49709c !important;
  color: #000000 !important;
}
body, body * {
  color: #000000 !important;
}
.card, .login-card, .nav-card, .network-card, .metric-card,
.sim-card, .audit-item, .pickup-panel, .scanner-box, #reader,
.admin-sidebar, .admin-bar, .drawer, .table-wrap, .toast,
.modal-card {
  background: #f0f9ff !important;
  color: #000000 !important;
  border-color: #94a3b8 !important;
}
.sidebar-block {
  background: #ffffff !important;
  border: 1px solid #94a3b8 !important;
  border-radius: 18px !important;
}
.metric-card {
  border-radius: 14px !important;
}
button.tech-tab,
.tech-tab {
  border-radius: 16px !important;
}
.audit-item button,
.audit-item button.ghost {
  width: auto !important;
  min-width: 0 !important;
  flex: 0 0 auto !important;
}
.discrepancy-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}
.modal-card, .drawer {
  background: #f8fafc !important;
  color: #000000 !important;
}
.modal {
  background: rgba(15, 23, 42, 0.35) !important;
}
input, select, textarea,
input[type="date"], input[type="file"], input[type="password"],
input[type="text"], input[type="number"],
#simSearch, #unlistedInput, #techSelect, #password,
#simNumber, #simCell, #simSize, #simPrice, #simTechnician,
#simProvider, #contractStart, #contractEnd, #lastChecked,
#importFile, #importDestination, #checkDate {
  background: #ffffff !important;
  color: #000000 !important;
  border: 1px solid #334155 !important;
  color-scheme: light !important;
}
button, .btn-compact, a.btn-compact, a.button-link,
.tech-submit, .tech-add-row button, .tech-tab, .actions button {
  background: #7dd3fc !important;
  color: #000000 !important;
  border: 1px solid #0369a1 !important;
  font-weight: 800 !important;
}
button.secondary, a.btn-compact.secondary, a.button-link,
button.ghost, .actions button.ghost {
  background: #ffffff !important;
  color: #000000 !important;
  border: 1px solid #334155 !important;
}
button.ok, .btn-compact.ok {
  background: #86efac !important;
  color: #000000 !important;
  border: 1px solid #166534 !important;
}
.view-tech .tech-submit,
.view-tech .tech-add-row button {
  background: #7dd3fc !important;
  color: #000000 !important;
  border: 1px solid #0369a1 !important;
}
.view-tech .tech-page-tab {
  background: #ffffff !important;
  color: #000000 !important;
  border: 1px solid #334155 !important;
}
.view-tech .tech-page-tab.active {
  background: #7dd3fc !important;
  border-color: #0369a1 !important;
}
button.purple, .btn-compact.purple {
  background: #ddd6fe !important;
  color: #000000 !important;
  border: 1px solid #6d28d9 !important;
}
.tech-tab {
  background: #e0f2fe !important;
}
.tech-tab:hover, .tech-tab.active {
  background: #bae6fd !important;
  border-color: #0284c7 !important;
}
table, .table-wrap table, .dash-table {
  background: #ffffff !important;
  color: #000000 !important;
}
th, td,
.table-wrap th, .table-wrap td,
.dash-table th, .dash-table td {
  background: #ffffff !important;
  color: #000000 !important;
  border: 1px solid #94a3b8 !important;
}
th, .table-wrap th, .dash-table th {
  background: #e0f2fe !important;
  color: #000000 !important;
}
tr.row-expire td {
  background: #fee2e2 !important;
  color: #000000 !important;
}
.table-wrap tr {
  background: #ffffff !important;
  border-color: #94a3b8 !important;
}
a, a:visited, a:hover, .admin-bar a, .topnav a, a.nav-card {
  color: #000000 !important;
}
.badge, .badge-ok, .badge-alert, .badge-warn, .badge-info, .chip {
  color: #000000 !important;
}
.badge-ok { background: #dcfce7 !important; }
.badge-alert { background: #fee2e2 !important; }
.badge-warn { background: #fef3c7 !important; }
.badge-info, .chip { background: #e0f2fe !important; }

.btn-header-action,
a.btn-header-action,
button.btn-header-action,
.btn-portal-switch,
a.btn-portal-switch {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  height: auto !important;
  min-height: 0 !important;
  width: auto !important;
  margin: 0 !important;
  padding: 8px 14px !important;
  border-radius: 8px !important;
  outline: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  filter: none !important;
  overflow: visible !important;
  cursor: pointer !important;
  text-decoration: none !important;
  box-sizing: border-box !important;
}
.btn-header-action,
a.btn-header-action,
button.btn-header-action {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: none !important;
}
.btn-header-action span,
.btn-header-action .btn-ico,
a.btn-header-action span {
  color: #0f172a !important;
  background: transparent !important;
  border: none !important;
}
.btn-header-action:hover,
a.btn-header-action:hover,
.btn-header-action:focus-visible {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06) !important;
  transform: none !important;
  filter: none !important;
}
.btn-header-action-primary,
button.btn-header-action-primary {
  background: #0f172a !important;
  color: #ffffff !important;
  border: none !important;
}
.btn-header-action-primary:hover,
.btn-header-action-primary:focus-visible {
  background: #1e293b !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06) !important;
}
.btn-header-action-primary span,
.btn-header-action-primary .btn-ico {
  color: #ffffff !important;
  background: transparent !important;
}
.btn-portal-switch,
a.btn-portal-switch,
a.btn-portal-switch:visited,
a.btn-portal-switch:hover {
  background: #e0f2fe !important;
  color: #0369a1 !important;
  border: 1px solid #bae6fd !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}
a.btn-portal-switch:hover,
a.btn-portal-switch:focus-visible {
  background: #bae6fd !important;
  color: #0369a1 !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06) !important;
}
.action-toolbar .count-pill {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 18px;
  padding: 2px 6px !important;
  border-radius: 12px !important;
  background: #e2e8f0 !important;
  color: #0f172a !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  border: none !important;
  box-shadow: none !important;
}
.action-toolbar .count-pill[hidden] { display: none !important; }
.view-tech .sim-cards {
  grid-template-columns: 1fr 1fr !important;
  gap: 8px;
  margin: 8px 0 0;
}
.view-tech .sim-card {
  padding: 8px;
  border-radius: 10px;
  gap: 8px;
}
.view-tech .sim-card input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
}
.view-tech .sim-meta strong {
  font-size: 0.72rem;
  line-height: 1.2;
}
.view-tech .sim-meta span {
  font-size: 0.68rem;
  display: block;
}
.view-tech .sim-card:has(input:checked) {
  background: #e0f2fe !important;
  border-color: #0284c7 !important;
}
.tech-network {
  margin: 12px 0 18px;
}
.tech-network h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.view-tech .btn-portal-switch { margin-bottom: 16px !important; }

.planner-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 14px;
}
.planner-toolbar button {
  width: auto;
}
.planner-week-label {
  font-weight: 700;
  margin-right: 8px;
}
.planner-wrap {
  overflow-x: auto;
  margin-bottom: 16px;
}
.planner-grid {
  display: grid;
  grid-template-columns: 220px repeat(5, minmax(190px, 1fr));
  gap: 8px;
  min-width: 1180px;
}
.planner-head,
.planner-tech,
.planner-day {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  padding: 10px;
}
.planner-head {
  font-weight: 700;
  font-size: 0.85rem;
  background: #f8fafc;
}
.planner-tech {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #ffffff;
}
.planner-tech strong {
  display: block;
  margin-bottom: 6px;
}
.planner-job {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 8px;
  background: #f8fafc;
  font-size: 0.82rem;
}
.planner-job strong {
  display: block;
  margin-bottom: 2px;
}
.planner-job .empty {
  margin: 0;
}
.planner-fup {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.3;
}
.planner-job-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.btn-edit-job {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  width: auto;
  height: auto;
}
.planner-job-actions button,
.planner-add {
  width: auto;
  padding: 4px 8px;
  font-size: 12px;
  height: auto;
}
.planner-job-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}
.planner-job-form input,
.planner-job-form select {
  font-size: 12px;
  height: 32px;
  min-height: 32px;
}
.planner-form-actions {
  display: flex;
  gap: 6px;
}
.planner-form-actions button {
  width: auto;
  flex: 1;
  height: 32px;
  min-height: 32px;
  font-size: 12px;
}
.planner-summaries {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}
.planner-summary {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 12px;
  background: #ffffff;
}
.planner-summary.ready {
  border-color: #86efac;
  background: #f0fdf4;
}
.planner-summary.short {
  border-color: #fca5a5;
  background: #fef2f2;
}
.planner-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}
.planner-summary.ready .planner-badge { color: #166534; }
.planner-summary.short .planner-badge { color: #b91c1c; }
.planner-summary ul {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 0.85rem;
}
