/* ============================================================
   ATLAS ONE — Components
   Buttons, pills, cards, tables, modals, forms, empty states.
   ============================================================ */

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--blue);
  color: #F0F0F0;
  border-color: var(--blue);
}
.btn-primary:hover:not(:disabled) {
  background: var(--blue-hover);
  border-color: var(--blue-hover);
}

.btn-secondary {
  background: var(--white);
  color: var(--grey-700);
  border-color: var(--grey-200);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--grey-50);
  border-color: var(--grey-300);
}

.btn-danger {
  background: var(--white);
  color: var(--red);
  border-color: var(--red-mid);
}
.btn-danger:hover:not(:disabled) {
  background: var(--red-light);
}

.btn-ghost {
  background: transparent;
  color: var(--grey-600);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) {
  background: var(--grey-100);
  color: var(--grey-800);
}

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

.btn-icon {
  padding: 6px;
  border-radius: var(--radius-sm);
}

.btn-icon svg {
  width: 14px;
  height: 14px;
}

/* ------------------------------------------------------------
   HEADER ACTION BUTTONS — uniform across the whole platform.
   Every top-right page-action button matches the dashboard
   "Revenue / Forecast" button: blue box, 12px font, same size.
   Overrides per-page btn-secondary / btn-sm / btn-ghost usage.
   (The calendar date-nav cluster `.cal-nav` keeps its stepper.)
   ------------------------------------------------------------ */
.page-actions:not(.cal-nav) .btn {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
}
.page-actions:not(.cal-nav) .btn:hover:not(:disabled) {
  background: var(--blue-hover);
  border-color: var(--blue-hover);
}

/* ============================================================
   STATUS PILLS
   ============================================================ */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.pill-green   { background: var(--green-light);  color: var(--green); }
.pill-amber   { background: var(--amber-light);  color: var(--amber); }
.pill-red     { background: var(--red-light);    color: var(--red); }
.pill-blue    { background: var(--blue-light);   color: var(--blue); }
.pill-purple  { background: var(--purple-light); color: var(--purple); }
.pill-grey    { background: var(--grey-100);     color: var(--grey-600); }
.pill-navy    { background: var(--grey-800);     color: var(--white); }

.pill-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

/* Health dot */
.health-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.health-dot.green  { background: var(--green); }
.health-dot.amber  { background: var(--amber); }
.health-dot.red    { background: var(--red); }

/* ============================================================
   CARDS
   ============================================================ */

/* Premium elevated cards — soft shadow, larger radius, no hard border. */
.card {
  background: var(--white);
  border: none;
  border-radius: 14px;
  padding: 22px;
  box-shadow: var(--shadow-soft);
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover {
  box-shadow: var(--shadow-soft-hover);
  transform: translateY(-1px);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--navy);
}

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px)  { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }

.kpi-card {
  background: var(--white);
  border: none;
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: var(--shadow-soft);
  cursor: default;
  transition: box-shadow var(--transition), transform var(--transition);
}
.kpi-card:hover {
  box-shadow: var(--shadow-soft-hover);
  transform: translateY(-1px);
}

.kpi-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 4px;
}

.kpi-value.kpi-blue   { color: var(--blue); }
.kpi-value.kpi-green  { color: var(--green); }
.kpi-value.kpi-amber  { color: var(--amber); }
.kpi-value.kpi-red    { color: var(--red); }

.kpi-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--grey-400);
}

/* Prior-month change chip on KPI cards */
.kpi-delta { display: inline-block; margin-top: 8px; font-size: 11px; font-weight: 700; }
.kpi-delta.up   { color: var(--green); }
.kpi-delta.down { color: var(--red); }
.kpi-delta.flat { color: var(--grey-400); }
.kpi-delta-note { font-weight: 500; color: var(--grey-400); letter-spacing: 0; }

/* ============================================================
   TABLES
   ============================================================ */

.table-wrapper {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.table-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--grey-200);
  flex-wrap: wrap;
}

.table-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.table-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-input {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--grey-50);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  min-width: 200px;
}

.search-input input {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  color: var(--grey-800);
  outline: none;
  width: 100%;
}

