/* ═══════════════════════════════════════════════════════════
   CAFLAT.CORE V1 — UPGRADED STYLESHEET
   Black & White · Minimalist · Professional SaaS
═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=DM+Mono:wght@400;500&display=swap');

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

:root {
  --black: #000;
  --white: #fff;
  --gray-50: #fafafa;
  --gray-100: #f4f4f4;
  --gray-200: #e8e8e8;
  --gray-300: #d0d0d0;
  --border: #a8a8a8;
  --gray-400: #a0a0a0;
  --gray-500: #777;
  --gray-600: #555;
  --gray-700: #333;
  --gray-800: #1a1a1a;
  --gray-900: #111;

  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --success: #16a34a;
  --warning: #d97706;

  --font-main: 'Nunito', sans-serif;
  --font-mono: 'DM Mono', monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-full: 999px;

  --shadow-xs: 0 1px 3px rgba(0,0,0,.06);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.08);
  --shadow-md: 0 8px 24px rgba(0,0,0,.10);
  --shadow-lg: 0 16px 48px rgba(0,0,0,.14);
  --shadow-xl: 0 24px 64px rgba(0,0,0,.18);

  --header-h: 58px;
  --transition: 0.15s ease;
}

html, body { height: 100%; }

body {
  font-family: var(--font-main);
  background: var(--white);
  color: var(--black);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-font-smoothing: antialiased;
}

body.login-active { overflow: hidden; }

/* ═══ SCROLLBAR ═══ */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ═══ HEADER ═══ */
header {
  background: var(--black);
  color: var(--white);
  height: var(--header-h);
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}

header h1 {
  font-size: 13px;
  letter-spacing: 4px;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--white);
}

/* ═══ APP BODY — sidebar + main ═══ */
.app-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
  background: var(--gray-50);
}

/* ═══ SIDEBAR ═══ */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 10px;
  transition: width .22s ease, padding .22s ease, opacity .22s ease;
}

.sidebar.collapsed {
  width: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  border-right: none;
}

#sidebarToggleBtn:hover {
  background: rgba(255,255,255,.1);
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
}

.nav-group {
  margin-bottom: 4px;
}

.nav-group-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gray-300);
  padding: 8px 10px 4px;
}

.nav-group-bottom {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.sidebar nav button {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 9px 12px;
  border: none;
  background: transparent;
  color: var(--gray-500);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-main);
  border-radius: var(--radius-sm);
  text-align: left;
  transition: all var(--transition);
  margin-bottom: 1px;
  white-space: nowrap;
  letter-spacing: 0;
  text-transform: none;
}

.sidebar nav button:hover {
  background: var(--gray-100);
  color: var(--black);
}

.sidebar nav button.active {
  background: var(--black);
  color: var(--white);
  font-weight: 600;
}

/* remove nav-icon from CSS since icons are gone from HTML */
.nav-icon { display: none; }

/* ═══ LAYOUT ═══ */
main {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
  width: 100%;
}

.view {
  display: none;
  width: 100%;
  min-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

.view.active { display: flex; }

#app { display: none; width: 100%; height: 100%; }
#app.authenticated { display: flex; flex-direction: column; }

/* ═══ POS LAYOUT ═══ */
.pos-products {
  flex: 2;
  padding: 20px 24px;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  min-width: 0;
  background: var(--white);
}

.pos-cart {
  flex: 0 0 360px;
  min-width: 340px;
  max-width: 400px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  background: var(--gray-50);
  border-left: 1px solid var(--border);
}

/* ═══ CATEGORY TABS ═══ */
.category-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.category-tabs button {
  padding: 6px 16px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--gray-500);
  cursor: pointer;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 700;
  border-radius: var(--radius-full);
  transition: all var(--transition);
  font-family: var(--font-main);
}

.category-tabs button:hover {
  border-color: var(--black);
  color: var(--black);
}

.category-tabs button.active {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

/* ═══ PRODUCT GRID ═══ */
#productGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  align-content: start;
  width: 100%;
}

/* ═══ PRODUCT CARD ═══ */
.pos-product-card {
  position: relative;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
  height: 200px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  overflow: hidden;
  user-select: none;
}

