:root {
  --ink: #172033;
  --muted: #637083;
  --line: #d9e0ea;
  --canvas: #f4f6f9;
  --paper: #ffffff;
  --navy: #172033;
  --navy-2: #25324a;
  --blue: #5869c9;
  --blue-soft: #e9edff;
  --teal: #1f8a80;
  --teal-soft: #e3f4f1;
  --amber: #d99524;
  --red: #b7433f;
  --shadow: 0 18px 50px rgba(23, 32, 51, 0.08);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; min-height: 100vh; background: var(--canvas); padding-bottom: env(safe-area-inset-bottom); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 2.65rem; line-height: 1.06; letter-spacing: 0; }
h2 { font-size: 1.7rem; line-height: 1.15; letter-spacing: 0; }
h3 { font-size: 1rem; }

.boot-screen, .empty-state, .error-state {
  min-height: 60vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--muted);
  text-align: center;
  padding: 32px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 900;
  font-size: 1.4rem;
  border: 1px solid rgba(88, 105, 201, 0.16);
}

.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; font-weight: 800; }
.brand small { display: block; color: var(--muted); font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.brand-logo { height: 34px; width: auto; max-width: 190px; display: block; object-fit: contain; }
.login-panel .brand-logo { height: 42px; max-width: 250px; }
.brand-logo-chip {
  background: #ffffff;
  border: 1px solid rgba(217, 224, 234, .82);
  border-radius: 8px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  box-shadow: 0 10px 25px rgba(23, 32, 51, .08);
}
.sidebar .brand-logo-chip, .public-header .brand-logo-chip, .tech-header .brand-logo-chip { box-shadow: none; }

.btn {
  border: 0;
  border-radius: 8px;
  padding: 11px 16px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 760;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--navy); color: white; box-shadow: 0 12px 24px rgba(23, 32, 51, .16); }
