/* DC Compliance - Main Stylesheet */

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

:root {
  --primary:      #1a56db;
  --primary-dark: #1e40af;
  --primary-light:#eff6ff;
  --success:      #057a55;
  --success-bg:   #f0fdf4;
  --warning:      #b45309;
  --warning-bg:   #fffbeb;
  --danger:       #dc2626;
  --danger-bg:    #fef2f2;
  --gray-50:      #f9fafb;
  --gray-100:     #f3f4f6;
  --gray-200:     #e5e7eb;
  --gray-300:     #d1d5db;
  --gray-400:     #9ca3af;
  --gray-500:     #6b7280;
  --gray-600:     #4b5563;
  --gray-700:     #374151;
  --gray-800:     #1f2937;
  --gray-900:     #111827;
  --white:        #ffffff;
  --sidebar-w:    240px;
  --topbar-h:     64px;
  --radius:       8px;
  --shadow:       0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md:    0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --transition:   0.15s ease;
}

html { font-size: 15px; overflow-x: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── Layout ─── */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 200;
  overflow-y: auto;
  transition: transform 0.25s ease;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--gray-200);
}
.sidebar-logo a {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}
.logo-icon {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}
.logo-text { font-weight: 700; font-size: 15px; color: var(--gray-900); line-height: 1.2; }
.logo-text span { display: block; font-size: 11px; font-weight: 400; color: var(--gray-500); }

.sidebar-nav { padding: 12px 0; flex: 1; }
.nav-section { padding: 8px 12px 4px; font-size: 11px; font-weight: 600; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.06em; }
.nav-item a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  margin: 1px 8px;
  text-decoration: none;
  color: var(--gray-600);
  font-size: 14px;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}
.nav-item a:hover { background: var(--gray-100); color: var(--gray-900); }
.nav-item a.active { background: var(--primary-light); color: var(--primary); }
.nav-item a svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 600;
  border-radius: 10px;
  padding: 1px 7px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--gray-200);
}
.user-menu {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  color: var(--gray-700);
}
.user-menu:hover { background: var(--gray-100); }
.user-avatar {
  width: 32px; height: 32px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-info strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info span { font-size: 11px; color: var(--gray-500); }

/* ─── Main Content ─── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  min-width: 0;          /* allow flex child to shrink below content size */
  max-width: 100%;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  min-width: 0;
}
.topbar-title { font-size: 17px; font-weight: 600; color: var(--gray-900); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  background: var(--white);
  cursor: pointer;
  color: var(--gray-500);
  text-decoration: none;
  transition: all var(--transition);
}
.icon-btn:hover { background: var(--gray-100); color: var(--gray-700); }
.icon-btn svg { width: 18px; height: 18px; }

.page-content { padding: 28px; flex: 1; width: 100%; min-width: 0; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 14px; font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1.4;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-secondary { background: var(--white); color: var(--gray-700); border-color: var(--gray-300); }
.btn-secondary:hover { background: var(--gray-50); }
.btn-success { background: var(--success); color: white; border-color: var(--success); }
.btn-success:hover { background: #046741; }
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-icon { padding: 8px; }
.btn-ai {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white; border-color: transparent; font-size: 13px; padding: 6px 14px;
}
.btn-ai:hover { background: linear-gradient(135deg, #4f46e5, #7c3aed); color: white; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ─── Cards ─── */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
}
.card-header h3 { font-size: 15px; font-weight: 600; }
.card-body { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--gray-200); background: var(--gray-50); border-radius: 0 0 var(--radius) var(--radius); }

/* ─── Stats Cards ─── */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.stat-label { font-size: 13px; color: var(--gray-500); font-weight: 500; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--gray-900); margin: 4px 0; }
.stat-sub { font-size: 12px; color: var(--gray-400); }
.stat-card.primary { border-left: 3px solid var(--primary); }
.stat-card.success { border-left: 3px solid var(--success); }
.stat-card.warning { border-left: 3px solid #f59e0b; }
.stat-card.danger  { border-left: 3px solid var(--danger); }

/* ─── Tables ─── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 14px;
  color: var(--gray-700);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-50); }
.table-link { color: var(--gray-900); text-decoration: none; font-weight: 500; }
.table-link:hover { color: var(--primary); }

/* ─── Badges ─── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px; font-weight: 600;
}
.badge-blue   { background: #eff6ff; color: #1d4ed8; }
.badge-green  { background: #f0fdf4; color: #15803d; }
.badge-red    { background: #fef2f2; color: #b91c1c; }
.badge-gray   { background: var(--gray-100); color: var(--gray-600); }
.badge-yellow { background: #fffbeb; color: #92400e; }

/* Hamburger hidden on desktop; the 900px media query shows it. */
#menuToggle { display: none; }

/* ─── Forms ─── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.form-label .req { color: var(--danger); margin-left: 2px; }
.form-control {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--gray-900);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: inherit;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}
.form-control::placeholder { color: var(--gray-400); }
.form-control:disabled { background: var(--gray-100); color: var(--gray-500); }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.form-hint { font-size: 12px; color: var(--gray-500); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* Checkbox & Radio */
.check-group { display: flex; align-items: flex-start; gap: 10px; }
.check-group input[type="checkbox"],
.check-group input[type="radio"] { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--primary); flex-shrink: 0; cursor: pointer; }
.check-label { font-size: 14px; color: var(--gray-700); cursor: pointer; }
.check-label strong { display: block; font-weight: 500; }
.check-label small { color: var(--gray-500); }

/* Radio Cards */
.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.radio-card {
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.radio-card:hover { border-color: var(--primary); }
.radio-card.selected { border-color: var(--primary); background: var(--primary-light); }
.radio-card .check-icon {
  position: absolute; top: 12px; right: 12px;
  width: 20px; height: 20px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white;
  opacity: 0;
}
.radio-card.selected .check-icon { opacity: 1; }
.radio-card h4 { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.radio-card p { font-size: 13px; color: var(--gray-500); line-height: 1.4; }
.radio-card input { display: none; }

/* Toggle Switch */
.toggle-wrap { display: flex; align-items: center; gap: 12px; }
.toggle { position: relative; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--gray-300);
  border-radius: 24px;
  cursor: pointer;
  transition: background var(--transition);
}
.toggle-slider:before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition);
}
.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider:before { transform: translateX(20px); }
.toggle-label { font-size: 14px; font-weight: 500; color: var(--gray-700); }

