/* ─────────────────────────────────────────────────────────────
   Batchtastic — style.css
   Version: 2.7.0
   Updated: 2026-04-09
   Changes: Toast notification system — container, toast types,
            slide-in/out animations, close button
───────────────────────────────────────────────────────────── */

* {
  box-sizing: border-box;
}

.hidden {
  display: none !important;
}

body {
  margin: 0;
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  background: #f5f6fa;
  color: #1f2937;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand h1 {
  margin: 0 0 20px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section {
  display: flex;
  flex-direction: column;
}

.nav-main {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  color: #374151;
  font-weight: 500;
  transition: background 0.12s ease;
}

.nav-main:hover {
  background: #f3f4f6;
}

.nav-main.active {
  background: #eef2ff;
  color: #1d4ed8;
  font-weight: 600;
}

.nav-submenu {
  margin-top: 2px;
  margin-left: 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-submenu.hidden {
  display: none;
}

.nav-sub {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  color: #6b7280;
  transition: background 0.12s ease;
}

.nav-sub:hover {
  background: #f9fafb;
  color: #374151;
}

.nav-sub.active {
  background: #e0e7ff;
  color: #1d4ed8;
  font-weight: 600;
}

.main-content {
  flex: 1;
  padding: 24px 28px;
  min-width: 0;
}

.content-view.hidden {
  display: none;
}

.page-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.page-top h2 {
  margin: 0 0 3px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.page-subtitle {
  margin: 0;
  color: #9ca3af;
  font-size: 12.5px;
}

.primary-btn,
.secondary-btn {
  border: none;
  padding: 8px 14px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.primary-btn {
  background: #2563eb;
  color: #fff;
}

.primary-btn:hover {
  background: #1d4ed8;
}

.secondary-btn {
  background: #fff;
  color: #1f2937;
  border: 1px solid #d1d5db;
}

.secondary-btn:hover {
  background: #f9fafb;
}

.small-btn {
  padding: 8px 12px;
  font-size: 13px;
}

.text-link-btn {
  background: none;
  border: none;
  color: #2563eb;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.text-link-btn:hover {
  text-decoration: underline;
}

.summary-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.summary-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 16px;
}

.summary-label {
  font-size: 11.5px;
  font-weight: 500;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.summary-value {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.summary-value.danger { color: #dc2626; }
.summary-value.success { color: #16a34a; }

.summary-sub {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 4px;
}

/* ─── Alerts Button ───────────────────────────────────── */

.alerts-btn-wrapper {
  position: relative;
}

.alerts-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: none;
  border-radius: 7px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  background: #fef3c7;
  color: #92400e;
  transition: background 0.12s ease;
}

.alerts-btn:hover {
  background: #fde68a;
}

.alerts-btn.seen {
  background: #f3f4f6;
  color: #6b7280;
}

.alerts-btn.seen:hover {
  background: #e5e7eb;
}

.alerts-btn-badge {
  background: #f59e0b;
  color: #fff;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  line-height: 1.4;
}

.alerts-btn.seen .alerts-btn-badge {
  background: #9ca3af;
}

/* ─── Alerts Dropdown ─────────────────────────────────── */

.alerts-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
  z-index: 1100;
  overflow: hidden;
}

.alerts-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
}

.alerts-dropdown-title {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
}

.alerts-dropdown-count {
  font-size: 11px;
  font-weight: 600;
  background: #fef3c7;
  color: #92400e;
  padding: 2px 8px;
  border-radius: 999px;
}

.alert-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 16px;
  border-bottom: 1px solid #f9fafb;
}

.alert-item:last-child {
  border-bottom: none;
}

.alert-item-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f59e0b;
  flex-shrink: 0;
  margin-top: 5px;
}

.alert-item-dot.red {
  background: #ef4444;
}

.alert-item-body {
  flex: 1;
}

.alert-item-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 2px;
}

.alert-item-desc {
  font-size: 11.5px;
  color: #6b7280;
  line-height: 1.5;
}

.panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0;
  margin-bottom: 20px;
  overflow: hidden;
}

.table-wrap {
  overflow-x: auto;
}

.materials-table {
  width: 100%;
  border-collapse: collapse;
}

.materials-table th {
  text-align: left;
  padding: 9px 14px;
  font-size: 10.5px;
  color: #6b7280;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  background: #f3f4f6;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
}

