/* =============================================
   CSS Variables
   ============================================= */
:root {
  --bg-primary: #FDFCFA;
  --bg-secondary: #F5F3EF;
  --bg-card: #FFFFFF;
  --text-primary: #1A1A1A;
  --text-secondary: #5A5A5A;
  --text-muted: #777777;
  --accent-primary: #2D5A4A;
  --accent-light: #E8F0ED;
  --accent-warm: #C4956A;
  --danger: #C45D4A;
  --danger-light: #FAF0EE;
  --warning: #D4A84B;
  --warning-light: #FBF6EA;
  --success: #4A8B6E;
  --success-light: #EDF6F1;
  --border: #E8E6E1;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
}

/* Color Themes */
[data-accent="green"] {
  --accent-primary: #2D5A4A;
  --accent-light: #E8F0ED;
}

[data-accent="pink"] {
  --accent-primary: #D4629B;
  --accent-light: #FBEEF5;
}

[data-accent="navy"] {
  --accent-primary: #2D4A5A;
  --accent-light: #E8EEF0;
}

[data-accent="plum"] {
  --accent-primary: #6B4A5A;
  --accent-light: #F0E8EC;
}

[data-accent="rust"] {
  --accent-primary: #A65D3F;
  --accent-light: #F5EDE8;
}

[data-accent="gold"] {
  --accent-primary: #8B7355;
  --accent-light: #F3F0EB;
}

/* =============================================
   Reset & Base
   ============================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* =============================================
   Utilities
   ============================================= */
.hidden {
  display: none !important;
}

.screen {
  min-height: 100vh;
}

/* =============================================
   Buttons
   ============================================= */
.btn {
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: var(--accent-primary);
  color: white;
}

.btn-primary:hover {
  background: #234a3c;
}

.btn-primary:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent-primary);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent-primary);
  cursor: pointer;
  font-size: 13px;
  text-decoration: underline;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.icon-btn:hover {
  border-color: var(--accent-primary);
}

/* =============================================
   Initial Loading Screen
   ============================================= */
#init-loading-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.init-loading-container {
  text-align: center;
}

.init-spinner {
  width: 40px;
  height: 40px;
  margin: 24px auto 0;
  border: 3px solid var(--border);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =============================================
   Auth Screen
   ============================================= */
#auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.auth-container {
  background: var(--bg-card);
  padding: 48px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.logo-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
}

.logo-text {
  font-family: 'DM Serif Display', serif;
  font-size: 28px;
  color: var(--text-primary);
}

.tagline {
  color: var(--text-muted);
  margin-bottom: 8px;
}

.tagline-sub {
  color: var(--primary);
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 32px;
}

.auth-form h2 {
  font-size: 20px;
  margin-bottom: 24px;
  color: var(--text-primary);
}

.form-group {
  margin-bottom: 16px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.auth-form .btn {
  width: 100%;
  margin-top: 8px;
}

.promo-code-toggle {
  margin: 8px 0 4px;
  text-align: left;
}

.promo-code-toggle a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}

.promo-code-toggle a:hover {
  color: var(--accent-primary);
}

.code-msg {
  font-size: 12px;
  margin-top: 6px;
}

.code-msg.valid {
  color: var(--success);
}

.code-msg.invalid {
  color: var(--error);
}

.auth-switch {
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-muted);
}

.auth-switch a {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
}

.form-description {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}

/* Streaming cursor animation */
.cursor {
  display: inline-block;
  animation: blink 1s infinite;
  color: var(--accent-color);
  font-weight: bold;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.error-message {
  background: var(--danger-light);
  color: var(--danger);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-top: 16px;
  font-size: 14px;
}

.success-message {
  background: var(--success-light);
  color: var(--success);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-top: 16px;
  font-size: 14px;
}

/* =============================================
   Main App Layout
   ============================================= */
#main-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.header-left {
  display: flex;
  align-items: center;
}

.logo-small {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon-small {
  width: 32px;
  height: 32px;
  background: var(--accent-primary);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
}

.logo-text-small {
  font-family: 'DM Serif Display', serif;
  font-size: 20px;
  color: var(--text-primary);
}

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

.store-name {
  font-size: 14px;
  color: var(--text-secondary);
}

.main-content {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* =============================================
   Sidebar
   ============================================= */
.sidebar {
  width: 280px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 24px;
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar-section {
  margin-bottom: 24px;
}

.sidebar-section h3 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.status-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 13px;
}

.status-label {
  color: var(--text-secondary);
}

.status-value {
  font-weight: 500;
}

.status-value.success {
  color: var(--success);
}

.status-value.warning {
  color: var(--warning);
}

.status-value.danger {
  color: var(--danger);
}

.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.quick-action-btn:hover {
  background: var(--accent-light);
  border-color: var(--accent-primary);
}

.recent-chats {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.recent-chat-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-chat-item:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* =============================================
   Chat Area
   ============================================= */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  overflow: hidden;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.welcome-message {
  text-align: center;
  padding: 48px 24px;
  max-width: 500px;
  margin: 0 auto;
}

.welcome-message h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 28px;
  margin-bottom: 12px;
}

.welcome-message p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.example-questions {
  text-align: left;
  background: var(--bg-card);
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.example-questions p {
  margin-bottom: 12px;
  font-size: 13px;
}

.example-btn {
  display: block;
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

.example-btn:last-child {
  margin-bottom: 0;
}

.example-btn:hover {
  background: var(--accent-light);
  border-color: var(--accent-primary);
}

.message {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  max-width: 800px;
}

.message.user {
  flex-direction: row-reverse;
  margin-left: auto;
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.message.assistant .message-avatar {
  background: var(--accent-light);
  color: var(--accent-primary);
}

.message.user .message-avatar {
  background: var(--accent-primary);
  color: white;
  font-size: 14px;
  font-weight: 600;
}

.message-content {
  flex: 1;
}

.message-bubble {
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  line-height: 1.6;
}

.message.user .message-bubble {
  background: var(--accent-primary);
  color: white;
  border-bottom-right-radius: 4px;
}

.message.assistant .message-bubble {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.message-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  padding: 0 4px;
}

.message.user .message-time {
  text-align: right;
}

/* =============================================
   Input Area
   ============================================= */
.input-area {
  padding: 20px 24px;
  background: var(--bg-primary);
  border-top: 1px solid var(--border);
}

.input-container {
  display: flex;
  gap: 12px;
  max-width: 800px;
  margin: 0 auto;
}

#message-input {
  flex: 1;
  padding: 14px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
}

#message-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* =============================================
   Modals
   ============================================= */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-large {
  max-width: 700px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 18px;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

/* =============================================
   Upload Modal
   ============================================= */
.upload-step h3 {
  font-size: 18px;
  margin-bottom: 16px;
  text-align: center;
}

.step-desc {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 20px;
}

.upload-type-buttons {
  display: flex;
  gap: 16px;
}

.upload-type-btn {
  flex: 1;
  padding: 24px;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.upload-type-btn:hover {
  border-color: var(--accent-primary);
  background: var(--accent-light);
}

.upload-type-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 8px;
}

.upload-type-label {
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.upload-type-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-secondary);
}

.upload-area:hover,
.upload-area.dragover {
  border-color: var(--accent-primary);
  background: var(--accent-light);
}

.upload-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.upload-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
}

.upload-link {
  color: var(--accent-primary);
  cursor: pointer;
  text-decoration: underline;
  position: relative;
  z-index: 10;
}

.file-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--success-light);
  border-radius: var(--radius-sm);
  margin-top: 16px;
}

#file-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--success);
}

