/* Admin Management — founder business ops dashboard (SaaS admin, not user budget UI) */

.mgmt-page { display: grid; gap: 16px; }

.mgmt-header-bar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
}
.mgmt-header-title { display: flex; align-items: center; gap: 10px; }
.mgmt-header-title h2 { margin: 0; font-family: var(--font-display); font-size: 20px; font-weight: 600; }
.mgmt-admin-badge {
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; background: var(--tint); color: var(--mint-700);
  border: 1px solid rgba(14, 124, 102, .2);
}
.mgmt-header-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.mgmt-kpi-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
}
@media (max-width: 1100px) { .mgmt-kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .mgmt-kpi-grid { grid-template-columns: 1fr; } }

.mgmt-kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; min-height: 92px;
}
.mgmt-kpi.accent { border-color: rgba(14, 124, 102, .35); box-shadow: 0 0 0 1px rgba(14, 124, 102, .08); }
.mgmt-kpi-label { font-size: 12px; font-weight: 600; color: var(--ink-500); margin-bottom: 6px; }
.mgmt-kpi-value { font-size: 22px; font-weight: 800; color: var(--ink-900); letter-spacing: -.02em; }
.mgmt-kpi-sub { font-size: 12px; color: var(--ink-400); margin-top: 4px; }
.mgmt-kpi.tone-good .mgmt-kpi-value { color: var(--mint-700); }
.mgmt-kpi.tone-bad .mgmt-kpi-value { color: var(--bad); }
.mgmt-kpi.tone-warn .mgmt-kpi-sub { color: #b45309; }

.mgmt-mid-grid {
  display: grid; grid-template-columns: 1.2fr 1fr 0.9fr; gap: 16px;
}
@media (max-width: 1100px) { .mgmt-mid-grid { grid-template-columns: 1fr; } }

.mgmt-panel .head h3 { font-size: 14px; font-weight: 700; }

.mgmt-trend-wrap { position: relative; }
.mgmt-trend-svg { width: 100%; height: 140px; display: block; }
.mgmt-trend-labels {
  display: flex; justify-content: space-between; margin-top: 6px;
  font-size: 10.5px; color: var(--ink-400);
}
.mgmt-trend-legend { display: flex; gap: 14px; margin-top: 10px; font-size: 12px; font-weight: 600; }
.mgmt-trend-legend .dot::before {
  content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px;
}
.mgmt-trend-legend .rev::before { background: var(--mint-600); }
.mgmt-trend-legend .exp::before { background: var(--bad); }

.mgmt-donut { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.mgmt-donut-total { font-size: 16px; font-weight: 800; fill: var(--ink-900); }
.mgmt-donut-sub { font-size: 9px; font-weight: 700; fill: var(--ink-400); letter-spacing: .06em; }
.mgmt-donut-legend { flex: 1; min-width: 180px; display: grid; gap: 6px; }
.mgmt-donut-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.mgmt-donut-row .sw { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.mgmt-donut-row .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mgmt-donut-row .pct { color: var(--ink-400); font-size: 12px; min-width: 36px; text-align: right; }

.mgmt-due-list { display: grid; gap: 8px; }
.mgmt-due-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid var(--line); font-size: 13px;
}
.mgmt-due-row:last-child { border-bottom: 0; }

.mgmt-bot-grid {
  display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: start;
}
@media (max-width: 900px) { .mgmt-bot-grid { grid-template-columns: 1fr; } }

.mgmt-filters {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; display: grid; gap: 10px;
}
.mgmt-filters h4 { margin: 0 0 4px; font-size: 13px; font-weight: 700; }
.mgmt-filter-row { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink-500); }
.mgmt-filter-row select { width: 100%; }
.mgmt-check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-600); }
.mgmt-apply { width: 100%; margin-top: 4px; }

.mgmt-dre-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 0; }
.mgmt-dre-head h3 { margin: 0; font-size: 15px; }
.mgmt-dre-table { width: 100%; }
.mgmt-dre-table tr.section td { font-weight: 700; background: var(--ink-50, #f8faf9); padding-top: 12px; }
.mgmt-dre-table tr.bold td { font-weight: 800; }
.mgmt-collapse {
  border: 0; background: none; cursor: pointer; font-size: 12px; margin-right: 6px; color: var(--ink-500);
}

.mgmt-pill {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  text-transform: capitalize; white-space: nowrap;
}
.mgmt-pill.good { background: #d1fae5; color: #047857; }
.mgmt-pill.bad { background: #fee2e2; color: #b91c1c; }
.mgmt-pill.warn { background: #fef3c7; color: #b45309; }
.mgmt-pill.info { background: #e0f2fe; color: #0369a1; }
.mgmt-pill.muted { background: var(--line); color: var(--ink-500); }

.mgmt-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mgmt-toolbar h3 { margin: 0; font-size: 17px; font-weight: 700; }

.mgmt-table { min-width: 900px; }
.mgmt-table .num { text-align: right; font-variant-numeric: tabular-nums; }

.mgmt-conn-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px;
}
.mgmt-conn-card { padding: 0; overflow: hidden; }
.mgmt-conn-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.mgmt-conn-meta { padding: 12px 16px; display: grid; gap: 6px; }
.mgmt-conn-row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.mgmt-conn-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 16px; border-top: 1px solid var(--line); background: var(--ink-50, #f8faf9);
}
.mgmt-toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.mgmt-security-note { font-size: 12px; color: var(--ink-400); }

.mgmt-empty { padding: 24px; text-align: center; color: var(--ink-500); font-size: 13px; }
.mgmt-access-denied {
  padding: 48px 24px; text-align: center; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px;
}
.mgmt-access-denied h3 { margin: 0 0 8px; color: var(--bad); }

.mgmt-cashflow { display: grid; gap: 14px; }

/* Sidebar Management group highlight */
.uj-nav-item.mgmt-active,
.uj-side .uj-nav button.mgmt-active {
  background: rgba(14, 124, 102, .14) !important;
  color: var(--mint-700) !important;
  font-weight: 700;
}

.uj-side .mgmt-founder-badge {
  margin: 12px 10px 0; padding: 10px 12px; border-radius: 10px; font-size: 11.5px; line-height: 1.45;
  background: rgba(14, 124, 102, .08); border: 1px solid rgba(14, 124, 102, .15); color: var(--ink-600);
}
.uj-side .mgmt-founder-badge strong { display: block; color: var(--mint-700); font-size: 12px; margin-bottom: 2px; }

html[data-theme="dark"] .mgmt-kpi { background: var(--surface); }
html[data-theme="dark"] .mgmt-pill.good { background: rgba(4, 120, 87, .2); color: #6ee7b7; }
html[data-theme="dark"] .mgmt-pill.bad { background: rgba(185, 28, 28, .2); color: #fca5a5; }
