/* ================================================================
   BUSINESS HUB — style.css
   Clean, premium, fully responsive design system
================================================================ */

/* ─── Variables ─────────────────────────────────────────────── */
:root {
  --sidebar-w: 240px;
  --topbar-h: 60px;

  /* Brand colours */
  --accent:    #f97316;
  --accent-2:  #3b82f6;
  --success:   #22c55e;
  --warning:   #eab308;
  --danger:    #ef4444;
  --purple:    #a855f7;

  /* Backgrounds */
  --bg-1:      #f8fafc;
  --bg-2:      #ffffff;
  --bg-3:      #f1f5f9;
  --sidebar-bg:#0f172a;

  /* Text */
  --text-1:    #0f172a;
  --text-2:    #475569;
  --text-3:    #94a3b8;

  /* Borders */
  --border:    #e2e8f0;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.15);

  --transition: .18s ease;
}

/* ─── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-1);
  background: var(--bg-1);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 14px; }
img { max-width: 100%; }

/* ─── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 300;
  transition: transform .22s cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Backdrop behind sidebar on mobile */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 299;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}
.sidebar-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* ─── Sidebar Collapsed (desktop icon-only rail) ─── */
.sidebar {
  transition: transform .22s cubic-bezier(.4,0,.2,1), width .22s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
.sidebar.sidebar-collapsed {
  width: 64px;
}
.sidebar.sidebar-collapsed .brand-name,
.sidebar.sidebar-collapsed .nav-link span,
.sidebar.sidebar-collapsed .nav-section-label,
.sidebar.sidebar-collapsed .sidebar-footer-info {
  display: none;
}
.sidebar.sidebar-collapsed .nav-link {
  justify-content: center;
  padding: 10px 0;
}
.sidebar.sidebar-collapsed .nav-link i {
  width: auto;
  font-size: 18px;
}
.sidebar.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  padding: 20px 0 16px;
}
.sidebar.sidebar-collapsed .sidebar-footer {
  justify-content: center;
  padding: 16px 0 20px;
}
.sidebar.sidebar-collapsed .sidebar-nav {
  padding: 16px 8px;
}

/* Main wrapper shifts when sidebar collapses */
.main-wrapper {
  transition: margin-left .22s cubic-bezier(.4,0,.2,1), width .22s cubic-bezier(.4,0,.2,1);
}
.main-wrapper.sidebar-collapsed {
  margin-left: 64px;
  width: calc(100% - 64px);
}


