:root {
  --text: #030303;
  --text2: #1a1814;
  --text3: #363431;
  --text4: #b8b2a8;

  --accent: #007bff;


  --body-bg: #fff8e1;
  --bg: #f5f2ed;
  --bg2: #eeebe4;
  --surface: #ffffff;
  --surface2: #f9f7f4;
  --border: #e0dbd2;
  --border2: #ccc7bb;

  /* Multi color */
  --green: #2a7a4a;
  --green-bg: #edf7f1;
  --red: #c0392b;
  --red-bg: #fdf0ef;
  --amber: #0056b3;
  --amber-bg: #fdf5e8;

  /* radius */
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --sidebar-width: 256px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.05);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; }

body {
  font-family: 'Geist', 'Helvetica Neue', sans-serif;
  background: var(--body-bg);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.container {
  display: flex;
  height: 100vh;
}

h1 {
  text-align: center;
  color: #333;
}

img, table {
  max-width: 100%;
}

.overlay {
  width: 100%;
  height: 100%;
  position: absolute;
  display: none;
  z-index: 1;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.overlay.active {
  display: block;
  opacity: 1;
}

/* Left Navigation */
.left-navbar {
  width: 19rem;
  min-width: 19rem;
  background: #333333;
  border-right: 1px solid #007bff;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  transition: transform 0.3s ease;
}

.left-navbar.active {
  width: 0rem;
  min-width: 0rem;
}

/* Side Nav Open and Close Style */
.close-toggle-btn {
  display: flex;
  border-radius: 1rem;
  padding: 0.3rem;
  border: none;
  background: #333333;
  font-size: 2rem;
  color: #fff;
  cursor: pointer;
}

.close-toggle-btn svg {
  stroke: #fff;
  stroke-width: 3;
  stroke-linecap: round;
}

.close-toggle-btn:hover {
  background: rgba(255,255,255,0.1);
  transform: scale(1.1);
}

.toggle-btn {
  background: #fff;
  border: none;
  font-size: 2rem;
  font-weight: 400;
  cursor: pointer;
  display: none;
}

.main-toggle-btn {
  background-color: var(--body-bg);
  color: var(--accent);
  border: none;
  width: 5rem;
  font-size: 2.6rem;
  font-weight: 400;
  padding: 1rem;
  cursor: pointer;
}

.main-toggle-btn-div {
  top: 0;
  left: 0;
  position: absolute;
  display: none;
}

/* Header */
.header {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  text-align: center;
}

.header h1 {
  font-size: 2rem;
  background: linear-gradient(90deg, #0056b3, #afcdee, #007bff );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: bold;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.2rem;
  padding: 1rem;
  padding-top: 1.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #fff8e162;
}

.brand-logo {
  width: 38px;
  height: 38px;
  background: #007bff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Instrument Serif', serif;
  font-size: 2.5rem;
  font-weight: bold;
  color: white;
  flex-shrink: 0;
}

.btn-new-cat {
  margin: 14px 12px 0;
  display: flex;
  align-items: center;
  align-self: center;
  gap: 8px;
  padding: 9px 14px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  font-family: 'Geist', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  width: calc(80% - 30px);
  justify-content: center;
}

.btn-new-cat:active { transform: scale(0.98); }

.sidebar-section-label {
  font-family: 'Geist Mono', monospace;
  font-size: 1.2rem;
  font-weight: 500;
  margin-top: 2rem;
  letter-spacing: 1.2px;
  color: #fff8e1;
  padding: 14px 18px 6px;
  text-transform: uppercase;
  text-align: center;
}

.cat-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px;
}

.cat-list::-webkit-scrollbar { width: 6px; }
.cat-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.cat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s;
  margin-bottom: 2px;
  position: relative;
}

.cat-item:hover { background: rgba(255,255,255,0.06); }
.cat-item.active { background: rgba(198,124,42,0.25); }
.cat-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 25%;
  bottom: 25%;
  width: 2px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

.cat-icon {
  width: 30px;
  height: 30px;
  background: rgba(255,255,255,0.08);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Instrument Serif', serif;
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  flex-shrink: 0;
}

.cat-item.active .cat-icon { background: rgba(198,124,42,0.3); color: var(--accent); }

.cat-item-info { flex: 1; min-width: 0; }
.cat-item-name {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.cat-item.active .cat-item-name { color: #fff; }
.cat-item-count {
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  font-family: 'Geist Mono', monospace;
  margin-top: 2px;
}

.cat-item-del {
  opacity: 0;
  background: none;
  border: none;
  color: rgba(255,255,255,0.3);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 14px;
  transition: color 0.12s, opacity 0.12s;
  line-height: 1;
}
.cat-item:hover .cat-item-del { opacity: 1; }
.cat-item-del:hover { color: var(--red); }

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid #fff8e162;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sf-icon { font-size: 14px; opacity: 0.4; }
.sf-text { font-size: 11px; color: #fff8e1; font-family: 'Geist Mono', monospace; }

/* WELCOME */
.welcome-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
}

.welcome-graphic {
  width: 80px;
  height: 80px;
  position: relative;
  margin-bottom: 28px;
}


.wg-box {
  position: absolute;
  border-radius: 8px;
}

.wg-1 { width: 64px; height: 64px; background: #007bff; top: 0; left: 0; opacity: 0.9; }
.wg-2 { width: 44px; height: 44px; background: #333333; top: 30px; left: 38px; opacity: 0.15; }
.wg-3 { width: 34px; height: 34px; background: #007bff; top: 52px; left: 10px; opacity: 0.4; }
.wg-mark {
  position: absolute;
  top: 12px;
  left: 22px;
  font-family: 'Instrument Serif', serif;
  font-size: 32px;
  color: white;
  font-weight: 400;
}

.welcome-title {
  font-family: 'Instrument Serif', serif;
  font-size: 39px;
  font-weight: 400;
  color: #333333;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
}
.welcome-title em { font-style: italic; color: #007bff; }
.welcome-desc { font-size: 14px; color: #5a5650; line-height: 1.7; max-width: 360px; margin-bottom: 24px; }

/* CATEGORY VIEW */
.cat-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cat-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  gap: 16px;
  flex-shrink: 0;
}

.cat-topbar-left { flex: 1; min-width: 0; }
.cat-heading-wrap { display: flex; align-items: baseline; gap: 8px; }


.cat-heading {
  font-family: 'Instrument Serif', serif;
  font-size: 22px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.3px;
  line-height: 1.2;
  outline: none;
  border-bottom: 1.5px solid transparent;
  padding-bottom: 2px;
  transition: border-color 0.15s;
  cursor: text;
  max-width: 400px;
}

.cat-heading:hover { border-bottom-color: var(--border2); }
.cat-heading:focus { border-bottom-color: var(--accent); }

.edit-hint {
  font-size: 10px;
  color: var(--text4);
  font-family: 'Geist Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  opacity: 0;
  transition: opacity 0.15s;
}

.cat-heading:hover ~ .edit-hint,
.cat-heading:focus ~ .edit-hint { opacity: 1; }

.cat-meta { font-size: 12px; color: var(--text3); margin-top: 4px; font-family: 'Geist Mono', monospace; }

.cat-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 10px;
  color: var(--text3);
  pointer-events: none;
}

.search-box input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px 8px 32px;
  font-family: 'Geist', sans-serif;
  font-size: 13px;
  color: var(--text);
  width: 220px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(198,124,42,0.1);
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-family: 'Geist', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 0.13s, transform 0.1s, box-shadow 0.13s;
  white-space: nowrap;
  text-decoration: none;
}

.btn:active { transform: scale(0.97); }

.btn-accent { background: #007bff; color: white; }
.btn-accent:hover { background: #0056b3 }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--text2);
}
.btn-ghost:hover { background: var(--bg); border-color: var(--border2); }

.btn-sm { padding: 6px 12px; font-size: 12px; }

.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.12s;
  font-family: 'Geist', sans-serif;
}

.btn-sell { background: var(--green-bg); color: var(--green); border-color: rgba(42,122,74,0.2); }
.btn-sell:hover { background: #d7f0e3; }
.btn-edit { background: var(--accent-light); color: var(--accent-dark); border-color: rgba(198,124,42,0.2); }
.btn-edit:hover { background: #fce8ce; }
.btn-stock { background: var(--amber-bg); color: var(--amber); border-color: rgba(184,115,32,0.2); }
.btn-stock:hover { background: #fdecc8; }
.btn-hist { background: var(--bg2); color: var(--text2); border-color: var(--border); }
.btn-hist:hover { background: var(--border); }
.btn-del { background: var(--red-bg); color: var(--red); border-color: rgba(192,57,43,0.2); }
.btn-del:hover { background: #fbe0de; }

/* SECTIONS */
.cat-view > section {
  padding: 0 28px 20px;
  flex-shrink: 0;
}

.cat-view {
  overflow-y: auto;
  padding-bottom: 0;
}
.cat-view::-webkit-scrollbar { width: 4px; }
.cat-view::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

.section-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 0 10px;
}

.eyebrow-label {
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  letter-spacing: 1.4px;
  color: var(--text3);
  text-transform: uppercase;
}

.product-count-badge {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 9px;
  font-size: 11px;
  font-family: 'Geist Mono', monospace;
  color: var(--text3);
}

/* TABLE LOADER EFFECT */
.dashboard {
  position: relative;
}

.skeleton-container {
  position: absolute;
  inset: 0; /* shorthand for top:0, left:0, right:0, bottom:0 */
  
  background: var( --body-bg); /* match your UI */
  z-index: 10;
  padding: 20px;
}

/* Layout */
.skeleton-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 20px;
}

.skeleton.card {
  height: 40px;
  border-radius: 12px;
}

.skeleton-table .row {
  height: 80px;
  margin-bottom: 20px;
  border-radius: 6px;
}

/* Base skeleton style */
.skeleton {
  position: relative;
  background: #fff;
  overflow: hidden;
}

/* Shimmer effect */
.skeleton::after {
  content: '';
  position: absolute;
  top: 0;
  left: -150px;
  height: 100%;
  width: 150px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.712),
    transparent
  );
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  100% {
    transform: translateX(300%);
  }
}

/* TABLE */
.table-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.status-container {
  padding-bottom: 5rem;
}

.table-wrapper {
  overflow-x: auto; 
  overflow-y: auto;
}
.table-wrapper::-webkit-scrollbar { height: 5px; }
.table-wrapper::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

.product-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.product-table thead tr {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}

.product-table thead th {
  padding: 10px 14px;
  text-align: left;
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text3);
  white-space: nowrap;
}

.product-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

.product-table tbody tr:last-child { border-bottom: none; }
.product-table tbody tr:hover { background: var(--surface2); }

.product-table tbody td {
  padding: 11px 14px;
  vertical-align: middle;
  color: var(--text);
}

/* sub-row for base unit */
.product-table tbody tr.base-row {
  background: rgba(198,124,42,0.02);
}
.product-table tbody tr.base-row:hover { background: rgba(198,124,42,0.04); }
.product-table tbody tr.base-row td { padding-top: 7px; padding-bottom: 7px; color: var(--text2); }

td.mono, .mono { font-family: 'Geist Mono', monospace; font-size: 12px; }
td.num { font-family: 'Geist Mono', monospace; font-size: 12px; }

.id-pill {
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--text3);
  white-space: nowrap;
}

.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  font-family: 'Geist Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 20px;
}

.type-single { background: rgba(198,124,42,0.1); color: var(--accent-dark); }
.type-multi-unit { background: rgba(42,122,74,0.1); color: var(--green); }
.type-multi-base { background: rgba(192,57,43,0.08); color: var(--red); }

.prod-name {
  font-weight: 500;
  font-size: 13px;
  color: var(--text);
}

.sub-name {
  font-size: 12px;
  color: var(--text3);
  display: flex;
  align-items: center;
  gap: 6px;
}
.sub-arrow { color: var(--text4); font-size: 10px; }

.qty-display { display: flex; align-items: center; gap: 6px; }

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sd-ok { background: var(--green); }
.sd-low { background: var(--amber); }
.sd-out { background: var(--red); }

.profit-pos { color: var(--green); font-weight: 500; }
.profit-neg { color: var(--red); font-weight: 500; }
.profit-zero { color: var(--text3); }

.col-actions { min-width: 200px; }
.action-cell { display: flex; gap: 4px; flex-wrap: wrap; }

.date-text { font-family: 'Geist Mono', monospace; font-size: 10.5px; color: var(--text3); }

/* PAGINATION */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 14px 0 4px;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  font-family: 'Geist', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.13s;
}

.page-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.page-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.page-info { font-family: 'Geist Mono', monospace; font-size: 12px; color: var(--text3); min-width: 90px; text-align: center; }

/* STATUS TABLE */
.status-section { margin-top: 4px; margin-bottom: 1rem;}
.status-table tr:hover { background: var(--surface2); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
}

.status-ok { background: var(--green-bg); color: var(--green); }
.status-low { background: var(--amber-bg); color: var(--amber); }
.status-out { background: var(--red-bg); color: var(--red); }


/* EMPTY STATE */
.empty-products {
  padding: 56px 20px;
  text-align: center;
}
.ep-icon { font-size: 36px; margin-bottom: 12px; opacity: 0.4; }
.ep-text { font-size: 14px; color: var(--text3); margin-bottom: 16px; }

/* ── MODALS ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20,18,14,0.55);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.hidden { display: none !important; }

.modal {
  background: #fff8e1;
  border: 1px solid #e0dbd2;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalIn 0.2s ease;
}

.modal-sm { max-width: 380px; }
.modal-lg { max-width: 620px; }
.modal-xl { max-width: 780px; }

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid #e0dbd2;
  flex-shrink: 0;
}

.modal-title {
  font-family: 'Instrument Serif', serif;
  font-size: 20px;
  font-weight: 500;
  color: var(--text);
}

.modal-close {
  width: 28px;
  height: 28px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 16px;
  color: var(--text2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s;
  line-height: 1;
}
.modal-close:hover { background: var(--red-bg); color: var(--red); border-color: rgba(192,57,43,0.3); }

.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
}
.modal-body::-webkit-scrollbar { width: 3px; }
.modal-body::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

.modal-desc { font-size: 16px; color: var(--text2); margin-bottom: 18px; line-height: 1.6; }
.delete-modal-desc {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.3;
}

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

/* TYPE CARDS */
.type-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.type-card {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
}

.type-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.15s;
}