.btn-primary:hover { background: var(--navy-2); }
.btn-lime { background: var(--blue); color: white; box-shadow: 0 10px 22px rgba(88, 105, 201, .18); }
.btn-ghost { color: var(--ink); background: #eef2f6; }
.btn-danger { color: #8f2826; background: #fae8e7; }
.btn-small { min-height: 34px; padding: 7px 11px; border-radius: 8px; font-size: .82rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; pointer-events: none; }

.field { display: grid; gap: 7px; }
.field > span, .field > label { font-size: .79rem; font-weight: 760; color: #405168; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fbfcfe;
  color: var(--ink);
  border-radius: 8px;
  padding: 11px 12px;
  outline: 0;
  transition: border .15s, box-shadow .15s, background .15s;
}
.field textarea { min-height: 105px; resize: vertical; }
.field select[multiple] { min-height: 180px; padding: 8px; }
.field select[multiple] option { padding: 7px 8px; border-radius: 6px; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--blue);
  background: white;
  box-shadow: 0 0 0 3px rgba(88, 105, 201, .12);
}
.field-hint { color: var(--muted); font-size: .75rem; line-height: 1.45; }
.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #405168;
  font-weight: 760;
  font-size: .88rem;
}
.checkbox-row input { width: 18px; height: 18px; accent-color: var(--blue); }
.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}
.choice-chip {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: #405168;
  font-size: .84rem;
  font-weight: 720;
}
.choice-chip input { width: 16px; height: 16px; accent-color: var(--blue); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, .92fr) minmax(520px, 1.08fr);
  background: var(--paper);
}
.login-panel {
  display: grid;
  align-content: center;
  padding: 48px 7vw;
  overflow-y: auto;
  min-height: 100vh;
}
.login-panel .brand { margin-bottom: 42px; }
.login-copy { max-width: 480px; }
.login-copy > p:not(.eyebrow) { color: var(--muted); line-height: 1.7; margin-bottom: 32px; }
.login-form { display: grid; gap: 16px; max-width: 430px; }
.login-switch {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  max-width: 430px;
  margin-bottom: 18px;
  padding: 5px;
  border-radius: 8px;
  background: #eef2f6;
  border: 1px solid var(--line);
}
.login-switch button {
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}
.login-switch button.active {
  background: white;
  color: var(--navy);
  box-shadow: 0 3px 12px rgba(23, 32, 51, .08);
}
.field .access-code-input {
  font: 800 1.3rem ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .32em;
}
.login-visual {
  margin: 12px;
  min-height: calc(100vh - 24px);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  display: grid;
  align-items: center;
  padding: 46px;
  color: white;
  background:
    linear-gradient(135deg, rgba(23,32,51,.96), rgba(37,50,74,.94)),
    repeating-linear-gradient(0deg, rgba(255,255,255,.05) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.04) 0 1px, transparent 1px 64px);
}
.login-visual::before {
  content: "";
  position: absolute;
  inset: 22px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
}
.visual-card { position: relative; z-index: 1; max-width: 540px; }
.visual-card h2 { font-size: 2.3rem; line-height: 1.04; margin-bottom: 18px; letter-spacing: 0; }
.visual-card p { color: #d6dce8; line-height: 1.6; }
.feature-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.feature-pill { padding: 9px 12px; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; font-size: .76rem; color: #f4f7fb; background: rgba(255,255,255,.06); }

.dashboard { min-height: 100vh; display: grid; grid-template-columns: 258px minmax(0, 1fr); }
.sidebar {
  background: var(--navy);
  color: white;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid rgba(255,255,255,.08);
}
.sidebar .brand { padding: 0 6px; margin-bottom: 34px; }
.sidebar .brand small { color: #aeb8c8; }
.nav-list { display: grid; gap: 4px; }
.nav-item {
  border: 0;
  background: transparent;
  color: #c7cfda;
  padding: 11px 12px;
  border-radius: 8px;
  text-align: left;
  font-weight: 680;
  display: flex;
  align-items: center;
  gap: 11px;
}
.nav-item::before { content: ""; width: 4px; height: 20px; border-radius: 4px; background: currentColor; opacity: .25; }
.nav-label { flex: 1; min-width: 0; }
.nav-badge {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: #e5484d;
  color: white;
  font-size: .72rem;
  font-weight: 900;
  line-height: 1;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: white; }
.nav-item.active { background: #ffffff; color: var(--navy); box-shadow: 0 10px 24px rgba(0,0,0,.14); }
.nav-item.active::before { background: var(--blue); opacity: 1; }
.nav-item.active .nav-badge { background: var(--blue); }
.sidebar-user { margin-top: auto; border-top: 1px solid rgba(255,255,255,.12); padding: 20px 8px 0; }
.sidebar-user strong, .sidebar-user span { display: block; }
.sidebar-user span { color: #aeb8c8; font-size: .74rem; margin: 4px 0 12px; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .btn { color: white; background: rgba(255,255,255,.08); width: 100%; }

.main-area { min-width: 0; }
.topbar {
  min-height: 76px;
  padding: 17px 44px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(217,224,234,.86);
}
.topbar h1 { font-size: 1.3rem; margin: 0; letter-spacing: 0; }
.topbar p { color: var(--muted); font-size: .77rem; margin: 3px 0 0; }
.topbar-badge { padding: 8px 11px; border-radius: 8px; background: var(--teal-soft); color: #14685f; font-size: .74rem; font-weight: 800; }
.content { padding: 28px 44px 60px; max-width: 1500px; width: 100%; min-width: 0; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 22px; }
.page-heading h2 { margin-bottom: 5px; }
.page-heading p { margin: 0; color: var(--muted); font-size: .86rem; }

.stats-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.stat-card, .panel, .service-card, .public-card {
  background: var(--paper);
  border: 1px solid rgba(217,224,234,.9);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(23,32,51,.045);
}
.stat-card { padding: 20px; min-height: 124px; display: flex; flex-direction: column; justify-content: space-between; }
.stat-card span { color: var(--muted); font-size: .77rem; font-weight: 680; }
.stat-card strong { font-size: 2rem; letter-spacing: 0; }
.stat-card.highlight { background: var(--navy); color: white; border-color: var(--navy); }
.stat-card.highlight span { color: #c9d1dc; }
.panel { padding: 22px; min-width: 0; }
.panel + .panel { margin-top: 16px; }
.overview-queue { margin-top: 32px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.panel-head h3 { margin: 0; }
.two-columns { display: grid; grid-template-columns: minmax(290px, .72fr) minmax(500px, 1.3fr); gap: 18px; align-items: start; }
.customer-layout { display: grid; gap: 18px; }
.customer-layout > .panel:first-child { max-width: 520px; }
.toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.toolbar-wide { flex: 1; }
.search-input, .toolbar select {
  border: 1px solid var(--line);
  background: #fbfcfe;
  color: var(--ink);
  border-radius: 8px;
  padding: 9px 11px;
  min-height: 38px;
  outline: 0;
}
.search-input { width: min(320px, 100%); }
.toolbar-wide .search-input { width: min(380px, 100%); }
.search-input:focus, .toolbar select:focus {
  border-color: var(--blue);
  background: white;
  box-shadow: 0 0 0 3px rgba(88, 105, 201, .12);
}
.empty-filter { margin: 14px 0 0; }

.table-wrap { width: 100%; max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: .83rem; }
table[data-filter-table="customers"] { min-width: 1180px; }
th { padding: 11px 13px; background: #f7f9fc; color: var(--muted); text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
td { padding: 13px; border-top: 1px solid var(--line); vertical-align: middle; }
tr:hover td { background: #fbfcfe; }
.cell-main { display: block; font-weight: 760; color: var(--ink); }
.cell-sub { display: block; color: var(--muted); font-size: .74rem; margin-top: 3px; }
.table-actions { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.table-actions select { max-width: 155px; border: 1px solid var(--line); border-radius: 8px; padding: 7px; background: white; }

.brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}
.brand-card {
  border: 1px solid var(--line);
  background: #fbfcfe;
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 13px;
  min-height: 102px;
}
.brand-card strong, .brand-card span { display: block; }
.brand-card strong { font-size: .96rem; }
.brand-card span { color: var(--muted); font-size: .73rem; margin-top: 4px; }
.brand-card.is-disabled { opacity: .62; background: #f1f3f6; }
.brand-card .table-actions { justify-content: flex-end; }

.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 8px; padding: 5px 9px; font-size: .67rem; font-weight: 850; letter-spacing: .02em; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-active, .badge-completed { background: #e0f3ec; color: #15704c; }
.badge-expired, .badge-cancelled { background: #fae7e6; color: #a33b38; }
.badge-pending, .badge-new { background: #fff2d9; color: #89580a; }
.badge-assigned { background: #e6ecfb; color: #315d9d; }
.badge-in_progress { background: #ece8fb; color: #5841a0; }
.badge-void { background: #eef1f4; color: #5c6673; }
.badge-warranty { background: #e3f4f1; color: #14685f; }
.badge-non_warranty { background: #f7ecdc; color: #7d531f; }

.modal { border: 0; border-radius: 8px; padding: 0; width: min(760px, calc(100vw - 28px)); max-height: calc(100vh - 28px); box-shadow: 0 30px 90px rgba(23,32,51,.28); }
.modal::backdrop { background: rgba(11, 18, 32, .62); backdrop-filter: blur(3px); }
.modal-head { position: sticky; top: 0; z-index: 2; background: white; border-bottom: 1px solid var(--line); padding: 18px 22px; display: flex; justify-content: space-between; align-items: center; }
.modal-head h2 { margin: 0; font-size: 1.25rem; }
.modal-body { padding: 22px; }
.close-btn { border: 0; background: #eef2f6; width: 34px; height: 34px; border-radius: 8px; font-size: 1.1rem; }
.qr-layout { display: grid; grid-template-columns: 280px 1fr; gap: 24px; align-items: start; }
.qr-image { width: 100%; border-radius: 8px; border: 1px solid var(--line); }
.token-box { background: #f4f6f9; border-radius: 8px; padding: 11px; font: 500 .72rem ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.customer-id-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  white-space: nowrap;
  background: #eef2f6;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  font: 800 .72rem ui-monospace, SFMono-Regular, Consolas, monospace;
  color: var(--navy);
}
.detail-list { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.detail-row { display: grid; grid-template-columns: 150px 1fr; gap: 15px; padding: 11px 13px; border-bottom: 1px solid var(--line); }
.detail-row:last-child { border: 0; }
.detail-row span { color: var(--muted); font-size: .75rem; }
.detail-row strong { font-size: .82rem; }
.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.media-grid img, .media-grid video { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; background: #eef2f6; }

.technician-page { min-height: 100vh; background: var(--canvas); }
.tech-header { background: var(--navy); color: white; padding: 17px 64px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.1); }
.tech-header .brand small { color: #aeb8c8; }
.tech-user { display: flex; align-items: center; gap: 12px; }
.tech-user-copy { text-align: right; }
.tech-user-copy strong, .tech-user-copy span { display: block; }
.tech-user-copy span { color: #aeb8c8; font-size: .7rem; margin-top: 3px; }
.tech-main { max-width: 1200px; margin: 0 auto; padding: 38px 22px 70px; }
.filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.filter-tab { border: 1px solid var(--line); background: white; border-radius: 8px; padding: 9px 14px; font-weight: 760; color: var(--muted); }
.filter-tab.active { background: var(--navy); color: white; border-color: var(--navy); }
.service-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.service-card { padding: 20px; }
.service-card-top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.service-number { color: var(--muted); font-size: .73rem; }
.service-card h3 { font-size: 1.15rem; margin: 4px 0 5px; }
.service-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 16px 0; }
.meta-box { padding: 10px; background: #f6f8fb; border-radius: 8px; }
.meta-box span, .meta-box strong { display: block; }
.meta-box span { color: var(--muted); font-size: .68rem; margin-bottom: 4px; }
.meta-box strong { font-size: .78rem; }
.problem-preview { color: #405168; font-size: .84rem; line-height: 1.55; padding-top: 14px; border-top: 1px solid var(--line); }

.public-page { min-height: 100vh; background: var(--canvas); }
.public-header { background: var(--navy); color: white; padding: 17px 76px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255,255,255,.1); }
.public-header .brand small { color: #aeb8c8; }
.public-header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; }
.public-tech-login {
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 8px;
  background: rgba(255,255,255,.1);
  color: white;
  padding: 9px 13px;
  font-size: .78rem;
  font-weight: 850;
}
.public-tech-login:hover { background: rgba(255,255,255,.18); }
.verified-pill { border: 1px solid rgba(255,255,255,.18); border-radius: 8px; padding: 8px 12px; color: #d6dce8; font-size: .72rem; font-weight: 750; }
.public-main { max-width: 1180px; margin: 0 auto; padding: 32px 20px 70px; }
.boiler-hero { background: var(--navy); border-radius: 8px; padding: 48px; color: white; position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: end; border: 1px solid rgba(255,255,255,.08); }
.boiler-hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 4px; background: linear-gradient(90deg, var(--blue), var(--teal), var(--amber)); }
.eyebrow { color: var(--teal); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 850; }
.login-visual .eyebrow, .boiler-hero .eyebrow { color: #9aa8ff; }
.boiler-hero h1 { margin: 12px 0 10px; max-width: 680px; }
.serial { color: #c9d1dc; font: 500 .85rem ui-monospace, SFMono-Regular, Consolas, monospace; }
.warranty-seal { position: relative; z-index: 1; min-width: 175px; padding: 18px; border: 1px solid rgba(255,255,255,.16); border-radius: 8px; background: rgba(255,255,255,.06); backdrop-filter: blur(5px); }
.warranty-seal span, .warranty-seal strong { display: block; }
.warranty-seal span { color: #c9d1dc; font-size: .7rem; margin-bottom: 7px; }
.warranty-seal strong { font-size: 1rem; }
.public-section-title { margin: 34px 0 16px; }
.public-section-title p { color: var(--muted); font-size: .84rem; }
.action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.access-panel { max-width: 520px; margin: 24px auto 0; }
.public-entry-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 900px; margin: 24px auto 0; }
.entry-card { display: flex; flex-direction: column; min-height: 245px; }
.entry-card p { color: var(--muted); line-height: 1.6; flex: 1; }
.public-page:has(.public-entry-grid) .serial { font-family: inherit; line-height: 1.6; }
.registration-hero { align-items: center; }
.step-chip { position: relative; z-index: 1; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; padding: 9px 13px; color: #d6dce8; font-size: .78rem; font-weight: 800; }
.registration-card { max-width: 820px; margin: 24px auto 0; }
.registration-card > .btn { margin-bottom: 24px; }
.registration-success { min-height: 280px; display: grid; place-items: center; justify-items: center; gap: 12px; text-align: center; }
.registration-success h2, .registration-success p { margin: 0; }
.success-mark { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: var(--teal-soft); color: var(--teal); font-size: 1.6rem; font-weight: 900; }
.public-boiler-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.public-boiler-tab {
  text-align: left;
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 5px;
}
.public-boiler-tab strong, .public-boiler-tab span { display: block; }
.public-boiler-tab span { color: var(--muted); font-size: .75rem; }
.public-boiler-tab.active { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(88, 105, 201, .12); }
.public-card { padding: 24px; }
.public-card-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 20px; }
.card-number { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 8px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; font-weight: 900; }
.public-card h2 { font-size: 1.18rem; margin: 1px 0 5px; }
.public-card-head p { color: var(--muted); margin: 0; font-size: .77rem; line-height: 1.45; }
.warranty-ticket { border-radius: 8px; background: #f6f8fb; padding: 16px; display: grid; gap: 11px; border: 1px solid var(--line); }
.ticket-row { display: flex; justify-content: space-between; gap: 12px; font-size: .8rem; }
.ticket-row span { color: var(--muted); }
.ticket-row strong { text-align: right; }
.public-form { display: grid; gap: 12px; }
.public-form .form-actions { margin: 2px 0 0; }
.stars { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.stars input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; overflow: hidden; clip-path: inset(50%); }
.stars label { color: #cfd6df; font-size: 2rem; line-height: 1; cursor: pointer; transition: color .15s, transform .15s; }
.stars label:hover, .stars label:hover ~ label, .stars input:checked ~ label { color: var(--amber); }
.stars label:hover { transform: scale(1.08); }
.history-list { display: grid; gap: 10px; }
.history-item { border: 1px solid var(--line); border-radius: 8px; padding: 14px; display: grid; grid-template-columns: 1fr auto; gap: 12px; }
.history-item strong, .history-item span { display: block; }
.history-item span { color: var(--muted); font-size: .72rem; margin-top: 4px; }

.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: grid; gap: 9px; width: min(360px, calc(100vw - 36px)); }
.toast { background: var(--ink); color: white; padding: 13px 15px; border-radius: 8px; box-shadow: var(--shadow); font-size: .82rem; animation: toast-in .2s ease; }
.toast.success { background: var(--teal); }
.toast.error { background: #942e2c; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.muted { color: var(--muted); }
.small { font-size: .76rem; }
.stack { display: grid; gap: 14px; }
.divider { height: 1px; background: var(--line); margin: 20px 0; }
.mobile-brand { display: none; }

@media (max-width: 1100px) {
  h1 { font-size: 2.2rem; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .two-columns { grid-template-columns: 1fr; }
  .login-page { grid-template-columns: minmax(340px, 1fr) minmax(430px, .95fr); }
}

@media (max-width: 820px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.45rem; }
  .login-page { grid-template-columns: 1fr; }
  .login-panel { min-height: 100vh; padding: 32px 24px; }
  .login-panel .brand { margin-bottom: 42px; }
  .login-visual { display: none; }
  .dashboard { display: block; }
  .sidebar { height: auto; position: fixed; z-index: 50; bottom: 0; left: 0; right: 0; top: auto; padding: 8px; display: block; }
  .sidebar .brand, .sidebar-user { display: none; }
  .nav-list { display: flex; overflow-x: auto; gap: 5px; }
  .nav-item { flex: 0 0 auto; padding: 10px 12px; font-size: .74rem; }
  .nav-item::before { display: none; }
  .topbar { top: 0; padding: 14px 20px; }
  .content { padding: 22px 20px 110px; }
  th { padding: 10px 11px; }
  td { padding: 11px; }
  .customer-id-pill { min-width: 80px; padding: 5px 7px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .action-grid, .service-grid { grid-template-columns: 1fr; }
  .boiler-hero { grid-template-columns: 1fr; padding: 28px; }
  .warranty-seal { width: 100%; }
  .qr-layout { grid-template-columns: 1fr; }
  .qr-image { max-width: 310px; margin: auto; }
  .public-header, .tech-header { padding: 14px 20px; }
  .public-entry-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .public-entry-grid { gap: 12px; margin-top: 16px; }
  .entry-card { min-height: 0; }
  .entry-card p { font-size: .875rem; margin-bottom: 14px; }
  .public-page:has(.public-entry-grid) .boiler-hero { padding: 18px; }
  .public-page:has(.public-entry-grid) .boiler-hero h1 { font-size: 1.45rem; }
  .public-page:has(.public-entry-grid) .serial { margin-bottom: 0; }
  h1 { font-size: 1.78rem; }
  .brand-logo { height: 28px; max-width: 160px; }
  .login-panel .brand-logo { height: 36px; max-width: 220px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-card { min-height: 105px; padding: 16px; }
  .stat-card strong { font-size: 1.55rem; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .panel { padding: 17px; }
  .verified-pill, .tech-user-copy { display: none; }
  .public-main { padding: 18px 13px 50px; }
  .public-header { padding: 12px 14px; gap: 10px; }
  .public-header .brand small { display: none; }
  .public-header-actions { gap: 6px; }
  .public-tech-login { padding: 9px 10px; font-size: .72rem; }
  .boiler-hero { padding: 24px 20px; }
  .boiler-hero h1 { font-size: 1.72rem; }
  .public-card { padding: 18px; }
  .modal-body { padding: 17px; }
  .detail-row { grid-template-columns: 1fr; gap: 4px; }
  .media-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 390px) {
  .public-tech-login { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .login-panel { padding-inline: 18px; }
  .content { padding-inline: 14px; }
  .topbar { padding-inline: 14px; }
}

@media (pointer: coarse) {
  .btn, .nav-item, .public-tech-login, .filter-tab, .public-boiler-tab, .close-btn { min-height: 44px; }
  .field input, .field select, .field textarea { min-height: 46px; font-size: 16px; }
}

/* Task-focused admin and technician workspaces. */
[hidden] { display: none !important; }
.mobile-menu-toggle { display: none; }
.topbar-title { flex: 1; min-width: 0; }
.topbar { gap: 16px; background: var(--paper); backdrop-filter: none; }
.sidebar { overflow-y: auto; }
.dashboard .content { margin-inline: auto; }
.dashboard .panel, .technician-page .panel, .service-card { box-shadow: none; border-radius: 12px; }
.dashboard .stats-grid { grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); }
.panel-head p { color: var(--muted); font-size: .875rem; line-height: 1.6; margin: 6px 0 0; }
.panel-head > *, .field, .service-card-top > *, .history-item > *, .meta-box { min-width: 0; }
.mobile-cell-value { overflow-wrap: anywhere; }
.btn, .filter-tab, .nav-item, .tech-nav-button { min-height: 44px; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.tech-main { max-width: 1240px; padding: 32px 24px 64px; }
.tech-main .page-heading h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 10px; line-height: 1.2; }
.tech-navigation { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 6px; background: #e8edf4; border-radius: 12px; margin-bottom: 28px; }
.tech-nav-button { padding: 12px; border: 0; border-radius: 8px; background: transparent; color: #405168; font-weight: 700; line-height: 1.4; }
.tech-nav-button[aria-current="page"] { background: var(--navy); color: white; }
.tech-nav-button:hover { background: var(--blue-soft); color: var(--navy); }
.tech-pane.panel { margin: 0; padding: 28px; }
#tech-register { max-width: 900px; }
#tech-lookup { max-width: 660px; }
.tech-pane .form-grid { gap: 20px 24px; }
.check-row { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: .9rem; }
.check-row input { width: 20px; height: 20px; accent-color: var(--blue); }
.service-card { display: flex; flex-direction: column; padding: 24px; }
.service-card > .btn { margin-top: auto; box-shadow: none; }
.service-card-top { flex-wrap: wrap; gap: 12px; }
.service-card-top > div:last-child { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; }
.service-card h3, .meta-box strong, .history-item strong { overflow-wrap: anywhere; }
.service-card .badge { font-size: .75rem; }
.service-meta { gap: 12px; }
.meta-box span { font-size: .75rem; }
.meta-box strong { font-size: .9rem; line-height: 1.5; }
.problem-preview { font-size: .95rem; line-height: 1.65; overflow-wrap: anywhere; }
.service-grid > .empty-state { grid-column: 1 / -1; min-height: 240px; background: white; border: 1px dashed var(--line); border-radius: 12px; }
.tech-header { padding-inline: max(24px, calc((100% - 1192px) / 2)); gap: 16px; }
.tech-header .tech-user-copy { display: block; }
.tech-user-copy strong { max-width: 220px; overflow-wrap: anywhere; }
.field input, .field select, .field textarea { min-width: 0; max-width: 100%; }

@media (max-width: 1000px) and (min-width: 821px) {
  .dashboard { grid-template-columns: 220px minmax(0, 1fr); }
  .content, .topbar { padding-inline: 24px; }
  .panel-head { flex-wrap: wrap; }
}
@media (max-width: 820px) {
  .dashboard { display: flex; flex-direction: column; }
  .dashboard .sidebar { display: none; position: static; height: auto; padding: 16px; order: 0; background: var(--paper); color: var(--ink); border-bottom: 1px solid var(--line); }
  .dashboard.menu-open .sidebar { display: block; }
  .dashboard .main-area { display: contents; }
  .dashboard .topbar { order: -1; z-index: 60; padding: 12px 16px; gap: 10px; }
  .mobile-menu-toggle { display: inline-flex; }
  .topbar h1 { font-size: 1rem; line-height: 1.35; overflow-wrap: anywhere; }
  .topbar p { font-size: .75rem; }
  .dashboard .nav-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; overflow: visible; }
  .dashboard .nav-item { color: #405168; border: 1px solid var(--line); font-size: .875rem; padding: 12px; line-height: 1.4; }
  .dashboard .nav-item.active { color: white; background: var(--navy); box-shadow: none; }
  .dashboard .nav-item.active .nav-badge { background: white; color: var(--navy); }
  .dashboard .content { padding: 24px 16px max(32px, env(safe-area-inset-bottom)); }
  .panel-head { align-items: stretch; flex-direction: column; }
  .toolbar, .toolbar-wide { width: 100%; justify-content: flex-start; }
  .toolbar .search-input, .toolbar-wide .search-input { width: 100%; }
  .toolbar select { flex: 1 1 140px; min-width: 0; max-width: 100%; min-height: 44px; }
  .dashboard .field input, .dashboard .field select, .dashboard .field textarea,
  .technician-page input, .technician-page select, .technician-page textarea, .search-input { font-size: 16px; }
  .table-wrap:has(.responsive-table) { border: 0; overflow: visible; }
  .responsive-table, table.responsive-table[data-filter-table="customers"] { display: block; min-width: 0; width: 100%; }
  .responsive-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .responsive-table tbody { display: grid; gap: 16px; }
  .responsive-table tbody tr { display: block; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--paper); }
  .responsive-table td { display: grid; grid-template-columns: minmax(80px, .7fr) minmax(0, 1.3fr); gap: 12px; padding: 12px; align-items: start; font-size: .875rem; }
  .responsive-table td::before { content: attr(data-label); color: var(--muted); font-size: .75rem; font-weight: 600; line-height: 1.5; }
  .responsive-table td:first-child { border-top: 0; background: #f7f9fc; }
  .responsive-table td[colspan] { display: block; padding: 20px; }
  .responsive-table td[colspan]::before { display: none; }
  .responsive-table .cell-sub { font-size: .8rem; line-height: 1.5; }
  .responsive-table .badge { white-space: normal; font-size: .75rem; }
  .responsive-table .table-actions { flex-wrap: wrap; white-space: normal; gap: 8px; }
  .responsive-table .table-actions > * { flex: 1 1 100px; max-width: 100%; min-height: 44px; }
  .tech-main { padding: 24px 16px 48px; }
  .tech-navigation { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 24px; }
  .tech-pane.panel { padding: 20px; }
  .tech-header { padding: 16px; align-items: center; flex-wrap: wrap; }
  .tech-header .brand small { display: none; }
  .tech-user { margin-left: auto; }
  .tech-user-copy strong { font-size: .8rem; max-width: 130px; }
  .filter-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .filter-tab { padding: 10px 8px; font-size: .875rem; }
  .service-card { padding: 20px; }
  .history-item { grid-template-columns: 1fr; }
  .modal { max-height: calc(100dvh - 24px); }
  .close-btn { min-width: 44px; min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
