/* =====================================================================
   File: assets/css/style.css
   BLOOMZ Inventory - design system
   White base, blush pink and muted gold accents, elegant serif headings.
   Loaded after Bootstrap 5, so it can override Bootstrap styles.
   ===================================================================== */

/* ---------- Fonts (stored locally in assets/vendor/fonts) ---------- */
@font-face { font-family: "Cormorant Garamond"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("../vendor/fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("../vendor/fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("../vendor/fonts/cormorant-garamond-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 600; font-style: italic; font-display: swap;
  src: url("../vendor/fonts/cormorant-garamond-latin-600-italic.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../vendor/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("../vendor/fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("../vendor/fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("../vendor/fonts/inter-latin-700-normal.woff2") format("woff2"); }

/* ---------- Colour tokens ---------- */
:root {
  --bl-white:      #ffffff;
  --bl-ivory:      #fcfaf8;   /* page background */
  --bl-cream:      #f7f1ec;
  --bl-line:       #efe6e1;   /* borders */
  --bl-line-soft:  #f5efeb;
  --bl-ink:        #2f2a2c;   /* main text */
  --bl-ink-soft:   #6f6568;   /* secondary text */
  --bl-muted:      #a0959a;

  --bl-blush:      #e9b8bf;
  --bl-blush-600:  #d48f9a;   /* buttons */
  --bl-blush-700:  #bd7380;   /* hover / text on white */
  --bl-blush-50:   #fdf3f4;
  --bl-blush-100:  #f9e3e6;

  --bl-gold:       #b89a63;
  --bl-gold-600:   #a3864f;
  --bl-gold-700:   #8a6f3e;
  --bl-gold-50:    #faf6ee;
  --bl-gold-100:   #f2e9d6;

  --bl-sage:       #8fa79a;
  --bl-sage-50:    #f1f5f2;
  --bl-rose:       #c98a8a;

  --bl-success:    #5f9a7a;
  --bl-warning:    #c99a3e;
  --bl-danger:     #c4626c;

  --bl-radius:     14px;
  --bl-radius-sm:  10px;
  --bl-shadow:     0 1px 2px rgba(47, 42, 44, .04), 0 6px 24px rgba(47, 42, 44, .05);
  --bl-shadow-lg:  0 10px 40px rgba(47, 42, 44, .10);
  --bl-sidebar-w:  262px;

  --bl-font-body:  "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bl-font-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;

  /* Bootstrap overrides */
  --bs-body-font-family: var(--bl-font-body);
  --bs-body-color: var(--bl-ink);
  --bs-body-bg: var(--bl-ivory);
  --bs-border-color: var(--bl-line);
  --bs-primary: var(--bl-blush-600);
  --bs-primary-rgb: 212, 143, 154;
  --bs-link-color: var(--bl-blush-700);
  --bs-link-hover-color: var(--bl-gold-700);
  --bs-secondary-color: var(--bl-ink-soft);
}

/* ---------- Base ---------- */
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--bl-font-body); font-size: .925rem; color: var(--bl-ink); background: var(--bl-ivory); }
h1, h2, h3, .serif { font-family: var(--bl-font-serif); letter-spacing: .01em; }
a { text-decoration: none; }
code { color: var(--bl-gold-700); }
.text-muted { color: var(--bl-ink-soft) !important; }
.req { color: var(--bl-danger); }
.link-gold { color: var(--bl-gold-700); font-weight: 500; }
.link-gold:hover { color: var(--bl-blush-700); }
.link-muted { color: var(--bl-ink-soft); }
.link-muted:hover { color: var(--bl-blush-700); }
::selection { background: var(--bl-blush-100); }

/* ---------- Layout ---------- */
.app-shell { display: flex; min-height: 100vh; }
.app-main { flex: 1; min-width: 0; margin-left: var(--bl-sidebar-w); display: flex; flex-direction: column; }
.app-content { flex: 1; padding: 24px 28px 32px; }
.app-footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 16px 28px; font-size: .8rem; color: var(--bl-ink-soft); border-top: 1px solid var(--bl-line);
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--bl-sidebar-w); z-index: 1040;
  display: flex; flex-direction: column; background: var(--bl-white);
  border-right: 1px solid var(--bl-line); transition: transform .25s ease;
}
.sidebar-brand {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 20px 18px; border-bottom: 1px solid var(--bl-line-soft);
}
.brand-link { display: flex; align-items: center; gap: 12px; color: var(--bl-ink); }
.brand-mark { flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: var(--bl-font-serif); font-size: 1.6rem; font-weight: 700; letter-spacing: .18em; }
.brand-sub { font-size: .66rem; letter-spacing: .22em; text-transform: uppercase; color: var(--bl-gold-700); margin-top: 3px; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 12px 16px; scrollbar-width: thin; }
.nav-group { margin-top: 14px; }
.nav-group-title {
  font-size: .66rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--bl-muted); padding: 0 12px 6px;
}
.nav-item-link {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; margin: 1px 0; border-radius: 10px;
  color: var(--bl-ink-soft); font-weight: 500; transition: background .15s, color .15s;
}
.nav-item-link i { color: var(--bl-muted); font-size: .95rem; transition: color .15s; }
.nav-item-link:hover { background: var(--bl-blush-50); color: var(--bl-ink); }
.nav-item-link:hover i { color: var(--bl-blush-700); }
.nav-item-link.active { background: linear-gradient(90deg, var(--bl-blush-100), var(--bl-blush-50)); color: var(--bl-ink); font-weight: 600; }
.nav-item-link.active i { color: var(--bl-blush-700); }
.nav-item-link.active::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--bl-gold);
}
.sidebar-footer { padding: 14px 20px; border-top: 1px solid var(--bl-line-soft); line-height: 1.5; }
.sidebar-backdrop { display: none; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 1020;
  display: flex; align-items: center; gap: 16px;
  padding: 16px 28px; background: rgba(252, 250, 248, .9);
  backdrop-filter: saturate(160%) blur(8px); border-bottom: 1px solid var(--bl-line);
}
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 1.9rem; font-weight: 600; margin: 0; line-height: 1.1; }
.topbar-title p { margin: 2px 0 0; color: var(--bl-ink-soft); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.topbar-date { font-size: .8rem; color: var(--bl-ink-soft); }
.btn-icon {
  width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--bl-line); border-radius: 10px; background: var(--bl-white); color: var(--bl-ink);
}
.btn-icon:hover { border-color: var(--bl-blush); color: var(--bl-blush-700); }

.user-chip {
  display: flex; align-items: center; gap: 10px; padding: 5px 10px 5px 5px;
  border: 1px solid var(--bl-line); border-radius: 999px; background: var(--bl-white); color: var(--bl-ink);
}
.user-chip:hover { border-color: var(--bl-blush); }
.user-chip-text { flex-direction: column; align-items: flex-start; line-height: 1.15; text-align: left; }
.user-chip-text strong { font-size: .82rem; font-weight: 600; }
.user-chip-text small { font-size: .7rem; color: var(--bl-gold-700); }

.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--bl-blush-100), var(--bl-gold-100));
  color: var(--bl-gold-700); font-weight: 700; font-size: .78rem; letter-spacing: .04em;
}
.avatar-sm { width: 32px; height: 32px; font-size: .72rem; }
.avatar-xl { width: 84px; height: 84px; font-size: 1.6rem; display: flex; }