.type-card:hover { border-color: var(--accent); box-shadow: 0 4px 16px rgba(198,124,42,0.12); }

.tc-icon { font-size: 26px; margin-bottom: 10px; }
.tc-name { font-family: 'Geist', sans-serif; font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.tc-desc { font-size: 14px; color: var(--text2); line-height: 1.5; }
.tc-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 16px;
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
}
.type-card:hover .tc-arrow { opacity: 1; transform: translateY(-50%) translateX(3px); }


/* FORMS */
.prod-form { display: flex; flex-direction: column; gap: 0; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.fg-full { grid-column: 1 / -1; }

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

.form-group label {
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text2);
  font-weight: 500;
}

.req { color: var(--accent); }

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  font-family: 'Geist', sans-serif;
  font-size: 13px;
  color: var(--text);
  transition: border-color 0.13s, box-shadow 0.13s;
  width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(198,124,42,0.1);
}

.form-group input[readonly],
.form-group input.auto {
  background: var(--bg2);
  color: var(--text3);
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
}

.form-group input[readonly]:focus,
.form-group input.auto:focus { box-shadow: none; border-color: var(--border); }

/* AUTO-CALC TOGGLE */
.autocalc-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--accent-light);
  border: 1px solid rgba(198,124,42,0.2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 18px;
}

