/* ============================
    Global StylesBridgePulse 
   ============================ */
:root {
  --green-dark: #2e7d32;
  --green-mid: #43a047;
  --green-light: #81c784;
  --green-bg: #f6faf7;
  --white: #fff;
  --shadow: 0 4px 24px rgba(60,120,80,0.10);
  --radius: 12px;
  --text: #222;
  --muted: #666;
  --danger: #e53935;
  --warning: #f9a825;
  --info: #1976d2;
}

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

body {
  font-family: 'Segoe UI', 'Arial', sans-serif;
  background: var(--green-bg);
  color: var(--text);
  min-height: 100vh;
}

/* ---- Nav ---- */
.nav {
  background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 60%, #388e3c 100%);
  display: flex;
  align-items: center;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 3px 16px rgba(30,80,30,0.22);
  min-height: 58px;
}
.nav-inner { display: flex; align-items: center; width: 100%; gap: 0; }
.nav-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  margin-right: 28px;
  flex-shrink: 0;
}
.nav-brand-icon {
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.18);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.nav-brand-text {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
}
.nav-links {
  display: flex;
  list-style: none;
  gap: 2px;
  flex: 1;
}
.nav-links li a {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,0.78);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.nav-links li a:hover {
  background: rgba(255,255,255,0.14);
  color: #fff;
}
.nav-links li a.active {
  background: rgba(255,255,255,0.22);
  color: #fff;
  font-weight: 700;
}
.nav-links li a .nav-icon { font-size: 0.95rem; opacity: 0.85; }
.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-shrink: 0;
}
.nav-user {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.12);
  padding: 4px 10px;
  border-radius: 20px;
}
.nav-logo { height: 32px; }

@media (max-width: 768px) {
  .nav { padding: 0 12px; min-height: 52px; flex-wrap: wrap; }
  .nav-links { gap: 0; overflow-x: auto; padding-bottom: 4px; }
  .nav-links li a { padding: 6px 10px; font-size: 0.82rem; }
  .nav-links li a .nav-icon { display: none; }
  .nav-brand-text { font-size: 1rem; }
}

/* ---- Container ---- */
.container {
  max-width: 1100px;
  margin: 32px auto;
  padding: 0 16px;
}

/* ---- Card ---- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
  margin-bottom: 24px;
}
.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  border-radius: 8px;
  padding: 10px 22px;
  font-size: 0.97rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(90deg, var(--green-mid) 0%, var(--green-light) 100%); color: #fff; }
.btn-primary:hover:not(:disabled) { background: linear-gradient(90deg, var(--green-dark) 0%, var(--green-mid) 100%); }
.btn-secondary { background: #f0f4f0; color: var(--green-dark); border: 1px solid var(--green-light); }
.btn-secondary:hover:not(:disabled) { background: #e0ede0; }
.btn-danger { background: #fde8e8; color: var(--danger); border: 1px solid #f5c6c6; }
.btn-danger:hover:not(:disabled) { background: #fbd0d0; }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }

.main-btn { /* keep compat */
  background: linear-gradient(90deg, var(--green-mid) 0%, var(--green-light) 100%);
  color: #fff; border: none; border-radius: 8px;
  padding: 14px 36px; font-size: 1.1rem; font-weight: 600;
  cursor: pointer; margin-top: 18px;
  box-shadow: 0 2px 8px rgba(60,120,80,0.08); transition: background 0.2s;
}
.main-btn:hover { background: linear-gradient(90deg, var(--green-dark) 0%, var(--green-mid) 100%); }

/* ---- Forms ---- */
.form-group { margin-bottom: 16px; }
label { display: block; font-weight: 600; color: var(--green-dark); margin-bottom: 6px; font-size: 0.93rem; }
input[type=text], input[type=email], input[type=password], input[type=file],
textarea, select {
  width: 100%; padding: 10px 12px; border: 1.5px solid #d0e8d0;
  border-radius: 8px; font-size: 0.97rem; background: #fafdfa;
  transition: border 0.15s; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--green-mid); background: #fff; }
