:root {
  --navy-900: #0f2547;
  --navy-800: #16335f;
  --navy-700: #1d4280;
  --navy-600: #2c5db2;
  --accent: #3b82f6;
  --bg: #f4f6fa;
  --card-bg: #ffffff;
  --text: #1f2937;
  --text-strong: #0f172a;
  --muted: #6b7280;
  --border: #e5e7eb;
  --border-strong: #d1d5db;

  --green-bg: #d1fae5;
  --green-text: #065f46;
  --yellow-bg: #fef3c7;
  --yellow-text: #92400e;
  --orange-bg: #ffedd5;
  --orange-text: #9a3412;
  --blue-bg: #dbeafe;
  --blue-text: #1e40af;
  --red-bg: #fee2e2;
  --red-text: #991b1b;
  --gray-bg: #f3f4f6;
  --gray-text: #374151;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.view { flex: 1; display: flex; flex-direction: column; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-weight: 400; }

/* ─────────── BRAND HEADER ─────────── */
.brand-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 0;
}
.brand-header-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.brand-left, .brand-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.brand-mark {
  height: 48px;
  width: auto;
  max-width: 220px;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
}
.brand-name {
  display: inline-flex;
  flex-direction: column;
  line-height: 1;
  font-weight: 800;
  color: #000;
  font-size: 1.35rem;
  letter-spacing: -0.5px;
}
.brand-name small {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: #4b5563;
  margin-top: 4px;
}
.brand-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
  align-self: center;
}
.brand-section {
  color: var(--text-strong);
  font-weight: 600;
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.pin-icon { color: var(--navy-700); }
.status-pill {
  background: var(--green-bg);
  color: var(--green-text);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 4px;
}
.brand-time {
  color: var(--muted);
  font-size: 0.85rem;
}

/* ─────────── STEPPER ─────────── */
.stepper {
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.25rem 1rem;
}
.step {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.95rem;
}
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gray-bg);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}
.step.active .step-num {
  background: var(--navy-800);
  color: #fff;
}
.step.active .step-label {
  color: var(--text-strong);
  font-weight: 600;
}
.step.done .step-num {
  background: var(--navy-800);
  color: #fff;
}
.step.done .step-num::before {
  content: "✓";
}
.step.done .step-num span { display: none; }
.step.done .step-label {
  color: var(--text-strong);
  font-weight: 600;
}
.step-line {
  width: 120px;
  height: 1px;
  background: var(--border);
}

/* ─────────── CONTAINER ─────────── */
.container {
  max-width: 1320px;
  margin: 0 auto;
  width: 100%;
  padding: 2rem;
}

/* ─────────── VIEW 1: AUTH SPLIT ─────────── */
.view-split {
  flex-direction: row;
  flex-wrap: wrap;
  max-width: 1320px;
  margin: 0 auto;
  width: 100%;
  padding: 3rem 2rem;
  gap: 3rem;
}
.split-left {
  flex: 1 1 380px;
  min-width: 320px;
}
.split-right {
  flex: 1 1 520px;
  min-width: 320px;
  display: flex;
  justify-content: flex-end;
}
.hero-title {
  font-size: 2.25rem;
  color: var(--text-strong);
  margin: 0 0 1rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.hero-lead {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0 0 2.5rem;
  max-width: 480px;
}
.feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 480px;
}
.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.feature-list li:last-child { border-bottom: none; }
.feat-icon {
  width: 28px;
  height: 28px;
  background: var(--gray-bg);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.95rem;
}
.feature-list strong {
  display: block;
  color: var(--text-strong);
  font-size: 1rem;
  margin-bottom: 0.2rem;
}
.feature-list small {
  color: var(--muted);
  font-size: 0.85rem;
}

/* ─────────── AUTH CARD ─────────── */
.auth-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2rem;
  width: 100%;
  max-width: 540px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.card-title {
  color: var(--navy-800);
  margin: 0 0 0.25rem;
  font-size: 1.4rem;
  font-weight: 700;
}
.card-sub {
  color: var(--muted);
  margin: 0 0 1.5rem;
  font-size: 0.9rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

/* ─────────── FIELDS ─────────── */
.field {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
}
.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 0.4rem;
}
.req { color: #dc2626; }
.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}
.input-with-icon .ico {
  position: absolute;
  left: 0.85rem;
  color: var(--muted);
  pointer-events: none;
  font-size: 0.95rem;
}
.input-with-icon input,
.input-with-icon select {
  width: 100%;
  padding: 0.7rem 0.85rem 0.7rem 2.4rem;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-size: 0.95rem;
  color: var(--text);
  background: #fff;
  font-family: inherit;
}
.input-with-icon input:focus,
.input-with-icon select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.field-hint {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 0.35rem;
}