.pos-product-card:hover {
  transform: translateY(-2px);
  border-color: var(--gray-700);
  box-shadow: var(--shadow-md);
}

.pos-product-card:active { transform: translateY(0); }

.pos-product-card.low-stock {
  border-color: var(--danger-border);
}

.pos-product-card.out-of-stock {
  opacity: .4;
  filter: grayscale(1);
  cursor: not-allowed;
  pointer-events: none;
}

.pos-product-card.out-of-stock::after {
  content: 'SOLD OUT';
  position: absolute;
  top: 14px;
  right: -36px;
  transform: rotate(45deg);
  background: var(--black);
  color: var(--white);
  padding: 6px 44px;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 1.5px;
}

/* Card quantity badge — shows how many are in cart */
.pos-card-cart-qty {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 26px;
  height: 26px;
  background: var(--black);
  color: var(--white);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
}

.pos-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
}

.pos-category-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: var(--gray-100);
  color: var(--gray-700);
}

.pos-low-stock-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

.pos-product-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.pos-product-name {
  font-size: 18px;
  font-weight: 900;
  line-height: 1.2;
  color: var(--gray-900);
  margin-bottom: 6px;
  word-break: break-word;
}

.pos-product-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  gap: 8px;
}

.pos-product-footer-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.pos-product-price {
  font-size: 22px;
  font-weight: 900;
  color: var(--black);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.pos-product-stock {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gray-600);
  line-height: 1;
}

.pos-product-stock.low { color: var(--danger); }

.pos-options-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  background: var(--gray-100);
  color: var(--gray-500);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-main);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  letter-spacing: 0;
}

.pos-options-btn:hover {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

/* ═══ CART ═══ */
.cart-header {
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: 800;
  padding-bottom: 14px;
  border-bottom: 1.5px solid var(--black);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-item-count {
  background: var(--black);
  color: var(--white);
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}

#cartItems {
  flex: 1;
  overflow-y: auto;
  padding-right: 2px;
  min-height: 0;
}

/* Empty cart */
.empty-cart-state {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 260px;
  gap: 10px;
}

.empty-cart-icon { font-size: 36px; opacity: .25; }
.empty-cart-title { font-size: 16px; font-weight: 800; color: var(--gray-700); }
.empty-cart-subtitle { font-size: 12px; color: var(--gray-400); }

/* Cart items */
.cart-line-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.cart-line-info { min-width: 0; }

.cart-line-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--black);
  margin-bottom: 2px;
  word-break: break-word;
  line-height: 1.3;
}

.cart-line-price { font-size: 11px; color: var(--gray-600); font-weight: 600; }

.cart-line-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.cart-line-controls button {
  width: 26px;
  height: 26px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--gray-700);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  line-height: 1;
}

.cart-line-controls button:hover { border-color: var(--black); background: var(--black); color: var(--white); }

.cart-remove-btn {
  width: 26px !important;
  height: 26px !important;
  border: 1px solid var(--border) !important;
  background: var(--white) !important;
  color: var(--gray-400) !important;
  cursor: pointer;
  border-radius: var(--radius-sm) !important;
  font-size: 14px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.cart-remove-btn:hover { border-color: var(--danger) !important; background: var(--danger-bg) !important; color: var(--danger) !important; }

.cart-line-controls span {
  min-width: 22px;
  text-align: center;
  font-weight: 900;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.cart-line-total {
  min-width: 76px;
  text-align: right;
  font-size: 13px;
  font-weight: 900;
  color: var(--black);
  font-variant-numeric: tabular-nums;
}

/* ═══ CART SUMMARY ═══ */
.cart-summary {
  padding-top: 12px;
  border-top: 1.5px solid var(--black);
  background: var(--gray-50);
}

.cart-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  font-size: 12px;
  color: var(--gray-700);
  font-weight: 600;
}

.cart-row span:last-child {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.cart-row.total {
  font-size: 20px;
  font-weight: 900;
  padding: 10px 0;
  border-top: 1.5px solid var(--black);
  margin-top: 8px;
  color: var(--black);
}

.cart-row.total span:last-child { font-weight: 900; }

/* Discount row */
.discount-input {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  align-items: center;
}

.discount-input input,
.discount-input select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  background: var(--white);
  font-size: 12px;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  transition: border-color var(--transition);
}

.discount-input input:focus,
.discount-input select:focus {
  outline: none;
  border-color: var(--black);
}

.discount-input input { flex: 1; }
.discount-input select { width: 72px; }

/* Cart actions */
.cart-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.cart-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

.cart-actions-row button {
  padding: 10px 6px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--gray-700);
  cursor: pointer;
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 800;
  border-radius: var(--radius-md);
  transition: all var(--transition);
  font-family: var(--font-main);
}

