:root {
  color-scheme: light;
  --ink: #163d3a;
  --paper: #ffffffc9;
  --canvas: #f7faf9;
  --text: #1a302e;
  --muted: #5c716e;
  --line: #d8e5e1;
  --accent: #0e766b;
  --action: #126d61;
  --action-hover: #0c544b;
  --soft: #e9f5f1;
  --danger: #a12f3a;
  --danger-bg: #fceff0;
  --warning: #7c5a16;
  --warning-bg: #fff5dc;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100dvh; background: var(--canvas); color: var(--text); }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { min-height: 46px; padding: 10px 18px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; touch-action: manipulation; transition: background-color .18s, border-color .18s, transform .18s; }
button:active { transform: scale(.985); }
button:disabled { cursor: wait; opacity: .6; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
input { display: block; width: 100%; min-height: 50px; margin-top: 8px; padding: 11px 14px; border: 1px solid #c7d9d3; border-radius: 8px; background: #ffffffd9; color: var(--text); }
input:focus { border-color: var(--action); outline: 3px solid #126d6124; outline-offset: 0; }
input::placeholder { color: #829098; }
label { display: block; margin-top: 20px; font-size: .9375rem; font-weight: 620; }
h1, h2, p { margin: 0; }
h1 { font-size: 2.3rem; line-height: 1.2; letter-spacing: -.035em; font-weight: 660; }
h2 { font-size: 1.45rem; line-height: 1.35; letter-spacing: -.02em; font-weight: 640; }
p { line-height: 1.7; }
[hidden] { display: none !important; }
.skip-link { position: absolute; z-index: 1000; top: -70px; left: 16px; padding: 10px 16px; background: var(--paper); color: var(--text); border-radius: 6px; }
.skip-link:focus { top: 12px; }
.primary { background: var(--action); color: #fff; font-weight: 620; }
.primary:hover { background: var(--action-hover); }
.primary span { margin-left: 12px; font-size: 1.2em; line-height: 0; }
.secondary { border-color: var(--line); background: #ffffffa8; color: var(--text); font-weight: 570; }
.secondary:hover { background: var(--soft); border-color: #b4cfc3; }
.text-button { background: transparent; color: var(--muted); }
.text-button:hover { background: var(--canvas); }
.full { width: 100%; margin-top: 26px; }
.muted, .hint { color: var(--muted); }
.hint { margin-top: 8px; font-size: .875rem; }
.error { margin-top: 16px; padding: 11px 14px; border: 1px solid #f0c5ca; border-radius: 8px; background: var(--danger-bg); color: var(--danger); font-size: .9375rem; }
.badge { display: inline-flex; align-items: center; min-height: 27px; padding: 3px 9px; border-radius: 5px; background: var(--soft); color: #145b50; font-size: .8125rem; font-weight: 600; white-space: nowrap; }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.warning { background: var(--warning-bg); color: var(--warning); }
.badge.disabled { background: #e9eef0; color: var(--muted); }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.eyebrow { display: flex; align-items: center; gap: 11px; color: var(--accent); font-size: .875rem; font-weight: 620; letter-spacing: .08em; }
.eyebrow-line { width: 20px; height: 2px; background: currentColor; }
.accent-stop { color: var(--accent); }
.site-header { position: relative; z-index: 1; height: 86px; padding: 0 max(32px, calc((100vw - 1200px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid #dce9e5; background: #ffffffad; color: var(--text); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { display: grid; place-items: center; width: 39px; height: 39px; flex: 0 0 39px; border: 1px solid #a8cec3; border-radius: 8px; background: #e8f5f0a8; color: var(--accent); font-size: 1.1rem; font-weight: 800; letter-spacing: -.08em; }
.brand-type { display: flex; flex-direction: column; line-height: 1.15; }
.brand-type strong { font-size: .975rem; letter-spacing: .16em; }
.brand-type small { margin-top: 5px; color: var(--muted); font-size: .75rem; letter-spacing: .08em; }
.header-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 0; color: var(--muted); font-size: .9375rem; }
.header-link:hover { color: var(--action); }
.header-link span { color: var(--accent); font-size: 1.1rem; }
.panel-topline { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 22px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .8125rem; font-weight: 600; letter-spacing: .04em; }
.panel-topline span:last-child { color: #72918b; font-size: .72rem; letter-spacing: .14em; }
.required { color: var(--danger); }

/* Customer lookup: the working form is visible in the first viewport. */
.query-page { display: flex; flex-direction: column; background: var(--canvas); }
.query-main { flex: 1; display: flex; align-items: center; background: radial-gradient(circle at 14% 30%, #dff3ec 0, transparent 36%), radial-gradient(circle at 85% 78%, #e8f4f1 0, transparent 34%), linear-gradient(135deg, #fcfefd, #f4faf7); }
.query-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 470px); align-items: center; gap: clamp(40px, 6vw, 100px); width: min(1200px, 100%); margin: 0 auto; padding: 72px 32px 86px; }
.query-intro h1, .login-intro h1 { margin: 22px 0 20px; color: var(--text); font-size: clamp(3rem, 5.2vw, 4.65rem); line-height: 1.15; letter-spacing: -.065em; font-weight: 660; }
.query-description, .login-intro > p:last-child { max-width: 29ch; color: var(--muted); font-size: 1.0625rem; line-height: 1.85; }
.query-intro .query-meta { display: flex; align-items: center; gap: 13px; max-width: 440px; margin-top: 66px; padding-top: 21px; border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; }
.meta-index { margin-right: 18px; color: var(--accent); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .8125rem; letter-spacing: .06em; }
.meta-divider { width: 22px; height: 1px; background: #a9c3bc; }
.query-panel, .login-panel { padding: 34px 38px 38px; border: 1px solid #ffffff; border-radius: 16px; background: #ffffffb8; box-shadow: 0 20px 56px #28746112, inset 0 1px #fff; backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); }
.query-panel h2, .login-panel h2 { margin-top: 28px; }
.panel-description { margin-top: 7px; color: var(--muted); font-size: .9375rem; }
.query-panel form { margin-top: 24px; }
.query-panel form label { margin-top: 0; }
.code-input { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 1.125rem; letter-spacing: .1em; text-transform: uppercase; }
.code-input::placeholder { font-family: inherit; font-size: 1rem; letter-spacing: 0; }
.query-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: min(1200px, 100%); min-height: 68px; margin: auto; padding: 16px 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8125rem; }
.result { margin-top: 26px; padding-top: 23px; border-top: 1px solid var(--line); }
.result-heading, .result-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.result-heading > span:first-child { overflow-wrap: anywhere; font-weight: 600; }
.otp { display: block; margin: 9px 0 11px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: clamp(2.7rem, 4vw, 3.5rem); font-weight: 660; letter-spacing: .12em; line-height: 1.5; font-variant-numeric: tabular-nums; }
.result-footer { font-size: .875rem; }

/* Admin uses the same masthead and a compact information surface. */
.login-view { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 440px); align-items: center; gap: clamp(40px, 7vw, 110px); min-height: calc(100dvh - 86px); padding: 72px max(32px, calc((100vw - 1200px) / 2)); background: radial-gradient(circle at 16% 34%, #dff3ec 0, transparent 36%), radial-gradient(circle at 82% 78%, #e8f4f1 0, transparent 34%), linear-gradient(135deg, #fcfefd, #f4faf7); }
.login-intro h1 { font-size: clamp(3rem, 5vw, 4.5rem); }
.login-panel form { margin-top: 25px; }
.login-panel form label { margin-top: 0; }
.dashboard { min-height: calc(100dvh - 86px); }
.dashboard-title { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 48px max(32px, calc((100vw - 1200px) / 2)) 88px; background: radial-gradient(circle at 15% 5%, #e3f5ed 0, transparent 38%), linear-gradient(120deg, #f9fcfa, #f0f8f5); color: var(--text); }
.dashboard-title h1 { margin-top: 13px; font-size: 2.65rem; }
.dashboard-subtitle { margin-top: 10px; color: var(--muted); font-size: .9375rem; }
.dashboard-title .secondary { border-color: #bdd6ce; background: #ffffff9c; color: var(--text); }
.dashboard-title .secondary:hover { background: #fff; }
.dashboard-content { width: min(1200px, calc(100% - 64px)); margin: -44px auto 0; padding-bottom: 70px; }
.summary { display: grid; grid-template-columns: repeat(4, 1fr); padding: 24px 8px; border: 1px solid #ffffff; border-radius: 14px; background: #ffffffbf; box-shadow: 0 14px 40px #2874610d; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.summary > div { padding: 3px 28px; }
.summary > div + div { border-left: 1px solid var(--line); }
.summary span { display: block; color: var(--muted); font-size: .875rem; }
.summary strong { display: block; margin-top: 8px; font-size: 2.05rem; font-weight: 650; line-height: 1.2; font-variant-numeric: tabular-nums; }
.table-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 40px 0 18px; }
.tabs { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.tab { min-height: 44px; padding: 9px 14px; border-radius: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-weight: 580; }
.tab:hover { color: var(--text); }
.tab.active { border-bottom-color: var(--action); color: var(--action); }
.account-list { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #ffffffba; }
.account-row { display: grid; grid-template-columns: minmax(130px, 1.25fr) 85px minmax(170px, 1.1fr) minmax(180px, 1.1fr) auto; align-items: center; gap: 22px; padding: 21px 24px; }
.account-row + .account-row { border-top: 1px solid var(--line); }
.account-name { margin-bottom: 6px; font-weight: 620; overflow-wrap: anywhere; }
.meta-label { display: block; margin-bottom: 4px; color: var(--muted); font-size: .8125rem; }
.account-code { display: inline-block; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 1.025rem; font-weight: 660; letter-spacing: .08em; }
.account-row > .query-meta { min-width: 0; overflow-wrap: anywhere; }
.code-copy { min-height: 40px; padding: 6px 9px; background: transparent; color: var(--action); font-size: .875rem; }
.code-copy:hover { background: var(--soft); }
.meta-line { margin-top: 4px; color: var(--muted); font-size: .8125rem; }
.account-actions { display: flex; gap: 8px; }
.account-actions button { padding: 9px 12px; font-size: .875rem; }
.empty { padding: 68px 24px; border: 1px dashed #bac8ce; border-radius: 10px; background: #ffffffba; text-align: center; }
.empty-mark { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 21px; border: 1px solid #c1d4cf; border-radius: 9px; color: var(--action); font-size: 1.6rem; line-height: 1; }
.empty p { margin: 9px 0 23px; color: var(--muted); }
.log-list { overflow: hidden; margin-top: 18px; border: 1px solid var(--line); border-radius: 10px; background: #ffffffba; }
.log-row { display: grid; grid-template-columns: 185px 1fr 1fr 120px; gap: 18px; padding: 16px 23px; font-size: .875rem; }
.log-row + .log-row { border-top: 1px solid var(--line); }
.log-name { overflow-wrap: anywhere; }
.dashboard-footnote { margin-top: 20px; color: var(--muted); font-size: .8125rem; }

/* Dialogs are functional forms, with the same restrained treatment. */
dialog { width: min(580px, calc(100% - 32px)); max-height: calc(100dvh - 48px); overflow: auto; padding: 30px; border: 1px solid #fff; border-radius: 14px; background: #ffffffed; color: var(--text); box-shadow: 0 24px 70px #1b493b25; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
dialog::backdrop { background: #1942365c; backdrop-filter: blur(4px); }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 8px; }
.form-grid { display: grid; grid-template-columns: 1fr 1.7fr; gap: 18px; }
.checkbox-label { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.checkbox-label input { display: inline-block; width: 20px; min-height: 20px; margin: 0; accent-color: var(--action); }
.dialog-actions { justify-content: flex-end; margin-top: 24px; }
#confirm-message { margin-top: 18px; }
.toast { position: fixed; z-index: 100; bottom: 28px; left: 50%; max-width: calc(100% - 32px); padding: 13px 22px; border-radius: 8px; background: var(--ink); color: #fff; box-shadow: 0 8px 25px #15283535; transform: translateX(-50%); font-size: .9375rem; }

@media (max-width: 1100px) {
  .account-row { grid-template-columns: 1.2fr 80px 1.1fr 1.2fr; gap: 16px; }
  .account-actions { grid-column: 1 / -1; justify-content: flex-end; }
}
@media (max-width: 767px) {
  .site-header { height: 72px; padding: 0 22px; }
  .brand-mark { width: 36px; height: 36px; flex-basis: 36px; }
  .query-main { display: block; }
  .query-layout { display: block; max-width: 520px; padding: 50px 22px 48px; }
  .query-intro h1, .login-intro h1 { margin: 16px 0; font-size: clamp(2.65rem, 10vw, 3.3rem); }
  .query-intro h1 br, .login-intro h1 br { display: none; }
  .query-description { max-width: none; font-size: .975rem; }
  .query-intro .query-meta { display: none; }
  .query-panel, .login-panel { margin-top: 32px; padding: 25px 23px 28px; }
  .query-footer { align-items: flex-start; flex-direction: column; gap: 3px; padding: 17px 22px 22px; }
  .login-view { display: block; min-height: calc(100dvh - 72px); padding: 50px 22px; }
  .login-intro > p:last-child { font-size: .975rem; }
  .dashboard-title { align-items: flex-start; flex-direction: column; gap: 23px; padding: 42px 22px 84px; }
  .dashboard-title h1 { font-size: 2.2rem; }
  .dashboard-content { width: calc(100% - 44px); }
  .summary { grid-template-columns: 1fr 1fr; padding: 0; }
  .summary > div { padding: 19px; }
  .summary > div + div { border-left: 0; }
  .summary > div:nth-child(even) { border-left: 1px solid var(--line); }
  .summary > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .summary strong { font-size: 1.75rem; }
  .table-toolbar { margin-top: 31px; }
  .table-toolbar > .primary { padding: 8px 12px; white-space: nowrap; }
  .tab { padding: 9px 10px; }
  .account-list { overflow: visible; border: 0; background: transparent; }
  .account-row { grid-template-columns: 1fr 1fr; gap: 18px; padding: 21px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
  .account-row + .account-row { margin-top: 12px; }
  .account-row > .account-identity { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .account-name { margin: 0; }
  .account-row > .query-meta { grid-column: 1 / -1; display: block; max-width: none; margin: 0; padding: 0; border: 0; color: var(--text); }
  .account-actions { justify-content: flex-start; padding-top: 15px; border-top: 1px solid var(--line); }
  .log-row { grid-template-columns: 1fr 1fr; gap: 8px; padding: 16px; }
  .log-row time, .log-client { grid-column: 1 / -1; }
  .otp { font-size: clamp(2.4rem, 9vw, 3.1rem); }
  .result-footer { flex-wrap: wrap; }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
  dialog { padding: 23px; }
}
@media (max-width: 380px) {
  .brand-type small { display: none; }
  .header-link { font-size: .875rem; }
  .table-toolbar { flex-wrap: wrap; }
  .table-toolbar > .primary { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