.act-label { font-size: 13px; font-weight: 500; color: var(--text); }
.act-sub { font-size: 11px; color: var(--text3); margin-top: 2px; }

.toggle-switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border2);
  border-radius: 22px;
  transition: background 0.2s;
}
.slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .slider { background: var(--accent); }
.toggle-switch input:checked + .slider::before { transform: translateX(18px); }

/* MULTI SECTION LABEL */
.multi-section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text2);
  margin-bottom: 12px;
}
.msl-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}
.msl-dot-base { background: var(--accent); }

/* CALC PREVIEW */
.form-calc-preview {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 16px;
  font-size: 12px;
  font-family: 'Geist Mono', monospace;
  color: var(--text2);
  min-height: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.calc-item { display: flex; flex-direction: column; gap: 2px; }
.calc-label { font-size: 10px; color: var(--text3); }
.calc-val { font-size: 13px; color: var(--text); font-weight: 500; }
.calc-val.pos { color: var(--green); }
.calc-val.neg { color: var(--red); }

/* SELL / STOCK MODAL CONTENT */
.sell-info-card {
  background: var(--bg2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.sic-item { display: flex; flex-direction: column; gap: 3px; }
.sic-label { font-size: 10px; color: var(--text3); font-family: 'Geist Mono', monospace; text-transform: uppercase; letter-spacing: 0.5px; }
.sic-value { font-size: 14px; font-weight: 500; font-family: 'Geist Mono', monospace; }

.sell-tab-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}
.sell-tab {
  flex: 1;
  padding: 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.13s;
  text-align: center;
  font-family: 'Geist', sans-serif;
}
.sell-tab.active { border-color: var(--green); background: var(--green-bg); color: var(--green); }
.sell-tab:hover:not(.active) { border-color: var(--border2); background: var(--bg); }

.gain-preview {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.gp-item { display: flex; flex-direction: column; gap: 3px; }
.gp-label { font-size: 10px; color: var(--text3); font-family: 'Geist Mono', monospace; text-transform: uppercase; }
.gp-val { font-size: 14px; font-weight: 600; font-family: 'Geist Mono', monospace; }
.gp-pos { color: var(--green); }
.gp-neg { color: var(--red); }
.gp-neutral { color: var(--text2); }

/* HISTORY */
.history-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.hs-card {
  background: var(--bg2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  border: 1px solid var(--border);
}
.hs-label { font-size: 10px; color: var(--text3); font-family: 'Geist Mono', monospace; text-transform: uppercase; margin-bottom: 4px; }
.hs-value { font-size: 18px; font-weight: 600; font-family: 'Geist Mono', monospace; }
.hs-pos { color: var(--green); }
.hs-neg { color: var(--red); }

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

.hist-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: border-color 0.12s;
}
.hist-item:hover { border-color: var(--border2); }

.hist-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.hist-type {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  font-family: 'Geist Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ht-sale { color: var(--green); }
.ht-restock { color: var(--amber); }
.ht-edit { color: var(--accent); }
.hist-date { font-family: 'Geist Mono', monospace; font-size: 10.5px; color: var(--text3); }

.hist-body { display: flex; gap: 20px; flex-wrap: wrap; }
.hb-item { display: flex; flex-direction: column; gap: 2px; }
.hb-label { font-size: 10px; color: var(--text3); font-family: 'Geist Mono', monospace; }
.hb-val { font-size: 13px; color: var(--text); font-family: 'Geist Mono', monospace; font-weight: 500; }
.hb-pos { color: var(--green); }
.hb-neg { color: var(--red); }

.hist-empty { text-align: center; padding: 40px; color: var(--text3); font-size: 14px; }

/* TOAST */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  max-width: 340px;
  animation: toastIn 0.25s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast.hidden { display: none; }
.toast.toast-success { background: var(--green); }
.toast.toast-error { background: var(--red); }
.toast.toast-warn { background: var(--amber); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px) scale(0.95); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

/* UTILITY */
.hidden { display: none !important; }
.text-muted { color: var(--text3); }
.text-sm { font-size: 12px; }

/* DIVIDER */
.form-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 14px 0;
}

/* SELL CONFIRM style */
.btn-sell-confirm { background: var(--green); color: white; }
.btn-sell-confirm:hover { background: #1f6640; }

@media (max-width: 900px) {
  .search-box input {
    width: 140px;
  }

  .cat-heading-wrap { 
    flex-wrap: wrap; 
    gap: 5px; 
  }

  .cat-topbar {
    padding: 13px 23px;
    gap: 16px;
  }
}

@media (max-width: 700px) {
  .toggle-btn {display: block;}
  .left-navbar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 2000;

    /* Start hidden on mobile */
    transform: translateX(-100%);
  }

  .left-navbar.open {
    transform: translateX(0);
  }

  .main-toggle-btn-div {
    display: block;
  }

  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .history-stats { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 550px) {
  .cat-topbar-right {
    flex-direction: column;
    gap: 16px;
    flex-shrink: 0;
  }

  .btn-add-product {
    width: 11rem;
  }

  .search-box input {
    width: 154px;
  }
}



















.category-btn {
  display: flex;
  text-align: center;
}

.create-product {
  margin-bottom: 3rem;
  margin-top: 3rem;
  align-items: center;
}

.create-product h3 {
  font-size: 1.1rem;
  color: #2a2a3a;
  text-align: center;
}

.add-multiple-product-card {
  display: none;
  background-color: #dad9d9;
  margin: 15px 0;
  padding: 1rem;
  border: 1px solid #007bff;
}

.add-multiple-product-card h4 {
  padding-bottom: 1rem;
}

.add-single-product-card {
  background-color: #dad9d9;
  padding: 1rem;
  border: 1px solid #007bff;
  margin: 15px 0;
}

.add-single-product-card h4 {
  /* margin-bottom: 1rem; */
}

.single-product {
  margin-top: 2rem;
}

.single-product input {
  width: 7rem;
  border-color: #007bff;
}

.single-product input:focus-visible {
  outline: none;
}

.create-product-button {
  gap: 0.8rem;
  display: flex;
}

.product-form input{
  width: 7rem;
  border-color: #007bff;
}

.unit-container {
  margin-top: 2rem;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: margin-left 0.3s ease;
}

body.sidebar-open .main-content {
  margin-left: 0;
}

.card {
  background: #dee0e2;
  padding: 20px;
  margin: 15px 0;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.search-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.search-card input {
  width: 30rem;
  border: none;
  border-radius: 1rem;
}

.search-card input:focus-within {
  outline: none;
}

.all-product-cards {
  overflow-x: auto;
}

.single-product {
  margin-bottom: 2rem;
}

input {
  padding: 10px;
  margin: 5px;
  width: calc(30% - 10px);
}

.product {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  border-bottom: 1px solid #ddd;
}