/*
   Bannack Medical Quote System — Self-contained stylesheet v1.0.2
   Prefixed with .bqs- to avoid conflicts with WordPress themes
   ============================================================ */

/* ── Reset & base ─────────────────────────────────────────── */
.bqs-wrap *, .bqs-app * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
.bqs-wrap, .bqs-app {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  color: #1a2332;
  line-height: 1.5;
}

/* ── CSS Variables ────────────────────────────────────────── */
.bqs-wrap, .bqs-app {
  --bqs-primary:      #0f4c81;
  --bqs-primary-dark: #0a3660;
  --bqs-primary-light:#e8f4fd;
  --bqs-accent:       #4fc3f7;
  --bqs-success:      #22c55e;
  --bqs-warning:      #f59e0b;
  --bqs-danger:       #ef4444;
  --bqs-gray-50:      #f8fafc;
  --bqs-gray-100:     #f1f5f9;
  --bqs-gray-200:     #e2e8f0;
  --bqs-gray-300:     #cbd5e1;
  --bqs-gray-400:     #94a3b8;
  --bqs-gray-500:     #64748b;
  --bqs-gray-600:     #475569;
  --bqs-gray-700:     #334155;
  --bqs-gray-800:     #1e293b;
  --bqs-sidebar-w:    240px;
  --bqs-radius:       8px;
  --bqs-shadow:       0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --bqs-shadow-md:    0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -1px rgba(0,0,0,.06);
}

/* ── Login page ───────────────────────────────────────────── */
.bqs-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f4c81 0%, #1565c0 50%, #0288d1 100%);
  padding: 24px;
}
.bqs-login-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.bqs-login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}
.bqs-login-logo img {
  max-height: 72px;
  width: auto;
}
.bqs-login-brand {
  font-size: 20px;
  font-weight: 700;
  color: var(--bqs-primary);
  line-height: 1.2;
}
.bqs-login-subtitle {
  font-size: 12px;
  color: var(--bqs-gray-500);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.bqs-login-form { display: flex; flex-direction: column; gap: 16px; }
.bqs-login-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--bqs-gray-400);
}

/* ── App shell ────────────────────────────────────────────── */
.bqs-app {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: var(--bqs-gray-50);
}

/* ── Sidebar ──────────────────────────────────────────────── */
.bqs-sidebar {
  width: var(--bqs-sidebar-w);
  background: var(--bqs-gray-800);
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}
.bqs-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.bqs-sidebar-logo {
  height: 36px;
  width: auto;
  object-fit: contain;
}
.bqs-sidebar-name {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.bqs-sidebar-sub {
  display: block;
  font-size: 11px;
  color: var(--bqs-gray-400);
}
.bqs-sidebar-section-label {
  padding: 14px 16px 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--bqs-gray-500);
  font-weight: 600;
}
.bqs-sidebar-nav {
  padding: 6px 8px;
  flex: 1;
}
.bqs-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 6px;
  color: var(--bqs-gray-300);
  text-decoration: none;
  font-size: 13.5px;
  transition: background .15s, color .15s;
  margin-bottom: 2px;
}
.bqs-nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.bqs-nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.bqs-nav-item--active { background: var(--bqs-primary) !important; color: #fff !important; }
.bqs-nav-item--new-quote {
  background: rgba(79,195,247,0.12);
  color: #4fc3f7 !important;
  border: 1px solid rgba(79,195,247,0.25);
  margin-top: 4px;
  font-weight: 600;
}
.bqs-nav-item--new-quote:hover { background: rgba(79,195,247,0.22) !important; }
.bqs-sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.bqs-user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.bqs-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bqs-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.bqs-user-info { overflow: hidden; }
.bqs-user-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bqs-user-role {
  display: block;
  font-size: 11px;
  color: var(--bqs-gray-400);
}
.bqs-sidebar-actions { display: flex; gap: 6px; }
.bqs-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: var(--bqs-gray-400);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.bqs-icon-btn svg { width: 16px; height: 16px; }
.bqs-icon-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.bqs-icon-btn--danger:hover { background: rgba(239,68,68,.2); color: #fca5a5; }

/* ── Main content ─────────────────────────────────────────── */
.bqs-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
}

/* ── Topbar ───────────────────────────────────────────────── */
.bqs-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  height: 56px;
  background: #fff;
  border-bottom: 1px solid var(--bqs-gray-200);
  flex-shrink: 0;
  z-index: 50;
}
.bqs-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--bqs-gray-600);
  padding: 4px;
}
.bqs-menu-toggle svg { width: 20px; height: 20px; }
.bqs-page-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--bqs-gray-800);
  flex: 1;
}
.bqs-topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ── Content area (the main scroll container) ─────────────── */
.bqs-content {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ── Cards ────────────────────────────────────────────────── */
.bqs-card {
  background: #fff;
  border-radius: var(--bqs-radius);
  border: 1px solid var(--bqs-gray-200);
  box-shadow: var(--bqs-shadow);
  overflow: hidden;
}
.bqs-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--bqs-gray-100);
}
.bqs-card-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--bqs-gray-700);
}

