/* ==========================================================================
   Shrimant Retail - application styles (on top of Bootstrap 5.3)
   Bootstrap 5 colour palette, a dark sidebar with colour-coded modules,
   soft "tone" chips for icons, compact tables and readable numbers.
   ========================================================================== */

:root {
	--app-bg: #f3f5f9;
	--surface: #ffffff;
	--surface-2: #f8f9fc;
	--border: #e3e7ee;
	--border-strong: #cfd6e1;
	--text: #1d2433;
	--text-2: #3a4356;
	--muted: #6b7385;
	--brand: #0d6efd;
	--brand-600: #0b5ed7;
	--brand-700: #0a58ca;
	--brand-50: #eef5ff;
	--brand-100: #cfe2ff;
	--success: #198754;
	--success-bg: #d1e7dd;
	--warning: #997404;
	--warning-bg: #fff3cd;
	--danger: #dc3545;
	--danger-bg: #f8d7da;
	--info: #087990;
	--info-bg: #cff4fc;
	--neutral-bg: #eef1f6;
	--sidebar-w: 256px;
	--topbar-h: 60px;
	--radius: 14px;
	--radius-sm: 9px;
	--shadow-sm: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .04);
	--shadow-md: 0 10px 28px -10px rgba(16, 24, 40, .22);
	--sidebar-bg: #0f1b3d;

	--bs-body-color: var(--text);
	--bs-body-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
	--bs-body-font-size: .9375rem;
	--bs-border-color: var(--border);
	--bs-border-radius: var(--radius-sm);
}

/* ---------------------------------------------------------------- tones
   A tone sets colour variables that chips, cards, buttons and nav icons use:
   <span class="ic tone-success"><i class="bi bi-cash"></i></span>           */
