/* ============================================================
   Daily Salad Co. — Store Manager
   Mobile-first app shell. Brand green on white, no dependencies.
   ============================================================ */

:root {
    /* Brand — sampled from the Daily Salad Co. logo */
    --green-900: #12291C;
    --green-800: #1A3A25;
    --green-700: #204129;
    --green-600: #2A6B41;
    --green-500: #16A34A;
    --green-400: #22C55E;
    --green-300: #6EE7A0;
    --green-100: #DCFCE7;
    --green-50:  #F1FBF4;
    --cream:     #F2EAD8;
    --cream-50:  #FCF9F2;

    --ink:       #0F172A;
    --ink-2:     #334155;
    --muted:     #64748B;
    --line:      #E7EDF3;
    --line-2:    #F1F5F9;
    --white:     #FFFFFF;
    --canvas:    #F6F8F7;

    --amber:     #D97706;
    --amber-bg:  #FEF3C7;
    --red:       #DC2626;
    --red-bg:    #FEE2E2;
    --blue:      #2563EB;
    --blue-bg:   #DBEAFE;

    --r-sm: 10px;
    --r:    14px;
    --r-lg: 18px;
    --r-xl: 24px;

    --sh-1: 0 1px 2px rgba(15, 23, 42, .05);
    --sh-2: 0 2px 10px rgba(15, 23, 42, .06);
    --sh-3: 0 8px 24px rgba(15, 23, 42, .10);
    --sh-green: 0 8px 20px rgba(32, 65, 41, .28);

    --font-head: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-body: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --nav-h: 66px;
    --bar-h: 58px;
    --ease: cubic-bezier(.32, .72, 0, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--canvas);
    overscroll-behavior-y: contain;
}

h1, h2, h3, h4, .num { font-family: var(--font-head); font-weight: 600; letter-spacing: -.01em; margin: 0; }

a { color: var(--green-600); text-decoration: none; }

input, select, textarea, button { font-family: inherit; font-size: 16px; }

/* ---------- App frame ---------------------------------------------------- */

.app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--canvas);
    position: relative;
    box-shadow: 0 0 40px rgba(15, 23, 42, .07);
}

.appbar {
    position: sticky;
    top: 0;
    z-index: 30;
    background: linear-gradient(135deg, var(--green-700) 0%, var(--green-600) 55%, var(--green-500) 140%);
    color: #fff;
    padding: calc(env(safe-area-inset-top, 0px) + 10px) 14px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 14px rgba(18, 41, 28, .22);
}

.appbar .brandmark {
    width: 36px; height: 36px; flex: 0 0 36px;
    border-radius: 50%;
    background: #fff;
    display: grid; place-items: center;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
.appbar .brandmark img { width: 100%; height: 100%; object-fit: cover; }

.appbar h1 { font-size: 17px; font-weight: 600; line-height: 1.15; color: #fff; }
.appbar .sub { font-size: 11.5px; opacity: .82; letter-spacing: .04em; text-transform: uppercase; }
.appbar .spacer { flex: 1 1 auto; }

.appbar .iconbtn {
    width: 40px; height: 40px;
    border: 0; border-radius: 50%;
    background: rgba(255,255,255,.16);
    color: #fff;
    display: grid; place-items: center;
    cursor: pointer;
    transition: background .18s, transform .18s;
    position: relative;
}
.appbar .iconbtn:active { transform: scale(.92); background: rgba(255,255,255,.3); }
.appbar .iconbtn .dot {
    position: absolute; top: 7px; right: 8px;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--cream); border: 2px solid var(--green-600);
}

.back-link {
    display: inline-grid; place-items: center;
    width: 38px; height: 38px; margin-left: -6px;
    border-radius: 50%;
    background: rgba(255,255,255,.16); color: #fff;
    transition: transform .18s;
}
.back-link:active { transform: scale(.9); }

.page {
    padding: 14px 14px calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 26px);
    animation: pageIn .34s var(--ease) both;
}
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Bottom navigation ------------------------------------------- */

.bottomnav {
    position: fixed;
    left: 50%; transform: translateX(-50%);
    bottom: 0;
    width: 100%; max-width: 480px;
    height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255,255,255,.94);
    backdrop-filter: saturate(180%) blur(14px);
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    z-index: 40;
}

