/* Look Fresh staff console. Same look as the app: Fraunces + Inter, warm paper, brand yellow. Self-hosted fonts only. */
@font-face { font-family: Fraunces; src: url(/admin/fonts/fraunces.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: Inter; src: url(/admin/fonts/inter.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #FAF8F5; --surface: #FFFFFF; --surface-2: #F3EFE8; --ink: #1C1A17; --muted: #6E675E; --faint: #9C948A;
  --line: #E9E3D9; --line-strong: #D9D0C2;
  --brand: #F5A623; --brand-deep: #E09000; --brand-soft: #FDF0DC; --on-brand: #1C1A17;
  --ok: #1F7A4D; --ok-soft: #E3F3EA; --info: #2257A8; --info-soft: #E5EDFA; --warn: #A15C00; --warn-soft: #FDF0DC;
  --bad: #B3261E; --bad-soft: #FBE7E5; --violet: #6B3FA0; --violet-soft: #F0E9F8;
  --shadow: 0 1px 2px rgba(28,26,23,.06), 0 4px 16px rgba(28,26,23,.05);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15130F; --surface: #1E1B17; --surface-2: #26221D; --ink: #F3EEE6; --muted: #B0A797; --faint: #857C70;
    --line: #322D26; --line-strong: #413A31; --brand-soft: #3A2E17;
    --ok: #6CCB98; --ok-soft: #173326; --info: #8DB4F2; --info-soft: #17243A; --warn: #F2B85C; --warn-soft: #3A2E17;
    --bad: #F2867E; --bad-soft: #3A1B19; --violet: #C4A6EA; --violet-soft: #2A2136;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 Inter, system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: Fraunces, Georgia, serif; font-weight: 500; letter-spacing: -.01em; margin: 0; }
.muted { color: var(--muted); }
.fine { color: var(--faint); font-size: .8rem; margin: 10px 0 0; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: .85em; }
[hidden] { display: none !important; }

/* Brand */
.brand { display: flex; align-items: center; gap: 10px; }
.mark { width: 34px; height: 34px; border-radius: 9px; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; font-weight: 800; font-size: .8rem; letter-spacing: .02em; }
.wordmark { font-family: Fraunces, Georgia, serif; font-size: 1.2rem; font-weight: 600; white-space: nowrap; }
.tag { margin-left: auto; font-size: .62rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 99px; padding: 2px 8px; }

/* Buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; padding: 9px 16px; font: 600 .9rem/1.2 Inter, system-ui, sans-serif; cursor: pointer; text-decoration: none; background: var(--brand); color: var(--on-brand); transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { background: var(--brand-deep); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn.secondary:hover { background: var(--surface-2); }
.btn.ghost { background: transparent; color: var(--ink); border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.btn.danger:hover { background: color-mix(in srgb, var(--bad-soft) 70%, var(--bad) 15%); }
.btn.small { padding: 6px 11px; font-size: .82rem; border-radius: 8px; }
.btn[aria-busy="true"] { opacity: .6; pointer-events: none; }
.btn.google { width: 100%; background: var(--surface); color: var(--ink); border-color: var(--line-strong); padding: 12px 16px; font-size: .95rem; }
.btn.google:hover { background: var(--surface-2); }
.g { width: 18px; height: 18px; background: conic-gradient(from -45deg, #EA4335 0 25%, #4285F4 0 50%, #34A853 0 75%, #FBBC05 0); border-radius: 50%; -webkit-mask: radial-gradient(circle, transparent 38%, #000 39%); mask: radial-gradient(circle, transparent 38%, #000 39%); }
.field { display: grid; gap: 6px; margin: 12px 0; }
.field > span { font-size: .78rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; padding: 9px 12px; width: 100%; }
textarea { resize: vertical; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row > .field { flex: 1 1 200px; }
.msg { min-height: 1.4em; color: var(--bad); font-size: .88rem; margin: 12px 0 0; }

/* Sign-in */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 500px at 50% -10%, var(--brand-soft), transparent 70%), var(--bg); }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 32px; box-shadow: var(--shadow); }
.login-card h1 { font-size: 1.9rem; margin: 26px 0 6px; }
.login-card .muted { margin: 0 0 22px; }

