/* ============================================================
   Sourcewell Quarterly Audit — Stylesheet
   ============================================================ */

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

:root {
  --brand-blue:   #1a4b8c;
  --accent-blue:  #2563eb;
  --light-blue:   #dbeafe;
  --success:      #16a34a;
  --warning:      #d97706;
  --danger:       #dc2626;
  --gray-50:      #f9fafb;
  --gray-100:     #f3f4f6;
  --gray-200:     #e5e7eb;
  --gray-300:     #d1d5db;
  --gray-400:     #9ca3af;
  --gray-600:     #4b5563;
  --gray-700:     #374151;
  --gray-800:     #1f2937;
  --white:        #ffffff;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.08);
  --shadow-md:    0 4px 12px rgba(0,0,0,.12);
  --shadow-lg:    0 8px 24px rgba(0,0,0,.16);
  --radius:       10px;
  --radius-sm:    6px;
  --transition:   0.18s ease;
}

html { font-size: 15px; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  min-height: 100vh;
}

/* ── Header ─────────────────────────────────────────────── */
.app-header {
  background: var(--brand-blue);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(0,0,0,.22);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -.2px;
  flex-shrink: 0;
}
.header-brand i { font-size: 1.3rem; opacity: .9; }

.header-nav { display: flex; gap: .35rem; }
.nav-btn {
  background: transparent;
  border: 2px solid rgba(255,255,255,.22);
  color: rgba(255,255,255,.8);
  padding: .35rem .85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .82rem;
  font-weight: 500;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: .4rem;
  position: relative;
}
.nav-btn:hover, .nav-btn.active {
  background: rgba(255,255,255,.15);
  border-color: rgba(255,255,255,.6);
  color: var(--white);
}

/* Old badge class kept for any legacy refs — superseded by .nav-badge */
.customer-count-badge { display: none !important; }

/* ── Main layout ─────────────────────────────────────────── */
.app-main {
  max-width: 1140px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3rem;
}

.tab-section { display: none; }
.tab-section.active { display: block; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.4rem;
  overflow: hidden;
}
.card-header {
  padding: .8rem 1.25rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  background: var(--gray-50);
}
.card-header h2 {
  font-size: .95rem;
  font-weight: 600;
  color: var(--brand-blue);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.card-header-actions {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
}
.card-body { padding: 1.1rem 1.25rem; }
.card-body.p0 { padding: 0; }

/* ── Config card ─────────────────────────────────────────── */
.config-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: flex-end;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.form-group label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.form-group select,
.form-group input[type="text"],
.form-group textarea {
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: .45rem .7rem;
  font-size: .88rem;
  font-family: inherit;
  color: var(--gray-800);
  background: var(--white);
  cursor: pointer;
  transition: border-color var(--transition);
  resize: vertical;
}
.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.field-hint {
  font-size: .72rem;
  font-weight: 400;
  color: var(--gray-400);
  text-transform: none;
  letter-spacing: 0;
  margin-left: .3rem;
}
.required { color: var(--danger); }

.presets-group { flex: 1; min-width: 280px; }
.presets-row { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.presets-row select { flex: 1; min-width: 140px; }

/* ── Nav badge (customers + pricing count) ───────────────── */
.nav-badge {
  background: #60a5fa;
  color: var(--white);
  font-size: .65rem;
  font-weight: 700;
  border-radius: 99px;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
  line-height: 1.4;
  display: none;
}

/* ── Status banners row (Generate tab) ───────────────────── */
.status-banners-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .8rem;
  margin-bottom: 1.1rem;
}
@media (max-width: 680px) {
  .status-banners-row { grid-template-columns: 1fr; }
}

.status-banner {
  border-radius: var(--radius);
  padding: .7rem 1.1rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .85rem;
  font-weight: 500;
}
.status-banner i       { font-size: 1.1rem; flex-shrink: 0; }
.status-banner span    { flex: 1; }

.status-banner-blue {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1.5px solid #bfdbfe;
  color: var(--brand-blue);
}
.status-banner-blue i  { color: var(--accent-blue); }

.status-banner-green {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1.5px solid #86efac;
  color: #166534;
}
.status-banner-green i { color: var(--success); }

/* Green outline button (used in green banner) */
.btn-outline-green {
  background: transparent;
  color: var(--success);
  border-color: var(--success);
}
.btn-outline-green:hover:not(:disabled) {
  background: #dcfce7;
}

/* ── Combined multi-file drop zone ──────────────────────── */
.multi-drop-zone {
  border: 2px dashed var(--accent-blue);
  border-radius: var(--radius);
  background: #f0f6ff;
  padding: 1.75rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  margin-bottom: 1.1rem;
}
.multi-drop-zone.dragging,
.multi-drop-zone:hover {
  background: #dbeafe;
  border-color: var(--brand-blue);
}
.multi-drop-icon {
  font-size: 2rem;
  color: var(--accent-blue);
  margin-bottom: .5rem;
  display: block;
}
.multi-drop-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--brand-blue);
  margin-bottom: .25rem;
}
.multi-drop-sub {
  font-size: .8rem;
  color: var(--gray-600);
  margin-bottom: .9rem;
}
.multi-drop-browse {
  pointer-events: all;
}

