/* MANDA OS GO: a small business on one phone. Light and high-contrast so it reads on a ute dashboard in the sun; the sign-in screen is
   the same dark-gold one every MANDA OS app shares. One column on a phone, a side menu and wider columns on a computer. */
:root {
  --bg: #F6F2EA; --card: #FFFFFF; --ink: #1A1408; --ink2: #3B3320; --mute: #6B6048; --line: #E3DAC6; --line2: #D2C6A8;
  --gold: #CFA53C; --gold-dk: #8A6B14; --gold-lt: #F3E3AD; --gold-bg: #FBF4DC;
  --good: #2A7A50; --good-bg: #E3F3EA; --bad: #B03A2A; --bad-bg: #FBE7E3; --warn: #8A5A00; --warn-bg: #FFF0CF;
  --r: 16px; --tap: 48px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--ink); font: 16px/1.45 'DM Sans', system-ui, sans-serif; overflow-x: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; text-align: left; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
p, h1, h2, h3, div, span, a, button, li { overflow-wrap: anywhere; }
svg.ic { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.ic.sm { width: 18px; height: 18px; }

/* ── frame: phone first ── */
.app { min-height: 100vh; min-height: 100dvh; display: block; }
.side { display: none; }
.col { min-width: 0; }
.top { position: sticky; top: 0; z-index: 20; background: rgba(246, 242, 234, .95); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.top-in { display: flex; align-items: center; gap: 10px; max-width: 760px; margin: 0 auto; padding: 10px 16px; min-height: 62px; }
.top h1 { flex: 1; min-width: 0; font-family: 'Playfair Display', serif; font-weight: 600; font-size: 26px; line-height: 1.15; }
.top .biz { display: block; font: 600 12px/1.2 'DM Sans', sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-dk); }
.main { max-width: 760px; margin: 0 auto; padding: 14px 16px calc(100px + env(safe-area-inset-bottom)); }
.bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.bottom-in { display: flex; max-width: 760px; margin: 0 auto; }
.bt { flex: 1; min-height: 62px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px; font-weight: 600; color: var(--mute); position: relative; text-align: center; }
.bt.on { color: var(--gold-dk); }
.bt.on::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold); }
.bt .n { position: absolute; top: 6px; left: calc(50% + 9px); min-width: 19px; padding: 0 5px; border-radius: 10px; background: var(--bad); color: #fff; font-size: 11.5px; font-weight: 700; text-align: center; }

@media (min-width: 900px) {
  /* the web version: a side menu, wider columns, no bottom bar */
  .app { display: grid; grid-template-columns: 240px minmax(0, 1fr); }
  .side { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; padding: 22px 14px; background: #fff; border-right: 1px solid var(--line); }
  .side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
  .side .brand img { width: 38px; height: 38px; border-radius: 10px; }
  .side .brand b { display: block; font-family: 'Playfair Display', serif; font-size: 18px; line-height: 1.1; }
  .side .brand span { font-size: 12px; color: var(--mute); }
  .side .bt { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 46px; padding: 0 12px; border-radius: 12px; font-size: 15px; }
  .side .bt.on { background: var(--gold-bg); }
  .side .bt.on::before { display: none; }
  .side .bt .n { position: static; margin-left: auto; }
  .bottom { display: none; }
  .top-in, .main { max-width: 1000px; padding-left: 28px; padding-right: 28px; }
  .main { padding-bottom: 60px; }
  .cols2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 22px; align-items: start; }
}

/* ── text ── */
.hello { font-size: 18px; color: var(--ink2); margin: 2px 0 12px; }
.hello b { font-family: 'Playfair Display', serif; font-weight: 600; font-size: 24px; display: block; color: var(--ink); }
.label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--gold-dk); margin: 22px 0 10px; }
.label:first-child { margin-top: 4px; }
.label .count { background: var(--gold-lt); color: var(--ink); border-radius: 10px; padding: 0 8px; font-size: 12px; letter-spacing: 0; }
.note { font-size: 14px; color: var(--mute); }
.muted { color: var(--mute); }
.empty { padding: 26px 18px; text-align: center; border: 1.5px dashed var(--line2); border-radius: var(--r); color: var(--mute); }
.empty b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.right { margin-left: auto; text-align: right; }