/* Shell */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px; padding: 22px 16px; border-right: 1px solid var(--line); background: var(--surface); }
.side nav { display: grid; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: .92rem; }
.nav-item svg { width: 18px; height: 18px; flex: none; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item[aria-current="page"] { background: var(--brand-soft); color: var(--ink); font-weight: 600; }
.nav-item[aria-current="page"] svg { color: var(--brand-deep); }
.nav-count { margin-left: auto; background: var(--brand); color: var(--on-brand); font-size: .72rem; font-weight: 700; border-radius: 99px; padding: 1px 7px; }
.me { margin-top: auto; display: grid; grid-template-columns: 36px 1fr; gap: 4px 10px; align-items: center; padding: 12px; border-radius: 12px; background: var(--surface-2); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; font-weight: 700; }
.me-text { display: grid; min-width: 0; font-size: .85rem; }
.me-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .btn { grid-column: 1 / -1; justify-content: center; }
.main { min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding: 28px 36px 18px; border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.topbar h1 { font-size: 1.9rem; }
.eyebrow { margin: 0 0 4px; font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; color: var(--brand-deep); font-weight: 700; }
.top-actions { display: flex; gap: 10px; align-items: center; }
.env { font-size: .75rem; color: var(--warn); background: var(--warn-soft); border-radius: 99px; padding: 4px 10px; font-weight: 600; }
.page { padding: 26px 36px 60px; display: grid; gap: 22px; max-width: 1280px; }

/* Cards, KPIs */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 20px 0; }
.card-h h2 { font-size: 1.15rem; }
.card-b { padding: 16px 20px 20px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.kpi { padding: 18px 20px; text-decoration: none; color: inherit; display: grid; gap: 4px; }
a.kpi:hover { border-color: var(--line-strong); }
.kpi .label { font-size: .8rem; color: var(--muted); font-weight: 600; }
.kpi .value { font-family: Fraunces, Georgia, serif; font-size: 2.2rem; line-height: 1.1; font-weight: 500; }
.kpi .sub { font-size: .8rem; color: var(--faint); }
.kpi.hero { background: linear-gradient(135deg, var(--brand-soft), var(--surface) 70%); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; }

/* Charts (pure CSS) */
.bars { display: flex; align-items: flex-end; gap: 14px; height: 180px; padding-top: 10px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; min-width: 0; }
.bar .colwrap { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.bar .col { width: 100%; max-width: 46px; border-radius: 8px 8px 3px 3px; background: var(--brand); min-height: 3px; }
.bar.zero .col { background: var(--line); }
.bar .n { font-size: .8rem; font-weight: 700; }
.bar .m { font-size: .74rem; color: var(--muted); }
.funnel { display: grid; gap: 12px; }
.step { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; font-size: .88rem; }
.step .track { grid-column: 1 / -1; }
.track { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.fill { height: 100%; background: var(--brand); border-radius: 99px; }
.step .num { text-align: right; font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.stat { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.stat b { display: block; font-family: Fraunces, Georgia, serif; font-size: 1.5rem; font-weight: 500; }
.stat span { font-size: .78rem; color: var(--muted); }

/* Tables */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
td.actions { text-align: right; white-space: nowrap; }
td.actions .btn + .btn { margin-left: 6px; }
td .primary { font-weight: 600; }
td .secondary-line { display: block; font-size: .8rem; color: var(--muted); }
.num-cell { text-align: right; font-variant-numeric: tabular-nums; }

/* Pills, tabs, chips */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.violet { background: var(--violet-soft); color: var(--violet); }
.tabs { display: inline-flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 12px; flex-wrap: wrap; }
.tab { border: 0; background: transparent; font: 600 .84rem Inter, system-ui, sans-serif; color: var(--muted); padding: 7px 14px; border-radius: 9px; cursor: pointer; }
.tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.search { max-width: 280px; }

/* Empty, loading */
.empty { text-align: center; padding: 38px 20px; color: var(--muted); }
.empty b { display: block; font-family: Fraunces, Georgia, serif; font-size: 1.15rem; font-weight: 500; color: var(--ink); margin-bottom: 4px; }
.skeleton { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; margin: 10px 0; }
@keyframes shimmer { to { background-position: -200% 0; } }
.note { font-size: .82rem; color: var(--muted); background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }

/* Dialog, toasts */
.dlg { border: 0; border-radius: 18px; padding: 0; width: min(440px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.dlg::backdrop { background: rgba(20,18,15,.45); backdrop-filter: blur(2px); }
.dlg form { padding: 24px; }
.dlg h2 { font-size: 1.3rem; margin-bottom: 6px; }
.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 50; }
.toast { background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 12px; font-size: .88rem; box-shadow: var(--shadow); animation: rise .2s ease-out; max-width: 360px; }
.toast.bad { background: var(--bad); color: #fff; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton, .toast { animation: none; } }

/* Small screens: menu becomes a top bar of tabs */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side nav { order: 3; width: 100%; display: flex; overflow-x: auto; gap: 4px; }
  .nav-item { white-space: nowrap; }
  .me { margin: 0 0 0 auto; grid-template-columns: auto auto; background: none; padding: 0; }
  .me .avatar, .me-text { display: none; }
  .topbar, .page { padding-left: 16px; padding-right: 16px; }
  .grid-2 { grid-template-columns: 1fr; }
  .env { display: none; }
}

/* Clickable rows */
tr.clickable { cursor: pointer; }
tr.clickable:focus-visible td { outline: none; background: var(--brand-soft); }

/* Job drawer */
.drawer { position: fixed; inset: 0; z-index: 40; background: rgba(20,18,15,.45); display: flex; justify-content: flex-end; animation: fade .15s ease-out; }
.drawer-panel { width: min(620px, 100vw); height: 100%; overflow-y: auto; background: var(--bg); border-left: 1px solid var(--line); box-shadow: -20px 0 60px rgba(0,0,0,.2); animation: slide .2s ease-out; }
.drawer-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 22px 24px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 1.6rem; margin: 2px 0 8px; }
.mono-ref { font-family: ui-monospace, 'SF Mono', Menlo, monospace !important; letter-spacing: .02em; }
.drawer-body { padding: 18px 24px 40px; display: grid; gap: 16px; }
.drawer-body h3 { font-size: 1.05rem; margin: 10px 0 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.facts > div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; min-width: 0; }
.facts span { font-size: .74rem; color: var(--muted); font-weight: 600; }
.facts b { font-size: .92rem; overflow: hidden; text-overflow: ellipsis; }
.stats.tight .stat b { font-size: 1.2rem; }
.timeline { list-style: none; margin: 0; padding: 0; }
.tl-item { position: relative; display: grid; grid-template-columns: 22px 1fr; gap: 12px; padding-bottom: 18px; }
.tl-item:not(:last-child)::before { content: ''; position: absolute; left: 10px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
.tl-item.done:not(:last-child)::before { background: var(--brand); }
.tl-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); margin-top: 1px; }
.tl-item.done .tl-dot { border-color: var(--brand); background: var(--brand); box-shadow: inset 0 0 0 4px var(--bg); }
.tl-item.bad .tl-dot { border-color: var(--bad); background: var(--bad); }
.tl-body { display: grid; gap: 2px; }
.tl-row { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; }
.tl-item.todo b { color: var(--faint); font-weight: 500; }
.tl-gap { font-size: .78rem; font-weight: 700; color: var(--brand-deep); background: var(--brand-soft); border-radius: 99px; padding: 2px 8px; white-space: nowrap; }
.tl-sub { font-size: .82rem; color: var(--muted); }
.tl-sub.faint { color: var(--faint); }
.tl-note { font-size: .84rem; font-style: italic; color: var(--ink); }
.photos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.photos img { width: 92px; height: 92px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); display: block; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(30px); opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .drawer, .drawer-panel { animation: none; } }