/* ── Stats grid ───────────────────────────────────────────── */
.bqs-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.bqs-stat-card {
  background: #fff;
  border-radius: var(--bqs-radius);
  border: 1px solid var(--bqs-gray-200);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--bqs-shadow);
}
.bqs-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.bqs-stat-icon svg { width: 20px; height: 20px; }
.bqs-stat-icon--blue   { background: #dbeafe; color: #2563eb; }
.bqs-stat-icon--teal   { background: #ccfbf1; color: #0d9488; }
.bqs-stat-icon--green  { background: #dcfce7; color: #16a34a; }
.bqs-stat-icon--yellow { background: #fef9c3; color: #ca8a04; }
.bqs-stat-label { font-size: 12px; color: var(--bqs-gray-500); margin-bottom: 2px; }
.bqs-stat-value { font-size: 24px; font-weight: 700; color: var(--bqs-gray-800); }

/* ── Tables ───────────────────────────────────────────────── */
.bqs-table-wrap { overflow-x: auto; }
.bqs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.bqs-table th {
  background: var(--bqs-gray-50);
  padding: 10px 14px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--bqs-gray-500);
  border-bottom: 1px solid var(--bqs-gray-200);
  white-space: nowrap;
}
.bqs-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--bqs-gray-100);
  color: var(--bqs-gray-700);
  vertical-align: middle;
}
.bqs-table tr:last-child td { border-bottom: none; }
.bqs-table tr:hover td { background: var(--bqs-gray-50); }
.bqs-table--compact th,
.bqs-table--compact td { padding: 7px 10px; font-size: 12.5px; }
.bqs-empty { text-align: center; color: var(--bqs-gray-400); padding: 32px !important; }
.bqs-sortable { cursor: pointer; user-select: none; }
.bqs-sortable:hover { color: var(--bqs-primary); }
.bqs-sort-icon { opacity: .4; }

/* ── Quote items table ────────────────────────────────────── */
.bqs-items-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
}
.bqs-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 1200px;
}
.bqs-items-table th {
  background: var(--bqs-gray-800);
  color: #fff;
  padding: 9px 8px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}
.bqs-items-table td {
  padding: 4px 4px;
  border-bottom: 1px solid var(--bqs-gray-100);
  vertical-align: middle;
}
.bqs-items-table tr.bqs-row-even td { background: #f0f9ff; }
.bqs-items-table tr.bqs-row-odd td  { background: #fff; }
.bqs-items-table tr:hover td { filter: brightness(.97); }
.bqs-items-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--bqs-gray-200);
  background: var(--bqs-gray-50);
}
.bqs-grand-total {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  color: var(--bqs-gray-600);
}
.bqs-grand-total strong {
  font-size: 18px;
  color: var(--bqs-primary);
}
.bqs-grand-total-card {
  background: var(--bqs-primary);
  color: #fff;
  border-radius: var(--bqs-radius);
  padding: 16px 24px;
  margin-top: 16px;
}
.bqs-grand-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 18px;
}
.bqs-grand-total-row strong { font-size: 26px; }

/* ── Form elements ────────────────────────────────────────── */
.bqs-field { display: flex; flex-direction: column; gap: 5px; }
.bqs-field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--bqs-gray-600);
}
.bqs-req { color: var(--bqs-danger); }
.bqs-field input,
.bqs-field select,
.bqs-field textarea,
.bqs-select,
.bqs-input {
  padding: 8px 10px;
  border: 1.5px solid var(--bqs-gray-300);
  border-radius: 6px;
  font-size: 13.5px;
  color: var(--bqs-gray-800);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
  font-family: inherit;
}
.bqs-field input:focus,
.bqs-field select:focus,
.bqs-field textarea:focus,
.bqs-select:focus,
.bqs-input:focus {
  outline: none;
  border-color: var(--bqs-primary);
  box-shadow: 0 0 0 3px rgba(15,76,129,.12);
}
.bqs-field input:disabled,
.bqs-field select:disabled { background: var(--bqs-gray-100); cursor: not-allowed; }
.bqs-input-wrap { position: relative; }
.bqs-toggle-pw {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--bqs-gray-400);
  padding: 0;
  display: flex;
}
.bqs-eye-icon { width: 16px; height: 16px; }

