/* ─── Admin Dashboard – Minimal Clean CSS ─────────────────────────── */

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

:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --border: #dde1ea;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --text: #1e2030;
  --muted: #6b7280;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
  --radius: 8px;
  --shadow: 0 1px 4px rgba(0, 0, 0, .08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
}

/* ── Layout ── */
.navbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
}

.navbar .brand {
  font-weight: 700;
  font-size: 16px;
  color: var(--primary);
  text-decoration: none;
}

.navbar a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}

.navbar a:hover {
  color: var(--primary);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* ── Cards ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: background .15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: #e5e7eb;
  color: var(--text);
}

.btn-secondary:hover {
  background: #d1d5db;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

/* ── Forms ── */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  transition: border .15s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

/* ── Filter bar ── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 20px;
}

.filter-bar .form-group {
  margin-bottom: 0;
}

.filter-bar .form-group label {
  margin-bottom: 3px;
}

.filter-bar select,
.filter-bar input {
  width: auto;
}

/* ── Table ── */
.table-wrapper {
  overflow-x: auto;
}

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

th {
  background: #f9fafb;
  border-bottom: 2px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  white-space: nowrap;
}

td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 13px;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: #f9fafb;
}

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.badge-new {
  background: #dbeafe;
  color: #1e40af;
}

.badge-in_progress {
  background: #fef3c7;
  color: #92400e;
}

.badge-done {
  background: #dcfce7;
  color: #166534;
}

/* ── Detail section ── */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.detail-field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: .05em;
  margin-bottom: 3px;
}

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

/* ── Login page ── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
}

.login-card h1 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}

.login-card .subtitle {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 28px;
}

.alert-error {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: var(--danger);
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* ── Misc ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.page-header h1 {
  font-size: 20px;
  font-weight: 700;
}

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

.mt-2 {
  margin-top: 8px;
}

.mt-4 {
  margin-top: 16px;
}

.wa-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #16a34a;
  font-weight: 600;
  text-decoration: none;
  font-size: 13px;
}

.wa-link:hover {
  text-decoration: underline;
}

.media-preview {
  max-width: 300px;
  max-height: 220px;
  border-radius: 8px;
  margin-top: 8px;
  border: 1px solid var(--border);
}

@media (max-width: 640px) {
  .filter-bar {
    flex-direction: column;
  }

  .filter-bar select,
  .filter-bar input {
    width: 100%;
  }
}

/* ── Nav tabs ── */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 100%;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 14px;
  height: 56px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted) !important;
  text-decoration: none !important;
  border-bottom: 3px solid transparent;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--primary) !important;
}

.nav-tab.active {
  color: var(--primary) !important;
  border-bottom-color: var(--primary);
  font-weight: 600;
}

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

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.stat-icon {
  font-size: 24px;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.stat-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.stat-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

.stat-sub.reminder {
  color: var(--warning);
  font-weight: 600;
}

/* ── WhatsApp button variants ── */
.btn-wa {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background: #25d366;
  color: #fff !important;
  border-radius: 6px;
  text-decoration: none !important;
  font-size: 13px;
  font-weight: 600;
  transition: background .15s;
}

.btn-wa:hover {
  background: #1ebe57;
}

.btn-wa-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: #d1fae5;
  border-radius: 6px;
  text-decoration: none !important;
  font-size: 14px;
  transition: background .15s;
}

.btn-wa-sm:hover {
  background: #a7f3d0;
}

/* ── Signup status badges ── */
.badge-contacted {
  background: #fef3c7;
  color: #92400e;
}

.badge-connected {
  background: #dcfce7;
  color: #166534;
}

.badge-rejected {
  background: #fee2e2;
  color: #991b1b;
}