/* ─────────── BUTTONS ─────────── */
.btn-primary {
  background: var(--navy-800);
  color: #fff;
  border: none;
  padding: 0.75rem 1.4rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--navy-900); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.arrow { font-size: 1.05rem; }

.btn-outline {
  background: #fff;
  color: var(--text-strong);
  border: 1px solid var(--border-strong);
  padding: 0.55rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.btn-outline:hover { background: var(--gray-bg); }
.ico-inline { font-size: 0.9rem; color: var(--navy-700); }

.link-muted {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.link-muted:hover { color: var(--navy-700); text-decoration: underline; }
.link-add {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
}
.link-back {
  color: var(--navy-700);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.9rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.link-back:hover { text-decoration: underline; }

.form-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
}
.form-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

/* ─────────── ERROR ─────────── */
.error {
  background: var(--red-bg);
  color: var(--red-text);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  margin: 0.5rem 0;
}

/* ─────────── ACCOUNT CARD (View 2) ─────────── */
.account-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.account-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.5fr auto;
  gap: 1.5rem;
  align-items: center;
}
.account-label {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.account-val {
  color: var(--navy-800);
  font-weight: 600;
  font-size: 0.95rem;
  word-break: break-word;
}

/* ─────────── SEARCH CARD ─────────── */
.section-title {
  font-size: 1.5rem;
  color: var(--text-strong);
  margin: 0 0 0.5rem;
  font-weight: 700;
}
.section-title.compact { font-size: 1.5rem; margin: 0; }
.section-sub {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 1.25rem;
  max-width: 760px;
  line-height: 1.5;
}
.search-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.search-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr;
  gap: 1.5rem;
  align-items: start;
}
.po-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}
.po-header label { margin-bottom: 0; }
.po-inputs { display: flex; flex-direction: column; gap: 0.5rem; }
.po-row { display: flex; gap: 0.5rem; align-items: center; }
.po-row .input-with-icon { flex: 1; }
.po-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.3rem 0.5rem;
  line-height: 1;
}
.po-remove:hover { color: var(--red-text); }

/* ─────────── TRACK VIEW ─────────── */
.track-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  align-items: center;
}
.chip {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 38px;
  white-space: nowrap;
}
.chip-edit {
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.chip-edit:hover {
  border-color: var(--navy-600);
  background: #f8fafc;
}
.chip-edit::after {
  content: "✎";
  color: var(--muted);
  font-size: 0.75rem;
  margin-left: 0.25rem;
}
.chip-label {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}
.chip-val {
  color: var(--navy-700);
  font-weight: 600;
}
.chip-val.placeholder {
  color: var(--muted);
  font-weight: 500;
  font-style: italic;
}
.last-updated {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 0.6rem 0 1.5rem;
}

/* ─────────── TOAST ─────────── */
.toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 380px;
  pointer-events: none;
}
.toast {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--navy-700);
  border-radius: 8px;
  padding: 0.85rem 2.5rem 0.85rem 1rem;
  box-shadow: 0 10px 25px rgba(15, 37, 71, 0.18);
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-strong);
  position: relative;
  pointer-events: auto;
  animation: toast-in 0.2s ease-out;
}
.toast-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 700;
  font-size: 0.85rem;
}
.toast-body { line-height: 1.4; flex: 1; }
.toast-title { font-weight: 700; margin-bottom: 0.15rem; }
.toast-msg { color: var(--muted); font-size: 0.85rem; }
.toast-close {
  position: absolute;
  top: 0.4rem;
  right: 0.5rem;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.25rem;
}
.toast-close:hover { color: var(--text-strong); }
.toast.error { border-left-color: #dc2626; }
.toast.error .toast-icon { background: var(--red-bg); color: var(--red-text); }
.toast.success { border-left-color: #16a34a; }
.toast.success .toast-icon { background: var(--green-bg); color: var(--green-text); }
.toast.info { border-left-color: var(--navy-700); }
.toast.info .toast-icon { background: var(--blue-bg); color: var(--blue-text); }
.toast.warn { border-left-color: #d97706; }
.toast.warn .toast-icon { background: var(--yellow-bg); color: var(--yellow-text); }
@keyframes toast-in {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ─────────── LOADER ─────────── */
.loader {
  position: fixed;
  inset: 0;
  background: rgba(15, 37, 71, 0.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}
.loader.hidden { display: none; }
.loader-card {
  background: #fff;
  padding: 1.5rem 2rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.loader-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--navy-700);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}
.loader-text {
  color: var(--text-strong);
  font-weight: 600;
  font-size: 0.95rem;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─────────── EDIT POPOVER ─────────── */
.popover-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 37, 71, 0.3);
  z-index: 996;
}
.popover-overlay.hidden { display: none; }
.popover {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
  padding: 1.25rem;
  width: 420px;
  max-width: 92vw;
  z-index: 997;
}
.popover.hidden { display: none; }
.popover-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: 0.85rem;
}
.popover-body { display: flex; flex-direction: column; gap: 0.75rem; }
.popover-body .field { margin-bottom: 0; }
.popover-body .po-row { display: flex; gap: 0.5rem; align-items: center; }
.popover-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
  margin-top: 1.25rem;
}
.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; }
.dates-row { display: flex; gap: 0.75rem; }
.dates-row .field { flex: 1; }