/* Inline table inputs */
.bqs-items-table input,
.bqs-items-table select {
  padding: 5px 6px;
  border: 1.5px solid transparent;
  border-radius: 4px;
  font-size: 12.5px;
  color: var(--bqs-gray-800);
  background: transparent;
  width: 100%;
  font-family: inherit;
  transition: border-color .15s;
}
.bqs-items-table input:focus,
.bqs-items-table select:focus {
  outline: none;
  border-color: var(--bqs-primary);
  background: #fff;
  box-shadow: 0 0 0 2px rgba(15,76,129,.1);
}
.bqs-items-table select { cursor: pointer; }

/* ── Form grid ────────────────────────────────────────────── */
.bqs-form-grid { display: grid; gap: 14px; }
.bqs-form-grid--2 { grid-template-columns: repeat(2, 1fr); }
.bqs-form-grid--3 { grid-template-columns: repeat(3, 1fr); }
.bqs-field--full { grid-column: 1 / -1; }
.bqs-form-grid--inline { display: flex; gap: 10px; }

/* ── Chip multi-select ────────────────────────────────────── */
.bqs-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  border: 1.5px solid var(--bqs-gray-300);
  border-radius: 6px;
  min-height: 38px;
  background: #fff;
}
.bqs-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1.5px solid var(--bqs-gray-300);
  background: var(--bqs-gray-100);
  color: var(--bqs-gray-600);
  transition: all .15s;
  user-select: none;
}
.bqs-chip:hover { border-color: var(--bqs-primary); color: var(--bqs-primary); }
.bqs-chip--selected {
  background: var(--bqs-primary);
  border-color: var(--bqs-primary);
  color: #fff;
}

/* ── Buttons ──────────────────────────────────────────────── */
.bqs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  text-decoration: none;
  transition: all .15s;
  font-family: inherit;
  white-space: nowrap;
}
.bqs-btn--primary {
  background: var(--bqs-primary);
  color: #fff;
  border-color: var(--bqs-primary);
}
.bqs-btn--primary:hover { background: var(--bqs-primary-dark); border-color: var(--bqs-primary-dark); }
.bqs-btn--outline {
  background: transparent;
  color: var(--bqs-primary);
  border-color: var(--bqs-primary);
}
.bqs-btn--outline:hover { background: var(--bqs-primary-light); }
.bqs-btn--ghost {
  background: transparent;
  color: var(--bqs-gray-600);
  border-color: var(--bqs-gray-300);
}
.bqs-btn--ghost:hover { background: var(--bqs-gray-100); color: var(--bqs-gray-800); }
.bqs-btn--danger {
  background: var(--bqs-danger);
  color: #fff;
  border-color: var(--bqs-danger);
}
.bqs-btn--danger:hover { background: #dc2626; }
.bqs-btn--sm { padding: 5px 12px; font-size: 12.5px; }
.bqs-btn--full { width: 100%; }
.bqs-btn--icon {
  padding: 5px;
  background: transparent;
  border-color: transparent;
  color: var(--bqs-gray-500);
}
.bqs-btn--icon:hover { background: var(--bqs-gray-100); color: var(--bqs-gray-800); }
.bqs-btn--icon svg { width: 15px; height: 15px; }
.bqs-btn--icon-danger:hover { background: #fee2e2; color: var(--bqs-danger); }

/* ── Badges ───────────────────────────────────────────────── */
.bqs-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.bqs-badge--yellow { background: #fef9c3; color: #854d0e; }
.bqs-badge--blue   { background: #dbeafe; color: #1d4ed8; }
.bqs-badge--green  { background: #dcfce7; color: #166534; }
.bqs-badge--red    { background: #fee2e2; color: #991b1b; }
.bqs-badge--gray   { background: var(--bqs-gray-100); color: var(--bqs-gray-600); }

/* ── Alerts ───────────────────────────────────────────────── */
.bqs-alert {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13.5px;
  border: 1px solid;
}
.bqs-alert--error   { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.bqs-alert--success { background: #dcfce7; color: #166534; border-color: #86efac; }
.bqs-alert--info    { background: #dbeafe; color: #1d4ed8; border-color: #93c5fd; }

/* ── Modal ────────────────────────────────────────────────── */
.bqs-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.bqs-modal {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  overflow: hidden;
}
.bqs-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--bqs-gray-200);
}
.bqs-modal-header h3 { font-size: 15px; font-weight: 600; color: var(--bqs-gray-800); }
.bqs-modal-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--bqs-gray-400);
  line-height: 1;
  padding: 0 4px;
}
.bqs-modal-close:hover { color: var(--bqs-gray-700); }
.bqs-modal-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.bqs-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--bqs-gray-200);
  background: var(--bqs-gray-50);
}

/* ── Section label (collapsible) ──────────────────────────── */
.bqs-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--bqs-primary);
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--bqs-gray-100);
  cursor: pointer;
  user-select: none;
  transition: background .15s;
}
.bqs-section-label:hover { background: var(--bqs-gray-50); }
.bqs-section-label svg { width: 15px; height: 15px; }
.bqs-collapse-icon {
  margin-left: auto;
  width: 16px;
  height: 16px;
  color: var(--bqs-gray-400);
  transition: transform .2s;
  flex-shrink: 0;
}
.bqs-section-label.bqs-collapsed .bqs-collapse-icon {
  transform: rotate(-90deg);
}
.bqs-section-summary {
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-weight: 400 !important;
  font-size: 13px !important;
  color: #475569 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 500px;
}
.bqs-collapsible-body {
  transition: max-height .3s ease, opacity .25s ease;
  overflow: hidden;
  max-height: 2000px;
  opacity: 1;
}
.bqs-collapsible-body.bqs-collapsed {
  max-height: 0;
  opacity: 0;
}