/* Multi-select tags */
.tag-input-wrap {
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  padding: 6px 10px;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  min-height: 44px;
  background: var(--white);
  cursor: text;
}
.tag-input-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,219,0.1); }
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 13px;
}
.tag-remove { cursor: pointer; color: var(--gray-400); font-size: 15px; line-height: 1; }
.tag-remove:hover { color: var(--danger); }
.tag-input {
  border: none; outline: none; font-size: 14px;
  flex: 1; min-width: 120px; background: transparent; font-family: inherit;
}

/* Dropdown for tag-input */
.dropdown-list {
  position: absolute; z-index: 200;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  max-height: 200px; overflow-y: auto;
  width: 100%;
}
.dropdown-item {
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  color: var(--gray-700);
}
.dropdown-item:hover { background: var(--gray-50); color: var(--primary); }
.dropdown-item.selected { color: var(--primary); font-weight: 500; }
/* Reusable class for action items in ⋮ menus (links + buttons) */
.dropdown-action {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 14px;
  font-size: 14px; color: var(--gray-700);
  background: none; border: none; cursor: pointer;
  text-decoration: none; transition: background 0.1s;
}
.dropdown-action:hover { background: var(--gray-50); }
.dropdown-action.danger { color: var(--danger); }
.dropdown-action.danger:hover { background: #fef2f2; }
.dropdown-wrap { position: relative; }
.dropdown-menu {
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius); box-shadow: var(--shadow-md); overflow: hidden;
}

/* ─── Alerts ─── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 10px;
}
.alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--success-bg); color: #065f46; border: 1px solid #a7f3d0; }
.alert-error   { background: var(--danger-bg);  color: #991b1b; border: 1px solid #fca5a5; }
.alert-warning { background: var(--warning-bg); color: #78350f; border: 1px solid #fcd34d; }
.alert-info    { background: var(--primary-light); color: #1e40af; border: 1px solid #bfdbfe; }

/* ─── Tabs ─── */
.tabs { display: flex; border-bottom: 2px solid var(--gray-200); margin-bottom: 24px; gap: 0; }
.tab-link {
  padding: 10px 20px;
  font-size: 14px; font-weight: 500;
  color: var(--gray-500);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  white-space: nowrap;
}
.tab-link:hover { color: var(--gray-700); }
.tab-link.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-count { background: var(--gray-100); border-radius: 10px; padding: 1px 7px; font-size: 12px; margin-left: 6px; }
.tab-link.active .tab-count { background: var(--primary-light); color: var(--primary); }

/* ─── Search & Filters ─── */
.search-bar { position: relative; }
.search-bar input { padding-left: 38px; }
.search-bar svg {
  position: absolute; left: 11px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--gray-400);
  pointer-events: none;
}
.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-select {
  padding: 7px 30px 7px 10px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--white);
  color: var(--gray-700);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  cursor: pointer;
  font-family: inherit;
}

/* ─── Page Header ─── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.page-header h1 { font-size: 22px; font-weight: 700; color: var(--gray-900); }
.page-header p { font-size: 14px; color: var(--gray-500); margin-top: 2px; }
.page-header-actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }
/* ⋮ more-actions button must never stretch full-width on mobile */
.page-header-actions #moreActionsWrap { flex: 0 0 auto !important; }
.page-header-actions #moreActionsWrap .btn { flex: none !important; }

/* Bid view two-column layout */
.bid-view-grid { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }

/* ─── Empty State ─── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-500);
}
.empty-state svg { width: 48px; height: 48px; color: var(--gray-300); margin: 0 auto 16px; display: block; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--gray-700); margin-bottom: 8px; }
.empty-state p { font-size: 14px; max-width: 380px; margin: 0 auto 20px; }

/* ─── File Upload ─── */
.upload-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  background: var(--gray-50);
  cursor: pointer;
  transition: all var(--transition);
}
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--primary); background: var(--primary-light); }
.upload-zone svg { width: 32px; height: 32px; color: var(--gray-400); margin: 0 auto 12px; display: block; }
.upload-zone p { font-size: 14px; color: var(--gray-600); }
.upload-zone .upload-link { color: var(--primary); font-weight: 500; cursor: pointer; }
.upload-zone small { font-size: 12px; color: var(--gray-400); display: block; margin-top: 6px; }
.uploaded-files { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.uploaded-file {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 13px;
  transition: border-color var(--transition);
}
.uploaded-file:hover { border-color: var(--gray-300); }
.uf-thumb { flex-shrink: 0; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: var(--gray-50); border-radius: 6px; overflow: hidden; }
.uf-info { flex: 1; min-width: 0; }
.uf-name { font-weight: 500; color: var(--gray-800); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.uf-size { font-size: 11px; color: var(--gray-400); margin-top: 2px; }
.uf-remove {
  flex-shrink: 0; background: none; border: none; cursor: pointer;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-400); transition: all var(--transition);
}
.uf-remove svg { width: 13px; height: 13px; }
.uf-remove:hover { background: var(--danger); color: var(--white); }
/* legacy server-rendered uploaded file links */
.uploaded-file > svg { width: 16px; height: 16px; color: var(--primary); flex-shrink: 0; }
.uploaded-file > span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uploaded-file > a { color: var(--danger); font-size: 18px; text-decoration: none; }

/* ─── Pricing Table ─── */
.pricing-table { width: 100%; border-collapse: collapse; }
.pricing-table th {
  background: var(--gray-900);
  color: var(--white);
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}
.pricing-table td { padding: 10px 14px; border-bottom: 1px solid var(--gray-200); vertical-align: middle; }
.pricing-table tr:last-child td { border-bottom: none; }
.pricing-table input, .pricing-table select {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  background: var(--white);
}
.pricing-table input:focus, .pricing-table select:focus { outline: none; border-color: var(--primary); }
.pricing-table .row-delete { color: var(--gray-400); cursor: pointer; background: none; border: none; font-size: 18px; }
.pricing-table .row-delete:hover { color: var(--danger); }
.add-line-btn {
  color: var(--primary); background: none; border: none;
  font-size: 14px; font-weight: 500;
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  padding: 8px 0;
}
.add-line-btn:hover { text-decoration: underline; }

/* Pricing table — mobile card layout */
@media (max-width: 640px) {
  .pricing-table { min-width: 0 !important; border: none; }
  .pricing-table thead { display: none; }
  .pricing-table tbody tr {
    display: block;
    position: relative;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 12px 44px 8px 12px;
    margin-bottom: 10px;
    background: var(--white);
  }
  .pricing-table tbody td {
    display: block;
    padding: 0 0 10px;
    border: none;
  }
  .pricing-table tbody td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
  }
  .pricing-table tbody td.pricing-row-delete-cell {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 0;
    display: block;
  }
  .pricing-table .row-delete { font-size: 22px; }
  .pricing-table tbody td.freq-extra.hidden { display: none; }
  .pricing-table tbody td.freq-extra:not(.hidden) { display: block; }
}

/* ─── File Preview Lightbox ─── */
.uf-preview-hint { color: var(--primary); font-style: normal; }
.uf-previewable .uf-thumb, .uf-previewable .uf-info { cursor: pointer; }
.uf-lightbox {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; transition: opacity 0.2s ease;
}
.uf-lightbox.open { opacity: 1; }
.uf-lightbox-inner {
  background: var(--white);
  border-radius: 12px;
  display: flex; flex-direction: column;
  width: 100%; max-width: 900px;
  max-height: 90vh;
  overflow: hidden;
  transform: scale(0.96); transition: transform 0.2s ease;
  box-shadow: 0 25px 60px rgba(0,0,0,0.4);
}
.uf-lightbox.open .uf-lightbox-inner { transform: scale(1); }
.uf-lightbox-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
  flex-shrink: 0;
}
.uf-lightbox-name { font-size: 14px; font-weight: 500; color: var(--gray-800); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uf-lb-btn {
  width: 32px; height: 32px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 1px solid var(--gray-300);
  color: var(--gray-600); cursor: pointer; text-decoration: none;
  transition: all var(--transition); flex-shrink: 0;
}
.uf-lb-btn svg { width: 15px; height: 15px; }
.uf-lb-btn:hover { background: var(--gray-200); color: var(--gray-900); }
.uf-lb-close:hover { background: var(--danger); border-color: var(--danger); color: white; }
.uf-lightbox-body { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; background: var(--gray-100); min-height: 200px; }
.uf-lb-img { max-width: 100%; max-height: calc(90vh - 60px); object-fit: contain; display: block; }
.uf-lb-pdf { width: 100%; height: calc(90vh - 60px); border: none; display: block; }
@media (max-width: 600px) {
  .uf-lightbox { padding: 0; align-items: flex-end; }
  .uf-lightbox-inner { max-width: 100%; border-radius: 16px 16px 0 0; max-height: 95vh; }
  .uf-lb-pdf { height: calc(95vh - 60px); }
}

/* ─── Modal ─── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--white);
  border-radius: 12px;
  max-width: 520px; width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.modal-header {
  padding: 24px 24px 16px;
  display: flex; justify-content: space-between; align-items: flex-start;
}
.modal-header h3 { font-size: 18px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--gray-400); }
.modal-body { padding: 0 24px 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--gray-200); display: flex; gap: 10px; justify-content: flex-end; }

/* ─── Section Headers ─── */
.section-title {
  font-size: 16px; font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-light);
}

/* ─── Detail Rows ─── */
.detail-grid { display: grid; gap: 0; }
.detail-row {
  display: flex;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-100);
  gap: 16px;
}
.detail-row:last-child { border-bottom: none; }
.detail-label { font-size: 14px; color: var(--gray-500); width: 220px; flex-shrink: 0; display: flex; align-items: center; gap: 8px; }
.detail-label svg { width: 16px; height: 16px; }
.detail-value { font-size: 14px; color: var(--gray-800); font-weight: 500; flex: 1; }

/* ─── Announcement Timeline ─── */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 0; bottom: 0; width: 2px; background: var(--gray-200); }
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-dot {
  position: absolute; left: -28px; top: 4px;
  width: 14px; height: 14px;
  background: var(--primary);
  border-radius: 50%;
  border: 2px solid var(--white);
  box-shadow: 0 0 0 2px var(--primary);
}
.timeline-content {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 12px 16px;
}
.timeline-meta { font-size: 12px; color: var(--gray-400); margin-bottom: 6px; }
.timeline-text { font-size: 14px; color: var(--gray-700); }

