:root{
  --bg-surface:#f6f6f7;      /* app background */
  --bg-card:#ffffff;         /* cards, tables */
  --text:#1a1f24;            /* primary text */
  --muted:#637381;           /* secondary text */
  --line:#e5e7eb;            /* borders */
  --focus:#4d9fff;           /* focus ring */
  --primary:#008060;         /* Shopify green vibe */
  --primary-ink:#ffffff;
  --danger:#d82c0d;
  --radius:8px;
  --shadow:0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.1);
  --shadow-lg:0 6px 12px rgba(16,24,40,.12);
  --font: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0; background:var(--bg-surface); color:var(--text); font:14px/1.5 var(--font);
}

/* Header / Shell */
.shell-header{position:sticky; top:0; z-index:10; background:var(--bg-card); border-bottom:1px solid var(--line)}
.shell-header__inner{max-width:1200px; margin:0 auto; display:flex; align-items:center; gap:16px; padding:10px 16px}
.brand{display:flex; align-items:center; gap:10px; font-weight:600}
.brand__dot{width:10px; height:10px; border-radius:50%; background:var(--primary)}
.brand__text{letter-spacing:.2px}
.shell-nav{display:flex; gap:10px; margin-left:8px}
.nav-link{padding:8px 10px; border-radius:6px; color:var(--text); text-decoration:none}
.nav-link:hover{background:#f0f2f4}
.nav-link.is-active{background:#e6f3ef; color:#064d3b}
.shell-footer{position:absolute; text-align:center; margin:auto; bottom:0; z-index:10; width:100vw; color:#fff; background:#000; border-bottom:1px solid var(--line); }
.shell-footer__inner{max-width:1200px; margin:0 auto; display:flex; align-items:center; gap:16px; color:#fff; padding:10px 16px}

/* Page container */
.page{max-width:1200px; margin:20px auto; padding:0 16px}

/* Card */
.card{background:var(--bg-card); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow)}
.card__header{display:flex; align-items:center; justify-content:space-between; padding:14px 16px; border-bottom:1px solid var(--line)}
.card__title{font-size:16px; margin:0}
.card__actions{display:flex; gap:8px}
.card .form-row{display:flex; gap:12px; align-items:flex-end; padding:12px 16px; border-bottom:1px solid var(--line); flex-wrap:wrap}

/* Controls */
.label{display:block; font-weight:500; margin:0 0 6px; color:#2f3941}
.input, .select, .textarea{
  display:block; width:260px; max-width:100%;
  padding:10px 12px; border:1px solid var(--line); border-radius:6px; background:#fff; color:var(--text);
  outline:none; transition:box-shadow .15s, border-color .15s;
}
.input:focus, .select:focus, .textarea:focus{border-color:var(--focus); box-shadow:0 0 0 3px rgba(77,159,255,.25)}
.btn{
  appearance:none; border:1px solid transparent; border-radius:6px; padding:9px 14px; font-weight:600; cursor:pointer;
  background:#fff; color:var(--text); transition:background .15s, box-shadow .15s, border-color .15s, transform .02s;
}
.btn:active{transform:translateY(1px)}
.btn:hover{background:#f3f4f6}
.btn-primary{background:var(--primary); color:var(--primary-ink); border-color:var(--primary)}
.btn-primary:hover{filter:brightness(.95)}
.btn-outline{background:#fff; border-color:var(--line)}
.btn-danger{background:var(--danger); color:#fff; border-color:var(--danger)}

/* Table */
.table-wrap{overflow:auto}
.data-table{width:100%; border-collapse:separate; border-spacing:0}
.data-table thead th{
  position:sticky; top:0; z-index:1;
  background:#f9fafb; color:#374151; font-weight:600; text-align:left; font-size:12px; letter-spacing:.02em;
  border-bottom:1px solid var(--line); padding:10px 12px;
}
.data-table tbody td{
  padding:12px; border-bottom:1px solid var(--line); vertical-align:middle; color:#111827;
}
.data-table tbody tr:hover{background:#fbfbfc}
.data-table tbody tr:nth-child(even){background:#fcfcfd}
.data-table th:first-child, .data-table td:first-child{border-top-left-radius:6px}
.data-table th:last-child, .data-table td:last-child{border-top-right-radius:6px}
.t-right{text-align:right}

/* Badges (if you show stock/due state) */
.badge{display:inline-flex; align-items:center; gap:6px; padding:2px 8px; border-radius:999px; font-size:12px; border:1px solid var(--line); background:#fff}
.badge--ok{background:#e6f3ef; border-color:#c7e6db; color:#064d3b}
.badge--warn{background:#fff4e5; border-color:#ffe0b2; color:#8a5200}
.badge--muted{background:#f2f4f6; color:#637381}

/* Utilities */
.hidden{display:none}

/* Quick additions / overrides you might need */
.shadow-md {
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}
.rounded-xl {
  border-radius: 0.75rem;
}
.transition-colors {
  transition: color 0.2s, background-color 0.2s, border-color 0.2s;
}
.focus\:border-indigo-500:focus {
  border-color: #6366f1;
}
.focus\:ring-indigo-500:focus {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

/*ADDED */

/* Modernized dropdown */
.dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.12), 0 8px 10px -6px rgba(0,0,0,0.08);
  z-index: 50;
  margin-top: 8px;
  max-height: 320px;
  overflow-y: auto;
  font-size: 0.95rem;
}

.dropdown__item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
}

.dropdown__item:last-child {
  border-bottom: none;
}

.dropdown__item:hover,
.dropdown__item:focus {
  background: #f1f5f9;
  outline: none;
}

/* Table improvements */
.table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 0.94rem;
  line-height: 1.45;
}

.table th,
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: middle;
}

.table thead th {
  background: #f8fafc;
  font-weight: 600;
  color: #374151;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.4px;
}

.table tbody tr:hover {
  background-color: #f9fafb;
  transition: background-color 0.12s;
}

.table .ta-right {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Buttons consistency */
.btn {
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.13s;
}

.btn-primary {
  background-color: #2563eb;
  color: white;
  border: none;
}

.btn-primary:hover:not(:disabled) {
  background-color: #1d4ed8;
  transform: translateY(-1px);
}

.btn-outline {
  border: 1px solid #d1d5db;
  background: white;
  color: #374151;
}

.btn-outline:hover:not([disabled]) {
  background: #f8fafc;
  border-color: #9ca3af;
}

/* Loading / empty states */
#empty {
  padding: 60px 20px;
  text-align: center;
  font-size: 1.05rem;
  color: #6b7280;
  background: #f9fafb;
  border-radius: 10px;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Fix dropdown positioning & overflow */
.field {
  position: relative;           /* ← VERY IMPORTANT – makes dropdown position relative to this wrapper */
}

.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;                     /* stretch full width of input */
  z-index: 100;
  margin-top: 4px;              /* slightly tighter than before */
  max-height: 320px;
  overflow-y: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  background: var(--bg-card);
  border: 1px solid var(--line);
  font-size: 0.96rem;
  display: none;                /* we control via JS anyway */
}

/* Optional: nicer scrollbar if you want */
.dropdown::-webkit-scrollbar {
  width: 6px;
}
.dropdown::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

.dropdown__item {
  padding: 11px 16px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown__item:hover,
.dropdown__item:focus {
  background: #f0f9f4;
  outline: none;
}

/* Fix button alignment – make them consistent height + centering */
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;          /* ← changed from flex-end → much better vertical alignment */
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.35;            /* ← helps a lot with text vertical centering */
  height: 44px !important;      /* force same height */
  box-sizing: border-box;
}

.btn-primary,
.btn-outline {
  min-width: 140px;             /* smaller min-width looks better on narrow screens */
  padding: 0 20px;
  font-weight: 600;
}

/* Optional: make outline button text color more consistent */
.btn-outline {
  color: #333;
}

.btn-outline:hover:not([disabled]) {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(0, 128, 96, 0.05);
}

.dropdown {
border-radius: var(--radius);
box-shadow: var(--shadow-lg);
margin-top: 8px;
max-height: 340px;
font-size: 0.96rem;
background: var(--bg-card);
border: 1px solid var(--line);
}
.dropdown__item {
padding: 12px 16px;
cursor: pointer;
}
.dropdown__item:hover {
background: #f0f9f4; /* light green tint matching --primary */
}
.table {
font-size: 0.95rem;
}
.table thead th {
background: #f0f9f4; /* subtle primary tint */
color: #064d3b;
text-transform: uppercase;
font-size: 0.81rem;
letter-spacing: 0.45px;
padding: 12px 16px;
}
.table tbody td {
padding: 13px 16px;
}
.table tbody tr:hover {
background: #f0f9f4;
transition: background-color 0.13s;
}
#empty {
color: var(--muted);
}
/* Better button hover for primary */
.btn-primary:hover:not(:disabled) {
filter: brightness(0.94);
transform: translateY(-1px);
box-shadow: 0 4px 8px rgba(0,128,96,0.22);
}
.btn-outline:hover:not([disabled]) {
border-color: var(--primary);
color: var(--primary);
background: rgba(0,128,96,0.04);
}