/* ------------------------------------------------------------------
   Ginger Sparrow Admin — brand stylesheet
   Tokens lifted from gingersparrow.com (Ascension theme, custom.css :root)
   ------------------------------------------------------------------ */
:root {
  --ink: #4b3d30;
  --ink-soft: rgba(75, 61, 48, 0.74);
  --ink-muted: rgba(75, 61, 48, 0.56);
  --paper: #fffbf5;
  --paper-2: #f7f0e6;
  --paper-3: #f1e8d9;
  --tan: #c9bca1;
  --sage: #a8b2ad;
  --sage-deep: #778482;
  --khaki: #a89e84;
  --rust: #c69e7d;
  --grey: #939393;
  --line: rgba(75, 61, 48, 0.12);
  --line-strong: rgba(75, 61, 48, 0.3);
  --serif: 'Libre Baskerville', Baskerville, 'Times New Roman', serif;
  --sans: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --ui: 'Fira Sans', 'Nunito Sans', Helvetica, Arial, sans-serif;
  --max: 1240px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: 0.1px;
  -webkit-font-smoothing: antialiased;
}
/* paper: warm wash + faint grain */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1200px 620px at 85% -10%, rgba(201, 188, 161, 0.24), transparent 62%),
    radial-gradient(900px 520px at -10% 105%, rgba(168, 178, 173, 0.2), transparent 60%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.29 0 0 0 0 0.24 0 0 0 0 0.19 0 0 0 0.05 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
a { color: inherit; }
button { font: inherit; color: inherit; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.eyebrow {
  margin: 0;
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; text-decoration: none; color: var(--ink); }
.brand__logo { display: block; height: 14px; width: auto; }
.brand__text { display: none; font-family: var(--serif); font-size: 13px; letter-spacing: 0.32em; text-transform: uppercase; }
.brand--text .brand__logo { display: none; }
.brand--text .brand__text { display: inline; }
.brand--stacked { display: flex; justify-content: center; margin-bottom: 22px; }
.brand--stacked .brand__logo { height: 20px; }

/* ---------- buttons (mirrors storefront .button) ---------- */
.btn {
  font-family: var(--ui);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.125em;
  text-transform: uppercase;
  line-height: 1.3;
  padding: 13px 26px;
  border: 1px solid transparent;
  border-radius: 0;
  cursor: pointer;
  background: var(--sage);
  color: var(--paper);
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.btn:hover { background: var(--sage-deep); }
.btn:focus-visible { outline: 2px solid var(--sage-deep); outline-offset: 2px; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { background: var(--paper-2); border-color: var(--ink); }
.btn--sm { padding: 8px 14px; font-size: 11px; }
.btn--wide { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: progress; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 251, 245, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner { max-width: var(--max); margin: 0 auto; padding: 14px 28px; display: flex; align-items: center; gap: 18px; }
.topbar__rule { width: 1px; height: 18px; background: var(--line-strong); }
.topbar__app { color: var(--ink); }
.topbar__nav { margin-left: 14px; display: flex; gap: 22px; }
.topbar__nav a {
  font-family: var(--serif); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  text-decoration: none; padding: 6px 0; color: var(--ink-soft); border-bottom: 1px solid transparent;
}
.topbar__nav a.is-active { color: var(--ink); border-bottom-color: var(--ink); }
.topbar__user { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.topbar__who { font-size: 13px; }
.topbar__who strong { font-weight: 500; }
.topbar__user form { margin: 0; }

.ribbon { background: var(--paper-3); border-bottom: 1px solid var(--line); text-align: center; font-size: 13px; padding: 8px 16px; }
.ribbon strong { font-weight: 500; }

/* ---------- page ---------- */
.main { width: 100%; max-width: var(--max); margin: 0 auto; padding: 44px 28px 64px; flex: 1; }

.pagehead { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-bottom: 26px; border-bottom: 1px solid var(--ink); }
.pagehead::after { content: ''; position: absolute; left: 0; right: 0; bottom: -4px; border-bottom: 1px solid var(--line); }
.pagehead__title { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 2vw + 20px, 40px); line-height: 1.15; letter-spacing: 0.01em; margin: 8px 0 10px; }
.pagehead__sub { margin: 0; max-width: 58ch; color: var(--ink-soft); }
.pagehead__sub em { font-family: var(--serif); font-style: italic; font-size: 0.95em; }
.pagehead__meta { display: flex; align-items: center; gap: 14px; white-space: nowrap; }
.updated { font-family: var(--serif); font-style: italic; font-size: 12.5px; color: var(--ink-muted); }

.notice { margin: 20px 0 0; padding: 12px 16px; border: 1px solid var(--line-strong); background: var(--paper-2); font-size: 13.5px; }
.notice--error { border-color: rgba(198, 158, 125, 0.85); background: #f6ebe2; color: #7a4a2c; }

/* ---------- tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 30px; }
.tile { position: relative; overflow: hidden; padding: 18px 18px 16px 20px; border: 1px solid var(--line); background: rgba(247, 240, 230, 0.62); display: flex; flex-direction: column; gap: 4px; }
.tile::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--tan); }
.tile--total::before { background: var(--ink); }
.tile--shipped::before { background: #b8965f; }
.tile--delivered::before { background: var(--sage-deep); }
.tile__num { font-family: var(--serif); font-size: 32px; line-height: 1; font-variant-numeric: tabular-nums; }
.tile__label { font-family: var(--serif); font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-muted); }

/* ---------- toolbar ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin-top: 26px; }
.search { position: relative; flex: 1 1 260px; max-width: 380px; display: flex; align-items: center; }
.search__icon { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--ink-muted); pointer-events: none; }
.search__input {
  width: 100%; font: inherit; font-size: 14px; padding: 10px 12px 10px 36px; border-radius: 0;
  border: 1px solid var(--line-strong); background: rgba(255, 255, 255, 0.55); color: var(--ink);
}
.search__input:focus { outline: none; border-color: var(--ink); background: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--ui); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 0; background: transparent;
  color: var(--ink-soft); cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip__count { margin-left: 4px; opacity: 0.7; font-variant-numeric: tabular-nums; }
.chip.is-active .chip__count { opacity: 0.85; }
.sort { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.sort__select {
  font: inherit; font-size: 13.5px; padding: 8px 32px 8px 10px; border-radius: 0; color: var(--ink);
  border: 1px solid var(--line-strong); appearance: none; -webkit-appearance: none;
  background: transparent url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%234B3D30' stroke-width='1.3'/></svg>") no-repeat right 11px center;
}
.sort__select:focus { outline: none; border-color: var(--ink); }

/* ---------- ledger ---------- */
.ledger { margin-top: 18px; border-top: 1px solid var(--ink); }
.orders { width: 100%; border-collapse: collapse; }
.orders th {
  font-family: var(--serif); font-size: 10.5px; font-weight: 400; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-muted); text-align: left; padding: 14px 14px 12px; border-bottom: 1px solid var(--line-strong); white-space: nowrap;
}
.orders td { padding: 16px 14px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 14px; }
.orders tbody tr { transition: background 0.15s; }
.orders tbody tr:hover { background: rgba(247, 240, 230, 0.7); }
.orders tr.is-cancelled td > * { opacity: 0.6; }
.orders th:nth-child(3), .orders td:nth-child(3) { width: 120px; }

.cell-order__num { display: block; font-family: var(--serif); font-size: 15px; letter-spacing: 0.02em; }
.cell-order__date { display: block; margin-top: 3px; font-size: 12.5px; color: var(--ink-muted); white-space: nowrap; }
.qty { display: inline-block; margin-left: 6px; padding: 1px 6px; font-family: var(--ui); font-size: 11px; letter-spacing: 0.05em; border: 1px solid var(--line-strong); color: var(--ink-soft); vertical-align: 2px; }
.tag { display: inline-block; margin-left: 6px; padding: 2px 6px; font-family: var(--ui); font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; background: var(--paper-3); color: var(--ink-soft); vertical-align: 2px; }

.cell-customer__name { display: block; font-weight: 500; }
.cell-customer__to { display: block; font-size: 12.5px; color: var(--ink-soft); }
.cell-customer__to::before { content: '→ '; color: var(--ink-muted); }
.cell-customer__dest { display: block; margin-top: 2px; font-size: 12.5px; color: var(--ink-muted); }

.cell-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.cell-date--none { color: var(--ink-muted); font-style: italic; font-family: var(--serif); font-size: 13px; }

.pill {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; line-height: 1.2;
  font-family: var(--ui); font-size: 10.5px; letter-spacing: 0.11em; text-transform: uppercase;
  padding: 5px 10px 5px 8px; border: 1px solid transparent;
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.9; }
.pill--delivered { background: #e6ece8; color: #4b5d56; }
.pill--shipped { background: #f1e8d9; color: #6f5434; }
.pill--awaiting { background: var(--paper-2); color: var(--ink-soft); border-color: var(--line-strong); border-style: dashed; }
.pill--issue { background: #f3e3d8; color: #8a4a2a; }
.pill--cancelled { background: #eeecea; color: #6f6b68; }
.status__detail { display: block; margin-top: 6px; font-size: 12.5px; color: var(--ink-muted); }

.ship { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ship + .ship { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.ship__carrier { min-width: 40px; font-family: var(--serif); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-muted); }
.ship__num { font-size: 13.5px; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line-strong); }
a.ship__num:hover { border-bottom-color: var(--ink); }
.ship__none { font-family: var(--serif); font-style: italic; font-size: 13px; color: var(--ink-muted); }
.ship__status { font-family: var(--ui); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
.copy {
  font-family: var(--ui); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 7px; border: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--ink-muted); cursor: pointer;
}
.copy:hover { border-color: var(--ink); color: var(--ink); }
.copy.is-done { color: #4b5d56; border-color: #4b5d56; }

.state { padding: 44px 14px; text-align: center; font-family: var(--serif); font-style: italic; color: var(--ink-muted); }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); padding: 22px 28px; display: flex; justify-content: space-between; gap: 16px; font-size: 12px; color: var(--ink-muted); }
.foot p { margin: 0; }
.foot__brand { font-family: var(--serif); font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase; }

/* ---------- login ---------- */
.page--login { justify-content: center; align-items: center; padding: 24px; }
.login { width: 100%; max-width: 440px; margin: auto; text-align: center; }
.login__card {
  position: relative; padding: 44px 40px 38px; background: rgba(255, 255, 255, 0.55); border: 1px solid var(--line);
  box-shadow: 0 30px 60px -40px rgba(75, 61, 48, 0.4);
}
.login__card::before { content: ''; position: absolute; inset: 6px; border: 1px solid var(--line); pointer-events: none; }
.login__eyebrow { margin-bottom: 6px; }
.login__title { margin: 0 0 8px; font-family: var(--serif); font-weight: 400; font-size: 28px; }
.login__sub { margin: 0 0 26px; font-size: 14px; color: var(--ink-soft); }
.form { text-align: left; display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field__label { font-family: var(--serif); font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-muted); }
.field__input { font: inherit; font-size: 15px; padding: 11px 12px; border: 1px solid var(--line-strong); border-radius: 0; background: rgba(255, 255, 255, 0.7); color: var(--ink); }
.field__input:focus { outline: none; border-color: var(--ink); background: #fff; }
.form__error { margin: 0; padding: 10px 12px; background: #f6ebe2; border: 1px solid rgba(198, 158, 125, 0.85); color: #7a4a2c; font-size: 13.5px; }
.form .btn { margin-top: 6px; }
.login__foot { margin-top: 18px; font-family: var(--serif); font-size: 10.5px; letter-spacing: 0.25em; text-transform: uppercase; color: var(--ink-muted); }

/* ---------- motion ---------- */
.reveal { animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.reveal[data-reveal='1'] { animation-delay: 90ms; }
.reveal[data-reveal='2'] { animation-delay: 180ms; }
.reveal[data-reveal='3'] { animation-delay: 270ms; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .reveal { animation: none; } }

/* ---------- responsive ---------- */
@media (max-width: 1000px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 820px) {
  .topbar__inner { padding: 12px 16px; gap: 12px; }
  .topbar__nav, .topbar__rule, .topbar__app, .topbar__who { display: none; }
  .main { padding: 28px 16px 48px; }
  .pagehead { flex-direction: column; align-items: flex-start; }
  .pagehead__meta { white-space: normal; }
  .sort { margin-left: 0; }
  .orders thead { display: none; }
  .orders, .orders tbody, .orders tr, .orders td { display: block; width: 100%; }
  .orders th:nth-child(3), .orders td:nth-child(3) { width: auto; }
  .orders tr { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .orders td { border: 0; padding: 6px 0; display: grid; grid-template-columns: 88px 1fr; column-gap: 10px; row-gap: 4px; align-items: start; }
  .orders td::before { content: attr(data-label); grid-column: 1; grid-row: 1; padding-top: 3px; font-family: var(--serif); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-muted); }
  .orders td > * { grid-column: 2; justify-self: start; max-width: 100%; }
  .orders td > .ship { justify-self: stretch; }
  .orders td > .cell-order__date, .orders td > .cell-customer__to, .orders td > .cell-customer__dest, .orders td > .status__detail { margin-top: 0; }
  .foot { flex-direction: column; padding: 18px 16px; }
}
@media (max-width: 480px) {
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile__num { font-size: 26px; }
  .login__card { padding: 32px 22px 28px; }
}
@media print {
  .topbar, .toolbar, .foot, .btn, .copy, .ribbon { display: none !important; }
  body::before { display: none; }
  .orders td, .orders th { padding: 8px 6px; font-size: 12px; }
}