.dropdown-menu { border: 1px solid var(--bl-line); border-radius: 12px; padding: 6px; font-size: .88rem; }
.dropdown-item { border-radius: 8px; padding: 8px 12px; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--bl-blush-50); }
.dropdown-header { font-size: .75rem; }

/* ---------- Buttons ---------- */
.btn { border-radius: 10px; font-weight: 500; }
.btn-blush {
  --bs-btn-color: #fff; --bs-btn-bg: var(--bl-blush-600); --bs-btn-border-color: var(--bl-blush-600);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--bl-blush-700); --bs-btn-hover-border-color: var(--bl-blush-700);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--bl-blush-700); --bs-btn-active-border-color: var(--bl-blush-700);
  --bs-btn-focus-shadow-rgb: 212, 143, 154;
  box-shadow: 0 4px 14px rgba(212, 143, 154, .28);
}
.btn-outline-gold {
  --bs-btn-color: var(--bl-gold-700); --bs-btn-border-color: var(--bl-gold-100); --bs-btn-bg: var(--bl-white);
  --bs-btn-hover-color: var(--bl-gold-700); --bs-btn-hover-bg: var(--bl-gold-50); --bs-btn-hover-border-color: var(--bl-gold);
  --bs-btn-active-color: var(--bl-gold-700); --bs-btn-active-bg: var(--bl-gold-100); --bs-btn-active-border-color: var(--bl-gold);
}
.btn-light-elegant {
  --bs-btn-bg: var(--bl-white); --bs-btn-border-color: var(--bl-line); --bs-btn-color: var(--bl-ink-soft);
  --bs-btn-hover-bg: var(--bl-blush-50); --bs-btn-hover-border-color: var(--bl-blush); --bs-btn-hover-color: var(--bl-blush-700);
  padding: .25rem .5rem;
}
.btn-chip {
  --bs-btn-color: var(--bl-ink-soft); --bs-btn-bg: var(--bl-white); --bs-btn-border-color: var(--bl-line);
  --bs-btn-hover-bg: var(--bl-blush-50); --bs-btn-hover-color: var(--bl-ink); --bs-btn-hover-border-color: var(--bl-line);
  --bs-btn-active-bg: var(--bl-blush-100); --bs-btn-active-color: var(--bl-ink); --bs-btn-active-border-color: var(--bl-blush);
}
.btn-chip.active { background: var(--bl-blush-100); color: var(--bl-ink); border-color: var(--bl-blush); }

/* ---------- Forms ---------- */
.form-label { font-size: .82rem; font-weight: 500; color: var(--bl-ink); margin-bottom: .35rem; }
.form-control, .form-select { border-color: var(--bl-line); border-radius: 10px; background-color: var(--bl-white); }
.form-control:focus, .form-select:focus { border-color: var(--bl-blush); box-shadow: 0 0 0 .22rem rgba(233, 184, 191, .30); }
.form-control:disabled, .form-select:disabled { background-color: var(--bl-ivory); }
.form-check-input:checked { background-color: var(--bl-blush-600); border-color: var(--bl-blush-600); }
.form-check-input:focus { border-color: var(--bl-blush); box-shadow: 0 0 0 .22rem rgba(233, 184, 191, .30); }
.form-text { color: var(--bl-ink-soft); font-size: .76rem; }

.input-icon { position: relative; }
.input-icon > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--bl-muted); pointer-events: none; font-size: .9rem; }
.input-icon > .form-control { padding-left: 40px; }
.input-icon-sm > i { left: 11px; font-size: .8rem; }
.input-icon-sm > .form-control { padding-left: 32px; }
.btn-reveal {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--bl-muted); padding: 6px 10px; border-radius: 8px;
}
.btn-reveal:hover { color: var(--bl-blush-700); }
.input-icon > .form-control:has(+ .btn-reveal) { padding-right: 44px; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-bar .form-select, .filter-bar .input-icon { width: auto; min-width: 150px; }
.filter-bar .input-icon { min-width: 240px; }
.filter-bar input[type="date"].form-control { width: auto; flex: 0 0 auto; }

/* ---------- Cards ---------- */
.card-elegant {
  background: var(--bl-white); border: 1px solid var(--bl-line); border-radius: var(--bl-radius);
  box-shadow: var(--bl-shadow); padding: 20px 22px;
}
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-title-elegant { font-family: var(--bl-font-serif); font-size: 1.35rem; font-weight: 600; margin: 0; }
.card-sub { font-size: .8rem; color: var(--bl-ink-soft); margin: 2px 0 0; }
.card-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 16px -22px -20px; padding: 12px 22px; border-top: 1px solid var(--bl-line-soft);
  background: var(--bl-ivory); border-radius: 0 0 var(--bl-radius) var(--bl-radius);
}

.page-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-toolbar .form-select { min-width: 150px; }

/* KPI cards */
.kpi-card {
  position: relative; overflow: hidden; height: 100%;
  background: var(--bl-white); border: 1px solid var(--bl-line); border-radius: var(--bl-radius);
  box-shadow: var(--bl-shadow); padding: 18px 20px;
}
.kpi-card::after {
  content: ""; position: absolute; right: -36px; top: -36px; width: 120px; height: 120px; border-radius: 50%;
  background: var(--kpi-tint, var(--bl-blush-50)); opacity: .9;
}
.kpi-icon {
  position: relative; z-index: 1; width: 40px; height: 40px; border-radius: 12px; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--kpi-tint, var(--bl-blush-50)); color: var(--kpi-color, var(--bl-blush-700));
}
.kpi-label { font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--bl-ink-soft); }
.kpi-value { font-family: var(--bl-font-serif); font-size: 1.9rem; font-weight: 700; line-height: 1.15; margin: 4px 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-foot { font-size: .78rem; color: var(--bl-ink-soft); }
.kpi-blush { --kpi-tint: var(--bl-blush-50); --kpi-color: var(--bl-blush-700); }
.kpi-gold  { --kpi-tint: var(--bl-gold-50);  --kpi-color: var(--bl-gold-700); }
.kpi-rose  { --kpi-tint: #fbf1ef;            --kpi-color: #b3706f; }
.kpi-sage  { --kpi-tint: var(--bl-sage-50);  --kpi-color: #5f8070; }

.stat-strip {
  display: flex; align-items: center; gap: 14px; height: 100%;
  background: var(--bl-white); border: 1px solid var(--bl-line); border-radius: var(--bl-radius); padding: 14px 16px;
}
.stat-icon {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--bl-gold-100); color: var(--bl-gold-700); background: var(--bl-gold-50);
}
.stat-value { font-weight: 700; font-size: 1.05rem; }
.stat-value small { font-weight: 500; font-size: .75rem; color: var(--bl-ink-soft); }
.stat-label { font-size: .76rem; color: var(--bl-ink-soft); }
.stat-alert .stat-icon { border-color: var(--bl-blush-100); color: var(--bl-danger); background: var(--bl-blush-50); }

.chart-box { position: relative; height: 300px; }

/* Best sellers */
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--bl-line); }
.rank-list li:last-child { border-bottom: 0; }
.rank-no {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--bl-font-serif); font-weight: 700; background: var(--bl-gold-50); color: var(--bl-gold-700); border: 1px solid var(--bl-gold-100);
}
.rank-body { flex: 1; min-width: 0; }
.rank-name { font-weight: 500; }
.rank-units { font-size: .8rem; font-weight: 600; color: var(--bl-blush-700); white-space: nowrap; }
.rank-bar { height: 5px; border-radius: 4px; background: var(--bl-blush-50); margin: 6px 0 4px; overflow: hidden; }
.rank-bar span { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--bl-blush), var(--bl-gold)); }
.rank-meta { font-size: .74rem; color: var(--bl-ink-soft); }