.materials-table th.sortable-col:hover {
  background: #e9eaec;
  color: #374151;
}

.sort-arrow {
  display: inline-block;
  margin-left: 5px;
  font-size: 9px;
  color: #2563eb;
  font-weight: 700;
}

.materials-table td {
  text-align: left;
  padding: 0 14px;
  height: 40px;
  vertical-align: middle;
  font-size: 13px;
  color: #374151;
  box-shadow: inset 0 -1px 0 #f3f4f6;
}

.material-row:last-child td {
  box-shadow: none;
}

.material-row {
  cursor: pointer;
}

.material-row:hover td {
  background: #f9fafb;
}

.material-row.low-stock td {
  background: #fffafa;
}

.material-row.low-stock:hover td {
  background: #fef2f2;
}

.material-name {
  font-weight: 500;
  color: #111827;
}

.low-stock-text {
  color: #ef4444;
  font-weight: 500;
}

.category-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.empty-cell,
.placeholder-text {
  color: #6b7280;
  font-size: 14px;
}

/* Drawer */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(560px, 100%);
  height: 100vh;
  background: #ffffff;
  border-left: 1px solid #e5e7eb;
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid #e5e7eb;
}

.drawer-header h3 {
  margin: 0 0 4px;
  font-size: 24px;
}

.drawer-subtitle {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
}

.drawer-close-btn {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
}

.drawer-close-btn:hover {
  color: #111827;
}

.drawer-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.full-width {
  grid-column: 1 / -1;
}

.label-with-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

label {
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

input,
select,
textarea {
  padding: 9px 10px;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  color: #1f2937;
}

select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #2563eb;
}

textarea {
  resize: vertical;
}