/* ── Upload grid (2-column) ──────────────────────────────── */
.uploads-grid {
  display: grid;
  gap: 1.1rem;
  margin-bottom: 1.25rem;
}
.uploads-grid-2col {
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}

.upload-card {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.1rem;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
  position: relative;
}
.upload-card.has-file  { border-color: #86efac; background: #f0fdf4; }
.upload-card.has-error { border-color: var(--danger); }
.upload-card-optional  { border-style: dashed; border-color: var(--gray-300); background: var(--gray-50); }
.upload-card-optional.has-file { border-style: solid; border-color: #86efac; background: #f0fdf4; }

.upload-header {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  margin-bottom: .9rem;
}
.upload-number {
  width: 28px; height: 28px; min-width: 28px;
  background: var(--brand-blue);
  color: var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700;
  margin-top: 2px;
}
.upload-number.optional-num { background: var(--gray-400); }
.upload-header h3 { font-size: .9rem; font-weight: 600; margin-bottom: .2rem; line-height: 1.3; }
.upload-hint { font-size: .75rem; color: var(--gray-400); }
.optional-tag {
  font-size: .68rem; font-weight: 600;
  background: var(--gray-200); color: var(--gray-600);
  padding: 1px 6px; border-radius: 99px;
  text-transform: uppercase; letter-spacing: .3px;
  vertical-align: middle; margin-left: .3rem;
}

.drop-zone {
  border: 2px dashed var(--gray-200);
  border-radius: 8px;
  padding: 1.4rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  background: var(--gray-50);
}
.drop-zone:hover, .drop-zone.dragging {
  border-color: var(--accent-blue);
  background: var(--light-blue);
}
.drop-icon { font-size: 1.75rem; color: var(--gray-400); margin-bottom: .4rem; display: block; }
.drop-zone:hover .drop-icon, .drop-zone.dragging .drop-icon { color: var(--accent-blue); }
.drop-text { font-size: .81rem; color: var(--gray-600); }
.drop-link { color: var(--accent-blue); font-weight: 600; text-decoration: underline; }
.file-input {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer; width: 100%; height: 100%;
}

.file-info {
  font-size: .78rem; color: var(--success); font-weight: 500;
  margin-top: .4rem; min-height: 1.1em;
  display: flex; align-items: center; gap: .3rem;
}
.validation-msg {
  font-size: .76rem; margin-top: .25rem;
  min-height: 1.1em; line-height: 1.4;
}
.validation-msg.ok    { color: var(--success); }
.validation-msg.warn  { color: var(--warning); }
.validation-msg.error { color: var(--danger); }

.remove-file-btn {
  position: absolute;
  top: .6rem; right: .6rem;
}

/* ── Action row ──────────────────────────────────────────── */
.action-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.action-hint { font-size: .82rem; color: var(--gray-400); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  padding: .5rem 1rem;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1.3;
  text-decoration: none;
}
.btn:disabled { opacity: .42; cursor: not-allowed; }

.btn-primary  { background: var(--accent-blue); color: var(--white); border-color: var(--accent-blue); }
.btn-primary:hover:not(:disabled)  { background: #1d4ed8; border-color: #1d4ed8; }

.btn-secondary { background: var(--gray-100); color: var(--gray-800); border-color: var(--gray-200); }
.btn-secondary:hover:not(:disabled) { background: var(--gray-200); }

.btn-outline   { background: transparent; color: var(--accent-blue); border-color: var(--accent-blue); }
.btn-outline:hover:not(:disabled)   { background: var(--light-blue); }

.btn-success   { background: var(--success); color: var(--white); border-color: var(--success); }
.btn-success:hover:not(:disabled)   { background: #15803d; border-color: #15803d; }

.btn-danger    { background: var(--danger); color: var(--white); border-color: var(--danger); }
.btn-danger:hover:not(:disabled)    { background: #b91c1c; border-color: #b91c1c; }

.btn-ghost {
  background: transparent; color: var(--gray-600);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) { background: var(--gray-100); color: var(--gray-800); }

.btn-lg  { font-size: .97rem; padding: .65rem 1.5rem; }
.btn-sm  { font-size: .79rem; padding: .32rem .75rem; }
.btn-xs  { font-size: .72rem; padding: .22rem .55rem; gap: .3rem; }

/* ── Progress ────────────────────────────────────────────── */
.progress-bar-wrap {
  background: var(--gray-200);
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
  margin-bottom: .8rem;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), #60a5fa);
  border-radius: 99px;
  width: 0%;
  transition: width .4s ease;
}
.progress-log {
  background: #0f172a;
  color: #a3e635;
  font-family: 'Courier New', monospace;
  font-size: .76rem;
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
  max-height: 220px;
  overflow-y: auto;
  line-height: 1.65;
}
.log-entry  { margin: .05rem 0; }
.log-ok     { color: #4ade80; }
.log-warn   { color: #fbbf24; }
.log-error  { color: #f87171; }

/* ── Results ─────────────────────────────────────────────── */
.results-card { border-color: #bbf7d0; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: .8rem;
  margin-bottom: 1.2rem;
}
.stat-box {
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  padding: .85rem 1rem;
  text-align: center;
}
.stat-box.stat-warn { border-color: #fde68a; background: #fffbeb; }
.stat-label { font-size: .7rem; color: var(--gray-600); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; margin-bottom: .3rem; }
.stat-value { font-size: 1.3rem; font-weight: 700; color: var(--brand-blue); }
.stat-box.stat-warn .stat-value { color: var(--warning); }
.stat-sub   { font-size: .7rem; color: var(--gray-400); margin-top: .2rem; }

.download-row { display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }

.errors-preview {
  border: 1.5px solid #fde68a;
  background: #fffbeb;
  border-radius: 8px;
  padding: 1rem;
}
.errors-preview h3 { font-size: .88rem; color: var(--warning); margin-bottom: .75rem; display: flex; align-items: center; gap: .4rem; }

/* ── Unknown customers alert ─────────────────────────────── */
.unknown-alert {
  background: linear-gradient(135deg, #faf5ff 0%, #ede9fe 100%);
  border: 2px solid #a78bfa;
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.25rem;
  animation: fadeInDown .3s ease;
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.unknown-alert-header {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  margin-bottom: .85rem;
  flex-wrap: wrap;
}
.unknown-alert-header i {
  font-size: 1.1rem;
  color: #7c3aed;
  margin-top: 2px;
  flex-shrink: 0;
}
.unknown-alert-header strong {
  color: #5b21b6;
  font-size: .92rem;
}
.unknown-alert-sub {
  display: block;
  font-size: .78rem;
  color: #6d28d9;
  margin-top: .2rem;
  width: 100%;
}
.unknown-alert-actions {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  margin-top: .85rem;
  padding-top: .85rem;
  border-top: 1px solid #ddd6fe;
}
.unknown-table { width: 100%; }

/* ── Tables (shared) ─────────────────────────────────────── */
.errors-table, .customer-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
}
.errors-table th, .customer-table th {
  background: var(--gray-100);
  text-align: left;
  padding: .5rem .75rem;
  border-bottom: 2px solid var(--gray-200);
  font-weight: 600;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: var(--gray-600);
  white-space: nowrap;
}
.errors-table td, .customer-table td {
  padding: .45rem .75rem;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
.errors-table tr:last-child td,
.customer-table tr:last-child td { border-bottom: none; }
.errors-table tr:hover td,
.customer-table tbody tr:hover td { background: var(--gray-50); }
.table-more { font-style: italic; color: var(--gray-400); padding: .6rem .75rem; }
.col-actions { width: 90px; text-align: right; white-space: nowrap; }

/* ── Customers tab ───────────────────────────────────────── */
.customer-search-row {
  padding: .7rem 1.25rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--white);
}
.search-wrap {
  position: relative;
  flex: 1;
  max-width: 380px;
}
.search-icon {
  position: absolute;
  left: .7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: .85rem;
  pointer-events: none;
}
.search-input {
  width: 100%;
  border: 1.5px solid var(--gray-200);
  border-radius: 99px;
  padding: .4rem .75rem .4rem 2.1rem;
  font-size: .84rem;
  font-family: inherit;
  background: var(--gray-50);
  transition: border-color var(--transition);
}
.search-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  background: var(--white);
}
.list-count {
  font-size: .78rem;
  color: var(--gray-400);
  white-space: nowrap;
}

.cust-name-cell { min-width: 200px; }
.cust-name      { font-weight: 600; color: var(--gray-800); }
.cust-aliases {
  display: inline-block;
  font-size: .7rem;
  color: var(--accent-blue);
  background: var(--light-blue);
  border-radius: 99px;
  padding: 1px 8px;
  margin-left: .4rem;
  cursor: default;
  vertical-align: middle;
}
.cust-addr {
  font-size: .78rem;
  color: var(--gray-600);
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  animation: modalIn .2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(.95); }
  to   { opacity: 1; transform: scale(1);  }
}
.modal-header {
  padding: 1rem 1.25rem .75rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 1rem; font-weight: 700; color: var(--brand-blue); }
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--gray-400); font-size: 1rem; padding: .2rem .4rem;
  border-radius: 4px; transition: var(--transition);
}
.modal-close:hover { background: var(--gray-100); color: var(--gray-700); }
.modal-body  { padding: 1.1rem 1.25rem; display: flex; flex-direction: column; gap: .85rem; }
.modal-footer {
  padding: .9rem 1.25rem;
  border-top: 1px solid var(--gray-200);
  display: flex;
  gap: .6rem;
  justify-content: flex-end;
  background: var(--gray-50);
  border-radius: 0 0 var(--radius) var(--radius);
}

/* ── History tab ─────────────────────────────────────────── */
.history-item {
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  padding: .85rem 1rem;
  margin-bottom: .65rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  transition: border-color var(--transition);
}
.history-item:last-child { margin-bottom: 0; }
.history-item:hover { border-color: var(--gray-300); }
.history-meta { flex: 1; }
.history-title  { font-size: .9rem; font-weight: 700; color: var(--brand-blue); margin-bottom: .25rem; }
.history-detail { font-size: .78rem; color: var(--gray-600); line-height: 1.5; }
.history-time   { font-size: .72rem; color: var(--gray-400); white-space: nowrap; padding-top: 2px; }

.empty-msg { font-size: .86rem; color: var(--gray-400); text-align: center; padding: 2rem 0; }

/* ── Toast ───────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  top: 70px;
  right: 1.25rem;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  pointer-events: none;
}
.toast {
  background: var(--gray-800);
  color: var(--white);
  padding: .6rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: .5rem;
  animation: slideIn .22s ease;
  max-width: 360px;
  pointer-events: auto;
}
.toast.success { background: var(--success); }
.toast.warning { background: var(--warning); }
.toast.error   { background: var(--danger); }
@keyframes slideIn {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── Upload grid variants ────────────────────────────────── */
.uploads-grid-1col {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

/* ── Pricing tab ─────────────────────────────────────────── */

/* Info bar at top of pricing card */
.pricing-info-bar {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .75rem 1.25rem;
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  font-size: .82rem;
  color: #92400e;
  line-height: 1.5;
}
.pricing-info-bar i {
  font-size: 1rem;
  color: var(--warning);
  flex-shrink: 0;
  margin-top: 2px;
}

/* Type filter pill tabs */
.price-type-tabs {
  display: flex;
  gap: .35rem;
  padding: .65rem 1.25rem;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
}
.price-tab-btn {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  color: var(--gray-600);
  padding: .28rem .75rem;
  border-radius: 99px;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}
.price-tab-btn:hover  { border-color: var(--accent-blue); color: var(--accent-blue); }
.price-tab-btn.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: var(--white);
}

/* Price table */
.price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
}
.price-table th {
  background: var(--gray-100);
  text-align: left;
  padding: .5rem .75rem;
  border-bottom: 2px solid var(--gray-200);
  font-weight: 600;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: var(--gray-600);
  white-space: nowrap;
}
.price-table td {
  padding: .45rem .75rem;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
.price-table tr:last-child td { border-bottom: none; }
.price-table tbody tr:hover td { background: var(--gray-50); }

.col-price {
  text-align: right;
  white-space: nowrap;
  width: 110px;
}

/* Type badge */
.price-type-badge {
  display: inline-flex;
  align-items: center;
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: .3px;
  white-space: nowrap;
}
.price-type-code   { background: #dbeafe; color: #1e40af; }
.price-type-family { background: #dcfce7; color: #166534; }

/* Code monospace chip */
.price-code {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: .78rem;
  color: var(--gray-800);
  font-family: 'Courier New', monospace;
  white-space: nowrap;
}

/* Family tag */
.price-family-tag {
  font-size: .75rem;
  color: var(--gray-600);
  background: var(--gray-100);
  border-radius: 99px;
  padding: 2px 8px;
  white-space: nowrap;
}

/* Price label cell */
.price-label-cell { font-weight: 500; }

/* Notes cell */
.price-notes-cell {
  font-size: .75rem;
  color: var(--gray-400);
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Keyless surcharge note — shown on every ProPlus + Keyless row */
.price-surcharge-note {
  display: block;
  font-size: .68rem;
  color: #7c3aed;
  font-weight: 500;
  margin-top: 2px;
  cursor: default;
}

/* Subtle tint on every ProPlus + Keyless price row */
.price-row-keyless {
  background: #faf5ff;
}
.price-row-keyless:hover {
  background: #f3e8ff;
}

/* ── Mapping guide (pricing tab) ─────────────────────────── */
.mapping-guide {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.mapping-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 0;
  border-bottom: 1px solid var(--gray-100);
}
.mapping-step:last-child { border-bottom: none; }

.mapping-step-num {
  width: 28px; height: 28px; min-width: 28px;
  background: var(--brand-blue);
  color: var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .82rem; font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}
.mapping-step-body { flex: 1; }
.mapping-step-body strong {
  display: block;
  font-size: .88rem;
  color: var(--gray-800);
  margin-bottom: .3rem;
}
.mapping-step-body p {
  font-size: .82rem;
  color: var(--gray-600);
  line-height: 1.55;
  margin-bottom: .5rem;
}
.mapping-example {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: .4rem .75rem;
  font-size: .8rem;
  color: var(--gray-700);
  display: inline-block;
}
.mapping-example code {
  background: var(--gray-200);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: .78rem;
}

/* Keyless multi-row example block */
.mapping-example-keyless {
  display: block;
  width: 100%;
}
.keyless-example-row {
  display: block;
  padding: .25rem 0;
  border-bottom: 1px dashed var(--gray-200);
}
.keyless-example-row:last-child { border-bottom: none; }
.keyless-total {
  color: #7c3aed;
}
.keyless-fallback-row {
  color: var(--gray-500, #6b7280);
  font-style: italic;
}

/* Keyless step highlight */
.mapping-step-keyless {
  background: #faf5ff;
  border-radius: var(--radius-sm);
  padding: 1rem .75rem;
  margin: 0 -.75rem;
}

/* ── Price modal number input ────────────────────────────── */
#price-modal-price {
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: .45rem .7rem;
  font-size: .88rem;
  font-family: inherit;
  color: var(--gray-800);
  background: var(--white);
  transition: border-color var(--transition);
  width: 100%;
}
#price-modal-price:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

/* ── Utility ─────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 680px) {
  .config-row    { flex-direction: column; }
  .header-brand span { font-size: .9rem; }
  .nav-btn { padding: .32rem .55rem; font-size: .75rem; }
  .nav-badge { display: none !important; }
  .uploads-grid-1col,
  .uploads-grid-2col { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .cust-addr, .price-notes-cell { display: none; }
  .card-header-actions { width: 100%; }
  .price-type-tabs { flex-wrap: wrap; }
}