.search-input input::placeholder {
  color: var(--grey-400);
}

.search-input svg {
  width: 14px;
  height: 14px;
  color: var(--grey-400);
  flex-shrink: 0;
}

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

thead th {
  padding: 11px 14px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--grey-500);
  background: var(--grey-50);
  border-bottom: 1px solid var(--grey-100);
  text-align: left;
  white-space: nowrap;
}

thead th:first-child { padding-left: 18px; }
thead th:last-child  { padding-right: 18px; }

tbody tr {
  border-bottom: 1px solid var(--grey-100);
  transition: background var(--transition-fast);
}

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

tbody tr:hover { background: var(--grey-50); }

tbody td {
  padding: 13px 14px;
  font-size: 13px;
  color: var(--grey-700);
  vertical-align: middle;
}

tbody td:first-child { padding-left: 18px; }
tbody td:last-child  { padding-right: 18px; }

.td-primary {
  font-weight: 600;
  color: var(--navy);
}

.td-primary a, .td-link {
  color: var(--navy);
  text-decoration: none;
  font-weight: 600;
}

.td-primary a:hover, .td-link:hover {
  color: var(--blue);
  text-decoration: underline;
}

.td-muted {
  color: var(--grey-400);
  font-style: italic;
}

.td-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
}

.table-empty {
  padding: 48px 16px;
  text-align: center;
}

.table-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--grey-200);
  font-size: 11px;
  color: var(--grey-400);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ============================================================
   FORMS
   ============================================================ */

.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--grey-500);
  margin-bottom: 5px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13px;
  color: var(--grey-800);
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  appearance: none;
  -webkit-appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.form-input::placeholder { color: var(--grey-400); }

.form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2364748B' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
  padding-right: 30px;
  cursor: pointer;
}

.form-textarea {
  resize: vertical;
  min-height: 72px;
  line-height: 1.5;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.form-hint {
  font-size: 11px;
  color: var(--grey-400);
  margin-top: 3px;
}

/* Checkbox group */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 6px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--grey-700);
  cursor: pointer;
  user-select: none;
}

.checkbox-item input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--blue);
  cursor: pointer;
}

/* Filter select — smaller, inline */
.filter-select {
  padding: 6px 28px 6px 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--grey-700);
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2364748B' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 14px;
  transition: border-color var(--transition-fast);
}

.filter-select:focus {
  border-color: var(--blue);
  outline: none;
}

/* ============================================================
   MODAL
   ============================================================ */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.50);
  z-index: 1000;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  box-shadow: var(--shadow-lg);
  margin: auto;
  overflow: hidden;
}

.modal-lg { max-width: 800px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--grey-200);
}

.modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.01em;
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--grey-400);
  transition: all var(--transition-fast);
  background: none;
  border: none;
}

.modal-close:hover {
  background: var(--grey-100);
  color: var(--grey-700);
}

.modal-body {
  padding: 20px 24px;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 24px;
  border-top: 1px solid var(--grey-200);
  background: var(--grey-50);
}

/* ============================================================
   EMPTY STATE
   ============================================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.empty-state-icon {
  width: 40px;
  height: 40px;
  color: var(--grey-300);
  margin-bottom: 12px;
}

.empty-state-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--grey-600);
  margin-bottom: 4px;
}

.empty-state-desc {
  font-size: 13px;
  color: var(--grey-400);
  max-width: 360px;
  line-height: 1.5;
}

.empty-state-action {
  margin-top: 16px;
}

/* ============================================================
   SECTION PANELS (for dashboard feed panels)
   ============================================================ */

.panels-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 900px) {
  .panels-row { grid-template-columns: 1fr; }
  .form-row   { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr; }
}

.panel-list {
  list-style: none;
}

.panel-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--grey-100);
  gap: 8px;
}

.panel-list-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.panel-list-item-link {
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding-left: 8px;
  padding-right: 8px;
  margin: 0 -8px;
  transition: background var(--transition-fast);
}
.panel-list-item-link:hover { background: var(--grey-50); }

.panel-list-item-main {
  flex: 1;
  min-width: 0;
}

