/* ============================================================
   CADITECH ADMIN DASHBOARD - MODULE STYLES
   Kanban · Charts · SEO · Finance · Settings
   ============================================================ */

/* ── KANBAN BOARD ─────────────────────────────────────────── */
.kanban-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: var(--space-md);
}

.kanban-column {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  min-height: 200px;
  max-height: 65vh;
}

.kanban-column-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 2;
  background: inherit;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.kanban-column-title {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kanban-column-count {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
}

.kanban-column-body {
  padding: 8px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 11px 13px;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  position: relative;
}

.kanban-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.kanban-card-title {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}

.kanban-card-email {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.kanban-card-date {
  font-size: 10px;
  color: var(--text-muted);
}

.kanban-card-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity var(--duration-fast);
}

.kanban-card:hover .kanban-card-actions {
  opacity: 1;
}

.kanban-card-actions button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 3px 5px;
  font-size: 12px;
  border-radius: 4px;
  transition: all var(--duration-fast);
}

.kanban-card-actions button:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

/* Column accent colors */
.kanban-column[data-stage="prospect"] .kanban-column-title { color: var(--text-secondary); }
.kanban-column[data-stage="contacted"] .kanban-column-title { color: var(--cyan); }
.kanban-column[data-stage="followup"] .kanban-column-title { color: var(--yellow); }
.kanban-column[data-stage="discussion"] .kanban-column-title { color: var(--purple); }
.kanban-column[data-stage="proposal"] .kanban-column-title { color: var(--indigo); }
.kanban-column[data-stage="won"] .kanban-column-title { color: var(--green); }
.kanban-column[data-stage="refused"] .kanban-column-title { color: var(--orange); }
.kanban-column[data-stage="bounced"] .kanban-column-title { color: var(--red); }

.kanban-column[data-stage="prospect"] { border-top: 2px solid var(--text-muted); }
.kanban-column[data-stage="contacted"] { border-top: 2px solid var(--cyan); }
.kanban-column[data-stage="followup"] { border-top: 2px solid var(--yellow); }
.kanban-column[data-stage="discussion"] { border-top: 2px solid var(--purple); }
.kanban-column[data-stage="proposal"] { border-top: 2px solid var(--indigo); }
.kanban-column[data-stage="won"] { border-top: 2px solid var(--green); }
.kanban-column[data-stage="refused"] { border-top: 2px solid var(--orange); }
.kanban-column[data-stage="bounced"] { border-top: 2px solid var(--red); }

/* ── CHART CONTAINERS ─────────────────────────────────────── */
.chart-container {
  position: relative;
  width: 100%;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.chart-title {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

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

.chart-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* ── ACTIVITY FEED ────────────────────────────────────────── */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--duration-fast);
}

.activity-item:last-child { border-bottom: none; }

.activity-item:hover { background: rgba(255, 255, 255, 0.02); }

.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

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

.activity-text {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
}

.activity-text strong { color: #fff; font-weight: 600; }

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

/* ── SEO KEYWORD TABLE ────────────────────────────────────── */
.keyword-row {
  display: grid;
  grid-template-columns: 1fr 80px 80px 70px 100px;
  align-items: center;
  gap: var(--space-sm);
}

.keyword-position {
  font-family: var(--font-heading);
  font-weight: 700;
}

.position-up { color: var(--green); }
.position-down { color: var(--red); }
.position-same { color: var(--text-muted); }

.position-indicator {
  font-size: 10px;
  margin-left: 4px;
}

/* ── SEO AUDIT & PAGESPEED ───────────────────────────────── */
.audit-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: var(--space-lg);
}

.audit-url-input-group {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex: 1;
  min-width: 280px;
}

.audit-url-input {
  flex: 1;
  background: var(--bg-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 13px;
  transition: border-color var(--transition-fast);
}

.audit-url-input:focus {
  outline: none;
  border-color: var(--cyan);
}

.audit-score-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.audit-score-circle {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 4px solid var(--green);
  background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.03) 70%);
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.2);
  flex-shrink: 0;
}

.audit-score-val {
  font-family: var(--font-heading);
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
}

.audit-score-sub {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.audit-summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}

.audit-summary-pill.passed {
  background: var(--green-dim);
  color: var(--green);
  border-color: rgba(74, 222, 128, 0.2);
}