.bottomnav a {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px;
    height: var(--nav-h);
    font-size: 10.5px; font-weight: 600;
    color: var(--muted);
    letter-spacing: .01em;
    transition: color .18s;
    position: relative;
}
.bottomnav a .ic { transition: transform .24s var(--ease); }
.bottomnav a.on { color: var(--green-600); }
.bottomnav a.on .ic { transform: translateY(-2px) scale(1.06); }
.bottomnav a.on::before {
    content: ''; position: absolute; top: 6px;
    width: 26px; height: 3px; border-radius: 3px;
    background: var(--green-500);
    animation: tabIn .3s var(--ease) both;
}
@keyframes tabIn { from { width: 0; opacity: 0; } to { width: 26px; opacity: 1; } }
.bottomnav a:active { transform: scale(.94); }

.fab-slot { display: grid; place-items: center; height: var(--nav-h); }
.fab {
    width: 58px; height: 58px;
    margin-top: -26px;
    border-radius: 50%;
    background: linear-gradient(150deg, var(--green-500), var(--green-700));
    color: #fff;
    display: grid; place-items: center;
    box-shadow: var(--sh-green);
    border: 4px solid #fff;
    transition: transform .22s var(--ease), box-shadow .22s;
}
.fab:active { transform: scale(.9); }
.fab::after {
    content: ''; position: absolute;
    width: 58px; height: 58px; border-radius: 50%;
    border: 2px solid var(--green-400);
    opacity: 0;
    animation: pulseRing 2.6s ease-out infinite;
}
@keyframes pulseRing {
    0%   { transform: scale(.9); opacity: .5; }
    70%  { transform: scale(1.5); opacity: 0; }
    100% { opacity: 0; }
}

/* ---------- Cards & sections -------------------------------------------- */

.card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-1);
    padding: 14px;
    margin-bottom: 12px;
}
.card.tight { padding: 10px 12px; }
.card.flush { padding: 0; overflow: hidden; }

.section-head {
    display: flex; align-items: center; gap: 8px;
    margin: 18px 2px 10px;
}
.section-head h2 { font-size: 15px; font-weight: 600; color: var(--ink); }
.section-head .ic { color: var(--green-600); }
.section-head .spacer { flex: 1; }
.section-head .link { font-size: 12.5px; font-weight: 600; color: var(--green-600); display: inline-flex; align-items: center; gap: 2px; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tiny  { font-size: 11.5px; }
.strong { font-weight: 700; }
.right { text-align: right; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.stack > * + * { margin-top: 10px; }
.nowrap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt { margin-top: 12px; }
.mb0 { margin-bottom: 0; }

/* ---------- Hero greeting ----------------------------------------------- */

.hero {
    background: linear-gradient(140deg, var(--green-700), var(--green-600) 60%, var(--green-500));
    color: #fff;
    border-radius: var(--r-xl);
    padding: 16px 16px 18px;
    margin-bottom: 14px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--sh-green);
}
.hero::after {
    content: ''; position: absolute; right: -46px; top: -56px;
    width: 168px; height: 168px; border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.22), transparent 70%);
}
.hero .eyebrow { font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; opacity: .8; }
.hero h2 { font-size: 20px; margin: 2px 0 12px; color: #fff; }
.hero-figs { display: flex; gap: 10px; position: relative; z-index: 1; }
.hero-fig {
    flex: 1;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: var(--r);
    padding: 9px 10px;
}
.hero-fig .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; opacity: .84; }
.hero-fig .v { font-family: var(--font-head); font-size: 19px; font-weight: 600; line-height: 1.2; }

/* ---------- Stat tiles -------------------------------------------------- */

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tiles.three { grid-template-columns: repeat(3, 1fr); }