.panel-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel-item-sub {
  font-size: 11px;
  color: var(--grey-400);
  margin-top: 1px;
}

/* ============================================================
   TABS
   ============================================================ */

.tabs {
  display: flex;
  border-bottom: 1px solid var(--grey-200);
  margin-bottom: 20px;
  gap: 0;
  overflow-x: auto;
}

.tab {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--grey-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all var(--transition-fast);
  user-select: none;
}

.tab:hover {
  color: var(--grey-700);
}

.tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
  font-weight: 600;
}

.tab-count {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--grey-500);
  background: var(--grey-100);
  border-radius: 10px;
  padding: 0 6px;
  margin-left: 2px;
}
.tab.active .tab-count { color: var(--blue); background: var(--blue-light); }

/* ============================================================
   TOAST / NOTIFICATION
   ============================================================ */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--navy);
  color: var(--white);
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(8px);
  transition: all var(--transition);
  pointer-events: all;
  max-width: 320px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success { background: var(--green); }
.toast.error   { background: var(--red); }
.toast.warning { background: var(--amber); }

/* ============================================================
   CONFIRM DIALOG
   ============================================================ */

.confirm-dialog {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.50);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.confirm-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.confirm-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
}

.confirm-message {
  font-size: 13px;
  color: var(--grey-600);
  line-height: 1.5;
  margin-bottom: 20px;
}

.confirm-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ============================================================
   MISC UTILITIES
   ============================================================ */

.divider      { border: none; border-top: 1px solid var(--grey-100); }
.filter-chip  { display:inline-flex;align-items:center;gap:2px;padding:2px 8px;border-radius:20px;background:var(--blue);color:#fff;font-size:11px;font-weight:600; }
.suppression-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; margin-bottom: 16px;
  background: var(--amber-light); border: 1px solid var(--amber-mid);
  border-radius: var(--radius); color: var(--grey-700);
  font-size: 12.5px; line-height: 1.45;
}
.suppression-banner svg { color: var(--amber); }
.lead-view-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.lead-view-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--grey-400); }
.seg-toggle { display: inline-flex; background: var(--grey-100); border: 1px solid var(--grey-200); border-radius: var(--radius-sm); padding: 2px; gap: 2px; }
.seg-btn { font-family: inherit; font-size: 12px; font-weight: 600; color: var(--grey-600); background: transparent; border: none; border-radius: 4px; padding: 5px 14px; cursor: pointer; transition: all var(--transition-fast); }
.seg-btn:hover { color: var(--grey-800); }
.seg-btn.active { background: var(--white); color: var(--navy); box-shadow: var(--shadow-xs); }
.bulk-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 16px; background: var(--blue-light); border-bottom: 1px solid var(--blue-mid); }
.bulk-count { font-size: 13px; font-weight: 600; color: var(--blue-dark); }
.bulk-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
tbody tr.row-selected, tbody tr.row-selected:hover { background: var(--blue-light); }
@media (max-width: 600px) { table.cards-sm td.lead-select-cell { display: none; } }
.kpi-card-link:hover { box-shadow: 0 0 0 2px var(--blue); }
.text-muted   { color: var(--grey-400); }
.text-sm      { font-size: 12px; }
.text-xs      { font-size: 11px; }
.font-mono    { font-family: 'SF Mono', Monaco, Consolas, monospace; font-size: 12px; }
.truncate     { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; gap: 8px; }
.gap-4        { gap: 4px; }
.gap-8        { gap: 8px; }
.mt-4         { margin-top: 4px; }
.mt-8         { margin-top: 8px; }
.mt-16        { margin-top: 16px; }
.mb-16        { margin-bottom: 20px; }
.mb-24        { margin-bottom: 24px; }

/* ============================================================
   RESPONSIVE — phones (≤600px)
   Bigger tap targets, full-screen modals, tables → stacked cards.
   ============================================================ */
