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

:root {
  --primary:        #3D8B5F;
  --primary-h:      #2d7048;
  --primary-light:  #f0fdf4;
  --bg:             #F8FAFC;
  --card:           #FFFFFF;
  --border:         #E2E8F0;
  --text:           #1E293B;
  --text-muted:     #64748B;
  --success:        #22C55E;
  --warning:        #F59E0B;
  --danger:         #EF4444;
  --radius:         8px;
  --radius-lg:      12px;
  --shadow:         0 1px 3px rgba(0,0,0,0.10);
  --shadow-lg:      0 10px 25px rgba(0,0,0,0.10);
  --sidebar-w:      220px;
  --header-h:       56px;
}

html, body { height: 100%; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Auth screens ──────────────────────────────────────────────────────────── */
#auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.auth-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}
.auth-logo {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.auth-subtitle { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 28px; }
.auth-tabs { display: flex; gap: 0; margin-bottom: 24px; border-bottom: 2px solid var(--border); }
.auth-tab {
  flex: 1; text-align: center; padding: 8px; cursor: pointer;
  font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: color .15s, border-color .15s;
}
.auth-tab.active { color: var(--primary); border-color: var(--primary); }

/* ── Layout ────────────────────────────────────────────────────────────────── */
#app { display: none; height: 100vh; flex-direction: column; }
#app.visible { display: flex; }

.app-header {
  height: var(--header-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  position: sticky; top: 0; z-index: 100;
  flex-shrink: 0;
}
.header-logo {
  font-size: 1.1rem; font-weight: 900; color: var(--primary);
  letter-spacing: 0.08em; text-decoration: none; white-space: nowrap;
}
.header-logo span { color: var(--text-muted); font-weight: 400; font-size: 0.8rem; margin-left: 6px; }
.header-search {
  flex: 1; max-width: 340px;
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 6px 12px;
}
.header-search input {
  border: none; background: transparent; outline: none;
  font-size: 0.85rem; color: var(--text); width: 100%;
}
.header-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.header-user { font-size: 0.82rem; color: var(--text-muted); }
.btn-logout {
  font-size: 0.78rem; color: var(--text-muted); cursor: pointer;
  background: none; border: none; padding: 4px 8px; border-radius: 4px;
  transition: background .12s;
}
.btn-logout:hover { background: var(--border); }

.app-body { display: flex; flex: 1; overflow: hidden; }

/* ── Sidebar ───────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w); background: var(--card);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 16px 0; flex-shrink: 0;
  overflow-y: auto;
}
.sidebar-section { padding: 0 12px 8px; }
.sidebar-label {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); padding: 0 8px;
  margin-bottom: 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius);
  cursor: pointer; color: var(--text-muted); font-weight: 500;
  transition: background .12s, color .12s; text-decoration: none;
  font-size: 0.875rem;
}
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.nav-icon { font-size: 1rem; width: 20px; text-align: center; }
.sidebar-btn {
  margin: 8px 12px 0; width: calc(100% - 24px);
  padding: 9px; background: var(--primary); color: #fff;
  border: none; border-radius: var(--radius); font-size: 0.85rem;
  font-weight: 600; cursor: pointer; transition: background .15s;
}
.sidebar-btn:hover { background: var(--primary-h); }

/* ── Main content ─────────────────────────────────────────────────────────── */
.main-content { flex: 1; overflow-y: auto; overflow-x: hidden; }
.view { display: none; height: 100%; }
.view.active { display: block; }

.page-header {
  padding: 20px 24px 16px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border); background: var(--card);
  position: sticky; top: 0; z-index: 50;
}
.page-title { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.page-actions { display: flex; gap: 8px; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius);
  font-size: 0.82rem; font-weight: 600; cursor: pointer;
  border: none; transition: background .15s, transform .1s; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-h); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: #FEF2F2; color: var(--danger); border: 1px solid #FECACA; }
.btn-danger:hover { background: #FEE2E2; }
.btn-sm { padding: 4px 10px; font-size: 0.75rem; }

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.8rem; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 0.875rem; font-family: inherit; color: var(--text);
  background: var(--card); outline: none;
  transition: border-color .15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--primary); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  box-shadow: var(--shadow);
}
.stat-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  text-align: center;
}
.stat-value { font-size: 2rem; font-weight: 800; color: var(--text); line-height: 1.1; }
.stat-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }

/* ── Dashboard ────────────────────────────────────────────────────────────── */
#view-dashboard { padding: 24px; }
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 24px;
}
.stage-bar-wrap { margin-bottom: 8px; }
.stage-bar-label {
  display: flex; justify-content: space-between;
  font-size: 0.78rem; margin-bottom: 4px;
}
.stage-bar-track { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.stage-bar-fill { height: 100%; border-radius: 4px; transition: width .4s; }
.activity-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--bg);
}
.activity-icon {
  width: 28px; height: 28px; border-radius: 50%; background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; flex-shrink: 0;
}
.activity-text { font-size: 0.82rem; color: var(--text); }
.activity-time { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.dashboard-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── Pipeline Kanban ──────────────────────────────────────────────────────── */
#view-pipeline { display: none; flex-direction: column; height: 100%; }
#view-pipeline.active { display: flex; }
.pipeline-header {
  padding: 16px 24px; border-bottom: 1px solid var(--border);
  background: var(--card); display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}
.kanban-board {
  display: flex; gap: 12px; padding: 16px 24px;
  overflow-x: auto; flex: 1; align-items: flex-start;
}
.kanban-col {
  min-width: 240px; max-width: 260px; flex-shrink: 0;
  display: flex; flex-direction: column;
  background: var(--bg); border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.kanban-col-header {
  padding: 12px 14px;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.stage-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.kanban-col-title { font-weight: 700; font-size: 0.82rem; flex: 1; }
.kanban-col-count {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 1px 7px;
  font-size: 0.72rem; font-weight: 700; color: var(--text-muted);
}
.kanban-cards { padding: 8px; min-height: 80px; display: flex; flex-direction: column; gap: 6px; }
.kanban-col.drag-over .kanban-cards { background: var(--primary-light); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

.contact-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px;
  cursor: grab; transition: box-shadow .15s, transform .15s;
  user-select: none;
}
.contact-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.contact-card.dragging { opacity: .5; cursor: grabbing; }
.contact-card-name { font-weight: 700; font-size: 0.82rem; margin-bottom: 3px; color: var(--text); }
.contact-card-meta { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 6px; }
.contact-card-footer { display: flex; align-items: center; gap: 6px; }
.channel-icon { font-size: 0.78rem; }
.score-badge {
  margin-left: auto; background: var(--primary-light); color: var(--primary);
  border-radius: 10px; padding: 1px 7px; font-size: 0.68rem; font-weight: 700;
}

/* ── Contacts table ───────────────────────────────────────────────────────── */
#view-contacts { padding: 0; }
.contacts-filters {
  padding: 14px 24px; background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
.filter-input {
  padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 0.82rem; background: var(--bg); color: var(--text); outline: none;
}
.filter-input:focus { border-color: var(--primary); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--bg); border-bottom: 2px solid var(--border); }
th { padding: 10px 14px; text-align: left; font-size: 0.72rem; font-weight: 700;
     text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 0.82rem; }
tr:hover td { background: var(--bg); }
tr.selected td { background: var(--primary-light); }
.td-company { font-weight: 600; color: var(--text); }
.td-email { color: var(--primary); }
.stage-chip {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 0.72rem; font-weight: 600; color: #fff; white-space: nowrap;
}
.bulk-bar {
  display: none; padding: 10px 24px; background: var(--primary);
  color: #fff; align-items: center; gap: 12px;
}
.bulk-bar.visible { display: flex; }
.bulk-bar .btn { background: rgba(255,255,255,0.2); color: #fff; border: none; }
.bulk-bar .btn:hover { background: rgba(255,255,255,0.3); }

/* ── Contact detail ───────────────────────────────────────────────────────── */
#view-contact { padding: 24px; }
.contact-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.contact-info-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.contact-company-name { font-size: 1.3rem; font-weight: 800; }
.contact-field { margin-bottom: 14px; }
.contact-field-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 3px; }
.contact-field-value { font-size: 0.875rem; color: var(--text); }
.contact-field-value a { color: var(--primary); text-decoration: none; }
.tags-wrap { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.tag-chip {
  background: var(--primary-light); color: var(--primary);
  border-radius: 10px; padding: 2px 10px; font-size: 0.72rem; font-weight: 600;
  display: flex; align-items: center; gap: 4px;
}
.tag-chip .remove { cursor: pointer; opacity: .7; }
.tag-chip .remove:hover { opacity: 1; }
.score-bar-track { height: 6px; background: var(--border); border-radius: 3px; margin-top: 6px; }
.score-bar-fill { height: 100%; background: var(--primary); border-radius: 3px; }
.action-buttons { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }

/* Timeline */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item {
  display: flex; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.timeline-icon {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; flex-shrink: 0; margin-top: 2px;
}
.timeline-body { flex: 1; }
.timeline-title { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.timeline-content { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; line-height: 1.5; }
.timeline-time { font-size: 0.7rem; color: var(--text-muted); margin-top: 3px; }

/* ── Campaigns ────────────────────────────────────────────────────────────── */
#view-campaigns { padding: 24px; }
.campaign-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.campaign-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px;
  cursor: pointer; transition: box-shadow .15s;
}
.campaign-card:hover { box-shadow: var(--shadow-lg); }
.campaign-name { font-weight: 700; margin-bottom: 6px; }
.campaign-meta { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 12px; }
.campaign-status {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 0.72rem; font-weight: 700;
}
.status-draft    { background: #F1F5F9; color: #64748B; }
.status-active   { background: #DCFCE7; color: #16A34A; }
.status-paused   { background: #FEF9C3; color: #A16207; }
.status-completed{ background: #f0fdf4; color: #3D8B5F; }
.campaign-stats { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.cstat { text-align: center; }
.cstat-val { font-size: 1.1rem; font-weight: 800; color: var(--text); }
.cstat-lbl { font-size: 0.68rem; color: var(--text-muted); }
.progress-bar-wrap { margin-top: 10px; }
.progress-bar-track { height: 6px; background: var(--border); border-radius: 3px; display: flex; gap: 2px; overflow: hidden; }
.progress-seg { height: 100%; transition: width .3s; }

/* ── Modal ────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  display: none; align-items: center; justify-content: center;
  z-index: 1000; padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
}
.modal-header {
  padding: 18px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 1rem; font-weight: 700; }
.modal-close { cursor: pointer; color: var(--text-muted); font-size: 1.2rem; background: none; border: none; }
.modal-body { padding: 20px; }
.modal-footer {
  padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
}

/* ── Toast ────────────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 8px; z-index: 9999;
}
.toast {
  padding: 12px 16px; border-radius: var(--radius); font-size: 0.82rem;
  font-weight: 500; color: #fff; box-shadow: var(--shadow-lg);
  animation: slideIn .2s ease;
  display: flex; align-items: center; gap: 8px; min-width: 240px;
}
.toast.success { background: #16A34A; }
.toast.error   { background: var(--danger); }
.toast.info    { background: var(--primary); }
@keyframes slideIn { from { transform: translateX(100%); opacity:0; } to { transform: translateX(0); opacity:1; } }

/* ── Empty state ──────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--text-muted);
}
.empty-state-icon { font-size: 2.5rem; margin-bottom: 12px; }
.empty-state-title { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.empty-state-text { font-size: 0.85rem; }

/* ── Spinner ──────────────────────────────────────────────────────────────── */
.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-wrap { display: flex; justify-content: center; padding: 40px; }

/* ── Ximena styles ─────────────────────────────────────────────────────────── */
.ximena-section { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 20px; }
.ximena-section h2 { font-size: 16px; font-weight: 700; margin-bottom: 16px; }

/* Catalog card */
.catalog-empty { text-align: center; padding: 32px 16px; color: var(--text-muted); }
.catalog-empty p { margin-bottom: 16px; }
.catalog-upload-hint { font-size: 12px; margin-top: 8px; }
.catalog-card { display: flex; flex-direction: column; gap: 12px; }
.catalog-filename { font-weight: 600; color: var(--text); }
.catalog-summary { font-size: 13px; color: var(--text-muted); line-height: 1.5; background: var(--bg); border-radius: var(--radius); padding: 10px 14px; }
.catalog-products { display: flex; flex-direction: column; gap: 4px; }
.catalog-product-tag { font-size: 12px; color: var(--text-muted); padding: 2px 0; }
.catalog-product-tag::before { content: "· "; }
.catalog-actions { display: flex; gap: 8px; margin-top: 4px; }
.catalog-upload-overlay { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px; }
.catalog-progress { width: 100%; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.catalog-progress-fill { height: 100%; background: var(--primary); border-radius: 2px; transition: width .3s; }

/* Generate button in contacts bulk bar */
.btn-ximena {
  padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600;
  border: none; background: linear-gradient(135deg, #3D8B5F, #2d7048); color: #fff;
  cursor: pointer; transition: opacity .15s;
}
.btn-ximena:hover { opacity: .9; }

/* Ximena modal */
.ximena-modal-panel {
  background: #fff; border-radius: 16px; width: 100%; max-width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2); max-height: 90vh; overflow-y: auto;
}
.ximena-modal-panel .modal-header-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 0;
}
.ximena-modal-panel .modal-header-row h2 { font-size: 17px; font-weight: 700; }
.ximena-modal-body { padding: 16px 24px 24px; }
.ximena-info-row { display: flex; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.ximena-info-chip { font-size: 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 20px; padding: 4px 10px; color: var(--text-muted); }
.ximena-field { margin-bottom: 14px; }
.ximena-field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .5px; }
.ximena-field select { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; background: #fff; }
.ximena-radio-group { display: flex; gap: 8px; }
.ximena-radio { display: flex; align-items: center; gap: 5px; cursor: pointer; font-size: 13px; }
.ximena-checkbox-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.ximena-checkbox-row input { margin-top: 2px; flex-shrink: 0; }
.ximena-checkbox-row small { display: block; color: var(--text-muted); font-size: 11px; margin-top: 2px; }
.ximena-cost { font-size: 12px; color: var(--text-muted); background: var(--bg); border-radius: var(--radius); padding: 8px 12px; margin: 12px 0; }
.ximena-modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding-top: 8px; }
.btn-close { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--text-muted); padding: 4px 8px; }
.btn-close:hover { color: var(--text); }

/* Progress modal */
.ximena-progress-body { padding: 16px 24px 24px; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, #3D8B5F, #22C55E); border-radius: 4px; transition: width .4s ease; }
.progress-text { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.progress-sub { font-size: 12px; color: var(--text-muted); }

/* Messages review */
.messages-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.messages-header h2 { font-size: 16px; font-weight: 700; }
.message-card { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; margin-bottom: 12px; transition: border-color .15s; }
.message-card.approved { border-color: var(--primary); background: var(--primary-light); }
.message-card.discarded { opacity: .4; }
.message-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.message-company { font-weight: 700; font-size: 14px; }
.message-city { font-size: 12px; color: var(--text-muted); }
.message-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.msg-badge { font-size: 11px; padding: 2px 7px; border-radius: 20px; }
.msg-badge-web { background: #dbeafe; color: #1d4ed8; }
.msg-badge-catalog { background: var(--primary-light); color: var(--primary); }
.msg-badge-approved { background: var(--primary-light); color: var(--primary); }
.message-subject { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.message-preview { font-size: 13px; color: var(--text-muted); line-height: 1.5; white-space: pre-wrap; }
.message-full { width: 100%; min-height: 120px; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; font-size: 13px; font-family: inherit; resize: vertical; margin-top: 8px; }
.message-subject-input { width: 100%; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; font-size: 13px; margin-bottom: 8px; }
.message-card-actions { display: flex; gap: 8px; margin-top: 10px; }
.btn-msg-edit { font-size: 12px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 6px; background: #fff; cursor: pointer; }
.btn-msg-approve { font-size: 12px; padding: 5px 10px; border: 1px solid var(--primary); border-radius: 6px; background: #fff; color: var(--primary); cursor: pointer; font-weight: 600; }
.btn-msg-approve.active { background: var(--primary); color: #fff; }
.btn-msg-discard { font-size: 12px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--danger); cursor: pointer; }
.messages-bottom-bar { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--border); padding: 12px 0; display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-cols { grid-template-columns: 1fr; }
  .contact-detail-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .kanban-board { padding: 12px; }
}
@media (max-width: 480px) {
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
}

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

/* ── Settings ─────────────────────────────────────────────────────────────── */
.settings-section { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 20px; }
.settings-section h2 { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .form-group { display: flex; flex-direction: column; gap: 5px; }
.form-grid .form-group label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.form-grid .form-group input { padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; font-weight: 400 !important; color: var(--text) !important; }
.settings-actions { display: flex; gap: 10px; margin-top: 16px; }
.settings-status { font-size: 13px; margin-top: 10px; }
.settings-status.ok { color: #16a34a; }
.settings-status.error { color: var(--danger); }

/* Send modal */
.send-modal-panel { background: #fff; border-radius: 16px; width: 100%; max-width: 460px; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.send-modal-panel .modal-header-row { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 0; }
.send-modal-panel .modal-header-row h2 { font-size: 17px; font-weight: 700; }
.send-modal-body { padding: 16px 24px 24px; }
.send-row { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.send-row label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.send-row input, .send-row select { padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; }
.send-radio-group { display: flex; flex-direction: column; gap: 8px; }
.send-radio { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.send-scheduled-fields { margin-top: 8px; display: flex; gap: 10px; }
.send-summary { background: var(--bg); border-radius: var(--radius); padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }
.send-footer { display: flex; justify-content: flex-end; gap: 10px; padding-top: 8px; }

/* Campaign status badges */
.campaign-stats-row { display: flex; gap: 16px; flex-wrap: wrap; margin: 8px 0; }
.campaign-stat { display: flex; align-items: center; gap: 4px; font-size: 13px; }
.campaign-stat-icon { font-size: 14px; }
.campaign-status-badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.status-scheduled { background: #fef9c3; color: #a16207; }
.status-sending { background: #dbeafe; color: #1d4ed8; }