.audit-summary-pill.warning {
  background: var(--yellow-dim);
  color: var(--yellow);
  border-color: rgba(250, 204, 21, 0.2);
}

.audit-summary-pill.error {
  background: var(--red-dim);
  color: var(--red);
  border-color: rgba(248, 113, 113, 0.2);
}

.vitals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.vital-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px;
  text-align: center;
}

.vital-name {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.vital-val {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.vital-status {
  font-size: 10px;
  font-weight: 600;
  margin-top: 2px;
}

.audit-check-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.audit-check-card:hover {
  border-color: var(--border-default);
  transform: translateY(-1px);
}

.audit-check-card.passed {
  border-left-color: var(--green);
}

.audit-check-card.warning {
  border-left-color: var(--yellow);
}

.audit-check-card.error {
  border-left-color: var(--red);
}

.audit-check-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.audit-check-title {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.audit-check-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.audit-recommendation {
  background: rgba(250, 204, 21, 0.08);
  border: 1px dashed rgba(250, 204, 21, 0.3);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--yellow);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

/* ── FINANCE INVOICE LIST ─────────────────────────────────── */
.invoice-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.invoice-status.paid { color: var(--green); }
.invoice-status.pending { color: var(--yellow); }
.invoice-status.overdue { color: var(--red); }

.revenue-big {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.revenue-currency {
  font-size: 18px;
  color: var(--text-secondary);
  font-weight: 600;
}

/* ── SETTINGS ─────────────────────────────────────────────── */
.settings-section {
  margin-bottom: var(--space-xl);
}

.settings-section-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.account-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  transition: border-color var(--duration-fast);
}

.account-card:hover {
  border-color: var(--border-hover);
}

.account-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.account-title {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.account-status-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.account-status-tag.configured {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(74, 222, 128, 0.25);
}

.account-status-tag.unconfigured {
  background: var(--yellow-dim);
  color: var(--yellow);
  border: 1px solid rgba(250, 204, 21, 0.25);
}

.test-result-box {
  font-size: 11px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-top: var(--space-sm);
  display: none;
}

.test-result-box.show { display: block; }
.test-result-box.success {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(74, 222, 128, 0.2);
}
.test-result-box.error {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(248, 113, 113, 0.2);
}
.test-result-box.loading {
  background: var(--yellow-dim);
  color: var(--yellow);
  border: 1px solid rgba(250, 204, 21, 0.2);
}

/* ── TABS ─────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px;
  width: fit-content;
}

.tab-item {
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  background: transparent;
  border: none;
  font-family: var(--font-heading);
}

.tab-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.tab-item.active {
  color: #fff;
  background: rgba(56, 189, 248, 0.12);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* ── VIEW TOGGLE ──────────────────────────────────────────── */
.view-toggle {
  display: flex;
  gap: 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.view-toggle-btn {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--duration-fast);
  font-family: var(--font-heading);
}

.view-toggle-btn:not(:last-child) {
  border-right: 1px solid var(--border-subtle);
}

.view-toggle-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }

.view-toggle-btn.active {
  color: var(--cyan);
  background: rgba(56, 189, 248, 0.1);
}

/* ── SYNC BANNER ──────────────────────────────────────────── */
.sync-banner {
  background: rgba(56, 189, 248, 0.06);
  border: 1px solid rgba(56, 189, 248, 0.15);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-size: 12px;
  color: var(--cyan);
  display: none;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.sync-banner.active { display: flex; }

/* ── PROGRESS BAR ─────────────────────────────────────────── */
.progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--duration-slow) var(--ease-out);
}

/* ── MINI SPARKLINE (CSS only) ────────────────────────────── */
.sparkline {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 30px;
}

.sparkline-bar {
  width: 4px;
  border-radius: 2px;
  background: var(--cyan);
  opacity: 0.5;
  transition: opacity var(--duration-fast);
}

.sparkline-bar:last-child { opacity: 1; }

/* ── TROUBLESHOOT BOX ─────────────────────────────────────── */
.troubleshoot-box {
  background: rgba(250, 204, 21, 0.05);
  border: 1px solid rgba(250, 204, 21, 0.2);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 12px;
  color: var(--yellow);
  line-height: 1.6;
}

.troubleshoot-box strong { color: #fde047; }

.troubleshoot-box ul {
  margin: 6px 0 0 16px;
}

.troubleshoot-box li {
  margin-bottom: 4px;
}

.troubleshoot-box code {
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
}