.tone-primary   { --tone: #0d6efd; --tone-rgb: 13, 110, 253;  --tone-light: #6ea8fe; --tone-bg: #e7f1ff; --tone-text: #0a58ca; --tone-on: #fff; }
.tone-success   { --tone: #198754; --tone-rgb: 25, 135, 84;   --tone-light: #75b798; --tone-bg: #e3f4ea; --tone-text: #146c43; --tone-on: #fff; }
.tone-danger    { --tone: #dc3545; --tone-rgb: 220, 53, 69;   --tone-light: #ea868f; --tone-bg: #fce8ea; --tone-text: #b02a37; --tone-on: #fff; }
.tone-warning   { --tone: #ffc107; --tone-rgb: 255, 193, 7;   --tone-light: #ffda6a; --tone-bg: #fff4d6; --tone-text: #946c00; --tone-on: #3d2e00; }
.tone-info      { --tone: #0dcaf0; --tone-rgb: 13, 202, 240;  --tone-light: #6edff6; --tone-bg: #dcf7fd; --tone-text: #087990; --tone-on: #053b47; }
.tone-indigo    { --tone: #6610f2; --tone-rgb: 102, 16, 242;  --tone-light: #a370f7; --tone-bg: #efe6fe; --tone-text: #520dc2; --tone-on: #fff; }
.tone-purple    { --tone: #6f42c1; --tone-rgb: 111, 66, 193;  --tone-light: #a98eda; --tone-bg: #f0eafa; --tone-text: #59359a; --tone-on: #fff; }
.tone-pink      { --tone: #d63384; --tone-rgb: 214, 51, 132;  --tone-light: #e685b5; --tone-bg: #fbe7f1; --tone-text: #ab296a; --tone-on: #fff; }
.tone-orange    { --tone: #fd7e14; --tone-rgb: 253, 126, 20;  --tone-light: #feb272; --tone-bg: #ffeedf; --tone-text: #b35600; --tone-on: #fff; }
.tone-teal      { --tone: #20c997; --tone-rgb: 32, 201, 151;  --tone-light: #79dfc1; --tone-bg: #dff7ef; --tone-text: #13795b; --tone-on: #fff; }
.tone-secondary { --tone: #6c757d; --tone-rgb: 108, 117, 125; --tone-light: #adb5bd; --tone-bg: #eceff2; --tone-text: #495057; --tone-on: #fff; }
.tone-dark      { --tone: #343a40; --tone-rgb: 52, 58, 64;    --tone-light: #ced4da; --tone-bg: #e6e9ed; --tone-text: #212529; --tone-on: #fff; }

/* Icon chip */
.ic {
	--ic-size: 2.5rem;
	width: var(--ic-size); height: var(--ic-size); flex-shrink: 0;
	display: inline-flex; align-items: center; justify-content: center;
	border-radius: 12px; font-size: calc(var(--ic-size) * .46); line-height: 1;
	background: var(--tone-bg, var(--neutral-bg)); color: var(--tone-text, var(--text-2));
}
.ic-xs { --ic-size: 1.5rem; border-radius: 7px; }
.ic-sm { --ic-size: 1.9rem; border-radius: 9px; }
.ic-lg { --ic-size: 3.1rem; border-radius: 15px; }
.ic-solid {
	background: var(--tone);
	color: var(--tone-on, #fff);
	box-shadow: 0 8px 16px -8px rgba(var(--tone-rgb), .75);
}
.text-tone { color: var(--tone-text) !important; }

html { -webkit-text-size-adjust: 100%; }
body { background: var(--app-bg); color: var(--text); min-height: 100vh; }
a { text-decoration: none; }
a:hover { text-decoration: underline; }
.btn:hover, .nav-link:hover, .dropdown-item:hover, .page-link:hover, .list-group-item-action:hover, .kpi:hover, .qa:hover { text-decoration: none; }
.num, .table td.num, .kpi-value { font-variant-numeric: tabular-nums; }
.text-muted { color: var(--muted) !important; }
.small-label { font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.fw-medium { font-weight: 500; }
.min-w-0 { min-width: 0; }
.cursor-pointer { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------------------------------------------------------------- buttons */
.btn { --bs-btn-font-weight: 500; --bs-btn-padding-x: .9rem; --bs-btn-font-size: .9rem; border-radius: var(--radius-sm); }
.btn-sm { --bs-btn-padding-x: .6rem; --bs-btn-font-size: .8125rem; border-radius: 7px; }
.btn-lg { --bs-btn-font-size: 1rem; --bs-btn-padding-y: .65rem; border-radius: 11px; }
.btn-primary, .btn-success, .btn-danger, .btn-warning, .btn-info, .btn-dark { box-shadow: 0 1px 2px rgba(16, 24, 40, .08); }
.btn-primary:not(:disabled):hover { box-shadow: 0 6px 14px -6px rgba(13, 110, 253, .7); }
.btn-success:not(:disabled):hover { box-shadow: 0 6px 14px -6px rgba(25, 135, 84, .7); }
.btn-danger:not(:disabled):hover { box-shadow: 0 6px 14px -6px rgba(220, 53, 69, .7); }
.btn-light { --bs-btn-bg: var(--surface); --bs-btn-border-color: var(--border-strong); --bs-btn-color: var(--text-2); --bs-btn-hover-bg: var(--surface-2); --bs-btn-hover-border-color: #b9c2d0; --bs-btn-active-bg: var(--neutral-bg); }
.btn-ghost { --bs-btn-color: var(--text-2); --bs-btn-hover-bg: var(--neutral-bg); --bs-btn-active-bg: var(--border); border: 0; }
.btn-whatsapp { --bs-btn-bg: #25a244; --bs-btn-border-color: #25a244; --bs-btn-color: #fff; --bs-btn-hover-bg: #1e8a39; --bs-btn-hover-border-color: #1e8a39; --bs-btn-hover-color: #fff; --bs-btn-active-bg: #187230; --bs-btn-active-color: #fff; --bs-btn-disabled-bg: #25a244; --bs-btn-disabled-border-color: #25a244; }
/* Soft button in any tone: <a class="btn btn-soft tone-success"> */
.btn-soft {
	--bs-btn-bg: var(--tone-bg); --bs-btn-color: var(--tone-text); --bs-btn-border-color: transparent;
	--bs-btn-hover-bg: rgba(var(--tone-rgb), .2); --bs-btn-hover-color: var(--tone-text); --bs-btn-hover-border-color: transparent;
	--bs-btn-active-bg: rgba(var(--tone-rgb), .28); --bs-btn-active-color: var(--tone-text); --bs-btn-active-border-color: transparent;
	--bs-btn-disabled-bg: var(--tone-bg); --bs-btn-disabled-color: var(--tone-text); --bs-btn-disabled-border-color: transparent;
}
.btn-icon { width: 2.25rem; height: 2.25rem; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.btn-icon.btn-sm { width: 1.9rem; height: 1.9rem; }

/* ---------------------------------------------------------------- forms */
.form-control, .form-select { border-color: var(--border-strong); border-radius: var(--radius-sm); font-size: .9375rem; }
.form-control:focus, .form-select:focus { border-color: #86b7fe; box-shadow: 0 0 0 .22rem rgba(13, 110, 253, .14); }
.form-control-sm, .form-select-sm { font-size: .8125rem; border-radius: 7px; }
.form-label { font-weight: 600; font-size: .85rem; color: var(--text-2); margin-bottom: .3rem; }
.form-text { color: var(--muted); font-size: .8rem; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .15); border-color: #86b7fe; }
.form-switch .form-check-input:checked { background-color: #198754; border-color: #198754; }
.required::after { content: " *"; color: var(--danger); }
.input-group-text { background: var(--surface-2); border-color: var(--border-strong); color: var(--muted); }
.form-section { padding: 1.25rem 1.35rem; border-bottom: 1px solid var(--border); }
.form-section:last-child { border-bottom: 0; }
.form-section-title { display: flex; align-items: center; gap: .6rem; font-size: 1rem; font-weight: 650; margin: 0 0 .3rem; }
.form-section-title > .ic { --ic-size: 1.9rem; border-radius: 9px; font-size: .95rem; }
.form-section-desc { color: var(--muted); font-size: .825rem; margin-bottom: 1rem; }
.invalid-feedback { font-size: .8rem; }
/* Magnifier inside search fields */
input[type="search"].form-control, .form-control.has-search-icon {
	padding-left: 2.3rem;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%237a8396' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001q.044.06.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0'/%3E%3C/svg%3E");
	background-repeat: no-repeat; background-position: .8rem center; background-size: 14px;
}
.form-control-lg.has-search-icon { padding-left: 2.6rem; background-position: .95rem center; background-size: 16px; }

/* ---------------------------------------------------------------- layout: sidebar */
/* Bootstrap makes .offcanvas-lg transparent (!important) on wide screens; this beats it. */
.app-sidebar.offcanvas-lg { background-color: var(--sidebar-bg) !important; }
.app-sidebar {
	width: var(--sidebar-w);
	color: #c9d3e6;
}
@media (min-width: 992px) {
	.app-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 1030; display: flex; flex-direction: column; }
	.app-main { margin-left: var(--sidebar-w); }
}
@media (max-width: 991.98px) {
	.app-sidebar.offcanvas-lg { --bs-offcanvas-width: 280px; }
}
.app-sidebar .offcanvas-body { display: flex; flex-direction: column; padding: 0; overflow: hidden; height: 100%; }
.sidebar-brand { display: flex; align-items: center; gap: .7rem; min-height: var(--topbar-h); padding: .6rem 1.1rem; border-bottom: 1px solid rgba(255, 255, 255, .08); flex-shrink: 0; color: #fff; }
.brand-link { display: flex; align-items: center; gap: .7rem; min-width: 0; color: #fff; }
.brand-link:hover { text-decoration: none; color: #fff; }
.sidebar-brand .brand-plate { background: #fff; border-radius: 10px; padding: 4px 10px; display: inline-flex; align-items: center; max-width: 196px; box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .5); }
.sidebar-brand img.brand-logo { max-height: 36px; max-width: 176px; object-fit: contain; object-position: left center; }
.sidebar-brand .brand-mark { width: 36px; height: 36px; border-radius: 11px; background: #0d6efd; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.sidebar-brand .brand-name { font-weight: 650; font-size: .95rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-brand .brand-sub { display: block; font-size: .7rem; font-weight: 500; color: #8f9bb8; }
/* Only the menu scrolls; the logo and the user card stay in place. */
.sidebar-nav { padding: .45rem .7rem 1rem; flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .18) transparent; }
.nav-group-label { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: #7d8bad; padding: .9rem .6rem .35rem; }
.sidebar-nav .nav-link {
	display: flex; align-items: center; gap: .7rem;
	color: #c9d3e6; font-size: .885rem; font-weight: 500;
	padding: .34rem .5rem; border-radius: 10px; margin-bottom: 2px;
	transition: background-color .15s ease, color .15s ease;
}
.sidebar-nav .nav-ic {
	width: 1.9rem; height: 1.9rem; border-radius: 9px; flex-shrink: 0;
	display: inline-flex; align-items: center; justify-content: center; font-size: 1rem;
	background: rgba(var(--tone-rgb), .17); color: var(--tone-light);
	transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.sidebar-nav .nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar-nav .nav-link.active { background: rgba(255, 255, 255, .11); color: #fff; box-shadow: inset 3px 0 0 var(--tone-light); }
.sidebar-nav .nav-link.active .nav-ic { background: var(--tone); color: var(--tone-on); box-shadow: 0 6px 14px -6px rgba(var(--tone-rgb), .95); }
.sidebar-nav .nav-link .badge { margin-left: auto; }
.sidebar-foot { display: flex; align-items: center; gap: .5rem; padding: .7rem .8rem; border-top: 1px solid rgba(255, 255, 255, .08); font-size: .76rem; color: #8f9bb8; flex-shrink: 0; }
.sidebar-user { display: flex; align-items: center; gap: .6rem; min-width: 0; padding: .3rem .4rem; border-radius: 10px; color: #8f9bb8; }
.sidebar-user:hover { background: rgba(255, 255, 255, .07); color: #c9d3e6; text-decoration: none; }
.sidebar-foot strong { color: #fff; font-weight: 600; display: block; font-size: .82rem; }
.sidebar-foot .avatar { width: 34px; height: 34px; font-size: .8rem; }
.sidebar-icon-btn { width: 34px; height: 34px; border-radius: 10px; border: 0; background: rgba(255, 255, 255, .08); color: #c9d3e6; display: inline-flex; align-items: center; justify-content: center; transition: background-color .15s, color .15s; }
.sidebar-icon-btn:hover { background: #dc3545; color: #fff; }

/* ---------------------------------------------------------------- layout: topbar */
.app-topbar {
	position: sticky; top: 0; z-index: 1020;
	height: var(--topbar-h);
	background: rgba(255, 255, 255, .9);
	backdrop-filter: saturate(180%) blur(10px);
	border-bottom: 1px solid var(--border);
	display: flex; align-items: center; gap: .6rem;
	padding: 0 1.25rem;
}
.topbar-title { display: flex; align-items: center; gap: .6rem; font-weight: 650; font-size: 1rem; min-width: 0; }
.topbar-title .ic { --ic-size: 2rem; border-radius: 10px; font-size: .95rem; }
.topbar-title .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .45rem; }
.notif-dot { position: absolute; top: 3px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: .65rem; font-weight: 700; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px #fff; }
.user-chip { display: inline-flex; align-items: center; gap: .5rem; padding: .22rem .6rem .22rem .22rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: .85rem; font-weight: 500; }
.user-chip:hover { border-color: var(--border-strong); background: var(--surface-2); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #0d6efd; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .74rem; flex-shrink: 0; }

.app-content { padding: 1.4rem 1.5rem 2rem; max-width: 1480px; margin: 0 auto; }
@media (max-width: 575.98px) {
	.app-content { padding: 1rem 1rem 1.5rem; }
	.app-topbar { padding: 0 .5rem 0 .6rem; gap: .4rem; }
	.topbar-title .ic { display: none; }
}

/* ---------------------------------------------------------------- page header */
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem; margin-bottom: 1.25rem; }
.page-head > .page-icon { --ic-size: 3rem; border-radius: 15px; font-size: 1.35rem; box-shadow: inset 0 0 0 1px rgba(var(--tone-rgb), .14); }
.page-head > .page-icon + div { flex: 1 1 240px; min-width: 0; }
.page-head h1 { font-size: 1.4rem; font-weight: 700; margin: 0; letter-spacing: -.015em; color: var(--text); }
.page-head .page-sub { color: var(--muted); font-size: .86rem; margin-top: .2rem; }
.page-head .page-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: .5rem; }
.breadcrumb { font-size: .8rem; margin-bottom: .4rem; --bs-breadcrumb-divider-color: #98a2b3; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand); }
@media (max-width: 575.98px) {
	.page-head { gap: .7rem; }
	.page-head > .page-icon { --ic-size: 2.5rem; border-radius: 12px; font-size: 1.1rem; }
	.page-head h1 { font-size: 1.2rem; }
	.page-head .page-actions { margin-left: 0; width: 100%; }
}

/* ---------------------------------------------------------------- cards */
.card { --bs-card-border-color: var(--border); --bs-card-border-radius: var(--radius); --bs-card-inner-border-radius: calc(var(--radius) - 1px); --bs-card-cap-bg: transparent; box-shadow: var(--shadow-sm); }
.card-header { padding: .85rem 1.15rem; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; border-bottom-color: var(--border); }
.card-header:has(> .filter-bar) { background: var(--surface-2); }
.card-title { font-size: .98rem; font-weight: 650; margin: 0; display: inline-flex; align-items: center; gap: .6rem; }
.card-title > .ic { --ic-size: 1.9rem; border-radius: 9px; font-size: .92rem; }
.card-header .card-actions { margin-left: auto; display: flex; gap: .4rem; align-items: center; }
.card-header .card-actions > a:not(.btn) { font-size: .82rem; font-weight: 600; }
.card-body { padding: 1.15rem; }
.card-footer { background: var(--surface-2); padding: .75rem 1.15rem; border-top-color: var(--border); }
.card-tone { border-top: 3px solid var(--tone); }

/* ---------------------------------------------------------------- KPI tiles */
.kpi {
	position: relative; overflow: hidden; display: block; height: 100%;
	padding: 1rem 1.1rem 1.05rem; background: var(--surface);
	border: 1px solid var(--border); border-radius: var(--radius);
	box-shadow: var(--shadow-sm); color: inherit;
	transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.kpi[class*="tone-"] { box-shadow: var(--shadow-sm), inset 0 -3px 0 var(--tone); }
.kpi[class*="tone-"]::after { content: ""; position: absolute; width: 120px; height: 120px; right: -42px; top: -42px; border-radius: 50%; background: rgba(var(--tone-rgb), .08); pointer-events: none; }
a.kpi:hover { color: inherit; transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
a.kpi[class*="tone-"]:hover { box-shadow: var(--shadow-md), inset 0 -3px 0 var(--tone); border-color: rgba(var(--tone-rgb), .4); }
.kpi-top { display: flex; align-items: center; gap: .65rem; position: relative; z-index: 1; }
.kpi-label { font-size: .8rem; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: .4rem; }
.kpi-value { font-size: 1.5rem; font-weight: 700; margin-top: .6rem; line-height: 1.2; letter-spacing: -.015em; color: var(--text); position: relative; z-index: 1; }
.kpi-meta { font-size: .78rem; color: var(--muted); margin-top: .4rem; position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .45rem; }
.kpi-sm { padding: .85rem .95rem .9rem; }
.kpi-sm .kpi-value { font-size: 1.15rem; margin-top: .45rem; }
.trend { font-size: .74rem; font-weight: 650; display: inline-flex; align-items: center; padding: .05rem .45rem .05rem .2rem; border-radius: 999px; white-space: nowrap; }
.trend-up { color: #146c43; background: #e3f4ea; }
.trend-down { color: #b02a37; background: #fce8ea; }
.trend-flat { color: var(--muted); background: var(--neutral-bg); padding-left: .45rem; }

/* Small tiles; the view sets --cols so the rows come out even (4+4, 3+3...). */
.kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
@media (min-width: 768px) { .kpi-grid { grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .kpi-grid { gap: .7rem; } .kpi-value { font-size: 1.25rem; } }

/* ---------------------------------------------------------------- dashboard hero */
.hero {
	position: relative; overflow: hidden; border-radius: 18px; padding: 1.4rem 1.5rem 1.3rem; margin-bottom: 1.25rem; color: #fff;
	background: #0d6efd;
	box-shadow: 0 10px 24px -16px rgba(13, 110, 253, .8);
}
.hero h1 { font-size: 1.55rem; font-weight: 700; margin: 0; letter-spacing: -.015em; }
.hero .hero-sub { color: rgba(255, 255, 255, .86); font-size: .9rem; margin-top: .3rem; }
.hero-chip { display: inline-flex; align-items: center; gap: .4rem; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .2); border-radius: 999px; padding: .22rem .75rem; font-size: .8rem; font-weight: 600; }
.period-pills { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.period-pills a, .period-pills button { padding: .3rem .8rem; border-radius: 999px; font-size: .8rem; font-weight: 600; color: rgba(255, 255, 255, .92); background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); line-height: 1.4; }
.period-pills a:hover, .period-pills button:hover { background: rgba(255, 255, 255, .24); color: #fff; text-decoration: none; }
.period-pills a.active { background: #fff; color: #0a58ca; border-color: #fff; box-shadow: 0 6px 14px -8px rgba(0, 0, 0, .5); }
.hero .form-control { background-color: rgba(255, 255, 255, .95); border-color: transparent; }
.quick-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: .6rem; margin-top: 1.15rem; }
.qa { display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; border-radius: 12px; background: rgba(255, 255, 255, .13); border: 1px solid rgba(255, 255, 255, .2); color: #fff; font-weight: 600; font-size: .86rem; transition: background-color .15s ease, transform .15s ease; }
.qa:hover { background: rgba(255, 255, 255, .24); color: #fff; transform: translateY(-1px); }
.qa .ic { --ic-size: 2rem; border-radius: 9px; background: #fff; color: var(--tone-text); font-size: .98rem; }
@media (max-width: 575.98px) {
	.hero { padding: 1.1rem 1rem; border-radius: 16px; }
	.hero h1 { font-size: 1.25rem; }
	.quick-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.qa { font-size: .8rem; padding: .5rem .55rem; }
}

/* ---------------------------------------------------------------- tables */
.table { --bs-table-bg: transparent; --bs-table-hover-bg: #f3f8ff; margin-bottom: 0; font-size: .875rem; }
.table > :not(caption) > * > * { padding: .65rem .8rem; border-bottom-color: var(--border); }
.table thead th { background: #f5f7fb; color: #5d6679; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; white-space: nowrap; border-bottom: 1px solid var(--border); }
.table tbody tr:last-child td { border-bottom: 0; }
.table td.actions, .table th.actions { text-align: right; white-space: nowrap; width: 1%; }
.table .cell-title { font-weight: 600; color: var(--text); }
.table a.cell-title, a.cell-title { color: var(--brand-700); }
.table .cell-sub { font-size: .78rem; color: var(--muted); }
.list-title { max-width: 280px; }
@media (max-width: 575.98px) { .list-title { max-width: 42vw; } }
.table tfoot td, .table tfoot th { font-weight: 700; background: #f5f7fb; border-top: 1px solid var(--border-strong); }
.table-responsive { border-radius: inherit; }
.card > .table-responsive:last-child, .card > .table:last-child { border-bottom-left-radius: var(--radius); border-bottom-right-radius: var(--radius); }
.table-sticky thead th { position: sticky; top: 0; z-index: 1; }
.sort-link { color: inherit; }
.sort-link:hover { color: var(--text); text-decoration: none; }

/* ---------------------------------------------------------------- badges */
.badge-soft { display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .58rem; border-radius: 999px; font-size: .74rem; font-weight: 600; line-height: 1.35; white-space: nowrap; border: 1px solid transparent; }
.badge-soft > .bi { font-size: .82em; }
.badge-soft-primary { background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); border-color: var(--bs-primary-border-subtle); }
.badge-soft-success { background: var(--bs-success-bg-subtle); color: var(--bs-success-text-emphasis); border-color: var(--bs-success-border-subtle); }
.badge-soft-warning { background: var(--bs-warning-bg-subtle); color: var(--bs-warning-text-emphasis); border-color: var(--bs-warning-border-subtle); }
.badge-soft-danger { background: var(--bs-danger-bg-subtle); color: var(--bs-danger-text-emphasis); border-color: var(--bs-danger-border-subtle); }
.badge-soft-info { background: var(--bs-info-bg-subtle); color: var(--bs-info-text-emphasis); border-color: var(--bs-info-border-subtle); }
.badge-soft-secondary { background: var(--bs-secondary-bg-subtle); color: var(--bs-secondary-text-emphasis); border-color: var(--bs-secondary-border-subtle); }
.badge-soft[class*="tone-"] { background: var(--tone-bg); color: var(--tone-text); border-color: rgba(var(--tone-rgb), .22); }
.color-swatch { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .15); vertical-align: -1px; flex-shrink: 0; }

/* ---------------------------------------------------------------- filters */
.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.filter-bar .form-control, .filter-bar .form-select { width: auto; min-width: 140px; }
.filter-bar .search-input { min-width: 220px; flex: 1 1 220px; max-width: 360px; }
@media (max-width: 575.98px) {
	.filter-bar .form-control, .filter-bar .form-select, .filter-bar .search-input { flex: 1 1 100%; max-width: none; min-width: 0; }
}
.filter-toggle { display: none; }
@media (max-width: 575.98px) {
	.filter-bar.collapsible .filter-toggle { display: inline-flex; align-items: center; gap: .25rem; }
	.filter-bar.collapsible:not(.expanded) > :not(.search-input):not(.filter-toggle):not([type=hidden]):not(.btn) { display: none !important; }
	.filter-bar.collapsible .search-input { flex: 1 1 0; min-width: 0; }
}
.list-footer { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; padding: .75rem 1.15rem; border-top: 1px solid var(--border); font-size: .82rem; color: var(--muted); background: var(--surface-2); border-bottom-left-radius: var(--radius); border-bottom-right-radius: var(--radius); }
.pagination { --bs-pagination-active-bg: var(--brand); --bs-pagination-active-border-color: var(--brand); --bs-pagination-color: var(--text-2); --bs-pagination-border-radius: 8px; }

/* ---------------------------------------------------------------- empty states */
.empty-state { text-align: center; padding: 2.75rem 1rem; color: var(--muted); }
.empty-state > i.bi {
	display: inline-flex; align-items: center; justify-content: center;
	width: 3.75rem; height: 3.75rem; border-radius: 50%; font-size: 1.6rem;
	background: var(--brand-50); color: var(--brand); margin-bottom: .85rem;
	box-shadow: 0 0 0 8px rgba(13, 110, 253, .05);
}
.empty-state > i.text-success { background: #e3f4ea; box-shadow: 0 0 0 8px rgba(25, 135, 84, .06); }
.empty-state > i.text-warning { background: #fff4d6; box-shadow: 0 0 0 8px rgba(255, 193, 7, .08); }
.empty-state > i.text-danger { background: #fce8ea; box-shadow: 0 0 0 8px rgba(220, 53, 69, .06); }
.empty-state h3 { font-size: 1rem; color: var(--text); margin-bottom: .3rem; font-weight: 650; }
.empty-state p { font-size: .875rem; margin-bottom: 1rem; }

/* ---------------------------------------------------------------- item picker (search dropdown) */
.picker-menu {
	position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 1050;
	background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
	box-shadow: 0 18px 44px -14px rgba(16, 24, 40, .32);
	max-height: min(380px, 60vh); overflow-y: auto; padding: .35rem;
}
.picker-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .3rem .55rem .4rem; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.picker-head .kbd { text-transform: none; letter-spacing: 0; }
.picker-item { display: flex; align-items: center; gap: .75rem; width: 100%; text-align: left; border: 0; background: transparent; padding: .5rem .55rem; border-radius: 10px; color: var(--text); cursor: pointer; }
.picker-item + .picker-item { margin-top: 2px; }
.picker-item:hover { background: var(--surface-2); }
.picker-item.active { background: var(--brand-50); box-shadow: inset 0 0 0 1px var(--brand-100); }
.picker-item .p-thumb { --ic-size: 2.4rem; border-radius: 10px; font-size: .8rem; font-weight: 700; letter-spacing: .02em; }
.picker-item .p-main { min-width: 0; flex: 1; }
.picker-item .p-name { display: block; font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-item .p-name mark { background: #fff1b8; color: inherit; padding: 0 1px; border-radius: 3px; }
.picker-item .p-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .4rem; margin-top: .2rem; font-size: .75rem; color: var(--muted); }
.p-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .05rem .45rem; border-radius: 6px; background: var(--neutral-bg); color: var(--text-2); font-weight: 600; font-size: .72rem; line-height: 1.5; }
.p-sku { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .72rem; color: var(--muted); }
.picker-item .p-side { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; text-align: right; }
.picker-item .p-price { font-weight: 700; font-size: .9rem; font-variant-numeric: tabular-nums; }
.picker-item .p-cost { font-size: .72rem; color: var(--muted); }
.picker-state { padding: 1.2rem .75rem; text-align: center; color: var(--muted); font-size: .85rem; }
.picker-state .bi { display: block; font-size: 1.4rem; margin-bottom: .3rem; color: #9aa4b8; }
@media (max-width: 575.98px) {
	.picker-item { gap: .55rem; }
	.picker-item .p-thumb { --ic-size: 2.1rem; }
}

/* ---------------------------------------------------------------- detail lists */
.dl-grid { display: grid; grid-template-columns: minmax(110px, 40%) 1fr; gap: .5rem 1rem; font-size: .875rem; margin: 0; }
.dl-grid dt { color: var(--muted); font-weight: 500; }
.dl-grid dd { margin: 0; color: var(--text); word-break: break-word; }
.totals { font-size: .9rem; }
.totals .row-line { display: flex; justify-content: space-between; padding: .28rem 0; }
.totals .row-line.grand { font-size: 1.12rem; font-weight: 700; border-top: 1px dashed var(--border-strong); margin-top: .4rem; padding-top: .6rem; color: var(--text); }

/* ---------------------------------------------------------------- toasts */
.toast-stack { position: fixed; top: calc(var(--topbar-h) + .6rem); right: 1rem; z-index: 1090; display: flex; flex-direction: column; gap: .5rem; max-width: min(380px, calc(100vw - 2rem)); }
.app-toast { display: flex; gap: .65rem; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--bs-info); border-radius: 11px; box-shadow: var(--shadow-md); padding: .75rem .85rem; font-size: .875rem; animation: toast-in .18s ease-out; }
.app-toast > .bi:first-child { font-size: 1.1rem; line-height: 1.2; color: #0aa2c0; }
.app-toast.success { border-left-color: var(--bs-success); }
.app-toast.success > .bi:first-child { color: var(--bs-success); }
.app-toast.error { border-left-color: var(--bs-danger); }
.app-toast.error > .bi:first-child { color: var(--bs-danger); }
.app-toast.warning { border-left-color: var(--bs-warning); }
.app-toast.warning > .bi:first-child { color: #cc9a06; }
.app-toast .btn-close { margin-left: auto; font-size: .65rem; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .app-toast, .kpi, .qa { animation: none; transition: none; } }

/* ---------------------------------------------------------------- misc */
.thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--neutral-bg); border: 1px solid var(--border); flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; color: #98a2b3; }
.thumb-lg { width: 96px; height: 96px; border-radius: 14px; }
.logo-preview { max-height: 72px; max-width: 220px; object-fit: contain; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 6px; background: #fff; }
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .6rem; border: 1px solid var(--border); border-radius: 999px; font-size: .78rem; background: var(--surface); color: var(--text-2); }
.chip-check input { display: none; }
.chip-check label { cursor: pointer; user-select: none; }
.chip-check input:checked + label { background: var(--brand-50); border-color: var(--brand); color: var(--brand-700); }
.section-divider { border-top: 1px solid var(--border); margin: 1rem 0; }
.kbd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .72rem; padding: .05rem .35rem; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; background: var(--surface); color: var(--text-2); }
.btn .kbd { margin-left: .35rem; background: rgba(255, 255, 255, .2); border-color: rgba(255, 255, 255, .35); color: inherit; }
.text-success-strong { color: var(--success) !important; }
.text-danger-strong { color: var(--danger) !important; }
.bg-surface-2 { background: var(--surface-2) !important; }
.sticky-actions { position: sticky; bottom: 0; background: rgba(243, 245, 249, .94); backdrop-filter: blur(6px); padding: .75rem 0; margin-top: 1rem; border-top: 1px solid var(--border); z-index: 5; }
.modal-content { border: 0; border-radius: 16px; box-shadow: 0 24px 48px -12px rgba(16, 24, 40, .3); }
.modal-header { border-bottom-color: var(--border); }
.modal-title { display: inline-flex; align-items: center; gap: .55rem; font-weight: 650; font-size: 1.05rem; }
.modal-footer { border-top-color: var(--border); background: var(--surface-2); border-bottom-left-radius: 16px; border-bottom-right-radius: 16px; }
.dropdown-menu { --bs-dropdown-border-color: var(--border); --bs-dropdown-link-active-bg: var(--brand); border-radius: 12px; box-shadow: var(--shadow-md); font-size: .9rem; padding: .35rem; }
.dropdown-item { border-radius: 8px; padding: .45rem .7rem; }
.dropdown-item > .bi { width: 1.1rem; display: inline-block; }
.nav-tabs .nav-link { color: var(--muted); font-weight: 600; }
.nav-tabs .nav-link.active { color: var(--brand-700); border-bottom-color: var(--surface); }
.nav-tabs .nav-link:hover { color: var(--text); }
.nav-pills { gap: .3rem; }
.nav-pills .nav-link { color: var(--text-2); font-weight: 600; border-radius: 999px; padding: .4rem .9rem; }
.nav-pills .nav-link:hover { background: var(--neutral-bg); }
.nav-pills .nav-link.active { background: var(--brand); color: #fff; box-shadow: 0 6px 14px -8px rgba(13, 110, 253, .9); }
.list-group-item { border-color: var(--border); }
.progress { background: var(--neutral-bg); border-radius: 999px; }
.progress-bar { border-radius: 999px; }
.chart-box { position: relative; height: 270px; }
.chart-box-sm { position: relative; height: 210px; }
.alert { border-radius: 12px; font-size: .9rem; border-left-width: 4px; }
.rank { width: 1.6rem; height: 1.6rem; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; flex-shrink: 0; background: var(--tone-bg); color: var(--tone-text); }
.legend-dot { width: .6rem; height: .6rem; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* ---------------------------------------------------------------- settings / report tiles */
.tile { display: flex; gap: .85rem; align-items: flex-start; height: 100%; padding: 1rem 1.05rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); color: inherit; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
a.tile:hover { color: inherit; text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: rgba(var(--tone-rgb, 13, 110, 253), .4); }
.tile .tile-title { font-weight: 650; color: var(--text); }
.tile .tile-desc { font-size: .8rem; color: var(--muted); margin-top: .2rem; line-height: 1.4; }
.tile .tile-go { margin-left: auto; color: #b4bccb; align-self: center; transition: transform .15s ease, color .15s ease; }
a.tile:hover .tile-go { color: var(--tone, var(--brand)); transform: translateX(2px); }
.section-nav .list-group-item { display: flex; gap: .7rem; align-items: center; padding: .75rem .9rem; border: 0; border-radius: 10px; margin: 2px .35rem; }
.section-nav .list-group-item:first-child { margin-top: .35rem; }
.section-nav .list-group-item:last-child { margin-bottom: .35rem; }
.section-nav .list-group-item .ic { --ic-size: 2.1rem; border-radius: 10px; font-size: 1rem; }
.section-nav .list-group-item.active { background: var(--brand-50); color: var(--text); box-shadow: inset 0 0 0 1px var(--brand-100); }
.section-nav .list-group-item.active .ic { background: var(--tone); color: var(--tone-on); }
.section-nav .list-group-item .s-desc { font-size: .76rem; color: var(--muted); }

/* ---------------------------------------------------------------- auth pages */
.auth-wrap {
	min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem 1rem;
	background: #eef1f6;
}
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 30px 60px -30px rgba(16, 24, 40, .35); padding: 2.25rem 2rem; }
.auth-card .auth-logo { max-height: 56px; max-width: 200px; object-fit: contain; }
.auth-card h1 { font-size: 1.35rem; font-weight: 700; margin: .75rem 0 .25rem; letter-spacing: -.01em; }
.auth-shell { width: 100%; max-width: 980px; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--surface); border-radius: 22px; box-shadow: 0 34px 70px -34px rgba(16, 24, 40, .45); overflow: hidden; border: 1px solid var(--border); }
.auth-shell .auth-card { max-width: none; border: 0; border-radius: 0; box-shadow: none; padding: 2.75rem 2.5rem; display: flex; flex-direction: column; justify-content: center; }
.auth-side { position: relative; overflow: hidden; padding: 2.5rem 2.4rem; color: #fff; display: flex; flex-direction: column; background: #0d6efd; }
.auth-side .brand-plate { align-self: flex-start; background: #fff; border-radius: 14px; padding: 8px 14px; box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .5); }
.auth-side .brand-plate img { max-height: 46px; max-width: 200px; object-fit: contain; display: block; }
.auth-side .brand-mark-lg { width: 54px; height: 54px; border-radius: 16px; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .3); display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 700; }
.auth-side h2 { font-size: 1.7rem; font-weight: 700; margin: 1.6rem 0 .5rem; letter-spacing: -.015em; }
.auth-side .lead-text { color: rgba(255, 255, 255, .86); font-size: .95rem; }
.auth-feature { display: flex; gap: .8rem; align-items: center; margin-top: .95rem; font-size: .9rem; font-weight: 500; }
.auth-feature .ic { --ic-size: 2.2rem; background: rgba(255, 255, 255, .16); color: #fff; border: 1px solid rgba(255, 255, 255, .22); }
.auth-side .auth-foot { margin-top: auto; padding-top: 2rem; font-size: .78rem; color: rgba(255, 255, 255, .7); }
.input-icon { position: relative; }
.input-icon > .bi { position: absolute; left: .95rem; top: 50%; transform: translateY(-50%); color: #8a93a6; pointer-events: none; z-index: 6; }
.input-icon > .form-control, .input-icon > .input-group > .form-control:first-child { padding-left: 2.6rem; }
@media (max-width: 767.98px) {
	.auth-shell { grid-template-columns: 1fr; max-width: 440px; }
	.auth-side { display: none; }
	.auth-shell .auth-card { padding: 2rem 1.5rem; }
}

/* ---------------------------------------------------------------- print */
@media print {
	.app-sidebar, .app-topbar, .page-actions, .filter-bar, .no-print, .toast-stack, .list-footer .pagination, .page-icon { display: none !important; }
	.app-main { margin: 0 !important; }
	.app-content { padding: 0; max-width: none; }
	.card { box-shadow: none; border-color: #ccc; }
	.kpi { box-shadow: none !important; }
	body { background: #fff; }
}
