/* My Shop Bills — the look of the app (teal, Manrope text, Anek Latin titles), on top of Bootstrap 5.3. */
@font-face { font-family: "Manrope"; src: url("../fonts/manrope.0a30df7affb4.woff") format("woff"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Anek Latin"; src: url("../fonts/anek-latin.71f87de1e712.woff") format("woff"); font-weight: 100 800; font-stretch: 75% 125%; font-display: swap; }

:root {
  --a1-ink: #0f1c24;
  --a1-text-2: #2b3b45;
  --a1-grey: #4e5f69;
  --a1-line: #c9d5da;
  --a1-soft: #eef3f5;
  --a1-paper: #f5f8f9;
  --a1-teal: #0b6e86;
  --a1-teal-dark: #095c70;
  --a1-teal-tint: #e4f1f4;
  --a1-deep: #06394a;
  --a1-accent: #f0a02e;
  --a1-green: #067049;
  --a1-red: #a82e2a;
  --a1-amber-bg: #fff6e3;
  --a1-amber-line: #f2cf8a;
  --a1-amber-ink: #5c3d00;
  --bs-body-font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-color: var(--a1-ink);
  --bs-body-bg: var(--a1-paper);
  --bs-primary: var(--a1-teal);
  --bs-primary-rgb: 11, 110, 134;
  --bs-link-color: var(--a1-teal);
  --bs-link-color-rgb: 11, 110, 134;
  --bs-link-hover-color: var(--a1-teal-dark);
  --bs-border-color: var(--a1-line);
  --bs-secondary-color: var(--a1-grey);
  --sidebar-w: 248px;
}
body { font-size: 15px; -webkit-font-smoothing: antialiased; }
h1, h2, h3, .a1-title, .a1-brand-name { font-family: "Anek Latin", "Manrope", system-ui, sans-serif; font-stretch: 87.5%; letter-spacing: 0; }
h1, .h1 { font-size: 30px; font-weight: 700; }
h2, .h2 { font-size: 22px; font-weight: 700; }
.text-muted, .form-text { color: var(--a1-grey) !important; }
.num, .table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.money-due { color: var(--a1-red); font-weight: 700; }
.money-ok { color: var(--a1-green); font-weight: 700; }

/* buttons and boxes */
.btn { font-weight: 700; border-radius: 9px; }
.btn-primary { --bs-btn-bg: var(--a1-teal); --bs-btn-border-color: var(--a1-teal); --bs-btn-hover-bg: var(--a1-teal-dark);
  --bs-btn-hover-border-color: var(--a1-teal-dark); --bs-btn-active-bg: var(--a1-teal-dark); --bs-btn-disabled-bg: var(--a1-teal); }
.btn-outline-primary { --bs-btn-color: var(--a1-teal); --bs-btn-border-color: var(--a1-teal); --bs-btn-hover-bg: var(--a1-teal);
  --bs-btn-hover-border-color: var(--a1-teal); --bs-btn-active-bg: var(--a1-teal-dark); }
.btn-accent { background: var(--a1-accent); color: #2a1700; border: 0; }
.btn-accent:hover { background: #e28f17; color: #2a1700; }
.form-control, .form-select { border: 1.5px solid #8397a2; border-radius: 9px; min-height: 42px; }
.form-control:focus, .form-select:focus { border-color: var(--a1-teal); box-shadow: 0 0 0 3px rgba(11, 110, 134, .18); }
.form-label { font-weight: 700; font-size: 14px; margin-bottom: 5px; }
.card { border: 1.5px solid var(--a1-line); border-radius: 12px; }
.card-header { background: #fff; font-weight: 700; border-bottom: 1.5px solid var(--a1-line); }
:focus-visible { outline: 3px solid rgba(11, 110, 134, .5); outline-offset: 2px; }

/* layout: menu on the left, page on the right */
.a1-shell { display: flex; min-height: 100vh; }
.a1-side { width: var(--sidebar-w); flex: none; background: var(--a1-deep); color: #e3eef2; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.a1-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; text-decoration: none; }
.a1-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--a1-accent); color: #3a2100; display: grid; place-items: center; flex: none; }
.a1-mark svg { width: 20px; height: 20px; }
.a1-brand-name { font-size: 21px; font-weight: 700; line-height: 1; }
.a1-brand small { display: block; font-family: "Manrope", sans-serif; font-size: 12px; font-weight: 600; color: #a9c4cd; margin-top: 3px; }
.a1-newbill { margin: 4px 14px 12px; }
.a1-nav-group { padding: 9px 18px 3px; font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #8fb3bf; }
.a1-nav a { display: flex; align-items: center; gap: 10px; padding: 7px 18px; color: #e3eef2; text-decoration: none; font-size: 15.5px; font-weight: 600;
  border-left: 3px solid transparent; }
.a1-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.a1-nav a.active { background: rgba(240, 160, 46, .14); border-left-color: var(--a1-accent); color: #fff; }
.a1-nav svg { width: 19px; height: 19px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.a1-side-foot { margin-top: auto; padding: 14px 18px 18px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: 13px; color: #a9c4cd; }
.a1-side-foot .btn { width: 100%; margin-top: 8px; }
.a1-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.a1-top { display: none; }
.a1-content { flex: 1; padding: 24px 28px; max-width: 1400px; width: 100%; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--a1-grey); }

/* the notice in the footer of every page */
.a1-foot { padding: 10px 28px 18px; }
.a1-notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border: 1px solid var(--a1-amber-line); border-radius: 10px;
  background: var(--a1-amber-bg); color: var(--a1-amber-ink); font-size: 13px; line-height: 1.5; }
.a1-notice b { color: #3d2800; }
.a1-notice svg { width: 18px; height: 18px; flex: none; margin-top: 1px; stroke: #a46b00; fill: none; stroke-width: 2; stroke-linecap: round; }

/* number tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: #fff; border: 1.5px solid var(--a1-line); border-radius: 12px; padding: 14px 16px; }
.tile .label { font-size: 13px; font-weight: 700; color: var(--a1-grey); }
.tile .value { font-family: "Anek Latin", sans-serif; font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; margin-top: 2px; }
.tile .sub { font-size: 12.5px; color: var(--a1-grey); }

/* tables */
.table { --bs-table-bg: #fff; margin-bottom: 0; }
.table thead th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--a1-text-2); background: var(--a1-soft);
  border-bottom: 1.5px solid var(--a1-line); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.table-wrap { background: #fff; border: 1.5px solid var(--a1-line); border-radius: 12px; overflow: auto; }
.table td, .table th { vertical-align: middle; }
.table tfoot td { font-weight: 800; background: var(--a1-soft); }
.badge-status { font-size: 12px; font-weight: 800; border-radius: 999px; padding: 4px 10px; }
.st-paid { background: #e2f3eb; color: var(--a1-green); }
.st-part { background: #fff1d6; color: #7a4a00; }
.st-unpaid { background: #eef3f5; color: var(--a1-text-2); }
.st-overdue { background: #fbe4e2; color: var(--a1-red); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-bottom: 14px; }
.filters .form-control, .filters .form-select { min-width: 150px; }
.empty { padding: 34px 16px; text-align: center; color: var(--a1-grey); }

/* the bill screen */
.bill-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.bill-lines td { padding: 6px 8px; }
.bill-lines input { min-height: 36px; padding: 4px 8px; }
.bill-lines .w-qty { width: 90px; } .bill-lines .w-rate { width: 120px; } .bill-lines .w-color { width: 110px; } .bill-lines .w-tax { width: 130px; } .bill-lines .w-item { min-width: 200px; }
.bill-sum { position: sticky; top: 16px; }
.bill-sum dl { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0; }
.bill-sum dt { font-weight: 600; color: var(--a1-text-2); }
.bill-sum dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.bill-sum .grand { font-family: "Anek Latin", sans-serif; font-size: 30px; font-weight: 700; border-top: 3px double var(--a1-ink); padding-top: 6px; }
.suggest { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; background: #fff; border: 1.5px solid var(--a1-line); border-radius: 10px;
  box-shadow: 0 12px 28px -10px rgba(6, 57, 74, .35); max-height: 320px; overflow-y: auto; }
.suggest button { display: block; width: 100%; text-align: left; border: 0; background: #fff; padding: 8px 12px; border-bottom: 1px solid var(--a1-soft); }
.suggest button:hover, .suggest button.on { background: var(--a1-teal-tint); }
.suggest small { color: var(--a1-grey); }

/* sign-in pages */
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; background: var(--a1-paper); }
.auth-box { width: 100%; max-width: 440px; margin: 48px auto 24px; padding: 0 16px; }
.auth-box .card { padding: 26px; }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; color: var(--a1-ink); text-decoration: none; }

/* ledger */
.ledger td.part b { font-weight: 800; }
.ledger .vt { font-size: 12.5px; font-weight: 700; color: var(--a1-text-2); }

@media (max-width: 1100px) {
  .bill-grid { grid-template-columns: minmax(0, 1fr); }
  .bill-sum { position: static; }
}
@media (max-width: 991px) {
  .a1-side { position: fixed; z-index: 1040; left: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: 8px 0 30px rgba(0,0,0,.25); }
  .a1-side.open { transform: none; }
  .a1-top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--a1-deep); color: #fff; position: sticky; top: 0; z-index: 1030; }
  .a1-top .btn { color: #fff; border-color: rgba(255,255,255,.35); }
  .a1-content { padding: 16px; }
  .a1-foot { padding: 8px 16px 16px; }
}
@media (max-width: 600px) {
  h1, .h1 { font-size: 25px; }
  .tile .value { font-size: 22px; }
  .table-wrap .table { font-size: 14px; }
}
@media print {
  .a1-side, .a1-top, .a1-foot, .no-print { display: none !important; }
  .a1-content { padding: 0; }
}
.form-narrow { max-width: 720px; }
.btn svg, .tile svg { width: 18px; height: 18px; vertical-align: -3px; margin-right: 4px; }
.a1-newbill { display: flex; align-items: center; justify-content: center; gap: 6px; }
.a1-top svg { width: 22px; height: 22px; }
details.fold > summary { cursor: pointer; font-weight: 700; padding: 12px 16px; list-style: none; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: " ▾"; color: var(--a1-grey); }
details.fold[open] > summary { border-bottom: 1.5px solid var(--a1-line); }
.card-header form { flex-wrap: wrap; }
.card-header input[type=date] { max-width: 150px; min-width: 0; }
@media (max-width: 400px) { .card-header input[type=date] { max-width: 118px; } .a1-content { padding: 12px; } }

/* purchase screen: a narrower table so the remove button fits next to the totals */
#purchase-form .bill-lines .w-qty { width: 76px; }
#purchase-form .bill-lines .w-rate { width: 108px; }
#purchase-form .bill-lines .w-tax { width: 118px; }
#purchase-form .bill-lines .w-item { min-width: 170px; }

/* reports */
.report-group { font-size: 17px; margin: 22px 0 10px; color: var(--a1-text-2); }
.report-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.report-card { display: block; background: #fff; border: 1.5px solid var(--a1-line); border-left: 4px solid var(--a1-teal); border-radius: 10px;
  padding: 12px 14px; color: var(--a1-ink); text-decoration: none; }
.report-card:hover, .report-card:focus-visible { border-color: var(--a1-teal); background: var(--a1-teal-tint); }
.report-card b { display: block; font-size: 15.5px; }
.report-card span { display: block; font-size: 13px; color: var(--a1-grey); margin-top: 2px; }
.report-caption { font-size: 17px; margin: 18px 0 8px; }
.report-table td, .report-table th { vertical-align: top; }
.report-table tfoot td { font-weight: 700; background: var(--a1-soft); }
@media print {
  .report-table { font-size: 11px; }
  .report-table.wide { font-size: 10px; }
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .tile { padding: 8px 10px; }
  .tile .value { font-size: 18px; }
  a { color: inherit; text-decoration: none; }
}

/* simple bar charts (SVG) */
.hbars { width: 100%; height: auto; display: block; }
.hb-label { font-size: 15px; fill: var(--a1-grey); }
.hb-bar { fill: var(--a1-teal); }
.vbars .vb-sales { fill: var(--a1-teal); }
.vbars .vb-costs { fill: var(--a1-accent); }
.vbars .vb-label { font-size: 11px; fill: var(--a1-grey); text-anchor: middle; }
.vbars .vb-grid { stroke: var(--a1-line); stroke-width: 1; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.legend-dot.sales { background: var(--a1-teal); } .legend-dot.costs { background: var(--a1-accent); }
.tile .value-text { font-size: 19px; overflow-wrap: anywhere; }
.pl-row { margin-bottom: 10px; }
.pl-row.pl-sub { font-weight: 700; }
.pl-track { width: 100%; height: 6px; display: block; margin-top: 4px; }
.pl-bg { fill: var(--a1-soft); } .pl-plus { fill: var(--a1-teal); } .pl-minus { fill: var(--a1-accent); } .pl-neg { fill: var(--a1-red); }
.otp-input { font-weight: 800; letter-spacing: .25em; font-variant-numeric: tabular-nums; }

/* the testing notice on the sign-in pages (they do not load the Khata stylesheet) */
.auth-wrap .k-footnote { display: flex; flex-direction: column; gap: 6px; max-width: 760px; margin: 18px auto 0; padding: 10px 14px;
  border: 1.5px solid #c9a35b; border-radius: 12px; background: #fdf3e1; font-size: 12.5px; line-height: 1.5; color: #3a2a00; }
.auth-wrap .k-footnote > span { display: flex; align-items: flex-start; gap: 8px; }
.auth-wrap .k-footnote .k-icon { flex: none; width: 16px; height: 16px; margin-top: 2px; color: #8a4b00; }

/* Items sold to a customer: the item column keeps its width on phones (the table scrolls sideways) */
.ksd-item { min-width: 190px; }

/* Terms and Privacy pages (owner, 21 Nov) */
.legal-box { width: 100%; max-width: 780px; margin: 40px auto 24px; padding: 0 16px; }
.legal-box .card.legal { padding: 30px 32px; }
.legal h1 { font-size: 1.9rem; font-weight: 800; margin-bottom: .25rem; }
.legal h2 { font-size: 1.12rem; font-weight: 800; margin: 1.7rem 0 .5rem; }
.legal p, .legal li { font-size: 15.5px; line-height: 1.65; }
.legal ul { padding-left: 1.2rem; margin-bottom: 1rem; }
.legal li { margin-bottom: .35rem; }
.legal-updated { color: #6b6b6b; font-size: 13.5px; }
.legal .legal-lead { font-size: 16px; font-weight: 600; padding: 12px 14px; background: #fdf3e1; border-radius: 10px; }
.legal-nav { text-align: center; margin: 18px 0 8px; font-size: 14px; }
.k-footnote .k-legal a { color: inherit; text-decoration: underline; }
@media (max-width: 576px) { .legal-box { margin-top: 20px; } .legal-box .card.legal { padding: 20px 18px; } }