/* ── Builder ──────────────────────────────────────────────── */
.bqs-builder-section .bqs-form-grid { padding: 0 18px 16px; }

/* ── Quote view ───────────────────────────────────────────── */
.bqs-view-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.bqs-view-card { padding: 0; }
.bqs-info-table { width: 100%; border-collapse: collapse; padding: 0 18px 16px; }
.bqs-info-table th {
  width: 110px;
  padding: 7px 18px;
  font-size: 12px;
  font-weight: 600;
  color: var(--bqs-gray-500);
  text-align: left;
  vertical-align: top;
}
.bqs-info-table td { padding: 7px 18px 7px 0; font-size: 13.5px; color: var(--bqs-gray-700); }
.bqs-quote-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--bqs-gray-200);
}

/* ── Action buttons in tables ─────────────────────────────── */
.bqs-table-actions { display: flex; gap: 4px; align-items: center; }

/* ── Toggle switch ────────────────────────────────────────── */
.bqs-toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}
.bqs-toggle input { opacity: 0; width: 0; height: 0; }
.bqs-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bqs-gray-300);
  border-radius: 20px;
  transition: background .2s;
}
.bqs-toggle-slider:before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
}
.bqs-toggle input:checked + .bqs-toggle-slider { background: var(--bqs-success); }
.bqs-toggle input:checked + .bqs-toggle-slider:before { transform: translateX(16px); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .bqs-sidebar {
    position: fixed;
    left: -100%;
    transition: left .25s;
  }
  .bqs-sidebar--open { left: 0; }
  .bqs-menu-toggle { display: flex; }
  .bqs-form-grid--2,
  .bqs-form-grid--3 { grid-template-columns: 1fr; }
  .bqs-content { padding: 16px; }
  .bqs-stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .bqs-stats-grid { grid-template-columns: 1fr; }
  .bqs-login-card { padding: 28px 20px; }
}

/* ═══════════════════════════════════════════════════════════
   BANNACK MEDICAL PDF QUOTE PAGES
   Each quote number renders as a separate .bqs-pdf-page div.
   On screen: shown as preview cards.
   On print: each page breaks cleanly.
   ═══════════════════════════════════════════════════════════ */

/* Screen-only elements hidden on print */
.bqs-no-print { }
/* Print-only elements hidden on screen */
.bqs-print-only { display: none; }

/* PDF page container */
.bqs-pdf-page {
  background: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10pt;
  color: #000;
  padding: 20px 24px;
  margin-bottom: 24px;
  border: 1px solid var(--bqs-gray-200);
  border-radius: 4px;
  box-shadow: var(--bqs-shadow);
}

/* PDF Header */
.bqs-pdf-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 2px solid #000;
  padding-bottom: 8px;
  margin-bottom: 10px;
}
.bqs-pdf-logo img {
  height: 52px;
  width: auto;
}
.bqs-pdf-title {
  font-size: 16pt;
  font-weight: 700;
  text-align: center;
  letter-spacing: 1px;
  align-self: center;
}
.bqs-pdf-quote-id {
  font-size: 12pt;
  font-weight: 700;
  text-decoration: underline;
  text-align: right;
  white-space: nowrap;
  align-self: flex-start;
}