.cart-actions-row button:hover { background: var(--gray-100); border-color: var(--gray-300); }

.checkout-btn {
  width: 100%;
  padding: 16px;
  background: var(--black);
  color: var(--white);
  border: 2px solid var(--black);
  cursor: pointer;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 900;
  border-radius: var(--radius-md);
  transition: all var(--transition);
  font-family: var(--font-main);
}

.checkout-btn:hover { background: var(--gray-800); }
.checkout-btn:active { transform: scale(.99); }

/* ═══ PANELS ═══ */
.panel {
  width: 100%;
  padding: 24px;
  overflow-y: auto;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1.5px solid var(--black);
  gap: 12px;
  flex-wrap: wrap;
}

.panel-header h2 {
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--gray-900);
}

/* ═══ BUTTONS ═══ */
.btn {
  padding: 9px 18px;
  background: var(--black);
  color: var(--white);
  border: 1.5px solid var(--black);
  cursor: pointer;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 800;
  border-radius: var(--radius-md);
  transition: all var(--transition);
  font-family: var(--font-main);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.btn:hover { background: var(--gray-800); }
.btn:active { transform: scale(.98); }

.btn-secondary {
  background: var(--white);
  color: var(--black);
  border-color: var(--border);
}

.btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-400); }

.btn-danger {
  background: var(--danger);
  color: var(--white);
  border-color: var(--danger);
}

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

.btn-sm { padding: 5px 10px; font-size: 9px; letter-spacing: 1px; }

/* ═══ TABLES ═══ */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  min-width: 680px;
}

th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--gray-800);
}

th {
  background: var(--gray-900);
  color: rgba(255,255,255,.85);
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 700;
  border-bottom: none;
  white-space: nowrap;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--gray-50); }

.table-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.low-stock-row td { background: #fffbfb !important; }
.low-stock-row td:first-child { border-left: 3px solid var(--danger); }

/* ═══ BADGES ═══ */
.badge-low-stock {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  border: 1px solid var(--danger-border);
}

.badge-low-stock::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: var(--radius-full);
  background: var(--danger);
  flex-shrink: 0;
}

.badge-ok {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  background: #f0fdf4;
  color: #15803d;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  border: 1px solid #bbf7d0;
}

.badge-ok::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: var(--radius-full);
  background: #16a34a;
  flex-shrink: 0;
}

/* ═══ FORMS ═══ */
.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--gray-800);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  background: var(--white);
  font-size: 13px;
  font-family: var(--font-main);
  border-radius: var(--radius-md);
  transition: border-color var(--transition), box-shadow var(--transition);
  color: var(--black);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--black);
  box-shadow: 0 0 0 3px rgba(0,0,0,.06);
}

/* Safari/iPadOS renders type="date" with its own internal box model
   that ignores width:100% from the rule above — pin it down explicitly
   so it matches the height/sizing of adjacent <select> elements. */
.form-group input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  min-height: 42px;
  box-sizing: border-box;
  display: block;
  width: 100%;
}

.form-group input[type="date"]::-webkit-date-and-time-value {
  text-align: left;
}

.form-group input[readonly] {
  background: var(--gray-50);
  color: var(--gray-500);
  cursor: default;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ═══ MODALS ═══ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
  backdrop-filter: blur(2px);
}

.modal-overlay.active { display: flex; }

.modal {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  box-shadow: var(--shadow-xl);
}