/* ─── Shared Components (used on view & wizard pages) ─── */
.vendor-logo {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; flex-shrink: 0;
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
  border-radius: 10px;
  font-size: 13px; font-weight: 700; color: #4338ca;
}
.contact-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; gap: 10px;
  border: 1px solid var(--gray-200); border-radius: var(--radius);
  background: var(--white);
}
.contact-card-left { display: flex; align-items: center; gap: 10px; }
.contact-avatar {
  width: 32px; height: 32px; flex-shrink: 0;
  background: var(--primary); color: white; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.contact-name { font-size: 14px; font-weight: 500; }
.contact-tag  { font-size: 12px; color: var(--gray-400); }

[data-theme="dark"] .vendor-logo { background: linear-gradient(135deg, #1e2a4a, #2a3a60); color: #93c5fd; }
[data-theme="dark"] .contact-card { background: var(--gray-200); border-color: var(--gray-300); }

/* ─── Pagination ─── */
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-top: 1px solid var(--gray-200); font-size: 13px; color: var(--gray-500); }
.pag-links { display: flex; gap: 4px; }
.pag-link {
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-600);
  text-decoration: none;
  font-size: 13px;
}
.pag-link:hover { background: var(--gray-50); }
.pag-link.active { background: var(--primary); color: white; border-color: var(--primary); }

/* ─── Dashboard Layout ─── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
}
.dashboard-right { display: flex; flex-direction: column; gap: 20px; }

@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

/* ─── Dashboard Quick Actions ─── */
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 28px;
}

/* ── Card base ── */
.qa-card {
  flex: 1 1 140px;
  position: relative;
  border-radius: 18px;
  padding: 22px 20px 18px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  min-width: 0;
  overflow: hidden;
  border: 1.5px solid transparent;
  transition: transform .25s cubic-bezier(.34,1.4,.64,1), box-shadow .22s ease;
}