.drawer-actions {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.drawer-actions-right {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.danger-btn {
  border: none;
  padding: 8px 14px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  background: #fff;
  color: #dc2626;
  border: 1px solid #fca5a5;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.danger-btn:hover {
  background: #fef2f2;
  border-color: #dc2626;
}

/* Disabled/grayed stock field in edit mode */
input.stock-readonly {
  background: #f9fafb;
  color: #9ca3af;
  cursor: not-allowed;
  border-color: #e5e7eb;
}

/* Lookup / Category field */
.lookup-wrapper {
  position: relative;
}

.lookup-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  z-index: 1200;
  max-height: 240px;
  overflow-y: auto;
}

.lookup-menu.hidden {
  display: none;
}

.lookup-item {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

.lookup-item:hover {
  background: #f9fafb;
}

.lookup-item-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lookup-create {
  color: #1d4ed8;
  font-weight: 600;
}

.selected-category-preview {
  margin-top: 8px;
}

.selected-category-preview.hidden {
  display: none;
}

/* Calculator Modal + Category Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  z-index: 1099;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(520px, calc(100% - 32px));
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.18);
  transform: translate(-50%, -50%) scale(0.98);
  opacity: 0;
  pointer-events: none;
  z-index: 1100;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
  margin: 0 0 4px;
  font-size: 24px;
}

.modal-subtitle {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
}

.modal-body {
  padding: 20px;
}

.helper-text {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #6b7280;
  font-weight: 400;
}

.calc-result {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}

.modal-actions {
  padding: 0 20px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Color palette */
.color-palette {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
}

.color-swatch {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

.color-swatch.active {
  border-color: #111827;
  box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.12);
}

.custom-color-row {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.hidden-color-input {
  width: 44px;
  height: 36px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

.color-preview-chip {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  display: inline-block;
}

/* Page top actions */
.page-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Dot menu */
.dot-menu-wrapper {
  position: relative;
}

.dot-menu-btn {
  padding: 10px 12px;
  font-size: 18px;
  line-height: 1;
  letter-spacing: 2px;
}

.dot-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
  z-index: 1100;
  min-width: 190px;
  padding: 4px 0;
}

.dot-menu.hidden {
  display: none;
}

.dot-menu-item {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  color: #1f2937;
}

.dot-menu-item:hover {
  background: #f3f4f6;
}

.dot-menu-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 4px 0;
}

/* Columns config modal */
.modal-wide {
  width: min(600px, calc(100% - 32px));
}

.columns-config {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.columns-list-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.columns-list-label {
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
}

.columns-list {
  min-height: 120px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #f9fafb;
}

.columns-list.drag-over {
  background: #eff6ff;
  border-color: #2563eb;
}

.column-drag-item {
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  cursor: grab;
  user-select: none;
  transition: box-shadow 0.15s ease;
}

.column-drag-item:active {
  cursor: grabbing;
}

.column-drag-item.dragging {
  opacity: 0.4;
}

.column-drag-item:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Inline chip input (shared by category & supplier) */
.inline-chip-input {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  cursor: text;
  min-height: 42px;
}

.inline-chip-input:focus-within {
  border-color: #2563eb;
}

.inline-chip-input input {
  flex: 1;
  min-width: 120px;
  border: none;
  padding: 4px 0;
  font-size: 14px;
  outline: none;
  background: transparent;
}

.inline-chip-input input:focus {
  border: none;
  outline: none;
}

.inline-chips {
  display: contents;
}

.inline-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  background: #f3f4f6;
  color: #1f2937;
}

.inline-chip.hidden {
  display: none;
}

.chip-remove {
  background: none;
  border: none;
  font-size: 14px;
  line-height: 1;
  color: inherit;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  opacity: 0.7;
}

.chip-remove:hover {
  opacity: 1;
}

@media (max-width: 900px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
  }

  .summary-row {
    grid-template-columns: 1fr;
  }

  .page-top {
    flex-direction: column;
    align-items: stretch;
  }

  .color-palette {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* ─── Sidebar version ─────────────────────────────────── */

.sidebar-version {
  display: inline-block;
  font-size: 10px;
  color: #9ca3af;
  font-weight: 500;
  margin-top: -16px;
  margin-bottom: 16px;
  letter-spacing: 0.04em;
  cursor: pointer;
  position: relative;
}

.sidebar-version:hover {
  color: #6b7280;
}

.version-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: #1f2937;
  color: #f9fafb;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 11.5px;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  z-index: 9999;
  line-height: 1.8;
  font-family: "Poppins", monospace;
}

.version-popover.hidden {
  display: none;
}

.version-popover-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.version-popover-file {
  color: #9ca3af;
}

.version-popover-num {
  color: #34d399;
  font-weight: 600;
}

/* ─── Table row hover underline ───────────────────────── */

.material-row td.primary-col {
  cursor: pointer;
}

.material-row:hover td.primary-col .material-name,
.material-row:hover td.primary-col {
  text-decoration: underline;
}

.stock-level-cell {
  cursor: pointer;
}

.stock-level-cell:hover span {
  text-decoration: underline;
}

.material-row.active-row td {
  background: #f0f4ff;
}

.material-row.active-row:hover td {
  background: #e8eeff;
}

/* ─── Detail Drawer ───────────────────────────────────── */

.detail-drawer-header {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 14px;
}

.detail-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  padding: 8px;
  margin-top: 2px;
  flex-shrink: 0;
  transition: background 0.12s ease;
}

.detail-back-btn:hover {
  background: #e5e7eb;
}

.detail-back-arrow {
  font-size: 16px;
  color: #374151;
  line-height: 1;
  display: block;
}

.detail-header-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.detail-pre-header {
  margin: 0;
  font-size: 11.5px;
  font-weight: 500;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.4;
}

.detail-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-title-row h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #111827;
  line-height: 1.2;
}

.detail-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-bottom: 6px;
  padding: 16px 0 8px;
  border-top: 1px solid #f3f4f6;
  border-bottom: 1px solid #f3f4f6;
}

.detail-stat {
  padding: 0 16px 10px 0;
}

.full-width-stat {
  grid-column: 1 / -1;
  padding-top: 10px;
  margin-top: 4px;
  border-top: 1px solid #f3f4f6;
  padding-bottom: 0;
}

.detail-stat-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #9ca3af;
  margin-bottom: 3px;
}

