/* ─── Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  background-color: #faf7f3;
  color: #292524;
  margin: 0;
}

/* ─── Navbar ────────────────────────────────────────────────── */
.navbar {
  background: #ffffff;
  border-bottom: 1px solid #e8ddd2;
  height: 64px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  /* border-radius: 0.75rem;
  border-color: #33302B;
  border-width: 1px;
  border-style: solid; */
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-name {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.025em;
  color: #292524;
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: #78716c;
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  transition: color 0.15s, background 0.15s;
}

.nav-link:hover {
  color: #292524;
  background: #f3ede4;
}

.nav-link-active {
  color: #292524 !important;
  background: #f3ede4;
  font-weight: 600;
}

.nav-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 0.625rem;
  border: 1px solid #e8ddd2;
  background: transparent;
  color: #78716c;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.nav-icon-btn:hover {
  background: #f3ede4;
  color: #292524;
}

.btn-primary-nav {
  display: inline-block;
  background: #33302B;
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  text-decoration: none;
  border: none;
  box-shadow: 0 4px 14px rgba(51, 48, 43, 0.25);
  transition: background 0.15s;
}

.btn-primary-nav:hover {
  background: #252320;
  color: #ffffff;
}

.btn-ghost-nav {
  display: inline-block;
  background: transparent;
  border: 1px solid #e8ddd2;
  color: #78716c;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.btn-ghost-nav:hover {
  background: #f3ede4;
  color: #292524;
}

/* ─── Buttons ───────────────────────────────────────────────── */
.btn-primary {
  display: inline-block;
  background: #33302B;
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(51, 48, 43, 0.25);
  transition: background 0.15s;
  text-decoration: none;
}

.btn-primary:hover {
  background: #252320;
  color: #ffffff;
}

.btn-ghost {
  display: inline-block;
  background: transparent;
  border: 1px solid #e8ddd2;
  color: #78716c;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.625rem 1.25rem;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}

.btn-ghost:hover {
  background: #f3ede4;
  color: #292524;
}

.btn-icon {
  padding: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}

/* ─── Cards ─────────────────────────────────────────────────── */
.card {
  background: #ffffff;
  border: 1px solid #e8ddd2;
  border-radius: 1rem;
  box-shadow: 0 1px 4px rgba(120, 80, 40, 0.05);
}

/* ─── Stat Cards ─────────────────────────────────────────────── */
.stat-card {
  background: #ffffff;
  border: 1px solid #e8ddd2;
  border-radius: 1rem;
  box-shadow: 0 1px 4px rgba(120, 80, 40, 0.05);
  padding: 1.25rem;
}

.stat-card .stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #a8a29e;
}

.stat-card .stat-value {
  font-size: 1.875rem;
  font-weight: 700;
  color: #292524;
  margin: 0.25rem 0;
}