.modal h3 {
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  font-weight: 900;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1.5px solid var(--black);
  color: var(--black);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ═══ DASHBOARD ═══ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  border: 1.5px solid var(--gray-200);
  padding: 18px 20px;
  background: var(--white);
  border-radius: var(--radius-xl);
  transition: box-shadow var(--transition), border-color var(--transition);
}

.stat-card:hover { border-color: var(--gray-400); }

.stat-card:hover { box-shadow: var(--shadow-sm); }

.stat-card .label {
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--gray-600);
  margin-bottom: 10px;
}

.stat-card .value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  color: var(--gray-900);
}

.stat-card .sub {
  font-size: 11px;
  color: var(--gray-600);
  margin-top: 6px;
  font-weight: 600;
}

.stat-card.dark {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

.stat-card.dark .label,
.stat-card.dark .sub { color: rgba(255,255,255,.45); }

.stat-card.dark .value { color: var(--white); }

.dashboard-alert {
  border-color: var(--danger-border) !important;
  background: var(--danger-bg) !important;
}

.dashboard-alert .value { color: var(--danger); font-size: 22px; }

.section-title {
  font-size: 9px;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--gray-600);
  margin: 28px 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-100);
}

/* Top products dashboard widget */
.top-product-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

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

.top-product-name { font-size: 13px; font-weight: 700; color: var(--gray-900); }
.top-product-qty { font-size: 11px; font-weight: 700; color: var(--gray-600); }

/* Low stock dashboard widget */
.low-stock-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border: 1px solid var(--danger-border);
  background: var(--danger-bg);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}

.low-stock-name { font-size: 12px; font-weight: 700; color: var(--danger); }
.low-stock-meta { font-size: 11px; color: var(--danger); opacity: .7; }

/* Chart container */
.chart-container {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
  background: var(--white);
  margin-bottom: 24px;
  height: 280px;
  position: relative;
}

/* ═══ RECEIPT ═══ */
.receipt {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 10px;
  max-width: 360px;
  margin: 0 auto;
  background: var(--white);
}

.receipt-header {
  text-align: center;
  border-bottom: 1px dashed var(--gray-300);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.receipt-brand {
  font-weight: 500;
  letter-spacing: 3px;
  font-size: 13px;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.receipt-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0;
  font-size: 11px;
}

.receipt-divider {
  border-top: 1px dashed var(--gray-300);
  margin: 8px 0;
}

.receipt-total {
  font-weight: 700;
  font-size: 13px;
}

/* ═══ FILTER BAR ═══ */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-bar input,
.filter-bar select {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  background: var(--white);
  color: var(--gray-800);
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  transition: border-color var(--transition);
}

.filter-bar input:focus,
.filter-bar select:focus {
  outline: none;
  border-color: var(--black);
}

/* ═══ LOGIN ═══ */
.login-screen {
  position: fixed;
  inset: 0;
  background: var(--white);
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.login-screen.hidden { display: none !important; visibility: hidden !important; pointer-events: none !important; }

.login-card {
  width: min(400px, 92vw);
  border: 1.5px solid var(--black);
  padding: 40px;
  background: var(--white);
  border-radius: var(--radius-xl);
}

.login-card h2 {
  font-size: 22px;
  margin-bottom: 6px;
  letter-spacing: 1px;
  font-weight: 900;
}

.login-subtitle {
  font-size: 11px;
  color: var(--gray-600);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.login-card input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  margin-bottom: 12px;
  font-size: 13px;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  transition: border-color var(--transition);
}

.login-card input:focus { outline: none; border-color: var(--black); }

.login-card button {
  width: 100%;
  padding: 14px;
  background: var(--black);
  color: var(--white);
  border: none;
  cursor: pointer;
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: 900;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  transition: background var(--transition);
  margin-top: 4px;
}

.login-card button:hover { background: var(--gray-800); }
@keyframes loginShake {
  0%,100% { transform: translateX(0); }
  15%      { transform: translateX(-8px); }
  30%      { transform: translateX(8px); }
  45%      { transform: translateX(-6px); }
  60%      { transform: translateX(6px); }
  75%      { transform: translateX(-3px); }
  90%      { transform: translateX(3px); }
}

.login-shake {
  animation: loginShake 0.45s cubic-bezier(.36,.07,.19,.97) both;
}

.login-card input.login-input-error {
  border-color: #fca5a5;
}


/* ═══ NOTIFICATIONS ═══ */
#notificationContainer {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
}

.notification {
  min-width: 240px;
  max-width: 300px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px) scale(.97);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: auto;
}