.detail-stat-value {
  font-size: 13.5px;
  font-weight: 400;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-stat-value .text-link-btn {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 6px;
  background: #eff6ff;
  border-radius: 4px;
  color: #2563eb;
}

.detail-stat-value .text-link-btn:hover {
  background: #dbeafe;
  text-decoration: none;
}

/* ─── Detail Actions ──────────────────────────────────── */

.detail-actions {
  display: flex;
  gap: 8px;
  margin: 16px 0 20px;
  align-items: center;
}

.detail-action-btn {
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  padding: 8px 16px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.detail-action-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.detail-action-primary {
  background: #1d4ed8;
  color: #fff;
  border-color: #1d4ed8;
}

.detail-action-primary:hover {
  background: #1e40af;
  border-color: #1e40af;
}

.detail-action-dots {
  padding: 8px 12px;
  font-size: 16px;
  letter-spacing: 1px;
  line-height: 1;
}

.detail-header-dot-wrapper {
  position: relative;
}

/* ─── Archive Modal ───────────────────────────────────── */

.archive-modal-text {
  margin: 0;
  font-size: 13.5px;
  color: #374151;
  line-height: 1.6;
}

/* ─── Detail Sections ─────────────────────────────────── */

.detail-section {
  margin-bottom: 20px;
}

.detail-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 10px;
}

.detail-products-empty {
  font-size: 12.5px;
  color: #9ca3af;
  padding: 12px 0;
}

/* ─── Detail Tabs ─────────────────────────────────────── */

.detail-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 14px;
}

.detail-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 16px 8px 0;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  margin-bottom: -1px;
  transition: color 0.12s ease, border-color 0.12s ease;
}

.detail-tab:hover {
  color: #374151;
}

.detail-tab.active {
  color: #111827;
  border-bottom-color: #111827;
  font-weight: 600;
}

.detail-tab-panel {
  min-height: 60px;
}

.detail-tab-panel.hidden {
  display: none;
}

.detail-empty-tab {
  font-size: 13px;
  color: #9ca3af;
  padding: 14px 0;
}

/* ─── Archived Banner ─────────────────────────────────── */

.detail-archived-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 13px;
  color: #92400e;
  font-weight: 500;
}

.warning-btn {
  border: none;
  padding: 8px 14px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  background: #f59e0b;
  color: #fff;
  transition: background 0.12s ease;
}

.warning-btn:hover {
  background: #d97706;
}

.active-filter-btn {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}

/* ─── Stock Update Modal ──────────────────────────────── */

#stockUpdateModal .modal-body .form-group {
  margin-bottom: 14px;
}

#stockUpdateModal .modal-body .form-group:last-child {
  margin-bottom: 0;
}

#stockUpdateModal label {
  margin-bottom: 7px;
}

.stock-qty-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stock-qty-row input {
  flex: 1;
}

.stock-unit-label {
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
  white-space: nowrap;
}

.stock-update-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #f9fafb;
  border: 1px solid #f3f4f6;
  margin: 4px 0 14px;
  font-size: 13px;
  font-weight: 500;
}

.stock-update-preview.hidden {
  display: none;
}

.stock-preview-before {
  color: #6b7280;
}

.stock-preview-arrow {
  color: #9ca3af;
  font-size: 14px;
}

.stock-preview-after {
  color: #111827;
  font-weight: 600;
}

.stock-preview-after.is-increase {
  color: #16a34a;
}

.stock-preview-after.is-decrease {
  color: #dc2626;
}

.stock-preview-label {
  color: #9ca3af;
  font-weight: 400;
}

.stock-advanced-toggle {
  margin-top: 4px;
}

.stock-advanced-toggle .text-link-btn {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
}

.stock-advanced-toggle .text-link-btn:hover {
  color: #374151;
  text-decoration: none;
}

.stock-advanced-body {
  margin-top: 12px;
  padding: 12px 14px;
  background: #f9fafb;
  border: 1px solid #f3f4f6;
  border-radius: 8px;
}

.stock-date-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.stock-radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  margin-bottom: 0;
}

.stock-radio-label input[type="radio"] {
  width: auto;
  padding: 0;
  border: none;
  cursor: pointer;
}

.stock-custom-date {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  width: 100%;
}

.stock-custom-date.hidden {
  display: none;
}

.stock-custom-date input {
  flex: 1;
  font-size: 13px;
}

/* ─── Checkboxes ──────────────────────────────────────── */

.checkbox-col {
  width: 36px;
  padding: 0 8px !important;
}

.row-checkbox {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: #2563eb;
  border: none;
  padding: 0;
  background: none;
}

.material-row.selected td {
  background: #eff6ff;
}

.material-row.selected:hover td {
  background: #dbeafe;
}

/* ─── Bulk Toolbar ────────────────────────────────────── */

.bulk-toolbar {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  background: #1d4ed8;
  border-radius: 10px;
  margin-bottom: 12px;
  gap: 12px;
}