textarea { min-height: 80px; resize: vertical; }

/* ---- Table ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th { background: var(--green-bg); color: var(--green-dark); font-weight: 700; padding: 10px 12px; text-align: left; border-bottom: 2px solid var(--green-light); }
td { padding: 9px 12px; border-bottom: 1px solid #eef4ee; vertical-align: middle; }
tr:hover td { background: #f4faf4; }

/* ---- Status badges ---- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 0.8rem; font-weight: 600; white-space: nowrap;
}
.badge-pending   { background: #fff3cd; color: #856404; }
.badge-active    { background: #d4edda; color: #155724; }
.badge-interested{ background: #cce5ff; color: #004085; }
.badge-unsubscribed{ background: #f8d7da; color: #721c24; }
.badge-completed  { background: #e2e3e5; color: #383d41; }
/* ---- New contact statuses ---- */
.badge-in-db             { background: #e2e3e5; color: #383d41; }
.badge-first-message     { background: #fff3cd; color: #856404; }
.badge-they-replied      { background: #cce5ff; color: #004085; }
.badge-they-silent       { background: #fde8c8; color: #7d4e0f; }
.badge-not-interested    { background: #f8d7da; color: #721c24; }
.badge-in-progress-human { background: #d4edda; color: #155724; }
.badge-running    { background: #cce5ff; color: #004085; }
.badge-failed     { background: #f8d7da; color: #721c24; }
.badge-paused     { background: #fff3cd; color: #856404; }
.badge-stopped    { background: #fff3cd; color: #856404; }
.badge-info      { background: #d1ecf1; color: #0c5460; }
.badge-warning   { background: #fff3cd; color: #856404; }
.badge-error     { background: #f8d7da; color: #721c24; }

/* ---- Progress bar ---- */
.progress-bar-wrap { background: #e8f5e9; border-radius: 8px; height: 16px; overflow: hidden; }
.progress-bar { background: linear-gradient(90deg, var(--green-mid), var(--green-light)); height: 100%; border-radius: 8px; transition: width 0.4s; }

/* ---- Log area ---- */
.log-area {
  background: #1e2a1e; color: #a8e6a8; font-family: monospace;
  font-size: 0.82rem; border-radius: 8px; padding: 14px;
  max-height: 260px; overflow-y: auto;
}
.log-area .log-error { color: #ff8080; }
.log-area .log-warning { color: #ffd080; }

/* ---- Alerts ---- */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 0.95rem; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6c6; }
.alert-info    { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* ---- Header (landing) ---- */
header.hero { text-align: center; padding: 40px 0 20px; }
header.hero .logo { width: 110px; margin-bottom: 12px; }
header.hero h1 { font-size: 2.4rem; color: var(--green-dark); letter-spacing: 1px; margin-bottom: 8px; }
header.hero .subtitle { color: var(--green-mid); font-size: 1.1rem; }

/* ---- Grid ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ---- Stat boxes ---- */
.stat-box { text-align: center; padding: 20px; }
.stat-box .stat-num { font-size: 2.2rem; font-weight: 800; color: var(--green-dark); }
.stat-box .stat-label { color: var(--muted); font-size: 0.9rem; margin-top: 4px; }

/* ---- Modal ---- */
.modal-backdrop { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.4); z-index:200; align-items:center; justify-content:center; }
.modal-backdrop.open { display:flex; }
.modal { background:#fff; border-radius:14px; padding:28px; max-width:520px; width:90%; box-shadow:0 8px 40px rgba(0,0,0,0.18); }
.modal-title { font-size:1.15rem; font-weight:700; color:var(--green-dark); margin-bottom:16px; }
.modal-footer { display:flex; gap:10px; justify-content:flex-end; margin-top:20px; }

/* ---- Footer ---- */
footer { text-align: center; color: var(--muted); font-size: 0.9rem; padding: 24px 0 16px; }

/* ---- Responsive ---- */
@media (max-width: 700px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .nav { flex-wrap: wrap; gap: 4px; }
  .nav-brand { display: none; }
  .container { margin: 16px auto; }
}
