:root {
  --ink: #17212b;
  --muted: #657384;
  --line: #e4e9ee;
  --bg: #f6f8fb;
  --card: #fff;
  --blue: #246bfe;
  --green: #14966b;
  --amber: #d99015;
  --red: #c94b4b;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Noto Sans Thai", Arial, sans-serif;
}
.topbar {
  height: 84px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 34px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--blue);
  font-weight: 800;
}
.topbar h1 {
  font-size: 22px;
  margin: 5px 0 0;
}
.top-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}
.pill {
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  background: #eaf8f2;
  color: var(--green);
}
button {
  font: inherit;
  border: 0;
  cursor: pointer;
}
.ghost,
.secondary {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--ink);
}
.primary {
  background: var(--blue);
  color: #fff;
  border-radius: 10px;
  padding: 11px 16px;
  font-weight: 700;
}
.danger {
  background: #fff0f0;
  color: var(--red);
  border: 1px solid #ffd1d1;
  border-radius: 10px;
  padding: 10px 14px;
}
.layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  min-height: calc(100vh - 84px);
}
.sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 24px 14px;
}
.nav {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  background: transparent;
  border-radius: 10px;
  color: var(--muted);
  margin-bottom: 4px;
}
.nav.active,
.nav:hover {
  background: #edf3ff;
  color: var(--blue);
  font-weight: 700;
}
.side-note {
  margin: 38px 10px 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.side-note b {
  display: block;
  color: var(--ink);
  margin-bottom: 9px;
}
.side-note select {
  width: 100%;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.side-note small {
  display: block;
  line-height: 1.5;
  margin-top: 12px;
}
.content {
  padding: 30px;
  max-width: 1400px;
  width: 100%;
  margin: auto;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 22px;
}
.page-head h2 {
  margin: 0;
  font-size: 25px;
}
.muted {
  color: var(--muted);
}
.grid {
  display: grid;
  gap: 16px;
}
.metrics {
  grid-template-columns: repeat(4, 1fr);
}
.two {
  grid-template-columns: 1.2fr 0.8fr;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 20px #1b31500a;
}
.metric .label {
  font-size: 13px;
  color: var(--muted);
}
.metric .value {
  font-size: 30px;
  font-weight: 800;
  margin-top: 10px;
}
.metric .hint {
  font-size: 12px;
  color: var(--green);
  margin-top: 7px;
}
.section-title {
  font-size: 16px;
  font-weight: 800;
  margin: 0 0 15px;
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th,
.table td {
  text-align: left;
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  vertical-align: top;
}
.table th {
  color: var(--muted);
  font-weight: 600;
}
.tag {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef2f6;
  color: #526272;
  font-size: 12px;
}
.tag.blue {
  background: #eaf0ff;
  color: #245ee5;
}
.tag.green {
  background: #e9f8f1;
  color: #13835e;
}
.tag.amber {
  background: #fff5df;
  color: #a96b04;
}
.tag.red {
  background: #ffeded;
  color: #b34040;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
}
.field textarea {
  min-height: 90px;
  resize: vertical;
}
.span-2 {
  grid-column: span 2;
}
.actions {
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  align-items: center;
}
.notice {
  padding: 13px 15px;
  border-radius: 10px;
  background: #eef5ff;
  color: #315d9d;
  font-size: 13px;
  line-height: 1.55;
}
.customer-card {
  background: linear-gradient(135deg, #172b4d, #2059a5);
  color: #fff;
  border: 0;
}
.customer-card .muted {
  color: #d6e2f7;
}
.price {
  font-size: 34px;
  font-weight: 900;
  margin: 6px 0;
}
.choice-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.choice {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.choice.selected {
  border-color: var(--blue);
  background: #eef3ff;
  color: var(--blue);
  font-weight: 700;
}
.timeline {
  display: grid;
  gap: 12px;
}
.timeline-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.dot {
  width: 10px;
  height: 10px;
  background: var(--blue);
  border-radius: 50%;
  margin-top: 4px;
  box-shadow: 0 0 0 4px #eaf0ff;
}
.qrbox {
  width: 138px;
  height: 138px;
  border: 8px solid #fff;
  outline: 1px solid var(--line);
  background: repeating-linear-gradient(45deg, #111 0 5px, #fff 5px 10px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}
.customer-mode {
  max-width: 980px;
  margin: 0 auto;
  padding: 36px;
}
.customer-mode .topbar {
  margin: -36px -36px 28px;
  height: 75px;
  padding: 0 24px;
}
.lang {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.lang button {
  background: #fff;
  border: 1px solid var(--line);
  padding: 8px 11px;
  border-radius: 8px;
  font-size: 12px;
}
.lang button.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.full {
  width: 100%;
  margin-top: 10px;
}
.smallqr {
  width: 48px;
  height: 48px;
  border-width: 3px;
  font-size: 8px;
  display: inline-flex;
  margin-right: 8px;
  vertical-align: middle;
}
.receiptqr {
  width: 120px;
  height: 120px;
  margin: 12px auto;
}
.job-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 18px 0;
}
.detail-grid div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #f7f9fc;
  padding: 12px;
  border-radius: 10px;
}
.photo-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.photo-chip {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  background: #fff;
}
.job-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: -8px 0 20px;
}
.step {
  padding: 8px 12px;
  border-radius: 999px;
  background: #edf0f4;
  color: var(--muted);
  font-size: 12px;
}
.step.active {
  background: #e8f8f1;
  color: var(--green);
  font-weight: 700;
}
.sign-box {
  margin-top: 16px;
  padding: 14px;
  border: 1px dashed #aebdcc;
  border-radius: 10px;
  background: #fbfdff;
}
.sign-box input {
  width: 100%;
  margin-top: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.checklist {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 14px;
  background: #f7f9fc;
  border-radius: 10px;
  margin-bottom: 16px;
}
.guide-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}
.guide-list details {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
  background: #fff;
}
.guide-list summary {
  font-weight: 700;
  cursor: pointer;
}
.guide-list p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}
@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: flex;
    gap: 5px;
    overflow: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 10px;
  }
  .nav {
    white-space: nowrap;
    width: auto;
  }
  .side-note {
    display: none;
  }
  .content {
    padding: 18px;
  }
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .two {
    grid-template-columns: 1fr;
  }
  .topbar {
    padding: 0 18px;
  }
  .top-actions .pill {
    display: none;
  }
}
@media (max-width: 600px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  .span-2 {
    grid-column: auto;
  }
  .topbar h1 {
    font-size: 18px;
  }
  .customer-mode {
    padding: 18px;
  }
  .customer-mode .topbar {
    margin: -18px -18px 22px;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
}
.tech-brief {
  border: 2px solid #d7e7ff;
  background: #f8fbff;
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.photo-grid figure {
  margin: 0;
}
.photo-grid img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #dce7f5;
}
.photo-grid figcaption {
  font-size: 11px;
  color: #667085;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 3px;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 10, 24, 0.72);
  backdrop-filter: blur(5px);
}
.modal-card {
  width: min(460px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}
.modal-card h2 {
  margin: 0 0 8px;
}
.modal-card .actions {
  justify-content: flex-end;
  margin-top: 22px;
}
.modal-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 16px;
  color: var(--text);
}
.photo-grid figure {
  cursor: zoom-in;
}
.photo-lightbox {
  position: fixed;
  inset: 0;
  background: #000b;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
}
.photo-lightbox img {
  max-width: 95vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 12px 50px #0008;
}
.photo-lightbox figcaption {
  color: #fff;
  text-align: center;
  margin-top: 8px;
}
.sign-box.customer-sign {
  margin-top: 18px;
}
.sign-box.customer-sign input {
  font-size: 18px;
  padding: 14px;
}
.signature-pad {
  display: block;
  width: 100%;
  height: 180px;
  margin-top: 10px;
  border: 1px dashed #8da9c9;
  border-radius: 10px;
  background: #fff;
  touch-action: none;
  cursor: crosshair;
}
.signature-record {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #b9dfcb;
  border-radius: 10px;
  background: #f1fbf5;
}
.signature-record b,
.signature-record small {
  display: block;
}
.signature-record img {
  display: block;
  width: min(100%, 360px);
  height: 110px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #d6e8de;
  border-radius: 8px;
  margin: 9px 0;
}
.signature-wait {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  padding: 12px;
  border-radius: 9px;
  background: #fff7e8;
  color: #7a5815;
}
.intake-qr {
  display: block;
  margin: 10px auto;
  background: #fff;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.qr-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: #17212bcc;
}
.qr-modal-card {
  position: relative;
  width: min(100%, 520px);
  padding: 28px;
  border-radius: 16px;
  background: #fff;
  text-align: center;
  box-shadow: 0 20px 60px #0004;
}
.qr-modal-card h3 {
  margin: 0 0 8px;
}
.qr-modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f0f3f7;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}
.qr-modal-url {
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 12px;
  word-break: break-all;
}
.customer-entry-modal {
  width: min(560px, 100%);
}
.passcode-choice {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.passcode-choice button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 9px;
  padding: 9px 11px;
}
.passcode-choice button.selected {
  background: #eaf0ff;
  border-color: var(--blue);
  color: var(--blue);
  font-weight: 700;
}
.passcode-dots {
  font-size: 28px;
  letter-spacing: 7px;
  text-align: center;
  margin: 18px 0;
  color: #111;
}
.iphone-keypad {
  max-width: 300px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.iphone-keypad button {
  height: 58px;
  border-radius: 50%;
  background: #f0f2f5;
  border: 1px solid #d8dde5;
  font-size: 22px;
  color: #17212b;
}
.iphone-keypad button:active {
  background: #d7dce3;
}
.customer-entry-modal {
  width: min(480px, calc(100vw - 28px));
  padding: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #f2f5fa 100%);
  border: 1px solid #ffffff;
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.38);
}
.customer-entry-modal h2 {
  text-align: center;
  font-size: 24px;
  margin: 2px 0 5px;
}
.customer-entry-modal > p.muted {
  text-align: center;
  margin: 0 0 20px;
}
.customer-entry-modal .field {
  margin-top: 13px;
}
.customer-entry-modal .field label {
  font-size: 12px;
  color: #5d6674;
  margin: 0 0 6px;
}
.customer-entry-modal .field input,
.customer-entry-modal .field select {
  border: 0;
  border-radius: 13px;
  background: #fff;
  box-shadow: inset 0 0 0 1px #d9dee7;
  padding: 13px 14px;
  font-size: 16px;
}
.customer-entry-modal .form-grid {
  gap: 10px;
}
.customer-entry-modal .passcode-choice {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  padding: 4px;
  border-radius: 13px;
  background: #e3e7ee;
}
.customer-entry-modal .passcode-choice button {
  min-height: 42px;
  padding: 7px 5px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #4d5765;
  font-size: 12px;
  line-height: 1.2;
}
.customer-entry-modal .passcode-choice button.selected {
  background: #fff;
  color: #1671e9;
  box-shadow: 0 2px 7px #32455d25;
  font-weight: 800;
}
.customer-entry-modal .passcode-dots {
  font-size: 24px;
  letter-spacing: 9px;
  color: #1e2732;
  margin: 22px 0 6px;
}
.customer-entry-modal .iphone-keypad {
  max-width: 286px;
  gap: 13px;
  margin: 7px auto 0;
}
.customer-entry-modal .iphone-keypad button {
  height: 64px;
  border: 1px solid #d5dce6;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 28%,
    #fff 0,
    #f6f8fb 55%,
    #e2e7ef 100%
  );
  box-shadow:
    0 4px 9px #14233924,
    inset 0 1px 0 #fff;
  font-size: 25px;
  font-weight: 500;
  transition:
    transform 0.12s,
    background 0.12s;
}
.customer-entry-modal .iphone-keypad button:active {
  transform: scale(0.93);
  background: #dbe2eb;
}
.customer-entry-modal .notice {
  position: relative;
  padding: 14px 15px 14px 46px;
  border: 1px solid #cde0ff;
  border-radius: 14px;
  background: linear-gradient(135deg, #edf5ff, #f8fbff);
  color: #315d9d;
  box-shadow: 0 3px 10px #356da615;
}
.customer-entry-modal .notice:before {
  content: "i";
  position: absolute;
  left: 15px;
  top: 14px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #2675ec;
  color: #fff;
  font-weight: 900;
  font-family: Georgia, serif;
}
.customer-entry-modal .actions {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 9px;
}
.customer-entry-modal .actions button {
  min-height: 48px;
  border-radius: 14px;
  font-weight: 800;
}
.customer-entry-modal .primary {
  background: linear-gradient(180deg, #3d91ff, #1664e8);
  box-shadow: 0 8px 16px #1664e844;
}
.customer-entry-modal .secondary {
  background: #fff;
  border: 1px solid #dce2ea;
}
.modal-backdrop {
  background: rgba(21, 29, 42, 0.58);
  backdrop-filter: blur(11px);
}
.ios-alert-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(17, 24, 39, 0.42);
  backdrop-filter: blur(9px);
  animation: iosFade 0.18s ease-out;
}
.ios-alert {
  width: min(310px, 100%);
  padding: 24px 22px 16px;
  border-radius: 24px;
  background: rgba(250, 252, 255, 0.96);
  box-shadow: 0 18px 60px #0005;
  text-align: center;
  animation: iosPop 0.22s cubic-bezier(0.2, 0.85, 0.28, 1.2);
}
.ios-alert-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 11px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #41d77a, #14a95a);
  color: #fff;
  font-size: 28px;
  font-weight: 900;
  box-shadow: 0 6px 14px #14a95a55;
}
.ios-alert h3 {
  margin: 0;
  font-size: 19px;
}
.ios-alert p {
  margin: 8px 0 18px;
  color: #5b6572;
  line-height: 1.5;
  font-size: 14px;
}
.ios-alert button {
  width: calc(100% + 44px);
  margin-left: -22px;
  padding: 13px 20px;
  border: 0;
  border-top: 1px solid #dce2ea;
  background: transparent;
  color: #1671e9;
  font-size: 17px;
  font-weight: 800;
}
@keyframes iosFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes iosPop {
  from {
    opacity: 0;
    transform: scale(0.86);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.repair-approved {
  display: flex;
  gap: 13px;
  align-items: center;
  padding: 17px;
  border: 1px solid #b8e7cc;
  border-radius: 15px;
  background: linear-gradient(135deg, #effdf5, #e0f8ea);
  color: #147246;
}
.repair-approved-icon {
  width: 39px;
  height: 39px;
  flex: 0 0 39px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #45d67e, #18a55a);
  color: #fff;
  font-size: 23px;
  font-weight: 900;
  box-shadow: 0 5px 12px #18a55a55;
}
.repair-approved b {
  display: block;
  font-size: 17px;
}
.repair-approved span {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  color: #438262;
}
.repair-approved-footer {
  width: 100%;
  padding: 13px 14px;
  border-radius: 14px;
  background: #eaf9f0;
  color: #197548;
  text-align: center;
  font-weight: 800;
}
.repair-approved-footer small {
  color: #52866a;
  font-weight: 500;
}
