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

/* ── KPI Cards ───────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card .kpi-value {
  font-family: var(--font-heading);
  font-size: 28px;
  color: var(--ink);
}

.kpi-card .kpi-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-top: 4px;
}

/* ── Table ───────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th, .data-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  font-weight: 600;
}

/* ── Badges ──────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
}

.badge-green  { background: #D6EFE0; color: var(--accent); }
.badge-red    { background: #FAE0DE; color: var(--red); }
.badge-amber  { background: #FFF0CC; color: var(--amber); }
.badge-purple { background: #E8E7F8; color: var(--purple); }
.badge-gray   { background: var(--border); color: var(--muted); }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--border); color: var(--ink); }

/* ── Page header with action button ─────────────────── */
.page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
}
.page-header .page-title { margin-bottom: 0; }

/* ── Section labels ──────────────────────────────────── */
.section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: 10px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 18px;
  color: var(--ink);
}

/* ── Sidebar nav groups ──────────────────────────────── */
.nav-group-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--sidebar-muted);
  padding: 16px 12px 4px;
}

/* ── Summary bar (payments KPIs) ─────────────────────── */
.summary-bar {
  display: flex;
  gap: 24px;
  background: var(--sidebar-bg);
  border-radius: var(--radius);
  padding: 16px 24px;
  margin-bottom: 20px;
}

.summary-stat .summary-value {
  font-family: var(--font-heading);
  font-size: 22px;
  color: var(--sidebar-text);
}

.summary-stat .summary-label {
  font-size: 11px;
  color: var(--sidebar-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-top: 2px;
}

/* ── Progress bars ───────────────────────────────────── */
.progress-bar-track {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* ── Modal ───────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  width: 480px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
}

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

.modal-title {
  font-family: var(--font-heading);
  font-size: 20px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--muted);
  line-height: 1;
  padding: 0 4px;
}

/* ── Forms ───────────────────────────────────────────── */
.modal-form { display: flex; flex-direction: column; gap: 14px; }

.form-row { display: flex; flex-direction: column; gap: 4px; }

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.form-input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14px;
  background: var(--bg);
  color: var(--ink);
}

.form-input:focus { outline: 2px solid var(--accent); border-color: transparent; }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.required { color: var(--red); }

/* ── Sliders (projection controls) ──────────────────── */
.sliders-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 32px;
}

.slider-row { display: flex; flex-direction: column; gap: 8px; }

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

.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: var(--border);
  outline: none;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

/* ── Sidebar user footer ─────────────────────────────── */
.sidebar-user {
  margin-top: auto;
  padding: 16px 12px 4px;
  border-top: 1px solid rgba(255,255,255,.08);
}

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

.sidebar-user-role {
  font-size: 11px;
  color: var(--sidebar-muted);
  margin-top: 2px;
  margin-bottom: 10px;
}

.sidebar-logout {
  background: none;
  border: 1px solid rgba(255,255,255,.15);
  color: var(--sidebar-muted);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  width: 100%;
  text-align: center;
  transition: background 0.15s, color 0.15s;
}

.sidebar-logout:hover {
  background: rgba(255,255,255,.07);
  color: var(--sidebar-text);
}

/* ── Alert banner ────────────────────────────────────── */
.alert-banner {
  background: #FAE0DE;
  color: var(--red);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
}