.bulk-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bulk-count {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.bulk-deselect-btn {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}

.bulk-deselect-btn:hover {
  background: rgba(255,255,255,0.3);
}

.bulk-toolbar-right {
  display: flex;
  gap: 8px;
}

.bulk-toolbar-right .primary-btn {
  background: #fff;
  color: #1d4ed8;
}

.bulk-toolbar-right .primary-btn:hover {
  background: #eff6ff;
}

.bulk-toolbar-right .warning-btn {
  background: #f59e0b;
  color: #fff;
}

/* ─── Primary Column ──────────────────────────────────── */

th.primary-col {
  font-weight: 700;
  color: #111827;
}

td.primary-col {
  font-weight: 600;
  color: #111827;
}

/* ─── Column drag item primary styles ─────────────────── */

.column-drag-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.column-drag-label {
  flex: 1;
  font-size: 13px;
}

.column-primary {
  background: #eff6ff !important;
  border-color: #bfdbfe !important;
  cursor: default;
}

.column-primary-badge {
  font-size: 10.5px;
  font-weight: 600;
  background: #2563eb;
  color: #fff;
  border-radius: 999px;
  padding: 2px 8px;
  flex-shrink: 0;
}

.column-set-primary-btn {
  font-size: 11px;
  font-weight: 600;
  background: none;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  padding: 2px 8px;
  color: #6b7280;
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
  transition: background 0.12s ease, color 0.12s ease;
}

.column-set-primary-btn:hover {
  background: #f3f4f6;
  color: #111827;
  border-color: #9ca3af;
}

.bulk-toolbar-right .danger-btn {
  background: #dc2626;
  color: #fff;
  border: none;
}

.bulk-toolbar-right .danger-btn:hover {
  background: #b91c1c;
}

/* ─── Delete Confirm Code ─────────────────────────────── */

.delete-confirm-code-section {
  margin-top: 16px;
}

.delete-confirm-label {
  font-size: 12.5px;
  color: #6b7280;
  margin-bottom: 8px;
}

.delete-confirm-code {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 12px 20px;
  text-align: center;
  margin-bottom: 10px;
  font-family: monospace;
}

.delete-confirm-input {
  width: 100%;
  padding: 10px;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.2em;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-family: monospace;
  box-sizing: border-box;
}

.delete-confirm-input:focus {
  border-color: #dc2626;
  outline: none;
  box-shadow: 0 0 0 2px rgba(220,38,38,0.15);
}

.danger-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.csv-upload-zone {
  border: 2px dashed #d1d5db;
  border-radius: 10px;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
  margin-bottom: 16px;
}

.csv-upload-zone:hover, .csv-upload-zone.drag-over {
  border-color: #2563eb;
  background: #eff6ff;
}

.csv-upload-icon { font-size: 32px; margin-bottom: 10px; }
.csv-upload-text { font-size: 13.5px; font-weight: 600; color: #111827; margin: 0 0 6px; }
.csv-upload-hint { font-size: 12px; color: #9ca3af; margin: 0 0 14px; }

.csv-file-info {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: #0369a1;
  margin-bottom: 16px;
}

.csv-step-label {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.csv-mapping-table {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.csv-mapping-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 8px 12px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.csv-mapping-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 8px 12px;
  border-bottom: 1px solid #f3f4f6;
  align-items: center;
  gap: 8px;
}

.csv-mapping-row:last-child { border-bottom: none; }
.csv-mapping-field { font-size: 12.5px; font-weight: 500; color: #374151; }
.csv-mapping-required { color: #dc2626; font-size: 10px; margin-left: 3px; }

.csv-mapping-row select {
  font-size: 12px;
  padding: 5px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: #374151;
  width: 100%;
}

.csv-advanced-toggle { margin-top: 12px; }

.csv-preview-summary {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px;
}

.csv-preview-stat {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 13px;
}

.csv-preview-stat:last-child { margin-bottom: 0; }

.csv-preview-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #16a34a;
  flex-shrink: 0;
  margin-top: 4px;
}

.csv-preview-dot.warning { background: #f59e0b; }
.csv-preview-dot.info { background: #2563eb; }
.csv-preview-label { font-weight: 600; color: #111827; }
.csv-preview-detail { font-size: 11.5px; color: #6b7280; margin-top: 2px; }

/* ─── Categories Page ─────────────────────────────────── */

.cat-page-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 16px;
}

.cat-page-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 16px 8px 0;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  margin-bottom: -1px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.12s ease, border-color 0.12s ease;
}

.cat-page-tab:hover {
  color: #374151;
}

.cat-page-tab.active {
  color: #111827;
  border-bottom-color: #111827;
  font-weight: 600;
}

.cat-tab-count {
  background: #f3f4f6;
  color: #6b7280;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
}

.cat-page-tab.active .cat-tab-count {
  background: #e0e7ff;
  color: #1d4ed8;
}

.cat-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid #f3f4f6;
}

.cat-list-row:last-child {
  border-bottom: none;
}

.cat-list-row:hover {
  background: #fafafa;
}

.cat-list-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cat-list-name {
  font-size: 13px;
  font-weight: 500;
  color: #111827;
  flex: 1;
}

.cat-list-count {
  font-size: 12px;
  color: #9ca3af;
  margin-right: 8px;
}

.cat-list-edit {
  background: none;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: background 0.12s ease;
}

.cat-list-edit:hover {
  background: #f3f4f6;
}

.cat-list-delete {
  background: none;
  border: none;
  padding: 5px 8px;
  font-size: 14px;
  color: #d1d5db;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.12s ease, background 0.12s ease;
  line-height: 1;
}

.cat-list-delete:hover {
  color: #dc2626;
  background: #fef2f2;
}

.cat-empty {
  padding: 32px 16px;
  text-align: center;
  font-size: 13px;
  color: #9ca3af;
}

/* ─── Category Modal Tip ──────────────────────────────── */

.cat-modal-tip {
  margin: 12px 0 0;
  font-size: 11.5px;
  color: #9ca3af;
  font-style: italic;
}

/* ─── Clickable category badge ────────────────────────── */

.category-badge.clickable {
  cursor: pointer;
  transition: opacity 0.12s ease;
}

.category-badge.clickable:hover {
  opacity: 0.8;
}
/* ─── Login Screen ────────────────────────────────────── */

.login-screen {
  position: fixed;
  inset: 0;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.login-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 40px 36px;
  width: 360px;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

.sidebar-logo {
  width: 140px;
  height: auto;
  display: block;
  margin-bottom: 16px;
}

.login-logo {
  margin-bottom: 8px;
}

.login-logo-img {
  width: 220px;
  height: auto;
  display: block;
  margin: 0 auto 8px;
}

.login-tagline {
  font-size: 13px;
  color: #9ca3af;
  margin-bottom: 32px;
}

.google-signin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 20px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: #374151;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.google-signin-btn:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.login-error {
  margin-top: 14px;
  font-size: 12.5px;
  color: #dc2626;
}

/* ─── Sidebar User ────────────────────────────────────── */

.sidebar-user {
  padding: 12px 10px;
  border-top: 1px solid #f0f0f0;
  margin-top: auto;
}

.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.user-name {
  font-size: 12px;
  font-weight: 500;
  color: #374151;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sign-out-btn {
  width: 100%;
  padding: 6px 10px;
  background: none;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease, color 0.12s ease;
}

.sign-out-btn:hover {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

/* ─── Toast Notifications ─────────────────────────────── */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  font-family: "Poppins", sans-serif;
  min-width: 240px;
  max-width: 360px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  pointer-events: all;
  animation: toast-in 0.2s ease;
}

.toast.toast-success {
  background: #166534;
  color: #dcfce7;
}

.toast.toast-error {
  background: #991b1b;
  color: #fee2e2;
}

.toast.toast-info {
  background: #1e40af;
  color: #dbeafe;
}

.toast.toast-warning {
  background: #92400e;
  color: #fef3c7;
}

.toast-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  color: inherit;
  opacity: 0.7;
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

.toast-close:hover {
  opacity: 1;
}

.toast.toast-out {
  animation: toast-out 0.2s ease forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(20px); }
}

/* ─── Users Page ──────────────────────────────────────── */

.users-add-row {
  display: flex;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid #f0f0f0;
}

.users-email-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
}

.users-email-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.1);
}

.users-list {
  padding: 8px 0;
}

.user-row {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid #f9fafb;
  gap: 12px;
}

.user-row:last-child {
  border-bottom: none;
}

.user-avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  flex-shrink: 0;
}

.user-email {
  flex: 1;
  font-size: 13px;
  color: #374151;
}

.user-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  background: #dbeafe;
  color: #1e40af;
}

.user-badge.admin {
  background: #fef3c7;
  color: #92400e;
}

.user-remove-btn {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
}

.user-remove-btn:hover {
  background: #fee2e2;
  color: #dc2626;
}