/* ════════════════════════════════════════════════════════════════
   CERTY — Refresh overlay
   Link AFTER styles.css on every app page:
     <link rel="stylesheet" href="styles.css">
     <link rel="stylesheet" href="refresh.css">
   Plain CSS only. Layers the elevated dashboard treatment across the
   whole app shell. Builds entirely on existing styles.css tokens
   (--bg, --surface, --raised, --border, --accent, --expired, …).
   No markup, id, data-* or script hooks are touched.
   ════════════════════════════════════════════════════════════════ */

/* ── Global: a soft accent wash above the dot-grid ─────────────── */
body::after {
  content: '';
  position: fixed;
  inset: 0 0 auto 0;
  height: 340px;
  background: radial-gradient(ellipse 80% 100% at 50% -20%, rgba(79,142,247,0.06), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Auth pages center their card; keep the wash from covering it visually */
.auth-body::after { height: 100%; background: radial-gradient(ellipse 70% 60% at 50% 0%, rgba(79,142,247,0.07), transparent 70%); }

.page-content { max-width: 1160px; }

/* ── Page header (dashboard + reusable) ────────────────────────── */
.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 16px;
  flex-wrap: wrap;
}
.dash-title {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.dash-subtitle {
  font-size: 0.8rem;
  color: var(--text-2);
  margin-top: 5px;
  font-family: var(--mono);
  letter-spacing: 0.01em;
}
.page-title { font-size: 1.15rem; letter-spacing: -0.01em; }

/* ── Toolbar: calmer, better-grouped control bar ───────────────── */
.toolbar {
  background: linear-gradient(180deg, var(--raised), color-mix(in srgb, var(--raised) 88%, #000));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.02) inset;
}
.tenant-select { background-color: var(--surface); min-width: 190px; font-weight: 500; }
.last-checked { display: inline-flex; align-items: center; gap: 8px; }
.last-checked:not(:empty)::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px rgba(52,211,153,0.7);
}

/* ── Stat cards: stronger hierarchy, cleaner footing ───────────── */
.stats { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat-card {
  text-align: left;
  display: flex;
  flex-direction: column;
  padding: 20px 22px 18px;
  border-radius: 12px;
  border-top-width: 0;
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  cursor: default;
}
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; }
.stat-card.expired::before  { background: var(--expired);  }
.stat-card.critical::before { background: var(--critical); }
.stat-card.warning::before  { background: var(--warning);  }
.stat-card.total::before    { background: var(--accent);   }
.stat-card:hover { transform: translateY(-3px); border-color: var(--border-hi); }
.stat-card.expired  { box-shadow: 0 2px 18px rgba(251,113,133,0.07); }
.stat-card.critical { box-shadow: 0 2px 18px rgba(251,146,60,0.07);  }
.stat-card.warning  { box-shadow: 0 2px 18px rgba(251,191,36,0.07);  }
.stat-card.total    { box-shadow: 0 2px 18px rgba(79,142,247,0.07);  }
.stat-card.expired:hover  { box-shadow: 0 10px 30px rgba(251,113,133,0.16); }
.stat-card.critical:hover { box-shadow: 0 10px 30px rgba(251,146,60,0.16);  }
.stat-card.warning:hover  { box-shadow: 0 10px 30px rgba(251,191,36,0.16);  }
.stat-card.total:hover    { box-shadow: 0 10px 30px rgba(79,142,247,0.16);  }
.stat-icon { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; flex-shrink: 0; }
.stat-card.expired  .stat-icon { background: var(--expired-bg);  border: 1px solid var(--expired-bdr);  }
.stat-card.critical .stat-icon { background: var(--critical-bg); border: 1px solid var(--critical-bdr); }
.stat-card.warning  .stat-icon { background: var(--warning-bg);  border: 1px solid var(--warning-bdr);  }
.stat-card.total    .stat-icon { background: var(--accent-bg);   border: 1px solid var(--accent-border); }
.stat-value { font-size: 2.7rem; letter-spacing: -0.02em; text-align: left; }
.stat-label { text-align: left; font-size: 0.76rem; color: var(--text-2); margin-top: 2px; }

/* ── Filter pills ──────────────────────────────────────────────── */
.filters { gap: 8px; margin-bottom: 16px; }
.filter-btn { padding: 6px 16px; }

/* ── Item cards: refined rhythm + crisper meta ─────────────────── */
.item-card { padding: 18px 24px; border-radius: 11px; }
.item-card.expired  { background: linear-gradient(90deg, rgba(251,113,133,0.06) 0%, var(--raised) 46%); }
.item-card.critical { background: linear-gradient(90deg, rgba(251,146,60,0.06) 0%, var(--raised) 46%);  }
.item-card.warning  { background: linear-gradient(90deg, rgba(251,191,36,0.06) 0%, var(--raised) 46%);  }
.item-card:hover { transform: translateX(4px); box-shadow: 0 8px 26px rgba(0,0,0,0.34); }
.item-name { font-size: 1rem; }
.item-meta { gap: 26px; margin-top: 2px; }
.meta-label { margin-bottom: 3px; }
.days-number { font-size: 2rem; }

/* ── State / loading box ───────────────────────────────────────── */
.state-box { border-radius: 12px; padding: 72px 24px; }

/* ── Auth cards (login, signup, reset, forgot) ─────────────────── */
.login-card {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border-color: var(--border-hi);
  box-shadow: 0 32px 80px rgba(0,0,0,0.5), 0 0 60px rgba(79,142,247,0.05);
}
.login-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(79,142,247,0.6), transparent);
}
.login-brand-icon { box-shadow: 0 0 22px rgba(79,142,247,0.3); }

/* Setup wizard card (onboarding) gets the same lift */
.setup-card { border-radius: 16px; position: relative; overflow: hidden; }
.setup-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(79,142,247,0.6), transparent);
}

/* ── Settings ──────────────────────────────────────────────────── */
.settings-nav-panel, .settings-main { border-radius: 12px; }
.settings-nav-panel { padding: 9px; }
.settings-menu-item { border-radius: var(--r-sm); }
.settings-menu-item.active {
  background: var(--accent-bg);
  box-shadow: inset 2px 0 0 var(--accent);
}
.tenant-card { border-radius: 11px; transition: border-color 0.14s, transform 0.14s; }
.tenant-card:hover { transform: translateY(-1px); }

/* ── History ───────────────────────────────────────────────────── */
.chart-panel { border-radius: 12px; }
.history-table { border-radius: 12px; }
.history-table thead th { letter-spacing: 0.09em; }
.history-row:hover td { background: rgba(79,142,247,0.04); }

/* ── Timeline ──────────────────────────────────────────────────── */
.tl-strip-wrap { border-radius: 12px; }
.tl-col-now { box-shadow: inset 0 2px 0 var(--accent); }
.tl-item { border-radius: 11px; transition: border-color 0.14s, background 0.14s, transform 0.14s; }
.tl-item:hover { transform: translateX(3px); }

/* ── Billing ───────────────────────────────────────────────────── */
#billingCard { border-radius: 14px !important; box-shadow: 0 24px 60px rgba(0,0,0,0.3); position: relative; overflow: hidden; }
#billingCard::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(79,142,247,0.6), transparent);
}

/* ── Responsive nicety ─────────────────────────────────────────── */
@media (max-width: 640px) {
  .dash-title { font-size: 1.35rem; }
  .stat-value { font-size: 2.3rem; }
}