#column-mappings {
  margin-bottom: 20px;
}

.mapping-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.mapping-label {
  width: 120px;
  font-size: 13px;
  font-weight: 500;
}

.mapping-label.required::after {
  content: " *";
  color: var(--danger);
}

.mapping-select {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.success-state {
  text-align: center;
  padding: 24px;
}

.success-icon {
  font-size: 64px;
  display: block;
  margin-bottom: 16px;
}

.success-state h3 {
  margin-bottom: 8px;
}

.success-state p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* =============================================
   Settings Modal
   ============================================= */
.settings-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.settings-tab {
  padding: 8px 16px;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.settings-tab:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.settings-tab.active {
  background: var(--accent-light);
  color: var(--accent-primary);
}

.settings-panel {
  animation: fadeIn 0.2s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
}

.data-source-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}

.data-source-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.data-source-icon {
  font-size: 24px;
}

.data-source-info h4 {
  font-size: 14px;
  margin-bottom: 2px;
}

.data-source-info p {
  font-size: 12px;
  color: var(--text-muted);
}

/* =============================================
   Integrations Tab Styles
   ============================================= */
.settings-panel-intro {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.integration-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  overflow: hidden;
}

.integration-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.integration-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.integration-icon {
  font-size: 1.5rem;
}

.integration-title h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.integration-title p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.integration-body {
  padding: 20px;
}

.integration-body .form-group {
  margin-bottom: 16px;
}

.integration-body .form-group:last-child {
  margin-bottom: 0;
}

.integration-actions {
  margin-top: 24px;
  text-align: center;
}

.integration-actions .btn {
  min-width: 220px;
}

.success-text {
  color: var(--success);
  margin-top: 12px;
  font-size: 0.9rem;
}

/* =============================================
   ReceiptAI Not Connected Screen
   ============================================= */
#receiptai-tab {
  flex-direction: column;
}

.receiptai-not-connected {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  background: var(--bg-secondary);
  padding: 40px;
}

.receiptai-not-connected.hidden {
  display: none !important;
}

.not-connected-content {
  text-align: center;
  max-width: 400px;
}

.not-connected-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.not-connected-content h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.not-connected-content p {
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.6;
}

.not-connected-status {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 24px;
}

.connection-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
}

.connection-icon {
  font-size: 1.25rem;
}

.connection-icon.connected {
  color: var(--success);
}

/* =============================================
   Loading State
   ============================================= */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }
  
  .auth-container {
    padding: 24px;
    margin: 16px;
  }
  
  .upload-type-buttons {
    flex-direction: column;
  }
  
  .form-row {
    flex-direction: column;
  }
}

/* =============================================
   Message Action Buttons
   ============================================= */
.message-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.msg-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.msg-action-btn:hover {
  background: var(--accent-light);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* Legacy save-insight-btn - keeping for backwards compatibility */
.save-insight-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  margin-top: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.save-insight-btn:hover {
  background: var(--accent-light);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.save-insight-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.save-insight-btn.saved {
  background: var(--success-light);
  border-color: var(--success);
  color: var(--success);
}

/* =============================================
   Toast Animations
   ============================================= */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* =============================================
   Small Modal & Form Select
   ============================================= */
.modal-sm {
  max-width: 400px;
}

.form-select {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  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;
}

.form-select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.form-select option {
  padding: 8px;
}

/* =============================================
   Tab Navigation
   ============================================= */
.main-tabs {
  display: flex;
  gap: 4px;
  margin-left: 24px;
}

.tab-btn {
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--accent-light);
  color: var(--accent-primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: flex;
  flex: 1;
  overflow: hidden;
  height: 100%;
}

/* Home Dashboard */
#home-tab.active {
  display: block;
  overflow-y: auto;
  padding: 0;
}

.home-dashboard {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
}

.home-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.home-greeting h1 {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.home-store-name {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

.home-streak {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
  padding: 0.75rem 1.25rem;
  border-radius: 50px;
  border: 1px solid #FFB74D;
}

.streak-flame {
  font-size: 1.25rem;
}

.streak-count {
  font-size: 1.25rem;
  font-weight: 700;
  color: #E65100;
}

.streak-label {
  font-size: 0.85rem;
  color: #F57C00;
}

.home-section {
  margin-bottom: 2rem;
}

.home-section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

/* Data Health Grid */
.data-health-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.health-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  transition: all 0.2s;
}

.health-card:hover {
  border-color: var(--accent-primary);
}

.health-icon {
  font-size: 1.1rem;
}

.health-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.health-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.health-status {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
}

.health-status.fresh {
  color: var(--success);
}

.health-status.stale {
  color: #F57C00;
}

.health-status.missing {
  color: var(--error);
}

.health-badge {
  font-size: 1rem;
}

/* Money Moves Grid */
.money-moves-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.money-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  transition: all 0.2s;
}

.money-card:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.money-card.warning {
  border-color: #FFB74D;
  background: linear-gradient(180deg, #FFF8E1 0%, #FFFFFF 100%);
}

.money-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.money-card-icon {
  font-size: 1.25rem;
}

.money-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.money-card-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.money-card-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  flex: 1;
}

.money-card-btn {
  background: var(--accent-primary);
  color: white;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.money-card-btn:hover {
  background: var(--accent-secondary);
  transform: translateY(-1px);
}

.money-card.warning .money-card-btn {
  background: #F57C00;
}

.money-card.warning .money-card-btn:hover {
  background: #E65100;
}

/* Activity Tracker */
.activity-tracker {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
}

/* Quick Insights & Top Brands Row */
.insights-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.insights-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
}

.insights-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.insights-period {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted);
}