/* ---------- Tables ---------- */
.table-elegant { --bs-table-bg: transparent; --bs-table-hover-bg: var(--bl-blush-50); margin-bottom: 0; }
.table-elegant > thead th {
  font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--bl-ink-soft);
  background: var(--bl-ivory); border-bottom: 1px solid var(--bl-line); padding: 10px 12px; white-space: nowrap;
}
.table-elegant > thead th:first-child { border-top-left-radius: 10px; }
.table-elegant > thead th:last-child { border-top-right-radius: 10px; }
.table-elegant > tbody td { padding: 11px 12px; border-color: var(--bl-line-soft); }
.table-elegant > tbody tr:hover > td { background: var(--bl-blush-50); }
.table-elegant > tbody tr:last-child td { border-bottom: 0; }

.table-permissions td:first-child { min-width: 260px; }
.perm-group-row td {
  background: var(--bl-gold-50) !important; font-family: var(--bl-font-serif); font-size: 1.05rem; font-weight: 700;
  color: var(--bl-gold-700); padding-top: 8px !important; padding-bottom: 8px !important;
}

.pagination { --bs-pagination-color: var(--bl-ink-soft); --bs-pagination-border-color: var(--bl-line);
  --bs-pagination-hover-bg: var(--bl-blush-50); --bs-pagination-hover-color: var(--bl-ink);
  --bs-pagination-active-bg: var(--bl-blush-600); --bs-pagination-active-border-color: var(--bl-blush-600);
  --bs-pagination-focus-box-shadow: 0 0 0 .2rem rgba(233, 184, 191, .35); }

