/* F&Bot app — brand tokens (see F&Bot Brand design system) */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07142B; --surface: #0F2246; --surface-2: #142A52; --raise: #1E3A66; --line: #1F3560;
  --ink: #F5F8FF; --muted: #93A3BC; --accent: #F59E0B; --on-accent: #0B1E3F; --accent-text: #FBBF24;
  --brand: #F5F8FF; --on-brand: #0B1E3F; --hero: #0F2246; --hero-line: #24406E;
  --success: #4ADE80; --danger: #F87171; --focus: #FCD34D;
  --logo-fg: #F5F8FF; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  --t-blue: #1D3A6B; --t-indigo: #2A2F6E; --t-amber: #4A3510; --t-slate: #22324D; --t-red: #4A1D24; --t-green: #12402B;
}
:root, [data-theme="light"] {
  color-scheme: light;
  --bg: #F2F5FA; --surface: #FFFFFF; --surface-2: #F4F6FA; --raise: #E7ECF3; --line: #E3E8F0;
  --ink: #0B1E3F; --muted: #6B7A90; --accent: #F59E0B; --on-accent: #0B1E3F; --accent-text: #B45309;
  --brand: #0B1E3F; --on-brand: #FFFFFF; --hero: #0B1E3F; --hero-line: #1E3A66;
  --success: #15803D; --danger: #B91C1C; --focus: #B45309;
  --logo-fg: #0B1E3F; --shadow: 0 1px 2px rgba(11,30,63,.05), 0 6px 20px rgba(11,30,63,.06);
  --t-blue: #E6EEFB; --t-indigo: #ECEBFC; --t-amber: #FEF3DC; --t-slate: #EDF0F5; --t-red: #FDECEC; --t-green: #E5F6EC;
}
:root { --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --font: "Open Sans", "Segoe UI", Arial, sans-serif;
        --nav-h: 64px; --safe-b: env(safe-area-inset-bottom, 0px); }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 400 15px/1.45 var(--font); color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
.num, input.amt, .kpi .v { font-variant-numeric: tabular-nums; }
.hide { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- logo ---------- */
.logo svg { display: block; height: 100%; width: auto; }
.logo .ff { fill: var(--logo-fg); } .logo .fa { fill: var(--accent); }

/* ---------- boot / login ---------- */
.center { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.boot .logo { height: 56px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.login { width: 100%; max-width: 400px; }
.login .logo { height: 64px; margin: 0 auto 6px; display: flex; justify-content: center; }
.login .tag { text-align: center; color: var(--muted); font-size: 13px; letter-spacing: .4px; margin-bottom: 28px; }
.card { background: var(--surface); border: 0; border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow); }
.login h2 { margin: 0 0 4px; font-size: 18px; font-weight: 800; }
.login .store { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.people { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 8px 14px;
        font-weight: 600; cursor: pointer; min-height: 40px; }
.chip.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.pin-dots { display: flex; justify-content: center; gap: 12px; margin: 6px 0 16px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--muted); }
.pin-dots i.f { background: var(--accent); border-color: var(--accent); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.keypad button { height: 58px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2);
                 font-size: 22px; font-weight: 700; cursor: pointer; }
.keypad button:active { background: var(--raise); }
.keypad .go { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-size: 16px; }
.err { color: var(--danger); font-weight: 600; font-size: 14px; min-height: 20px; text-align: center; margin-bottom: 8px; }

/* ---------- shell ---------- */
.shell { min-height: 100%; padding-bottom: calc(var(--nav-h) + var(--safe-b) + 110px); }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
       padding: calc(14px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px));
       background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.top .ttl { flex: 1; min-width: 0; }
.top h1 { margin: 0; font-size: 22px; line-height: 28px; font-weight: 800; letter-spacing: -.3px; }
.top .sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iconbtn { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px; border: 0; background: var(--surface); box-shadow: var(--shadow);
           display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.iconbtn svg, .menu svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.avatar { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; border: 0; background: var(--brand); color: var(--on-brand);
          display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; letter-spacing: .5px; cursor: pointer; }
.avatar.big { width: 52px; height: 52px; flex-basis: 52px; font-size: 18px; }
.me { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.me h3 { margin: 0 !important; }
.menu { display: flex; flex-direction: column; gap: 8px; }
.menu button { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 0 14px; border-radius: var(--r-md); border: 0;
               background: var(--surface-2); font-weight: 700; cursor: pointer; text-align: left; }
.menu .danger { color: var(--danger); }

.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--nav-h) + var(--safe-b));
       padding-bottom: var(--safe-b); display: flex; align-items: stretch; background: var(--surface);
       box-shadow: 0 -1px 0 var(--line), 0 -8px 24px rgba(11, 30, 63, .05); }