/* Quick Insights List */
.insights-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.insight-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: #F8F9FA;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.4;
}

.insight-item.loading {
  opacity: 0.6;
}

.insight-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.insight-text {
  color: var(--text-secondary);
}

.insight-text strong {
  color: var(--text-primary);
}

.insight-item.alert {
  background: #FFF3E0;
  border: 1px solid #FFE0B2;
}

.insight-item.success {
  background: #E8F5E9;
  border: 1px solid #C8E6C9;
}

/* Top Brands Leaderboard */
.brands-leaderboard {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: #F8F9FA;
  border-radius: 8px;
  font-size: 0.85rem;
}

.brand-row.loading {
  opacity: 0.6;
}

.brand-row:first-child {
  background: linear-gradient(135deg, #FFF8E1, #FFECB3);
  border: 1px solid #FFD54F;
}

.brand-rank {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--text-muted);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.brand-row:first-child .brand-rank {
  background: #FFC107;
  color: #5D4037;
}

.brand-row:nth-child(2) .brand-rank {
  background: #90A4AE;
}

.brand-row:nth-child(3) .brand-rank {
  background: #A1887F;
}

.brand-name {
  flex: 1;
  font-weight: 500;
  color: var(--text-primary);
}

.brand-value {
  font-weight: 600;
  color: var(--text-primary);
}

.brand-badge {
  font-size: 0.9rem;
  margin-left: 0.25rem;
}

@media (max-width: 768px) {
  .insights-row {
    grid-template-columns: 1fr;
  }
}

.activity-month {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.activity-grid {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.activity-day {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: #E8E8E8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: var(--text-muted);
  position: relative;
  cursor: default;
}

.activity-day.active {
  background: var(--accent-primary);
  color: white;
}

.activity-day.today {
  box-shadow: 0 0 0 2px var(--accent-primary);
}

.activity-day.future {
  background: #F5F5F5;
  color: #CCC;
}

.activity-legend {
  display: flex;
  gap: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-item .dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: #E8E8E8;
}

.legend-item .dot.active {
  background: var(--accent-primary);
}

/* Onboarding Section */
.home-onboarding {
  background: linear-gradient(135deg, #E8F5E9, #F1F8E9);
  border: 2px dashed var(--accent-primary);
  border-radius: 16px;
  padding: 2.5rem;
  text-align: center;
  margin-top: 1rem;
}

.onboarding-content h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.onboarding-content > p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.onboarding-steps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 400px;
  margin: 0 auto 2rem;
  text-align: left;
}

.onboarding-step {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: white;
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.onboarding-step.complete {
  border-color: var(--success);
  background: #F1F8E9;
}

.step-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
}

.onboarding-step.complete .step-number {
  background: var(--success);
}

.step-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.step-title {
  font-weight: 500;
  color: var(--text-primary);
}

.step-status {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.step-check {
  font-size: 1.25rem;
  color: var(--text-muted);
}

.onboarding-step.complete .step-check {
  color: var(--success);
}

/* Step Help Toggle & Content */
.step-help-toggle {
  font-size: 0.85rem;
  color: var(--accent-primary);
  text-decoration: none;
  margin-left: 2.5rem;
  cursor: pointer;
}

.step-help-toggle:hover {
  text-decoration: underline;
}

.step-help-toggle.open {
  color: var(--text-secondary);
}

.step-help {
  margin-left: 2.5rem;
  margin-top: 0.75rem;
  padding: 1rem;
  background: #F8F9FA;
  border-radius: 8px;
  text-align: left;
}

.help-section {
  margin-bottom: 1rem;
}

.help-section:last-child {
  margin-bottom: 0;
}

.help-section strong {
  display: block;
  font-size: 0.85rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.help-section ul {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.help-section li {
  margin-bottom: 0.25rem;
}

.help-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.5rem;
}

/* POS Buttons */
.pos-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.pos-btn {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.pos-btn:hover {
  border-color: var(--accent-primary);
  background: #F0F7F4;
}

.pos-btn.active {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

/* POS Instructions */
.pos-instructions {
  margin-top: 1rem;
  padding: 1rem;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.85rem;
}

.pos-instructions h4 {
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pos-instructions ol {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text-secondary);
}

.pos-instructions li {
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.pos-instructions .tip {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: #FFF8E1;
  border-radius: 6px;
  font-size: 0.8rem;
  color: #F57C00;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .home-dashboard {
    padding: 1rem;
  }

  .home-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .data-health-grid,
  .money-moves-grid,
  .month-stats-grid {
    grid-template-columns: 1fr;
  }

  .home-streak {
    align-self: flex-start;
  }
}

/* ReceiptAI tab needs column layout */
#receiptai-tab.active {
  flex-direction: column;
}

/* ReviewAI and RetargetAI tabs need scrolling */
#reviews-tab.active,
#retarget-tab.active {
  overflow-y: auto;
  justify-content: center;
}

/* ReviewAI/RetargetAI outreach dashboard styling */
.outreach-dashboard {
  padding: 24px;
  max-width: 700px;
  margin: 0 auto;
}

/* =============================================
   StoreIQ Dashboard
   ============================================= */
.storeiq-container {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  background: var(--bg-secondary);
}

.storeiq-header {
  margin-bottom: 24px;
}

.storeiq-header h2 {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.storeiq-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Dashboard Cards */
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.dash-card {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.dash-card-icon {
  font-size: 32px;
}

.dash-card-content {
  display: flex;
  flex-direction: column;
}

.dash-card-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.dash-card-label {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ========================================
   STORE HEALTH SNAPSHOT
   ======================================== */

.health-snapshot {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.health-card {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border-left: 4px solid var(--accent-primary);
  transition: transform 0.15s, box-shadow 0.15s;
}

.health-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.health-card.risk {
  border-left-color: #e74c3c;
  background: linear-gradient(135deg, #fff 0%, #fef5f5 100%);
}

.health-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.health-icon {
  font-size: 24px;
}

.health-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.health-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}

.health-status {
  display: flex;
  align-items: center;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
}

.status-badge.healthy {
  background: #d4edda;
  color: #155724;
}

.status-badge.warning {
  background: #fff3cd;
  color: #856404;
}

.status-badge.critical {
  background: #f8d7da;
  color: #721c24;
}

.health-context {
  font-size: 13px;
  color: var(--text-secondary);
}

.context-period {
  color: var(--text-muted);
}

.context-detail {
  color: var(--text-secondary);
}

.health-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.health-indicator.healthy {
  color: #28a745;
}

.health-indicator.warning {
  color: #d68910;
}

.health-indicator.critical {
  color: #e74c3c;
}

.health-action {
  margin-top: auto;
  padding-top: 8px;
}

.btn-health-action {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--accent-primary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
  text-align: center;
}

.btn-health-action:hover {
  background: var(--accent-light);
  border-color: var(--accent-primary);
}

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

@media (max-width: 600px) {
  .health-snapshot {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   BRAND PERFORMANCE QUADRANT
   ======================================== */

.quadrant-panel {
  min-height: 400px;
}

.panel-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin: -8px 0 16px 0;
}

.quadrant-container {
  position: relative;
  width: 100%;
  height: 320px;
}

.quadrant-grid {
  position: relative;
  width: 100%;
  height: 100%;
  background: 
    linear-gradient(to right, transparent 50%, transparent 50%),
    linear-gradient(to bottom, transparent 50%, transparent 50%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}

.quadrant-grid::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border-light);
}

.quadrant-grid::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border-light);
}

.quadrant-label {
  position: absolute;
  font-size: 11px;
  color: var(--text-muted);
  padding: 8px;
  text-align: center;
  pointer-events: none;
}

.quadrant-label small {
  display: block;
  font-size: 10px;
  opacity: 0.7;
}

.quadrant-label.top-left { top: 4px; left: 4px; }
.quadrant-label.top-right { top: 4px; right: 4px; }
.quadrant-label.bottom-left { bottom: 4px; left: 4px; }
.quadrant-label.bottom-right { bottom: 4px; right: 4px; }

.quadrant-axis-x {
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--text-muted);
}

.quadrant-axis-y {
  position: absolute;
  left: -20px;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.quadrant-dot {
  position: absolute;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  transition: transform 0.15s, box-shadow 0.15s;
  z-index: 1;
}

.quadrant-dot:hover {
  transform: translate(-50%, -50%) scale(1.2);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 10;
}

.quadrant-dot.cash-cow {
  background: #28a745;
  border: 2px solid #1e7e34;
}

.quadrant-dot.bleeder {
  background: #dc3545;
  border: 2px solid #bd2130;
}

.quadrant-dot.profit-driver {
  background: #ffc107;
  border: 2px solid #d39e00;
}

.quadrant-dot.volume-driver {
  background: #17a2b8;
  border: 2px solid #117a8b;
}

.dot-label {
  font-size: 8px;
  font-weight: 600;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90%;
}

.quadrant-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 32px;
  justify-content: center;
}

.quadrant-legend .legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.quadrant-legend .legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.legend-dot.cash-cow { background: #28a745; }
.legend-dot.bleeder { background: #dc3545; }
.legend-dot.profit-driver { background: #ffc107; }
.legend-dot.volume-driver { background: #17a2b8; }

/* ========================================
   BRAND DECISIONS LIST
   ======================================== */

.brand-decisions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
}

.brand-decision-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
  border-left: 3px solid transparent;
}

.brand-decision-row:hover {
  background: var(--bg-tertiary);
}

.brand-decision-row.pause {
  border-left-color: #dc3545;
}

.brand-decision-row.watch {
  border-left-color: #ffc107;
}

.brand-decision-row.buy-more {
  border-left-color: #28a745;
}

.brand-decision-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-decision-info .brand-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

.brand-decision-info .brand-reason {
  font-size: 12px;
  color: var(--text-muted);
}

.action-badge {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.action-badge.pause {
  background: #f8d7da;
  color: #721c24;
}

.action-badge.watch {
  background: #fff3cd;
  color: #856404;
}

.action-badge.buy-more {
  background: #d4edda;
  color: #155724;
}

/* ========================================
   TURN RATE CHART
   ======================================== */

.turn-track {
  position: relative;
}

.turn-track .target-line {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: var(--text-muted);
  z-index: 2;
}

.turn-track .target-line::after {
  content: '4x';
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: var(--text-muted);
}

.bar-fill.turn-healthy {
  background: linear-gradient(90deg, #28a745, #20c997);
}

.bar-fill.turn-warning {
  background: linear-gradient(90deg, #ffc107, #fd7e14);
}

.bar-fill.turn-critical {
  background: linear-gradient(90deg, #dc3545, #e83e8c);
}

/* ========================================
   TOGGLE BUTTONS
   ======================================== */

.panel-header-with-toggle {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.panel-header-with-toggle h3 {
  margin-bottom: 0;
}

.panel-header-with-toggle .panel-subtitle {
  margin: 4px 0 0 0;
}

.toggle-buttons {
  display: flex;
  gap: 4px;
  background: var(--bg-secondary);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.toggle-btn {
  padding: 6px 12px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s;
}

.toggle-btn:hover {
  background: var(--bg-tertiary);
}

.toggle-btn.active {
  background: var(--bg-primary);
  color: var(--accent-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ========================================
   CASH RELEASE GAUGE
   ======================================== */

.cash-release-panel {
  min-height: 280px;
}

.cash-release-container {
  padding: 8px 0;
}

.cash-gauge {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.gauge-visual {
  padding: 0 8px;
}

.gauge-track {
  position: relative;
  height: 24px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.gauge-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

.gauge-fill.total {
  background: linear-gradient(90deg, #ffc107, #fd7e14);
  z-index: 1;
}

.gauge-fill.critical {
  background: linear-gradient(90deg, #dc3545, #c0392b);
  z-index: 2;
}

.gauge-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.cash-opportunities {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.opportunity-card {
  padding: 16px;
  border-radius: var(--radius-sm);
  text-align: center;
}

.opportunity-card.primary {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  border: 1px solid #28a745;
}

.opportunity-card.urgent {
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  border: 1px solid #dc3545;
}

.opportunity-amount {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}

.opportunity-card.primary .opportunity-amount {
  color: #155724;
}

.opportunity-card.urgent .opportunity-amount {
  color: #721c24;
}

.opportunity-label {
  font-size: 13px;
  font-weight: 600;
  margin-top: 4px;
  color: var(--text-secondary);
}

.opportunity-detail {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.btn-cash-action {
  width: 100%;
  padding: 12px 16px;
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-cash-action:hover {
  background: var(--accent-dark);
}

/* ========================================
   RECENT ACTIVITY / WHAT'S HAPPENING
   ======================================== */

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  border-left: 3px solid transparent;
}

.activity-item:hover {
  background: var(--bg-tertiary);
  transform: translateX(4px);
}

.activity-item.hot {
  border-left-color: #28a745;
}

.activity-item.warning {
  border-left-color: #ffc107;
}

.activity-item.alert {
  border-left-color: #dc3545;
}

.activity-item.restock {
  border-left-color: #17a2b8;
}

.activity-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-message {
  font-size: 14px;
  color: var(--text-primary);
}

.activity-message strong {
  font-weight: 600;
}

.activity-detail {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.activity-arrow {
  color: var(--text-muted);
  font-size: 14px;
  flex-shrink: 0;
}

/* ========================================
   SIZE RISK SUMMARY
   ======================================== */

.size-risk-summary {
  margin-bottom: 16px;
}

.size-risk-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
}

.size-risk-badge.healthy {
  background: #d4edda;
  color: #155724;
}

.size-risk-alerts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.size-risk-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  border-left: 3px solid transparent;
}

.size-risk-alert:hover {
  background: var(--bg-tertiary);
  transform: translateX(4px);
}

.size-risk-alert.warning {
  border-left-color: #ffc107;
  background: linear-gradient(90deg, #fff9e6 0%, var(--bg-secondary) 30%);
}

.size-risk-alert.opportunity {
  border-left-color: #28a745;
  background: linear-gradient(90deg, #e8f5e9 0%, var(--bg-secondary) 30%);
}

.size-risk-alert .alert-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.size-risk-alert .alert-content {
  flex: 1;
  min-width: 0;
}

.size-risk-alert .alert-message {
  font-size: 13px;
  color: var(--text-primary);
}

.size-risk-alert .alert-detail {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.size-risk-alert .alert-arrow {
  color: var(--text-muted);
  font-size: 14px;
  flex-shrink: 0;
}

/* ========================================
   CHAT PROMPT SECTION
   ======================================== */

.chat-prompt-panel {
  background: linear-gradient(135deg, var(--bg-primary) 0%, #f8f4ff 100%);
  border: 1px solid var(--accent-light);
}

.chat-prompt-content {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.chat-prompt-icon {
  font-size: 40px;
  flex-shrink: 0;
}

.chat-prompt-text h3 {
  margin: 0 0 4px 0;
  color: var(--text-primary);
}

.chat-prompt-text p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.chat-prompt-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.suggestion-btn {
  padding: 10px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s;
}

.suggestion-btn:hover {
  background: var(--accent-light);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* ========================================
   SMART CONTEXTUAL PROMPTS
   ======================================== */

.smart-prompts {
  margin: 24px 0;
  padding: 20px;
  background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.smart-prompts-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.smart-prompts-icon {
  font-size: 20px;
}

.smart-prompts-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.smart-prompts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.smart-prompt-btn {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  border-left: 4px solid var(--border-light);
}

.smart-prompt-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-primary);
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.smart-prompt-btn.urgent {
  border-left-color: #dc3545;
  background: linear-gradient(90deg, #fff5f5 0%, var(--bg-primary) 20%);
}

.smart-prompt-btn.warning {
  border-left-color: #ffc107;
  background: linear-gradient(90deg, #fffbeb 0%, var(--bg-primary) 20%);
}

.smart-prompt-btn.opportunity {
  border-left-color: #28a745;
  background: linear-gradient(90deg, #f0fff4 0%, var(--bg-primary) 20%);
}

.smart-prompt-btn.info {
  border-left-color: #17a2b8;
  background: linear-gradient(90deg, #f0f9ff 0%, var(--bg-primary) 20%);
}

.smart-prompt-btn .prompt-icon {
  font-size: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}

.smart-prompt-btn .prompt-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.smart-prompt-btn .prompt-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.smart-prompt-btn .prompt-question {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
}

.smart-prompt-btn .prompt-reason {
  font-size: 12px;
  color: var(--text-muted);
}

/* Hide smart prompts when there are messages */
.messages:not(:has(.welcome-message)) .smart-prompts {
  display: none;
}

@media (max-width: 768px) {
  .smart-prompts {
    padding: 16px;
  }
  
  .smart-prompt-btn {
    padding: 12px;
  }
  
  .smart-prompt-btn .prompt-icon {
    font-size: 20px;
  }
}

/* Dashboard Rows */
.dashboard-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.dashboard-row.full-width {
  grid-template-columns: 1fr;
}

/* Dashboard Panels */
.dash-panel {
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.dash-panel h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

/* Bar Charts */
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bar-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bar-label {
  width: 120px;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-track {
  flex: 1;
  height: 24px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--accent-primary);
  border-radius: var(--radius-sm);
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
}

.bar-fill span {
  font-size: 11px;
  font-weight: 600;
  color: white;
}

.bar-value {
  width: 70px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
}

/* Horizontal bar chart for sizes */
.bar-chart.horizontal .bar-item {
  flex-direction: row;
}

.bar-chart.horizontal .bar-label {
  width: 50px;
}

/* Velocity List */
.velocity-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.velocity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

.velocity-brand {
  font-weight: 600;
  color: var(--text-primary);
}

.velocity-days {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--accent-primary);
  font-weight: 600;
}

.velocity-revenue {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Stale indicator colors */
.bar-fill.stale {
  background: var(--warning);
}

.bar-fill.warning {
  background: #F59E0B;
}

.bar-fill.danger {
  background: var(--error);
}

/* =============================================
   Size Comparison Chart
   ============================================= */
.size-legend {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.legend-dot.sold {
  background: var(--accent-primary);
}

.legend-dot.inventory {
  background: #94A3B8;
}

.size-comparison-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.size-comparison-item.understocked {
  background: rgba(34, 197, 94, 0.08);
}

.size-comparison-item.overstocked {
  background: rgba(239, 68, 68, 0.08);
}

.comparison-bars {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.comparison-bar-track {
  height: 10px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
}

.comparison-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.comparison-bar.sold {
  background: var(--accent-primary);
}

.comparison-bar.inventory {
  background: #94A3B8;
}

.comparison-values {
  display: flex;
  gap: 8px;
  min-width: 100px;
  font-size: 12px;
  font-weight: 600;
}

.sold-value {
  color: var(--accent-primary);
}

.inventory-value {
  color: #64748B;
}

.status-icon {
  font-size: 14px;
}

/* =============================================
   Stale Inventory Tiers
   ============================================= */
.stale-tiers {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.stale-tier {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.stale-tier.critical {
  background: rgba(239, 68, 68, 0.1);
  color: #DC2626;
}

.stale-tier.monitor {
  background: rgba(245, 158, 11, 0.1);
  color: #D97706;
}

.stale-tier.low {
  background: rgba(107, 114, 128, 0.1);
  color: #6B7280;
}

.tier-icon {
  font-size: 16px;
}

.tier-label {
  font-weight: 500;
}

.tier-value {
  font-weight: 700;
}

/* =============================================
   Clickable Dashboard Elements
   ============================================= */
.clickable {
  cursor: pointer;
  transition: all 0.2s;
}

.clickable:hover {
  transform: translateX(4px);
  background: var(--accent-light);
}

.bar-item.clickable:hover {
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  margin: -4px -8px;
  padding: 4px 8px;
}

.stale-tier.clickable:hover {
  transform: scale(1.02);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.velocity-item.clickable:hover {
  background: var(--accent-light);
}

.size-comparison-item.clickable:hover {
  background: var(--accent-light);
}

/* =============================================
   Module Placeholder Styles
   ============================================= */
.module-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.placeholder-icon {
  font-size: 4rem;
  margin-bottom: 20px;
}

.module-placeholder h2 {
  font-family: var(--font-serif);
  font-size: 2rem;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.module-placeholder > p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 30px;
}

.placeholder-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-bottom: 30px;
}

.placeholder-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  text-align: left;
}

.placeholder-feature .feature-icon {
  font-size: 1.2rem;
}

.placeholder-status {
  color: var(--text-tertiary);
  font-size: 0.9rem;
  padding: 8px 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
}

/* =============================================
   Color Picker
   ============================================= */
.color-picker-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.color-swatch {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 3px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.color-swatch:hover {
  transform: scale(1.1);
}

.color-swatch.selected {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 2px white, 0 0 0 4px var(--text-primary);
}

/* =============================================
   ReceiptAI Styles
   ============================================= */

/* Setup Screen */
.receiptai-setup {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex: 1;
  padding: 40px 20px;
  overflow-y: auto;
  background: var(--bg-secondary);
}

.setup-container {
  max-width: 800px;
  width: 100%;
}

.setup-header {
  text-align: center;
  margin-bottom: 24px;
}

.setup-icon {
  display: none;
}

.setup-header h2 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  margin-bottom: 8px;
}

.setup-header p {
  color: var(--text-secondary);
}

.setup-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.setup-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
}

.setup-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.setup-card-icon {
  font-size: 1.5rem;
}

.setup-card-header h3 {
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
}

.status-badge {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-weight: 500;
}

.status-badge.connected {
  background: var(--success-light);
  color: var(--success);
}

.status-badge.disconnected {
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.setup-card-body {
  padding: 20px;
}

.setup-card-body .form-group {
  margin-bottom: 16px;
}

.setup-card-body .form-group:last-child {
  margin-bottom: 0;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

.setup-actions {
  text-align: center;
}

.setup-actions .btn {
  min-width: 200px;
}

.error-text {
  color: var(--danger);
  margin-top: 12px;
  font-size: 0.9rem;
}

/* Main ReceiptAI Interface */
.receiptai-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  height: 100%;
}

.receiptai-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.receiptai-header h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.receiptai-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.receiptai-header-right {
  display: flex;
  gap: 12px;
  align-items: center;
}

.receiptai-header-right .form-select {
  width: auto;
}

.receiptai-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* Receipt List Panel */
.receipt-list-panel {
  width: 380px;
  min-width: 380px;
  border-right: 1px solid var(--border);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.receipt-list-panel h3 {
  padding: 16px 20px;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.receipt-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.receipt-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
  margin-bottom: 4px;
}

.receipt-card:hover {
  background: var(--bg-secondary);
}

.receipt-card.active {
  background: var(--accent-light);
  border-left: 3px solid var(--accent-primary);
}

.receipt-card-content {
  flex: 1;
  cursor: pointer;
}

.receipt-card-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 75px;
}

.skip-placeholder {
  height: 28px; /* Match button height to keep alignment */
}

.receipt-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.receipt-number {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.receipt-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.receipt-vendor {
  font-weight: 600;
  font-size: 0.95rem;
}

.receipt-meta {
  display: flex;
  gap: 12px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.receipt-status-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 500;
}

.receipt-status-badge.new {
  background: var(--accent-light);
  color: var(--accent-primary);
}

.receipt-status-badge.in_progress {
  background: var(--warning-light);
  color: var(--warning);
}

.receipt-status-badge.complete {
  background: var(--success-light);
  color: var(--success);
}

/* Item Processing Panel */
.item-process-panel {
  flex: 1;
  overflow-y: auto;
  background: var(--bg-secondary);
  padding: 32px 40px;
}

.item-generator {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  max-width: 1000px;
}

.receipt-items-list {
  display: grid;
  gap: 12px;
  max-width: 1000px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.loading-state {
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
}

/* Receipt Items View */
.receipt-items-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.receipt-items-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.receipt-items-header h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #0d9f4f;
}

.vendor-badge {
  background: var(--bg-card);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* receipt-items-list defined above in item-process-panel section */

.item-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid var(--border);
}

.item-card:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
}

.item-card.processed {
  opacity: 0.6;
}

.item-card-info {
  flex: 1;
  cursor: pointer;
}

.item-card-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.item-card-meta {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.item-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.item-status-icon {
  font-size: 1.25rem;
}

.grid-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  background: var(--accent-light);
  color: var(--accent-primary);
  border-radius: var(--radius-full);
}

.item-card.is-grid {
  border-left: 3px solid var(--accent-primary);
}

/* Small skip button on item cards */
.btn-skip-small {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-skip-small:hover {
  background: var(--bg-secondary);
  border-color: var(--text-muted);
}

/* Item Generator - main rule above */
.generator-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.generator-header .btn-link {
  font-size: 0.85rem;
  margin-bottom: 8px;
  display: inline-block;
}

.generator-header h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
}

.generator-body {
  padding: 20px;
}

.generator-section {
  margin-bottom: 24px;
}

.generator-section h4 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.item-details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-value {
  font-weight: 500;
}

/* Generator textarea */
#gen-custom-notes {
  width: 100%;
  min-height: 100px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  background: var(--bg-card);
}

#gen-custom-notes:focus {
  outline: none;
  border-color: var(--accent-primary);
}

/* Image Upload */
.image-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 32px;
  text-align: center;
  transition: all 0.2s;
}

.image-upload-area:hover,
.image-upload-area.dragover {
  border-color: var(--accent-primary);
  background: var(--accent-light);
}

.upload-prompt .upload-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  display: block;
}

.upload-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.image-preview {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.preview-image {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: grab;
  transition: transform 0.15s, opacity 0.15s;
}

.preview-image:hover {
  transform: scale(1.02);
}

.preview-image.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.preview-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.preview-image .drag-hint {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.5);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  opacity: 0;
  transition: opacity 0.2s;
}

.preview-image:hover .drag-hint {
  opacity: 1;
}

.preview-image .remove-image {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Generated Content */
.generated-content {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.gen-output-field {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
}

.gen-output-field:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.char-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 4px;
}

.generator-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.generator-actions .btn {
  flex: 1;
  min-width: 150px;
}

.btn-lg {
  padding: 14px 24px;
  font-size: 1rem;
}

.publish-status {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.publish-status.success {
  background: var(--success-light);
  color: var(--success);
}

.publish-status.error {
  background: var(--danger-light);
  color: var(--danger);
}

.publish-status a {
  color: inherit;
  text-decoration: underline;
}

.publish-actions {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(0,0,0,0.1);
}

.publish-actions .btn {
  flex: 1;
}

/* No data state */
.no-data-message {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

.no-data-message p {
  margin-bottom: 16px;
}

/* Responsive */
@media (max-width: 768px) {
  .dashboard-row {
    grid-template-columns: 1fr;
  }
  
  .dashboard-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .main-tabs {
    margin-left: 12px;
  }
  
  .tab-btn {
    padding: 6px 12px;
    font-size: 13px;
  }
}

/* =============================================
   Pro Feature Styles
   ============================================= */

.pro-badge {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: #1a1a1a;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pro-badge-sm {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: #1a1a1a;
  font-size: 8px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-left: 4px;
  vertical-align: middle;
}

.pro-status-item {
  border-top: 1px dashed rgba(255, 215, 0, 0.3);
  padding-top: 8px;
  margin-top: 4px;
}

.pro-data-source {
  border: 1px solid rgba(255, 215, 0, 0.3);
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.05) 0%, rgba(255, 165, 0, 0.05) 100%);
}

.pro-panel {
  position: relative;
  border: 1px solid rgba(255, 215, 0, 0.2);
}

.pro-panel .panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.pro-panel .panel-header h3 {
  margin-bottom: 0;
}

.upload-type-btn.pro-feature {
  position: relative;
  border-color: var(--accent-primary);
}

.upload-type-btn .pro-badge {
  position: absolute;
  top: 8px;
  right: 8px;
}

/* Customer Health Panel */
#customer-health-content .health-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

#customer-health-content .health-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}

#customer-health-content .health-card.warning {
  background: #fff8e6;
  border: 1px solid #ffd700;
}

#customer-health-content .health-card.danger {
  background: #fef2f2;
  border: 1px solid #ef4444;
}

#customer-health-content .health-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

#customer-health-content .health-label {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Customer Segments Panel */
#customer-segments-content .segment-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#customer-segments-content .segment-row {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

#customer-segments-content .segment-row:hover {
  background: var(--bg-secondary);
}

#customer-segments-content .segment-label {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 110px;
  flex-shrink: 0;
}

#customer-segments-content .segment-icon {
  font-size: 14px;
}

#customer-segments-content .segment-name {
  font-size: 13px;
  font-weight: 500;
}

#customer-segments-content .segment-bar-track {
  flex: 1;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
}

#customer-segments-content .segment-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

#customer-segments-content .segment-count {
  font-size: 13px;
  font-weight: 600;
  width: 32px;
  text-align: right;
}

/* No Data State */
.no-data-state {
  text-align: center;
  padding: 20px;
  color: var(--text-secondary);
}

.no-data-state p {
  margin-bottom: 12px;
  font-size: 14px;
}

/* Action Button in Panels */
.action-btn {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--accent-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.action-btn:hover {
  background: var(--accent-primary);
  color: white;
}

/* =============================================
   Decision Buckets (Brand Performance)
   ============================================= */

.decision-buckets-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.decision-bucket {
  padding: 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.decision-bucket:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.decision-bucket.buy-more {
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  border-color: #4CAF50;
}

.decision-bucket.buy-more:hover {
  border-color: #2E7D32;
}

.decision-bucket.markdown {
  background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
  border-color: #FFC107;
}

.decision-bucket.markdown:hover {
  border-color: #FF8F00;
}

.decision-bucket.negotiate {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  border-color: #2196F3;
}

.decision-bucket.negotiate:hover {
  border-color: #1565C0;
}

.decision-bucket.drop-pause {
  background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
  border-color: #f44336;
}

.decision-bucket.drop-pause:hover {
  border-color: #c62828;
}

.bucket-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.bucket-icon {
  font-size: 20px;
}

.bucket-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.bucket-stats {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.bucket-count {
  font-size: 13px;
  color: var(--text-secondary);
}

.bucket-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.bucket-brands {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0,0,0,0.1);
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Quadrant Toggle */
.quadrant-toggle {
  margin-top: 8px;
  text-align: center;
}

.quadrant-toggle-btn {
  background: none;
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.quadrant-toggle-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

#quadrant-toggle-icon {
  display: inline-block;
  transition: transform 0.2s;
}

.quadrant-detail.expanded #quadrant-toggle-icon,
.quadrant-toggle-btn.expanded #quadrant-toggle-icon {
  transform: rotate(90deg);
}

.quadrant-detail {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.quadrant-detail.hidden {
  display: none;
}

/* Updated Quadrant for plain-language labels */
.quadrant-axis-x {
  font-size: 11px !important;
  color: var(--text-muted) !important;
}

.quadrant-axis-y {
  font-size: 11px !important;
  color: var(--text-muted) !important;
}

/* =============================================
   Welcome Modal
   ============================================= */
.welcome-modal-content {
  max-width: 480px;
  text-align: center;
  margin: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.welcome-header {
  padding: 32px 24px 16px;
  background: linear-gradient(135deg, #2d5a47 0%, #234536 100%);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  color: white;
}

.welcome-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.welcome-header h2 {
  font-family: var(--font-serif);
  font-size: 24px;
  margin: 0 0 8px 0;
  color: white;
}

.welcome-subtitle {
  font-size: 14px;
  opacity: 0.9;
  margin: 0;
}

.welcome-tagline-sub {
  font-size: 16px;
  font-weight: 500;
  margin: 8px 0 0 0;
  color: #a8d5c5;
}

.welcome-steps {
  text-align: left;
  margin-bottom: 24px;
}

.welcome-step {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.welcome-step:last-child {
  margin-bottom: 0;
}

.step-number {
  width: 32px;
  height: 32px;
  background: var(--bg-tertiary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--accent-color);
  flex-shrink: 0;
}

.step-content h4 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 4px 0;
  color: var(--text-primary);
}

.step-content p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

.welcome-trial-notice {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

.trial-icon {
  font-size: 18px;
}

/* Account Tab Styles */
.settings-section {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.settings-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.settings-section h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.account-info-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--bg-tertiary);
}

.account-info-row:last-child {
  border-bottom: none;
}

.account-label {
  color: var(--text-muted);
  font-size: 14px;
}

.account-value {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 14px;
}

.danger-zone {
  background: #FDF2F2;
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid #FECACA;
}

.danger-zone h4 {
  color: #DC2626;
}

.danger-description {
  font-size: 13px;
  color: #7F1D1D;
  margin-bottom: 16px;
  line-height: 1.5;
}

.btn-danger {
  background: #DC2626;
  color: white;
  border: none;
}

.btn-danger:hover {
  background: #B91C1C;
}

/* Support Tab Styles */
.support-description {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
}

.welcome-actions {
  display: flex;
  gap: 12px;
}

.welcome-actions .btn {
  flex: 1;
}

/* =============================================
   Mobile Notice
   ============================================= */
.mobile-notice {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1001;
  padding: 12px 16px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
}

.mobile-notice-content {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 600px;
  margin: 0 auto;
}

.mobile-notice-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.mobile-notice-text {
  flex: 1;
  font-size: 13px;
  color: var(--text-secondary);
}

.mobile-notice-close {
  width: 28px;
  height: 28px;
  border: none;
  background: var(--bg-tertiary);
  border-radius: 50%;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mobile-notice-close:hover {
  background: var(--border);
  color: var(--text-primary);
}

/* Only show mobile notice on small screens */
@media (min-width: 769px) {
  .mobile-notice {
    display: none !important;
  }
}

/* =============================================
   Trial Expired Modal
   ============================================= */
.trial-expired-modal-content {
  max-width: 600px;
  text-align: center;
  margin: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.trial-expired-header {
  padding: 32px 24px 20px;
  background: linear-gradient(135deg, #C45D4A 0%, #A84832 100%);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  color: white;
}

.trial-expired-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.trial-expired-header h2 {
  font-family: var(--font-serif);
  font-size: 24px;
  margin: 0;
  color: white;
}

.trial-expired-message {
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.6;
}

.trial-expired-plans {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.plan-option {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  position: relative;
}

.plan-option.recommended {
  border-color: var(--accent-color);
  border-width: 2px;
  padding-top: 30px;
}

.plan-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #4A8B6E;
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 12px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.plan-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.plan-price {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.plan-price span {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
  text-align: left;
}

.plan-features li {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 0;
  padding-left: 20px;
  position: relative;
}

.plan-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent-color);
  font-weight: 600;
}

.plan-option .btn {
  width: 100%;
}

.trial-expired-note {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* ========================================
   OUTREACH DASHBOARD (ReviewAI / RetargetAI)
   ======================================== */

.outreach-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
}

.outreach-title h2 {
  font-size: 24px;
  margin: 0 0 4px 0;
  color: var(--text-primary);
}

.outreach-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

.outreach-stats {
  display: flex;
  gap: 24px;
}

.outreach-stat {
  text-align: center;
}

.outreach-stat .stat-value {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: var(--accent-color);
}

.outreach-stat .stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.outreach-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

.outreach-controls select {
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-primary);
  font-size: 14px;
}

/* Empty States */
.outreach-empty {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-secondary);
  border-radius: 12px;
  margin: 24px 0;
}

.outreach-empty .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.outreach-empty h3 {
  font-size: 20px;
  margin: 0 0 8px 0;
  color: var(--text-primary);
}

.outreach-empty p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

.outreach-empty .empty-hint {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Candidate Cards */
.outreach-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.outreach-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.outreach-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent-primary);
}

.outreach-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px 20px;
  background: var(--accent-light);
  border-bottom: 1px solid var(--border);
}

.customer-info h3 {
  font-size: 18px;
  margin: 0 0 4px 0;
  color: var(--text-primary);
}

.customer-contact {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

.customer-contact a {
  color: var(--accent-color);
  text-decoration: none;
}

.customer-contact a:hover {
  text-decoration: underline;
}

.customer-stats {
  text-align: right;
  font-size: 13px;
}

.customer-stats .stat-row {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  color: var(--text-secondary);
}

.customer-stats .stat-highlight {
  color: var(--accent-color);
  font-weight: 600;
}

.outreach-card-body {
  padding: 16px 20px;
}

.last-purchase {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
  margin-bottom: 16px;
}

.last-purchase-icon {
  font-size: 24px;
}

.last-purchase-details {
  flex: 1;
}

.last-purchase-item {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.last-purchase-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.message-preview {
  margin-bottom: 16px;
}

.message-preview label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.message-preview textarea {
  width: 100%;
  min-height: 80px;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  font-family: inherit;
}

.message-preview textarea:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.outreach-card-actions {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
}

.outreach-card-actions .btn {
  flex: 1;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-copy {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.btn-copy:hover {
  background: var(--accent-light);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.btn-sent {
  background: var(--accent-primary);
  border: 1px solid var(--accent-primary);
  color: white;
}

.btn-sent:hover {
  background: #234536;
  border-color: #234536;
}

.btn-skip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-skip:hover {
  background: #fee2e2;
  border-color: #ef4444;
  color: #ef4444;
}

.btn-never {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 13px;
  padding: 12px 8px;
  flex: 0.5;
}

.btn-never:hover {
  color: #ef4444;
  border-color: #fee2e2;
  background: #fee2e2;
}
}

/* Outreach Settings */
.outreach-settings {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: 8px;
  margin-top: 24px;
  font-size: 14px;
}

.outreach-settings label {
  color: var(--text-secondary);
  white-space: nowrap;
}

.outreach-settings input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
}

/* Top brands/categories pills */
.customer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.customer-tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--accent-light);
  color: var(--accent-color);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

/* Loading state */
.outreach-loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.outreach-loading .spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

/* Mobile responsive */
@media (max-width: 600px) {
  .outreach-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .outreach-stats {
    justify-content: space-around;
  }
  
  .outreach-card-header {
    flex-direction: column;
    gap: 12px;
  }
  
  .customer-stats {
    text-align: left;
  }
  
  .customer-stats .stat-row {
    justify-content: flex-start;
  }
  
  .outreach-card-actions {
    flex-wrap: wrap;
  }
  
  .outreach-card-actions .btn {
    flex: 1 1 45%;
  }
}
