/* ShortletBox Platform console — /platform only.
 *
 * Design source: docs/design/super-admin/ShortletBox Admin Console.dc.html.
 * Layout from that file, colour and type from sb_tokens.css.
 *
 * Everything here is prefixed `pf-` and scoped under `.pf-app`. The tenant
 * admin (/admin) and the landlord portal (/portal) share sb_tokens.css with
 * this file, so nothing in here may redefine an --sb-* token or a shared
 * .sb-* component class — the console's rounder, floatier surfaces are its
 * own, and must not leak into the other two apps.
 */

@keyframes sbPulse { 0%, 100% { opacity: 1 } 50% { opacity: .35 } }

.pf-app {
  /* One value the brand tokens don't carry: a field a step darker than Mist,
     so the white cards read as floating rather than flush. */
  --pf-field: #E9EBEF;
  --pf-hover: #F4F6F9;
  --pf-rail: #F1F3F7;

  min-height: 100vh;
  margin: 0;
  background: var(--pf-field);
  font-family: var(--sb-font-text);
  color: var(--sb-navy);
  -webkit-font-smoothing: antialiased;
}

.pf-shell {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 22px;
}

/* ---------- sidebar ---------- */

.pf-sidebar {
  width: 252px;
  flex: 0 0 252px;
  position: sticky;
  top: 22px;
  background: var(--sb-paper);
  border-radius: var(--sb-r-xl);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  min-height: calc(100vh - 44px);
  box-shadow: 0 1px 2px rgba(20, 40, 75, 0.04);
}

.pf-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px;
}

.pf-nav-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pf-nav-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.13em;
  color: var(--sb-faint);
  padding: 0 8px;
  margin-bottom: 6px;
}

.pf-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--sb-slate);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.pf-nav-item:hover { background: var(--pf-hover); color: var(--sb-navy); }
.pf-nav-item svg { width: 19px; height: 19px; flex: 0 0 auto; }
.pf-nav-item span:first-of-type { flex: 1; }

.pf-nav-item.is-current {
  background: var(--pf-hover);
  color: var(--sb-navy);
  font-weight: 600;
}
/* The rail sits in the sidebar's 18px gutter, so only the current item shows it. */
.pf-nav-item.is-current::before {
  content: "";
  position: absolute;
  left: -18px;
  width: 3px;
  height: 22px;
  border-radius: 3px;
  background: var(--sb-ember);
}

.pf-nav-badge {
  font-family: var(--sb-font-mono);
  font-size: 11px;
  font-weight: 600;
  background: var(--sb-ember-100);
  color: var(--sb-ember-600);
  padding: 2px 7px;
  border-radius: 7px;
}
.pf-nav-badge.is-quiet {
  background: var(--sb-wash);
  color: var(--sb-muted);
}

/* ---------- sidebar audit card ---------- */

.pf-audit {
  margin-top: auto;
  border-radius: var(--sb-r-lg);
  padding: 20px 18px 18px;
  background: linear-gradient(155deg, var(--sb-navy-600), var(--sb-navy-700));
  position: relative;
  overflow: hidden;
}
.pf-audit::before {
  content: "";
  position: absolute;
  right: -46px;
  top: -46px;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(228, 96, 47, 0.5), transparent 68%);
}
.pf-audit > * { position: relative; }
.pf-audit-icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
}
.pf-audit-title {
  font-family: var(--sb-font-display);
  font-weight: 600;
  font-size: 16px;
  color: var(--sb-paper);
  margin-top: 12px;
  line-height: 1.3;
}
.pf-audit-title span { color: var(--sb-on-navy-muted); font-weight: 400; }
.pf-audit-meta {
  font-family: var(--sb-font-mono);
  font-size: 12px;
  color: var(--sb-on-navy-muted);
  margin-top: 8px;
}

/* ---------- main column ---------- */

.pf-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.pf-topbar {
  background: var(--sb-paper);
  border-radius: var(--sb-r-xl);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: 0 1px 2px rgba(20, 40, 75, 0.04);
}

.pf-search {
  flex: 1;
  max-width: 520px;
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--pf-hover);
  border: 1px solid var(--sb-border);
  border-radius: 14px;
  padding: 11px 14px;
}
.pf-search:focus-within {
  border-color: var(--sb-navy-500);
  box-shadow: 0 0 0 4px rgba(46, 78, 134, 0.12);
}
.pf-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  color: var(--sb-navy);
}
.pf-kbd {
  font-family: var(--sb-font-mono);
  font-size: 11px;
  color: var(--sb-muted);
  background: var(--sb-paper);
  border: 1px solid var(--sb-border);
  border-radius: 7px;
  padding: 3px 7px;
}