/* ── buttons and chips ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 18px; border-radius: 14px; border: 1.5px solid var(--line2); background: #fff; font-weight: 600; font-size: 16px; text-align: center; text-decoration: none; }
.btn:active { background: var(--gold-bg); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.btn.gold:active { background: var(--gold-lt); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.danger { border-color: #E0B1A9; color: var(--bad); }
.btn.good { background: var(--good); border-color: var(--good); color: #fff; }
.btn.sm { min-height: 40px; padding: 0 11px; gap: 6px; font-size: 14px; border-radius: 12px; }
.btn.block { display: flex; width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { flex: none; width: var(--tap); height: var(--tap); border-radius: 14px; border: 1.5px solid var(--line2); background: #fff; display: grid; place-items: center; }
.icon-btn:active { background: var(--gold-bg); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 22px; border: 1.5px solid var(--line2); background: #fff; font-weight: 600; font-size: 14.5px; white-space: nowrap; }
.chip b { font-variant-numeric: tabular-nums; }
.chip.alert { border-color: #E5B8AF; background: var(--bad-bg); color: var(--bad); }
.chip.hot { border-color: var(--gold); background: var(--gold-bg); }
.seg { display: flex; padding: 4px; gap: 4px; border-radius: 14px; background: #ECE5D3; margin: 0 0 12px; }
.seg button { flex: 1; min-height: 42px; border-radius: 11px; text-align: center; font-weight: 600; font-size: 14.5px; color: var(--ink2); }
.seg button.on { background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); color: var(--ink); }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 10px; font-size: 12.5px; font-weight: 700; background: #ECE5D3; color: var(--ink2); white-space: nowrap; }
.pill.big { background: var(--gold); color: var(--ink); }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }

/* ── cards ── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 15px; }
.card.tap { width: 100%; display: block; cursor: pointer; }
.card.tap:active { background: var(--gold-bg); }
.card.big { border: 2px solid var(--gold); background: linear-gradient(180deg, #FFFDF5, #fff); }
.card.next { border-color: var(--ink); box-shadow: 0 2px 0 var(--ink); }
.card h3 { font-size: 17px; line-height: 1.25; font-weight: 700; }
.card .meta { font-size: 14px; color: var(--mute); margin-top: 2px; }
.card .money { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.card .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.kicker { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-dk); margin-bottom: 4px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.tile { border-radius: var(--r); padding: 12px 14px; background: #fff; border: 1px solid var(--line); }
.tile b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.tile span { font-size: 13px; color: var(--mute); }
.tile.bad b { color: var(--bad); }
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--warn-bg); border: 1px solid #EBCF8C; margin-bottom: 12px; font-size: 15px; }
.banner.info { background: var(--gold-bg); border-color: #E8D590; }
.locbar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: #fff; border: 1px dashed var(--line2); margin-bottom: 12px; font-size: 14px; color: var(--ink2); }

/* ── forms ── */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span, .field > label { font-size: 13.5px; font-weight: 700; color: var(--ink2); }
.field small { font-size: 12.5px; color: var(--mute); }
input[type=text], input[type=tel], input[type=email], input[type=date], input[type=time], input[type=number], input[type=search], input[type=password], select, textarea {
  width: 100%; min-height: var(--tap); padding: 10px 13px; border-radius: 12px; border: 1.5px solid var(--line2); background: #fff; font-size: 16px; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--gold-lt); border-color: var(--gold); }
.check { display: flex; align-items: center; gap: 12px; min-height: var(--tap); font-size: 16px; }
.check input { width: 24px; height: 24px; accent-color: var(--gold-dk); flex: none; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.two > *, .three > * { min-width: 0; }
input[type=date], input[type=time] { min-width: 0; appearance: none; -webkit-appearance: none; }
.three { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr) minmax(0, 1fr); gap: 10px; }
.formerr { padding: 10px 12px; border-radius: 12px; background: var(--bad-bg); color: var(--bad); font-weight: 600; font-size: 15px; }
.lines { display: flex; flex-direction: column; gap: 10px; }
.line { padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #FDFBF6; display: flex; flex-direction: column; gap: 8px; }
.totals { margin-left: auto; width: min(100%, 300px); font-size: 15.5px; }
.totals div { display: flex; justify-content: space-between; padding: 3px 0; font-variant-numeric: tabular-nums; }
.totals .grand { border-top: 2px solid var(--ink); margin-top: 4px; padding-top: 7px; font-size: 19px; font-weight: 700; }
.pick { position: relative; }
.pick .list { position: absolute; left: 0; right: 0; top: 100%; z-index: 5; margin-top: 4px; background: #fff; border: 1.5px solid var(--line2); border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .14); max-height: 260px; overflow-y: auto; }
.pick .list button { display: block; width: 100%; min-height: 46px; padding: 8px 13px; border-bottom: 1px solid var(--line); }
.pick .list button:last-child { border-bottom: 0; }
.pick .list button:active, .pick .list button:focus-visible { background: var(--gold-bg); }
.gaps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; font-size: 15px; }
.kv dt { color: var(--mute); }
.kv dd { font-weight: 500; }

/* ── sheets: a panel that slides up on a phone and is a centred card on a computer ── */
.layer { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; background: rgba(26, 20, 8, .5); }
.sheet { width: 100%; max-width: 640px; max-height: 94vh; max-height: 94dvh; display: flex; flex-direction: column; background: var(--bg); border-radius: 22px 22px 0 0; box-shadow: 0 -8px 40px rgba(0, 0, 0, .25); }
.sheet-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.sheet-h h2 { flex: 1; min-width: 0; font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 600; line-height: 1.2; }
.sheet-b { padding: 14px 16px calc(24px + env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; }
.sheet-f { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff; border-radius: 0; }
.sheet-f .btn { flex: 1 1 96px; min-width: 0; padding: 0 10px; gap: 6px; white-space: nowrap; font-size: 15px; }
@media (min-width: 900px) { .layer { align-items: center; } .sheet { border-radius: 22px; max-height: 88vh; } }
.pdf { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; background: #fff; }
.pdf-h { display: flex; align-items: center; gap: 8px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; border-bottom: 1px solid var(--line); background: var(--bg); }
.pdf-h b { flex: 1; min-width: 0; font-size: 16px; }
.pdf iframe { flex: 1; width: 100%; border: 0; background: #ddd; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); top: calc(10px + env(safe-area-inset-top)); z-index: 90; max-width: min(92vw, 520px); padding: 12px 18px; border-radius: 14px; background: var(--ink); color: #fff; font-weight: 600; font-size: 15px; text-align: center; box-shadow: 0 6px 24px rgba(0, 0, 0, .3); }
.toast.bad { background: var(--bad); }


/* ── the sign-in extras: the business code and the invite link, inside the shared sign-in card ── */
.go-code { display: flex; flex-direction: column; gap: 10px; text-align: left; margin: 0 0 12px; }
.go-code label { font-size: 13px; font-weight: 700; color: #6B6048; }
.go-code input { min-height: 52px; font-size: 20px; text-align: center; letter-spacing: .06em; text-transform: lowercase; }
.go-hint { min-height: 20px; margin: -8px 0 10px; font-size: 14px; color: #6B6048; text-align: center; }
.go-link { display: block; margin: 12px auto 0; padding: 10px; font-size: 14px; font-weight: 600; color: #8A6B14; text-decoration: underline; text-align: center; background: none; }
.mgate-card .btn { width: 100%; }

/* a file picker that looks like a button: the real input sits invisibly over it, so a tap or a keyboard press opens the picker */
.filebtn { position: relative; overflow: hidden; }
.filebtn input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0; }
.filebtn:focus-within { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ── the team today: a dot says who is on, free, on a day off (can be called in) or on leave ── */
.who { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; margin-bottom: 4px; }
.who::-webkit-scrollbar { display: none; }
.who button { flex: none; min-width: 112px; padding: 9px 12px; border-radius: 14px; border: 1.5px solid var(--line2); background: #fff; }
.who b { display: flex; align-items: center; gap: 7px; font-size: 15px; }
.who b::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--mute); flex: none; }
.who span { display: block; font-size: 12.5px; color: var(--mute); margin-top: 1px; }
.who .st-on b::before { background: var(--good); }
.who .st-free b::before { background: var(--gold); }
.who .st-callin b::before { background: #fff; border: 2px solid var(--gold-dk); }
.who .st-leave b::before { background: var(--bad); }
.days { display: flex; gap: 6px; }
.days button { flex: 1; min-height: 42px; border-radius: 10px; border: 1.5px solid var(--line2); background: #fff; text-align: center; font-weight: 700; font-size: 14px; }
.days button[aria-pressed=true] { background: var(--gold); border-color: var(--gold); }

/* ── the Set up wizard ── */
.wiz-head { margin: 2px 0 14px; }
.wiz-h { font-family: 'Playfair Display', serif; font-size: 26px; font-weight: 600; line-height: 1.2; margin-bottom: 6px; }
.progress { height: 8px; border-radius: 4px; background: #ECE5D3; overflow: hidden; margin-top: 6px; }
.progress i { display: block; height: 100%; background: var(--gold); border-radius: 4px; transition: width .25s; }
.tick { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; }
.tick.ok { background: var(--good-bg); color: var(--good); }
.tick.no { background: #ECE5D3; color: var(--mute); }
@media (prefers-reduced-motion: reduce) { .progress i { transition: none; } }
.wiz-h + .note { margin-bottom: 14px; }
.wiz-h + .note + .stack { margin-top: 2px; }
