/* Tillo Cloud: the owner's reports, made for a phone first. Colours of the Tillo website: signboard green and haldi. */

:root {
    --ink: #12211a;
    --muted: #5b6b62;
    --line: #dde6e0;
    --paper: #ffffff;
    --bg: #f4f7f5;
    --board: #0d3a23;
    --board-2: #13532f;
    --on-board: #fffbef;
    --green: #15803d;
    --mint: #e7f4eb;
    --haldi: #f5b416;
    --haldi-tint: #fff3d1;
    --chilli: #c2412b;
    --chilli-tint: #fde7e2;
    --radius: 12px;
    --text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --urdu: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Urdu Typesetting", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--text); font-size: 16px; line-height: 1.5; }
a { color: var(--green); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.ur { font-family: var(--urdu); font-weight: 400; margin: 0 0 4px; text-align: left; color: var(--muted); }
.nowrap { white-space: nowrap; }
.narrow { display: none; }
@media (max-width: 599px) { .wide { display: none; } .narrow { display: block; } }

/* Top bar */
.top { background: var(--board); color: var(--on-board); position: sticky; top: 0; z-index: 5; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--on-board); text-decoration: none; font-weight: 700; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--haldi); color: var(--board); font-size: 18px; }
.brand-name { font-size: 1.15rem; }
.brand-sub { font-weight: 400; opacity: .75; }
.top-nav { display: flex; align-items: center; gap: 10px; min-width: 0; }
.top-link, .linklike { color: var(--on-board); font: inherit; background: none; border: 0; padding: 6px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.store-pick select { max-width: 46vw; padding: 6px 8px; border-radius: 8px; border: 0; font: inherit; }

main.wrap { padding-top: 18px; padding-bottom: 32px; }
.foot { color: var(--muted); font-size: .85rem; padding-bottom: 32px; }

/* Cards and forms */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.grid-2 { display: grid; gap: 0 16px; }
@media (min-width: 800px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.btn { display: inline-block; background: var(--green); color: #fff; border: 0; border-radius: 10px; padding: 12px 18px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: #0f6a31; }
.btn-small { padding: 8px 12px; font-size: .9rem; }
.btn-light { background: var(--mint); color: var(--board); }
.btn-light:hover { background: #d5ecdc; }
.btn-danger { background: var(--chilli); }
.btn-danger:hover { background: #a3331f; }
input, select { font: inherit; }
.form label { display: block; font-weight: 600; margin: 12px 0 4px; }
.form input { width: 100%; padding: 12px; border: 1px solid #b9c7be; border-radius: 10px; background: #fff; }
.form .btn { width: 100%; margin-top: 18px; }
.alert { background: var(--chilli-tint); color: #7a1f10; border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; }
.alert.ok { background: var(--mint); color: var(--board); }
.empty { color: var(--muted); margin: 0; }
.note { color: var(--muted); font-size: .9rem; margin: -6px 0 16px; }

/* Sign-in */
.login { max-width: 440px; margin: 12px auto; }
.login .lead { color: var(--muted); }
.help { margin-top: 22px; font-size: .95rem; }
.help h2 { font-size: 1rem; margin: 16px 0 4px; }
.help p { margin: 0; color: var(--muted); }
.urdu-note { font-family: var(--urdu); font-size: 1.05rem; line-height: 2.2; color: var(--muted); margin-top: 22px; }

/* Reports */
.store-head h1 { margin-bottom: 2px; }
.sync { margin: 0 0 14px; color: var(--muted); font-size: .9rem; }
.sync-old { background: var(--haldi-tint); color: #5c3d00; border-radius: 10px; padding: 8px 12px; }
.periods { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { padding: 7px 12px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: .9rem; white-space: nowrap; }
.chip.on { background: var(--board); border-color: var(--board); color: var(--on-board); }
.custom { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .9rem; }
.custom input { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; max-width: 150px; }
.custom.on input { border-color: var(--board); }
.period-title { margin: 6px 0 12px; }

.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
@media (min-width: 800px) { .kpis { grid-template-columns: repeat(3, 1fr); } }
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; min-width: 0; }
.kpi span { display: block; color: var(--muted); font-size: .85rem; }
.kpi strong { display: block; font-size: 1.25rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi small { display: block; color: var(--muted); font-size: .8rem; }
.kpi-main { grid-column: 1 / -1; background: var(--board); border-color: var(--board); color: var(--on-board); }
.kpi-main span, .kpi-main small { color: rgba(255, 251, 239, .8); }
.kpi-main strong { font-size: 2rem; color: var(--haldi); }
@media (min-width: 800px) { .kpi-main { grid-column: auto; } }

.bars { display: flex; align-items: flex-end; gap: 3px; height: 180px; overflow-x: auto; padding-top: 18px; }
.bar { flex: 1 0 22px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.bar-fill { width: 100%; max-width: 34px; background: var(--green); border-radius: 4px 4px 0 0; min-height: 1px; }
.bar-value { font-size: .65rem; color: var(--muted); white-space: nowrap; margin-bottom: 2px; }
.bar-label { font-size: .7rem; color: var(--muted); white-space: nowrap; margin-top: 4px; }

.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: .8rem; border-bottom: 1px solid var(--line); padding: 6px 6px 6px 0; }
.table td { border-bottom: 1px solid var(--line); padding: 8px 6px 8px 0; vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.num { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; padding-right: 0 !important; }
.table tfoot td { border-bottom: 0; padding-top: 6px; }
.table tfoot .total td { font-weight: 700; font-size: 1.1rem; border-top: 2px solid var(--ink); padding-top: 8px; }
.bills .voided td { color: var(--muted); text-decoration: line-through; }
.bills .voided td .narrow { text-decoration: line-through; }
.bills .voided td:first-child { text-decoration: none; }
.tag { display: inline-block; font-size: .7rem; font-weight: 600; padding: 1px 6px; border-radius: 6px; background: var(--mint); color: var(--board); vertical-align: middle; }
.tag-return { background: var(--haldi-tint); color: #5c3d00; }
.tag-void { background: var(--chilli-tint); color: #7a1f10; }
.more { display: inline-block; margin-top: 10px; font-weight: 600; }

.hbars { list-style: none; margin: 0; padding: 0; }
.hbars li { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; margin-bottom: 10px; font-size: .9rem; }
.hb-track { grid-column: 1 / -1; height: 6px; background: var(--mint); border-radius: 3px; overflow: hidden; }
.hb-fill { display: block; height: 100%; background: var(--green); }
.hb-value { font-variant-numeric: tabular-nums; }

/* One bill */
.back { display: inline-block; margin-bottom: 10px; }
.receipt { max-width: 560px; }

/* Support */
.searchbar { display: flex; gap: 8px; margin-bottom: 14px; }
.searchbar input { flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; }
.shop details { margin-top: 8px; }
.shop summary { cursor: pointer; color: var(--green); font-weight: 600; }
.inline { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.inline input { flex: 1 1 180px; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
