/* HOI Sales — House of Iyers. Mobile-first. */
:root {
  --bg: #F5EEE3;
  --surface: #FFFCF7;
  --surface-2: #F9F3EA;
  --ink: #2A1E14;
  --muted: #7B6756;
  --line: #EADFCF;
  --line-2: #DCCBB3;
  --brand: #7A4516;
  --brand-600: #5F340F;
  --brand-50: #F5E6D2;
  --gold: #C8922A;
  --green: #2F5D2A;
  --green-50: #E6EFE0;
  --danger: #B3261E;
  --danger-50: #FBE9E7;
  --wa: #1DA851;
  --wa-600: #178A43;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(70, 40, 10, .05), 0 6px 20px rgba(70, 40, 10, .06);
  --nav-h: 64px;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }
h1, h2, h3 { margin: 0; }
.ic { flex: none; display: block; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: rgba(255, 252, 247, .94);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--ink); text-decoration: none; }
.brand img { width: 46px; height: 32px; object-fit: contain; }
.brand b { display: block; font: 700 18px/1.1 var(--serif); color: var(--brand); }
.brand small { display: block; margin-top: 2px; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.topnav { display: none; gap: 2px; margin-left: auto; }
.topnav a {
  display: flex; align-items: center; gap: 7px; padding: 9px 12px; border-radius: 10px;
  color: var(--muted); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap;
}
.topnav a:hover { background: var(--surface-2); color: var(--ink); }
.topnav a.on { background: var(--brand-50); color: var(--brand); }
.who { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.who .who-txt, .who .who-out { display: none; }
.who-txt b { display: block; font-size: 13.5px; line-height: 1.2; }
.who-txt small { display: block; font-size: 11.5px; color: var(--muted); }
.avatar {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), #A8672B); color: #fff; font-weight: 700; font-size: 13px; flex: none;
}
.avatar.lg { width: 46px; height: 46px; font-size: 16px; }

@media (min-width: 1000px) {
  .topnav { display: flex; }
  .who { margin-left: 8px; }
  .who .who-out { display: inline-flex; }
}
@media (min-width: 1280px) { .who .who-txt { display: block; } }

/* ---------- Bottom nav + sheet (mobile) ---------- */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
}
.bottomnav a, .bottomnav button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: none; border: 0; color: var(--muted); font: 600 11px/1 Inter, system-ui, sans-serif;
  text-decoration: none; cursor: pointer; position: relative;
}
.bottomnav .on { color: var(--brand); }
.bottomnav .on::before {
  content: ""; position: absolute; top: 8px; width: 52px; height: 30px; border-radius: 999px;
  background: var(--brand-50); z-index: -1;
}
.bottomnav a, .bottomnav button { z-index: 0; }
@media (min-width: 1000px) { .bottomnav { display: none; } }

.sheet { position: fixed; inset: 0; z-index: 60; visibility: hidden; }
.sheet-bg { position: absolute; inset: 0; background: rgba(30, 20, 10, .45); opacity: 0; transition: opacity .2s; }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 8px 16px calc(20px + env(safe-area-inset-bottom));
  background: var(--surface); border-radius: 22px 22px 0 0;
  transform: translateY(100%); transition: transform .25s ease;
}
.menu-open .sheet { visibility: visible; }
.menu-open .sheet-bg { opacity: 1; }
.menu-open .sheet-panel { transform: none; }
.sheet-grip { width: 40px; height: 4px; border-radius: 4px; background: var(--line-2); margin: 4px auto 14px; }
.sheet-user { display: flex; align-items: center; gap: 12px; padding: 4px 4px 14px; border-bottom: 1px solid var(--line); }
.sheet-user b { display: block; }
.sheet-user small { color: var(--muted); font-size: 13px; }
.sheet-label { margin: 14px 4px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sheet-link {
  display: flex; align-items: center; gap: 12px; padding: 14px 6px; border-radius: 12px;
  color: var(--ink); font-weight: 600; text-decoration: none;
}
.sheet-link:active { background: var(--surface-2); }
.sheet-link .ic { color: var(--brand); }
.sheet-link.danger, .sheet-link.danger .ic { color: var(--danger); }

/* ---------- Layout ---------- */
.wrap {
  max-width: 1120px; margin: 0 auto;
  padding: 16px 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom));
}
.has-sumbar .wrap { padding-bottom: calc(var(--nav-h) + 110px + env(safe-area-inset-bottom)); }
@media (min-width: 1000px) {
  .wrap { padding: 24px 24px 48px; }
  .has-sumbar .wrap { padding-bottom: 120px; }
}
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 16px; }
.page-head h1 { font: 700 26px/1.15 var(--serif); }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px;
}
@media (min-width: 700px) { .card { padding: 20px; } }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head .card-title { margin: 0; }
.card-title {
  display: flex; align-items: center; gap: 8px; margin: 0 0 14px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand);
}
.card-sub { margin: -8px 0 14px; color: var(--muted); font-size: 13px; }