@media (max-width: 600px) {
  /* Toolbar: search fills the row, filters wrap underneath */
  .table-toolbar { padding: 10px 12px; }
  .table-toolbar-left { flex-wrap: wrap; width: 100%; }
  .search-input { min-width: 0; flex: 1 1 100%; }
  .filter-select { flex: 1; }

  /* Comfortable tap targets */
  .btn    { padding: 9px 14px; font-size: 13px; }
  .btn-sm { padding: 6px 10px; font-size: 12px; }

  /* Forms: single column, 16px inputs (prevents iOS zoom-on-focus) */
  .form-input, .form-select, .form-textarea { padding: 10px 12px; font-size: 16px; }
  .checkbox-grid { grid-template-columns: 1fr 1fr; }

  /* Modal fills the screen and scrolls */
  .modal-overlay { padding: 0; }
  .modal, .modal-lg {
    max-width: 100%;
    min-height: 100vh;
    border-radius: 0;
    display: flex;
    flex-direction: column;
  }
  .modal-body { max-height: none; flex: 1; }
  .modal-footer { position: sticky; bottom: 0; }
  .modal-footer .btn { flex: 1; justify-content: center; }

  .confirm-box { max-width: 100%; }

  /* ---- Tables become stacked cards (opt-in via .cards-sm) ---- */
  table.cards-sm thead { display: none; }
  table.cards-sm,
  table.cards-sm tbody,
  table.cards-sm tr,
  table.cards-sm td { display: block; width: 100%; }

  table.cards-sm tr {
    border: 1px solid var(--grey-200);
    border-radius: var(--radius);
    margin: 0 12px 10px;
    padding: 4px 0;
    background: var(--white);
  }
  table.cards-sm tr:hover { background: var(--white); }

  table.cards-sm td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 8px 14px !important;
    border: none;
    text-align: right;
    font-size: 13px;
  }
  table.cards-sm td::before {
    content: attr(data-label);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--grey-500);
    text-align: left;
    flex-shrink: 0;
  }

  /* First cell acts as the card title */
  table.cards-sm td.td-primary {
    display: block;
    text-align: left;
    font-size: 15px;
    padding-top: 12px !important;
    border-bottom: 1px solid var(--grey-100);
    margin-bottom: 4px;
  }
  table.cards-sm td.td-primary::before { display: none; }

  /* Actions span the full width as two big buttons */
  table.cards-sm td:last-child { justify-content: flex-start; }
  table.cards-sm td:last-child::before { display: none; }
  table.cards-sm .td-actions { justify-content: flex-start; width: 100%; }
  table.cards-sm .td-actions .btn { flex: 1; justify-content: center; }

  .table-footer { flex-direction: column; gap: 4px; align-items: flex-start; }
}

/* ============================================================
   DASHBOARD — Material-style stat cards & quick-stat pills
   ============================================================ */

.dash-greeting {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 28px;
}
.dash-greeting-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.02em;
}
.dash-greeting-date {
  font-size: 13px;
  color: var(--grey-400);
  font-weight: 500;
}

/* Hero stat cards */
.dash-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 20px;
  padding-top: 20px;
}
@media (max-width: 1100px) { .dash-stat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .dash-stat-grid { grid-template-columns: 1fr; } }

.dash-stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04);
  position: relative;
  overflow: visible;
  cursor: default;
  transition: box-shadow var(--transition), transform var(--transition);
}
.dash-stat-card-link { cursor: pointer; }
.dash-stat-card-link:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  transform: translateY(-2px);
}

.dash-stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  position: absolute;
  top: -18px;
  left: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-stat-body {
  padding: 12px 16px 10px 90px;
  min-height: 74px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  text-align: right;
}
.dash-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--grey-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.dash-stat-value {
  font-size: 30px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.03em;
  line-height: 1;
}
.dash-stat-footer {
  border-top: 1px solid var(--grey-100);
  padding: 8px 14px;
  font-size: 11px;
  color: var(--grey-400);
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
}

/* Quick stats row */
.dash-quick-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
@media (max-width: 1100px) { .dash-quick-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px)  { .dash-quick-row { grid-template-columns: repeat(2, 1fr); } }

.dash-quick-pill {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.dash-quick-pill:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow-xs);
}
.dash-quick-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dash-quick-info { flex: 1; min-width: 0; }
.dash-quick-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.02em;
  line-height: 1;
}
.dash-quick-lbl {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--grey-400);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Revenue + Follow-ups split row ---- */
.dash-split-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 900px) { .dash-split-row { grid-template-columns: 1fr; } }

