/* dashboard.css — Dashboard, connections, analysis, health, settings */
/* Payout row selection */
.payout-row:hover   { background: var(--row-hover, rgba(255,255,255,0.03)); }
.payout-row.selected { background: rgba(99,102,241,0.10) !important; box-shadow: inset 3px 0 0 #6366f1; }
/* ============================================================================
   30. Dashboard — TheReconciliator
   ============================================================================ */

.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.metric-card  { background: white; border-radius: 12px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.metric-card h3 { font-size: 14px; color: #64748b; margin: 0 0 8px; }
.metric-value   { font-size: 32px; font-weight: 700; color: #1e293b; }
.metric-change  { font-size: 13px; color: #22a559; margin-top: 4px; }

.quick-actions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.section-header { margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; }
.section-title  { font-size: 18px; font-weight: 600; color: #f9fafb; margin: 0; }

/* ============================================================================
   31. Connection Cards
   ============================================================================ */

.connection-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.connection-card  { background: white; border-radius: 12px; padding: 20px; display: flex; gap: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); border: 2px solid #e2e8f0; transition: all 0.2s; align-items: flex-start; }
.connection-card:hover { border-color: #cbd5e1; box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.connection-card#qbo-card { border-left: 4px solid #2ca01c; }
.card-content      { flex: 1; min-height: 80px; }
.card-content h3   { margin: 0 0 4px; font-size: 16px; }
.card-content .card-label { font-size: 12px; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.card-actions      { margin-top: 12px; }
.company-name, .connected-date, .store-url { font-size: 12px; color: #64748b; margin: 4px 0 0; }
.store-name        { font-size: 15px; font-weight: 600; color: #1e293b; margin-bottom: 2px; }
.store-details     { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: #64748b; }
.store-details span { display: flex; align-items: center; gap: 4px; }
.connection-error  { color: #dc2626; font-size: 13px; }

/* ============================================================================
   32. Action Cards
   ============================================================================ */

.action-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1200px) { .action-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px)  { .action-cards { grid-template-columns: 1fr; } }

.action-card  { background: white; border-radius: 12px; padding: 24px; cursor: pointer; transition: all 0.2s; box-shadow: 0 2px 8px rgba(0,0,0,0.05); border: 2px solid transparent; }
.action-card:hover  { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); border-color: #e2e8f0; }
.action-card:active { transform: translateY(0); }
.action-card.primary-action { background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%); color: white; }
.action-card.primary-action:hover { background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%); box-shadow: 0 8px 24px rgba(37,99,235,0.3); }
.action-card.primary-action h3,
.action-card.primary-action p { color: white; }
.action-card.primary-action p { opacity: 0.9; }
.action-icon     { font-size: 32px; margin-bottom: 12px; }
.action-card h3  { margin: 0 0 8px; font-size: 16px; color: #1e293b; }
.action-card p   { margin: 0; font-size: 13px; color: #64748b; }
.action-card.locked { opacity: 0.45; cursor: not-allowed; position: relative; border: 2px dashed #d1d5db; }
.action-card.locked:hover { transform: none; box-shadow: 0 2px 8px rgba(0,0,0,0.05); opacity: 0.65; border-color: #f59e0b; }
.action-card.locked .lock-badge { position: absolute; top: 10px; right: 10px; background: #f59e0b; color: #fff; font-size: 9px; font-weight: 700; padding: 2px 8px; border-radius: 4px; letter-spacing: 0.5px; }

/* ============================================================================
   33. Analysis Pages (Shared — Order & Customer)
   ============================================================================ */

.analysis-header   { margin-bottom: 24px; }
.analysis-header h2 { font-size: 24px; font-weight: 600; color: #1e293b; margin: 0 0 4px; }
.analysis-subtitle { font-size: 15px; color: #64748b; }

.stats-grid     { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card      { background: white; border-radius: 10px; padding: 16px; box-shadow: 0 2px 6px rgba(0,0,0,0.05); text-align: center; }
.stat-number    { font-size: 28px; font-weight: 700; color: #1e293b; }
.stat-icon      { font-size: 24px; margin-bottom: 8px; }
.stat-label     { font-size: 12px; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value     { font-size: 20px; font-weight: 600; color: #1e293b; }

.match-results  { background: white; border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.match-icon     { font-size: 20px; }
.match-label    { font-size: 14px; font-weight: 500; color: #374151; }

.custom-date-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 500; display: none; align-items: center; justify-content: center; }
.custom-date-overlay.active { display: flex; }
.custom-date-dialog { background: white; border-radius: 12px; padding: 24px; min-width: 320px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.custom-date-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.custom-date-header h3 { margin: 0; font-size: 18px; }
.custom-date-close { background: none; border: none; font-size: 24px; cursor: pointer; color: #64748b; }
.custom-date-body   { display: flex; flex-direction: column; gap: 12px; }
.custom-date-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.custom-date-field label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.custom-date-field input { width: 100%; padding: 8px 10px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 14px; }
.custom-date-footer { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

.log-entry { padding: 8px 12px; border-bottom: 1px solid #f1f5f9; font-size: 13px; color: #374151; }

.tab-btn        { padding: 8px 16px; border: 1px solid #e2e8f0; border-radius: 6px; background: #f8fafc; color: #374151; cursor: pointer; font-size: 14px; transition: all 0.15s; }
.tab-btn:hover  { background: #e2e8f0; }
.tab-btn.active { background: #22a559; color: white; border-color: #22a559; }

/* ============================================================================
   34. Health Pages (Shared — Financial & QBO)
   ============================================================================ */

.health-container { max-width: 900px; }

.score-card-main { background: linear-gradient(135deg, #1e3a5f 0%, #2d4a6f 100%); border-radius: 16px; padding: 32px; color: white; display: flex; gap: 32px; align-items: center; margin-bottom: 32px; }
.score-circle-wrapper { position: relative; }
.score-circle { width: 140px; height: 140px; border-radius: 50%; background: white; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.score-number { font-size: 48px; font-weight: 700; color: #1e293b; line-height: 1; }
.score-label  { font-size: 12px; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; }
.score-info h2 { font-size: 24px; margin-bottom: 8px; }
.score-info p  { opacity: 0.85; font-size: 15px; }
.score-date    { font-size: 13px; opacity: 0.7; margin-top: 8px; }

.categories-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 32px; }
.category-card   { background: white; border-radius: 12px; padding: 20px; box-shadow: 0 2px 6px rgba(0,0,0,0.05); }
.category-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.category-icon   { font-size: 24px; }
.category-score  { font-size: 20px; font-weight: 700; color: #1e293b; margin-left: auto; }
.category-bar    { height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; }
.category-bar-fill { height: 100%; border-radius: 4px; background: #22a559; }

.issues-section  { margin-bottom: 32px; }
.issues-section h3 { font-size: 20px; font-weight: 600; color: #1e293b; margin-bottom: 16px; }
.issue-group     { border: 1px solid #e2e8f0; border-radius: 8px; margin-bottom: 8px; overflow: hidden; }
.issue-group-header { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; transition: background 0.15s; }
.issue-group-header:hover { background: #f8fafc; }
.issue-group-icon  { font-size: 20px; }
.issue-group-title { flex: 1; font-weight: 500; color: #1e293b; }
.issue-group-count { font-size: 13px; font-weight: 600; padding: 2px 10px; border-radius: 10px; }
.issue-group-count.medium { background: #fef3c7; color: #92400e; }
.issue-group-count.low    { background: #d1fae5; color: #065f46; }
.issue-group-chevron { font-size: 12px; color: #64748b; transition: transform 0.2s; }
.issue-group.expanded .issue-group-chevron { transform: rotate(180deg); }
.issue-group-content { display: none; padding: 0; background: #f8fafc; }
.issue-group.expanded .issue-group-content { display: block; }

.issue-card     { padding: 16px; border-bottom: 1px solid #e2e8f0; display: flex; gap: 16px; align-items: flex-start; }
.issue-card:last-child { border-bottom: none; }
.issue-card.medium { border-left: 3px solid #f59e0b; }
.issue-card.low    { border-left: 3px solid #22a559; }
.issue-icon        { font-size: 20px; flex-shrink: 0; }
.issue-content     { flex: 1; }
.issue-title       { font-weight: 500; color: #1e293b; margin-bottom: 4px; }
.issue-description { font-size: 14px; color: #64748b; line-height: 1.5; }
.issue-action      { font-size: 13px; color: #2563eb; text-decoration: none; display: inline-block; margin-top: 8px; }

.progress-bar-container { background: #e2e8f0; border-radius: 8px; height: 10px; overflow: hidden; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 24px; }

.score-circle-wrapper.critical::before { content: ''; position: absolute; inset: -8px; border-radius: 50%; border: 3px solid #dc2626; animation: pulse-danger 2s infinite; }
@keyframes pulse-danger { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ============================================================================
   35. Inventory Page
   ============================================================================ */

.summary-row   { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #e5e7eb; }
.summary-row:last-child { border-bottom: none; }
.summary-label { font-size: 14px; color: #64748b; }
.summary-value { font-size: 14px; font-weight: 600; color: #1e293b; }

/* ============================================================================
   36. Settings Page
   ============================================================================ */

.settings-section { background: white; border-radius: 12px; padding: 24px; margin-bottom: 24px; }
.settings-section h2 { font-size: 18px; font-weight: 600; color: #1e293b; margin-bottom: 16px; }
.setting-card { padding: 16px; border: 1px solid #e2e8f0; border-radius: 8px; margin-bottom: 12px; }
.header-actions select { padding: 8px 12px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 14px; }

/* ============================================================================
   42. TheReconciliator Dashboard — Dark Sidebar Layout
        (dashboard-thereconciliator.pug)
   ============================================================================ */

/* Account bar at top of dark dashboard pages */
.dashboard .account-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0 0;
  margin-bottom: 12px;
}

.dashboard .header-left h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: #f9fafb;
}

.dashboard .header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Connection Cards — dark sidebar variant */
.dashboard .connection-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.dashboard .connection-card {
  background: #162231;
  border: 1px solid #1e3a5f;
  border-radius: 12px;
  padding: 28px 32px 64px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  min-height: 160px;
  position: relative;
}

.dashboard .connection-icon {
  font-size: 48px;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 14px;
  flex-shrink: 0;
}

.dashboard .connection-info { flex: 1; }

.dashboard .connection-info h3 {
  font-size: 16px;
  font-weight: 600;
  color: #f9fafb;
  margin: 0 0 4px;
}

.dashboard .connection-name { font-size: 14px; color: #9ca3af; margin: 0 0 8px; }

.dashboard .connection-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
}

.dashboard .connection-badge.connected { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.dashboard .connection-badge.disconnected { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.qbo-connect-btn { height: 32px; width: auto; display: block; }
.qbo-connect-btn:hover { content: url('/images/qbo/Connect_to_QuickBooks_SVG/C2QB_green_btn_med_hover.svg'); }
.env-badge { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px; letter-spacing: 0.5px; margin-left: 8px; vertical-align: middle; }
.env-sandbox { background: rgba(234, 179, 8, 0.2); color: #ca8a04; border: 1px solid rgba(234,179,8,0.3); }
.env-production { background: rgba(16, 185, 129, 0.2); color: #059669; border: 1px solid rgba(16,185,129,0.3); }
.connection-detail { font-size: 12px; color: var(--text-mid, #8a99ad); margin: 2px 0; }
.connection-detail-row { display: flex; gap: 16px; margin-top: 4px; }
.platform-badge { font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 4px; background: rgba(99,102,241,0.15); color: #818cf8; border: 1px solid rgba(99,102,241,0.25); margin-left: 6px; }
.connected-stores-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.connected-store-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 10px; border-radius: 8px; background: rgba(99,102,241,0.06); border: 1px solid rgba(99,102,241,0.15); }
.connected-store-info { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.connected-store-detail { font-size: 11px; color: var(--text-mid, #8a99ad); }
.btn-disconnect { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 5px; background: rgba(239,68,68,0.75); color: #ffffff; border: 1px solid rgba(239,68,68,0.5); text-decoration: none; white-space: nowrap; transition: background 0.15s; }
.btn-disconnect:hover { background: rgba(239,68,68,0.95); }

.dashboard .btn-link {
  color: #3b82f6;
  background: transparent;
  border: none;
  cursor: pointer;
  font-weight: 600;
}
.dashboard .btn-link:hover { text-decoration: underline; }

/* Metrics Grid — dark sidebar variant */
.dashboard .metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.dashboard .metric-card {
  background: #162231;
  border: 1px solid #1e3a5f;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.dashboard .metric-icon {
  font-size: 28px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(59, 130, 246, 0.15);
  border-radius: 10px;
}

.dashboard .metric-content { flex: 1; }

.dashboard .metric-label {
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.dashboard .metric-value {
  font-size: 24px;
  font-weight: 700;
  color: #f9fafb;
  line-height: 1.2;
}

.dashboard .metric-sublabel { font-size: 12px; color: #6b7280; margin-top: 2px; }

/* Quick Actions — dark sidebar variant */
.dashboard .quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.dashboard .quick-action-card {
  background: #162231;
  border: 1px solid #1e3a5f;
  border-radius: 12px;
  padding: 24px;
  text-decoration: none;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}

.dashboard .quick-action-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.12);
  transform: translateY(-2px);
}

.dashboard .quick-action-card.card-highlight {
  background: linear-gradient(135deg, #1e3a5f 0%, #2d4a6f 100%);
  border-color: #3b82f6;
}

.dashboard .qa-icon { font-size: 36px; margin-bottom: 16px; }

.dashboard .qa-content h3 { font-size: 16px; font-weight: 600; color: #f9fafb; margin: 0 0 6px; }
.dashboard .qa-content p  { font-size: 13px; color: #9ca3af; margin: 0; }

/* Tools Grid — dark sidebar variant */
.dashboard .tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.dashboard .tool-card {
  background: #162231;
  border: 1px solid #1e3a5f;
  border-radius: 12px;
  padding: 20px;
  text-decoration: none;
  transition: all 0.2s;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.dashboard .tool-card:not(.disabled):hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.12);
}

.dashboard .tool-card.disabled { opacity: 0.6; cursor: not-allowed; }

.dashboard .tool-icon { font-size: 32px; }

.dashboard .tool-content h3 { font-size: 15px; font-weight: 600; color: #f9fafb; margin: 0 0 4px; }
.dashboard .tool-content p  { font-size: 13px; color: #9ca3af; margin: 0; }

.dashboard .tool-content .coming-soon {
  display: inline-block;
  margin-top: 8px;
  font-size: 10px;
  background: #1e3a5f;
  padding: 3px 8px;
  border-radius: 4px;
  color: #9ca3af;
  text-transform: uppercase;
  font-weight: 600;
}

/* Responsive */
@media (max-width: 1200px) {
  .dashboard .metrics-grid { grid-template-columns: repeat(2, 1fr); }
}

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



/* --- connect-bigcommerce (migrated from inline style block) --- */
.cs-page { min-height: 100vh; background: #0b1120; display: flex; flex-direction: column; font-family: inherit; }
.cs-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 40px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.cs-back { display: flex; align-items: center; gap: 8px; color: #94a3b8; text-decoration: none; font-size: 0.9rem; font-weight: 500; transition: color 0.2s; }
.cs-back:hover { color: #e2e8f0; }
.cs-back-arrow { font-size: 1.1rem; }
.cs-back-method { display: inline-block; color: #475569; font-size: 0.85rem; text-decoration: none; margin-bottom: 20px; }
.cs-back-method:hover { color: #94a3b8; }
.cs-logo-text { font-size: 1rem; font-weight: 700; color: #64748b; }
.cs-hero { position: relative; text-align: center; padding: 48px 40px 32px; overflow: hidden; }
.cs-hero-glow { position: absolute; top: -60px; left: 50%; transform: translateX(-50%); width: 500px; height: 250px; background: radial-gradient(ellipse at center, rgba(34,197,94,0.12) 0%, transparent 70%); pointer-events: none; }
.cs-hero-content { position: relative; z-index: 1; }
.cs-hero-icon { font-size: 2.5rem; display: block; margin-bottom: 12px; }
.cs-hero-title { font-size: 2rem; font-weight: 800; color: #f1f5f9; margin: 0 0 10px; letter-spacing: -0.5px; }
.cs-hero-subtitle { font-size: 0.9rem; color: #64748b; margin: 0 auto; max-width: 400px; line-height: 1.6; }
.cs-cards-wrapper { flex: 1; display: flex; justify-content: center; padding: 8px 40px 64px; }
.cs-single-card { width: 100%; max-width: 480px; }
.cs-connect-box { background: #111827; border: 1px solid #1e293b; border-radius: 16px; overflow: hidden; }
.cs-connect-section { padding: 32px; }
.cs-method-cards { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 480px; }
.cs-method-card { position: relative; background: #111827; border: 1px solid #1e293b; border-radius: 14px; padding: 24px; text-decoration: none; color: inherit; display: block; transition: border-color 0.2s, transform 0.15s; cursor: pointer; }
.cs-method-card:hover { border-color: #4f46e5; transform: translateY(-2px); }
.cs-method-badge { position: absolute; top: 14px; right: 14px; background: #4f46e5; color: #fff; font-size: 0.65rem; font-weight: 800; letter-spacing: 0.05em; padding: 3px 8px; border-radius: 20px; }
.cs-method-icon { font-size: 1.8rem; margin-bottom: 10px; display: block; }
.cs-method-title { font-size: 1rem; font-weight: 700; color: #f1f5f9; margin: 0 0 6px; }
.cs-method-desc { font-size: 0.82rem; color: #475569; margin: 0; line-height: 1.6; }
.cs-section-title { font-size: 1.1rem; font-weight: 700; color: #f1f5f9; margin: 0 0 8px; }
.cs-section-desc { font-size: 0.875rem; color: #475569; margin: 0 0 16px; line-height: 1.6; }
.cs-hint { font-size: 0.8rem; color: #334155; margin: 0 0 14px; line-height: 1.6; }
.cs-hint code { background: #1e293b; padding: 1px 6px; border-radius: 4px; color: #94a3b8; font-size: 0.78rem; }
.cs-label { display: block; font-size: 0.8rem; font-weight: 600; color: #64748b; margin-bottom: 6px; letter-spacing: 0.04em; text-transform: uppercase; }
.cs-steps { display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; }
.cs-step { display: flex; align-items: center; gap: 12px; }
.cs-step-num { width: 24px; height: 24px; border-radius: 50%; background: rgba(34,197,94,0.15); border: 1px solid rgba(34,197,94,0.3); color: #4ade80; font-size: 0.75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cs-step-text { font-size: 0.875rem; color: #94a3b8; }
.cs-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.25); color: #f87171; padding: 10px 14px; border-radius: 8px; font-size: 0.85rem; margin-bottom: 16px; }
.cs-input { width: 100%; padding: 10px 12px; background: #0f172a; border: 1px solid #1e293b; border-radius: 8px; color: #f1f5f9; font-size: 0.9rem; box-sizing: border-box; outline: none; }
.cs-input:focus { border-color: #22c55e; }
.cs-btn-primary { display: block; text-align: center; padding: 12px; background: #22c55e; color: #fff; border: none; border-radius: 8px; font-size: 0.95rem; font-weight: 600; cursor: pointer; text-decoration: none; transition: background 0.2s; width: 100%; box-sizing: border-box; }
.cs-btn-primary:hover { background: #16a34a; color: #fff; }
.cs-connected-state { text-align: center; }
.cs-connected-icon { font-size: 2rem; color: #4ade80; margin-bottom: 8px; display: block; }
.cs-btn-danger { display: block; width: 100%; text-align: center; padding: 10px; background: rgba(239,68,68,0.1); color: #f87171; border: 1px solid rgba(239,68,68,0.25); border-radius: 8px; font-size: 0.9rem; font-weight: 600; cursor: pointer; margin-top: 12px; transition: background 0.2s; box-sizing: border-box; }
.cs-btn-danger:hover { background: rgba(239,68,68,0.2); }


/* --- connect-store (migrated from inline style block) --- */
/* Allow full page scroll on this view */
.page-wrapper { height: auto !important; overflow: visible !important; min-height: 100vh; }
.main-content { overflow-y: visible !important; height: auto !important; }
/* ── Connect Store Page ──────────────────────────────────── */
.cs-page {
  min-height: 100vh;
  background: #0b1120;
  font-family: inherit;
}

/* Header */
.cs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.cs-back {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.cs-back:hover { color: #e2e8f0; }
.cs-back-arrow { font-size: 1.1rem; }
.cs-logo-text {
  font-size: 1rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.5px;
}

/* Hero */
.cs-hero {
  position: relative;
  text-align: center;
  padding: 56px 40px 40px;
  overflow: hidden;
}
.cs-hero-glow {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 300px;
  background: radial-gradient(ellipse at center, rgba(99,102,241,0.2) 0%, transparent 70%);
  pointer-events: none;
}
.cs-hero-content { position: relative; z-index: 1; }
.cs-hero-icon {
  font-size: 2.75rem;
  display: block;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 20px rgba(99,102,241,0.4));
}
.cs-hero-title {
  font-size: 2.25rem;
  font-weight: 800;
  color: #f1f5f9;
  margin: 0 0 12px;
  letter-spacing: -0.5px;
}
.cs-hero-subtitle {
  font-size: 0.95rem;
  color: #64748b;
  margin: 0 auto;
  max-width: 480px;
  line-height: 1.7;
}

/* Cards grid */
.cs-cards-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 8px 40px 64px;
}
.cs-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  width: 100%;
  max-width: 1000px;
}
.cs-card {
  background: #111827;
  border: 1px solid #1e293b;
  border-radius: 16px;
  padding: 24px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  cursor: pointer;
}
.cs-card:not(.cs-card-disabled):hover {
  border-color: #6366f1;
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(99,102,241,0.15);
}
.cs-card-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Card Header */
.cs-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cs-card-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}
.cs-card-emoji { line-height: 1; }
.cs-woo        { background: rgba(150,88,255,0.12); border: 1px solid rgba(150,88,255,0.2); }
.cs-amazon     { background: rgba(255,153,0,0.12);  border: 1px solid rgba(255,153,0,0.2);  }
.cs-bigcommerce{ background: rgba(52,152,219,0.12); border: 1px solid rgba(52,152,219,0.2); }
.cs-wix        { background: rgba(250,204,21,0.10); border: 1px solid rgba(250,204,21,0.2); }
.cs-s4s        { background: rgba(99,102,241,0.12); border: 1px solid rgba(99,102,241,0.2); }
.cs-ebay       { background: rgba(231,76,60,0.10);  border: 1px solid rgba(231,76,60,0.2);  }
.cs-shopify    { background: rgba(149,191,71,0.10); border: 1px solid rgba(149,191,71,0.2); }
.cs-card-img   { width: 28px; height: 28px; object-fit: contain; }

.cs-card-status {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 3px 9px;
  border-radius: 20px;
}
.cs-status-connected {
  background: rgba(34,197,94,0.12);
  color: #22c55e;
  border: 1px solid rgba(34,197,94,0.25);
}
.cs-status-available {
  background: rgba(16,185,129,0.12);
  color: #10b981;
  border: 1px solid rgba(16,185,129,0.25);
}
.cs-status-soon {
  background: rgba(148,163,184,0.08);
  color: #64748b;
  border: 1px solid rgba(148,163,184,0.15);
}

/* Card Body */
.cs-card-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0 0 6px;
}
.cs-card-desc {
  font-size: 0.82rem;
  color: #475569;
  margin: 0;
  line-height: 1.6;
}

/* Card Footer */
.cs-card-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #1a2332;
}
.cs-card-cta    { font-size: 0.875rem; font-weight: 600; color: #6366f1; }
.cs-card-disconnect { font-size: 0.875rem; font-weight: 600; color: #ef4444; }
.cs-card-notify { font-size: 0.875rem; font-weight: 600; color: #2d3f55; }

/* Responsive */
@media (max-width: 900px) {
  .cs-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .cs-header { padding: 16px 20px; }
  .cs-hero { padding: 36px 20px 28px; }
  .cs-hero-title { font-size: 1.75rem; }
  .cs-cards-wrapper { padding: 0 20px 40px; }
  .cs-cards { grid-template-columns: 1fr; }
}


/* --- connect-wix (migrated from inline style block) --- */
.cs-page { min-height: 100vh; background: #0b1120; display: flex; flex-direction: column; font-family: inherit; }
.cs-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 40px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.cs-back { display: flex; align-items: center; gap: 8px; color: #94a3b8; text-decoration: none; font-size: 0.9rem; font-weight: 500; transition: color 0.2s; }
.cs-back:hover { color: #e2e8f0; }
.cs-back-arrow { font-size: 1.1rem; }
.cs-logo-text { font-size: 1rem; font-weight: 700; color: #64748b; }
.cs-hero { position: relative; text-align: center; padding: 48px 40px 32px; overflow: hidden; }
.cs-hero-glow { position: absolute; top: -60px; left: 50%; transform: translateX(-50%); width: 500px; height: 250px; background: radial-gradient(ellipse at center, rgba(250,204,21,0.15) 0%, transparent 70%); pointer-events: none; }
.cs-hero-content { position: relative; z-index: 1; }
.cs-hero-icon { font-size: 2.5rem; display: block; margin-bottom: 12px; }
.cs-hero-title { font-size: 2rem; font-weight: 800; color: #f1f5f9; margin: 0 0 10px; letter-spacing: -0.5px; }
.cs-hero-subtitle { font-size: 0.9rem; color: #64748b; margin: 0 auto; max-width: 400px; line-height: 1.6; }
.cs-cards-wrapper { flex: 1; display: flex; justify-content: center; padding: 8px 40px 64px; }
.cs-single-card { width: 100%; max-width: 480px; }
.cs-connect-box { background: #111827; border: 1px solid #1e293b; border-radius: 16px; overflow: hidden; }
.cs-connect-section { padding: 32px; }
.cs-section-title { font-size: 1.1rem; font-weight: 700; color: #f1f5f9; margin: 0 0 8px; }
.cs-section-desc { font-size: 0.875rem; color: #475569; margin: 0 0 24px; line-height: 1.6; }
.cs-steps { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.cs-step { display: flex; align-items: center; gap: 12px; }
.cs-step-num { width: 24px; height: 24px; border-radius: 50%; background: rgba(250,204,21,0.15); border: 1px solid rgba(250,204,21,0.3); color: #fbbf24; font-size: 0.75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cs-step-text { font-size: 0.875rem; color: #94a3b8; }
.cs-input-group { margin-bottom: 16px; }
.cs-input { width: 100%; padding: 10px 14px; background: #0b1120; border: 1px solid #1e293b; border-radius: 8px; color: #f1f5f9; font-size: 0.875rem; outline: none; box-sizing: border-box; transition: border-color 0.2s; }
.cs-input:focus { border-color: #6366f1; }
.cs-input::placeholder { color: #334155; }
.cs-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.25); color: #f87171; padding: 10px 14px; border-radius: 8px; font-size: 0.85rem; margin-bottom: 16px; }
.cs-success { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.25); color: #4ade80; padding: 10px 14px; border-radius: 8px; font-size: 0.85rem; margin-bottom: 16px; }
.cs-btn-primary { display: block; width: 100%; text-align: center; padding: 12px; background: #6366f1; color: #fff; border: none; border-radius: 8px; font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.cs-btn-primary:hover { background: #4f46e5; }
.cs-btn-primary:disabled { background: #334155; cursor: not-allowed; }
.cs-connected-state { text-align: center; padding: 16px 0; }
.cs-connected-icon { font-size: 2rem; color: #4ade80; display: block; margin-bottom: 10px; }
.cs-btn-danger { display: block; width: 100%; text-align: center; padding: 11px; background: rgba(239,68,68,0.1); color: #f87171; border: 1px solid rgba(239,68,68,0.25); border-radius: 8px; font-size: 0.9rem; font-weight: 600; cursor: pointer; margin-top: 16px; transition: background 0.2s; box-sizing: border-box; }
.cs-btn-danger:hover { background: rgba(239,68,68,0.2); }


/* --- connect-woocommerce (migrated from inline style block) --- */
.cs-page { min-height: 100vh; background: #0b1120; display: flex; flex-direction: column; font-family: inherit; }
.cs-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 40px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.cs-back { display: flex; align-items: center; gap: 8px; color: #94a3b8; text-decoration: none; font-size: 0.9rem; font-weight: 500; transition: color 0.2s; }
.cs-back:hover { color: #e2e8f0; }
.cs-back-arrow { font-size: 1.1rem; }
.cs-logo-text { font-size: 1rem; font-weight: 700; color: #64748b; }
.cs-hero { position: relative; text-align: center; padding: 48px 40px 32px; overflow: hidden; }
.cs-hero-glow { position: absolute; top: -60px; left: 50%; transform: translateX(-50%); width: 500px; height: 250px; background: radial-gradient(ellipse at center, rgba(99,102,241,0.2) 0%, transparent 70%); pointer-events: none; }
.cs-hero-content { position: relative; z-index: 1; }
.cs-hero-icon { font-size: 2.5rem; display: block; margin-bottom: 12px; }
.cs-hero-title { font-size: 2rem; font-weight: 800; color: #f1f5f9; margin: 0 0 10px; letter-spacing: -0.5px; }
.cs-hero-subtitle { font-size: 0.9rem; color: #64748b; margin: 0 auto; max-width: 400px; line-height: 1.6; }
.cs-cards-wrapper { flex: 1; display: flex; justify-content: center; padding: 8px 40px 64px; }
.cs-single-card { width: 100%; max-width: 680px; }
.cs-connect-box { background: #111827; border: 1px solid #1e293b; border-radius: 16px; overflow: hidden; }
.cs-connect-section { padding: 32px; }
.cs-section-title { font-size: 1.1rem; font-weight: 700; color: #f1f5f9; margin: 0 0 8px; }
.cs-section-desc { font-size: 0.875rem; color: #475569; margin: 0 0 24px; line-height: 1.6; }
.cs-steps { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.cs-step { display: flex; align-items: center; gap: 12px; }
.cs-step-num { width: 24px; height: 24px; border-radius: 50%; background: rgba(99,102,241,0.2); border: 1px solid rgba(99,102,241,0.4); color: #818cf8; font-size: 0.75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cs-step-text { font-size: 0.875rem; color: #94a3b8; }
.cs-store-url-input { margin-bottom: 20px; }
.cs-label { display: block; font-size: 0.8rem; font-weight: 600; color: #94a3b8; margin-bottom: 8px; letter-spacing: 0.3px; }
.cs-input { width: 100%; padding: 10px 14px; background: #0d1829; border: 1px solid #1e293b; border-radius: 8px; color: #e2e8f0; font-size: 0.9rem; outline: none; transition: border-color 0.2s; box-sizing: border-box; }
.cs-input:focus { border-color: #6366f1; }
.cs-input::placeholder { color: #334155; }
.cs-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.25); color: #f87171; padding: 10px 14px; border-radius: 8px; font-size: 0.85rem; margin-bottom: 16px; }
.cs-btn-primary { width: 100%; padding: 12px; background: #6366f1; color: #fff; border: none; border-radius: 8px; font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: background 0.2s, transform 0.1s; }
.cs-btn-primary:hover { background: #4f46e5; }
.cs-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.cs-divider { display: flex; align-items: center; gap: 16px; padding: 0 32px; color: #1e293b; font-size: 0.8rem; color: #334155; }
.cs-divider::before, .cs-divider::after { content: ''; flex: 1; height: 1px; background: #1e293b; }
.cs-form { display: flex; flex-direction: column; gap: 16px; }
.cs-form-group { display: flex; flex-direction: column; }
.cs-instructions { margin-bottom: 20px; }
.cs-instructions p { font-size: 0.875rem; color: #64748b; margin: 0 0 8px; }
.cs-instructions ol { margin: 0; padding-left: 20px; }
.cs-instructions li { font-size: 0.8rem; color: #475569; margin-bottom: 4px; line-height: 1.5; }
.cs-btn-secondary { width: 100%; padding: 12px; background: transparent; color: #6366f1; border: 1px solid #6366f1; border-radius: 8px; font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.cs-btn-secondary:hover { background: rgba(99,102,241,0.08); }


/* --- dashboard-thereconciliator (migrated from inline style block) --- */
.qbo-company-row { display: flex; align-items: center; gap: 8px; margin: 2px 0 4px; }
.qbo-company-name { font-size: 13px; font-weight: 700; color: var(--text-bright, #f1f5f9); letter-spacing: 0.3px; }
.qbo-company-sub { font-size: 12px; color: var(--text-mid, #8a99ad); margin: 0 0 6px; }
.env-badge.env-production { background: #fef3c7; color: #92400e; }
.env-badge.env-sandbox { background: #dbeafe; color: #1e40af; }


/* --- receipts (migrated from inline style block) --- */
.receipts-panels { display: flex; gap: 0; flex: 1; min-height: 0; padding: 0 24px 24px; }
.receipts-panel { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--card-bg, #111827); border: 1px solid var(--border-color, #1e293b); border-radius: 12px; overflow: hidden; }
.receipts-divider { width: 12px; flex-shrink: 0; }
.receipts-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border-color, #1e293b); }
.receipts-panel-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 0.95rem; color: var(--text-primary, #f1f5f9); }
.receipts-panel-icon { font-size: 1rem; }
.receipts-badge { background: var(--badge-bg, #1e293b); color: var(--text-secondary, #94a3b8); font-size: 0.75rem; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.receipts-table-wrap { flex: 1; overflow-y: auto; }
.receipts-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.receipts-table thead th { padding: 9px 12px; text-align: left; font-size: 0.7rem; font-weight: 700; color: var(--text-muted, #475569); letter-spacing: 0.05em; border-bottom: 1px solid var(--border-color, #1e293b); position: sticky; top: 0; background: var(--card-bg, #111827); z-index: 1; }
.receipts-table tbody tr { border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.04)); transition: background 0.15s; }
.receipts-table tbody tr:hover { background: var(--row-hover, rgba(255,255,255,0.03)); }
.receipts-table tbody td { padding: 9px 12px; color: var(--text-secondary, #94a3b8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.receipts-table .col-order { color: var(--accent, #6366f1); font-weight: 600; }
.receipts-table .col-amount { color: var(--text-primary, #f1f5f9); font-weight: 600; }
.receipts-table .col-amount.refund { color: #f87171; }
.status-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; }
.status-PAID { background: rgba(34,197,94,0.15); color: #4ade80; }
.status-UNPAID { background: rgba(239,68,68,0.12); color: #f87171; }
.status-PARTIAL { background: rgba(251,191,36,0.12); color: #fbbf24; }
.status-REFUNDED { background: rgba(239,68,68,0.12); color: #f87171; }
.status-PENDING { background: rgba(148,163,184,0.12); color: #94a3b8; }
.type-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; background: rgba(99,102,241,0.12); color: #818cf8; }
.type-badge.refund { background: rgba(239,68,68,0.12); color: #f87171; }
.receipts-loading td { color: var(--text-muted, #475569); padding: 24px 12px; }
.receipts-empty td { color: var(--text-muted, #475569); padding: 24px 12px; text-align: center; }
.receipts-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2); color: #f87171; padding: 10px 16px; border-radius: 8px; font-size: 0.85rem; margin: 0 24px 12px; }
.page-header { padding: 24px 24px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.page-header h1 { margin: 0; font-size: 1.6rem; font-weight: 800; color: var(--text-primary, #f1f5f9); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.main-content { display: flex; flex-direction: column; margin-left: 80px; margin-right: 16px; }
.store-tabs { display: flex; gap: 4px; padding: 8px 14px; border-bottom: 1px solid var(--border-color, #1e293b); background: rgba(255,255,255,0.02); }
.store-tab { padding: 5px 14px; border-radius: 6px; border: 1px solid transparent; background: transparent; color: var(--text-secondary, #94a3b8); font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.store-tab:hover { background: rgba(255,255,255,0.05); color: var(--text-primary, #f1f5f9); }
.store-tab.active { background: rgba(99,102,241,0.15); border-color: rgba(99,102,241,0.3); color: #818cf8; }


/* --- woo-connect-pending-thereconciliator (migrated from inline style block) --- */
.cs-page { min-height: 100vh; background: #0b1120; display: flex; flex-direction: column; font-family: inherit; }
.cs-header { display: flex; align-items: center; justify-content: center; padding: 20px 40px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.cs-logo-text { font-size: 1rem; font-weight: 700; color: #64748b; }
.cs-hero { position: relative; text-align: center; padding: 64px 40px 32px; overflow: hidden; }
.cs-hero-glow { position: absolute; top: -60px; left: 50%; transform: translateX(-50%); width: 400px; height: 200px; background: radial-gradient(ellipse, rgba(99,102,241,0.2) 0%, transparent 70%); pointer-events: none; }
.cs-hero-content { position: relative; z-index: 1; }
.cs-hero-icon { font-size: 2.5rem; display: block; margin-bottom: 12px; animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.cs-hero-title { font-size: 2rem; font-weight: 800; color: #f1f5f9; margin: 0 0 10px; }
.cs-hero-subtitle { font-size: 0.9rem; color: #64748b; max-width: 400px; margin: 0 auto; line-height: 1.6; }
.cs-cards-wrapper { flex: 1; display: flex; justify-content: center; padding: 8px 40px 64px; }
.cs-single-card { width: 100%; max-width: 480px; }
.cs-connect-box { background: #111827; border: 1px solid #1e293b; border-radius: 16px; overflow: hidden; }
.cs-connect-section { padding: 40px 32px; }
.cs-spinner { width: 40px; height: 40px; border: 3px solid #1e293b; border-top-color: #6366f1; border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 24px; }
@keyframes spin { to { transform: rotate(360deg); } }
.cs-waiting-msg { font-size: 1rem; color: #94a3b8; margin: 0 0 8px; }
.cs-waiting-sub { font-size: 0.85rem; color: #475569; margin: 0; }
.cs-btn-primary { display: inline-block; padding: 12px 28px; background: #6366f1; color: #fff; border: none; border-radius: 8px; font-size: 0.95rem; font-weight: 600; cursor: pointer; text-decoration: none; transition: background 0.2s; }
.cs-btn-primary:hover { background: #4f46e5; }

/* Bottom-right pinned card actions */
.card-actions-bottom {
  position: absolute;
  bottom: 20px;
  right: 24px;
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ── AI Analysis (receipts page) ─────────────────────────────────────────── */
.page-title-group { display: flex; align-items: center; gap: 16px; }
.btn-ai { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: white; border: none; padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: opacity 0.2s, transform 0.1s; text-decoration: none; }
.btn-ai:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-ai:active { transform: translateY(0); }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 500; display: none; align-items: center; justify-content: center; }
.modal-overlay[style*="flex"] { display: flex !important; }
.modal-dialog { background: #1e293b; border: 1px solid #334155; border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; }
.ai-modal-dialog { max-width: 680px; width: 90%; max-height: 80vh; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid #334155; }
.modal-header h3 { margin: 0; font-size: 16px; font-weight: 600; color: #f1f5f9; display: flex; align-items: center; }
.modal-buttons { display: flex; gap: 8px; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: #64748b; line-height: 1; padding: 0 4px; }
.modal-close:hover { color: #f1f5f9; }
.modal-body { overflow-y: auto; padding: 16px 20px; max-height: calc(80vh - 120px); }
.modal-footer { padding: 12px 20px; border-top: 1px solid #334155; display: flex; justify-content: flex-end; gap: 8px; }

.prompt-modal-body { padding: 16px 20px 8px; }
.prompt-hint { margin: 0 0 10px; font-size: 13px; color: #64748b; }
#ai-prompt-textarea { width: 100%; height: 280px; font-size: 12px; font-family: monospace; line-height: 1.6; padding: 12px; border: 1px solid #334155; border-radius: 6px; resize: vertical; box-sizing: border-box; background: #0f172a; color: #e2e8f0; outline: none; transition: border-color 0.15s; }
#ai-prompt-textarea:focus { border-color: #6366f1; }
.prompt-modal-footer { padding: 12px 20px; border-top: 1px solid #334155; display: flex; justify-content: flex-end; gap: 8px; background: #1e293b; }
.btn-cancel { background: #1e293b; color: #94a3b8; border: 1px solid #334155; padding: 8px 16px; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; transition: background 0.15s; }
.btn-cancel:hover { background: #334155; }

.ai-result { padding: 8px 4px; }
.ai-section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #475569; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid #1e293b; margin-top: 16px; }
.ai-para { font-size: 14px; line-height: 1.7; color: #e2e8f0; margin-bottom: 6px; }
.ai-bullet { font-size: 14px; line-height: 1.6; color: #cbd5e1; padding: 2px 0 2px 8px; }
.ai-spacer { height: 8px; }
.ai-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 10px 0 16px; }
.ai-table th { background: #1e293b; padding: 8px 12px; text-align: left; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: #94a3b8; border-bottom: 2px solid #334155; }
.ai-table td { padding: 8px 12px; border-bottom: 1px solid #1e293b; color: #e2e8f0; vertical-align: middle; }
.ai-table tr.even td { background: #0f172a; }
.ai-table tr:hover td { background: #1e3a5f; }
.ai-status.matched { color: #4ade80; font-weight: 600; }
.ai-status.warn    { color: #fbbf24; }
.ai-status.info    { color: #60a5fa; }
.ai-status.error   { color: #f87171; font-weight: 600; }
/* ── Mode Switcher ────────────────────────────────────────────────────────── */
.mode-switcher { display: flex; gap: 4px; padding: 8px 12px 4px; margin-bottom: 4px; }
.mode-btn { flex: 1; padding: 4px 2px; font-size: 9px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; border-radius: 4px; border: 1px solid #1e293b; background: #0f172a; color: #475569; cursor: pointer; transition: all 0.15s; }
.mode-btn:hover:not(.disabled) { background: #1e293b; color: #94a3b8; }
.mode-btn.active { background: #1e3a5f; color: #60a5fa; border-color: #3b82f6; }
.mode-btn.disabled { opacity: 0.3; cursor: not-allowed; }

/* ── Sortable Table Headers ──────────────────────────────────────────────── */
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: #e2e8f0; }
th.sortable.sort-active { color: #818cf8; }
.sort-icon { font-size: 10px; margin-left: 4px; opacity: 0.5; }
th.sortable.sort-active .sort-icon { opacity: 1; color: #818cf8; }

/* ── QBO Entry Edit Modal ────────────────────────────────────────────────── */
.qbo-edit-dialog { width: 680px; max-width: 95vw; max-height: 85vh; display: flex; flex-direction: column; }
.qbo-edit-loading, .qbo-edit-error { padding: 24px; text-align: center; color: #94a3b8; }
.qbo-edit-error { color: #f87171; }
.qbo-edit-form { display: flex; flex-direction: column; gap: 20px; }
.qbo-edit-section { display: flex; flex-direction: column; gap: 10px; }
.qbo-edit-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #475569; margin-bottom: 4px; }
.qbo-edit-row { display: grid; grid-template-columns: 100px 1fr; align-items: center; gap: 10px; }
.qbo-edit-row label { font-size: 12px; color: #64748b; font-weight: 600; }
.qbo-edit-input { background: #1e293b; border: 1px solid #334155; border-radius: 6px; color: #e2e8f0; padding: 7px 10px; font-size: 13px; width: 100%; box-sizing: border-box; }
.qbo-edit-input:focus { outline: none; border-color: #6366f1; }
.qbo-line-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.qbo-line-table th { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: #475569; padding: 4px 6px; border-bottom: 1px solid #1e293b; text-align: left; }
.qbo-line-table td { padding: 4px 4px; border-bottom: 1px solid #0f172a; }
.qbo-line-remove { background: none; border: none; color: #475569; cursor: pointer; font-size: 16px; padding: 2px 6px; border-radius: 4px; }
.qbo-line-remove:hover { color: #f87171; background: rgba(248,113,113,0.1); }
.qbo-add-line-btn { margin-top: 8px; background: none; border: 1px dashed #334155; color: #475569; border-radius: 6px; padding: 6px 12px; font-size: 12px; cursor: pointer; width: 100%; }
.qbo-add-line-btn:hover { border-color: #6366f1; color: #818cf8; }
.qbo-edit-total { font-size: 14px; font-weight: 700; color: #e2e8f0; text-align: right; padding-top: 8px; border-top: 1px solid #1e293b; }

/* ── QBO Row Actions ─────────────────────────────────────────────────────── */
.qbo-row { cursor: pointer; }
.qbo-row:hover td { background: rgba(99,102,241,0.06); }
.col-actions { width: 70px; text-align: right; white-space: nowrap; }
.row-action-btn { background: none; border: none; cursor: pointer; font-size: 14px; padding: 2px 4px; border-radius: 4px; opacity: 0.4; transition: opacity 0.15s; }
.row-action-btn:hover { opacity: 1; }
.row-action-btn.delete:hover { background: rgba(248,113,113,0.1); }