:root {
  --rose: #b8447a;
  --rose-dark: #8f2f5c;
  --gold: #c99a4a;
  --cream: #fbf6f2;
  --ink: #3a2233;
  --sidebar-w: 250px;
}

html {
  font-size: 14px; /* scales all Bootstrap rem-based sizing (buttons, forms, badges, spacing) down proportionally */
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--cream);
  color: var(--ink);
  font-size: .95rem;
}

h1, h2, h3, .brand { font-family: 'Playfair Display', serif; }

/* ---------- Topbar ---------- */
.topbar {
  background: linear-gradient(90deg, var(--rose-dark), var(--rose));
  padding: .6rem 1rem;
  z-index: 1050;
}
.brand { color: #fff !important; font-weight: 700; font-size: 1.3rem; }
.brand .tagline {
  font-family: 'Poppins', sans-serif;
  font-size: .7rem;
  font-weight: 400;
  color: #f3d9e6;
  margin-left: .6rem;
  vertical-align: middle;
}
.role-badge { background: var(--gold); color: #fff; letter-spacing: .5px; font-size: .65rem; }

/* ---------- Layout ---------- */
.app-wrapper { display: flex; min-height: calc(100vh - 56px); }

.sidebar {
  width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid #eee0e8;
  flex-shrink: 0;
  transition: transform .25s ease;
}
.sidebar-inner { padding: 1rem 0; position: sticky; top: 0px; }

.nav-section {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #b98aa5;
  font-weight: 600;
  padding: 1rem 1.2rem .3rem;
}
.sidebar .nav-link {
  color: var(--ink);
  padding: .55rem 1.2rem;
  font-size: .92rem;
  border-left: 3px solid transparent;
}
.sidebar .nav-link i { width: 22px; color: var(--rose); }
.sidebar .nav-link:hover { background: #fbeef4; }
.sidebar .nav-link.active {
  background: #fbeef4;
  border-left-color: var(--rose);
  font-weight: 600;
  color: var(--rose-dark);
}

.main-content { flex-grow: 1; min-width: 0; padding-bottom: 3rem; }

.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 1040;
}

@media (max-width: 991.98px) {
  .sidebar {
    position: fixed;
    top: 45px; bottom: 0; left: 0;
    transform: translateX(-100%);
    z-index: 1045;
    overflow-y: auto;
  }
  .sidebar.show { transform: translateX(0); }
  .sidebar-backdrop.show { display: block; }
}

/* ---------- Cards / widgets ---------- */
.stat-card {
  border: none;
  border-radius: 14px;
  color: #fff;
  padding: 1.25rem;
  box-shadow: 0 6px 18px rgba(184,68,122,.15);
}
.stat-card .stat-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
}
.stat-card.c1 { background: linear-gradient(135deg,#c15b8e,#8f2f5c); }
.stat-card.c2 { background: linear-gradient(135deg,#d9a24b,#a97527); }
.stat-card.c3 { background: linear-gradient(135deg,#6a8fc9,#3c5f9c); }
.stat-card.c4 { background: linear-gradient(135deg,#5cae86,#357a56); }
.stat-card h3 { font-family:'Poppins',sans-serif; font-weight:700; margin:0; }
.stat-card .label { font-size:.8rem; opacity:.9; }

.section-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #f1e2ea;
  box-shadow: 0 2px 10px rgba(0,0,0,.03);
}

.page-header { padding: 1.25rem 1.5rem .25rem; }
.page-header h4 { font-weight: 700; color: var(--rose-dark); }

.btn-brand { background: var(--rose); border-color: var(--rose); color: #fff; }
.btn-brand:hover { background: var(--rose-dark); border-color: var(--rose-dark); color:#fff; }
.btn-outline-brand { border-color: var(--rose); color: var(--rose); }
.btn-outline-brand:hover { background: var(--rose); color: #fff; }

.badge-low { background: #e35d6a; }
.badge-ok  { background: #46a672; }
.badge-partner { background: var(--gold); }

.table thead th {
  background: #fbeef4;
  color: var(--rose-dark);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: none;
}
.table-hover tbody tr:hover { background: #fef8fb; }

.login-wrapper {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--rose-dark), var(--rose) 60%, var(--gold));
  padding: 1rem;
}
.login-card {
  max-width: 420px; width: 100%;
  border-radius: 18px; border: none;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.login-card .brand-head { text-align:center; padding: 2rem 1.5rem 0; }
.login-card .brand-head i { font-size: 2.2rem; color: var(--rose); }

.thumb {
  width: 42px; height: 42px; object-fit: cover; border-radius: 8px;
  border: 1px solid #eee;
}

.stock-qty-low { color:#c62f3d; font-weight:600; }
.stock-qty-ok { color:#2f7d52; font-weight:600; }

/* ---------- Select2 (searchable dropdowns) ---------- */
.select2-container--default .select2-selection--single {
  height: 2.375rem;
  border: 1px solid #ced4da;
  border-radius: .375rem;
  display: flex;
  align-items: center;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 1.5;
  padding-left: .75rem;
  color: var(--ink);
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 2.25rem;
}
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
  border-color: var(--rose);
  box-shadow: 0 0 0 .2rem rgba(184,68,122,.15);
}
.select2-dropdown {
  border-color: #ced4da;
  z-index: 2000;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: var(--rose);
}
.select2-search--dropdown .select2-search__field {
  border-radius: .375rem;
  border: 1px solid #ced4da;
  padding: .35rem .5rem;
}
/* Compact variant inside small filter bars */
table .select2-container--default .select2-selection--single,
.form-select-sm ~ .select2-container .select2-selection--single {
  height: 1.9375rem;
}
table .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 1.8125rem;
}

/* ---------- Flatpickr (date picker) ---------- */
.flatpickr-day.selected, .flatpickr-day.selected:hover {
  background: var(--rose);
  border-color: var(--rose);
}
.flatpickr-day.today { border-color: var(--rose); }
.flatpickr-day.today:hover { background: var(--rose); color: #fff; }
.flatpickr-months .flatpickr-month,
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-weekdays { background: #fbeef4; }
.flatpickr-current-month input.cur-year { color: var(--rose-dark); }
span.flatpickr-weekday { color: var(--rose-dark); }
.flatpickr-day:hover { background: #fbeef4; }
