/* ── Inventory module styles ──────────────────────────────────────────────── */

.inv-dashboard { max-width: 1100px; margin: 0 auto; }

.inv-stats {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.inv-stat-card {
  flex: 1;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  text-align: center;
}
.inv-stat-card .stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
  color: #1a1a2e;
}
.inv-stat-card .stat-number.alert { color: #c0392b; }
.inv-stat-card .stat-label { font-size: .85rem; color: #666; margin-top: .3rem; }

/* ── Item list ────────────────────────────────────────────────────────────── */

.inv-layout { display: flex; gap: 1.5rem; align-items: flex-start; }
.inv-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 1rem;
}
.inv-sidebar h3 { font-size: .9rem; text-transform: uppercase; letter-spacing: .05em; color: #888; margin: 0 0 .75rem; }
.inv-cat-tree { list-style: none; margin: 0; padding: 0; }
.inv-cat-tree li { margin: .2rem 0; }
.inv-cat-tree a { display: block; padding: .3rem .5rem; border-radius: 4px; color: #333; text-decoration: none; }
.inv-cat-tree a:hover, .inv-cat-tree a.active { background: #e8f0fe; color: #1a73e8; }
.inv-cat-tree .depth-1 { padding-left: 1rem; font-size: .9rem; }
.inv-cat-tree .depth-2 { padding-left: 2rem; font-size: .85rem; }
.inv-cat-tree .depth-3 { padding-left: 3rem; font-size: .85rem; }

.inv-main { flex: 1; min-width: 0; }
.inv-search { display: flex; gap: .5rem; margin-bottom: 1rem; }
.inv-search input { flex: 1; padding: .5rem .75rem; border: 1px solid #ccc; border-radius: 4px; }
.inv-search button { padding: .5rem 1rem; background: #1a73e8; color: #fff; border: none; border-radius: 4px; cursor: pointer; }

.inv-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #ddd; border-radius: 6px; overflow: hidden; }
.inv-table th { background: #f5f5f5; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; padding: .6rem .75rem; text-align: left; border-bottom: 1px solid #ddd; }
.inv-table td { padding: .6rem .75rem; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.inv-table tr:last-child td { border-bottom: none; }
.inv-table tr:hover td { background: #fafafa; }

.stock-badge {
  display: inline-block;
  padding: .2rem .5rem;
  border-radius: 12px;
  font-size: .8rem;
  font-weight: 600;
  min-width: 2.5rem;
  text-align: center;
}
.stock-ok  { background: #e8f5e9; color: #2e7d32; }
.stock-low { background: #fff3e0; color: #e65100; }
.stock-out { background: #ffebee; color: #c62828; }

/* ── Quick adjust buttons ─────────────────────────────────────────────────── */

.quick-adj { display: flex; align-items: center; gap: .4rem; }
.adj-btn {
  width: 28px; height: 28px;
  border: 1px solid #ccc; border-radius: 4px;
  background: #fff; cursor: pointer; font-size: 1rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.adj-btn:hover { background: #f0f0f0; }
.adj-btn.inc { border-color: #4caf50; color: #4caf50; }
.adj-btn.dec { border-color: #f44336; color: #f44336; }
.stock-qty-display { font-weight: 600; min-width: 2.5rem; text-align: center; }

/* ── Item detail ──────────────────────────────────────────────────────────── */

.inv-item-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 1.5rem;
}
.inv-item-meta { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.inv-item-meta .meta-block { background: #fff; border: 1px solid #ddd; border-radius: 6px; padding: .75rem 1rem; }
.inv-item-meta .meta-label { font-size: .75rem; text-transform: uppercase; color: #888; }
.inv-item-meta .meta-value { font-size: 1.5rem; font-weight: 700; color: #1a1a2e; }

.inv-adjust-panel {
  background: #fff; border: 1px solid #ddd; border-radius: 6px;
  padding: 1.25rem; margin-bottom: 1.5rem;
}
.inv-adjust-panel h3 { margin: 0 0 1rem; font-size: 1rem; }
.adj-controls { display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-end; }
.adj-controls label { font-size: .85rem; display: block; margin-bottom: .25rem; color: #555; }
.adj-controls select, .adj-controls input { padding: .45rem .65rem; border: 1px solid #ccc; border-radius: 4px; }
.adj-controls input[type=number] { width: 90px; }
.adj-controls input[type=text] { width: 220px; }
.adj-submit-btn {
  padding: .5rem 1.25rem; background: #1a73e8; color: #fff;
  border: none; border-radius: 4px; cursor: pointer;
}

/* ── Adjustment history ───────────────────────────────────────────────────── */

.adj-type-decrement { color: #c62828; }
.adj-type-increment, .adj-type-received { color: #2e7d32; }
.adj-type-set { color: #1565c0; }

/* ── Purchase orders ──────────────────────────────────────────────────────── */

.po-status {
  display: inline-block; padding: .2rem .6rem; border-radius: 12px; font-size: .8rem; font-weight: 600;
}
.po-status-pending    { background: #fff9c4; color: #f57f17; }
.po-status-ordered    { background: #e3f2fd; color: #1565c0; }
.po-status-partial    { background: #fff3e0; color: #e65100; }
.po-status-received   { background: #e8f5e9; color: #2e7d32; }
.po-status-cancelled  { background: #fce4ec; color: #880e4f; }

.po-line-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-end; margin-top: 1rem; }
.po-line-form label { font-size: .8rem; display: block; margin-bottom: .2rem; }
.po-line-form input, .po-line-form select { padding: .4rem .6rem; border: 1px solid #ccc; border-radius: 4px; }
.po-line-form input[type=number] { width: 80px; }
.po-item-select { min-width: 200px; }

.order-history-table { font-size: .85rem; }
.order-history-table td { padding: .4rem .6rem; }

/* ── Low stock page ───────────────────────────────────────────────────────── */

.low-stock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.low-stock-card {
  background: #fff; border: 1px solid #f5a623; border-radius: 6px;
  padding: 1rem; display: flex; flex-direction: column; gap: .5rem;
}
.low-stock-card .item-name { font-weight: 600; color: #1a1a2e; }
.low-stock-card .stock-info { font-size: .85rem; color: #666; }
.low-stock-card .card-actions { margin-top: auto; display: flex; gap: .5rem; }
.btn-sm {
  padding: .3rem .7rem; font-size: .8rem; border-radius: 4px; text-decoration: none;
  display: inline-block; border: 1px solid transparent;
}
.btn-sm.primary { background: #1a73e8; color: #fff; }
.btn-sm.secondary { background: #fff; color: #333; border-color: #ccc; }

/* ── Barcode lookup ───────────────────────────────────────────────────────── */

.barcode-lookup { max-width: 500px; margin: 2rem auto; text-align: center; }
.barcode-input-wrap { display: flex; gap: .5rem; margin: 1rem 0; }
.barcode-input-wrap input { flex: 1; padding: .65rem 1rem; font-size: 1.1rem; border: 2px solid #1a73e8; border-radius: 6px; }
.barcode-result { background: #fff; border: 1px solid #ddd; border-radius: 6px; padding: 1.25rem; text-align: left; margin-top: 1rem; }

/* ── Store front ──────────────────────────────────────────────────────────── */

.store-hero { background: #1a1a2e; color: #fff; padding: 3rem 1.5rem; text-align: center; margin-bottom: 2rem; }
.store-hero h1 { font-size: 2.5rem; margin: 0 0 .5rem; }
.store-hero p { color: #aaa; }
.pickup-notice {
  background: #fff3cd; border: 1px solid #ffc107; border-radius: 6px;
  padding: .75rem 1.25rem; margin-bottom: 1.5rem; font-size: .9rem;
}
.pickup-notice strong { color: #856404; }

.store-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}
.store-cat-card {
  background: #fff; border: 1px solid #ddd; border-radius: 8px;
  padding: 1.5rem 1rem; text-align: center; text-decoration: none; color: #1a1a2e;
  transition: box-shadow .15s, transform .15s;
  display: block;
}
.store-cat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); transform: translateY(-2px); color: #1a73e8; }
.store-cat-card .cat-icon { font-size: 2.5rem; margin-bottom: .5rem; }
.store-cat-card .cat-name { font-weight: 600; font-size: 1.05rem; }
.store-cat-card .cat-count { font-size: .8rem; color: #888; margin-top: .2rem; }

.store-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.store-product-card {
  background: #fff; border: 1px solid #ddd; border-radius: 8px;
  padding: 1rem; text-decoration: none; color: #1a1a2e;
  transition: box-shadow .15s;
  display: flex; flex-direction: column;
}
.store-product-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.store-product-card .prod-name { font-weight: 600; margin-bottom: .3rem; }
.store-product-card .prod-price { color: #1a73e8; font-weight: 700; margin-top: auto; padding-top: .5rem; }
.store-product-card .prod-desc { font-size: .82rem; color: #666; }
.out-of-stock .prod-price { color: #c62828; }

/* ── Action buttons ───────────────────────────────────────────────────────── */

.btn { display: inline-block; padding: .5rem 1rem; border-radius: 4px; text-decoration: none; border: 1px solid transparent; cursor: pointer; font-size: .9rem; }
.btn-primary   { background: #1a73e8; color: #fff; }
.btn-secondary { background: #fff; color: #333; border-color: #ccc; }
.btn-danger    { background: #c62828; color: #fff; }
.btn-success   { background: #2e7d32; color: #fff; }
.btn-warning   { background: #e65100; color: #fff; }
.btn:hover { opacity: .85; }

.inv-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
