/* ============================================================
   Pearl Workspace portal — app shell layered on top of the base
   Pearl design tokens (../styles.css). Dark, sidebar-driven, no
   marketing chrome.
   ============================================================ */

body.portal-body {
  background: var(--ink);
  min-height: 100vh;
}

/* ── Auth gate ───────────────────────────────────────────── */
.auth-gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.auth-gate-card {
  width: 100%;
  max-width: 480px;
  background: #1c242c;
  border: 1px solid #33404b;
  border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 40px);
  color: #f2f5f0;
}

.auth-gate-card .brand {
  color: #f2f5f0;
  font: 700 20px var(--display);
  text-decoration: none;
}

.auth-gate-card h1 {
  font: 500 clamp(26px, 3vw, 32px) var(--display);
  margin: 18px 0 10px;
  color: #f2f5f0;
}

.auth-gate-card .wb-note {
  color: #b8c1c8;
}

.auth-gate-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: #7d8790;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.auth-gate-divider::before,
.auth-gate-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #33404b;
}
.auth-google-btn {
  width: 100%;
  text-align: center;
}

.auth-gate-back {
  display: inline-block;
  margin-top: 18px;
  color: var(--aqua);
  font-size: 13px;
  text-decoration: none;
}

.auth-gate-back:hover {
  text-decoration: underline;
}

/* ── App shell ───────────────────────────────────────────── */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: #f2f5f0;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px clamp(16px, 3vw, 32px);
  border-bottom: 1px solid #262f38;
}

.app-header .brand {
  color: #f2f5f0;
  font: 700 20px var(--display);
  text-decoration: none;
}

.app-header-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 12px;
}

.app-body {
  flex: 1;
  display: grid;
  grid-template-columns: 220px 1fr;
}

.app-sidebar {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 20px 12px;
  border-right: 1px solid #262f38;
}

.app-nav-item {
  text-align: left;
  border: 0;
  background: transparent;
  color: #aab5bd;
  font: 500 14px var(--sans);
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
}

.app-nav-item:hover {
  background: #1c242c;
  color: #f2f5f0;
}

.app-nav-item.is-active {
  background: rgba(56, 201, 232, .12);
  color: var(--aqua);
}

.app-main {
  padding: clamp(20px, 3vw, 40px);
  max-width: 900px;
}

.app-main h2 {
  font: 500 clamp(24px, 2.6vw, 30px) var(--display);
  color: #f2f5f0;
  margin: 0 0 20px;
}

.app-section .wb-card {
  margin-bottom: 18px;
}

.app-section .workbench-summary {
  margin-top: 0;
  margin-bottom: 20px;
}

/* ── Reminders ───────────────────────────────────────────── */
.wb-item.is-overdue {
  border-color: #b4402f;
}

.wb-item.is-overdue small {
  color: #e6836f;
}

.wb-item.is-soon small {
  color: var(--aqua);
}

.wb-item.is-above-appetite {
  border-color: #c98a2c;
}

.wb-item.is-above-appetite strong::after {
  content: "Above appetite";
  margin-left: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #e0a94a;
  vertical-align: middle;
}

/* ── Risk trend ──────────────────────────────────────────── */
.wb-trend {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 120px;
  margin-top: 16px;
  padding: 8px 0;
  border-bottom: 1px solid #33404b;
}

.wb-trend-bar {
  flex: 1;
  min-width: 4px;
  background: var(--aqua);
  border-radius: 2px 2px 0 0;
  opacity: .75;
}

.wb-trend-bar:hover {
  opacity: 1;
}

/* ── Heat map ────────────────────────────────────────────── */
.wb-upgrade-lock {
  background: #11171c;
  border: 1px dashed #44515c;
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  color: #cbd3d8;
}

.wb-upgrade-lock p {
  margin: 0 0 14px;
}

.wb-heatmap {
  display: grid;
  grid-template-columns: auto repeat(5, 1fr);
  gap: 4px;
  margin-top: 16px;
  font-size: 12px;
}

.wb-heatmap-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  border-radius: 8px;
  background: rgba(56, 201, 232, .06);
  color: #f2f5f0;
  font-weight: 600;
}

.wb-heatmap-label {
  display: flex;
  align-items: center;
  color: #aab5bd;
  padding: 0 8px;
  font-size: 11px;
}

.wb-heatmap-label.col-head {
  justify-content: center;
  text-align: center;
}

@media (max-width: 760px) {
  .app-body {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    border-right: 0;
    border-bottom: 1px solid #262f38;
  }

  .wb-heatmap {
    font-size: 10px;
  }
}

/* ── Board-ready print report ───────────────────────────────
   Hidden on screen; populated just-in-time and shown only in print
   media, so what gets printed is a clean summary, not the app chrome. */
.wb-print-view {
  display: none;
}

@media print {
  .app-header, .app-sidebar, .auth-gate { display: none !important; }
  .app-body { display: block; }
  .app-main { display: none; }
  .wb-print-view {
    display: block;
    color: #111;
    padding: 0;
  }
  .wb-print-view h1 { font: 600 26px var(--display, serif); margin: 0 0 4px; }
  .wb-print-view .wb-print-meta { color: #555; font-size: 12px; margin-bottom: 20px; }
  .wb-print-view h2 { font: 600 16px var(--display, serif); margin: 24px 0 8px; border-bottom: 1px solid #ccc; padding-bottom: 4px; }
  .wb-print-view table { width: 100%; border-collapse: collapse; font-size: 11px; }
  .wb-print-view th, .wb-print-view td { text-align: left; padding: 5px 6px; border-bottom: 1px solid #ddd; }
  .wb-print-view .wb-print-flag { color: #a15a00; font-weight: 700; }
}
