/* Sweet Shop Management - S.S. Solutions, Guntur
   Design tokens: navy/purple primary, teal secondary, orange accent, light grey background. */
:root {
    --ss-primary: #2d2a6e;
    --ss-primary-dark: #1f1c52;
    --ss-teal: #0f9fa6;
    --ss-accent: #f08a24;
    --ss-bg: #f3f5f9;
    --ss-production: #6a3fb5;
    --ss-branch: #0f9fa6;
    --bs-primary: #2d2a6e;
    --bs-primary-rgb: 45, 42, 110;
    --bs-link-color: #2d2a6e;
    --bs-link-hover-color: #1f1c52;
    --bs-body-bg: #f3f5f9;
    --sidebar-w: 248px;
}

body { background: var(--ss-bg); font-size: .95rem; }
.btn-primary { --bs-btn-bg: var(--ss-primary); --bs-btn-border-color: var(--ss-primary); --bs-btn-hover-bg: var(--ss-primary-dark); --bs-btn-hover-border-color: var(--ss-primary-dark); --bs-btn-active-bg: var(--ss-primary-dark); --bs-btn-disabled-bg: var(--ss-primary); --bs-btn-disabled-border-color: var(--ss-primary); }
.btn-outline-primary { --bs-btn-color: var(--ss-primary); --bs-btn-border-color: var(--ss-primary); --bs-btn-hover-bg: var(--ss-primary); --bs-btn-hover-border-color: var(--ss-primary); --bs-btn-active-bg: var(--ss-primary); }
.btn-accent { background: var(--ss-accent); border-color: var(--ss-accent); color: #fff; }
.btn-accent:hover, .btn-accent:focus { background: #d97510; border-color: #d97510; color: #fff; }
.pagination { --bs-pagination-active-bg: var(--ss-primary); --bs-pagination-active-border-color: var(--ss-primary); --bs-pagination-color: var(--ss-primary); }
.text-bg-primary { background-color: var(--ss-primary) !important; }
.form-control:focus, .form-select:focus { border-color: var(--ss-teal); box-shadow: 0 0 0 .2rem rgba(15, 159, 166, .2); }
.pre-wrap { white-space: pre-wrap; }

/* ---------- shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.app-sidebar { width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); background: var(--ss-primary-dark); color: #cfd0ec; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 1030; }
.app-sidebar .brand { display: flex; align-items: center; gap: .75rem; padding: 1.1rem 1.25rem; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
.app-sidebar .brand i { font-size: 1.8rem; color: var(--ss-accent); }
.brand-name { font-weight: 700; letter-spacing: .02em; }
.brand-sub { font-size: .75rem; opacity: .7; }
.side-nav { padding: .75rem .5rem; flex: 1; }
.side-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; opacity: .55; padding: 1rem .75rem .35rem; }
.side-link { display: flex; align-items: center; gap: .7rem; padding: .55rem .75rem; border-radius: .5rem; color: #d7d8f3; text-decoration: none; }
.side-link i { font-size: 1.1rem; width: 1.25rem; text-align: center; }
.side-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-link.active { background: var(--ss-teal); color: #fff; }
.sidebar-foot { font-size: .72rem; opacity: .5; padding: .75rem 1.25rem; border-top: 1px solid rgba(255,255,255,.08); }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-topbar { display: flex; align-items: center; gap: 1.5rem; padding: .6rem 1.5rem; background: var(--ss-primary); color: #fff; position: sticky; top: 0; z-index: 1020; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.topbar-location { display: flex; align-items: center; gap: .5rem; padding: .35rem .75rem; border-radius: .6rem; background: rgba(255,255,255,.12); border-left: 4px solid var(--ss-branch); }
.topbar-location.is-production { border-left-color: var(--ss-accent); }
.topbar-location i { font-size: 1.2rem; }
.loc-select { min-width: 14rem; font-weight: 600; background-color: rgba(255,255,255,.95); }
.loc-type-badge { background: rgba(255,255,255,.2); font-weight: 500; }
.app-content { padding: 1.5rem; flex: 1; }
.app-footer { padding: .75rem 1.5rem; font-size: .8rem; color: #6c757d; }
.page-title { font-size: 1.45rem; font-weight: 600; color: var(--ss-primary); margin: 0; }

/* production vs branch distinction */
.badge-production { background: var(--ss-production); color: #fff; }
.badge-branch { background: var(--ss-branch); color: #fff; }
.context-banner { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; border-radius: .75rem; color: #fff; }
.context-banner.is-branch { background: linear-gradient(120deg, var(--ss-teal), #0b7e84); }
.context-banner.is-production { background: linear-gradient(120deg, var(--ss-production), var(--ss-primary)); }

/* ---------- cards & stats ---------- */
.card { border: 0; border-radius: .75rem; box-shadow: 0 1px 3px rgba(20, 20, 60, .08); }
.card-header { background: #fff; font-weight: 600; border-bottom: 1px solid #eceef4; }
.stat-card { display: flex; gap: .9rem; align-items: center; background: #fff; border-radius: .75rem; padding: 1rem; box-shadow: 0 1px 3px rgba(20,20,60,.08); height: 100%; }
.stat-icon { width: 3rem; height: 3rem; border-radius: .75rem; display: grid; place-items: center; color: #fff; font-size: 1.35rem; flex: 0 0 3rem; }
.stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: .8rem; color: #6c757d; }
.bg-navy { background: var(--ss-primary); }
.bg-teal { background: var(--ss-teal); }
.bg-accent { background: var(--ss-accent); }
.bg-production { background: var(--ss-production); }

/* ---------- role dashboards ---------- */
.chart-box { position: relative; height: 260px; }
.chart-box-sm { height: 180px; }
.dashboard-tabs .nav-link { color: var(--ss-primary); font-weight: 500; }
.dashboard-tabs .nav-link.active { border-top: 3px solid var(--ss-teal); }
@media (max-width: 575.98px) {
    .chart-box { height: 220px; }
    .stat-card { padding: .75rem; gap: .6rem; }
    .stat-icon { width: 2.4rem; height: 2.4rem; flex-basis: 2.4rem; font-size: 1.1rem; }
    .stat-value { font-size: 1.2rem; }
}

/* ---------- tables & lists ---------- */
.table > thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: #5b5f73; white-space: nowrap; }
.sort-link { color: inherit; text-decoration: none; }
.sort-link:hover { color: var(--ss-primary); }
.filter-bar { background: #f8f9fc; border-radius: .6rem; padding: .75rem; margin-left: 0; margin-right: 0; }
.audit-details code { white-space: pre-wrap; word-break: break-word; font-size: .75rem; }
.logo-preview { max-height: 120px; }
.perm-group .form-check { margin-bottom: .25rem; }

/* busy state for submit buttons (prevents double posting) */
.btn.is-busy { pointer-events: none; opacity: .8; }

/* ---------- auth pages ---------- */
.auth-body { min-height: 100vh; background: linear-gradient(140deg, var(--ss-primary-dark), var(--ss-primary) 55%, var(--ss-teal)); display: flex; align-items: center; justify-content: center; }
.auth-wrap { width: 100%; max-width: 26rem; padding: 1.5rem; }
.auth-wrap.auth-wide { max-width: 56rem; }
.auth-brand { display: flex; align-items: center; gap: .75rem; color: #fff; margin-bottom: 1.25rem; }
.auth-brand i { font-size: 2.2rem; color: var(--ss-accent); }
.auth-card { box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.auth-foot { color: rgba(255,255,255,.7); font-size: .8rem; text-align: center; margin-top: 1rem; }

/* ---------- responsive ---------- */
@media (max-width: 991.98px) {
    .app-sidebar { position: fixed; left: calc(-1 * var(--sidebar-w)); transition: left .2s ease; }
    .app-sidebar.open { left: 0; box-shadow: 4px 0 20px rgba(0,0,0,.3); }
    .app-topbar { gap: .75rem; padding: .5rem .75rem; }
    .app-content { padding: 1rem .75rem; }
    .loc-select { min-width: 9rem; }
}

@media print {
    .app-sidebar, .app-topbar, .app-footer, .filter-bar, .btn, .pagination { display: none !important; }
    .app-content { padding: 0; }
    .card { box-shadow: none; }
}

/* ---------- notification bell ---------- */
.notif .notif-count { font-size: .65rem; }
.notif-menu { width: 22rem; max-width: calc(100vw - 2rem); }
.notif-list { max-height: 60vh; overflow-y: auto; }

/* ---------- backup scripts ---------- */
.script-box { background: #f6f7fb; border: 1px solid #e3e6ef; border-radius: .5rem; padding: .75rem; font-size: .78rem; max-height: 22rem; overflow: auto; white-space: pre; }

/* ---------- billing shortcuts ---------- */
.key-legend kbd { background: #eef0f6; color: #2d2a6e; border: 1px solid #d8dbe6; font-size: .72rem; padding: .05rem .3rem; }

/* Administration > Modules */
.module-row .form-switch .form-check-input { width: 2.6em; height: 1.35em; margin-top: .1em; cursor: pointer; }
.module-row .form-check-label { cursor: pointer; margin-left: .35rem; }
.module-row.is-off { background: #f8f9fa; }
.module-row.is-off .form-check-label { color: #6c757d; }
.modules-save { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; align-items: center; gap: 1rem; margin-top: 1rem; padding: .75rem 1rem;
    background: rgba(255,255,255,.95); border-top: 1px solid #e3e6ef; border-radius: .75rem; box-shadow: 0 -2px 8px rgba(20,20,60,.06); }

/* scan box suggestions (Billing/Index) */
.scan-suggest { position: absolute; left: calc(var(--bs-gutter-x) * .5); right: calc(var(--bs-gutter-x) * .5); top: 100%; z-index: 1050; max-height: 22rem; overflow-y: auto; margin-top: 2px; }
.scan-suggest .list-group-item { display: flex; align-items: baseline; gap: .75rem; padding: .5rem .75rem; cursor: pointer; }
.scan-suggest .list-group-item.active { background: var(--ss-primary); border-color: var(--ss-primary); }
.scan-suggest .s-code { flex: 0 0 auto; min-width: 6.5rem; font-family: var(--bs-font-monospace); font-weight: 600; color: var(--ss-primary); }
.scan-suggest .active .s-code, .scan-suggest .active .s-unit { color: #fff; }
.scan-suggest .s-name { flex: 1; min-width: 0; }
.scan-suggest .s-unit { flex: 0 0 auto; font-size: .8rem; color: #6c757d; }
.scan-suggest mark { padding: 0; background: #ffe69c; color: inherit; }
.scan-suggest .list-group-item.s-empty { color: #6c757d; cursor: default; }

/* direct print (both billing screens): the switch, the off-screen frame that prints, and a note that fades */
.direct-print-toggle { display: flex; align-items: center; gap: .4rem; padding: .35rem .75rem; border: 1px solid #d8dbe6; border-radius: .5rem; background: #fff; white-space: nowrap; }
.direct-print-toggle .form-check-input { float: none; margin: 0; width: 2.6em; height: 1.35em; cursor: pointer; }
.direct-print-toggle .form-check-label { cursor: pointer; font-weight: 500; }
.direct-print-toggle:has(:checked) { border-color: var(--ss-teal); background: #e9f7f7; }
/* Off screen rather than display:none, which some browsers will not print. */
.direct-print-frame { position: fixed; left: -10000px; top: 0; width: 80mm; height: 10px; border: 0; }
.direct-print-note { position: fixed; left: 1rem; bottom: 1rem; z-index: 1060; padding: .5rem .75rem; background: #fff; border: 1px solid #d8dbe6; border-radius: .5rem; box-shadow: 0 4px 12px rgba(0,0,0,.12);
    animation: direct-print-fade .5s ease 6s forwards; }
@keyframes direct-print-fade { to { opacity: 0; visibility: hidden; } }
.tp-direct-print { display: flex; }
.tp-direct-print .direct-print-toggle { min-height: 2.75rem; }

/* ---------- touch billing (Billing/Touch) ---------- */
/* Full screen: no menu, top bar, title row or footer, so the whole window is the bill. The Back button leaves for the dashboard. */
.touch-pos .app-sidebar, .touch-pos .app-topbar { display: none !important; }
.touch-pos .app-footer { display: none; }
.touch-pos .app-content { padding: .5rem; }
.touch-billing { -webkit-user-select: none; user-select: none; touch-action: manipulation; }
.touch-billing input, .touch-billing select { -webkit-user-select: text; user-select: text; }
.tp-btn { min-height: 2.75rem; }

/* Items on the left, the bill on the right; both fill the window height and scroll inside. */
.tp-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(24rem, 36%); gap: .5rem; height: calc(100vh - 1rem); height: calc(100dvh - 1rem); min-height: 32rem; }
.tp-items, .tp-bill { display: flex; flex-direction: column; min-height: 0; background: #fff; border-radius: .75rem; box-shadow: 0 1px 3px rgba(20,20,60,.08); }
.tp-items { padding: .5rem; }

.tp-toolbar { display: flex; gap: .4rem; margin-bottom: .5rem; }
.tp-search { flex: 1; min-width: 0; }
.tp-matches { margin-bottom: .5rem; padding-bottom: .5rem; border-bottom: 1px dashed #d8dbe6; }
/* Groups (categories) in a column on the left, their items beside them. */
.tp-browse { display: flex; gap: .5rem; flex: 1 1 auto; min-height: 0; }
.tp-cats { display: flex; flex-direction: column; gap: .4rem; width: 10.5rem; flex: 0 0 auto; overflow-y: auto; padding: .1rem .3rem .1rem .1rem; border-right: 1px solid #eceef4; scrollbar-width: thin; }
/* Button colours: set per company under Administration > Billing Colors (the page puts them on the form's style); these are the defaults.
   Hover / pressed shades are worked out from each colour. */
.touch-billing { --tb-group: #0a85c2; --tb-group-selected: #065a85; --tb-item: #e8590c; --tb-noprice: #868e96; --tb-qty: #7048e8; --tb-text: #ffffff;
    --tb-group-hover: color-mix(in srgb, var(--tb-group) 85%, #000); --tb-item-hover: color-mix(in srgb, var(--tb-item) 88%, #000);
    --tb-item-dark: color-mix(in srgb, var(--tb-item) 75%, #000);
    --tb-noprice-hover: color-mix(in srgb, var(--tb-noprice) 88%, #000); --tb-noprice-dark: color-mix(in srgb, var(--tb-noprice) 75%, #000); --tb-qty-hover: color-mix(in srgb, var(--tb-qty) 85%, #000);
    --tb-qty-dark: color-mix(in srgb, var(--tb-qty) 68%, #000); --tb-text-soft: color-mix(in srgb, var(--tb-text) 88%, transparent); }
.tp-cat { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: .3rem; min-height: 3.1rem; padding: .35rem .75rem; border: 2px solid var(--tb-group); border-radius: .6rem; background: var(--tb-group); color: var(--tb-text); font-weight: 600; text-align: left; line-height: 1.15; overflow-wrap: anywhere; }
.tp-cat:hover { background: var(--tb-group-hover); border-color: var(--tb-group-hover); color: var(--tb-text); }
.tp-cat.active { background: var(--tb-group-selected); border-color: var(--tb-group-selected); color: var(--tb-text); box-shadow: inset 0 0 0 2px var(--tb-text); }
.tp-cat-count { font-weight: 400; font-size: .75rem; opacity: .85; margin-left: .25rem; }
.tp-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.25rem, 1fr)); gap: .45rem; align-content: start; }
.tp-tiles-main { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: .1rem; }
.tp-no-tiles { grid-column: 1 / -1; }
.tp-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; min-height: 5.75rem; padding: .45rem; border: 0; border-bottom: 3px solid var(--tb-item-dark); border-radius: .6rem; background: var(--tb-item); color: var(--tb-text); text-align: center; line-height: 1.15; transition: transform .05s ease, background .1s ease; }
.tp-tile[hidden] { display: none; }
.tp-tile:hover { background: var(--tb-item-hover); }
.tp-tile:active { transform: scale(.96); background: var(--tb-item-dark); }
.tp-tile.no-price { background: var(--tb-noprice); border-bottom-color: var(--tb-noprice-dark); }
.tp-tile.no-price:hover { background: var(--tb-noprice-hover); }
.tp-tile.no-price:active { background: var(--tb-noprice-dark); }
.tp-tile.is-match { border-bottom-color: var(--ss-accent); min-height: 4.25rem; }
.tp-tile-img { width: 2.75rem; height: 2.75rem; object-fit: cover; border-radius: .4rem; }
.tp-tile-name { font-weight: 600; font-size: .95rem; overflow-wrap: anywhere; }
.tp-tile-local, .tp-tile-sub { font-size: .8rem; color: var(--tb-text-soft); }
.tp-tile-price { font-weight: 700; color: var(--tb-text); }
.tp-tile-price small { font-weight: 400; color: var(--tb-text-soft); }

/* Keypad strip under the tiles: the quantity for the next tap, or the bill line / amount being typed. */
.tp-keypad-strip { display: flex; gap: .5rem; align-items: stretch; padding-top: .5rem; margin-top: .5rem; border-top: 1px solid #eceef4; flex: 0 0 auto; }
.tp-keypad-display { display: flex; flex-direction: column; justify-content: center; width: 8.5rem; flex: 0 0 auto; }
.tp-keypad-display label { line-height: 1.1; margin-bottom: .2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-keypad-display .form-control { font-weight: 700; font-size: 1.15rem; }
.tp-keypad { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); gap: .3rem; }
.tp-keypad .btn { min-height: 2.6rem; font-size: 1.15rem; font-weight: 600; padding: 0; border: 1px solid var(--bs-btn-border-color); }
.tp-keypad-modal { grid-template-columns: repeat(7, 1fr); }
/* Quantity keypad: the Qty colour (Billing Colors); OK a deeper shade of it. */
.tp-keypad .btn, .tp-qty .btn { --bs-btn-bg: var(--tb-qty); --bs-btn-border-color: var(--tb-qty); --bs-btn-color: var(--tb-text);
    --bs-btn-hover-bg: var(--tb-qty-hover); --bs-btn-hover-border-color: var(--tb-qty-hover); --bs-btn-hover-color: var(--tb-text);
    --bs-btn-active-bg: var(--tb-qty-dark); --bs-btn-active-border-color: var(--tb-qty-dark); --bs-btn-active-color: var(--tb-text); }
.tp-keypad .btn.text-danger { color: var(--tb-text) !important; }
.tp-keypad .btn[data-key-press="ok"] { --bs-btn-bg: var(--tb-qty-dark); --bs-btn-border-color: var(--tb-qty-dark); --bs-btn-hover-bg: var(--tb-qty-hover); --bs-btn-hover-border-color: var(--tb-qty-hover); }
/* Administration > Billing Colors: a small copy of the touch screen's buttons. */
.bc-preview .tp-tiles-main { overflow: visible; }
.bc-preview .tp-tile { cursor: default; }
.bc-preview-keypad { flex: 0 1 18rem; grid-template-columns: repeat(5, 1fr); }
.bc-preview-keypad .btn, .bc-preview ~ * .tp-qty .btn { display: flex; align-items: center; justify-content: center; cursor: default; }
.keypad-target { outline: 3px solid var(--ss-accent); outline-offset: 1px; }

/* The bill: header, lines (all the free height), totals, pay buttons. */
.tp-bill { overflow: hidden; }
.tp-bill-head { display: flex; gap: .4rem; padding: .5rem; border-bottom: 1px solid #eceef4; flex: 0 0 auto; }
.tp-customer { max-height: 40vh; overflow-y: auto; }
/* "Served by": the staff picked for the bill, as big buttons (name and designation). */
.tp-staff-toggle { flex: 0 1 34%; min-width: 0; }
.tp-staff { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .4rem; max-height: 40vh; overflow-y: auto; }
.tp-staff-btn { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; text-align: left; line-height: 1.15; overflow: hidden; }
.tp-staff-name { font-weight: 600; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-staff-role { opacity: .8; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-lines-head { display: grid; grid-template-columns: minmax(0, 1fr) 8.6rem 5rem 2rem; gap: .4rem; padding: .3rem .6rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: #5b5f73; background: #f8f9fc; border-bottom: 1px solid #eceef4; flex: 0 0 auto; }
.tp-lines-head span:nth-child(2) { text-align: center; }
.tp-lines-head span:nth-child(3) { text-align: right; }
.tp-lines { flex: 1 1 auto; min-height: 7rem; overflow-y: auto; list-style: none; margin: 0; padding: 0; }
.tp-line { display: grid; grid-template-columns: minmax(0, 1fr) 8.6rem 5rem 2rem; align-items: center; gap: .4rem; padding: .4rem .6rem; border-bottom: 1px solid #f0f1f6; }
.tp-line:nth-child(even) { background: #fbfbfd; }
.tp-line.has-error { background: #fff1f1; }
.tp-line-name { font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.tp-line-no { color: #9aa0b4; font-weight: 400; }
.tp-line-sub { font-size: .8rem; color: #6c757d; display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.tp-unit { width: auto; display: inline-block; }
.tp-qty { display: flex; align-items: stretch; }
.tp-qty .btn { width: 2.5rem; min-height: 2.5rem; padding: 0; font-size: 1.1rem; }
.tp-qty .btn:first-child { border-radius: .5rem 0 0 .5rem; }
.tp-qty .btn:last-child { border-radius: 0 .5rem .5rem 0; }
.tp-qty .form-control { width: 3.6rem; border-radius: 0; font-weight: 600; padding: .2rem; }.tp-line-total { text-align: right; font-weight: 700; }
.tp-line-del { padding: .25rem; font-size: 1.15rem; }
.tp-empty { padding: 2.5rem 1rem; text-align: center; color: #6c757d; }

.tp-totals { padding: .45rem .75rem; border-top: 2px solid #e3e6ef; background: #f8f9fc; font-size: .82rem; flex: 0 0 auto; }
.tp-totals-row { display: flex; justify-content: space-between; gap: .5rem; color: #5b5f73; }
.tp-grand { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; color: var(--ss-primary); font-size: 1.1rem; }
.tp-grand [data-bill-total] { font-size: 1.85rem; line-height: 1.1; }

.tp-pay { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: .4rem; padding: .5rem; border-top: 1px solid #eceef4; flex: 0 0 auto; }
.tp-pay .btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; min-height: 3.6rem; padding: .25rem; line-height: 1.1; font-weight: 600; font-size: .9rem; }
.tp-pay .btn i { font-size: 1.3rem; }
.tp-pay .tp-pay-cash { font-size: 1.05rem; }
.tp-pay .tp-pay-cash i { font-size: 1.6rem; }

/* Payment window: the bill on the left, how it is paid on the right. */
.tp-summary { max-height: 45vh; overflow-y: auto; border: 1px solid #eceef4; border-radius: .5rem; }
.tp-summary thead th { position: sticky; top: 0; background: #fff; }
.tp-pay-modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: .4rem; }

/* Warning toast (stock): stands out, closes itself after 5 seconds. */
.toast-warning { min-width: 22rem; box-shadow: 0 6px 18px rgba(0,0,0,.2); }

@media (max-width: 991.98px) {
    .tp-layout { grid-template-columns: 1fr; height: auto; }
    .tp-tiles-main { max-height: 45vh; }
    .tp-cats { max-height: 45vh; }
    .tp-lines { max-height: 50vh; }
    .tp-keypad { grid-template-columns: repeat(7, 1fr); }
}
@media (max-width: 575.98px) {
    .tp-keypad-strip { flex-direction: column; }
    .tp-cats { width: 7.5rem; }
    .tp-cat { padding: .3rem .5rem; font-size: .9rem; }
    .tp-keypad-display { width: auto; flex-direction: row; align-items: center; gap: .5rem; }
    .tp-pay { grid-template-columns: 1fr 1fr; }
    .tp-line, .tp-lines-head { grid-template-columns: minmax(0, 1fr) 8.6rem 4.5rem 1.75rem; }
}
@media (max-height: 760px) and (min-width: 992px) {
    .tp-keypad .btn { min-height: 2.25rem; }
    .tp-pay .btn { min-height: 3rem; }
    .tp-tile { min-height: 5rem; }
}

/* ---------- MIS reports menu (classic palette) ---------- */
.reports-menu { --rg-paper: #fdfbf5; --rg-rule: #c9a646; --rg-ink: #2b2b2b; --rg-muted: #6b6558; }
.reports-intro { color: var(--rg-muted); font-size: .88rem; border-left: 3px solid var(--rg-rule); padding: .25rem 0 .25rem .75rem; margin-bottom: 1.25rem; }
.report-group { --rg: #3d3d3d; height: 100%; background: var(--rg-paper); border: 1px solid #e3dccb; border-top: 4px solid var(--rg); border-radius: .4rem; box-shadow: 0 1px 3px rgba(60, 50, 30, .08); overflow: hidden; }
.report-group-head { display: flex; align-items: center; gap: .6rem; padding: .7rem 1rem; background: var(--rg); color: #fff; border-bottom: 2px solid var(--rg-rule); }
.report-group-head i { font-size: 1.15rem; opacity: .9; }
.report-group-head h2 { flex: 1; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.08rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.report-count { min-width: 1.6rem; padding: .05rem .45rem; border-radius: 1rem; background: rgba(255, 255, 255, .18); font-size: .78rem; text-align: center; }
.report-link { display: flex; align-items: center; gap: .75rem; padding: .65rem 1rem; color: var(--rg-ink); text-decoration: none; border-bottom: 1px dotted #ddd3bd; border-left: 3px solid transparent; transition: background .15s, border-color .15s; }
.report-link:last-child { border-bottom: 0; }
.report-link:hover, .report-link:focus-visible { background: color-mix(in srgb, var(--rg) 7%, var(--rg-paper)); border-left-color: var(--rg); color: var(--rg-ink); }
.report-link-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.report-title { font-family: Georgia, "Times New Roman", serif; font-weight: 600; color: var(--rg); }
.report-desc { font-size: .8rem; color: var(--rg-muted); }
.report-link > .bi-chevron-right { color: var(--rg-rule); transition: transform .15s; }
.report-link:hover > .bi-chevron-right { transform: translateX(3px); color: var(--rg); }
.rg-navy { --rg: #1f3a5f; }
.rg-green { --rg: #2e5e3e; }
.rg-burgundy { --rg: #7a1f2b; }
.rg-bronze { --rg: #7a5230; }
.rg-slate { --rg: #2f5d62; }
.rg-gold { --rg: #8a6a12; }
.rg-plum { --rg: #4b2e5c; }
.rg-charcoal { --rg: #3d3d3d; }

/* ---------- split sign-in page ---------- */
.auth-split-body { min-height: 100vh; background: #fff; }
.auth-split { display: flex; min-height: 100vh; }
/* Login hero: the background is matched to the red backdrop of images/login-sweets.jpg (sampled: top #e10231,
   lower left #fa517a, right #be042a), and the photo's edges fade into it so the bowl sits on one continuous red. */
.auth-hero { flex: 1 1 56%; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 1rem; padding: 2.5rem 3rem; color: #fff;
    background-color: #e3062f;
    background-image: radial-gradient(ellipse 60% 55% at 0% 100%, rgba(250,81,122,.85), transparent 70%),
                      radial-gradient(ellipse 45% 70% at 100% 70%, rgba(184,3,40,.75), transparent 70%),
                      linear-gradient(180deg, #e1022f 0%, #e60838 55%, #ee1446 100%); }
.auth-hero > * { position: relative; }
.auth-hero-brand { display: flex; align-items: center; gap: .6rem; font-weight: 600; font-size: 1.05rem; letter-spacing: .02em; }
.auth-hero-brand i { color: #ffd28a; font-size: 1.6rem; }
.auth-hero-photo { margin: 0 auto; width: min(100%, 38rem, 78vh); }
.auth-hero-img { display: block; width: 100%; height: auto; aspect-ratio: 1535 / 1024;
    -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 62%, transparent 100%);
            mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 62%, transparent 100%); }
.auth-hero-copy { max-width: 32rem; }
.auth-hero-copy h2 { font-size: clamp(1.5rem, 2.4vw, 2.1rem); font-weight: 700; line-height: 1.2; margin-bottom: .6rem; text-shadow: 0 2px 12px rgba(120,0,20,.35); }
.auth-hero-copy p { color: rgba(255,255,255,.92); margin-bottom: 1rem; }
.auth-hero-chips { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 0; }
.auth-hero-chips li { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .8rem; border-radius: 999px; background: rgba(120,0,25,.22); border: 1px solid rgba(255,255,255,.28); font-size: .85rem; }
.auth-hero-chips i { color: #ffd28a; }

/* Login hero animation (CSS only). Positions are percentages of the photo, on the jamuns' highlights and the top of the pile. */
.auth-hero-photo { position: relative; animation: auth-photo-in 1s cubic-bezier(.2,.8,.2,1) both, auth-bob 6s ease-in-out 1s infinite; }
.auth-hero-brand { animation: auth-rise .7s ease-out .1s both; }
.auth-hero-copy { animation: auth-rise .8s ease-out .35s both; }
.auth-hero-chips li { animation: auth-rise .6s ease-out both; }
.auth-hero-chips li:nth-child(1) { animation-delay: .7s; }
.auth-hero-chips li:nth-child(2) { animation-delay: .85s; }
.auth-hero-chips li:nth-child(3) { animation-delay: 1s; }

/* A band of light passing over the syrup-glazed jamuns now and then. */
.auth-shine { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light;
    background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,.75) 50%, transparent 62%) no-repeat;
    background-size: 250% 100%; background-position: 160% 0; animation: auth-shine 7s ease-in-out 1.6s infinite;
    -webkit-mask-image: radial-gradient(ellipse 34% 30% at 50% 36%, #000 55%, transparent 100%);
            mask-image: radial-gradient(ellipse 34% 30% at 50% 36%, #000 55%, transparent 100%); }

/* Sugar-syrup glints that twinkle on the jamuns. */
.auth-glints { position: absolute; inset: 0; pointer-events: none; }
.auth-glints > span { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; opacity: 0;
    background: radial-gradient(circle, #fff 0 9%, rgba(255,244,214,.85) 14%, rgba(255,230,170,0) 34%),
                linear-gradient(0deg, transparent 47.5%, #fff 50%, transparent 52.5%),
                linear-gradient(90deg, transparent 47.5%, #fff 50%, transparent 52.5%);
    filter: drop-shadow(0 0 3px #fff) drop-shadow(0 0 7px rgba(255,214,140,.95));
    animation: auth-glint 3s ease-in-out infinite; }
/* The shorter diagonal rays of the star. */
.auth-glints > span::after { content: ""; position: absolute; inset: 22%; transform: rotate(45deg);
    background: linear-gradient(0deg, transparent 46%, rgba(255,255,255,.9) 50%, transparent 54%),
                linear-gradient(90deg, transparent 46%, rgba(255,255,255,.9) 50%, transparent 54%); }
.auth-glints > span:nth-child(1)  { left: 48%;   top: 18.5%; animation-delay: .9s; }
.auth-glints > span:nth-child(2)  { left: 38%;   top: 31%;   animation-delay: 1.5s; }
.auth-glints > span:nth-child(3)  { left: 47%;   top: 38%;   animation-delay: 2.1s; }
.auth-glints > span:nth-child(4)  { left: 68%;   top: 37%;   animation-delay: 1.2s; }
.auth-glints > span:nth-child(5)  { left: 29%;   top: 38%;   animation-delay: 2.7s; }
.auth-glints > span:nth-child(6)  { left: 57.5%; top: 34%;   animation-delay: 1.8s; }
.auth-glints > span:nth-child(7)  { left: 52%;   top: 17.5%;  animation-delay: 2.4s; width: 22px; height: 22px; margin: -11px 0 0 -11px; }
.auth-glints > span:nth-child(8)  { left: 61%;   top: 30%;  animation-delay: 3.3s; width: 22px; height: 22px; margin: -11px 0 0 -11px; }
.auth-glints > span:nth-child(9)  { left: 41%;   top: 50%;   animation-delay: 3s;   width: 22px; height: 22px; margin: -11px 0 0 -11px; }
.auth-glints > span:nth-child(10) { left: 71%;   top: 35.5%;  animation-delay: .6s;  width: 22px; height: 22px; margin: -11px 0 0 -11px; }

/* Warm steam rising from the top of the pile. */
.auth-steam { position: absolute; left: 36%; top: 30%; width: 28%; height: 0; pointer-events: none; }
.auth-steam > span { position: absolute; bottom: 0; width: 3.4rem; height: 9rem; border-radius: 50%; opacity: 0; filter: blur(6px);
    background: radial-gradient(ellipse at 50% 60%, rgba(255,255,255,.95) 0%, rgba(255,255,255,.55) 35%, rgba(255,255,255,0) 72%);
    animation: auth-steam 5s ease-in infinite; }
.auth-steam > span:nth-child(1) { left: 2%; animation-delay: .6s; }
.auth-steam > span:nth-child(2) { left: 26%; animation-delay: 1.6s; }
.auth-steam > span:nth-child(3) { left: 48%; animation-delay: 2.6s; }
.auth-steam > span:nth-child(4) { left: 68%; animation-delay: 3.6s; }
.auth-steam > span:nth-child(5) { left: 36%; animation-delay: 4.6s; width: 4rem; }

@keyframes auth-photo-in { from { opacity: 0; scale: .9; translate: 0 18px; } to { opacity: 1; scale: 1; translate: 0 0; } }
@keyframes auth-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@keyframes auth-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes auth-shine { 0%, 55% { background-position: 160% 0; } 85%, 100% { background-position: -60% 0; } }
/* Twinkle twice: flash, dip, flash again, then rest. */
@keyframes auth-glint { 0%, 50%, 100% { opacity: 0; transform: scale(.15) rotate(0deg); }
                        60% { opacity: 1; transform: scale(1.2) rotate(30deg); }
                        67% { opacity: .45; transform: scale(.65) rotate(50deg); }
                        75% { opacity: 1; transform: scale(1.05) rotate(70deg); }
                        88% { opacity: 0; transform: scale(.25) rotate(110deg); } }
@keyframes auth-steam { 0% { opacity: 0; transform: translateY(16px) scaleX(.55); }
                        20% { opacity: .9; }
                        55% { opacity: .75; transform: translateY(-70px) scaleX(1.05) skewX(10deg); }
                        100% { opacity: 0; transform: translateY(-130px) scaleX(1.6) skewX(-8deg); } }
@media (prefers-reduced-motion: reduce) {
    .auth-hero-photo, .auth-hero-brand, .auth-hero-copy, .auth-hero-chips li { animation: none; }
    .auth-shine, .auth-glints, .auth-steam { display: none; }
}

.auth-panel { flex: 1 1 44%; max-width: 34rem; display: flex; flex-direction: column; justify-content: center; padding: 2.5rem 3rem 1.5rem; background: #fff; }
.auth-panel-inner { width: 100%; max-width: 23rem; margin: auto; }
.auth-panel-brand { display: flex; align-items: center; gap: .75rem; margin-bottom: 2.25rem; }
.auth-panel-brand .brand-name { font-weight: 700; color: var(--ss-primary); }
.auth-panel-brand .brand-sub { font-size: .8rem; color: #6c757d; }
.auth-logo { display: inline-grid; place-items: center; width: 2.9rem; height: 2.9rem; border-radius: .9rem; color: #fff; font-size: 1.4rem;
    background: linear-gradient(135deg, var(--ss-accent), #e0571b); box-shadow: 0 6px 16px rgba(240,138,36,.35); }
.auth-title { font-size: 1.75rem; font-weight: 700; color: var(--ss-primary); margin-bottom: .25rem; }
.auth-lead { color: #6c757d; margin-bottom: 1.75rem; }
.auth-split .form-label { font-weight: 500; font-size: .875rem; color: #3b3d55; }
.auth-field { position: relative; }
.auth-field > .bi { position: absolute; left: .95rem; top: 50%; transform: translateY(-50%); color: #8a8fa8; pointer-events: none; }
.auth-field .form-control { padding-left: 2.6rem; border-radius: .7rem; background: #f7f8fb; border-color: #e1e4ee; font-size: 1rem; }
.auth-field .form-control:focus { background: #fff; }
.auth-field .form-control.input-validation-error { border-color: var(--bs-danger); }
.auth-eye { position: absolute; right: .4rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: #8a8fa8; padding: .35rem .55rem; border-radius: .5rem; }
.auth-eye:hover, .auth-eye:focus-visible { color: var(--ss-primary); background: #eef0f6; }
.auth-field:has(.auth-eye) .form-control { padding-right: 2.8rem; }
.auth-submit { border-radius: .7rem; font-weight: 600; box-shadow: 0 8px 20px rgba(240,138,36,.3); }
.auth-submit:hover { background: #dd7a17; border-color: #dd7a17; color: #fff; }
.auth-panel-foot { text-align: center; color: #9aa0b4; font-size: .78rem; margin-top: 2rem; }

@media (max-width: 991.98px) {
    .auth-split { flex-direction: column; }
    .auth-hero { flex: none; padding: 1.25rem 1rem; flex-direction: row; align-items: center; justify-content: center; }
    .auth-hero-photo { width: auto; margin: 0; animation: auth-photo-in .8s cubic-bezier(.2,.8,.2,1) both; }
    .auth-shine, .auth-glints, .auth-steam { display: none; }
    .auth-hero-img { width: 5.5rem; height: 5.5rem; object-fit: cover; border-radius: 50%; border: 3px solid rgba(255,255,255,.9); -webkit-mask-image: none; mask-image: none; }
    .auth-hero-copy, .auth-hero-brand { display: none; }
    .auth-panel { flex: 1; max-width: none; min-width: 0; width: 100%; padding: 2rem 1rem 1.25rem; }
}

/* Billing: an amount waiting for the live recalculation (billing-live.js) while a quantity is being typed. */
.live-stale { opacity: .45; transition: opacity .15s; }