/* Revenue card — zero out card padding so bars go edge-to-edge */
.dash-rev-card {
  padding: 20px 0 0;
  display: flex;
  flex-direction: column;
}
.dash-rev-card .card-header {
  padding: 0 20px 0;
  margin-bottom: 12px;
}

/* MRR badge next to card title */
.dash-mrr-badge {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.02em;
  line-height: 1;
}
.dash-mrr-per {
  font-size: 11px;
  font-weight: 600;
  color: var(--grey-400);
  letter-spacing: 0;
}

/* Client revenue bar rows */
.dash-rev-list {
  flex: 1;
  padding: 4px 0 8px;
}
.dash-rev-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 20px;
  border-bottom: 1px solid var(--grey-100);
  transition: background var(--transition-fast);
}
.dash-rev-row:last-child { border-bottom: none; }
.dash-rev-row:hover { background: var(--grey-50); }

.dash-rev-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  width: 140px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-rev-bar-track {
  flex: 1;
  height: 6px;
  background: var(--grey-100);
  border-radius: 99px;
  overflow: hidden;
}
.dash-rev-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue) 0%, var(--blue-dark) 100%);
  border-radius: 99px;
  transition: width var(--transition);
}
.dash-rev-amount {
  font-size: 12px;
  font-weight: 700;
  color: var(--grey-700);
  width: 72px;
  text-align: right;
  flex-shrink: 0;
}

/* Ad spend footer */
.dash-rev-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-top: 1px solid var(--grey-100);
  background: var(--grey-50);
  border-radius: 0 0 var(--radius) var(--radius);
  font-size: 12px;
  color: var(--grey-500);
}

/* Active Projects table — clickable rows */
.dash-proj-row { cursor: pointer; }

/* Even 1:1 split (Active Projects + Follow-Ups) */
.dash-split-even { grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .dash-split-even { grid-template-columns: 1fr; } }
/* When the revenue card is hidden (non-finance), Campaigns takes the full row. */
.dash-split-solo { grid-template-columns: 1fr; }

/* Campaigns card (current + upcoming) — roomier rows to fill the space (#2) */
.dash-camp-body { padding: 6px 22px 18px; }
.dash-camp-group + .dash-camp-group { margin-top: 20px; }
.dash-camp-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--grey-400); margin-bottom: 10px;
}
.dash-camp-livedot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 3px rgba(60,117,47,0.15);
  animation: dash-pulse 2s ease-in-out infinite;
}