/* ── Colored tint backgrounds ── */
.qa-blue   { background: linear-gradient(150deg,#eff6ff 0%,#fff 55%); border-color: #bfdbfe; }
.qa-yellow { background: linear-gradient(150deg,#fffbeb 0%,#fff 55%); border-color: #fde68a; }
.qa-green  { background: linear-gradient(150deg,#ecfdf5 0%,#fff 55%); border-color: #6ee7b7; }
.qa-purple { background: linear-gradient(150deg,#f5f3ff 0%,#fff 55%); border-color: #c4b5fd; }
.qa-pink   { background: linear-gradient(150deg,#fdf2f8 0%,#fff 55%); border-color: #f9a8d4; }

/* ── Decorative glow orb (top-right) ── */
.qa-card::before {
  content: '';
  position: absolute;
  top: -28px; right: -28px;
  width: 110px; height: 110px;
  border-radius: 50%;
  opacity: .14;
  transition: transform .35s ease, opacity .25s;
  pointer-events: none;
}
.qa-blue::before   { background: #2563eb; }
.qa-yellow::before { background: #f59e0b; }
.qa-green::before  { background: #10b981; }
.qa-purple::before { background: #7c3aed; }
.qa-pink::before   { background: #ec4899; }

/* ── Hover states ── */
.qa-card:hover { transform: translateY(-5px); }
.qa-card:hover::before { transform: scale(1.25); opacity: .22; }
.qa-blue:hover   { box-shadow: 0 16px 40px rgba(37,99,235,.18);  border-color: #93c5fd; }
.qa-yellow:hover { box-shadow: 0 16px 40px rgba(245,158,11,.18); border-color: #fcd34d; }
.qa-green:hover  { box-shadow: 0 16px 40px rgba(16,185,129,.18); border-color: #34d399; }
.qa-purple:hover { box-shadow: 0 16px 40px rgba(124,58,237,.18); border-color: #a78bfa; }
.qa-pink:hover   { box-shadow: 0 16px 40px rgba(236,72,153,.18); border-color: #f472b6; }

/* ── Icon ── */
.qa-icon {
  width: 50px; height: 50px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-bottom: 16px;
  transition: transform .25s cubic-bezier(.34,1.4,.64,1);
}
.qa-card:hover .qa-icon { transform: scale(1.12) rotate(-3deg); }
.qa-icon svg { width: 24px; height: 24px; }
.qa-icon.blue   { background: #2563eb; color: #fff; box-shadow: 0 6px 16px rgba(37,99,235,.40); }
.qa-icon.yellow { background: #f59e0b; color: #fff; box-shadow: 0 6px 16px rgba(245,158,11,.40); }
.qa-icon.green  { background: #10b981; color: #fff; box-shadow: 0 6px 16px rgba(16,185,129,.40); }
.qa-icon.purple { background: #7c3aed; color: #fff; box-shadow: 0 6px 16px rgba(124,58,237,.40); }
.qa-icon.pink   { background: #ec4899; color: #fff; box-shadow: 0 6px 16px rgba(236,72,153,.40); }

/* ── Text ── */
.qa-text { min-width: 0; flex: 1; }
.qa-title { font-size: 13.5px; font-weight: 700; color: var(--gray-900); line-height: 1.3; word-break: break-word; }
.qa-sub   { font-size: 11.5px; color: var(--gray-500); margin-top: 4px; line-height: 1.45; }

/* ── Bottom arrow indicator ── */
.qa-arrow {
  margin-top: 18px;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .2s, transform .22s;
  display: flex; align-items: center; gap: 4px;
  letter-spacing: .3px;
}
.qa-blue   .qa-arrow { color: #2563eb; }
.qa-yellow .qa-arrow { color: #f59e0b; }
.qa-green  .qa-arrow { color: #10b981; }
.qa-purple .qa-arrow { color: #7c3aed; }
.qa-pink   .qa-arrow { color: #ec4899; }
.qa-card:hover .qa-arrow { opacity: 1; transform: translateX(0); }

/* ── Mobile: 2 per row using explicit width so it's bulletproof ── */
@media (max-width: 640px) {
  .quick-actions { gap: 10px; margin-bottom: 20px; }
  .qa-card {
    flex: 0 0 calc(50% - 5px);
    width: calc(50% - 5px);
    flex-direction: row;
    align-items: center;
    padding: 14px 14px;
    gap: 12px;
    border-radius: 14px;
  }
  .qa-card:last-child { flex: 0 0 100%; width: 100%; }
  .qa-card::before { width: 64px; height: 64px; top: -16px; right: -16px; }
  .qa-icon { width: 40px; height: 40px; border-radius: 11px; margin-bottom: 0; }
  .qa-icon svg { width: 19px; height: 19px; }
  .qa-title { font-size: 13px; }
  .qa-sub { font-size: 11px; }
  .qa-arrow { display: none; }
}

/* ─── Misc ─── */
.text-muted { color: var(--gray-500); }
.text-sm { font-size: 13px; }
.text-right { text-align: right; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.divider { height: 1px; background: var(--gray-200); margin: 24px 0; }
.hidden { display: none !important; }
.w-full { width: 100%; }

/* ─── Responsive (base rules moved to the expanded block above) ─── */

/* ─── Login Page ─── */
.login-page {
  min-height: 100vh;
  display: flex;
  background: #f0f4ff;
}
.login-left {
  flex: 1;
  background: linear-gradient(150deg, #1a56db 0%, #0f2d6b 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 48px;
  position: relative;
  overflow: hidden;
}
.login-left::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  top: -120px; left: -120px;
}
.login-left::after {
  content: '';
  position: absolute;
  width: 350px; height: 350px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  bottom: -80px; right: -80px;
}
.login-left-content { position: relative; z-index: 1; color: white; max-width: 380px; }
.login-brand-icon {
  width: 72px; height: 72px;
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.25);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 800; color: white;
  margin-bottom: 24px;
  backdrop-filter: blur(10px);
}
.login-left-content h2 {
  font-size: 32px; font-weight: 800;
  margin-bottom: 12px; line-height: 1.2;
}
.login-left-content p {
  font-size: 15px; color: rgba(255,255,255,0.7);
  line-height: 1.6; margin-bottom: 40px;
}
.login-features { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.login-features li {
  display: flex; align-items: center; gap: 12px;
  font-size: 14px; color: rgba(255,255,255,0.85);
}
.login-features li span.feat-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(255,255,255,0.12);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.login-right {
  width: 480px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 48px 48px;
  background: white;
}
.login-card {
  width: 100%; max-width: 380px;
}
.login-logo { margin-bottom: 36px; }
.login-logo h1 { font-size: 24px; font-weight: 800; color: var(--gray-900); margin-bottom: 6px; }
.login-logo p { font-size: 14px; color: var(--gray-500); }
.login-logo-icon { display: none; }
.login-form .form-group { margin-bottom: 20px; }
.login-form .form-label { font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
.login-form .form-control {
  padding: 12px 14px; font-size: 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.login-form .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
  outline: none;
}
.login-btn {
  width: 100%; padding: 13px;
  font-size: 15px; font-weight: 600;
  margin-top: 8px; border-radius: 10px;
  background: linear-gradient(135deg, #1a56db, #1e3a8a);
  border: none; cursor: pointer; color: white;
  transition: opacity 0.2s, transform 0.1s;
}
.login-btn:hover { opacity: 0.92; transform: translateY(-1px); }
.login-btn:active { transform: translateY(0); }
.login-pw-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.login-pw-row .form-label { margin-bottom: 0; }
.login-forgot-link {
  font-size: 12px; color: var(--primary); text-decoration: none; font-weight: 500;
}
.login-forgot-link:hover { text-decoration: underline; }

.login-remember {
  margin: 4px 0 16px;
}
.login-checkbox-label {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--gray-600); cursor: pointer; user-select: none;
}
.login-checkbox-label input[type="checkbox"] { display: none; }
.login-checkbox-custom {
  width: 18px; height: 18px; border-radius: 5px;
  border: 2px solid var(--gray-300);
  background: white;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.15s, background 0.15s;
}
.login-checkbox-label input[type="checkbox"]:checked + .login-checkbox-custom {
  background: var(--primary); border-color: var(--primary);
}
.login-checkbox-label input[type="checkbox"]:checked + .login-checkbox-custom::after {
  content: '';
  display: block;
  width: 4px; height: 8px;
  border: 2px solid white;
  border-top: none; border-left: none;
  transform: rotate(45deg) translate(-1px, -1px);
}

.login-back-link {
  font-size: 13px; color: var(--primary); text-decoration: none; font-weight: 500;
}
.login-back-link:hover { text-decoration: underline; }

.login-divider {
  text-align: center; font-size: 12px; color: var(--gray-400);
  margin: 24px 0 0;
}

.dev-reset-box {
  background: #fffbeb; border: 1px solid #f59e0b;
  border-radius: 8px; padding: 14px 16px; margin-top: 16px;
  font-size: 13px; color: #92400e;
}
.dev-reset-box p { margin: 0 0 8px; }
.dev-reset-link {
  word-break: break-all; color: #1a56db; font-size: 12px;
}
@media (max-width: 768px) {
  .login-left { display: none; }
  .login-right { width: 100%; padding: 40px 24px; }
}

/* Richtext toolbar placeholder */
.richtext-toolbar {
  display: flex; gap: 2px; flex-wrap: wrap; align-items: center;
  padding: 6px 8px;
  border: 1px solid var(--gray-300);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--gray-50);
}
.rt-format-select {
  padding: 4px 6px; border: 1px solid var(--gray-200); border-radius: 4px;
  background: var(--white); font-size: 12px; color: var(--gray-700);
  cursor: pointer; height: 28px; margin-right: 2px;
}
.rt-sep { width: 1px; height: 20px; background: var(--gray-200); margin: 0 4px; flex-shrink: 0; }
.richtext-btn {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid transparent;
  border-radius: 4px;
  background: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-600);
  transition: all 0.1s;
  padding: 0;
}
.richtext-btn:hover { background: var(--gray-200); border-color: var(--gray-300); color: var(--gray-900); }
.richtext-btn.active { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.rt-strike s { text-decoration: line-through; font-style: normal; }
.richtext-area {
  border: 1px solid var(--gray-300);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 14px;
  min-height: 160px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.6;
  outline: none;
  color: var(--gray-800);
}
.richtext-area:focus { border-color: var(--primary); }

/* Shared richtext content rules (editor + display) */
.richtext-area ul, .richtext-display ul { padding-left: 20px; margin: 6px 0; list-style: disc; }
.richtext-area ol, .richtext-display ol { padding-left: 20px; margin: 6px 0; list-style: decimal; }
.richtext-area a,  .richtext-display a  { color: var(--primary); text-decoration: underline; }
.richtext-area blockquote { border-left: 3px solid var(--gray-300); padding-left: 12px; color: var(--gray-500); margin: 8px 0; }

/* Editor heading sizes */
.richtext-area h2 { font-size: 20px; font-weight: 700; margin: 8px 0 4px; }
.richtext-area h3 { font-size: 17px; font-weight: 600; margin: 8px 0 4px; }
.richtext-area h4 { font-size: 15px; font-weight: 600; margin: 6px 0 4px; }

/* Display (review/view) heading sizes */
.richtext-display { font-size: 14px; color: var(--gray-700); line-height: 1.7; }
.richtext-display h2 { font-size: 18px; font-weight: 700; margin: 10px 0 4px; color: var(--gray-900); }
.richtext-display h3 { font-size: 16px; font-weight: 600; margin: 8px 0 4px; color: var(--gray-800); }
.richtext-display h4 { font-size: 14px; font-weight: 600; margin: 6px 0 4px; }
.richtext-display strong, .richtext-display b { font-weight: 700; }
.richtext-display em,     .richtext-display i { font-style: italic; }

/* Terms & Conditions checkbox */
.tc-checkbox-label {
  display: flex; align-items: flex-start; gap: 12px;
  cursor: pointer; user-select: none;
  padding: 14px 16px;
  background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 8px;
  transition: all var(--transition);
}
.tc-checkbox-label:hover { border-color: var(--primary); background: var(--primary-light); }
.tc-checkbox-box {
  width: 20px; height: 20px; flex-shrink: 0;
  border: 2px solid var(--gray-300); border-radius: 4px;
  background: var(--white); margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.tc-checkbox-box svg { opacity: 0; }
.tc-checkbox-box.checked { background: var(--primary); border-color: var(--primary); }
.tc-checkbox-box.checked svg { opacity: 1; color: white; }
.tc-checkbox-text { font-size: 13px; color: var(--gray-700); line-height: 1.5; }
.tc-checkbox-label.tc-error {
  border-color: var(--danger);
  background: #fef2f2;
  animation: tcShake 0.45s ease;
}
.tc-checkbox-label.tc-error .tc-checkbox-text { color: var(--danger); }
.tc-checkbox-label.tc-error .tc-checkbox-box { border-color: var(--danger); }
@keyframes tcShake {
  0%,100% { transform: translateX(0); }
  15%      { transform: translateX(-6px); }
  30%      { transform: translateX(6px); }
  45%      { transform: translateX(-5px); }
  60%      { transform: translateX(5px); }
  75%      { transform: translateX(-3px); }
  90%      { transform: translateX(3px); }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════
   DARK MODE
   Toggle: <html data-theme="dark"> 
   ═══════════════════════════════════════════════════════════════ */
[data-theme="dark"] {
  --primary:       #4f86f7;
  --primary-dark:  #3b6fd4;
  --primary-light: #142044;
  --success:       #22c55e;
  --success-bg:    #052e16;
  --warning:       #fbbf24;
  --warning-bg:    #1c1200;
  --danger:        #f87171;
  --danger-bg:     #2d0808;
  --gray-50:       #0d0f16;
  --gray-100:      #151720;
  --gray-200:      #1e2130;
  --gray-300:      #272c3f;
  --gray-400:      #4a5168;
  --gray-500:      #7c849a;
  --gray-600:      #b0b8cc;
  --gray-700:      #cdd4e2;
  --gray-800:      #e2e6f0;
  --gray-900:      #f0f3fa;
  --white:         #12141c;
  --shadow:        0 1px 3px rgba(0,0,0,0.6);
  --shadow-md:     0 4px 8px rgba(0,0,0,0.5);
}

/* Component-level dark overrides */
[data-theme="dark"] .pricing-table th { background: var(--gray-300); color: var(--gray-800); }
[data-theme="dark"] .form-control { background: var(--gray-200); border-color: var(--gray-300); color: var(--gray-900); }
[data-theme="dark"] .form-control:focus { background: var(--gray-200); }
[data-theme="dark"] select.form-control { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237c849a' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-color: var(--gray-200); background-repeat: no-repeat; background-position: right 12px center; background-size: 12px 12px; }
[data-theme="dark"] .upload-zone { background: var(--gray-200); border-color: var(--gray-300); }
[data-theme="dark"] .upload-zone:hover { background: var(--primary-light); }
[data-theme="dark"] .modal { background: var(--gray-100); }
[data-theme="dark"] .modal-footer { background: var(--gray-200); }
[data-theme="dark"] .tag { background: var(--gray-300); border-color: var(--gray-400); color: var(--gray-800); }
[data-theme="dark"] .tag-input-wrap { background: var(--gray-200); border-color: var(--gray-300); }
[data-theme="dark"] .tag-input { color: var(--gray-900); }
[data-theme="dark"] .dropdown-list { background: var(--gray-100); border-color: var(--gray-300); }
[data-theme="dark"] .dropdown-item:hover { background: var(--gray-200); }
[data-theme="dark"] .richtext-toolbar { background: var(--gray-200); border-color: var(--gray-300); }
[data-theme="dark"] .richtext-btn { color: var(--gray-700); }
[data-theme="dark"] .richtext-btn:hover { background: var(--gray-300); }
[data-theme="dark"] .rt-format-select { background: var(--gray-300); border-color: var(--gray-400); color: var(--gray-700); }
[data-theme="dark"] .rt-sep { background: var(--gray-300); }
[data-theme="dark"] .richtext-area { background: var(--gray-200); border-color: var(--gray-300); color: var(--gray-900); }
[data-theme="dark"] .tc-checkbox-label { background: var(--gray-200); border-color: var(--gray-300); }
[data-theme="dark"] .tc-checkbox-box { background: var(--gray-300); border-color: var(--gray-400); }
[data-theme="dark"] .login-right { background: var(--white); }
[data-theme="dark"] .login-form .form-control { background: var(--gray-200); border-color: var(--gray-300); }
[data-theme="dark"] .login-checkbox-custom { background: var(--gray-200); border-color: var(--gray-300); }
[data-theme="dark"] .filter-select { background-color: var(--gray-200); border-color: var(--gray-300); color: var(--gray-800); }
[data-theme="dark"] .um-search-box { background: var(--gray-200); border-color: var(--gray-300); }
[data-theme="dark"] .um-search-box input { color: var(--gray-800); }
[data-theme="dark"] tr:hover td { background: var(--gray-200); }
[data-theme="dark"] .card-footer { background: var(--gray-200); }
[data-theme="dark"] .alert-success { background: #052e16; border-color: #166534; }
[data-theme="dark"] .alert-error { background: #2d0808; border-color: #991b1b; }
[data-theme="dark"] .alert-warning { background: #1c1200; border-color: #92400e; }
[data-theme="dark"] .alert-info { background: var(--primary-light); border-color: #1e40af; color: var(--primary); }

/* ── Quick action cards — dark mode ── */
[data-theme="dark"] .qa-blue   { background: linear-gradient(150deg,#142044 0%,#12141c 55%); border-color: #1e3a6e; }
[data-theme="dark"] .qa-yellow { background: linear-gradient(150deg,#1c1200 0%,#12141c 55%); border-color: #3d2800; }
[data-theme="dark"] .qa-green  { background: linear-gradient(150deg,#052e16 0%,#12141c 55%); border-color: #064e2a; }
[data-theme="dark"] .qa-purple { background: linear-gradient(150deg,#1e1040 0%,#12141c 55%); border-color: #3b2070; }
[data-theme="dark"] .qa-pink   { background: linear-gradient(150deg,#2d0820 0%,#12141c 55%); border-color: #5c1035; }
[data-theme="dark"] .qa-blue:hover   { box-shadow: 0 16px 40px rgba(79,134,247,.22);  border-color: #2a52a0; }
[data-theme="dark"] .qa-yellow:hover { box-shadow: 0 16px 40px rgba(245,158,11,.18);  border-color: #6b4500; }
[data-theme="dark"] .qa-green:hover  { box-shadow: 0 16px 40px rgba(34,197,94,.18);   border-color: #0a7a35; }
[data-theme="dark"] .qa-purple:hover { box-shadow: 0 16px 40px rgba(124,58,237,.22);  border-color: #5b30a8; }
[data-theme="dark"] .qa-pink:hover   { box-shadow: 0 16px 40px rgba(236,72,153,.18);  border-color: #8c1a50; }
[data-theme="dark"] .qa-title { color: var(--gray-900); }
[data-theme="dark"] .qa-sub   { color: var(--gray-500); }

/* Dark mode toggle button */
.dark-toggle {
  width: 36px; height: 36px;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  background: var(--white);
  cursor: pointer;
  color: var(--gray-500);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}
.dark-toggle:hover { background: var(--gray-100); color: var(--gray-700); }
.dark-toggle svg { width: 18px; height: 18px; pointer-events: none; }

/* Sidebar overlay backdrop (mobile) */
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 199;
}
.sidebar-backdrop.active { display: block; }

/* ═══════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE (expanded)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  /* Show hamburger */
  #menuToggle { display: flex !important; }

  /* Sidebar slides off-screen; main takes full width */
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; width: 100%; }

  /* Page padding */
  .page-content { padding: 16px; }
  .topbar { padding: 0 14px; gap: 10px; }

  /* Page header stacks */
  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .page-header-actions { flex-wrap: wrap; width: 100%; }
  .page-header-actions .btn { flex: 1; justify-content: center; min-width: 100px; }

  /* Tabs scroll */
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
  .tab-link { white-space: nowrap; padding: 10px 14px; }

  /* Detail row: stack label above value */
  .detail-row { flex-direction: column; gap: 4px; }
  .detail-label { width: auto; }

  /* Cards */
  .card-header { flex-wrap: wrap; gap: 10px; }
  .card { min-width: 0; }

  /* Forms */
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .radio-cards { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }

  /* Bid view: collapse two-column layout to single column */
  .bid-view-grid { grid-template-columns: 1fr; }

  /* Keep ⋮ more-actions button compact — never stretch to fill row */
  #moreActionsWrap { flex: 0 0 auto !important; }
  #moreActionsWrap .btn { flex: none !important; min-width: 0 !important; }

  /* Uploaded file: let button row wrap below filename on narrow screens */
  .uploaded-file { flex-wrap: wrap; }
  .uploaded-file > span { width: 100%; }
  .uploaded-file > div { margin-left: 0 !important; }
}
@media (max-width: 640px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .um-stats { grid-template-columns: 1fr 1fr; }
  .page-content { padding: 12px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar-title { font-size: 15px; }

  /* All flex/grid containers must not overflow */
  .card-body { min-width: 0; }
  .filter-chip { max-width: 100%; }

  /* Modals full-screen */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal {
    border-radius: 16px 16px 0 0;
    max-width: 100%;
    max-height: 90vh;
    overflow-y: auto;
  }

  /* Buttons in header/footer wrap */
  .modal-footer { flex-wrap: wrap; }
  .modal-footer .btn { flex: 1; justify-content: center; }
}

/* ─── Filter toggle (collapsible on mobile) ─── */
.filter-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  padding: 14px 20px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.filter-toggle-btn:hover { background: var(--gray-50); border-radius: var(--radius); }
.filter-clear-link {
  font-size: 12px; color: var(--danger); text-decoration: none;
  display: flex; align-items: center; gap: 4px;
}
.filter-clear-link:hover { text-decoration: underline; }

/* Desktop: body always visible, chevron hidden */
.filter-body { padding: 0 20px 16px; }
.filter-chevron { display: none; }

/* Mobile: body collapsible, chevron shown */
@media (max-width: 900px) {
  .filter-chevron { display: block; }
  .filter-toggle-btn { border-bottom: 1px solid var(--gray-100); }
  .filter-toggle-btn:hover { border-radius: 0; }
  .filter-body {
    overflow: hidden;
    max-height: 0;
    padding: 0 16px;
    transition: max-height .28s ease, padding .28s ease;
  }
  .filter-body.open {
    max-height: 800px;
    padding: 14px 16px 16px;
  }
  .filter-body.open ~ * .filter-toggle-btn .filter-chevron,
  .filter-chevron.open { transform: rotate(180deg); }
  /* When filters are active, show the body open by default via PHP class */
}

/* ─── Filter grid ─── */
.filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 10px;
  align-items: end;
}
@media (max-width: 900px) {
  .filter-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .filter-grid { grid-template-columns: 1fr; }
}

/* ─── Mobile card table (replaces rows on small screens) ─── */
@media (max-width: 640px) {
  /* Hide table header row */
  .table-wrap table thead { display: none; }

  /* Each row becomes a card */
  .table-wrap table,
  .table-wrap tbody,
  .table-wrap tr { display: block; }

  .table-wrap tr {
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    margin: 0 0 10px;
    padding: 14px 14px 10px;
    position: relative;
    background: var(--white);
  }
  .table-wrap tr:hover { background: var(--gray-50); }

  /* All cells stack */
  .table-wrap td {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 4px 0;
    border: none;
    font-size: 13px;
  }

  /* Label from data-label attribute */
  .table-wrap td[data-label]::before {
    content: attr(data-label);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--gray-400);
    min-width: 68px;
    flex-shrink: 0;
  }

  /* First cell (title) gets special treatment — no label prefix */
  .table-wrap td:first-child {
    padding-bottom: 8px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--gray-100);
  }
  .table-wrap td:first-child::before { display: none; }

  /* Last cell (actions) — push to top-right corner */
  .table-wrap td:last-child {
    position: absolute;
    top: 12px; right: 12px;
    padding: 0; border: none;
  }
  .table-wrap td:last-child::before { display: none; }
}

/* ─── Page header actions on mobile ─── */
@media (max-width: 540px) {
  .page-header-actions { gap: 8px; }
  .page-header-actions .btn { font-size: 13px; padding: 8px 12px; }
  .page-header h1 { font-size: 20px; }
}

/* Wizard tablet — hide labels, condense steps */
@media (max-width: 900px) {
  .wizard-topbar { padding: 0 16px; gap: 12px; }
  .wizard-autosave { min-width: unset; }
  .wizard-autosave small { display: none; }
  .step-label { display: none; }
  .wizard-steps { gap: 2px; }
  .step-connector { min-width: 12px; width: 20px; }
  .wizard-body { padding: 0; }
  .wizard-content { padding: 0 16px 16px; }
  .wizard-footer { padding: 12px 16px; }
}
/* Wizard mobile — handled in wizard.css @media (max-width: 540px) */

/* Report page responsive */
.report-comparison-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
