/* UAL Mason Reward Card — styles for the vendor page and the admin panel */
:root {
  --brand: #0a8e9b;
  --brand-dark: #076b75;
  --ink: #18282c;
  --ink-soft: #4a5b60;
  --muted: #6b7a7e;
  --line: #d9e3e4;
  --bg: #f2f6f6;
  --card: #ffffff;
  --ok: #0b7a4b;
  --ok-bg: #e6f4ee;
  --warn: #8a5300;
  --warn-bg: #fff4e0;
  --bad: #b3261e;
  --bad-bg: #fdecea;
  --info-bg: #e7f4f5;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--brand-dark); }
h1 { font-size: 1.5rem; line-height: 1.25; margin: 0 0 .5rem; }
h2 { font-size: 1.1rem; margin: 0 0 .5rem; }
p { margin: 0 0 .75rem; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 640px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

/* ---------- top bar ---------- */
.topbar { background: #fff; border-bottom: 3px solid var(--brand); }
.topbar-in { display: flex; align-items: center; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand img { height: 44px; width: auto; display: block; }
.tb-title { display: flex; flex-direction: column; line-height: 1.2; border-left: 1px solid var(--line); padding-left: 16px; }
.tb-title strong { font-size: 1rem; }
.tb-title span { font-size: .85rem; color: var(--muted); }

/* ---------- progress steps ---------- */
.steps { list-style: none; display: flex; gap: 8px; padding: 0; margin: 20px 0 16px; font-size: .9rem; color: var(--muted); }
.steps li { flex: 1; display: flex; align-items: center; gap: 8px; padding-bottom: 8px; border-bottom: 3px solid var(--line); }
.steps li span { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--line); color: var(--ink); font-weight: 700; font-size: .8rem; flex: none; }
.steps li.on { color: var(--ink); font-weight: 600; border-color: var(--brand); }
.steps li.on span { background: var(--brand); color: #fff; }
.steps li.done { border-color: var(--brand); }
.steps li.done span { background: var(--info-bg); color: var(--brand-dark); }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 16px; box-shadow: 0 2px 10px rgba(16, 40, 44, .05); }
.lead { color: var(--ink-soft); }

/* ---------- forms ---------- */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.req { color: var(--bad); }
.opt { color: var(--muted); font-weight: 400; font-size: .8rem; }
input:not([type]), input[type=text], input[type=tel], input[type=password], input[type=date], input[type=number], input[type=search], input[type=file], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1.5px solid #b9c7c9; border-radius: 8px; padding: 10px 12px; min-height: 44px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(10, 142, 155, .18); }
.code-label { margin-top: 12px; }
.code-input { font: 700 1.6rem/1.2 ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace !important; letter-spacing: .08em; text-align: center; text-transform: uppercase; padding: 14px !important; }
fieldset { border: 0; padding: 0; margin: 0 0 16px; }
legend { font-weight: 700; font-size: 1rem; margin-bottom: 8px; padding: 0; }
legend small { font-weight: 400; color: var(--muted); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.field.wide { grid-column: 1 / -1; }
.has-error input, .has-error select { border-color: var(--bad); background: #fffafa; }
.err-text { color: var(--bad); font-size: .85rem; margin: 4px 0 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; background: var(--warn-bg); border: 1px solid #f1d7a8; border-radius: 8px; padding: 12px; margin: 4px 0 4px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--brand); }
.check.has-error { border-color: var(--bad); }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-family: inherit; font-size: 1rem; font-weight: 600; line-height: 1.2; border-radius: 8px; padding: 11px 18px; min-height: 44px; border: 1.5px solid transparent; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.ghost { background: #fff; color: var(--brand-dark); border-color: var(--brand); }
.btn.danger { background: #fff; color: var(--bad); border-color: #e3b4b0; }
.btn.small { padding: 6px 12px; min-height: 34px; font-size: .875rem; }
.btn.big { width: 100%; font-size: 1.1rem; padding: 14px; margin-top: 14px; }
.btn.link { background: none; border: 0; color: var(--muted); text-decoration: underline; padding: 8px 0; min-height: 0; font-weight: 500; }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.cancel-form { text-align: center; margin-top: 6px; }

/* ---------- alerts ---------- */
.alert { border-radius: 8px; padding: 12px 14px; margin: 12px 0 14px; border-left: 5px solid; }
.alert strong { display: block; margin-bottom: 2px; }
.alert p { margin: 0; }
.alert-bad { background: var(--bad-bg); border-color: var(--bad); color: #6b1712; }
.alert-warn { background: var(--warn-bg); border-color: #d48806; color: #5c3a00; }
.alert-ok { background: var(--ok-bg); border-color: var(--ok); color: #064a2e; }
.alert-info { background: var(--info-bg); border-color: var(--brand); color: #0d4a50; }

/* ---------- valid banner / receipt ---------- */
.valid-banner { display: flex; align-items: center; gap: 16px; background: var(--ok-bg); border: 2px solid var(--ok); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; }
.valid-banner svg, .done-head svg { width: 56px; height: 56px; flex: none; }
.valid-banner svg circle, .done-head svg circle { fill: var(--ok); }
.valid-banner svg path, .done-head svg path { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.vb-label { font-weight: 700; color: var(--ok); text-transform: uppercase; letter-spacing: .06em; font-size: .85rem; margin: 0; }
.vb-amount { font-size: 2.4rem; font-weight: 800; line-height: 1.1; margin: 0; }
.vb-code { font-family: ui-monospace, Consolas, monospace; color: var(--ink-soft); margin: 2px 0 0; }
.done-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.done-head h1 { margin: 0; }
.receipt-list { margin: 0 0 8px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.receipt-list div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); }
.receipt-list div:first-child { border-top: 0; }
.receipt-list dt { color: var(--muted); white-space: nowrap; }
.receipt-list dd { margin: 0; font-weight: 600; text-align: right; }
.receipt-list .rid { background: var(--info-bg); }
.receipt-list .rid dd { font: 800 1.4rem ui-monospace, Consolas, monospace; color: var(--brand-dark); }

.howto { padding: 4px 8px 8px; color: var(--ink-soft); }
.howto ol { margin: 0; padding-left: 20px; }
.howto li { margin-bottom: 4px; }

.foot { color: var(--muted); font-size: .875rem; padding: 24px 0 32px; text-align: center; }

@media print {
  .topbar, .steps, .foot, .btn-row, .howto { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 0; }
}

/* =================================================================
 * Admin panel
 * ================================================================= */
.adm .topbar-in { justify-content: space-between; }
.adm-left { display: flex; align-items: center; gap: 16px; }
.adm-user { font-size: .875rem; color: var(--muted); }
.adm-nav { background: var(--brand); }
.adm-nav .wrap { display: flex; gap: 2px; overflow-x: auto; }
.adm-nav a { color: #fff; text-decoration: none; padding: 12px 14px; font-weight: 600; font-size: .925rem; white-space: nowrap; opacity: .9; }
.adm-nav a.on, .adm-nav a:hover { background: rgba(0, 0, 0, .14); opacity: 1; }
.adm main { padding-top: 20px; padding-bottom: 40px; }
.adm h1 { margin-bottom: 14px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.page-head h1 { margin: 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .k { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.stat .v { font-size: 1.6rem; font-weight: 800; line-height: 1.2; margin-top: 2px; }
.stat .s { font-size: .825rem; color: var(--muted); }
.bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: var(--brand); }

.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
table.t { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.t th, table.t td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; white-space: nowrap; }
table.t th { background: #f6fafa; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-soft); position: sticky; top: 0; }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.t tr:last-child td { border-bottom: 0; }
table.t tfoot td { font-weight: 700; background: #f6fafa; }
table.t .wrap-cell { white-space: normal; min-width: 180px; }
.mono { font-family: ui-monospace, Consolas, monospace; }

.pill { display: inline-block; font-size: .78rem; font-weight: 700; padding: 2px 9px; border-radius: 99px; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.grey { background: #eef1f1; color: var(--ink-soft); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; }
.filters .f { display: flex; flex-direction: column; min-width: 140px; }
.filters .f.grow { flex: 1; min-width: 200px; }
.filters label { font-size: .8rem; }
.pager { display: flex; gap: 6px; justify-content: flex-end; align-items: center; margin-top: 12px; font-size: .9rem; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-grid .wide { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.inline-form input[type=date], .inline-form input[type=text] { min-height: 34px; padding: 5px 8px; width: auto; }
details.settle summary { cursor: pointer; color: var(--brand-dark); font-weight: 600; }
details.settle form { margin-top: 8px; display: grid; gap: 6px; min-width: 220px; }
details.settle input { min-height: 34px; padding: 5px 8px; }

.login-box { max-width: 400px; margin: 48px auto; }

/* ---------- simple version additions ---------- */
.brand-img { height: 44px; width: auto; display: block; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin: 6px 0 14px; }
.tabs a { padding: 10px 16px; font-weight: 600; color: var(--ink-soft); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs a.on { color: var(--brand-dark); border-bottom-color: var(--brand); }
.quick { width: 100%; font-size: .875rem; color: var(--muted); }
.quick a { color: var(--brand-dark); }
.cn-given { margin: 0 6px 6px 0; }
.cn-form input[type=date] { width: 150px; }
.adm main section.card h2 { margin-bottom: 8px; }

/* ---------- Code Status page ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border: 1.5px solid var(--line); border-radius: 99px; background: #fff; color: var(--ink); text-decoration: none; font-size: .9rem; }
.chip b { font-variant-numeric: tabular-nums; }
.chip.on { border-color: var(--brand); background: var(--info-bg); }
.chip-note { color: var(--muted); font-size: .875rem; margin-left: 4px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: #b9c4c6; }
.dot.ok { background: var(--ok); }
.dot.warn { background: #d48806; }
.dot.bad { background: var(--bad); }
.status-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.status-bar input { max-width: 320px; min-height: 38px; padding: 6px 10px; }
.table-wrap.tall { max-height: 72vh; overflow: auto; }
.table-wrap.tall thead th { position: sticky; top: 0; z-index: 1; }
#codes td { padding-top: 6px; padding-bottom: 6px; }