.notification.show { opacity: 1; transform: translateY(0) scale(1); }
.notification.success { border-left: 4px solid var(--success); }
.notification.error { border-left: 4px solid var(--danger); }
.notification.info { border-left: 4px solid var(--black); }
.notification-content { font-size: 12px; font-weight: 700; line-height: 1.4; color: var(--gray-900); }

/* ═══ SETTINGS ═══ */
#categoryList {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

#categoryList .category-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1.5px solid var(--border);
  background: var(--white);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
}

#categoryList .category-chip button {
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  color: var(--gray-400);
  transition: color var(--transition);
}

#categoryList .category-chip button:hover { color: var(--danger); }

/* ═══ VARIANT BUILDER ═══ */
.variant-row {
  display: grid;
  grid-template-columns: 1fr 1fr 80px auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--gray-50);
}

.variant-row input {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 12px;
}

.variant-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.variant-option {
  border: 1.5px solid var(--border);
  background: var(--white);
  padding: 16px;
  cursor: pointer;
  text-align: left;
  border-radius: var(--radius-xl);
  transition: all var(--transition);
  font-family: var(--font-main);
}

.variant-option:hover { background: var(--black); color: var(--white); border-color: var(--black); }
.variant-option-name { font-weight: 800; margin-bottom: 4px; font-size: 13px; }
.variant-option-price { color: var(--gray-400); font-size: 12px; }
.variant-option:hover .variant-option-price { color: rgba(255,255,255,.6); }

/* Recipe row */
.recipe-row {
  display: grid;
  grid-template-columns: 1fr 100px auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--gray-50);
}

.recipe-row select,
.recipe-row input {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 12px;
  background: var(--white);
}

/* ═══ HELD ORDERS MODAL ═══ */
#heldOrdersModal.hidden { display: none !important; }

#heldOrdersModal:not(.hidden) {
  position: fixed !important;
  inset: 0 !important;
  display: flex !important;
  justify-content: center !important;
  align-items: flex-start !important;
  padding-top: 80px !important;
  background: rgba(0,0,0,.5) !important;
  z-index: 9999 !important;
  backdrop-filter: blur(2px);
}

#heldOrdersModal .modal-content {
  background: var(--white) !important;
  width: min(540px, 92vw) !important;
  max-height: 80vh !important;
  overflow: auto !important;
  border: 1.5px solid var(--border) !important;
  border-radius: var(--radius-xl) !important;
  padding: 24px !important;
  box-shadow: var(--shadow-xl) !important;
}

#heldOrdersModal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1.5px solid var(--black);
}

#heldOrdersModal .modal-header h3 {
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: 800;
  margin: 0;
  padding: 0;
  border: none;
}

#heldOrdersList { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }

.held-order-card {
  border: 1.5px solid var(--border) !important;
  padding: 14px 16px !important;
  cursor: pointer !important;
  border-radius: var(--radius-lg) !important;
  background: var(--white) !important;
  transition: all var(--transition) !important;
}

.held-order-card:hover {
  border-color: var(--black) !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm) !important;
}

.held-order-name { font-weight: 800; font-size: 14px; margin-bottom: 4px; }
.held-order-meta { font-size: 11px; color: var(--gray-400); }

#closeHeldOrdersBtn {
  width: 100%;
  padding: 12px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--black);
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 800;
  cursor: pointer;
  transition: all var(--transition);
}

#closeHeldOrdersBtn:hover { background: var(--gray-50); border-color: var(--gray-300); }

/* ═══ EMPTY STATES ═══ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--gray-400);
  font-size: 12px;
  letter-spacing: 1px;
}

/* ═══ CHECKOUT MODAL TWEAKS ═══ */
.payment-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: var(--black);
  color: var(--white);
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 800;
  border-radius: var(--radius-full);
  margin-bottom: 16px;
}

