/* ═══════════════════════════════════════════════════════════════════════
   PartsHound — Industrial Dark Theme
   Design: Charcoal + Amber, Space Grotesk headings, DM Sans body
   ═══════════════════════════════════════════════════════════════════════ */

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

:root {
  --charcoal: #1a1a1a;
  --steel: #2d2d2d;
  --concrete: #3a3a3a;
  --iron: #4a4a4a;
  --amber: #f59e0b;
  --amber-bright: #fbbf24;
  --amber-dim: #d97706;
  --amber-glow: rgba(245, 158, 11, 0.15);
  --red: #ef4444;
  --red-dim: #dc2626;
  --green: #22c55e;
  --green-dim: #16a34a;
  --blue: #3b82f6;
  --text-primary: #f5f5f5;
  --text-secondary: #a3a3a3;
  --text-muted: #737373;
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(245, 158, 11, 0.3);
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --transition: 0.2s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background-color: var(--charcoal);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Grain overlay */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
}

h1, h2, h3, h4 { font-family: 'Space Grotesk', sans-serif; }

.hidden { display: none !important; }

/* ─── NAV ──────────────────────────────────────────────────────────────── */

nav {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(26, 26, 26, 0.88);
  backdrop-filter: blur(12px);
  z-index: 100;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--amber);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.logo span { color: var(--text-primary); }

.nav-links {
  display: flex;
  gap: 0.25rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  position: relative;
}
.nav-link:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.nav-link.active { color: var(--amber); background: var(--amber-glow); }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  margin-left: 4px;
  vertical-align: middle;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: var(--transition);
}

/* ─── MOBILE NAV ───────────────────────────────────────────────────────── */

.mobile-nav-overlay {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(26,26,26,0.97);
  backdrop-filter: blur(20px);
  z-index: 99;
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  gap: 0.5rem;
}
.mobile-nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 1.15rem;
  font-weight: 600;
  padding: 1rem;
  border-radius: var(--radius);
  transition: var(--transition);
  font-family: 'Space Grotesk', sans-serif;
}
.mobile-nav-link:hover, .mobile-nav-link.active {
  color: var(--amber);
  background: var(--amber-glow);
}

/* ─── MAIN ─────────────────────────────────────────────────────────────── */

main {
  padding: 80px 1.5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  min-height: 100vh;
}

/* ─── PAGE HEADER ──────────────────────────────────────────────────────── */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ─── STATS GRID ───────────────────────────────────────────────────────── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--steel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: var(--transition);
}
.stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.35rem;
}
.stat-card .stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
}
.stat-card .stat-value.amber { color: var(--amber); }
.stat-card .stat-value.red { color: var(--red); }
.stat-card .stat-value.green { color: var(--green); }

/* ─── SEARCH BAR ───────────────────────────────────────────────────────── */

.search-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 200px;
  padding: 0.7rem 1rem;
  padding-left: 2.5rem;
  background: var(--steel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  transition: var(--transition);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23737373' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.85rem center;
}
.search-input:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-glow);
}
.search-input::placeholder { color: var(--text-muted); }

.filter-select {
  padding: 0.7rem 1rem;
  background: var(--steel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  appearance: none;
  padding-right: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23a3a3a3' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: calc(100% - 0.7rem) center;
}
.filter-select:focus {
  outline: none;
  border-color: var(--amber);
}

/* ─── BUTTONS ──────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.1rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--amber);
  color: var(--charcoal);
}
.btn-primary:hover { background: var(--amber-bright); transform: translateY(-1px); }

.btn-secondary {
  background: var(--concrete);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--text-muted); }

.btn-danger {
  background: rgba(239,68,68,0.15);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.2);
}
.btn-danger:hover { background: rgba(239,68,68,0.25); }

.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--concrete);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}
.btn-icon:hover { color: var(--amber); border-color: var(--amber); }

/* ─── CARDS / TABLE ────────────────────────────────────────────────────── */

.card {
  background: var(--steel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.card-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table thead th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.15);
  white-space: nowrap;
}
.data-table tbody tr {
  transition: var(--transition);
  cursor: pointer;
}
.data-table tbody tr:hover { background: rgba(245,158,11,0.04); }
.data-table tbody td {
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}
.data-table tbody td:first-child { color: var(--text-primary); font-weight: 500; }

/* Responsive table wrapper */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ─── ITEM CARDS (mobile list view) ────────────────────────────────────── */

.item-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.item-card {
  background: var(--steel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: var(--transition);
}
.item-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.item-card .item-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}
.item-card .item-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.item-card .item-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* ─── QUANTITY DISPLAY ─────────────────────────────────────────────────── */

.qty-display {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.qty-value {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
}
.qty-low { color: var(--red); }
.qty-ok { color: var(--green); }
.qty-zero { color: var(--red); font-weight: 700; }

/* ─── STATUS BADGES ────────────────────────────────────────────────────── */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}
.status-open { background: rgba(59,130,246,0.15); color: var(--blue); }
.status-in_progress, .status-in-progress { background: rgba(245,158,11,0.15); color: var(--amber); }
.status-completed { background: rgba(34,197,94,0.15); color: var(--green); }
.status-cancelled, .status-closed { background: rgba(115,115,115,0.15); color: var(--text-muted); }
.status-active { background: rgba(34,197,94,0.15); color: var(--green); }
.status-inactive, .status-down { background: rgba(239,68,68,0.15); color: var(--red); }
.status-maintenance { background: rgba(245,158,11,0.15); color: var(--amber); }

.priority-badge {
  display: inline-flex;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.priority-urgent { background: rgba(239,68,68,0.2); color: var(--red); }
.priority-high { background: rgba(245,158,11,0.2); color: var(--amber); }
.priority-normal { background: rgba(115,115,115,0.15); color: var(--text-muted); }
.priority-low { background: rgba(59,130,246,0.1); color: rgba(96,165,250,0.8); }

/* ─── LOCATION TAG ─────────────────────────────────────────────────────── */

.location-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.15);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--amber);
  font-weight: 500;
}