.filters-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.filter-tabs {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  flex: 1;
}
.tab {
  background: none;
  border: none;
  padding: 0.7rem 0.95rem;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--navy-700); }
.tab.active {
  color: var(--navy-800);
  font-weight: 700;
  border-bottom-color: var(--navy-700);
}
.filters-actions { display: flex; gap: 0.5rem; }

/* ─────────── TABLE ─────────── */
.table-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.table-wrap {
  overflow-x: auto;
}
table.orders {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
table.orders th {
  background: #fff;
  text-align: left;
  padding: 1rem 1rem;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
table.orders th.num { text-align: right; }
table.orders td {
  padding: 1rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
table.orders td.num { text-align: right; }
table.orders tbody tr:last-child td { border-bottom: none; }
table.orders tbody tr:hover { background: #fafbfc; }
.muted-text { color: var(--muted); }

/* ─────────── BADGES (status — generic, derived from API value) ─────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.65rem;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid transparent;
}
/* preserved class names from original (Shipped/Partial/InProduction) */
.badge-shipped { background: var(--green-bg); color: var(--green-text); }
.badge-partial { background: var(--orange-bg); color: var(--orange-text); }
.badge-production { background: var(--yellow-bg); color: var(--yellow-text); }
/* generic catch-alls — slugified API status drives class */
.badge-delivered { background: var(--green-bg); color: var(--green-text); }
.badge-ready-to-ship { background: var(--blue-bg); color: var(--blue-text); }
.badge-partially-shipped { background: var(--orange-bg); color: var(--orange-text); }
.badge-on-hold { background: var(--red-bg); color: var(--red-text); }
.badge-in-transit { background: var(--blue-bg); color: var(--blue-text); }
.badge-in-production { background: var(--yellow-bg); color: var(--yellow-text); }
.badge-default { background: var(--gray-bg); color: var(--gray-text); }

/* ─────────── TRACKING LINK CARRIERS (preserved from original) ─────────── */
.track-link {
  color: var(--navy-700);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.track-link:hover { text-decoration: underline; }
.carrier-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  letter-spacing: 0.04em;
}
.carrier-tag.ups { background: #5f3a17; color: #ffd34d; }
.carrier-tag.fedex { background: #4d148c; color: #ff6600; }

/* ─────────── PAGINATION ─────────── */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.75rem;
}
.pagination-info {
  color: var(--muted);
  font-size: 0.85rem;
}
.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.pagination-controls select {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  font-size: 0.85rem;
}
.page-numbers { display: flex; gap: 0.25rem; }
.page-btn {
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  min-width: 32px;
  height: 32px;
  padding: 0 0.5rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text);
}
.page-btn:hover:not(:disabled) { background: var(--gray-bg); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-btn.active {
  background: var(--navy-800);
  color: #fff;
  border-color: var(--navy-800);
}
.page-arrow { font-size: 1.1rem; line-height: 1; }

/* ─────────── FOOTER ─────────── */
.page-footer {
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 1rem 0;
  margin-top: auto;
}
.footer-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-right a {
  color: var(--navy-700);
  text-decoration: underline;
}

/* ─────────── PLANTS CHECKLIST ─────────── */
.plants-field { margin-top: 1rem; }
.plants-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
}
.plants-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.5rem 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #fff;
  max-height: 180px;
  overflow-y: auto;
}
.plant-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.plant-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--navy-800);
  cursor: pointer;
}
.plant-check .plant-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-left: 0.25rem;
}
@media (max-width: 640px) {
  .plants-checklist {
    grid-template-columns: 1fr;
    max-height: 220px;
  }
}