/* ═══ QUICK AMOUNT BUTTONS ═══ */
.quick-amounts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.quick-amount-btn {
  padding: 6px 12px;
  border: 1px solid var(--border);
  background: var(--white);
  border-radius: var(--radius-md);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-main);
}

.quick-amount-btn:hover { background: var(--black); color: var(--white); border-color: var(--black); }

/* ═══ REPORTS ═══ */
.report-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

/* ═══ ORDER TYPE TABS ═══ */
.order-type-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.order-type-btn {
  padding: 8px 20px;
  border: 1.5px solid var(--border);
  background: var(--white);
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-main);
}

.order-type-btn.active {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

/* ═══ PRODUCT SEARCH in POS ═══ */
.pos-search-wrap {
  margin-bottom: 16px;
}

.pos-search-wrap input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-family: var(--font-main);
  transition: border-color var(--transition);
  background: var(--white);
}

.pos-search-wrap input:focus {
  outline: none;
  border-color: var(--black);
}

/* ═══ DARK panel sections ═══ */
.dark-panel {
  background: var(--gray-900);
  color: var(--white);
  border-radius: var(--radius-xl);
  padding: 20px;
}

/* ═══ RESPONSIVE ═══ */
#view-dashboard .panel,
#view-reports .panel,
#view-products .panel,
#view-inventory .panel,
#view-sales .panel,
#view-settings .panel,
#view-ingredients .panel {
  width: 100%;
  overflow-x: hidden;
}

#view-dashboard .table-wrapper,
#view-reports .table-wrapper,
#view-products .table-wrapper,
#view-inventory .table-wrapper,
#view-sales .table-wrapper,
#view-ingredients .table-wrapper {
  width: 100%;
  overflow-x: auto;
}

canvas { width: 100% !important; max-width: 100%; }

@media (max-width: 1200px) {
  .stats-grid, .report-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1024px) {
  .view.active { flex-direction: column; }
  .pos-products { border-right: none; border-bottom: 1px solid var(--border); }
  .pos-cart { width: 100%; min-width: 100%; max-width: 100%; border-left: none; }
}

@media (max-width: 768px) {
  /* Sidebar becomes a horizontal top strip */
  .app-body { flex-direction: column; }
  .sidebar {
    width: 100%;
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 6px 8px;
    overflow-x: auto;
    overflow-y: hidden;
    height: auto;
  }
  .sidebar nav {
    flex-direction: row;
    gap: 0;
    align-items: center;
    width: 100%;
  }
  .nav-group { display: contents; }
  .nav-group-label { display: none; }
  .nav-group-bottom { margin-top: 0; padding-top: 0; border-top: none; margin-left: auto; }
  .sidebar nav button {
    flex-shrink: 0;
    padding: 6px 10px;
    font-size: 11px;
    white-space: nowrap;
  }
  .nav-icon { display: none; }
  .panel { padding: 14px; }
  .panel-header { flex-direction: column; align-items: flex-start; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid, .report-kpi-grid { grid-template-columns: 1fr 1fr; }
  #productGrid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .pos-product-card { height: 170px; padding: 14px; }
  .pos-product-name { font-size: 15px; }
  .pos-product-price { font-size: 17px; }
  .pos-options-btn { width: 30px; height: 30px; font-size: 14px; }
  .modal { padding: 18px; max-height: 88vh; }
  .variant-row { grid-template-columns: 1fr 1fr; }
  .recipe-row { grid-template-columns: 1fr 80px auto; }
}

@media (max-width: 480px) {
  .stats-grid, .report-kpi-grid { grid-template-columns: 1fr; }
  #productGrid { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════════════════════════════════════════════════
   PRODUCT COST PREVIEW CARD
═══════════════════════════════════════════════════ */

.cost-preview-card {
  margin-top: 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  background: var(--gray-50);
}

.cost-preview-empty {
  font-size: 11px;
  color: var(--gray-400);
  text-align: center;
  padding: 8px 0;
  letter-spacing: 0.5px;
}

.cost-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.cost-preview-item { text-align: center; }

.cost-preview-label {
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--gray-400);
  margin-bottom: 6px;
}

.cost-preview-value {
  font-size: 16px;
  font-weight: 900;
  color: var(--black);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

@media (max-width: 480px) {
  .cost-preview-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════════════════════════════════════════════════
   SALES STATUS BADGES
═══════════════════════════════════════════════════ */

.badge-completed {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--radius-full);
  background: #f0fdf4; color: #15803d;
  font-size: 9px; font-weight: 800; letter-spacing: 1px;
  text-transform: uppercase; border: 1px solid #bbf7d0;
}

.badge-pending {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--radius-full);
  background: #fff7ed; color: #c2410c;
  font-size: 9px; font-weight: 800; letter-spacing: 1px;
  text-transform: uppercase; border: 1px solid #fed7aa;
}

.badge-refunded {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--radius-full);
  background: #f3f4f6; color: #6b7280;
  font-size: 9px; font-weight: 800; letter-spacing: 1px;
  text-transform: uppercase; border: 1px solid #e5e7eb;
}