.stat-card .stat-sub {
  font-size: 0.75rem;
  color: #a8a29e;
  margin-top: 0.25rem;
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon-neutral { background: #f3ede4; }
.stat-icon-warning { background: #fffbeb; }
.stat-icon-success { background: #f0fdf4; }
.stat-icon-danger  { background: #fff5f5; }

/* ─── Table Card ─────────────────────────────────────────────── */
.table-card {
  background: #ffffff;
  border: 1px solid #e8ddd2;
  border-radius: 1rem;
  box-shadow: 0 1px 4px rgba(120, 80, 40, 0.05);
  overflow: hidden;
}

.table-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #f3ede4;
}

.table-card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #292524;
}

.table-card table {
  width: 100%;
  border-collapse: collapse;
}

.table-card thead {
  background: #faf7f3;
  border-bottom: 1px solid #f3ede4;
}

.table-card thead th {
  padding: 0.875rem 1.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  color: #a8a29e;
  text-align: left;
}

.table-card tbody td {
  padding: 1rem 1.5rem;
  font-size: 0.875rem;
  color: #292524;
  border-top: 1px solid #f3ede4;
}

/* ─── Status Badges ──────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid transparent;
}

.badge::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.badge-active    { color: #15803d; background: #f0fdf4; border-color: #bbf7d0; }
.badge-active::before    { background: #15803d; }

.badge-paused    { color: #c2410c; background: #fff7ed; border-color: #fed7aa; }
.badge-paused::before    { background: #c2410c; }

.badge-completed { color: #78716c; background: #f3ede4; border-color: #e8ddd2; }
.badge-completed::before { background: #78716c; }

.badge-failed    { color: #c53030; background: #fff5f5; border-color: #fed7d7; }
.badge-failed::before    { background: #c53030; }

.badge-pending   { color: #78716c; background: #f3ede4; border-color: #e8ddd2; }
.badge-pending::before   { background: #78716c; }

.badge-processing { color: #c2410c; background: #fff7ed; border-color: #fed7aa; }
.badge-processing::before { background: #c2410c; }

/* ─── Form Inputs ────────────────────────────────────────────── */
.form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #57534e;
  display: block;
  margin-bottom: 0.375rem;
}

.input-field {
  width: 100%;
  background: #faf7f3;
  border: 1.5px solid #e8ddd2;
  border-radius: 0.75rem;
  color: #292524;
  font-size: 0.875rem;
  font-family: 'Inter', sans-serif;
  padding: 0.625rem 0.875rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.input-field:focus {
  background: #ffffff;
  border-color: #7a7770;
  box-shadow: 0 0 0 3px rgba(51, 48, 43, 0.12);
}

.input-field::placeholder {
  color: #a8a29e;
}

/* ─── Alerts ─────────────────────────────────────────────────── */
.alert-error {
  background: #fff5f5;
  border: 1px solid #fed7d7;
  color: #b91c1c;
  border-radius: 0.75rem;
  padding: 0.875rem 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.875rem;
}

.alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
  border-radius: 0.75rem;
  padding: 0.875rem 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.875rem;
}

/* ─── KPI Cards ─────────────────────────────────────────────── */
.kpi-card {
  background: #ffffff;
  border: 1px solid #e8ddd2;
  border-radius: 1rem;
  box-shadow: 0 1px 4px rgba(120, 80, 40, 0.05);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.kpi-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.kpi-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #a8a29e;
}

.kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon-success { background: #f0fdf4; }
.kpi-icon-neutral { background: #f3ede4; }
.kpi-icon-warning { background: #fff7ed; }
.kpi-icon-danger  { background: #fff5f5; }

.kpi-value {
  font-size: 2.25rem;
  font-weight: 700;
  color: #292524;
  line-height: 1;
  letter-spacing: -0.02em;
}

.kpi-value-success { color: #15803d; }

.kpi-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 1.5rem;
}

.kpi-sub {
  font-size: 0.75rem;
  color: #a8a29e;
}

.chart-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ─── Chart cards ────────────────────────────────────────────── */
.chart-card {
  height: 300px;
}

.chart-card-sm {
  height: 260px;
}

.chart-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #a8a29e;
  margin: 0;
}

.chart-total-emails {
  font-size: 1.25rem;
  font-weight: 700;
  color: #15803d;
  margin: 0.125rem 0 0;
}

.chart-total-websites {
  font-size: 1.25rem;
  font-weight: 700;
  color: #33302B;
  margin: 0.125rem 0 0;
}

.chart-legend-dot-green  { background: #15803d; }
.chart-legend-dot-dark   { background: #33302B; }

.chart-canvas-tall   { position: relative; height: 200px; }
.chart-canvas-medium { position: relative; height: 160px; }
.chart-donut-wrap    { position: relative; max-width: 200px; margin: 0 auto; }

.period-selector {
  display: flex;
  gap: 0.25rem;
  background: #f3ede4;
  border-radius: 0.75rem;
  padding: 0.25rem;
}

/* ─── Page header ────────────────────────────────────────────── */
.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #292524;
  margin: 0;
}

.page-subtitle {
  font-size: 0.875rem;
  color: #78716c;
  margin: 0.25rem 0 0;
}

/* ─── Period selector ───────────────────────────────────────── */
.period-btn {
  background: transparent;
  border: none;
  padding: 0.375rem 0.875rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #78716c;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.period-btn:hover {
  background: #e8ddd2;
  color: #292524;
}

.period-btn.active {
  background: #ffffff;
  color: #292524;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(120, 80, 40, 0.1);
}

/* ─── Pipeline Funnel ───────────────────────────────────────── */
.funnel-step {
  flex: 1;
  text-align: center;
  padding: 0.75rem 0.5rem;
  background: #faf7f3;
  border: 1px solid #e8ddd2;
  border-radius: 0.75rem;
}

.funnel-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #292524;
}

.funnel-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #a8a29e;
  margin-top: 0.25rem;
}

.funnel-arrow {
  font-size: 1.25rem;
  color: #e8ddd2;
  flex-shrink: 0;
}

/* ─── Section label (chart titles, form section headers) ─────── */
.section-label {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #a8a29e;
  margin: 0 0 1rem;
}

/* ─── Alert icon (SVG inside alert boxes) ────────────────────── */
.alert-icon {
  flex-shrink: 0;
  margin-top: 1px;
}

/* ─── Table utilities ────────────────────────────────────────── */
.table-count {
  font-size: 0.8125rem;
  color: #a8a29e;
}

.table-loading td {
  text-align: center;
  color: #a8a29e;
  padding: 2rem;
}

/* ─── Small button modifier ──────────────────────────────────── */
.btn-ghost-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-danger-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  color: #c53030;
  border-color: #fed7d7;
}

/* ─── Form utilities ─────────────────────────────────────────── */
.form-hint {
  font-weight: 400;
  color: #a8a29e;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-section {
  border-top: 1px solid #f3ede4;
  padding-top: 1.25rem;
}

.form-section-inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-actions {
  padding-top: 0.5rem;
}

.input-resize {
  resize: vertical;
}

.input-code {
  resize: vertical;
  font-family: monospace;
  font-size: 0.8125rem;
}

/* ─── Job detail ─────────────────────────────────────────────── */
.job-meta {
  font-size: 0.8125rem;
  color: #a8a29e;
  margin: 0.25rem 0 0;
}

.stat-value-success {
  color: #15803d;
}

.funnel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

/* ─── Narrow card (forms, add-staff) ─────────────────────────── */
.card-narrow  { max-width: 540px; }
.card-medium  { max-width: 680px; }

/* ─── Modal card styling ─────────────────────────────────────── */
.modal-narrow { max-width: 440px; }

.modal-card {
  border-radius: 1rem;
  border: 1px solid #e8ddd2;
  box-shadow: 0 8px 32px rgba(120, 80, 40, 0.12);
}

.modal-card-header {
  border-bottom: 1px solid #f3ede4;
  padding: 1.25rem 1.5rem;
}

.modal-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: #292524;
  margin: 0;
}

.modal-card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-card-footer {
  border-top: 1px solid #f3ede4;
  padding: 1rem 1.5rem;
  gap: 0.5rem;
}

/* ─── Websites modal ─────────────────────────────────────────── */
.modal-websites       { max-width: 760px; }
.modal-websites-body  { padding: 0; max-height: 480px; overflow-y: auto; }

.modal-card-subtitle {
  font-size: 0.8125rem;
  color: #a8a29e;
  margin: 0.125rem 0 0;
}

.websites-table {
  width: 100%;
  border-collapse: collapse;
}

.websites-table thead {
  background: #faf7f3;
  position: sticky;
  top: 0;
  z-index: 1;
}

.websites-table thead th {
  padding: 0.75rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  color: #a8a29e;
  text-align: left;
  border-bottom: 1px solid #f3ede4;
}

.websites-table tbody td {
  padding: 0.875rem 1.25rem;
  font-size: 0.8125rem;
  color: #292524;
  border-top: 1px solid #f3ede4;
  vertical-align: middle;
}

.website-url {
  color: #78716c;
  text-decoration: none;
  word-break: break-all;
  max-width: 320px;
  display: inline-block;
}

.website-url:hover {
  color: #292524;
  text-decoration: underline;
}

/* ─── Text utilities ─────────────────────────────────────────── */
.fw-500       { font-weight: 500; }
.text-muted-sm { color: #78716c; font-size: 0.875rem; }

/* ─── Empty State ────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  color: #a8a29e;
  font-size: 0.875rem;
  gap: 0.5rem;
  opacity: 0.4;
}

/* ─── Small icon button (keyword table rows) ─────────────────── */
.btn-icon-sm {
  width: 28px;
  height: 28px;
  padding: 0.25rem;
}

/* ─── Small input (inline table editing) ────────────────────── */
.input-field-sm {
  padding: 0.375rem 0.625rem;
  font-size: 0.8125rem;
  border-radius: 0.5rem;
}

/* ─── Danger button (destructive actions) ───────────────────── */
.btn-danger {
  display: inline-block;
  background: #b91c1c;
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-danger:hover {
  background: #991b1b;
  color: #ffffff;
}