.pf-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--sb-navy);
  color: var(--sb-paper);
  display: grid;
  place-items: center;
  font-family: var(--sb-font-display);
  font-weight: 600;
  font-size: 15px;
  flex: 0 0 auto;
}

/* ---------- panels ---------- */

.pf-panel {
  background: var(--sb-paper);
  border-radius: var(--sb-r-xl);
  padding: 28px;
  box-shadow: 0 1px 2px rgba(20, 40, 75, 0.04);
}

.pf-panel-head {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}
.pf-panel-head h1 {
  font-family: var(--sb-font-display);
  font-weight: 600;
  font-size: 40px;
  letter-spacing: -0.035em;
  margin: 0;
  color: var(--sb-navy);
}
.pf-panel-head p {
  font-size: 15px;
  color: var(--sb-muted);
  margin: 6px 0 0;
}

/* Console buttons are pills, unlike the tenant admin's .sb-btn. */
.pf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1.5px solid transparent;
  border-radius: var(--sb-r-pill);
  padding: 13px 22px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease;
}
.pf-btn-primary { background: var(--sb-navy); color: var(--sb-paper); }
.pf-btn-primary:hover { background: var(--sb-navy-700); color: var(--sb-paper); }
.pf-btn-ghost { border-color: var(--sb-navy); color: var(--sb-navy); background: transparent; }
.pf-btn-ghost:hover { background: var(--pf-hover); color: var(--sb-navy); }
.pf-btn-ember { background: var(--sb-ember); color: var(--sb-paper); border-radius: 12px; padding: 10px; width: 100%; font-size: 13px; }
.pf-btn-ember:hover { background: var(--sb-ember-600); color: var(--sb-paper); }
.pf-btn-sm { padding: 9px 16px; font-size: 13.5px; }
.pf-btn-danger { border-color: var(--sb-danger-200); color: var(--sb-danger); background: transparent; }
.pf-btn-danger:hover { background: var(--sb-danger-100); color: var(--sb-danger); }

/* button_to wraps its button in a form, which would otherwise break the
   button rows this shell lays out with flex. */
.pf-panel-head form { margin: 0; }

.pf-input {
  border: 1px solid var(--sb-border);
  border-radius: 12px;
  background: var(--sb-paper);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  color: var(--sb-navy);
}
.pf-input:focus {
  outline: none;
  border-color: var(--sb-navy-500);
  box-shadow: 0 0 0 3px rgba(46, 78, 134, 0.12);
}

/* ---------- forms ---------- */

.pf-field { display: flex; flex-direction: column; gap: 7px; }
.pf-field .pf-input { width: 100%; box-sizing: border-box; }
.pf-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sb-muted);
}
.pf-hint { font-size: 12.5px; color: var(--sb-faint); }

.pf-link { font-size: 13.5px; font-weight: 600; color: var(--sb-navy); text-decoration: none; }
.pf-link:hover { color: var(--sb-ember-600); }

.pf-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
}
.pf-check input { width: 17px; height: 17px; accent-color: var(--sb-navy); cursor: pointer; }

.pf-back {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  color: var(--sb-muted);
  background: var(--pf-hover);
}
.pf-back:hover { color: var(--sb-navy); }

/* ---------- stat tiles ---------- */

.pf-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 26px;
}

.pf-stat {
  border: 1px solid var(--sb-border);
  border-radius: var(--sb-r-lg);
  padding: 22px;
}
.pf-stat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.pf-stat-label { font-size: 15px; font-weight: 500; }
.pf-stat-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--sb-border);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.pf-stat-value {
  font-family: var(--sb-font-display);
  font-weight: 600;
  font-size: 46px;
  letter-spacing: -0.04em;
  margin-top: 14px;
  line-height: 1;
}
.pf-stat-value small { font-size: 26px; letter-spacing: -0.02em; }
/* Exact naira runs far longer than the design's rounded "₦42.8M", so money
   tiles step down a size and use tabular figures to stop them wrapping. */
.pf-stat-value.is-money {
  font-size: 32px;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.pf-stat-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--sb-muted);
}

/* The lead tile is the one navy surface in the row. */
.pf-stat.is-lead {
  border: 0;
  background: linear-gradient(150deg, var(--sb-navy-600), var(--sb-navy-700));
  position: relative;
  overflow: hidden;
}
.pf-stat.is-lead::before {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -70px;
  width: 190px;
  height: 190px;
  background: radial-gradient(circle, rgba(228, 96, 47, 0.42), transparent 66%);
}
.pf-stat.is-lead > * { position: relative; }
.pf-stat.is-lead .pf-stat-label { color: rgba(255, 255, 255, 0.86); }
.pf-stat.is-lead .pf-stat-value { color: var(--sb-paper); }
.pf-stat.is-lead .pf-stat-dot { border-color: rgba(255, 255, 255, 0.32); }
.pf-stat.is-lead .pf-stat-foot { color: rgba(255, 255, 255, 0.66); }