/* ═══════════════════════════════════════════════════
   REFUND BUTTON
═══════════════════════════════════════════════════ */

.refund-btn {
  background: #fef2f2 !important;
  color: #dc2626 !important;
  border-color: #fecaca !important;
}

.refund-btn:hover {
  background: #dc2626 !important;
  color: var(--white) !important;
  border-color: #dc2626 !important;
}

/* ═══════════════════════════════════════════════════
   EVENT PICKER MODAL
═══════════════════════════════════════════════════ */

.event-picker-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  margin-bottom: 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--white);
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 700;
  color: var(--black);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.event-picker-option:hover {
  background: var(--gray-50);
  border-color: var(--black);
}

.event-picker-option.active {
  background: var(--black);
  border-color: var(--black);
  color: var(--white);
}

.event-picker-option:last-child {
  margin-bottom: 0;
}

/* ═══════════════════════════════════════════════════
   PRINT / PDF EXPORT
═══════════════════════════════════════════════════ */
@media print {
  /* Hide everything except the reports panel */
  header, nav, #loginScreen,
  .filter-bar, #profitabilityToggleBtn,
  button, .pos-products, .pos-cart,
  #view-pos, #view-dashboard, #view-products,
  #view-ingredients, #view-inventory, #view-sales,
  #view-supply, #view-production, #view-coffeecart,
  #view-lab, #view-settings,
  .shopping-list-fab { display: none !important; }

  #view-reports { display: block !important; }
  #profitabilitySection { display: block !important; }

  body { background: #fff !important; font-size: 11px; }
  .panel { box-shadow: none !important; border: none !important; padding: 0 !important; }
  .panel-header { border-bottom: 2px solid #000 !important; margin-bottom: 16px; }
  .panel-header h2 { font-size: 18px !important; }

  .section-title { font-size: 10px !important; margin-top: 20px !important; }

  .stat-card { border: 1px solid #ccc !important; break-inside: avoid; }
  .stats-grid { grid-template-columns: repeat(4, 1fr) !important; gap: 8px !important; }

  .chart-container { break-inside: avoid; }
  canvas { max-width: 100% !important; }

  table { font-size: 10px !important; break-inside: auto; }
  tr { break-inside: avoid; }

  .table-wrapper { overflow: visible !important; }

  /* Page breaks before major sections */
  #profitabilitySection { page-break-before: always; }
}

/* ═══════════════════════════════════════════════════
   DATE PRESET PILLS
═══════════════════════════════════════════════════ */
.date-preset-btn {
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 800;
  font-family: var(--font-main);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--white);
  color: var(--gray-600);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  letter-spacing: 0.2px;
}
.date-preset-btn:hover {
  border-color: var(--black);
  color: var(--black);
}
.date-preset-btn.active {
  background: var(--black);
  border-color: var(--black);
  color: var(--white);
}

/* ═══════════════════════════════════════════════════
   OFFLINE INDICATOR
═══════════════════════════════════════════════════ */
@keyframes offlinePulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ═══════════════════════════════════════════════════
   REPORTS ANIMATIONS
═══════════════════════════════════════════════════ */
@keyframes reportFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes statPulse {
  0%   { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* KPI value pop-in when reports render */
#reportStatsGrid .stat-card {
  animation: statPulse .4s ease both;
}
#reportStatsGrid .stat-card:nth-child(1) { animation-delay: .05s; }
#reportStatsGrid .stat-card:nth-child(2) { animation-delay: .10s; }
#reportStatsGrid .stat-card:nth-child(3) { animation-delay: .15s; }
#reportStatsGrid .stat-card:nth-child(4) { animation-delay: .20s; }
#reportStatsGrid .stat-card:nth-child(5) { animation-delay: .25s; }
#reportStatsGrid .stat-card:nth-child(6) { animation-delay: .30s; }

/* Chart container hover lift */
.chart-container {
  transition: box-shadow .2s ease;
}
.chart-container:hover {
  box-shadow: var(--shadow-sm);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  #reportStatsGrid .stat-card { animation: none; }
}

/* ═══════════════════════════════════════════════════
   THREE-DOT DROPDOWN MENU
═══════════════════════════════════════════════════ */
.three-dot-item {
  display: block;
  width: 100%;
  padding: 9px 14px;
  border: none;
  background: none;
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
  text-align: left;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}
.three-dot-item:last-child { border-bottom: none; }
.three-dot-item:hover { background: var(--gray-50); color: var(--black); }
.three-dot-item[data-action="delete-product"] { color: var(--danger); }
.three-dot-item[data-action="delete-product"]:hover {
  background: var(--danger-bg);
}

/* ═══════════════════════════════════════════════════
   ROLE BADGE
═══════════════════════════════════════════════════ */
.role-badge {
  padding: 3px 10px;
  border: 1px solid rgba(255,255,255,.3);
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: var(--radius-full);
  font-weight: 700;
  background: transparent;
  color: rgba(255,255,255,.7);
}

/* ═══════════════════════════════════════════════════
   PRODUCT LAB — 3-PANEL WORKSPACE
═══════════════════════════════════════════════════ */
.lab-workspace-grid {
  display: grid;
  grid-template-columns: 260px 1fr 280px;
  height: 100%;
}

.lab-panel {
  padding: 20px;
  overflow-y: auto;
}

.lab-results-panel {
  background: var(--gray-50);
}

.lab-panel-title {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gray-400);
  margin-bottom: 20px;
}

.lab-field {
  margin-bottom: 20px;
}

.lab-label {
  display: block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gray-600);
  margin-bottom: 7px;
}

.lab-input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-family: var(--font-main);
  font-weight: 600;
  background: var(--white);
  color: var(--black);
  outline: none;
  transition: border-color var(--transition);
}
.lab-input:focus { border-color: var(--black); }

