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

:root {
  --bg: #f5f4f1;
  --surface: #ffffff;
  --surface2: #f9f8f6;
  --sidebar-bg: #12111a;
  --sidebar-text: #c8c4d4;
  --sidebar-active: #ffffff;
  --sidebar-active-bg: rgba(255,255,255,0.1);
  --accent: #4f6ef7;
  --accent-dark: #3b56d6;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --text: #1a1826;
  --text-muted: #6b7280;
  --border: #e8e5de;
  --border-light: #f0ede8;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
  --shadow: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 230px;
  --header-h: 72px;
  --font: 'DM Sans', sans-serif;
  --font-display: 'Syne', sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  overflow: hidden;
}

/* ── SIDEBAR ── */
.sidebar {
  background: var(--sidebar-bg);
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}
.sidebar-logo {
  padding: 0 20px 28px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 12px;
}
.logo-text {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}
.logo-accent { color: var(--accent); }
.logo-sub {
  display: block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 3px;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  margin-top: 2px;
}
.sidebar-section-label {
  padding: 8px 20px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
}
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--sidebar-text);
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  border: none;
  background: transparent;
  text-align: left;
  width: 100%;
  text-decoration: none;
  transition: background .15s, color .15s;
  position: relative;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.7; }
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item:hover svg { opacity: 1; }
.nav-item.active { background: var(--sidebar-active-bg); color: var(--sidebar-active); font-weight: 500; }
.nav-item.active svg { opacity: 1; }
.nav-item .badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 99px;
  min-width: 20px;
  text-align: center;
}
.ext-link { opacity: 0.75; }
.ext-link:hover { opacity: 1; }
.ext-icon { width: 12px !important; height: 12px !important; margin-left: auto; }