.tile {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 12px;
    box-shadow: var(--sh-1);
    animation: fadeUp .4s var(--ease) both;
    animation-delay: calc(var(--i, 0) * 55ms);
    display: block;
}
.tile .tile-ic {
    width: 34px; height: 34px; border-radius: 11px;
    display: grid; place-items: center;
    background: var(--green-50); color: var(--green-600);
    margin-bottom: 8px;
}
.tile .k { font-size: 11.5px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.tile .v { font-family: var(--font-head); font-size: 21px; font-weight: 600; line-height: 1.2; color: var(--ink); }
.tile .d { font-size: 11px; color: var(--muted); margin-top: 2px; }

.tile.t-amber .tile-ic { background: var(--amber-bg); color: var(--amber); }
.tile.t-red   .tile-ic { background: var(--red-bg);   color: var(--red); }
.tile.t-blue  .tile-ic { background: var(--blue-bg);  color: var(--blue); }
.tile.t-cream .tile-ic { background: var(--cream);    color: var(--green-700); }

@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Lists ------------------------------------------------------- */

.list { display: flex; flex-direction: column; }
.list > * { animation: fadeUp .36s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }

.item {
    display: flex; align-items: center; gap: 11px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 11px 12px;
    margin-bottom: 9px;
    box-shadow: var(--sh-1);
    transition: transform .16s var(--ease), box-shadow .16s, border-color .16s;
    color: inherit;
}
.item:active { transform: scale(.985); box-shadow: var(--sh-2); }
.item .title { font-family: var(--font-head); font-weight: 600; font-size: 14.5px; line-height: 1.25; }
.item .meta  { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.item .meta .ic { opacity: .7; }
.item .amount { font-family: var(--font-head); font-weight: 600; font-size: 15.5px; white-space: nowrap; }
.item.dim { opacity: .58; }

.avatar {
    width: 40px; height: 40px; flex: 0 0 40px;
    border-radius: 13px;
    background: linear-gradient(145deg, var(--green-100), var(--cream));
    color: var(--green-700);
    display: grid; place-items: center;
    font-family: var(--font-head); font-weight: 600; font-size: 14px;
}
.avatar.sq { border-radius: 50%; }

.rowlink {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 14px;
    border-bottom: 1px solid var(--line-2);
    color: var(--ink);
    transition: background .16s;
}
.rowlink:last-child { border-bottom: 0; }
.rowlink:active { background: var(--green-50); }
.rowlink .lead {
    width: 36px; height: 36px; flex: 0 0 36px; border-radius: 11px;
    display: grid; place-items: center;
    background: var(--green-50); color: var(--green-600);
}
.rowlink .t { font-family: var(--font-head); font-weight: 600; font-size: 14.5px; }
.rowlink .s { font-size: 12px; color: var(--muted); }
.rowlink .chev { color: #C6D2DF; margin-left: auto; }

/* ---------- Chips & badges ---------------------------------------------- */

.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px; font-weight: 700;
    letter-spacing: .01em;
    background: var(--line-2); color: var(--ink-2);
    white-space: nowrap;
}
.badge.green  { background: var(--green-100); color: #15803D; }
.badge.amber  { background: var(--amber-bg);  color: #92400E; }
.badge.red    { background: var(--red-bg);    color: #991B1B; }
.badge.blue   { background: var(--blue-bg);   color: #1E40AF; }
.badge.cream  { background: var(--cream);     color: var(--green-700); }
.badge.solid  { background: var(--green-600); color: #fff; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 13px;
    min-height: 40px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink-2);
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    transition: all .18s var(--ease);
}
.chip:active { transform: scale(.95); }
.chip.on { background: var(--green-600); border-color: var(--green-600); color: #fff; box-shadow: 0 4px 12px rgba(32,65,41,.22); }

/* ---------- Segmented control ------------------------------------------- */

.seg {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 4px;
    background: var(--line-2);
    border-radius: var(--r);
    padding: 4px;
}
.seg label {
    position: relative;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 42px;
    border-radius: 11px;
    font-size: 13.5px; font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: color .2s, background .2s, box-shadow .2s, transform .16s;
}
.seg label:active { transform: scale(.97); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:checked + span,
.seg label.on { color: var(--green-700); }
.seg label:has(input:checked) {
    background: #fff;
    color: var(--green-700);
    box-shadow: var(--sh-1);
}
.seg label:has(input:checked) .ic { color: var(--green-600); }
.seg.dark { background: rgba(255,255,255,.16); }
.seg.dark label { color: rgba(255,255,255,.8); }
.seg.dark label:has(input:checked) { background: #fff; color: var(--green-700); }

/* ---------- Tabs -------------------------------------------------------- */

.tabs {
    display: flex; gap: 4px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 4px;
    margin-bottom: 12px;
    overflow-x: auto;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
    flex: 1 0 auto;
    text-align: center;
    padding: 9px 14px;
    min-height: 40px;
    border-radius: 10px;
    font-size: 13px; font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
    transition: all .18s;
}
.tabs a.on { background: var(--green-600); color: #fff; box-shadow: 0 3px 10px rgba(32,65,41,.2); }

/* ---------- Forms ------------------------------------------------------- */

.field { margin-bottom: 13px; }
.field > label, .label {
    display: block;
    font-size: 12.5px; font-weight: 700;
    color: var(--ink-2);
    margin-bottom: 6px;
    letter-spacing: .01em;
}
.input, input[type=text], input[type=tel], input[type=number], input[type=password],
input[type=date], input[type=time], input[type=search], select, textarea {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1.5px solid var(--line);
    border-radius: var(--r);
    background: #fff;
    color: var(--ink);
    font-size: 16px;
    transition: border-color .18s, box-shadow .18s;
    appearance: none;
}
textarea { min-height: 78px; resize: vertical; line-height: 1.5; }
select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.4' stroke-linecap='round'><path d='m6 9 6 6 6-6'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}
.input:focus, input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--green-500);
    box-shadow: 0 0 0 4px rgba(34,197,94,.14);
}
.input.err, input.err, select.err { border-color: var(--red); }
.err-msg { color: var(--red); font-size: 12px; margin-top: 5px; display: flex; align-items: center; gap: 4px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 5px; }

.input-icon { position: relative; }
.input-icon .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon input { padding-left: 42px; }
.input-icon .clear {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    width: 32px; height: 32px; border: 0; border-radius: 50%;
    background: var(--line-2); color: var(--muted);
    display: grid; place-items: center; cursor: pointer;
}

.money-input { position: relative; }
.money-input::before {
    content: '₹';
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    font-family: var(--font-head); font-weight: 600; color: var(--muted);
}
.money-input input { padding-left: 34px; font-family: var(--font-head); font-weight: 600; font-size: 18px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.switch { display: flex; align-items: center; gap: 11px; cursor: pointer; min-height: 44px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track {
    width: 48px; height: 28px; flex: 0 0 48px;
    border-radius: 999px;
    background: #CBD5E1;
    position: relative;
    transition: background .22s var(--ease);
}
.switch .track::after {
    content: ''; position: absolute;
    top: 3px; left: 3px;
    width: 22px; height: 22px; border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
    transition: transform .22s var(--ease);
}
.switch input:checked + .track { background: var(--green-500); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch .txt { font-size: 13.5px; font-weight: 600; }

/* ---------- Buttons ----------------------------------------------------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px;
    padding: 12px 18px;
    border: 0; border-radius: var(--r);
    background: var(--line-2);
    color: var(--ink);
    font-family: var(--font-head); font-size: 15px; font-weight: 600;
    cursor: pointer;
    transition: transform .16s var(--ease), box-shadow .18s, filter .18s;
    position: relative;
    overflow: hidden;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; pointer-events: none; }
.btn.block { width: 100%; }
.btn.sm { min-height: 40px; padding: 8px 13px; font-size: 13px; border-radius: 11px; }
.btn.pri {
    background: linear-gradient(135deg, var(--green-600), var(--green-700));
    color: #fff;
    box-shadow: 0 6px 16px rgba(32,65,41,.26);
}
.btn.pri:active { box-shadow: 0 3px 8px rgba(32,65,41,.3); }
.btn.ok    { background: var(--green-100); color: #15803D; }
.btn.warn  { background: var(--amber-bg); color: #92400E; }
.btn.danger{ background: var(--red-bg); color: #991B1B; }
.btn.ghost { background: #fff; border: 1.5px solid var(--line); color: var(--ink-2); }
.btn.wa    { background: #25D366; color: #fff; box-shadow: 0 6px 16px rgba(37,211,102,.3); }

.btn .spin { display: none; }
.btn.loading .spin { display: inline-block; }
.btn.loading .lbl { opacity: .65; }
.spin {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 9px; }

/* Sticky action bar above the bottom nav */
.sticky-bar {
    position: fixed;
    left: 50%; transform: translateX(-50%);
    bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
    width: 100%; max-width: 480px;
    padding: 10px 14px 12px;
    background: rgba(255,255,255,.95);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    z-index: 35;
    animation: barIn .3s var(--ease) both;
}
@keyframes barIn { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
.page.has-sticky { padding-bottom: calc(var(--nav-h) + 122px); }

/* ---------- Product picker (quick order) -------------------------------- */

.picker { display: flex; flex-direction: column; gap: 9px; }
.pick {
    display: flex; align-items: center; gap: 11px;
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: var(--r-lg);
    padding: 10px 11px;
    transition: border-color .2s, background .2s, box-shadow .2s;
}
.pick.on {
    border-color: var(--green-500);
    background: linear-gradient(180deg, var(--green-50), #fff 70%);
    box-shadow: 0 4px 14px rgba(34,197,94,.14);
}
.pick .pic {
    width: 42px; height: 42px; flex: 0 0 42px;
    border-radius: 13px;
    background: var(--green-50); color: var(--green-600);
    display: grid; place-items: center;
    transition: background .2s, color .2s, transform .2s;
}
.pick.on .pic { background: var(--green-600); color: #fff; transform: rotate(-6deg) scale(1.04); }
.pick .nm { font-family: var(--font-head); font-weight: 600; font-size: 14.5px; line-height: 1.2; }
.pick .pr { font-size: 12.5px; color: var(--muted); }

.stepper { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.stepper button {
    width: 42px; height: 42px;
    border: 1.5px solid var(--line);
    background: #fff;
    border-radius: 11px;
    color: var(--green-700);
    display: grid; place-items: center;
    cursor: pointer;
    transition: transform .14s, background .16s, border-color .16s;
}
.stepper button:active { transform: scale(.88); background: var(--green-50); }
.stepper button.minus:disabled { opacity: .35; pointer-events: none; }
.stepper .qty {
    min-width: 30px; text-align: center;
    font-family: var(--font-head); font-weight: 600; font-size: 16px;
}
.stepper .add {
    width: auto; padding: 0 16px; height: 42px;
    background: var(--green-600); border-color: var(--green-600); color: #fff;
    font-family: var(--font-head); font-weight: 600; font-size: 13px;
}

/* Customer search results */
.results { margin-top: 8px; display: flex; flex-direction: column; gap: 7px; }
.results .res {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 11px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r);
    cursor: pointer;
    text-align: left;
    width: 100%;
    animation: fadeUp .24s var(--ease) both;
    transition: background .16s, border-color .16s;
}
.results .res:active { background: var(--green-50); border-color: var(--green-300); }

.picked {
    display: flex; align-items: center; gap: 11px;
    background: linear-gradient(135deg, var(--green-50), var(--cream-50));
    border: 1.5px solid var(--green-300);
    border-radius: var(--r-lg);
    padding: 11px 12px;
    animation: popIn .28s var(--ease) both;
}
@keyframes popIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }

.sub-banner {
    display: flex; align-items: center; gap: 10px;
    background: linear-gradient(135deg, #ECFDF5, var(--cream));
    border: 1.5px dashed var(--green-400);
    border-radius: var(--r-lg);
    padding: 11px 12px;
    margin-top: 10px;
    animation: popIn .3s var(--ease) both;
}

/* Live total */
.total-line { display: flex; align-items: baseline; justify-content: space-between; }
.total-line .amt { font-family: var(--font-head); font-size: 26px; font-weight: 700; color: var(--green-700); }
.total-line .amt.flash { animation: flashAmt .45s var(--ease); }
@keyframes flashAmt { 0% { transform: scale(1); } 40% { transform: scale(1.11); color: var(--green-500); } 100% { transform: scale(1); } }

/* ---------- Bottom sheet ------------------------------------------------ */

.sheet-backdrop {
    position: fixed; inset: 0;
    background: rgba(15,23,42,.45);
    backdrop-filter: blur(2px);
    z-index: 60;
    opacity: 0; pointer-events: none;
    transition: opacity .26s;
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }

.sheet {
    position: fixed;
    left: 50%; bottom: 0;
    width: 100%; max-width: 480px;
    transform: translate(-50%, 100%);
    background: #fff;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    box-shadow: 0 -8px 40px rgba(15,23,42,.24);
    z-index: 61;
    padding: 8px 16px calc(20px + env(safe-area-inset-bottom, 0px));
    max-height: 92vh; overflow-y: auto;
    transition: transform .34s var(--ease);
}
.sheet.open { transform: translate(-50%, 0); }
.sheet .grip { width: 42px; height: 4px; border-radius: 4px; background: #D8E0E8; margin: 6px auto 12px; }
.sheet h3 { font-size: 17px; margin-bottom: 12px; }

/* ---------- Toast ------------------------------------------------------- */

.toasts {
    position: fixed;
    left: 50%; transform: translateX(-50%);
    top: calc(env(safe-area-inset-top, 0px) + 12px);
    width: min(452px, calc(100% - 24px));
    z-index: 90;
    display: flex; flex-direction: column; gap: 8px;
    pointer-events: none;
}
.toast {
    display: flex; align-items: center; gap: 9px;
    padding: 12px 14px;
    border-radius: var(--r);
    background: var(--green-700);
    color: #fff;
    font-size: 13.5px; font-weight: 600;
    box-shadow: var(--sh-3);
    animation: toastIn .34s var(--ease) both;
}
.toast.error   { background: #B91C1C; }
.toast.warning { background: #B45309; }
.toast.out     { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastIn  { from { opacity: 0; transform: translateY(-16px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-14px) scale(.97); } }

/* ---------- Progress ---------------------------------------------------- */

.bar { height: 8px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.bar > i {
    display: block; height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--green-500), var(--green-600));
    width: 0;
    transition: width .8s var(--ease);
}
.bar.warn > i { background: linear-gradient(90deg, #F59E0B, #D97706); }
.bar.red  > i { background: linear-gradient(90deg, #EF4444, #DC2626); }

.ring { position: relative; width: 76px; height: 76px; flex: 0 0 76px; }
.ring svg { transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 8; stroke-linecap: round; }
.ring .track { stroke: var(--line-2); }
.ring .val   { stroke: url(#ringGrad); transition: stroke-dashoffset 1s var(--ease); }
.ring .lbl {
    position: absolute; inset: 0;
    display: grid; place-items: center;
    font-family: var(--font-head); font-weight: 700; font-size: 17px; color: var(--green-700);
    line-height: 1;
}
.ring .lbl small { display: block; font-size: 9.5px; font-weight: 600; color: var(--muted); letter-spacing: .04em; }

/* ---------- Chart (inline SVG bars) ------------------------------------- */

.chart { width: 100%; overflow-x: auto; scrollbar-width: none; }
.chart::-webkit-scrollbar { display: none; }
.chart svg { display: block; }
.chart .gline { stroke: var(--line); stroke-width: 1; }
.chart .b-in  { fill: var(--green-500); }
.chart .b-ex  { fill: #F0A93B; }
.chart .lbl   { font-family: var(--font-body); font-size: 8px; fill: var(--muted); }
.bar-grow { animation: barGrow .7s var(--ease) both; transform-origin: bottom; }
@keyframes barGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.legend { display: flex; gap: 14px; justify-content: center; margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---------- Report blocks ----------------------------------------------- */

.kv { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.kv:last-child { border-bottom: 0; }
.kv .k { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 7px; }
.kv .v { font-family: var(--font-head); font-weight: 600; font-size: 14.5px; }
.kv.total { border-top: 1.5px solid var(--line); border-bottom: 0; margin-top: 4px; padding-top: 11px; }
.kv.total .k { font-weight: 700; color: var(--ink); }
.kv.total .v { font-size: 17px; }
.pos { color: #15803D; }
.neg { color: var(--red); }

.pnl {
    background: linear-gradient(140deg, var(--green-700), var(--green-600));
    color: #fff;
    border-radius: var(--r-xl);
    padding: 16px;
    box-shadow: var(--sh-green);
    margin-bottom: 12px;
}
.pnl .lbl { font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; opacity: .82; }
.pnl .big { font-family: var(--font-head); font-size: 30px; font-weight: 700; line-height: 1.15; }
.pnl .split { display: flex; gap: 10px; margin-top: 12px; }
.pnl .split > div { flex: 1; background: rgba(255,255,255,.14); border-radius: var(--r); padding: 9px 10px; }
.pnl .split .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; opacity: .85; }
.pnl .split .v { font-family: var(--font-head); font-weight: 600; font-size: 16px; }

/* ---------- Empty & skeleton ------------------------------------------- */

.empty {
    text-align: center;
    padding: 30px 20px;
    color: var(--muted);
}
.empty .ic-wrap {
    width: 62px; height: 62px; margin: 0 auto 12px;
    border-radius: 20px;
    background: var(--green-50); color: var(--green-400);
    display: grid; place-items: center;
    animation: floaty 3.4s ease-in-out infinite;
}
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.empty h3 { font-size: 15px; color: var(--ink-2); margin-bottom: 4px; }
.empty p { font-size: 13px; margin: 0 0 14px; }

.skel { background: linear-gradient(90deg, #EEF2F6 25%, #F7FAFC 50%, #EEF2F6 75%);
        background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- Login ------------------------------------------------------- */

.auth-wrap {
    min-height: 100vh;
    display: flex; flex-direction: column; justify-content: center;
    padding: 24px 22px calc(24px + env(safe-area-inset-bottom, 0px));
    background:
        radial-gradient(1100px 460px at 50% -10%, rgba(34,197,94,.18), transparent 70%),
        linear-gradient(180deg, var(--cream-50), #fff 42%);
    max-width: 480px; margin: 0 auto;
}
.auth-logo {
    width: 104px; height: 104px; margin: 0 auto 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 10px 30px rgba(32,65,41,.18);
    overflow: hidden;
    display: grid; place-items: center;
    animation: dropIn .6s var(--ease) both;
}
.auth-logo img { width: 100%; height: 100%; object-fit: cover; }
@keyframes dropIn { from { opacity: 0; transform: translateY(-18px) scale(.9); } to { opacity: 1; transform: none; } }
.auth-wrap h1 { text-align: center; font-size: 22px; color: var(--green-700); }
.auth-wrap .tag { text-align: center; color: var(--muted); font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; margin: 2px 0 22px; }
.auth-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-xl);
    padding: 20px 18px;
    box-shadow: var(--sh-3);
    animation: fadeUp .5s var(--ease) .1s both;
}
.auth-foot { text-align: center; margin-top: 20px; font-size: 11.5px; color: var(--muted); }

/* ---------- Utility ----------------------------------------------------- */

.ic { flex: 0 0 auto; }
.hidden { display: none !important; }
.divider { height: 1px; background: var(--line); margin: 12px 0; }
.pill-note {
    display: flex; align-items: flex-start; gap: 8px;
    background: var(--cream-50);
    border: 1px solid var(--cream);
    border-radius: var(--r);
    padding: 10px 12px;
    font-size: 12.5px; color: var(--ink-2);
}
.pill-note .ic { color: var(--green-600); margin-top: 1px; }

.fab-float {
    position: fixed;
    right: max(14px, calc(50% - 226px));
    bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 16px);
    width: 52px; height: 52px;
    border-radius: 50%;
    background: linear-gradient(150deg, var(--green-500), var(--green-700));
    color: #fff;
    display: grid; place-items: center;
    box-shadow: var(--sh-green);
    z-index: 36;
    transition: transform .2s var(--ease);
}
.fab-float:active { transform: scale(.9); }

/* ---------- Print (monthly report) ------------------------------------- */

@media print {
    .appbar, .bottomnav, .sticky-bar, .fab-float, .no-print, .toasts { display: none !important; }
    body, .app { background: #fff; box-shadow: none; }
    .app { max-width: none; }
    .page { padding: 0; animation: none; }
    .card, .tile { break-inside: avoid; box-shadow: none; }
    .pnl { background: #fff !important; color: #000 !important; border: 2px solid #204129; }
    .pnl .split > div { background: #F1F5F9 !important; }
}

/* ---------- Motion preferences ----------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

/* Desktop: keep the phone shell, add breathing room */
@media (min-width: 600px) {
    body { background: #E8EEEA; padding: 0; }
    .app { min-height: 100vh; }
}