.nav-logo { display: none; }
.nav button { flex: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center;
              gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); cursor: pointer; position: relative; padding: 0; }
.nav button i { display: flex; }
.nav button svg { width: 23px; height: 23px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.nav button.on { color: var(--ink); font-weight: 800; }
.nav button.on svg { stroke-width: 2.3; }
.nav .soon { display: none; }
.nav button.is-soon:not(.on) { opacity: .55; }
.nav button.fab i { width: 58px; height: 58px; border-radius: 50%; background: var(--brand); color: var(--on-brand);
                    align-items: center; justify-content: center; transform: translateY(-16px);
                    box-shadow: 0 0 0 5px var(--bg), 0 10px 22px rgba(11, 30, 63, .28); transition: transform .15s; }
.nav button.fab:active i { transform: translateY(-16px) scale(.94); }
.nav button.fab svg { width: 26px; height: 26px; stroke-width: 2.4; }
.nav button.fab span { position: absolute; bottom: 8px; }
.nav button.fab.on i { background: var(--accent); color: var(--on-accent); }

main { max-width: 760px; margin: 0 auto; padding-block: 4px 16px;
       padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.page-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.label { font-size: 11px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; color: var(--muted); }

/* ---------- today ---------- */
.hero { background: var(--hero); color: #F5F8FF; border-radius: var(--r-lg); padding: 18px 20px 16px; box-shadow: 0 12px 28px rgba(11, 30, 63, .22);
        border: 1px solid var(--hero-line); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; left: 20px; top: 0; width: 36px; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.hero .hl { font-size: 13px; color: #A7B4C8; font-weight: 600; }
.hero .hv { font-size: 38px; line-height: 1.15; font-weight: 800; letter-spacing: -1px; margin: 6px 0 10px; font-variant-numeric: tabular-nums; }
.hero .hv small { font-size: 16px; font-weight: 600; letter-spacing: 0; color: #A7B4C8; }
.hero .delta { font-size: 14px; font-weight: 800; letter-spacing: 0; vertical-align: middle; }
.hero .delta.up { color: #4ADE80; } .hero .delta.down { color: #F87171; }
.hero .hs { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: #C9D3E2; font-weight: 600; }
.shimmer { width: 60%; border-radius: 8px; background: linear-gradient(90deg, rgba(255,255,255,.06), rgba(255,255,255,.14), rgba(255,255,255,.06));
           background-size: 200% 100%; animation: shim 1.2s linear infinite; }
@keyframes shim { to { background-position: -200% 0; } }
.sect { margin: 22px 4px 10px; }
.tasks { display: flex; flex-direction: column; gap: 10px; }
.task { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px; border: 0; border-radius: var(--r-lg); background: var(--surface);
        box-shadow: var(--shadow); text-align: left; cursor: pointer; transition: transform .12s; }
.task:active { transform: scale(.985); }
.task:disabled { cursor: default; transform: none; }
.task.is-soon .tile, .task.is-soon .tx { opacity: .55; }
.tile { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; }
.tile svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.t-blue { background: var(--t-blue); color: #2563EB; } .t-indigo { background: var(--t-indigo); color: #4F46E5; }
.t-amber { background: var(--t-amber); color: #D97706; } .t-slate { background: var(--t-slate); color: #475569; }
.t-red { background: var(--t-red); color: #DC2626; } .t-green { background: var(--t-green); color: #16A34A; }
[data-theme="dark"] .tile { color: #E2E8F0; }
.tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tx b { font-size: 15.5px; font-weight: 700; }
.tx small { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task .go svg { width: 18px; height: 18px; stroke: var(--muted); fill: none; stroke-width: 2; stroke-linecap: round; }
.badge { font-size: 11px; font-weight: 800; padding: 5px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--t-green); color: var(--success); }

@media (min-width: 900px) {
  .shell { padding-left: 248px; padding-bottom: 120px; }
  .top { padding: 22px max(32px, calc((100% - 760px) / 2 + 32px)) 14px; }
  .top h1 { font-size: 26px; line-height: 32px; }
  .nav { top: 0; bottom: 0; right: auto; width: 248px; height: auto; flex-direction: column; align-items: stretch; justify-content: flex-start;
         padding: 22px 14px 14px; gap: 4px; box-shadow: 1px 0 0 var(--line); }
  .nav-logo { display: flex; height: 34px; margin: 0 8px 26px; }
  .nav button { flex: 0 0 48px; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 0 14px; border-radius: var(--r-md); font-size: 14px; }
  .nav button.on { background: var(--surface-2); }
  .nav .soon { display: inline-block; margin-left: auto; font-style: normal; font-size: 10px; font-weight: 700; color: var(--muted);
               background: var(--surface-2); padding: 2px 7px; border-radius: 999px; }
  .nav button.is-soon:not(.on) { opacity: .8; }
  .nav button.fab { order: -1; background: var(--brand); color: var(--on-brand); margin-bottom: 14px; justify-content: center; }
  .nav button.fab i { width: auto; height: auto; background: none; transform: none; box-shadow: none; color: inherit; }
  .nav button.fab:active i { transform: none; }
  .nav button.fab svg { width: 20px; height: 20px; }
  .nav button.fab span { position: static; }
  .nav button.fab.on { background: var(--accent); color: var(--on-accent); }
  .nav-logo { order: -2; }
  main { padding: 8px 32px 32px; }
}

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); }
.in, select.in { width: 100%; height: 44px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line);
                 background: var(--surface-2); outline: none; min-width: 0; }
.in:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.in.amt { text-align: right; font-weight: 700; font-size: 16px; }
.in.bad { border-color: var(--danger); }
.in[readonly] { background: transparent; border-style: dashed; color: var(--muted); }
select.in { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
            background-position: calc(100% - 18px) 19px, calc(100% - 13px) 19px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
textarea.in { height: 70px; padding: 10px 12px; resize: vertical; }
.grid { display: grid; gap: 10px; align-items: end; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.seg { display: flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 3px; gap: 3px; }
.seg button { flex: 1; min-height: 38px; border: 0; border-radius: 7px; background: none; font-weight: 700; font-size: 13px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--accent); color: var(--on-accent); }

.btn { min-height: 44px; padding: 0 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface);
       font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn.add { width: 100%; border-style: dashed; color: var(--accent-text); background: transparent; }
.btn:disabled { opacity: .55; cursor: default; }
.btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; }

/* ---------- sections ---------- */
.sec { background: var(--surface); border: 0; box-shadow: var(--shadow); border-radius: var(--r-lg); margin-bottom: 14px; overflow: hidden; }
.sec > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; }
.sec > summary::-webkit-details-marker { display: none; }
.sec > summary .n { width: 26px; height: 26px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line);
                     display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; color: var(--accent-text); }
.sec > summary h2 { margin: 0; font-size: 15px; font-weight: 800; flex: 1; }
.sec > summary .val { font-weight: 800; font-size: 15px; }
.sec > summary .chev { width: 18px; height: 18px; stroke: var(--muted); fill: none; stroke-width: 2; transition: transform .2s; }
.sec[open] > summary .chev { transform: rotate(180deg); }
.sec .body { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 12px; }

.item { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; position: relative; }
.item-h { display: flex; align-items: center; gap: 8px; }
.item-h .sel { flex: 1; }
.x { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 8px; border: 1px solid var(--line); background: transparent; cursor: pointer;
     display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.x svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2.2; fill: none; stroke-linecap: round; }
.result { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 13px; color: var(--muted); }
.result b { color: var(--ink); font-size: 16px; }
.result b.acc { color: var(--accent-text); }
.staff-row { display: grid; grid-template-columns: minmax(0, 1fr) 84px 36px; gap: 8px; align-items: end; }
.staff-tips { grid-column: 1 / -1; display: flex; gap: 14px; font-size: 12px; color: var(--muted); padding-left: 2px; }
.staff-tips b { color: var(--ink); }

.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
@media (min-width: 640px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { background: var(--surface); border: 1px solid transparent; box-shadow: var(--shadow); border-radius: var(--r-md); padding: 12px; min-width: 0; }
.kpi .v { font-size: 20px; font-weight: 800; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .s { font-size: 12px; color: var(--muted); }
.kpi.acc { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.kpi.acc .v { color: var(--accent-text); }
.up { color: var(--success); } .down { color: var(--danger); }

.ctx { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.ctx .field { flex: 1 1 150px; }

/* ---------- sticky summary ---------- */
.dock { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b) + 1px); z-index: 25; padding-block: 10px;
        padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
        background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(0, 0, 0, .18); }
.dock-in { max-width: 948px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.dock .m { flex: 1; min-width: 0; }
.dock .m .label { font-size: 10px; }
.dock .big { font-size: 22px; font-weight: 800; color: var(--accent-text); line-height: 1.1; }
.dock .sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock .btn { min-height: 50px; padding: 0 18px; }
@media (min-width: 900px) { .dock { left: 248px; bottom: 0; } }

/* ---------- modal & toast ---------- */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(4, 12, 28, .62); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 520px; max-height: 88vh; overflow: auto; background: var(--surface); border: 1px solid var(--line);
         border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 18px 16px calc(18px + var(--safe-b)); animation: up .18s ease-out; }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
@media (min-width: 640px) { .modal { align-items: center; } .sheet { border-radius: var(--r-lg); } }
.sheet h3 { margin: 0 0 12px; font-size: 18px; font-weight: 800; }
.sheet .rows { display: flex; flex-direction: column; margin: 8px 0 16px; }
.sheet .rows div { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.sheet .rows div b { font-variant-numeric: tabular-nums; }
.sheet .rows .hl b { color: var(--accent-text); font-size: 18px; }
.sheet .acts { display: flex; gap: 10px; }
.sheet .acts .btn { flex: 1; }
.ok-ico { width: 56px; height: 56px; border-radius: 50%; background: color-mix(in srgb, var(--success) 18%, transparent); color: var(--success);
          display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.ok-ico svg { width: 30px; height: 30px; stroke: currentColor; stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.toast { position: fixed; left: 50%; top: 16px; transform: translateX(-50%); z-index: 80; max-width: calc(100% - 32px);
         background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: var(--r-md); font-weight: 600; box-shadow: var(--shadow); }
.toast.bad { background: var(--danger); color: #fff; }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty .btn { margin-top: 14px; }
.empty .logo { height: 48px; display: flex; justify-content: center; margin-bottom: 12px; opacity: .5; }
.empty h2 { color: var(--ink); margin: 0 0 6px; font-size: 18px; }
.hint { font-size: 12px; color: var(--muted); }

.hide-sm { display: none; }
@media (min-width: 640px) { .hide-sm { display: inline; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