.pf-tag {
  font-family: var(--sb-font-mono);
  font-size: 11px;
  border-radius: 6px;
  padding: 2px 6px;
  background: var(--sb-wash);
  color: var(--sb-slate);
}
.pf-tag.is-onnavy { background: rgba(255, 255, 255, 0.16); color: var(--sb-paper); }
.pf-tag.is-good { background: var(--sb-success-100); color: var(--sb-success); }
.pf-tag.is-warn { background: var(--sb-warning-100); color: var(--sb-warning-700); }
.pf-tag.is-bad { background: var(--sb-danger-100); color: var(--sb-danger); }

/* ---------- cards + tables ---------- */

.pf-card {
  border: 1px solid var(--sb-border);
  border-radius: var(--sb-r-lg);
  padding: 22px 24px;
}
.pf-card-title {
  font-family: var(--sb-font-display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.02em;
}
.pf-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pf-chip {
  font-size: 12.5px;
  color: var(--sb-muted);
  border: 1px solid var(--sb-border);
  border-radius: var(--sb-r-pill);
  white-space: nowrap;
  padding: 6px 12px;
}

.pf-table {
  border: 1px solid var(--sb-border);
  border-radius: var(--sb-r-lg);
  overflow: hidden;
}
.pf-tr {
  display: grid;
  gap: 14px;
  align-items: center;
  padding: 16px 22px;
  border-top: 1px solid var(--sb-border-soft);
  text-decoration: none;
  color: inherit;
}
.pf-tr:hover { background: var(--sb-tint); }
.pf-th {
  display: grid;
  gap: 14px;
  padding: 14px 22px;
  background: var(--sb-mist);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--sb-muted);
  text-transform: uppercase;
}

.pf-initials {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  font-family: var(--sb-font-display);
  font-weight: 600;
  font-size: 14px;
  background: var(--sb-wash);
  color: var(--sb-navy);
}

.pf-num { font-family: var(--sb-font-mono); font-size: 14px; }

.pf-badge {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 8px;
  padding: 5px 10px;
  background: var(--sb-wash);
  color: var(--sb-slate);
}
.pf-badge.is-good { background: var(--sb-success-100); color: var(--sb-success-700); }
.pf-badge.is-warn { background: var(--sb-warning-100); color: var(--sb-warning-700); }
.pf-badge.is-bad { background: var(--sb-danger-100); color: var(--sb-danger-700); }

.pf-status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 600;
}
.pf-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}

/* ---------- filter pills ---------- */

.pf-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 24px;
}
.pf-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--sb-border);
  border-radius: var(--sb-r-pill);
  white-space: nowrap;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--sb-navy);
  background: var(--sb-paper);
  text-decoration: none;
}
.pf-filter:hover { background: var(--sb-wash); }
.pf-filter.is-on {
  background: var(--sb-navy);
  border-color: var(--sb-navy);
  color: #fff;
}
.pf-filter-count {
  font-family: var(--sb-font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--sb-muted);
}
.pf-filter.is-on .pf-filter-count { color: rgba(255, 255, 255, 0.7); }

.pf-sort {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--sb-muted);
  border: 1px solid var(--sb-border);
  border-radius: var(--sb-r-pill);
  white-space: nowrap;
  padding: 9px 15px;
}

/* ---------- flash ---------- */

.pf-flash {
  border-radius: var(--sb-r-lg);
  padding: 14px 20px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.pf-flash.is-good { background: var(--sb-success-100); color: var(--sb-success-700); }
.pf-flash.is-bad { background: var(--sb-danger-100); color: var(--sb-danger-700); }

/* ---------- roadmap (unbuilt screens) ---------- */

.pf-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 56px 28px 64px;
}
.pf-soon-icon {
  width: 62px;
  height: 62px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: var(--sb-wash);
  color: var(--sb-navy-500);
}
.pf-soon h2 {
  font-family: var(--sb-font-display);
  font-weight: 600;
  font-size: 28px;
  letter-spacing: -0.03em;
  margin: 0;
  color: var(--sb-navy);
}
.pf-soon p {
  font-size: 15px;
  color: var(--sb-muted);
  margin: 0;
  max-width: 520px;
  line-height: 1.6;
}
.pf-soon-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-top: 12px;
  width: 100%;
  max-width: 760px;
  text-align: left;
}
.pf-soon-list div {
  border: 1px dashed var(--sb-line);
  border-radius: var(--sb-r-md);
  padding: 14px 16px;
  font-size: 13.5px;
  color: var(--sb-slate);
}

@media (max-width: 1180px) {
  .pf-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
