/* Maid Shopping tool — self-contained styling (no external framework, so it
   works standalone under sch-tracker/ without the biz theme assets). */
:root {
  --accent: #766df4;
  --accent-dark: #5b52d6;
  --ink: #2b2c48;
  --muted: #737491;
  --line: #e2e5f1;
  --bg: #f7f7fc;
  --octopus: #2a7de1;
  --amex: #1f9d5b;
  --cash: #b58a00;
  --danger: #d1435b;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang HK", "Microsoft JhengHei", sans-serif;
  font-size: 15px; line-height: 1.5;
}
a { color: var(--accent); }
.hidden { display: none !important; }

/* Gate / spinner */
.maid-gate[hidden] { display: none !important; }  /* author display:flex would otherwise override [hidden] */
.maid-gate {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #fff; color: var(--muted); gap: .75rem;
}
.spinner {
  width: 2.5rem; height: 2.5rem;
  border: .15em solid var(--accent); border-right-color: transparent;
  border-radius: 50%; animation: spin .75s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Top bar */
.topbar {
  height: 60px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: .75rem; padding: 0 1.25rem;
  position: sticky; top: 0; z-index: 100;
}
.brand { font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: .01em; }
.brand .dot { color: var(--accent); }
.brand small { font-weight: 500; color: var(--muted); }
.topbar .spacer { margin-left: auto; }
.topbar .who { color: var(--muted); font-size: .85rem; }
.lang-btn {
  border: 1px solid var(--line); background: #fff; border-radius: .5rem;
  padding: .3rem .5rem; font-size: 1rem; cursor: pointer; line-height: 1;
}
.lang-btn:hover { background: #f2f1fd; border-color: var(--accent); }

.wrap { max-width: 1000px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
h1 { font-size: 1.4rem; margin: .2rem 0 1.2rem; }
h2 { font-size: 1.1rem; margin: 0 0 .5rem; }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: .8rem;
  padding: 1.25rem 1.25rem; margin-bottom: 1.25rem;
}

/* Buttons + inputs */
.btn {
  display: inline-flex; align-items: center; gap: .4rem; cursor: pointer;
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
  border-radius: .5rem; padding: .5rem .9rem; font-size: .9rem; font-weight: 500;
  text-decoration: none; transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: #fff; color: var(--accent); }
.btn.ghost:hover { background: #f2f1fd; }
.btn.sm { padding: .3rem .6rem; font-size: .82rem; }
.btn.danger { background: var(--danger); border-color: var(--danger); }
input, select {
  border: 1px solid var(--line); border-radius: .45rem; padding: .4rem .55rem;
  font-size: .9rem; color: var(--ink); background: #fff; max-width: 100%;
}
input:focus, select:focus { outline: 2px solid #cfcbf7; border-color: var(--accent); }
label { font-size: .82rem; color: var(--muted); display: block; margin-bottom: .2rem; }
.row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }

/* Login — mirrors /sch-tracker/login.html's .signin-form treatment so the two
   login screens read as one product: a fixed 652x556 box with the shared
   illustration as a ::before background, and a white ::after rectangle cutting
   out the middle so only the illustration's edges show around the card. */
.login-main { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px 24px 40px; }
.signin-form { position: relative; width: 652px; max-width: 100%; min-height: 556px; padding-bottom: 40px; overflow: hidden; margin: 0 auto; }
.signin-form::before, .signin-form::after { position: absolute; content: ''; }
.signin-form::before { left: 0; bottom: 0; width: 100%; height: 556px; background-image: url('/img/login-illustration.png'); background-repeat: no-repeat; background-size: cover; }
.signin-form::after { left: 122px; bottom: 556px; width: 412px; height: 100%; background-color: #fff; }
.signin-form-inner { position: relative; max-width: 390px; margin: 0 auto; padding: 32px 30px 0 30px; background-color: #fff; z-index: 5; text-align: left; }
.signin-form-inner h1 { font-size: 20px; font-weight: 700; margin: 0 0 6px; color: var(--ink); text-align: center; }
.signin-form-inner p.lede { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 0 0 20px; text-align: center; }

.form-group { margin-bottom: 12px; }
.form-input { width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; font-family: inherit; font-size: 14px; background: #fff; color: var(--ink); }
.form-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(118,109,244,0.12); }

.btn-primary { display: block; width: 100%; padding: 11px 16px; border: none; border-radius: 10px; background: var(--accent); color: #fff; font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .15s; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:disabled { opacity: .6; cursor: default; }

.divider { display: flex; align-items: center; gap: 10px; margin: 18px 0; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.btn-oauth { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 11px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font-family: inherit; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; transition: all .15s; }
.btn-oauth:hover { border-color: var(--accent); box-shadow: 0 4px 12px rgba(118,109,244,0.15); }
.btn-oauth svg { flex-shrink: 0; }

.login-note { margin-top: 16px; font-size: 11px; color: var(--muted); text-align: center; }

@media (max-width: 499px) {
  .signin-form { width: 100%; min-height: 0; padding-bottom: 0; overflow: visible; }
  .signin-form::before, .signin-form::after { display: none; }
  .signin-form-inner { padding: 40px 20px; border-radius: 1rem; box-shadow: 0 0 .625rem -.1875rem rgba(0,0,0,0.13); }
}

.login-box { max-width: 380px; margin: 8vh auto 0; }
.login-box .card { padding: 1.75rem; }
.login-box .field { margin-bottom: .9rem; }
.login-box input { width: 100%; }
.sep { text-align: center; color: var(--muted); font-size: .8rem; margin: .9rem 0; }
.err { color: var(--danger); font-size: .85rem; margin-top: .5rem; min-height: 1.1em; }
.msg { color: var(--octopus); font-size: .85rem; }
.ok { color: var(--amex); font-size: .85rem; }

/* Batch grid */
.grid-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: .85rem; }
table.grid th, table.grid td { border-bottom: 1px solid var(--line); padding: .4rem .5rem; text-align: left; vertical-align: middle; }
table.grid th { color: var(--muted); font-weight: 600; white-space: nowrap; }
table.grid input, table.grid select { width: 100%; }
table.grid tr.invalid td { background: #fff4f6; }
.thumb { width: 34px; height: 34px; object-fit: cover; border-radius: .3rem; border: 1px solid var(--line); }

/* Summary cards */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; }
.stat { border: 1px solid var(--line); border-radius: .6rem; padding: .8rem 1rem; }
.stat .k { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.stat .v { font-size: 1.4rem; font-weight: 700; margin-top: .15rem; }
.stat .n { font-size: .78rem; color: var(--muted); }
.stat.octopus { border-top: 3px solid var(--octopus); }
.stat.amex { border-top: 3px solid var(--amex); }
.stat.cash { border-top: 3px solid var(--cash); }
.stat.total { border-top: 3px solid var(--accent); }

.pill { font-size: .72rem; padding: .1rem .45rem; border-radius: 1rem; font-weight: 600; }
.pill.octopus { background: #e3f0fd; color: var(--octopus); }
.pill.amex { background: #e3f6ec; color: var(--amex); }
.pill.cash { background: #fbf3d9; color: var(--cash); }
.pill.yes { background: #e3f6ec; color: var(--amex); }
.pill.no { background: #fdeaee; color: var(--danger); }
.pill.ignore { background: #eceef2; color: var(--muted); }
.muted { color: var(--muted); }
.fs-sm { font-size: .85rem; }