.grid { display: grid; gap: 0 12px; }
.g2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 420px) { .g2.stack { grid-template-columns: 1fr; } }

.sale-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; }
.sale-grid > * { min-width: 0; }
@media (min-width: 900px) {
  .sale-grid { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: start; }
  .sticky-md { position: sticky; top: 84px; }
}

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field label, .label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field .hint { font-size: 12px; color: var(--muted); }
input, select, textarea {
  width: 100%; min-height: 48px; padding: 11px 13px;
  font: inherit; font-size: 16px; color: var(--ink);
  background: #fff; border: 1px solid var(--line-2); border-radius: 12px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 0; resize: vertical; line-height: 1.4; }
input::placeholder, textarea::placeholder { color: #B3A08C; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(122, 69, 22, .14); }
.invalid { border-color: var(--danger) !important; box-shadow: 0 0 0 3px rgba(179, 38, 30, .15) !important; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%237A4516' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
}
input[type=date] { min-width: 0; }
input[type=number]::-webkit-inner-spin-button { opacity: .4; }

.input-prefix { display: flex; align-items: stretch; }
.input-prefix span {
  display: grid; place-items: center; padding: 0 12px; font-weight: 600; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--line-2); border-right: 0; border-radius: 12px 0 0 12px;
}
.input-prefix input { border-radius: 0 12px 12px 0; font-weight: 600; letter-spacing: .03em; }

.input-icon { position: relative; }
.input-icon .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon input { padding-left: 40px; }

.cust-status {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-radius: 12px; font-size: 13.5px; background: var(--surface-2); color: var(--muted);
}
.cust-status.ok { background: var(--green-50); color: #22451E; }
.cust-status.new { background: var(--brand-50); color: var(--brand-600); }
.cust-status.err { background: var(--danger-50); color: var(--danger); }
.cust-status .muted { color: #4F6B49; font-size: 12.5px; }
.cust-status .btn { flex: none; }

.date-pill {
  display: flex; align-items: center; gap: 6px; padding: 0 4px 0 10px; border: 1px solid var(--line-2);
  border-radius: 999px; background: #fff; color: var(--brand);
}
.date-pill input { border: 0; min-height: 36px; padding: 4px 6px; width: auto; font-size: 14px; font-weight: 600; background: transparent; }
.date-pill input:focus { box-shadow: none; }

.disc-row { display: flex; flex-direction: column; gap: 8px; }
.disc-row input { max-width: 140px; }

.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px; margin-top: 14px; border-radius: 12px; background: #EEF7F0; cursor: pointer;
}
.switch-row b { display: block; font-size: 14px; }
.switch-row small { display: block; color: var(--muted); font-size: 12.5px; }
.switch {
  appearance: none; -webkit-appearance: none; flex: none; position: relative;
  width: 50px; min-height: 0; height: 30px; padding: 0; border: 0; border-radius: 999px;
  background: #CFC3B3; cursor: pointer; transition: background .2s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s;
}
.switch:checked { background: var(--wa); }
.switch:checked::after { transform: translateX(20px); }
.switch:focus { box-shadow: 0 0 0 3px rgba(29, 168, 81, .25); }
.check-row { display: flex; align-items: center; gap: 10px; font-weight: 600; margin-bottom: 14px; cursor: pointer; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border: 1px solid transparent; border-radius: 12px;
  font: 600 15px/1 Inter, system-ui, sans-serif; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background .15s, border-color .15s, transform .05s; user-select: none;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); }
.btn-ghost { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { background: var(--wa-600); }
.btn-danger { background: var(--danger-50); color: var(--danger); }
.btn-lg { min-height: 54px; padding: 0 24px; font-size: 16px; border-radius: 14px; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; gap: 6px; }
.btn-icon { width: 44px; padding: 0; }
.btn-sm.btn-icon { width: 36px; }
.btn-block { width: 100%; }
.btn-dashed { border-style: dashed; color: var(--brand); background: transparent; }
.btn[disabled] { opacity: .6; pointer-events: none; }
.btn.loading .ic { animation: spin .8s linear infinite; }
.spin {
  display: inline-block; width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Chips, badges, alerts ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; min-height: 36px;
  border: 1px solid var(--line-2); border-radius: 999px; background: #fff; color: var(--ink);
  font: 600 13px/1 Inter, system-ui, sans-serif; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; }
.chips.scroll::-webkit-scrollbar { display: none; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.badge.ok { background: var(--green-50); color: var(--green); }
.badge.err { background: var(--danger-50); color: var(--danger); }
.badge.brand { background: var(--brand-50); color: var(--brand); }
.badge.off { background: #EEE; color: #888; }

.alert { padding: 12px 14px; margin-bottom: 14px; border-radius: 12px; font-weight: 500; font-size: 14px; }
.alert.ok { background: var(--green-50); color: #22451E; }
.alert.err { background: var(--danger-50); color: var(--danger); }
.alert.info { background: var(--brand-50); color: var(--brand-600); }

/* ---------- Item rows ---------- */
.item-row {
  display: grid; grid-template-columns: 140px minmax(0, 1fr) 44px; grid-template-areas: "sel sel del" "qty meta meta";
  gap: 10px; padding: 12px; margin-bottom: 10px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px;
}
.item-row select { grid-area: sel; min-width: 0; font-weight: 600; text-overflow: ellipsis; }
.item-row .del { grid-area: del; color: var(--muted); }
.item-row .meta { grid-area: meta; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; }
.item-row .amt { font-weight: 800; font-size: 17px; }
.item-row .rate { font-size: 12.5px; color: var(--muted); }
.item-row.empty { background: transparent; border-style: dashed; }
.item-row.empty .stepper, .item-row.empty .meta { opacity: .45; }
.stepper {
  grid-area: qty; justify-self: start; display: flex; align-items: center;
  background: #fff; border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden;
}
.stepper button {
  display: grid; place-items: center; width: 44px; height: 44px; border: 0; background: none;
  color: var(--brand); cursor: pointer;
}
.stepper button:active { background: var(--brand-50); }
.stepper input {
  width: 50px; min-height: 44px; padding: 0; border: 0; border-radius: 0;
  text-align: center; font-weight: 800; font-size: 17px; -moz-appearance: textfield;
}
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { box-shadow: none; }
@media (min-width: 640px) {
  .item-row { grid-template-columns: minmax(0, 1fr) 140px 120px 44px; grid-template-areas: "sel qty meta del"; align-items: center; }
}

/* ---------- Totals & sticky summary ---------- */
.totals { margin: 4px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.totals div { display: flex; justify-content: space-between; padding: 4px 0; font-size: 14px; }
.totals .disc { color: var(--green); }
.totals em { font-style: normal; font-size: 12.5px; }
.totals .grand { margin-top: 6px; padding-top: 10px; border-top: 1px dashed var(--line-2); font-size: 18px; }
.totals .grand b { font-weight: 800; }

.sumbar {
  position: fixed; left: 0; right: 0; z-index: 35;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding: 10px 16px; background: var(--surface);
  border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(70, 40, 10, .08);
}
.sumbar-in { display: flex; align-items: center; gap: 12px; max-width: 1072px; margin: 0 auto; }
.sumbar .tot { flex: 1; min-width: 0; }
.sumbar .tot small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--muted); }
.sumbar .tot strong { display: block; font-size: 24px; font-weight: 800; letter-spacing: -.01em; }
@media (min-width: 1000px) { .sumbar { bottom: 0; padding: 12px 24px; } }

/* ---------- Stats & lists ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
@media (min-width: 800px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.stat small { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.stat b { display: block; margin-top: 6px; font-size: 21px; font-weight: 800; letter-spacing: -.01em; }
.stat.hl { background: linear-gradient(135deg, #7A4516, #A0612A); border: 0; color: #fff; }
.stat.hl small { color: rgba(255, 255, 255, .8); }

.filters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.filters .row { display: flex; gap: 8px; }
.filters .row > * { flex: 1; min-width: 0; }
.filters select { flex: 0 0 auto; width: auto; max-width: 42%; }
.custom-range { display: flex; gap: 8px; align-items: center; }
.custom-range input { flex: 1; }

.list { display: flex; flex-direction: column; gap: 10px; }
.li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.li-title { font-weight: 700; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; }
.li-sub { color: var(--muted); font-size: 13px; }
.li-items { grid-column: 1 / -1; font-size: 13.5px; color: var(--ink); }
.li-right { text-align: right; }
.li-amt { font-weight: 800; font-size: 17px; }
.li-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.li-actions {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 8px; padding-top: 10px; border-top: 1px dashed var(--line);
}
.li-actions form { margin: 0; }
.li.inactive { opacity: .6; }
@media (min-width: 900px) { .list.cols { display: grid; grid-template-columns: 1fr 1fr; } }

.empty-state { padding: 40px 16px; text-align: center; color: var(--muted); }
.empty-state .ic { margin: 0 auto 10px; color: var(--line-2); }

details.card > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary .card-title { margin: 0; }
details.card > summary::after { content: "+"; font-size: 20px; color: var(--brand); }
details.card[open] > summary::after { content: "–"; }
details.card[open] > summary { margin-bottom: 12px; }

.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 9px 6px; text-align: left; border-bottom: 1px solid var(--line); }
.tbl th { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tbl .r { text-align: right; }
.tbl tr:last-child td { border-bottom: 0; }

.pager { display: flex; justify-content: center; align-items: center; gap: 10px; margin: 18px 0; color: var(--muted); font-size: 14px; }

/* ---------- Dialogs ---------- */
dialog {
  width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0;
  border: 0; border-radius: 22px; background: var(--surface); color: var(--ink);
  box-shadow: 0 24px 60px rgba(30, 20, 10, .3);
}
dialog::backdrop { background: rgba(30, 20, 10, .5); }
dialog[open] { animation: pop .18s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { font: 700 20px/1.2 var(--serif); }
.dlg-body { padding: 18px; }
.dlg-foot { display: flex; gap: 10px; padding: 0 18px 18px; }
.dlg-foot .btn { flex: 1; }
dialog .edit-only { display: none; }
dialog.is-edit .edit-only { display: block; }
dialog.is-edit .add-only { display: none; }

.done-body { padding: 26px 22px 22px; text-align: center; }
.done-check {
  display: grid; place-items: center; width: 68px; height: 68px; margin: 0 auto 12px;
  border-radius: 50%; background: var(--green-50); color: var(--green);
}
.done-body h2 { font: 700 24px/1.2 var(--serif); }
.done-inv { margin: 6px 0 0; color: var(--muted); font-weight: 600; }
.done-amt { margin: 6px 0 0; font-size: 30px; font-weight: 800; }
.done-wa { margin: 10px 0 0; font-size: 13.5px; color: var(--muted); }
.done-wa.ok { color: var(--green); font-weight: 600; }
.done-wa.err { color: var(--danger); }
.done-actions { display: grid; gap: 10px; margin-top: 18px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top)); z-index: 100;
  max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 14px;
  background: #2A1E14; color: #fff; font-weight: 600; font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  transform: translate(-50%, -150%); transition: transform .25s ease; pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); }
.toast.err { background: var(--danger); }

/* ---------- Auth ---------- */
.auth .wrap { display: grid; place-items: center; min-height: 100vh; padding: 24px 16px; }
.auth-card { width: min(420px, 100%); padding: 28px 22px; text-align: center; }
.auth-logo { width: 190px; max-width: 70%; margin: 0 auto; display: block; }
.brand-name { margin: 8px 0 0; font: 700 38px/1.05 var(--serif); color: var(--brand); }
.brand-name i { font-size: .7em; font-weight: 700; }
.brand-orn { display: block; width: 150px; margin: 8px auto 6px; }
.brand-tag { font-size: 10.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.app-pill {
  display: inline-block; margin: 16px 0 20px; padding: 6px 14px; border-radius: 999px;
  background: var(--brand-50); color: var(--brand); font-weight: 700; font-size: 13px; letter-spacing: .04em;
}
.auth-card form { text-align: left; }
.auth-foot { margin-top: 16px; font-size: 12px; color: var(--muted); }

.code { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }
.help { font-size: 13px; color: var(--muted); line-height: 1.5; }
.help ul { margin: 6px 0; padding-left: 18px; }