/* Info grid (two columns: client info + GPO/IDN info) */
.bqs-pdf-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
  margin-bottom: 10px;
}
.bqs-pdf-info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9pt;
}
.bqs-pdf-info-table td {
  padding: 2px 6px;
  border: 1px solid #bbb;
  vertical-align: top;
}
.bqs-pdf-info-table td.bqs-pdf-lbl {
  background: #1565c0;
  color: #fff;
  font-weight: 700;
  width: 100px;
  white-space: nowrap;
}

/* Items table */
.bqs-pdf-items {
  width: 100%;
  border-collapse: collapse;
  font-size: 9pt;
  margin-bottom: 4px;
}
.bqs-pdf-items th {
  background: #1a1a1a;
  color: #fff;
  padding: 5px 8px;
  text-align: left;
  font-weight: 700;
  border: 1px solid #333;
}
.bqs-pdf-items td {
  padding: 4px 8px;
  border: 1px solid #ccc;
  vertical-align: middle;
}
.bqs-pdf-items .bqs-pdf-total-row td {
  background: #f0f0f0;
  font-weight: 700;
}
.bqs-pdf-items .bqs-pdf-total-row td:last-child {
  text-align: right;
}

/* Footer */
.bqs-pdf-footer {
  border-top: 1px solid #ccc;
  margin-top: 12px;
  padding-top: 8px;
  font-size: 8.5pt;
}
.bqs-pdf-footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 24px;
  margin-bottom: 8px;
}
.bqs-pdf-footer-lbl { font-weight: 700; }
.bqs-pdf-sig-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
  border-top: 1px solid #ccc;
  padding-top: 8px;
}
.bqs-pdf-sig-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 8pt;
}
.bqs-pdf-sig-line {
  border-bottom: 1px solid #000;
  height: 22px;
  margin-bottom: 2px;
}
.bqs-pdf-disclaimer {
  font-size: 7.5pt;
  color: #444;
  margin-top: 8px;
  border-top: 1px solid #ccc;
  padding-top: 6px;
  line-height: 1.4;
}

/* Download all button area */
.bqs-pdf-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  align-items: center;
}

/* ── Quote View Tabs ─────────────────────────────────────── */
.bqs-quote-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  background: var(--bqs-gray-100);
  border: 1px solid var(--bqs-gray-200);
  border-top: none;
  border-bottom: none;
  padding: 8px 12px 0;
}
.bqs-quote-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--bqs-gray-300);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  background: var(--bqs-gray-50);
  cursor: pointer;
  font-size: 12.5px;
  color: var(--bqs-gray-600);
  transition: background .15s, color .15s;
  font-family: inherit;
  white-space: nowrap;
}
.bqs-quote-tab:hover {
  background: #fff;
  color: var(--bqs-primary);
}
.bqs-quote-tab.active {
  background: #fff;
  color: var(--bqs-primary);
  border-color: var(--bqs-primary);
  border-bottom: 2px solid #fff;
  font-weight: 600;
  margin-bottom: -1px;
  position: relative;
  z-index: 1;
}
.bqs-tab-label {
  font-weight: 600;
  font-size: 12.5px;
}
.bqs-tab-total {
  font-size: 11.5px;
  color: var(--bqs-gray-500);
  font-weight: 400;
}
.bqs-quote-tab.active .bqs-tab-total {
  color: var(--bqs-primary);
  opacity: .8;
}

/* ── Print media ──────────────────────────────────────────── */
@media print {
  /* Hide all app chrome */
  .bqs-sidebar,
  .bqs-topbar,
  .bqs-topbar-actions,
  .bqs-btn,
  .bqs-menu-toggle,
  .bqs-grand-total-card,
  .bqs-no-print,
  .bqs-pdf-actions { display: none !important; }

  /* Reset layout for print */
  html, body {
    overflow: visible !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .bqs-app {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
  }
  .bqs-main {
    height: auto !important;
    overflow: visible !important;
  }
  .bqs-content {
    padding: 0 !important;
    overflow: visible !important;
  }

  /* Show print-only elements */
  .bqs-print-only { display: block !important; }

  /* Each PDF page on its own printed page */
  .bqs-pdf-page {
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 14px 18px !important;
    page-break-after: always;
    page-break-inside: avoid;
  }
  .bqs-pdf-page:last-child { page-break-after: auto; }

  /* Hide non-active pages when printing current tab only */
  .bqs-print-hide { display: none !important; }
}