/* ─── FORMS ────────────────────────────────────────────────────────────── */

.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  transition: var(--transition);
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-glow);
}
.form-input::placeholder, .form-textarea::placeholder {
  color: var(--text-muted);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-select {
  appearance: none;
  cursor: pointer;
  padding-right: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23a3a3a3' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: calc(100% - 0.7rem) center;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ─── MODAL ────────────────────────────────────────────────────────────── */

.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 1rem 2rem;
  overflow-y: auto;
}

.modal {
  background: var(--steel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow);
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
}
.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  transition: var(--transition);
}
.modal-close:hover { color: var(--text-primary); border-color: var(--text-muted); }

.modal-body {
  padding: 1.25rem;
}

/* ─── DETAIL VIEW ──────────────────────────────────────────────────────── */

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.detail-field {
  padding: 0.75rem 1rem;
  background: var(--charcoal);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.detail-field .field-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.2rem;
}
.detail-field .field-value {
  font-size: 0.9rem;
  color: var(--text-primary);
  word-break: break-word;
}
.detail-field.full-width {
  grid-column: 1 / -1;
}

.detail-section {
  margin-top: 1.5rem;
}
.detail-section h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.detail-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

/* ─── PART IMAGE ───────────────────────────────────────────────────────── */

.part-image {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.part-image-placeholder {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--concrete);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ─── TOAST ────────────────────────────────────────────────────────────── */

.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  animation: toastIn 0.25s ease;
  box-shadow: var(--shadow);
  max-width: 360px;
}
.toast-success { background: var(--green-dim); color: #fff; }
.toast-error { background: var(--red-dim); color: #fff; }
.toast-info { background: var(--concrete); color: var(--text-primary); border: 1px solid var(--border); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── ALERT CARD ───────────────────────────────────────────────────────── */

.alert-card {
  background: var(--steel);
  border: 1px solid rgba(239,68,68,0.2);
  border-left: 4px solid var(--red);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: var(--transition);
}
.alert-card:hover { border-color: rgba(239,68,68,0.4); }
.alert-info h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}
.alert-info p {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.alert-qty {
  text-align: right;
  white-space: nowrap;
}
.alert-qty .current {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--red);
}
.alert-qty .threshold {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ─── EMPTY STATE ──────────────────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}
.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.4;
}
.empty-state h3 {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}
.empty-state p {
  font-size: 0.88rem;
  margin-bottom: 1.5rem;
}

/* ─── LOADING ──────────────────────────────────────────────────────────── */

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── LINKED LIST (mini-table in detail view) ──────────────────────────── */

.linked-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.linked-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.85rem;
  background: var(--charcoal);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  transition: var(--transition);
}
.linked-item:hover { border-color: var(--border-hover); }
.linked-item .linked-name {
  font-weight: 500;
  color: var(--text-primary);
}
.linked-item .linked-meta {
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* ─── DASHBOARD WELCOME ───────────────────────────────────────────────── */

.dashboard-welcome {
  margin-bottom: 2rem;
}
.dashboard-welcome h1 {
  font-size: 2rem;
  margin-bottom: 0.3rem;
}
.dashboard-welcome h1 span { color: var(--amber); }
.dashboard-welcome p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 2rem;
}
.quick-action {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--steel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  color: var(--text-primary);
}
.quick-action:hover {
  border-color: var(--amber);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(245,158,11,0.1);
}
.quick-action .qa-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--amber-glow);
  border-radius: 8px;
  font-size: 1.2rem;
}
.quick-action .qa-text {
  font-weight: 600;
  font-size: 0.88rem;
}