/* ─────────── DATE COMBO (text + hidden picker) ─────────── */
.date-combo { position: relative; }
.input-with-icon .ico-btn {
  position: absolute;
  left: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  padding: 0.2rem 0.3rem;
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
  pointer-events: auto;
  z-index: 2;
}
.input-with-icon .ico-btn:hover { opacity: 0.65; }
.input-with-icon input.date-picker-shadow {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
}

/* ─────────── RESPONSIVE ─────────── */
@media (max-width: 880px) {
  .view-split { flex-direction: column; padding: 1.5rem; gap: 2rem; }
  .split-right { justify-content: stretch; }
  .auth-card { max-width: 100%; }
  .search-grid { grid-template-columns: 1fr; }
  .account-grid { grid-template-columns: 1fr; gap: 1rem; }
  .step-line { width: 36px; }
  .container { padding: 1.25rem; }
  .filters-bar { flex-direction: column; align-items: stretch; }
  .filter-tabs { overflow-x: auto; }
  .brand-header-inner { padding: 0 1rem; gap: 0.75rem; flex-wrap: wrap; }
  .dates-row { flex-direction: column; }
}

/* Phone-sized screens */
@media (max-width: 640px) {
  .brand-header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .brand-left, .brand-right { gap: 0.6rem; flex-wrap: wrap; }
  .brand-mark { height: 40px; max-width: 180px; }
  .brand-divider { height: 28px; }
  .brand-section { font-size: 0.95rem; }
  .brand-time { font-size: 0.78rem; }
  .status-pill { font-size: 0.7rem; padding: 0.2rem 0.5rem; }

  .stepper { gap: 0.4rem; padding: 0.85rem 0.5rem; flex-wrap: nowrap; }
  .step { gap: 0.35rem; font-size: 0.8rem; }
  .step-label { font-size: 0.8rem; }
  .step-num { width: 24px; height: 24px; font-size: 0.75rem; }
  .step-line { width: 18px; }

  .container { padding: 1rem; }
  .section-title { font-size: 1.4rem; }
  .section-sub { font-size: 0.9rem; }

  /* Forms: full-width buttons, stacked actions */
  .form-actions { flex-direction: column; align-items: stretch; gap: 0.6rem; }
  .form-actions .btn-primary { width: 100%; justify-content: center; }
  .form-actions .link-muted { text-align: center; }

  /* Account info card */
  .account-card { padding: 1rem; }
  .account-card .field-label { font-size: 0.7rem; }

  /* Track view: chips wrap and stack */
  .track-header { flex-direction: column; align-items: stretch; gap: 0.75rem; }
  .chip-row { flex-wrap: wrap; gap: 0.5rem; }
  .chip { flex: 1 1 calc(50% - 0.25rem); min-width: 0; }

  /* Toolbar/filters above the table */
  .filters-bar { gap: 0.6rem; }
  .filter-tabs { flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .filter-tabs .tab { flex-shrink: 0; }

  /* Orders table: horizontal scroll so it stays usable on phones */
  .orders-wrap, .orders-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.orders { min-width: 760px; font-size: 0.85rem; }
  table.orders th, table.orders td { padding: 0.6rem 0.5rem; white-space: nowrap; }

  /* Pagination wraps nicely */
  .pagination { flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
  .page-info { width: 100%; text-align: center; order: -1; font-size: 0.8rem; }

  /* Popover full-width on phone */
  .popover {
    width: calc(100vw - 1.5rem);
    max-width: 100%;
    left: 0.75rem;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
  }
  .popover-actions { flex-direction: column-reverse; gap: 0.5rem; }
  .popover-actions .btn-primary,
  .popover-actions .link-muted { width: 100%; text-align: center; justify-content: center; }

  /* Toast container — full width on phone */
  #toast-container { left: 0.75rem; right: 0.75rem; }
  .toast { width: auto; }
}
