/* Sales Management System: screen styles */

:root {
  --paper: #f5f4f7;
  --surface: #ffffff;
  --ink: #1d1826;
  --ink-2: #5a5466;
  --ink-3: #8a8494;
  --line: #e2dfe8;
  --line-soft: #efedf3;
  --plum: #2b1a36;
  --plum-2: #3d2649;
  --accent: #6a2a7d;
  --accent-dark: #54206a;
  --accent-soft: #f3e9f6;
  --data: #2a78d6;
  --good: #0b7a0b;
  --good-bg: #e7f6e7;
  --warn: #8a5a00;
  --warn-bg: #fff3d6;
  --bad: #b42b2b;
  --bad-bg: #fde9e9;
  --radius: 8px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, "Nirmala UI", "Noto Sans Bengali", sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 600; }
h1 { font-size: 24px; letter-spacing: -0.01em; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 8px 12px; z-index: 50; }
.skip-link:focus { left: 8px; top: 8px; }

/* ------------------------------------------------------------ app shell */

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 216px;
  flex: 0 0 216px;
  background: var(--plum);
  color: #e9e2ee;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px 14px; }
.brand-mark {
  width: 22px; height: 22px; flex: 0 0 22px; border-radius: 5px; background: #e9c46a;
  /* a ribbon crossing a wrapped box */
  background-image: linear-gradient(var(--plum), var(--plum)), linear-gradient(var(--plum), var(--plum));
  background-size: 4px 100%, 100% 4px; background-position: center; background-repeat: no-repeat;
}
.brand-link { display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none; }
.brand-logo {
  height: 40px; width: auto; max-width: 76px; flex: 0 0 auto; object-fit: contain;
  background: #fff; border-radius: 7px; padding: 3px;
}
.auth-logo { display: block; max-height: 72px; max-width: 200px; object-fit: contain; margin: 0 0 14px; }
.brand-name { font-weight: 600; font-size: 15px; color: #fff; line-height: 1.25; overflow-wrap: anywhere; }
.nav-toggle { display: none; }

.nav { display: flex; flex-direction: column; flex: 1; padding: 6px 10px 14px; }
.nav a {
  display: block; padding: 8px 12px; margin: 1px 0; border-radius: 6px;
  color: #d9cfe0; text-decoration: none; font-size: 14.5px;
}
.nav a:hover { background: var(--plum-2); color: #fff; }
.nav a.active { background: #fff; color: var(--plum); font-weight: 600; }
.nav a.nav-new {
  background: #e9c46a; color: #2b1a36; font-weight: 600; text-align: center; margin: 4px 0 14px;
}
.nav a.nav-new:hover { background: #f2d488; color: #2b1a36; }
.nav-foot { margin-top: auto; padding: 14px 12px 0; border-top: 1px solid #47305a; font-size: 13.5px; }
.nav-user { display: block; color: #bfb2c9; margin-bottom: 2px; overflow-wrap: anywhere; }
.nav-foot .link-button { color: #fff; }

.main { flex: 1; min-width: 0; padding: 26px 32px 60px; max-width: 1280px; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* -------------------------------------------------------------- buttons */

.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 500;
  text-decoration: none; cursor: pointer; white-space: nowrap; line-height: 1.3;
}
.btn:hover { border-color: #c9c3d2; color: var(--ink); background: #faf9fb; }
.btn-primary, button.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn-danger, button.btn-danger { background: var(--surface); border-color: #e3b5b5; color: var(--bad); }
.btn-danger:hover { background: var(--bad-bg); border-color: #d99; color: var(--bad); }
.btn-small { padding: 5px 10px; font-size: 13px; }

.link-button {
  background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline;
}
.link-button.danger { color: var(--bad); }
.inline-form { display: inline; margin: 0; }

/* ---------------------------------------------------------------- cards */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 20px 0; flex-wrap: wrap; }
.card-head p { margin: 2px 0 0; color: var(--ink-2); font-size: 13px; }
.card-body { padding: 14px 20px 18px; }
.card + .card { margin-top: 18px; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.grid-2 > .card + .card { margin-top: 0; }
.grid-even { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.grid-even > .card + .card { margin-top: 0; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; min-width: 0; }
.grid-2 > *, .grid-even > * { min-width: 0; }
.stack > .card + .card { margin-top: 0; }
.section-gap { margin-top: 18px; }

.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; border: 1px solid; font-size: 14.5px; }
.alert-success { background: var(--good-bg); border-color: #bfe3bf; color: #0a5c0a; }
.alert-error { background: var(--bad-bg); border-color: #f1c0c0; color: #8f1f1f; }
.alert-info { background: #eaf2fc; border-color: #c5dbf5; color: #17497f; }
.alert ul { margin: 4px 0 0; padding-left: 20px; }

.empty { color: var(--ink-2); margin: 0; padding: 6px 0; }
.empty-state { text-align: center; padding: 44px 20px; color: var(--ink-2); }
.empty-state h2 { color: var(--ink); margin-bottom: 6px; }
.empty-state p { margin: 0 0 16px; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }

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

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 15px; min-width: 0; }
.tile-label { color: var(--ink-2); font-size: 13.5px; }
.tile-value { font-size: 25px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; margin-top: 2px; overflow-wrap: anywhere; }
.tile-note { color: var(--ink-2); font-size: 13px; margin-top: 3px; }
.tile-note a { color: inherit; }
.tile-lead { background: var(--plum); border-color: var(--plum); color: #fff; }
.tile-lead .tile-label, .tile-lead .tile-note { color: #d3c6dc; }
.tile-lead .tile-value { font-size: 30px; }

.delta { font-weight: 600; white-space: nowrap; }
.delta.good { color: var(--good); }
.delta.bad { color: var(--bad); }
.delta.flat { color: var(--ink-2); font-weight: 400; white-space: normal; }
.delta-vs { color: var(--ink-2); }
.tile-lead .delta.good { color: #8fe08f; }
.tile-lead .delta.bad { color: #ffb0b0; }
.tile-lead .delta.flat, .tile-lead .delta-vs { color: #d3c6dc; }

/* --------------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.data th {
  text-align: left; font-weight: 600; font-size: 13px; color: var(--ink-2);
  padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fbfafc;
}
table.data th:first-child { border-top-left-radius: var(--radius); }
table.data th:last-child { border-top-right-radius: var(--radius); }
table.data td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data.rows-middle td { vertical-align: middle; }
table.data tbody tr:hover td { background: #fbfafc; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data tfoot td { font-weight: 600; border-top: 1px solid var(--line); border-bottom: 0; background: #fbfafc; }
table.data td .sub { display: block; color: var(--ink-2); font-size: 13px; }
table.data td.actions { white-space: nowrap; text-align: right; }
table.data td.actions > * + * { margin-left: 12px; }
table.data a.strong { font-weight: 600; text-decoration: none; }
table.data a.strong:hover { text-decoration: underline; }
.due-amount { color: var(--bad); font-weight: 600; }

.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--line-soft); color: var(--ink-2); font-size: 13.5px; }

.pagination { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 4px 10px; border-radius: 5px; text-decoration: none; color: var(--ink); font-size: 13.5px; }
.pagination a { border: 1px solid var(--line); background: var(--surface); }
.pagination a:hover { border-color: #c9c3d2; }
.pagination a.current { background: var(--plum); border-color: var(--plum); color: #fff; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.badge-pending { background: var(--warn-bg); color: var(--warn); }
.badge-delivered { background: var(--good-bg); color: var(--good); }
.badge-cancelled { background: var(--bad-bg); color: var(--bad); }

/* product pictures */
.thumb {
  width: 44px; height: 44px; flex: 0 0 44px; display: inline-block; border-radius: 6px; object-fit: cover;
  border: 1px solid var(--line); background: #fff; overflow: hidden; vertical-align: middle;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-sm { width: 37px; height: 37px; flex-basis: 37px; }
.thumb-lg { width: 96px; height: 96px; flex-basis: 96px; }
.thumb-empty {
  /* a light box with a small picture mark, so rows line up when there is no picture */
  background: var(--line-soft) linear-gradient(135deg, transparent 46%, #d5d0de 46%, #d5d0de 54%, transparent 54%);
}
.with-thumb { display: flex; align-items: center; gap: 12px; min-width: 0; }
.item-product { display: flex; align-items: center; gap: 6px; }
.item-product input[type=text] { min-width: 0; flex: 1 1 auto; }
.item-product .thumb-empty { display: none; }   /* a typed item has no picture: no empty box */

/* tick boxes and the print-several bar on the sales list */
.bulk-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--line-soft); background: #fbfafc; margin: 0; }
.bulk-count { flex: 1 1 220px; color: var(--ink-2); font-size: 13.5px; }
.bulk-bar.has-selection { background: var(--accent-soft); }
.bulk-bar.has-selection .bulk-count { color: var(--ink); font-weight: 600; }
.bulk-bar .btn[disabled] { opacity: 0.5; cursor: not-allowed; }
table.data .check-cell { width: 38px; padding-right: 0; }
table.data .check-cell input { margin: 0; width: 17px; height: 17px; vertical-align: -3px; cursor: pointer; }
table.data tbody tr.is-selected td { background: #faf4fc; }

/* grouped tables in the accounts section */
table.data tr.group-row th {
  background: var(--accent-soft); color: var(--ink); font-size: 14px; font-weight: 700; padding: 9px 14px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0; white-space: normal;
}
table.data tr.group-row th span { font-weight: 400; color: var(--ink-2); font-size: 13px; margin-left: 8px; }
table.data tr.subtotal-row td { font-weight: 600; background: #fbfafc; border-bottom: 0; }
table.data tr.grand-row td { font-size: 17px; padding-top: 12px; padding-bottom: 12px; }
table.data tr.inactive td { color: var(--ink-3); }
table.data tr.inactive a.strong { color: var(--ink-2); }

/* choice of transaction kind */
.kind-switch { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.kind-switch legend { padding: 0; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.kind-switch label { margin: 0; font-weight: 500; cursor: pointer; }
.kind-switch input { position: absolute; opacity: 0; }
.kind-switch span { display: block; padding: 8px 14px; border: 1px solid #cfcad8; border-radius: 6px; background: #fff; font-size: 14.5px; }
.kind-switch input:checked + span { background: var(--plum); border-color: var(--plum); color: #fff; }
.kind-switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* dropdown used for the print links in tables */
details.menu { display: inline-block; position: relative; }
details.menu > summary { list-style: none; cursor: pointer; color: var(--accent); text-decoration: underline; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu > summary::after { content: " \25BE"; text-decoration: none; display: inline-block; }
details.menu .menu-list {
  position: fixed; z-index: 40; min-width: 170px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 4px;
  box-shadow: 0 6px 20px rgba(43, 26, 54, 0.14);
}
details.menu .menu-list a { display: block; padding: 7px 10px; border-radius: 4px; text-decoration: none; color: var(--ink); font-size: 14px; }
details.menu .menu-list a:hover { background: var(--accent-soft); }

/* ---------------------------------------------------------------- forms */

label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 4px; }
label .optional { font-weight: 400; color: var(--ink-2); }
.hint { color: var(--ink-2); font-size: 13px; margin: 4px 0 0; }

input[type=text], input[type=password], input[type=email], input[type=tel], input[type=number], input[type=date],
input[type=search], input[type=file], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #cfcad8; border-radius: 6px; background: #fff;
  color: var(--ink); font: inherit; font-size: 14.5px; line-height: 1.35; height: 37px;
}
textarea { height: auto; min-height: 76px; resize: vertical; }
input[type=file] { height: auto; padding: 6px 8px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
input[type=number] { font-variant-numeric: tabular-nums; }
input.num { text-align: right; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); vertical-align: -2px; margin: 0 6px 0 0; }
label.check { font-weight: 400; font-size: 14.5px; display: inline-flex; align-items: center; margin: 0; cursor: pointer; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-narrow { max-width: 720px; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 20px; flex-wrap: wrap; }

.filters { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.filters .field { min-width: 130px; }
.filters .field.grow { flex: 1 1 220px; }
.filters label { font-weight: 500; color: var(--ink-2); font-size: 12.5px; margin-bottom: 3px; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; font-size: 14.5px; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }

.period-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.period-pills a { padding: 5px 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); color: var(--ink); text-decoration: none; font-size: 13.5px; }
.period-pills a:hover { border-color: #c9c3d2; }
.period-pills a.active { background: var(--plum); border-color: var(--plum); color: #fff; }

/* definition list used on detail pages */
dl.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 18px; margin: 0; font-size: 14.5px; }
dl.facts dt { color: var(--ink-2); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }

/* ------------------------------------------------------------ sale form */

.sale-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.sale-layout > .stack { min-width: 0; }
.sale-summary { position: sticky; top: 18px; }

.picker { position: relative; }
.picker-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; background: var(--surface);
  border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px rgba(43, 26, 54, 0.16);
  max-height: 280px; overflow-y: auto; padding: 4px;
}
.picker-results button {
  display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 4px;
  font: inherit; cursor: pointer; color: var(--ink);
}
.picker-results button:hover, .picker-results button.active { background: var(--accent-soft); }
.picker-results .sub { display: block; color: var(--ink-2); font-size: 13px; }
.picker-results .none { padding: 8px 10px; color: var(--ink-2); font-size: 14px; }
.chosen { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 10px 12px; background: var(--accent-soft); border-radius: 6px; }
.chosen strong { display: block; }
.chosen .sub { color: var(--ink-2); font-size: 13.5px; }

table.items { width: 100%; border-collapse: collapse; }
table.items th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--ink-2); padding: 0 6px 6px 0; }
table.items td { padding: 0 6px 8px 0; vertical-align: top; }
table.items td:last-child, table.items th:last-child { padding-right: 0; }
table.items .col-qty { width: 84px; }
table.items .col-price { width: 118px; }
table.items .col-total { width: 118px; text-align: right; }
table.items .col-remove { width: 34px; }
table.items td.line-total { text-align: right; padding-top: 8px; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.remove-row { width: 30px; height: 37px; border: 0; background: none; color: var(--ink-3); font-size: 20px; line-height: 1; cursor: pointer; border-radius: 6px; }
.remove-row:hover { background: var(--bad-bg); color: var(--bad); }

.totals { display: grid; grid-template-columns: 1fr auto; gap: 9px 12px; align-items: center; font-size: 14.5px; }
.totals .label { color: var(--ink-2); }
.totals .value { text-align: right; font-variant-numeric: tabular-nums; }
.totals input { width: 126px; text-align: right; }
.totals .grand { font-size: 19px; font-weight: 600; color: var(--ink); padding-top: 9px; border-top: 1px solid var(--line); }
.totals .grand.label { font-size: 15px; }
.totals .due-row { font-weight: 600; }

/* delivery details, laid out like the printed challan: sender left, receiver right */
.challan-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); gap: 0; }
.challan-form fieldset { border: 0; margin: 0; padding: 0 18px 0 0; min-width: 0; }
.challan-form fieldset + fieldset { padding: 0 0 0 18px; border-left: 1.5px solid var(--ink); }
.challan-form legend { padding: 0; margin-bottom: 10px; font-weight: 700; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }
.challan-form .field { margin-bottom: 10px; }
.challan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.challan-grid .full { grid-column: 1 / -1; }

/* --------------------------------------------------------------- charts */

.colchart { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: 220px auto; column-gap: 10px; }
.colchart-y { position: relative; min-width: 34px; font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.colchart-y span { position: absolute; right: 0; transform: translateY(50%); white-space: nowrap; line-height: 1; }
.colchart-y span:last-child { transform: translateY(0); }
.colchart-plot { position: relative; border-bottom: 1px solid #cfcad8; }
.colchart-plot .grid { position: absolute; left: 0; right: 0; height: 1px; background: var(--line-soft); }
.colchart-cols { position: absolute; inset: 0; display: flex; align-items: stretch; }
.colchart .col { flex: 1 1 0; min-width: 0; display: flex; align-items: flex-end; justify-content: center; padding: 0 1px; outline-offset: -2px; }
.colchart .bar { width: 100%; max-width: 24px; background: var(--data); border-radius: 4px 4px 0 0; min-height: 2px; }
.colchart .bar.zero { background: #cfcad8; min-height: 1px; height: 1px !important; border-radius: 0; }
.colchart .col:hover, .colchart .col:focus { background: rgba(42, 120, 214, 0.08); }
.colchart .col:hover .bar, .colchart .col:focus .bar { background: #1c5cab; }
.colchart-x { grid-column: 2; display: flex; padding-top: 6px; font-size: 12px; color: var(--ink-2); }
.colchart-x span { flex: 1 1 0; min-width: 0; text-align: center; white-space: nowrap; overflow: visible; }

.chart-tip {
  position: fixed; z-index: 60; pointer-events: none; background: var(--ink); color: #fff; border-radius: 6px;
  padding: 7px 10px; font-size: 13px; line-height: 1.4; max-width: 240px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}
.chart-tip b { display: block; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.chart-tip span { color: #d6d0de; display: block; }

.barlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.barlist-top { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; align-items: baseline; }
.barlist-label { min-width: 0; overflow-wrap: anywhere; }
.barlist-value { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.barlist-track { margin-top: 4px; height: 8px; }
.barlist-bar { height: 8px; background: var(--data); border-radius: 0 4px 4px 0; }
.barlist-sub { color: var(--ink-2); font-size: 12.5px; margin-top: 2px; }

.meter { height: 8px; background: #cde2fb; border-radius: 4px; overflow: hidden; margin-top: 8px; }
.meter > i { display: block; height: 100%; background: var(--data); }

/* ---------------------------------------------------------------- login */

.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--plum); }
.auth-box { width: 100%; max-width: 400px; background: var(--surface); border-radius: 12px; padding: 30px 30px 28px; }
.auth-box.wide { max-width: 560px; }
.auth-box h1 { font-size: 22px; margin-bottom: 4px; }
.auth-box p.lead { color: var(--ink-2); margin: 0 0 20px; }
.auth-box .field { margin-bottom: 14px; }
.auth-box .btn { width: 100%; padding: 10px 14px; font-size: 15px; }
.auth-box h2 { margin: 22px 0 12px; padding-top: 18px; border-top: 1px solid var(--line); }

/* ----------------------------------------------------------- responsive */

@media (max-width: 1020px) {
  .grid-2, .grid-even, .sale-layout { grid-template-columns: minmax(0, 1fr); }
  .sale-summary { position: static; }
}

@media (max-width: 800px) {
  .app { flex-direction: column; }
  .sidebar { width: auto; flex: none; height: auto; position: static; }
  .brand { padding: 12px 16px; }
  .nav-toggle {
    display: inline-block; margin-left: auto; background: none; color: #fff; border: 1px solid #6b5479;
    border-radius: 6px; padding: 5px 12px; font: inherit; font-size: 14px; cursor: pointer;
  }
  .nav { display: none; padding-top: 0; }
  .nav.open { display: flex; }
  .main { padding: 18px 16px 48px; }
  h1 { font-size: 21px; }
  .form-grid, .form-grid-3 { grid-template-columns: minmax(0, 1fr); }
  .challan-form { grid-template-columns: minmax(0, 1fr); }
  .challan-form fieldset, .challan-form fieldset + fieldset { padding: 0; border-left: 0; }
  .challan-form fieldset + fieldset { margin-top: 12px; padding-top: 14px; border-top: 1.5px solid var(--ink); }
  table.items, table.items tbody, table.items tr, table.items td { display: block; width: auto; }
  table.items thead { display: none; }
  table.items tr { border: 1px solid var(--line); border-radius: 6px; padding: 10px; margin-bottom: 10px; position: relative; }
  table.items td { padding: 0 0 8px; }
  table.items td.line-total { text-align: left; padding: 0; }
  table.items td.line-total::before { content: "Line total: "; font-weight: 400; color: var(--ink-2); }
  table.items td.cell-remove { position: absolute; right: 4px; bottom: 0; padding: 0; }
  table.items td[data-label]::before { content: attr(data-label); display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 3px; }
  .colchart { grid-template-rows: 180px auto; }
}

@media (prefers-reduced-motion: no-preference) {
  .btn, .nav a { transition: background-color 0.12s, border-color 0.12s; }
}

/* ---------------------------------------------- printing a report page */

@media print {
  body { background: #fff; font-size: 11px; }
  .sidebar, .page-actions, .filters, .tabs, .skip-link, .pagination, .chart-tip, .bulk-bar, .check-cell { display: none !important; }
  .main { padding: 0; max-width: none; }
  .card { border: 0; }
  .table-wrap { overflow: visible; }
  table.data { font-size: 11px; }
  table.data th, table.data td { padding: 5px 7px; }
  table.data a { color: inherit; text-decoration: none; }
}