.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-icon {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.brand-name {
  font-size: 15px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.sidebar-nav { flex: 1; padding: 16px 12px; }
.nav-section-label {
  font-size: 10px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: #475569;
  padding: 0 8px; margin-bottom: 6px;
}
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: #94a3b8;
  font-size: 13.5px; font-weight: 500;
  transition: background var(--transition), color var(--transition);
  margin-bottom: 2px;
}
.nav-link i { width: 16px; text-align: center; font-size: 14px; }
.nav-link:hover  { background: rgba(255,255,255,.07); color: #fff; }
.nav-link.active { background: var(--accent); color: #fff; }

.sidebar-footer {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 16px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-avatar {
  width: 34px; height: 34px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}
.sidebar-biz-name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.sidebar-biz-type { font-size: 11px; color: #94a3b8; }

/* ─── Main Wrapper ───────────────────────────────────────────── */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  width: calc(100% - var(--sidebar-w));
}

/* ─── Topbar ─────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 100;
  width: 100%;
  overflow: hidden;
}
.hamburger {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 18px;
  flex-shrink: 0;
  transition: background var(--transition);
}
.hamburger:hover { background: var(--bg-3); }

.topbar-search {
  flex: 1; max-width: 420px;
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-3);
  border-radius: 10px;
  padding: 0 14px;
  border: 1.5px solid transparent;
  transition: border-color var(--transition);
}
.topbar-search:focus-within { border-color: var(--accent-2); }
.topbar-search i { color: var(--text-3); font-size: 13px; }
.topbar-search input { flex: 1; background: none; border: none; outline: none; padding: 9px 0; color: var(--text-1); }
.topbar-search input::placeholder { color: var(--text-3); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); font-size: 16px;
  position: relative;
  transition: background var(--transition);
}
.icon-btn:hover { background: var(--bg-3); }
.notif-dot { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; background: var(--danger); border-radius: 50%; border: 2px solid #fff; }
.topbar-avatar {
  width: 32px; height: 32px;
  border-radius: 50%; background: var(--accent);
  color: #fff; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}

/* ─── Page Container ─────────────────────────────────────────── */
.page-container { flex: 1; padding: 28px 28px; overflow-y: auto; }

/* ─── View Sections ──────────────────────────────────────────── */
.view { animation: fadeIn .18s ease; }
.view.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.view-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; gap: 16px;
}
.view-header h1 { font-size: 24px; font-weight: 700; }
.view-sub { font-size: 13px; color: var(--text-2); margin-top: 3px; }

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary   { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #ea6c0a; }
.btn-ghost     { background: var(--bg-3); color: var(--text-2); }
.btn-ghost:hover { background: var(--border); }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm        { padding: 6px 12px; font-size: 12px; }
.btn-full      { width: 100%; justify-content: center; }

.icon-btn-sm {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 12px;
  transition: all var(--transition);
}
.icon-btn-sm:hover { background: var(--bg-3); color: var(--text-1); }
.icon-btn-sm.danger:hover { background: #fee2e2; color: var(--danger); }

.inline-link { color: var(--accent-2); font-weight: 600; text-decoration: underline; background: none; border: none; cursor: pointer; padding: 0; font-size: inherit; }

/* ─── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--bg-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.card-head h3 { font-size: 15px; font-weight: 600; }
.card-sub { font-size: 12px; color: var(--text-3); }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ─── KPI Grid ───────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.kpi-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.kpi-card:hover { box-shadow: var(--shadow-md); }
.kpi-left { display: flex; align-items: center; gap: 14px; }
.kpi-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.kpi-icon.c-orange { background: #fff7ed; color: var(--accent); }
.kpi-icon.c-blue   { background: #eff6ff; color: var(--accent-2); }
.kpi-icon.c-green  { background: #f0fdf4; color: var(--success); }
.kpi-icon.c-purple { background: #faf5ff; color: var(--purple); }
.kpi-label { font-size: 12px; color: var(--text-2); font-weight: 500; margin-bottom: 2px; }
.kpi-value { font-size: 26px; font-weight: 700; line-height: 1.1; }
.kpi-badge { font-size: 11px; color: var(--text-3); text-align: right; max-width: 90px; }

/* ─── AI Box ─────────────────────────────────────────────────── */
.ai-box {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border: 1.5px solid #bfdbfe;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}
.ai-box-icon { font-size: 22px; color: var(--accent-2); margin-top: 2px; }
.ai-box-body { flex: 1; }
.ai-box-label { font-size: 11px; font-weight: 700; color: var(--accent-2); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.ai-box-text { font-size: 13.5px; color: var(--text-1); line-height: 1.6; }

/* ─── Chart boxes ────────────────────────────────────────────── */
.chart-box { height: 260px; position: relative; }

/* ─── Target Ring ────────────────────────────────────────────── */
.ring-wrap {
  display: flex; justify-content: center; align-items: center;
  position: relative;
  padding: 20px 0 8px;
}
.ring-center {
  position: absolute;
  display: flex; flex-direction: column; align-items: center;
}
.ring-pct { font-size: 26px; font-weight: 800; }
.ring-sub { font-size: 11px; color: var(--text-3); }
.ring-detail { text-align: center; color: var(--text-2); font-size: 13px; margin-top: 8px; }

/* ─── Empty States ───────────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  padding: 60px 20px; gap: 12px; text-align: center;
}
.empty-state i { font-size: 48px; color: var(--border); }
.empty-state h3 { font-size: 16px; font-weight: 600; }
.empty-state p { font-size: 13px; color: var(--text-2); max-width: 300px; }
.empty-state-mini { padding: 20px; color: var(--text-3); font-size: 13px; text-align: center; }

/* ─── Kanban Board ───────────────────────────────────────────── */
.kanban {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
  align-items: flex-start;
}
.kanban-col {
  flex: 0 0 240px;
  background: var(--bg-3);
  border-radius: var(--radius-md);
  padding: 14px;
  min-height: 200px;
  transition: background var(--transition);
}
.kanban-col.drag-over { background: #dbeafe; }

.kanban-col-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
}
.kanban-col-head h4 { font-size: 13px; font-weight: 600; flex: 1; }
.kanban-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.kanban-count {
  background: var(--bg-2); border-radius: 20px;
  padding: 0 8px; font-size: 11px; font-weight: 700; color: var(--text-2);
  border: 1px solid var(--border);
}

.kanban-cards { display: flex; flex-direction: column; gap: 8px; min-height: 40px; }
.kanban-empty { padding: 12px; text-align: center; color: var(--text-3); font-size: 12px; border: 2px dashed var(--border); border-radius: 8px; }

.kanban-card {
  background: var(--bg-2);
  border-radius: var(--radius-sm);
  padding: 12px;
  border: 1px solid var(--border);
  cursor: grab;
  transition: box-shadow var(--transition), opacity var(--transition);
  box-shadow: var(--shadow-sm);
}
.kanban-card:hover { box-shadow: var(--shadow-md); }
.kanban-card.dragging { opacity: .4; }

.kc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 4px; margin-bottom: 4px; }
.kc-head strong { font-size: 13px; font-weight: 600; }
.kc-actions { display: flex; gap: 2px; flex-shrink: 0; }
.kc-sub  { font-size: 12px; color: var(--text-2); margin-bottom: 2px; }
.kc-cat  { font-size: 11px; color: var(--accent); font-weight: 600; }
.kc-meta { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.kc-meta i { margin-right: 4px; }
.kc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.kc-date { font-size: 11px; color: var(--text-3); }
.priority-dot { width: 8px; height: 8px; border-radius: 50%; }

.kanban-add-btn {
  width: 100%; margin-top: 10px;
  padding: 8px;
  border-radius: 8px;
  color: var(--text-3);
  font-size: 12px; font-weight: 500;
  border: 2px dashed var(--border);
  transition: all var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.kanban-add-btn:hover { border-color: var(--accent); color: var(--accent); background: #fff7ed; }

/* ─── Data Table ─────────────────────────────────────────────── */
.table-toolbar {
  display: flex; gap: 12px; align-items: center;
  margin-bottom: 16px; flex-wrap: wrap;
}
.table-search {
  flex: 1; min-width: 200px;
  background: var(--bg-3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px; outline: none;
  transition: border-color var(--transition);
}
.table-search:focus { border-color: var(--accent-2); }
.form-select {
  background: var(--bg-3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px; outline: none;
  cursor: pointer;
}

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-3); padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td { padding: 12px 12px; border-bottom: 1px solid var(--bg-3); font-size: 13.5px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-1); }
.data-table a { color: var(--accent-2); }
.actions-cell { white-space: nowrap; }

/* Stage badges */
.stage-badge {
  display: inline-block; padding: 3px 10px;
  border-radius: 20px; font-size: 11px; font-weight: 600;
}
.stage-inquiry  { background: #fff7ed; color: #c2410c; }
.stage-contacted{ background: #eff6ff; color: #1d4ed8; }
.stage-visit    { background: #fefce8; color: #a16207; }
.stage-reg      { background: #faf5ff; color: #7e22ce; }
.stage-enrolled { background: #f0fdf4; color: #15803d; }

/* Priority tags */
.priority-tag {
  display: inline-block; padding: 2px 8px;
  border-radius: 20px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
}
.p-high   { background: #fee2e2; color: #b91c1c; }
.p-medium { background: #fff7ed; color: #c2410c; }
.p-low    { background: #f1f5f9; color: #64748b; }

/* Dot colours for kanban */
.c-orange { background: var(--accent); }
.c-blue   { background: var(--accent-2); }
.c-yellow { background: var(--warning); }
.c-purple { background: var(--purple); }
.c-green  { background: var(--success); }

/* ─── Campaigns ──────────────────────────────────────────────── */
.campaigns-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.camp-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 18px;
  box-shadow: var(--shadow-sm); transition: box-shadow var(--transition);
}
.camp-card:hover { box-shadow: var(--shadow-md); }
.camp-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; gap: 8px; }
.camp-head h4 { font-size: 14px; font-weight: 600; line-height: 1.4; }
.camp-source { font-size: 11px; color: var(--text-3); font-weight: 500; }
.camp-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; }
.camp-metrics { display: flex; gap: 8px; flex-wrap: wrap; }
.camp-metric { flex: 1; min-width: 70px; background: var(--bg-3); border-radius: 8px; padding: 8px 10px; }
.camp-metric span { font-size: 10px; color: var(--text-3); display: block; font-weight: 500; }
.camp-metric strong { font-size: 15px; font-weight: 700; display: block; margin-top: 2px; }
.camp-date { font-size: 11px; color: var(--text-3); margin-top: 10px; }

/* ROI grid */
.roi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr) auto;
  gap: 16px; align-items: end;
}
.roi-result { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.roi-stat { text-align: center; }
.roi-stat span { font-size: 11px; color: var(--text-3); display: block; }
.roi-stat strong { font-size: 20px; font-weight: 700; }

/* ─── Tasks ──────────────────────────────────────────────────── */
.task-list { display: flex; flex-direction: column; gap: 4px; }
.task-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.task-row:hover { background: var(--bg-3); }
.task-done .task-text { text-decoration: line-through; color: var(--text-3); }

.task-check-btn {
  width: 20px; height: 20px;
  border-radius: 6px;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: transparent;
  flex-shrink: 0;
  transition: all var(--transition);
}
.task-check-btn.checked { background: var(--success); border-color: var(--success); color: #fff; }
.task-check-btn i { font-size: 10px; }
.task-text { flex: 1; font-size: 13.5px; }
.task-due { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.task-due i { margin-right: 3px; }
.task-actions { display: flex; gap: 2px; }

/* ─── Content Calendar ───────────────────────────────────────── */
.calendar-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cal-header {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  color: var(--text-3); text-align: center; padding: 8px 0;
}
.cal-cell {
  min-height: 72px; padding: 6px;
  border: 1px solid var(--bg-3);
  border-radius: 6px;
  font-size: 12px;
  transition: background var(--transition);
}
.cal-cell:hover { background: var(--bg-1); }
.cal-empty { background: none; border-color: transparent; }
.cal-today { background: #eff6ff; border-color: var(--accent-2); }
.cal-date { font-size: 11px; color: var(--text-3); display: block; margin-bottom: 3px; font-weight: 600; }
.cal-event {
  background: var(--accent-2);
  color: #fff; border-radius: 4px;
  padding: 2px 5px; font-size: 10px;
  margin-bottom: 2px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}

.content-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--bg-3);
}
.content-item:last-child { border-bottom: none; }
.content-icon { font-size: 18px; flex-shrink: 0; }
.content-info { flex: 1; min-width: 0; }
.content-info strong { display: block; font-size: 13px; font-weight: 600; }
.content-info span { font-size: 11px; color: var(--text-3); }
.content-actions { display: flex; gap: 2px; }
.status-chip {
  padding: 3px 8px; border-radius: 20px;
  font-size: 10px; font-weight: 700;
  white-space: nowrap;
}

/* ─── Staff ──────────────────────────────────────────────────── */
.staff-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--bg-3);
}
.staff-row:last-child { border-bottom: none; }
.staff-rank { font-size: 20px; flex-shrink: 0; width: 30px; text-align: center; }
.staff-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; flex-shrink: 0;
}
.staff-info { flex: 1; min-width: 0; }
.staff-info strong { display: block; font-size: 14px; font-weight: 600; }
.staff-info span { font-size: 12px; color: var(--text-3); }
.staff-stats { flex: 2; min-width: 0; }
.staff-bar-wrap { background: var(--bg-3); border-radius: 20px; height: 8px; margin-bottom: 4px; overflow: hidden; }
.staff-bar { height: 100%; background: var(--accent); border-radius: 20px; transition: width .4s ease; }
.staff-stats span { font-size: 11px; color: var(--text-3); }
.staff-actions { display: flex; gap: 4px; }

/* ─── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--text-2); margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  color: var(--text-1);
  outline: none;
  transition: border-color var(--transition);
}
.form-control:focus { border-color: var(--accent-2); }
.form-control::placeholder { color: var(--text-3); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; }
.form-hint { font-size: 12px; color: var(--text-3); margin-bottom: 14px; line-height: 1.5; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* NPS slider */
.nps-row { display: flex; align-items: center; gap: 12px; }
.nps-row input[type=range] { flex: 1; accent-color: var(--accent); }
.nps-val { font-size: 20px; font-weight: 800; min-width: 36px; text-align: right; }

/* ─── Settings Danger Zone ────────────────────────────────────── */
.danger-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.danger-row:last-child { border-bottom: none; }
.danger-row > div strong { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 2px; }
.danger-row > div p { font-size: 12px; color: var(--text-3); }

/* ─── Modals ─────────────────────────────────────────────────── */
dialog.modal {
  border: none;
  border-radius: var(--radius-lg);
  padding: 0;
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow-lg);
  background: var(--bg-2);
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
}
dialog.modal.modal-sm {
  max-width: 420px;
}
dialog.modal::backdrop { background: rgba(15,23,42,.5); backdrop-filter: blur(4px); }

.modal-inner { padding: 24px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.modal-head h2 { font-size: 17px; font-weight: 700; }
.modal-close {
  width: 30px; height: 30px; border-radius: 8px;
  color: var(--text-3); font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.modal-close:hover { background: var(--bg-3); color: var(--text-1); }

.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border);
}

/* ─── Toast ──────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 28px; right: 28px;
  background: var(--text-1); color: #fff;
  padding: 12px 20px; border-radius: 10px;
  font-size: 13.5px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  transform: translateY(60px);
  opacity: 0; pointer-events: none;
  transition: all .25s ease;
  z-index: 9999;
}
.toast.toast-show { transform: translateY(0); opacity: 1; }
.toast.toast-error { background: var(--danger); }
.toast.toast-success { background: var(--success); }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Tablet ── */
@media (max-width: 900px) {
  :root { --sidebar-w: 220px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .page-container { padding: 20px; }
}

/* ── Mobile / Tablet (<= 768px) ── */
@media (max-width: 768px) {
  /* Sidebar slides in from left, hidden by default */
  .sidebar {
    transform: translateX(-100%);
    width: 260px;
  }
  .sidebar.sidebar-open {
    transform: translateX(0);
    box-shadow: 4px 0 30px rgba(0,0,0,.35);
  }
  .sidebar-backdrop {
    display: block;
  }

  /* Main wrapper takes full width */
  .main-wrapper {
    margin-left: 0;
    width: 100%;
  }

  /* Topbar */
  .topbar { padding: 0 14px; gap: 8px; }

  /* Hide search bar on small screens, show icon only */
  .topbar-search {
    display: none;
  }

  /* Logout text hidden, show icon only */
  #logout-btn span { display: none; }

  /* Grids */
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .two-col { grid-template-columns: 1fr; }
  .roi-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }

  /* Page */
  .page-container { padding: 14px; }
  .view-header { flex-wrap: wrap; gap: 10px; }
  .view-header h1 { font-size: 20px; }

  /* Kanban — horizontal scroll */
  .kanban {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 12px;
  }
  .kanban-col { flex: 0 0 260px; }

  /* Modals — centered, near full-width */
  dialog.modal {
    max-width: 94vw;
    width: 94vw;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    max-height: 90vh;
    overflow-y: auto;
  }
  dialog.modal.modal-sm {
    max-width: 88vw;
    width: 88vw;
  }
  .modal-inner { padding: 16px; }

  /* Campaign cards */
  .campaigns-grid { grid-template-columns: 1fr; }

  /* Staff list */
  .staff-row { flex-wrap: wrap; gap: 8px; }

  /* Toast */
  .toast {
    bottom: 16px;
    right: 12px;
    left: 12px;
    text-align: center;
  }

  /* Auth card */
  .auth-card {
    padding: 24px 18px;
    max-width: 100%;
  }

  /* Tables — horizontal scroll */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { min-width: 600px; }
}

/* ── Small Mobile (<= 480px) ── */
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .camp-metrics { flex-direction: column; }
  .roi-grid { grid-template-columns: 1fr; }
  .view-header { flex-direction: column; align-items: flex-start; }
  .view-header .btn { align-self: flex-start; }
  .kanban-col { flex: 0 0 240px; }
  .auth-card { padding: 20px 14px; }
}

/* ─── Authentication Overlay ─── */
.auth-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 10% 20%, rgb(90, 92, 106) 0%, rgb(32, 34, 47) 90%);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-overlay.hidden {
  display: none !important;
}
body.authenticated .auth-overlay {
  display: none !important;
}
.auth-card {
  background: var(--bg-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--border);
  animation: fadeIn .25s ease;
}
.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.auth-brand h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-1);
}
.auth-tabs {
  display: flex;
  background: var(--bg-3);
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
}
.auth-tab {
  flex: 1;
  padding: 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  transition: all var(--transition);
}
.auth-tab.active {
  background: var(--bg-2);
  color: var(--text-1);
  box-shadow: var(--shadow-sm);
}
body.auth-required .sidebar,
body.auth-required .main-wrapper {
  display: none !important;
}
body.authenticated .sidebar,
body.authenticated .main-wrapper {
  display: flex !important;
}
body.authenticated.sidebar-active {
  overflow: hidden;
}

.hidden {
  display: none !important;
}

/* ─── Marketing Tabs ─────────────────────────────────────────────── */
.mkt-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}
.mkt-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
}
.mkt-tab:hover { color: var(--text-1); background: var(--bg-3); }
.mkt-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: transparent;
}

/* ─── SEO Task Rows ──────────────────────────────────────────────── */
.seo-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.seo-row:last-child { border-bottom: none; }
.seo-row:hover { background: var(--bg-3); border-radius: var(--radius-sm); padding-left: 8px; padding-right: 8px; margin: 0 -8px; }
.seo-row-done { opacity: .6; }
.seo-row-done .seo-row-title { text-decoration: line-through; }

.seo-cat-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  margin-top: 2px;
}
.seo-row-main { flex: 1; min-width: 0; }
.seo-row-title { font-size: 13.5px; font-weight: 600; color: var(--text-1); margin-bottom: 4px; }
.seo-row-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.seo-cat-label { font-size: 11px; color: var(--text-3); font-weight: 500; }
.seo-notes-preview { font-size: 11px; color: var(--text-3); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seo-keyword { font-size: 11px; background: #f0f9ff; color: #0369a1; border-radius: 4px; padding: 1px 6px; font-weight: 600; margin-left: 6px; }
.seo-row-actions { display: flex; gap: 4px; align-items: center; flex-shrink: 0; }

/* ─── Organic Content Rows ───────────────────────────────────────── */
.organic-content-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.organic-content-row:last-child { border-bottom: none; }
.organic-content-row:hover { background: var(--bg-3); border-radius: var(--radius-sm); padding-left: 8px; padding-right: 8px; margin: 0 -8px; }
.organic-published .seo-row-title { color: var(--success); }

/* ─── Badges ─────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-gray   { background: var(--bg-3); color: var(--text-2); }
.badge-warning{ background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #dc2626; }

/* ─── Progress Bar ───────────────────────────────────────────────── */
.progress-bar-track {
  width: 100%;
  height: 8px;
  background: var(--bg-3);
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #16a34a);
  border-radius: 99px;
  transition: width .4s ease;
}

@media (max-width: 768px) {
  .mkt-tabs { overflow-x: auto; }
  .mkt-tab { white-space: nowrap; padding: 8px 14px; font-size: 12.5px; }
  .seo-row-actions { flex-direction: column; }
  .seo-notes-preview { display: none; }
}