.sidebar-bottom {
  margin-top: auto;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.btn-backup, .btn-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  border: none;
  transition: background .15s;
  width: 100%;
  font-family: var(--font);
}
.btn-backup { background: rgba(79,110,247,0.15); color: #818cf8; }
.btn-backup:hover { background: rgba(79,110,247,0.25); }
.btn-backup svg { width: 15px; height: 15px; }
.btn-logout { background: transparent; color: rgba(255,255,255,0.3); }
.btn-logout:hover { background: rgba(239,68,68,0.12); color: #f87171; }
.btn-logout svg { width: 15px; height: 15px; }

/* ── MAIN CONTENT ── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.page { display: none; flex-direction: column; height: 100%; overflow: hidden; }
.page.active { display: flex; }

.page-header {
  padding: 24px 28px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.page-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}
.page-desc { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Search */
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
}
.search-box svg { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }
.search-box input {
  border: none;
  outline: none;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: transparent;
  width: 200px;
  padding: 8px 0;
}

/* Buttons */
.btn-primary {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, transform .1s;
  white-space: nowrap;
}
.btn-primary svg { width: 15px; height: 15px; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:active { transform: scale(0.98); }
.btn-outline {
  padding: 8px 14px;
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  white-space: nowrap;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost {
  padding: 8px 14px;
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  cursor: pointer;
  transition: background .15s;
}
.btn-ghost:hover { background: var(--border-light); color: var(--text); }
.btn-sm {
  padding: 5px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font);
  font-size: 12px;
  cursor: pointer;
  transition: background .15s;
}
.btn-sm:hover { background: var(--border); }
.btn-danger { color: var(--danger) !important; }
.btn-danger:hover { background: #fef2f2 !important; }

/* ── KANBAN BOARD ── */
.kanban-board {
  display: flex;
  gap: 16px;
  padding: 20px 28px;
  overflow-x: auto;
  flex: 1;
  align-items: flex-start;
}
.kanban-board::-webkit-scrollbar { height: 6px; }
.kanban-board::-webkit-scrollbar-track { background: transparent; }
.kanban-board::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.kanban-loading { color: var(--text-muted); font-size: 14px; padding: 24px; width: 100%; }

.kanban-col {
  min-width: 276px;
  max-width: 276px;
  background: var(--surface2);
  border-radius: var(--radius);
  border: 1.5px solid var(--border-light);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 160px);
}
.kanban-col-header {
  padding: 14px 16px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-light);
}
.stage-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.stage-name { font-weight: 600; font-size: 13px; flex: 1; }
.stage-count {
  background: var(--border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 99px;
}
.stage-value {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.kanban-cards {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  flex: 1;
  min-height: 60px;
}
.kanban-cards::-webkit-scrollbar { width: 4px; }
.kanban-cards::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Lead Card */
.lead-card {
  background: var(--surface);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 13px;
  cursor: grab;
  transition: box-shadow .15s, transform .1s, border-color .15s;
  position: relative;
}
.lead-card:hover { box-shadow: var(--shadow); border-color: var(--border); }
.lead-card.dragging { opacity: 0.5; transform: rotate(1deg); cursor: grabbing; }
.lead-card.drag-over { border-color: var(--accent); border-style: dashed; }
.lead-card.has-alert { border-left: 3px solid var(--danger); }
.lead-card.has-alert-warning { border-left: 3px solid var(--warning); }

.card-business { font-weight: 600; font-size: 13px; color: var(--text); margin-bottom: 2px; }
.card-contact { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.card-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--success);
  margin-bottom: 8px;
}
.card-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.card-tag {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--surface2);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
}
.card-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
}
.card-alert {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 99px;
  flex-shrink: 0;
}
.card-alert.overdue { background: #fef2f2; color: var(--danger); }
.card-alert.today { background: #fffbeb; color: var(--warning); }
.card-alert.upcoming { background: #f0fdf4; color: var(--success); }
.card-actions { display: flex; gap: 4px; margin-left: auto; }
.card-btn {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: var(--surface2);
  cursor: pointer;
  transition: background .15s;
  font-size: 12px;
}
.card-btn:hover { background: var(--border); }

/* Drop placeholder */
.drop-placeholder {
  height: 60px;
  border: 2px dashed var(--accent);
  border-radius: var(--radius-sm);
  background: rgba(79,110,247,0.04);
}

/* ── TASKS PAGE ── */
.tasks-container {
  padding: 20px 28px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.tasks-col { flex: 1; min-width: 300px; }
.tasks-col-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tasks-col-title .count-pill {
  font-size: 11px;
  font-family: var(--font);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
}
.count-pill.red { background: #fef2f2; color: var(--danger); }
.count-pill.orange { background: #fffbeb; color: var(--warning); }
.count-pill.blue { background: #eff6ff; color: var(--accent); }

.task-item {
  background: var(--surface);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: box-shadow .15s;
}
.task-item:hover { box-shadow: var(--shadow-sm); }
.task-item.overdue { border-left: 3px solid var(--danger); }
.task-item.today { border-left: 3px solid var(--warning); }
.task-check {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .15s, background .15s;
}
.task-check:hover { border-color: var(--success); }
.task-check.done { background: var(--success); border-color: var(--success); }
.task-check.done::after { content: '✓'; color: #fff; font-size: 10px; font-weight: 700; }
.task-info { flex: 1; }
.task-lead { font-size: 11px; font-weight: 600; color: var(--accent); margin-bottom: 2px; }
.task-title { font-size: 13px; font-weight: 500; color: var(--text); }
.task-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.task-date { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.task-date.overdue { color: var(--danger); font-weight: 600; }
.task-type-icon { font-size: 16px; }

/* ── REPORTS PAGE ── */
.reports-grid {
  padding: 20px 28px;
  overflow-y: auto;
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  align-content: start;
}

.stat-card {
  background: var(--surface);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
}
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-bottom: 8px; }
.stat-value { font-family: var(--font-display); font-size: 32px; font-weight: 700; color: var(--text); line-height: 1; }
.stat-sub { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.stat-card.highlight { border-color: var(--accent); }
.stat-card.success { border-color: var(--success); }
.stat-card.danger { border-color: var(--danger); }

.report-section {
  background: var(--surface);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  grid-column: 1 / -1;
}
.report-section-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

.funnel-bar { margin-bottom: 14px; }
.funnel-bar-label { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; }
.funnel-bar-name { font-weight: 500; }
.funnel-bar-stats { color: var(--text-muted); }
.funnel-bar-track { height: 8px; background: var(--border-light); border-radius: 4px; overflow: hidden; }
.funnel-bar-fill { height: 100%; border-radius: 4px; transition: width 0.6s ease; }

.conversion-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.conversion-table th { text-align: left; padding: 8px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); border-bottom: 1px solid var(--border-light); }
.conversion-table td { padding: 10px 12px; border-bottom: 1px solid var(--border-light); }
.conversion-rate {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
}
.rate-good { background: #f0fdf4; color: var(--success); }
.rate-mid { background: #fffbeb; color: var(--warning); }
.rate-bad { background: #fef2f2; color: var(--danger); }

.service-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border-light); font-size: 13px; }
.service-row:last-child { border-bottom: none; }

/* ── MODALS ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  backdrop-filter: blur(2px);
}
.modal-overlay.active { display: block; }
.modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -48%);
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  flex-direction: column;
  overflow: hidden;
  transition: transform .2s ease, opacity .2s ease;
  opacity: 0;
}
.modal.active { display: flex; transform: translate(-50%, -50%); opacity: 1; }
.modal-wide { max-width: 720px; }
.modal-header {
  padding: 20px 24px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}
.modal-title { font-family: var(--font-display); font-size: 17px; font-weight: 700; }
.modal-close { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border: none; background: var(--surface2); border-radius: 50%; cursor: pointer; font-size: 13px; color: var(--text-muted); transition: background .15s; }
.modal-close:hover { background: var(--border); color: var(--text); }
.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border-light); display: flex; justify-content: flex-end; gap: 8px; flex-shrink: 0; }

/* Forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }
label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }
input, select, textarea {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--surface2);
  outline: none;
  transition: border-color .15s, background .15s;
  width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); background: #fff; }
textarea { resize: vertical; min-height: 72px; }

/* Lead detail */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.detail-item label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); display: block; margin-bottom: 3px; }
.detail-item .val { font-size: 14px; color: var(--text); }
.detail-section { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border-light); }
.detail-section-title { font-size: 13px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }

/* Stage/service management */
.manage-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}
.manage-item:last-child { border-bottom: none; }
.manage-item input { flex: 1; }
.color-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }

/* Followup preview */
.followup-preview {
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
  max-height: 140px;
  overflow-y: auto;
}
.preview-item { padding: 3px 0; border-bottom: 1px solid var(--border-light); }
.preview-item:last-child { border-bottom: none; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 999;
  transform: translateY(10px);
  opacity: 0;
  transition: transform .2s, opacity .2s;
  pointer-events: none;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* History */
.history-item { font-size: 12px; color: var(--text-muted); padding: 4px 0; border-bottom: 1px solid var(--border-light); }
.history-item:last-child { border-bottom: none; }
.history-action { font-weight: 500; color: var(--text); }

/* ── RESPONSIVE MOBILE ── */
@media (max-width: 768px) {

  /* Sidebar vira bottom nav */
  .sidebar {
  background: var(--sidebar-bg);
  z-index: 50;
    width: 100%;
    height: 60px;
    min-height: unset;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    flex-direction: row;
    align-items: center;
    padding: 0;
    z-index: 100;
    border-top: 1px solid rgba(255,255,255,0.08);
  }
  .sidebar-logo { display: none; }
  .sidebar-section-label { display: none; }
  .sidebar-bottom { display: none; }
  .sidebar-nav {
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    padding: 0 8px;
    gap: 0;
  }
  .nav-item {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 8px;
    font-size: 10px;
    border-radius: 8px;
    flex: 1;
    text-align: center;
  }
  .nav-item svg { width: 20px; height: 20px; opacity: 1; }
  .nav-item .badge { display: none; }
  .ext-icon { display: none; }

  /* Main content ocupa tudo menos o bottom nav */
  .main-content {
    margin-left: 0;
    margin-bottom: 60px;
    height: calc(100vh - 60px);
  }

  /* Header */
  .page-header {
    padding: 14px 16px 12px;
    flex-wrap: wrap;
    gap: 10px;
  }
  .page-title { font-size: 18px; }
  .page-actions { width: 100%; justify-content: space-between; }
  .search-box input { width: 130px; font-size: 13px; }

  /* Kanban — scroll horizontal */
  .kanban-board {
    padding: 12px;
    gap: 12px;
  }
  .kanban-col {
    min-width: 240px;
    max-width: 240px;
    max-height: calc(100vh - 200px);
  }

  /* Tasks */
  .tasks-container {
    flex-direction: column;
    padding: 12px;
    gap: 16px;
  }
  .tasks-col { min-width: unset; width: 100%; }

  /* Reports */
  .reports-grid {
    padding: 12px;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .stat-value { font-size: 24px; }
  .report-section { grid-column: 1 / -1; padding: 14px; }
  .conversion-table { font-size: 11px; }
  .conversion-table th, .conversion-table td { padding: 7px 6px; }

  /* Modals — tela cheia no mobile */
  .modal {
    top: auto;
    bottom: 60px;
    left: 0;
    right: 0;
    transform: none;
    max-width: 100%;
    max-height: 85vh;
    border-radius: 16px 16px 0 0;
    width: 100%;
  }
  .modal.active { transform: none; }
  .modal-wide { max-width: 100%; }
  .modal-body { padding: 16px; }
  .modal-header { padding: 16px; }
  .modal-footer { padding: 12px 16px; }

  /* Forms */
  .form-grid { grid-template-columns: 1fr; gap: 10px; }
  .detail-grid { grid-template-columns: 1fr 1fr; gap: 10px; }

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

@media (max-width: 400px) {
  .reports-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .page-actions { flex-wrap: wrap; gap: 6px; }
  .search-box input { width: 100px; }
}

/* Filtros de período - mobile */
@media (max-width: 768px) {
  #reports-grid > div:first-child {
    overflow-x: auto;
    flex-wrap: nowrap !important;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }
  #reports-grid > div:first-child button {
    flex-shrink: 0;
    white-space: nowrap;
  }
}

/* Filtros relatório mobile */
@media (max-width: 768px) {
  #report-filters {
    padding: 10px 12px 0 !important;
  }
}

/* Tarefas - corrigir espaço vazio mobile */
@media (max-width: 768px) {
  .tasks-col {
    min-height: unset !important;
  }
  .tasks-container {
    align-items: flex-start;
  }
}
#page-spintracker:not(.active) { visibility: hidden; overflow: hidden; }
#page-coldcall:not(.active) { visibility: hidden; overflow: hidden; }


/* ── REPORTS v2 ── */
.rp-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.report-window { font-size: 12px; color: var(--text-muted); padding: 2px 0 4px; }
.report-hint { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.report-hint-inline { font-size: 11px; color: var(--text-muted); font-weight: 400; }
.stage-kind-sel { height: 32px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; padding: 0 4px; background: var(--surface); color: var(--text); }
.mchart { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 8px; }
.mchart-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; min-width: 0; }
.mchart-bars { flex: 1; display: flex; align-items: flex-end; gap: 3px; width: 100%; justify-content: center; }
.mchart-bar { width: 40%; min-height: 2px; border-radius: 3px 3px 0 0; transition: height .5s ease; }
.mchart-bar.in { background: var(--accent); }
.mchart-bar.won { background: var(--success); }
.mchart-x { font-size: 10px; color: var(--text-muted); margin-top: 4px; white-space: nowrap; }
.mchart-legend { font-size: 11px; color: var(--text-muted); margin-top: 10px; display: flex; align-items: center; gap: 6px; }
.mchart-legend .dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.mchart-legend .dot.in { background: var(--accent); }
.mchart-legend .dot.won { background: var(--success); margin-left: 12px; }
.taskhealth { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 8px; }
.taskhealth .th-n { font-size: 22px; font-weight: 700; }
.taskhealth .th-l { font-size: 11px; color: var(--text-muted); }