/* Subtle pulsing on the dashboard's circular indicators */
@keyframes dash-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.dash-quick-dot { animation: dash-pulse 2.4s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .dash-camp-livedot, .dash-quick-dot { animation: none; }
}
.dash-camp-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 12px 0; border-bottom: 1px solid var(--grey-100);
}
.dash-camp-row:last-child { border-bottom: none; }
.dash-camp-name {
  font-size: 15px; font-weight: 600; color: var(--navy);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash-camp-meta { font-size: 12.5px; color: var(--grey-500); white-space: nowrap; flex-shrink: 0; }

/* Campaigns + Forecast row — taller cards for breathing room (#2) */
.dash-rev-card, .dash-mini-card { min-height: 400px; }

/* Mini revenue forecast card */
.dash-mini-card { display: flex; flex-direction: column; }
.dash-mini-chartwrap { position: relative; padding: 0; }
.dash-mini-svg { width: 100%; height: 190px; display: block; }
.dash-mini-head-right { display: flex; align-items: center; gap: 8px; }
/* HTML overlay dot — stays perfectly circular (the SVG itself is stretched). */
.dash-mini-focus-dot {
  position: absolute; width: 9px; height: 9px; border-radius: 50%;
  background: var(--white); border: 2.5px solid var(--blue);
  transform: translate(-50%, -50%); pointer-events: none; z-index: 2;
  transition: left .45s cubic-bezier(.4,0,.2,1), top .45s cubic-bezier(.4,0,.2,1);
}
.dash-mini-hit { pointer-events: all; cursor: crosshair; }
.dash-mini-tip {
  position: absolute; z-index: 6; min-width: 150px;
  background: var(--white); border: 1px solid var(--grey-200); border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(0,0,0,0.14); padding: 7px 9px; pointer-events: none;
}
.dash-tip-title { font-size: 10.5px; font-weight: 700; color: var(--navy); margin-bottom: 5px; }
.dash-tip-row { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--grey-600); padding: 1px 0; }
.dash-tip-row strong { margin-left: auto; color: var(--navy); font-variant-numeric: tabular-nums; }
.dash-tip-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dash-mini-tabs { display: inline-flex; gap: 2px; background: var(--grey-100); border-radius: 8px; padding: 2px; }
.dash-mini-tab {
  border: none; background: transparent; cursor: pointer;
  font-size: 11px; font-weight: 600; color: var(--grey-500);
  padding: 4px 9px; border-radius: 6px; transition: all var(--transition-fast);
}
.dash-mini-tab:hover { color: var(--navy); }
.dash-mini-tab.active { background: var(--white); color: var(--blue); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.dash-mini-legend {
  display: flex; flex-wrap: wrap; gap: 12px;
  padding: 6px 20px 0; font-size: 10.5px; color: var(--grey-500);
}
.dash-leg { display: inline-flex; align-items: center; gap: 5px; }
.dash-leg-line { width: 14px; height: 2.5px; border-radius: 2px; display: inline-block; }
.dash-leg-line.dashed { height: 0; border-top: 2.5px dashed currentColor; background: none !important; }
.dash-mini-snap { padding: 4px 20px 10px; }
.dash-mini-snap-month { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--grey-400); margin-bottom: 8px; }
.dash-mini-figs { display: flex; gap: 18px; }
.dash-mini-fig { display: flex; flex-direction: column; gap: 2px; }
.dash-mini-fig-lbl { font-size: 11px; color: var(--grey-500); }
.dash-mini-fig-val { font-size: 16px; font-weight: 800; color: var(--navy); letter-spacing: -0.02em; }
.dash-mini-delta { font-size: 11px; font-weight: 700; margin-left: 6px; letter-spacing: 0; }
.dash-mini-delta.up { color: var(--green); }
.dash-mini-delta.down { color: var(--red); }

/* Invoice shortcut card (replaces the duplicate Active Projects list) */
.dash-invoice-shortcut {
  display: flex; align-items: center; gap: 14px; padding: 16px;
  border: 1px dashed var(--grey-300); border-radius: var(--radius);
  cursor: pointer; transition: border-color var(--transition-fast), background var(--transition-fast);
}
.dash-invoice-shortcut:hover { border-color: var(--blue); background: var(--blue-light); }
.dash-invoice-ico { width: 48px; height: 48px; border-radius: 12px; background: var(--blue); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dash-invoice-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dash-invoice-h { font-size: 14px; font-weight: 700; color: var(--navy); }
.dash-invoice-sub { font-size: 12px; color: var(--grey-500); }
.dash-invoice-cta { font-size: 13px; font-weight: 700; color: var(--blue); white-space: nowrap; }
.dash-followup-row { cursor: pointer; transition: background var(--transition-fast); }
.dash-followup-row:hover { background: var(--grey-50); }

/* ---- Page loading skeletons (shown during cloud fetch) ---- */
@keyframes atlas-shimmer { 0% { background-position: -520px 0; } 100% { background-position: 520px 0; } }
.skel {
  background: linear-gradient(90deg, #dde4ee 25%, #eef3f9 37%, #dde4ee 63%);
  background-size: 520px 100%;
  animation: atlas-shimmer 1.2s infinite linear;
  border-radius: 8px;
}
.page-skeleton { padding: 2px 0; }
.skel-title { height: 28px; width: 220px; margin-bottom: 22px; }
.skel-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.skel-card { height: 88px; }
.skel-rows { display: flex; flex-direction: column; gap: 10px; }
.skel-row { height: 44px; }
@media (max-width: 760px) {
  .skel-cards { grid-template-columns: repeat(2, 1fr); }
}