.lab-mode-btn {
  padding: 7px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--white);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-main);
  cursor: pointer;
  color: var(--gray-500);
  transition: all var(--transition);
}
.lab-mode-btn.lab-mode-active {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

.lab-stepper-btn {
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-main);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color var(--transition);
}
.lab-stepper-btn:hover { border-color: var(--black); }

.lab-stepper-input {
  width: 64px;
  padding: 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 800;
  font-family: var(--font-main);
  text-align: center;
  outline: none;
}
.lab-stepper-input:focus { border-color: var(--black); }

.lab-quick-btn {
  padding: 4px 10px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--white);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-main);
  color: var(--gray-500);
  transition: all var(--transition);
}
.lab-quick-btn:hover, .lab-quick-btn.lab-quick-active {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

.lab-margin-input {
  width: 56px;
  padding: 7px 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-main);
  text-align: center;
  outline: none;
}
.lab-margin-input:focus { border-color: var(--black); }

/* Responsive — stack on small screens */
@media (max-width: 1024px) {
  .lab-workspace-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    overflow-y: auto;
    height: auto;
  }
  .lab-panel { border-right: none !important; border-bottom: 1px solid var(--border); }
  .lab-results-panel { border-bottom: none; }
}

/* ═══════════════════════════════════════════════════
   ORIGIN MODE SUB-NAV TABS
═══════════════════════════════════════════════════ */
.origin-tab-btn {
  padding: 7px 14px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  white-space: nowrap;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.origin-tab-btn:hover {
  background: var(--white);
  color: var(--black);
}
.origin-tab-btn.active {
  background: var(--white);
  color: var(--black);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