/* ─── FILE INPUT ───────────────────────────────────────────────────────── */

.file-input-wrapper {
  position: relative;
}
.file-input-wrapper input[type="file"] {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.file-input-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem;
  background: var(--charcoal);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: var(--transition);
}
.file-input-label:hover { border-color: var(--amber); color: var(--amber); }

/* ─── DEMO BANNER ──────────────────────────────────────────────────────── */

.demo-banner {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  z-index: 95;
  background: linear-gradient(135deg, rgba(245,158,11,0.12) 0%, rgba(217,119,6,0.18) 100%);
  border-bottom: 1px solid rgba(245,158,11,0.25);
  backdrop-filter: blur(8px);
  padding: 0.55rem 1.5rem;
}

.demo-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.demo-banner-icon {
  font-size: 1.1rem;
  animation: spin 4s linear infinite;
  display: inline-block;
}

.demo-banner-text {
  flex: 1;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.demo-banner-text strong {
  color: var(--amber);
}

.demo-banner-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 1rem;
  background: var(--amber);
  color: var(--charcoal);
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 20px;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}

.demo-banner-cta:hover {
  background: var(--amber-bright);
  transform: translateY(-1px);
  box-shadow: 0 2px 12px rgba(245,158,11,0.3);
}

/* When demo banner is visible, push main content down */
body.demo-active main {
  padding-top: 120px;
}

/* ─── SUBSCRIPTION BANNER ───────────────────────────────────────────────── */

.subscription-banner {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  z-index: 96;
  background: linear-gradient(135deg, rgba(239,68,68,0.15) 0%, rgba(220,38,38,0.2) 100%);
  border-bottom: 1px solid rgba(239,68,68,0.3);
  backdrop-filter: blur(8px);
  padding: 0.6rem 1.5rem;
}

.subscription-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.subscription-banner-icon {
  font-size: 1.2rem;
  color: var(--red);
}

.subscription-banner-text {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.subscription-banner-text strong {
  color: var(--red);
}

.subscription-banner-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.45rem 1.1rem;
  background: var(--amber);
  color: var(--charcoal);
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 20px;
  text-decoration: none;
  transition: var(--transition);
}

.subscription-banner-cta:hover {
  background: var(--amber-bright);
  transform: translateY(-1px);
  box-shadow: 0 2px 12px rgba(245,158,11,0.3);
}

/* When subscription banner is visible, push main content down */
body.subscription-warning main {
  padding-top: 120px;
}

/* ─── RESPONSIVE ───────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }

  main { padding: 70px 1rem 1.5rem; }

  .page-header { flex-direction: column; align-items: flex-start; }
  .page-header h1 { font-size: 1.4rem; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  .form-row, .form-row-3 { grid-template-columns: 1fr; }

  .detail-grid { grid-template-columns: 1fr; }

  .modal-backdrop { padding: 60px 0.5rem 1rem; }
  .modal { max-width: 100%; }

  .data-table { display: none; }
  .mobile-only { display: block !important; }
  .desktop-only { display: none !important; }

  .search-bar { flex-direction: column; }

  .toast-container { left: 1rem; right: 1rem; }
  .toast { max-width: 100%; }

  .dashboard-welcome h1 { font-size: 1.5rem; }
  .quick-actions { grid-template-columns: 1fr 1fr; }

  .alert-card { flex-direction: column; align-items: flex-start; }
  .alert-qty { text-align: left; }

  .demo-banner { padding: 0.5rem 1rem; top: 56px; }
  .demo-banner-content { gap: 0.5rem; }
  .demo-banner-icon { display: none; }
  .demo-banner-text { font-size: 0.78rem; }
  body.demo-active main { padding-top: 110px; }

  .subscription-banner { padding: 0.5rem 1rem; top: 56px; }
  .subscription-banner-content { gap: 0.5rem; }
  .subscription-banner-icon { font-size: 1rem; }
  .subscription-banner-text { font-size: 0.78rem; }
  body.subscription-warning main { padding-top: 110px; }
}

@media (min-width: 769px) {
  .mobile-only { display: none !important; }
}

/* ─── CONFIRM DIALOG ───────────────────────────────────────────────────── */

.confirm-content {
  text-align: center;
  padding: 1rem 0;
}
.confirm-content p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}
.confirm-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

/* ─── LINK SELECTOR ────────────────────────────────────────────────────── */

.link-selector {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}
.link-selector .form-group { flex: 1; margin-bottom: 0; }
