/* Deliberate visual redesign layer - loaded last so it wins over style.css/
   custom.css defaults. Overrides Bootstrap 5's per-component CSS variables
   (--bs-primary, --bs-border-radius, --bs-box-shadow*, --bs-card-*, ...) so
   the new palette/shape language cascades to every page automatically. */

:root {
  --bs-primary: #18a06b;
  --bs-primary-rgb: 24, 160, 107;
  --bs-primary-text-emphasis: #148a5c;
  --bs-primary-bg-subtle: #eaf5ef;
  --bs-primary-border-subtle: #d9e8e1;
  --panel-sidebar-primary: #0f3d2e;

  --bs-border-radius-sm: 0.5rem;
  --bs-border-radius: 0.65rem;
  --bs-border-radius-lg: 0.9rem;
  --bs-border-radius-xl: 1.25rem;

  --bs-box-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.08);
  --bs-box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  --bs-box-shadow-lg: 0 12px 28px rgba(15, 23, 42, 0.12);

  --bs-body-color: #1e2433;
  --bs-body-bg: #f4faf7;
  --bs-link-color: var(--bs-primary);
  --bs-link-hover-color: var(--bs-primary-text-emphasis);
}

body {
  background-color: var(--bs-body-bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* --- Cards --- */
.card {
  border-color: rgba(15, 23, 42, 0.06);
  box-shadow: var(--bs-box-shadow-sm);
  border-radius: var(--bs-border-radius-lg);
}
.card-header {
  background-color: transparent;
  border-bottom-color: rgba(15, 23, 42, 0.06);
  font-weight: 600;
}
.card-footer {
  background-color: transparent;
  border-top-color: rgba(15, 23, 42, 0.06);
}

/* --- Buttons --- */
.btn {
  border-radius: var(--bs-border-radius);
  font-weight: 600;
  transition: box-shadow 0.15s ease, transform 0.05s ease, background-color 0.15s ease;
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  box-shadow: 0 2px 6px rgba(24, 160, 107, 0.35);
}
.btn-primary:hover, .btn-primary:focus {
  box-shadow: 0 4px 10px rgba(24, 160, 107, 0.4);
}
.btn-outline-primary:hover {
  box-shadow: 0 2px 6px rgba(24, 160, 107, 0.25);
}

/* --- Forms --- */
.form-control, .form-select {
  border-radius: var(--bs-border-radius-sm);
}
.form-control:focus, .form-select:focus {
  border-color: var(--bs-primary-border-subtle);
  box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.15);
}

/* --- Tables --- */
.table {
  --bs-table-border-color: rgba(15, 23, 42, 0.06);
}
.table > :not(caption) > * > * {
  padding: 0.85rem 1rem;
}
.table-hover > tbody > tr:hover > * {
  background-color: rgba(var(--bs-primary-rgb), 0.045);
}

/* --- Badges / status pills --- */
.badge {
  border-radius: 50rem;
  font-weight: 600;
  padding: 0.4em 0.85em;
}

/* --- Pagination --- */
.page-link {
  border-radius: var(--bs-border-radius-sm);
  margin-inline: 2px;
  border: none;
  color: var(--bs-body-color);
}
.page-item.active .page-link {
  background-color: var(--bs-primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(24, 160, 107, 0.35);
}

/* --- Sidebar --- */
.aside-header {
  background-color: var(--panel-sidebar-primary);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
.navbar-logo {
  color: #fff !important;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.aside-nav .nav-link {
  border-radius: var(--bs-border-radius-sm);
  font-weight: 500;
  transition: background-color 0.15s ease;
}
.aside-nav .nav-link.active, .aside-nav .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
}
.aside-nav .nav-link.active {
  box-shadow: inset 3px 0 0 0 #4fd1a5;
  background-color: rgba(255, 255, 255, 0.14);
  font-weight: 600;
}
.aside-nav > .nav-item {
  letter-spacing: 0.04em;
}

/* --- Topbar --- */
.header {
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
.avatar-initials.admin-avatar {
  width: 32px;
  height: 32px;
  background: var(--bs-primary);
  color: #fff;
  font-size: 0.8rem;
}

/* --- List toolbar: pill search input --- */
.search-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 50rem;
  padding: 0.5rem 1rem;
  width: 340px;
  flex: 0 0 auto;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search-pill:focus-within {
  border-color: var(--bs-primary-border-subtle);
  box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.15);
}
.search-pill i {
  color: #94a3b8;
  font-size: 0.9rem;
}
.search-pill input {
  border: none;
  outline: none;
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  background: transparent;
}

/* --- List rows: product/entity thumbnail --- */
.product-thumb {
  width: 52px;
  height: 52px;
  border-radius: var(--bs-border-radius);
  background: #f1f2fb;
  flex-shrink: 0;
  font-size: 1.1rem;
}

/* --- List rows: grouped row actions --- */
.action-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: #f4faf7;
  border-radius: 50rem;
  padding: 3px;
}
.action-pill .btn {
  border: none;
  border-radius: 50rem;
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  box-shadow: none;
}
.action-pill .btn:hover {
  background: #fff;
  color: var(--bs-primary);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}
.action-pill .btn.text-danger:hover {
  color: #dc3545 !important;
}

/* --- Shared compact list-table convention (products, orders, warehouses, etc.):
   ID column first, values centered, compact single-line rows, horizontal
   action icons, whole row clickable through to a detail/view page. Apply
   class="admin-list-table" to the <table>, class="clickable-row" to each
   <tr>, and class="action-pill-sm" alongside "action-pill" on the actions
   cell wrapper for every list page going forward. --- */
.admin-list-table > :not(caption) > * > * {
  padding: 0.6rem 0.75rem;
  height: 56px;
  line-height: 1.2;
}
.admin-list-table tbody tr.clickable-row {
  cursor: pointer;
}
.admin-list-table .action-pill-sm {
  padding: 3px;
  gap: 3px;
}
.admin-list-table .action-pill-sm .btn.icon-btn {
  --size: 1.8rem;
  width: 1.8rem !important;
  height: 1.8rem !important;
  font-size: 0.85rem;
}
/* Block-level elements (StatusSwitcher's <label>, etc.) ignore a parent's
   text-align, so a plain "text-center" td left them stuck to the left edge -
   auto side-margins are needed to actually center them. */
.admin-list-table td.text-center > .switcher,
.admin-list-table td.text-center > .switcher-sm {
  margin-left: auto;
  margin-right: auto;
}
.admin-list-table .switcher-sm {
  inline-size: 2.75rem;
  block-size: 1.6rem;
}
.admin-list-table .switcher-sm .switcher_control {
  inline-size: 2.75rem;
  block-size: 1.6rem;
}
.admin-list-table .switcher-sm .switcher_control::after {
  inline-size: 1.3rem;
  block-size: 1.3rem;
}
.admin-list-table .switcher-sm .switcher_input:checked ~ .switcher_control::after {
  inset-inline-start: calc(2.75rem - 1.3rem - 0.15rem);
}
.list-thumb-sm {
  width: 34px;
  height: 34px;
  border-radius: 0.4rem;
  background: #f1f2fb;
  flex-shrink: 0;
}

/* --- Avatar initials (customers, admins) --- */
.avatar-initials {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bs-primary-bg-subtle);
  color: var(--bs-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
}

/* --- Empty state --- */
.empty-state-icon {
  color: var(--bs-primary);
  background-color: var(--bs-primary-bg-subtle);
}

/* --- File inputs (thumbnail/gallery uploaders, etc.) --- */
input[type="file"].form-control,
input[type="file"] {
  border: 1px dashed rgba(15, 23, 42, 0.18);
  border-radius: var(--bs-border-radius);
  background: #f8f9fd;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
}
input[type="file"]:hover {
  border-color: var(--bs-primary-border-subtle);
  background: var(--bs-primary-bg-subtle);
}
input[type="file"]::file-selector-button {
  border: none;
  border-radius: 50rem;
  padding: 0.4rem 0.9rem;
  margin-right: 0.75rem;
  background: var(--bs-primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
input[type="file"]::file-selector-button:hover {
  background: var(--bs-primary-text-emphasis);
}