/* ---------- Badges ---------- */
.badge { font-weight: 600; letter-spacing: .02em; padding: .38em .7em; border-radius: 999px; }
.badge-soft-success   { background: #edf5f0; color: #3f7a5a; }
.badge-soft-warning   { background: #fbf3e2; color: #9a7020; }
.badge-soft-danger    { background: #fbecee; color: #b04a55; }
.badge-soft-secondary { background: #f2eff0; color: #776d70; }
.badge-soft-dark      { background: #e9e6e7; color: #4a4245; }
.badge-soft-gold      { background: var(--bl-gold-50); color: var(--bl-gold-700); border: 1px solid var(--bl-gold-100); }
.badge-role-admin   { background: var(--bl-gold-50); color: var(--bl-gold-700); border: 1px solid var(--bl-gold-100); }
.badge-role-manager { background: var(--bl-blush-50); color: var(--bl-blush-700); border: 1px solid var(--bl-blush-100); }
.badge-role-staff   { background: var(--bl-sage-50); color: #5f8070; border: 1px solid #dde7e1; }

.action-pill { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--bl-ivory); border: 1px solid var(--bl-line); }
.action-login, .action-create, .action-activate { color: #3f7a5a; }
.action-login_failed, .action-account_locked, .action-access_denied, .action-delete, .action-deactivate { color: #b04a55; }
.action-update, .action-password_change { color: var(--bl-gold-700); }

/* ---------- Alerts ---------- */
.alert-elegant { border-radius: 12px; border-width: 1px; font-size: .88rem; }
.alert-success.alert-elegant { background: #f0f7f2; border-color: #d5e8dc; color: #2f6448; }
.alert-danger.alert-elegant  { background: #fcf0f1; border-color: #f2d3d7; color: #9c3b46; }
.alert-warning.alert-elegant { background: #fcf6e9; border-color: #f0e1bd; color: #82601b; }
.alert-info.alert-elegant    { background: var(--bl-gold-50); border-color: var(--bl-gold-100); color: var(--bl-gold-700); }

/* ---------- Empty states ---------- */
.empty-mini { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 34px 12px; color: var(--bl-ink-soft); font-size: .86rem; text-align: center; }
.empty-mini i { font-size: 1.5rem; color: var(--bl-blush); }
.empty-state { max-width: 560px; margin: 40px auto; text-align: center; padding: 48px 32px; }
.empty-state h2 { font-size: 2rem; font-weight: 600; }
.empty-icon {
  width: 72px; height: 72px; margin: 0 auto 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 1.6rem;
  background: var(--bl-blush-50); color: var(--bl-blush-700); border: 1px solid var(--bl-blush-100);
}

/* Planned module page */
.planned-module { max-width: 880px; margin: 8px auto; text-align: center; padding: 40px 36px; }
.planned-icon {
  width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 22px; display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; color: var(--bl-blush-700); background: linear-gradient(135deg, var(--bl-blush-50), var(--bl-gold-50));
  border: 1px solid var(--bl-line);
}
.planned-title { font-size: 2.2rem; font-weight: 600; margin-bottom: 4px; }
.planned-intro { max-width: 560px; margin: 0 auto; }
.planned-sub { font-family: var(--bl-font-body); font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--bl-gold-700); margin-bottom: 10px; }
.planned-list { list-style: none; padding: 0; margin: 0; }
.planned-list li { display: flex; gap: 10px; padding: 6px 0; }
.planned-list i { color: var(--bl-blush-600); margin-top: 4px; font-size: .8rem; }
.table-chip { display: inline-block; padding: 4px 10px; border-radius: 8px; background: var(--bl-ivory); border: 1px solid var(--bl-line); font-size: .78rem; }

/* ---------- Users / roles / profile ---------- */
.role-option {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-bottom: 8px; cursor: pointer;
  border: 1px solid var(--bl-line); border-radius: 12px; transition: border-color .15s, background .15s;
}
.role-option input { margin-top: 4px; accent-color: var(--bl-blush-600); }
.role-option span { display: flex; flex-direction: column; }
.role-option small { color: var(--bl-ink-soft); font-size: .76rem; }
.role-option:hover, .role-option.selected { border-color: var(--bl-blush); background: var(--bl-blush-50); }
.role-card { background: var(--bl-white); border: 1px solid var(--bl-line); border-radius: var(--bl-radius); padding: 14px 16px; height: 100%; }

.profile-card { padding-top: 28px; }
.profile-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; text-align: left; margin: 22px 0 0; font-size: .82rem; }
.profile-facts dt { font-weight: 500; color: var(--bl-ink-soft); }
.profile-facts dd { margin: 0; text-align: right; }

.nav-tabs-elegant { border-bottom: 1px solid var(--bl-line); gap: 4px; flex-wrap: nowrap; overflow-x: auto; }
.nav-tabs-elegant .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--bl-ink-soft); font-weight: 500; padding: 10px 14px; white-space: nowrap; }
.nav-tabs-elegant .nav-link:hover { color: var(--bl-ink); border-color: transparent; }
.nav-tabs-elegant .nav-link.active { color: var(--bl-ink); background: transparent; border-bottom-color: var(--bl-gold); }

.timeline { list-style: none; margin: 0; padding: 0 0 0 6px; }
.timeline li { position: relative; display: flex; gap: 14px; padding: 0 0 16px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 14px; bottom: -2px; width: 1px; background: var(--bl-line); }
.timeline li:last-child::before { display: none; }
.timeline-dot { width: 11px; height: 11px; margin-top: 6px; border-radius: 50%; background: var(--bl-blush); border: 2px solid var(--bl-white); box-shadow: 0 0 0 1px var(--bl-blush); flex-shrink: 0; }

/* ---------- Login ---------- */
.auth-body { background: var(--bl-ivory); min-height: 100vh; }
.auth-split { display: flex; min-height: 100vh; }
.auth-hero {
  flex: 1.05; position: relative; overflow: hidden; align-items: center; justify-content: center; padding: 48px;
  background:
    radial-gradient(circle at 18% 22%, rgba(233, 184, 191, .55), transparent 46%),
    radial-gradient(circle at 82% 78%, rgba(184, 154, 99, .30), transparent 50%),
    linear-gradient(160deg, #fbeef0 0%, #f8efe6 100%);
}
.auth-hero::before, .auth-hero::after {
  content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(184, 154, 99, .35);
}
.auth-hero::before { width: 520px; height: 520px; right: -180px; top: -160px; }
.auth-hero::after { width: 380px; height: 380px; left: -140px; bottom: -120px; }
.auth-hero-inner { position: relative; z-index: 1; max-width: 420px; }
.auth-hero-title { font-size: 4rem; font-weight: 700; letter-spacing: .22em; margin: 18px 0 0; }
.auth-hero-sub { font-size: .8rem; letter-spacing: .26em; text-transform: uppercase; color: var(--bl-gold-700); margin-bottom: 34px; }
.auth-hero-list { list-style: none; padding: 0; margin: 0 0 40px; }
.auth-hero-list li { display: flex; align-items: center; gap: 14px; padding: 10px 0; color: var(--bl-ink); }
.auth-hero-list i {
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .75); color: var(--bl-blush-700); border: 1px solid rgba(184, 154, 99, .3);
}
.auth-hero-foot { font-size: .78rem; color: var(--bl-ink-soft); margin: 0; }
.auth-panel { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px 20px; background: var(--bl-white); }
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-wrap .auth-card { background: var(--bl-white); border: 1px solid var(--bl-line); border-radius: 18px; padding: 36px 32px; box-shadow: var(--bl-shadow-lg); }
.auth-title { font-size: 2.3rem; font-weight: 600; margin-bottom: 4px; }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--bl-shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.show { display: block; position: fixed; inset: 0; z-index: 1035; background: rgba(47, 42, 44, .35); }
  .app-main { margin-left: 0; }
  .topbar { padding: 12px 16px; }
  .topbar-title h1 { font-size: 1.55rem; }
  .app-content { padding: 18px 16px 24px; }
  .app-footer { padding: 14px 16px; }
}
@media (max-width: 575.98px) {
  .kpi-card { padding: 14px; }
  .kpi-value { font-size: 1.35rem; }
  .kpi-icon { width: 34px; height: 34px; margin-bottom: 10px; }
  .kpi-label { font-size: .66rem; }
  .card-elegant { padding: 16px; }
  .card-foot { margin: 14px -16px -16px; padding: 10px 16px; }
  .filter-bar .input-icon { min-width: 0; flex: 1 1 100%; }
  .filter-bar .form-select, .filter-bar input[type="date"].form-control { min-width: 0; flex: 1 1 calc(50% - 4px); }
  .topbar-title p { display: none; }
  .chart-box { height: 240px; }
  .planned-module { padding: 28px 18px; }
}

/* ---------- Print ---------- */
@media print {
  .sidebar, .topbar, .app-footer, .page-toolbar, .btn { display: none !important; }
  .app-main { margin-left: 0; }
  .card-elegant, .kpi-card { box-shadow: none; }
  body { background: #fff; }
}

/* ---------- Refinements ---------- */
h1, h2, h3, .serif, .kpi-value, .rank-no, .brand-name { font-variant-numeric: lining-nums; }
.kpi-card > * { position: relative; z-index: 1; }
.kpi-card::after { z-index: 0; }
.table-elegant td.fw-semibold, .table-elegant td.text-end, .table-elegant td.text-muted { white-space: nowrap; }
.nav-item-link { padding: 7px 12px; }
.nav-group { margin-top: 10px; }

/* =====================================================================
   Milestone 2 additions: toasts, dialogs, images, catalogue admin
   ===================================================================== */

/* Toasts */
.toast-container { z-index: 1090; }
.toast-elegant { border: 1px solid var(--bl-line); border-radius: 12px; box-shadow: var(--bl-shadow-lg); background: var(--bl-white); font-size: .88rem; min-width: 280px; }
.toast-elegant .btn-close-sm { width: .6em; height: .6em; margin-top: 4px; }
.toast-success { border-left: 4px solid var(--bl-success); } .toast-success i { color: var(--bl-success); }
.toast-danger  { border-left: 4px solid var(--bl-danger); }  .toast-danger i  { color: var(--bl-danger); }
.toast-warning { border-left: 4px solid var(--bl-warning); } .toast-warning i { color: var(--bl-warning); }
.toast-info    { border-left: 4px solid var(--bl-gold); }    .toast-info i    { color: var(--bl-gold-700); }

/* Confirmation dialog */
.modal-elegant { border: 1px solid var(--bl-line); border-radius: 18px; box-shadow: var(--bl-shadow-lg); }
.confirm-icon { width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; background: #fbecee; color: var(--bl-danger); }
#confirmModalExtra:not(:empty) { text-align: left; margin-top: 18px; }
.btn-danger-soft { --bs-btn-color: #fff; --bs-btn-bg: var(--bl-danger); --bs-btn-border-color: var(--bl-danger);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #a94e58; --bs-btn-hover-border-color: #a94e58; }

/* Thumbnails in tables */
.thumb { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; border: 1px solid var(--bl-line); background: var(--bl-ivory); flex-shrink: 0; }
.thumb-lg { width: 64px; height: 64px; border-radius: 12px; }

/* Image upload box with preview */
.image-drop {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 180px; padding: 16px; border: 1.5px dashed var(--bl-blush); border-radius: 14px;
  background: var(--bl-blush-50); color: var(--bl-ink-soft); text-align: center; cursor: pointer; overflow: hidden;
  transition: background .15s, border-color .15s;
}
.image-drop:hover { background: var(--bl-blush-100); border-color: var(--bl-blush-600); }
.image-drop i { font-size: 1.6rem; color: var(--bl-blush-700); }
.image-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.image-drop img.preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.image-drop.has-image .drop-text { display: none; }
.image-drop.has-image::after { content: "Click to change"; position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  background: rgba(47,42,44,.72); color: #fff; font-size: .72rem; padding: 3px 10px; border-radius: 999px; }
.preview-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.preview-thumb { position: relative; width: 92px; height: 92px; margin: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--bl-line); }
.preview-thumb img { width: 100%; height: 100%; object-fit: cover; }
.preview-thumb figcaption { position: absolute; left: 6px; top: 6px; font-size: .62rem; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: var(--bl-gold); color: #fff; }

/* Detail pages */
.detail-list { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 10px 18px; margin: 0; font-size: .9rem; }
.detail-list dt { color: var(--bl-ink-soft); font-weight: 500; }
.detail-list dd { margin: 0; word-break: break-word; }
.mini-stat { padding: 14px 16px; border: 1px solid var(--bl-line); border-radius: 12px; background: var(--bl-ivory); height: 100%; }
.mini-stat .label { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--bl-ink-soft); font-weight: 600; }
.mini-stat .value { font-family: var(--bl-font-serif); font-variant-numeric: lining-nums; font-size: 1.5rem; font-weight: 700; }
.section-title { font-family: var(--bl-font-body); font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--bl-gold-700); margin: 0 0 12px; }
.form-section { border-top: 1px solid var(--bl-line-soft); padding-top: 18px; margin-top: 18px; }
.form-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.was-validated .form-control:invalid, .was-validated .form-select:invalid { border-color: var(--bl-danger); }

/* ==========================================================================
   Milestone 2 – products
   ========================================================================== */
.badge-soft-info { background: #eaf2f8; color: #3f6f93; }
.text-gold { color: var(--bl-gold); }
.min-w-0 { min-width: 0; }
.view-switch .btn.active { background: var(--bl-blush-100); color: var(--bl-blush-700); border-color: var(--bl-blush); }

/* Grid view */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.product-card { background: var(--bl-white); border: 1px solid var(--bl-line); border-radius: var(--bl-radius); overflow: hidden;
  display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; }
.product-card:hover { box-shadow: 0 10px 26px rgba(120, 80, 90, .10); transform: translateY(-2px); }
.product-card-img { position: relative; display: block; aspect-ratio: 4 / 5; background: var(--bl-cream); }
.product-card-img img { width: 100%; height: 100%; object-fit: cover; }
.product-flag { position: absolute; top: 10px; left: 10px; font-size: .68rem; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: rgba(255,255,255,.92); color: var(--bl-gold-700); }
.product-flag-sale { left: auto; right: 10px; background: var(--bl-blush-600); color: #fff; }
.product-card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; flex: 1; }
.product-card-title { font-weight: 600; color: var(--bl-ink); text-decoration: none; line-height: 1.3; margin: 2px 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card-title:hover { color: var(--bl-blush-700); }

/* Form: profit strip, type switching, variations */
.profit-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; background: var(--bl-gold-50); border: 1px solid var(--bl-gold-100);
  border-radius: 12px; padding: 12px 14px; }
.profit-strip .label { display: block; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--bl-ink-soft); }
.profit-strip strong { font-variant-numeric: lining-nums tabular-nums; font-size: 1.02rem; color: var(--bl-ink); }
.profit-strip.is-loss strong { color: var(--bl-danger); }
@media (max-width: 575.98px) { .profit-strip { grid-template-columns: repeat(2, 1fr); } }

#productForm[data-type="simple"] .variants-only { display: none !important; }
#productForm:not([data-type="simple"]) .simple-only { display: none !important; }
#productForm[data-type="size"] .col-colour,
#productForm[data-type="colour"] .col-size { display: none !important; }

.variant-generator { background: var(--bl-blush-50); border: 1px dashed var(--bl-blush); border-radius: 12px; padding: 12px 14px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { border: 1px solid var(--bl-line); background: var(--bl-white); color: var(--bl-ink-soft); font-size: .72rem; padding: 2px 9px; border-radius: 999px; }
.chip:hover { border-color: var(--bl-blush-600); color: var(--bl-blush-700); }
.chip.active { background: var(--bl-blush-600); border-color: var(--bl-blush-600); color: #fff; }
.table-variants { min-width: 980px; }
.table-variants .col-size { width: 130px; }
.table-variants .col-colour { width: 240px; }
.table-variants th:nth-child(3) { width: 190px; }
.table-variants td { padding-top: 6px; padding-bottom: 6px; }
.table-variants .form-control-sm { min-width: 70px; }
.table-variants .form-control-color { width: 34px; min-width: 34px; height: 31px; padding: 3px; }
.variant-row.is-removed td { opacity: .45; text-decoration: line-through; }
.variant-row.is-removed td:last-child { opacity: 1; text-decoration: none; }
.table-danger-soft td { background: #fdf1f2 !important; }
.form-actions-sticky { position: sticky; top: 90px; }
.preview-thumb.is-primary { border-color: var(--bl-gold); box-shadow: 0 0 0 2px var(--bl-gold-100); }
.primary-tag { position: absolute; left: 6px; top: 6px; font-size: .62rem; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: var(--bl-gold); color: #fff; }

/* Product page gallery */
.gallery-main { aspect-ratio: 4 / 5; max-height: 520px; width: 100%; border-radius: 14px; overflow: hidden; background: var(--bl-cream); }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.gallery-item { position: relative; width: 88px; }
.gallery-thumb { display: block; width: 88px; height: 106px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: var(--bl-cream); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb.is-current { border-color: var(--bl-blush-600); }
.gallery-item.is-primary .gallery-thumb { box-shadow: 0 0 0 2px var(--bl-gold-100); }
.gallery-actions { display: flex; justify-content: center; gap: 2px; margin-top: 4px; }
.btn-icon { border: 0; background: transparent; color: var(--bl-ink-soft); font-size: .78rem; width: 22px; height: 22px; padding: 0; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.btn-icon:hover { background: var(--bl-blush-50); color: var(--bl-blush-700); }
.image-drop.image-drop-sm { min-height: 0; padding: 14px; }
.detail-list-2col { display: grid; grid-template-columns: max-content 1fr max-content 1fr; column-gap: 18px; }
@media (max-width: 767.98px) { .detail-list-2col { grid-template-columns: max-content 1fr; } }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); vertical-align: -2px; margin-right: 6px; }
@media (max-width: 575.98px) {
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .product-card-body { padding: 10px; font-size: .88rem; }
}

/* =====================================================================
   Milestone 3 additions: purchases (entry form, totals, printable invoice)
   ===================================================================== */
.thumb-sm { width: 36px; height: 36px; border-radius: 8px; }
.min-w-0 { min-width: 0; }
.mini-stat-action { border-style: dashed; color: var(--bl-blush-700) !important; transition: background .15s; }
.mini-stat-action:hover { background: var(--bl-blush-50); }

/* Product search on the purchase form */
.po-search { position: relative; flex: 1 1 320px; max-width: 440px; }
.po-results { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); max-height: 340px; overflow-y: auto;
  background: var(--bl-white); border: 1px solid var(--bl-line); border-radius: 12px; box-shadow: var(--bl-shadow-lg); padding: 4px; }
.po-result { display: flex; gap: 10px; align-items: center; width: 100%; border: 0; background: none; text-align: left; padding: 7px 8px; border-radius: 8px; font-size: .86rem; }
.po-result img { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; border: 1px solid var(--bl-line); flex-shrink: 0; }
.po-result:hover, .po-result.is-active { background: var(--bl-blush-50); }
.po-result-text { min-width: 0; }
.po-result-text small { display: block; color: var(--bl-ink-soft); }
.po-result-empty { padding: 10px; font-size: .86rem; color: var(--bl-ink-soft); }

/* Line table */
.table-po th:nth-child(1) { min-width: 240px; }
.table-po th:nth-child(2) { width: 90px; }
.table-po th:nth-child(3), .table-po th:nth-child(4) { width: 110px; }
.table-po th:nth-child(5) { width: 100px; }
.table-po th:nth-child(6) { width: 110px; }
.table-po th:nth-child(7) { width: 40px; }
.table-po .form-control-sm, .table-po .form-select-sm { min-width: 70px; }
.table-danger-soft > td { background: #fdf1f2 !important; }

/* Totals */
.po-totals { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 0 0 10px; font-size: .88rem; }
.po-totals dt { font-weight: 400; color: var(--bl-ink-soft); }
.po-totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.po-totals-lg { font-size: .95rem; gap: 6px 12px; }
.po-grand { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--bl-line); padding-top: 10px; }
.po-grand strong { font-family: var(--bl-font-serif); font-size: 1.35rem; font-variant-numeric: lining-nums; }
.po-pay { border-top: 1px dashed var(--bl-line); padding-top: 12px; }

/* Printable purchase invoice */
.print-body { background: var(--bl-cream); color: var(--bl-ink); }
.print-bar { display: flex; justify-content: space-between; max-width: 900px; margin: 16px auto 0; padding: 0 16px; }
.invoice-sheet { max-width: 900px; margin: 12px auto 32px; background: var(--bl-white); padding: 36px 40px; border-radius: 12px; box-shadow: var(--bl-shadow-lg); }
.invoice-head { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 2px solid var(--bl-blush); }
.invoice-logo { width: 54px; height: 54px; object-fit: contain; }
.invoice-brand { font-family: var(--bl-font-serif); font-size: 1.6rem; font-weight: 700; letter-spacing: .06em; }
.invoice-title { font-family: var(--bl-font-serif); font-size: 1.3rem; text-transform: uppercase; letter-spacing: .12em; color: var(--bl-blush-700); margin-bottom: 6px; }
.invoice-meta th { font-weight: 400; color: var(--bl-ink-soft); padding: 1px 12px 1px 0; text-align: right; font-size: .85rem; }
.invoice-meta td { font-weight: 600; font-size: .88rem; text-align: right; }
.invoice-party { margin: 18px 0; }
.invoice-sheet .label { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--bl-ink-soft); font-weight: 600; margin-bottom: 2px; }
.invoice-table { font-size: .86rem; }
.invoice-table thead th { background: var(--bl-blush-50); font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--bl-line); }
.invoice-table td { border-color: var(--bl-line-soft); }
.invoice-bottom { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-top: 8px; }
.invoice-notes { flex: 1 1 300px; }
.invoice-pay { font-size: .82rem; width: 100%; }
.invoice-pay td { padding: 2px 8px 2px 0; }
.invoice-totals { min-width: 280px; font-size: .9rem; }
.invoice-totals th { font-weight: 400; color: var(--bl-ink-soft); padding: 3px 16px 3px 0; }
.invoice-totals td { text-align: right; font-variant-numeric: tabular-nums; }
.invoice-totals .grand th, .invoice-totals .grand td { border-top: 1px solid var(--bl-ink); padding-top: 6px; font-weight: 700; color: var(--bl-ink); font-size: 1.05rem; }
.invoice-totals .due th, .invoice-totals .due td { color: var(--bl-danger); font-weight: 600; }
.invoice-foot { margin-top: 48px; }
.sign-line { border-top: 1px solid var(--bl-ink-soft); padding-top: 6px; font-size: .8rem; color: var(--bl-ink-soft); margin-top: 40px; max-width: 260px; }
@media (max-width: 575.98px) {
  .invoice-sheet { padding: 20px 16px; border-radius: 0; }
  .invoice-head > div:last-child { text-align: left !important; }
  .invoice-meta { margin-left: 0 !important; }
}
@media print {
  @page { size: A4; margin: 12mm; }
  .print-body { background: #fff; }
  .print-bar { display: none !important; }
  .invoice-sheet { box-shadow: none; margin: 0; padding: 0; max-width: none; border-radius: 0; }
  .invoice-table thead th { background: #f6f0f0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .invoice-table tr { page-break-inside: avoid; }
}
.po-result.is-muted { opacity: .55; }
/* Sales invoice: A5 size (print.php?size=a5) */
.invoice-sheet.is-a5 { max-width: 620px; padding: 24px 26px; }
.invoice-sheet.is-a5 .invoice-brand { font-size: 1.25rem; }
.invoice-sheet.is-a5 .invoice-title { font-size: 1.05rem; }
.invoice-sheet.is-a5 .invoice-table { font-size: .76rem; }
.invoice-sheet.is-a5 .invoice-table td, .invoice-sheet.is-a5 .invoice-table th { padding: .3rem .35rem; }
.invoice-sheet.is-a5 .invoice-totals { min-width: 230px; font-size: .8rem; }
.invoice-sheet.is-a5 .small, .invoice-sheet.is-a5 .invoice-meta th, .invoice-sheet.is-a5 .invoice-meta td { font-size: .74rem; }
.invoice-sheet.is-a5 .invoice-foot { margin-top: 24px; }
.invoice-cancelled { border: 2px solid var(--bl-danger); color: var(--bl-danger); font-weight: 700; letter-spacing: .15em; text-align: center; padding: 6px; margin: 12px 0; border-radius: 6px; }
.invoice-terms { white-space: pre-line; }
.print-bar .btn-group .btn.active { background: var(--bl-ink); color: #fff; }
.invoice-item-name { display: inline-block; min-width: 150px; }
.invoice-sheet.is-a5 .invoice-pay td:not(:nth-child(3)) { white-space: nowrap; }
.period-form input[type=date] { flex: 1 1 8rem; min-width: 0; width: auto; }

/* ---- BLOOMZ invoice layout (modules/sales/print.php, same as the PDF): compact, many items per page ---- */
.bz-invoice { --bz-gold: #c7963e; --bz-gold-dark: #a07632; --bz-beige: #f5eee3; --bz-rule: #e1e1e1; max-width: 820px;
  font-family: Arial, Helvetica, sans-serif; color: #222; font-size: 12.5px; display: flex; flex-direction: column; }
.bz-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 10px; border-bottom: 2px solid var(--bz-gold); }
.bz-brand { text-align: center; }
.bz-logo { height: 70px; width: auto; display: block; margin: 0 auto; }
.bz-wordmark { font-family: var(--bl-font-serif); font-size: 2rem; color: var(--bz-gold); letter-spacing: .12em; }
.bz-tagline { font-size: 8px; letter-spacing: .28em; margin-top: 3px; }
.bz-head-right { text-align: right; }
.bz-title { font-family: Arial, Helvetica, sans-serif; font-weight: 700; font-size: 21px; letter-spacing: .3em; margin: 2px -.3em 6px 0; }
.bz-meta { margin-left: auto; font-size: 11.5px; }
.bz-meta th { font-weight: 400; color: #707070; text-align: right; padding: 0 14px 1px 0; }
.bz-meta td { font-weight: 700; text-align: right; padding: 0 0 1px; }
.bz-section { font-family: Arial, Helvetica, sans-serif; font-size: 9px; font-weight: 700; letter-spacing: .26em; text-transform: uppercase;
  border-bottom: 1px solid var(--bz-rule); padding-bottom: 5px; margin: 0 0 7px; }
.bz-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin: 14px 0 4px; }
.bz-field { line-height: 1.45; }
.bz-label { font-weight: 700; }
.bz-value.is-soft { color: #707070; }
.bz-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 12px; }
.bz-table th { background: var(--bz-beige); font-size: 10.5px; font-weight: 700; text-align: center; padding: 7px 6px; line-height: 1.15;
  -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.bz-table th:first-child, .bz-table td:first-child { text-align: left; width: 5%; }
.bz-table td { text-align: center; padding: 5px 6px; border-bottom: 1px solid var(--bz-rule); }
.bz-table .bz-desc { min-width: 140px; }
.bz-table .bz-discount td { background: #fbf8f2; color: var(--bz-gold-dark); font-style: italic; border-bottom: 0;
  -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.bz-bottom { display: flex; gap: 24px; align-items: flex-start; margin-top: 8px; }
.bz-notes { flex: 1 1 48%; padding-top: 6px; font-size: 11.5px; }
.bz-notes-text { color: #707070; white-space: pre-line; }
.bz-totals { flex: 0 0 48%; border-collapse: collapse; font-size: 12px; }
.bz-totals th { font-weight: 400; padding: 5px 0; border-bottom: 1px solid var(--bz-rule); }
.bz-totals th small { font-size: 9px; color: #707070; }
.bz-totals td { text-align: right; font-weight: 700; padding: 5px 6px 5px 10px; border-bottom: 1px solid var(--bz-rule); white-space: nowrap; }
.bz-totals .bz-grand th, .bz-totals .bz-grand td { font-size: 17px; font-weight: 700; border-top: 2px solid var(--bz-gold); border-bottom: 2px solid var(--bz-gold); padding: 8px 6px 8px 2px; }
.bz-totals .bz-after th, .bz-totals .bz-after td { font-size: 11.5px; font-weight: 400; border-bottom: 0; padding: 3px 6px 0 0; }
.bz-totals .bz-after.is-due th, .bz-totals .bz-after.is-due td { color: var(--bl-danger); font-weight: 700; }
.bz-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 28px; padding-top: 10px; border-top: 1px solid #ead6b0; }
.bz-social { flex: 0 0 140px; text-align: center; font-size: 9.5px; line-height: 1.3; }
.bz-social img { width: 66px; height: 66px; display: block; margin: 0 auto 3px; }
.bz-social strong, .bz-social span { display: block; white-space: nowrap; }
.bz-social span { color: #707070; }
.bz-foot-mid { flex: 1; text-align: center; }
.bz-divider { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--bz-gold); }
.bz-divider span { width: 80px; height: 1px; background: var(--bz-gold); }
.bz-divider i { font-style: normal; font-size: 10px; }
.bz-thanks { font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-weight: 600; font-size: 21px; color: var(--bz-gold-dark); margin: 2px 0 4px; }
.bz-retain { font-size: 9.5px; color: #707070; }
.bz-invoice.is-a5 { max-width: 580px; font-size: 10.5px; }
.bz-invoice.is-a5 .bz-logo { height: 52px; }
.bz-invoice.is-a5 .bz-title { font-size: 15px; }
.bz-invoice.is-a5 .bz-meta, .bz-invoice.is-a5 .bz-notes { font-size: 9.5px; }
.bz-invoice.is-a5 .bz-table { font-size: 9.5px; }
.bz-invoice.is-a5 .bz-table th { font-size: 8.5px; padding: 5px 4px; }
.bz-invoice.is-a5 .bz-table td { padding: 3px 4px; }
.bz-invoice.is-a5 .bz-totals { font-size: 10px; }
.bz-invoice.is-a5 .bz-totals .bz-grand th, .bz-invoice.is-a5 .bz-totals .bz-grand td { font-size: 13.5px; }
.bz-invoice.is-a5 .bz-thanks { font-size: 15px; }
.bz-invoice.is-a5 .bz-social { flex-basis: 90px; font-size: 8px; }
.bz-invoice.is-a5 .bz-social img { width: 48px; height: 48px; }
@media screen and (max-width: 575.98px) {
  .bz-head { flex-direction: column; align-items: center; }
  .bz-head-right { text-align: center; }
  .bz-cols { grid-template-columns: 1fr; gap: 10px; }
  .bz-bottom { flex-direction: column-reverse; }
  .bz-totals { width: 100%; flex-basis: auto; }
  .bz-foot { flex-wrap: wrap; }
  .bz-foot-mid { order: -1; flex-basis: 100%; }
  .bz-social { flex: 1 1 45%; }
}
@media print {
  @page { margin: 10mm; }
  .bz-invoice { min-height: 268mm; }
  .bz-invoice.is-a5 { min-height: 186mm; }
  .bz-invoice .bz-foot { margin-top: auto; }
  .bz-invoice { font-size: 11px; }
  .bz-invoice .bz-logo { height: 58px; }
  .bz-invoice .bz-field { line-height: 1.35; }
  .bz-invoice .bz-table { font-size: 10.5px; margin-top: 8px; }
  .bz-invoice .bz-table th { font-size: 9.5px; padding: 5px 5px; }
  .bz-invoice .bz-table td { padding: 3px 5px; }
  .bz-invoice .bz-totals { font-size: 10.5px; }
  .bz-invoice .bz-totals th, .bz-invoice .bz-totals td { padding-top: 3px; padding-bottom: 3px; }
  .bz-invoice .bz-totals .bz-grand th, .bz-invoice .bz-totals .bz-grand td { font-size: 15px; padding-top: 6px; padding-bottom: 6px; }
  .bz-invoice .bz-thanks { font-size: 18px; }
  .bz-invoice .bz-social img { width: 58px; height: 58px; }
  .bz-invoice.is-a5 { font-size: 9px; }
  .bz-invoice.is-a5 .bz-logo { height: 40px; }
  .bz-invoice.is-a5 .bz-title { font-size: 13px; }
  .bz-invoice.is-a5 .bz-table { font-size: 8.5px; }
  .bz-invoice.is-a5 .bz-table th { font-size: 7.5px; padding: 4px 3px; }
  .bz-invoice.is-a5 .bz-table td { padding: 2px 3px; }
  .bz-invoice.is-a5 .bz-totals, .bz-invoice.is-a5 .bz-meta, .bz-invoice.is-a5 .bz-notes { font-size: 8.5px; }
  .bz-invoice.is-a5 .bz-totals .bz-grand th, .bz-invoice.is-a5 .bz-totals .bz-grand td { font-size: 11.5px; }
  .bz-invoice.is-a5 .bz-thanks { font-size: 13px; }
  .bz-invoice.is-a5 .bz-social { flex-basis: 105px; font-size: 7px; }
  .bz-invoice.is-a5 .bz-social img { width: 40px; height: 40px; }
  .bz-invoice.is-a5 .bz-foot { padding-top: 6px; }
  .bz-invoice .bz-table tr, .bz-invoice .bz-bottom, .bz-foot { page-break-inside: avoid; }
}

/* ---------- Reports (modules/reports/) ---------- */
.report-card { transition: transform .15s ease, box-shadow .15s ease; }
.report-card:hover { transform: translateY(-2px); }
.report-icon { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(201, 162, 126, .15); color: #a07850; }
.table-report .rr-head td { font-weight: 600; text-transform: uppercase; font-size: .75rem; letter-spacing: .04em; color: #7a6a5a; background: #faf6f1; }
.table-report .rr-sub td { font-weight: 600; border-top: 1px solid #e6dccf; }
.table-report .rr-total td { font-weight: 700; background: #f6efe6; border-top: 2px solid #d9c7b0; }
.table-report .rr-muted td { color: #a9a29a; }
.report-chart .chart-box { height: 280px; }
.report-print-head { display: none; }
@media print {
  .report-print-head { display: block; margin-bottom: 8px; font-size: 12px; }
  .table-report { font-size: 11px; }
  .table-report .rr-head td, .table-report .rr-total td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .report-chart { page-break-inside: avoid; }
}

/* ---- Two-tone colour swatches (update 2026-11) ---------------------- */
.swatch.is-two-tone, .cat-swatch.is-two-tone { border-color: rgba(0,0,0,.22); }
.two-tone-check { padding-left: 1.4em; min-height: 0; color: var(--bs-secondary-color, #6c757d); white-space: nowrap; }
.two-tone-check .form-check-input { margin-left: -1.4em; margin-top: .2em; }
.price-margin-box { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; padding: .75rem; border-radius: .75rem; background: rgba(201,165,77,.08); border: 1px solid rgba(201,165,77,.25); }

/* ---- Bank and gateway pages (update 2026-11) ------------------------- */
.banking-tabs .nav-link { color: var(--bl-ink-soft); border: 1px solid var(--bl-line); border-radius: 999px; padding: 5px 14px; background: #fff; }
.banking-tabs .nav-link.active { background: var(--bl-ink, #2b2b2b); color: #fff; border-color: transparent; }
.sticky-totals { position: sticky; bottom: 0; z-index: 5; background: #fff; border-top: 1px solid var(--bl-line); box-shadow: 0 -6px 18px rgba(0,0,0,.05); }
.sticky-totals .tot-label { font-size: .75rem; color: var(--bl-ink-soft); text-transform: uppercase; letter-spacing: .04em; }
.sticky-totals .tot-value { font-weight: 600; font-size: 1.05rem; }
.diff-ok { color: #2e7d32; }
.diff-bad { color: #c62828; }
tr.is-ticked { background: rgba(46,125,50,.05); }
.check-col { width: 38px; }
.stmt-amount-in { color: #2e7d32; }
.stmt-amount-out { color: #c62828; }
.map-table th { white-space: nowrap; font-size: .8rem; }
.map-table td { font-size: .8rem; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Bank statements review: keep columns readable on phones (the table scrolls sideways) */
.stmt-app-col { min-width: 200px; }
.stmt-desc-col { min-width: 160px; }
@media (max-width: 767.98px) { .sticky-totals { padding: .6rem .9rem !important; } .sticky-totals .tot-value { font-size: .95rem; } }

/* ---- Product form: several categories (tick boxes) ---- */
.cat-ticks { display: flex; flex-wrap: wrap; gap: .35rem .5rem; max-height: 14rem; overflow-y: auto; padding: .5rem .6rem;
  border: 1px solid var(--bs-border-color, #e5e0dc); border-radius: .6rem; background: rgba(0,0,0,.015); }
.cat-ticks.is-invalid { border-color: #dc3545; }
.cat-tick { margin: 0; padding: .2rem .6rem .2rem 1.9rem; border-radius: 2rem; background: #fff; border: 1px solid var(--bs-border-color, #e5e0dc); font-size: .875rem; }
.cat-tick .cat-main-tag { display: none; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: #a07a2e; font-weight: 600; }
.cat-tick.is-main { border-color: #c9a45c; background: #fbf6ec; }
.cat-tick.is-main .cat-main-tag { display: inline; }
.cat-tick .form-check-input:disabled ~ .form-check-label { opacity: 1; }

/* ---- Purchase import preview ---- */
.table-import .import-num { width: 5.5rem; min-width: 4.5rem; }
.table-import .import-vat { width: 4.5rem; }
.table-import input.form-control-sm { min-width: 4.5rem; }
.table-import tr.import-skipped td { text-decoration: line-through; text-decoration-color: rgba(0,0,0,.25); }
.table-import tr.import-skipped td:last-child { text-decoration: none; }
.table-import tr.import-msg td { border-top: 0; }

/* Product import preview: one heading row per product */
.table-import tr.import-group td { background: #fbf6f0; border-bottom: 1px solid rgba(0,0,0,.06); }
.table-import tr.import-msg td, .table-import tr.import-group td { white-space: normal; }
.table-import input.import-wide { min-width: 7rem; }
.table-import.table-products > tbody td { padding: 8px 6px; }
.table-import.table-products .import-num { width: 4.6rem; min-width: 4rem; }

/* Barcode labels (modules/products/labels.php, audit roadmap P4) */
.labels-body .label-pages { display: grid; gap: 0; margin: 12px auto 32px; background: #fff; }
.labels-sheet .label-pages { grid-template-columns: repeat(3, 70mm); grid-auto-rows: 37mm; width: 210mm; padding: 0; page: labelsheet; }
.labels-roll .label-pages { grid-template-columns: 50mm; grid-auto-rows: 25mm; width: 50mm; page: labelroll; }
.label-cell { overflow: hidden; padding: 2.5mm 3.5mm 2mm; display: flex; flex-direction: column; color: #000; font-family: Arial, Helvetica, sans-serif; outline: 1px dashed #e4d6d6; outline-offset: -1px; }
.labels-roll .label-cell { padding: 1.2mm 2mm 1mm; }
.label-brand { font-size: 6.5pt; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; line-height: 1.1; }
.label-name { font-size: 8pt; line-height: 1.15; max-height: 2.3em; overflow: hidden; margin: .4mm 0 .8mm; }
.labels-roll .label-name { font-size: 7pt; max-height: 1.15em; white-space: nowrap; text-overflow: ellipsis; }
.label-bars { flex: 1 1 auto; min-height: 8mm; }
.label-bars .barcode-svg { width: 100%; height: 100%; display: block; }
.label-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 2mm; font-size: 7pt; line-height: 1.2; margin-top: .6mm; }
.label-code { font-family: "Courier New", monospace; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.label-price { font-weight: 700; font-size: 9pt; white-space: nowrap; }
.labels-roll .label-price { font-size: 8pt; }
@page labelsheet { size: A4; margin: 0; }
@page labelroll { size: 50mm 25mm; margin: 0; }
@media print {
  .labels-body .label-pages { margin: 0; }
  .label-cell { outline: none; }
  .labels-sheet .label-cell { break-inside: avoid; }
  .labels-roll .label-cell { break-after: page; }
}
@media screen and (max-width: 767.98px) {
  .labels-sheet .label-pages { transform-origin: top left; zoom: .45; }
}
