/* Product dashboard layout for hadri.us planning pages (calendar, events). v1 draft, 2026-10-26.
   Mirrors apps/product_dashboard roadmaps: header with section menus, Day/Week/Month + Today, toolbar with
   search / Display / backlog, and a timeline with lanes and cards.
   The Product dashboard has no dark palette; this adds one keyed off html.dark (the same class the shared nav
   toggle flips), using the BDR dark surfaces and a lightened brand purple. Load AFTER hadrius.css. */

:root {
  --p-bg: #f9fafb;            /* gray-50 page */
  --p-surface: #ffffff;
  --p-surface-2: #f9fafb;     /* lane rail, period row */
  --p-border: #e5e7eb;        /* gray-200 */
  --p-border-soft: #f3f4f6;   /* gray-100 */
  --p-text: #111827;          /* gray-900 */
  --p-text-2: #374151;
  --p-muted: #6b7280;         /* gray-500 */
  --p-faint: #9ca3af;
  --p-brand: #4c3dab;
  --p-brand-hover: #6f5cf0;
  --p-brand-accent: #614ce1;
  --p-brand-tint: #f1effd;
  --p-brand-line: rgba(97, 76, 225, .22);
  --p-on-brand: #ffffff;
  --p-shadow-rail: 8px 0 18px rgba(15, 23, 42, .06);
  --p-shadow-pop: 0 10px 24px rgba(15, 23, 42, .12);
  --p-card-green-bg: #ecfdf5; --p-card-green-bd: #a7f3d0;
  --p-card-amber-bg: #fefce8; --p-card-amber-bd: #fde68a;
  --p-card-purple-bg: #faf5ff; --p-card-purple-bd: #e9d5ff;
  --p-card-gray-bg: #f9fafb; --p-card-gray-bd: #e5e7eb;
  color-scheme: light;
}
html.dark {
  --p-bg: #111113;
  --p-surface: #1b1b1e;
  --p-surface-2: #151517;
  --p-border: #2f2f33;
  --p-border-soft: #26262a;
  --p-text: #f0f0f2;
  --p-text-2: #d9d9de;
  --p-muted: #a1a1a8;          /* 7.0:1 on #1b1b1e */
  --p-faint: #7c7c84;
  --p-brand: #9d90f5;
  --p-brand-hover: #b3a8ff;
  --p-brand-accent: #9d90f5;
  --p-brand-tint: #262046;
  --p-brand-line: rgba(157, 144, 245, .35);
  --p-on-brand: #111113;
  --p-shadow-rail: 8px 0 18px rgba(0, 0, 0, .35);
  --p-shadow-pop: 0 10px 24px rgba(0, 0, 0, .5);
  --p-card-green-bg: #0f2a20; --p-card-green-bd: #1f5c45;
  --p-card-amber-bg: #2a2108; --p-card-amber-bd: #5c4a12;
  --p-card-purple-bg: #221c3d; --p-card-purple-bd: #3a3366;
  --p-card-gray-bg: #1f1f23; --p-card-gray-bd: #2f2f33;
  color-scheme: dark;
}

body.p-page {
  margin: 0; padding-top: 44px; background: var(--p-bg); color: var(--p-text);
  font-family: "Satoshi", -apple-system, "Segoe UI", sans-serif; font-size: 14px; line-height: 20px;
  -webkit-font-smoothing: antialiased;
}
.p-page *, .p-page *::before, .p-page *::after { box-sizing: border-box; }
.p-page button { font: inherit; }
.p-page :focus-visible { outline: 2px solid var(--p-brand-accent); outline-offset: 2px; }

/* Header */
.p-header {
  position: sticky; top: 44px; z-index: 50; display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 16px; padding: 14px 24px; background: var(--p-surface);
  border-bottom: 1px solid var(--p-border);
}
.p-left { display: flex; align-items: center; gap: 16px; min-width: 0; }
.p-title { font-size: 18px; font-weight: 700; color: var(--p-text); margin: 0; white-space: nowrap; }
.p-divider { width: 1px; height: 24px; background: var(--p-border); }
.p-menus { display: flex; gap: 4px; }
.p-menu { position: relative; }
.p-menu-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 0; border-radius: 8px;
  background: transparent; color: var(--p-muted); font-weight: 600; font-size: 15px; cursor: pointer;
}
.p-menu-btn:hover { color: var(--p-text); background: var(--p-border-soft); }
.p-menu-btn.active { background: var(--p-brand-tint); color: var(--p-brand); }
.p-menu-btn svg { width: 16px; height: 16px; transition: transform .15s; }
.p-menu-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.p-pop {
  position: absolute; top: 42px; left: 0; min-width: 224px; padding: 4px; background: var(--p-surface);
  border: 1px solid var(--p-border); border-radius: 10px; box-shadow: var(--p-shadow-pop); display: none; z-index: 60;
}
.p-pop.open { display: block; }
.p-pop a, .p-pop label {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 6px;
  color: var(--p-text-2); text-decoration: none; font-size: 14px; font-weight: 500; cursor: pointer;
}
.p-pop a:hover, .p-pop label:hover { background: var(--p-border-soft); color: var(--p-text); }
.p-pop a.active { background: var(--p-brand-tint); color: var(--p-brand); font-weight: 700; }
.p-pop .p-pop-head { padding: 8px 10px 4px; font-size: 12px; font-weight: 700; color: var(--p-faint); text-transform: uppercase; letter-spacing: .06em; }
.p-pop input[type="checkbox"] { accent-color: var(--p-brand-accent); width: 15px; height: 15px; }

.p-right { display: flex; align-items: center; gap: 12px; }
.p-scale {
  position: relative; display: inline-grid; grid-template-columns: repeat(3, 1fr); height: 38px; border-radius: 9999px;
  border: 1px solid var(--p-border); background: var(--p-surface);
}
.p-scale-thumb {
  position: absolute; top: -1px; bottom: -1px; left: -1px; width: calc(33.333% + 1px); border-radius: 9999px;
  background: var(--p-brand); transition: transform .2s ease-out; z-index: 0;
}
.p-scale button {
  position: relative; z-index: 1; height: 36px; padding: 0 20px; border: 0; border-radius: 9999px; background: transparent;
  color: var(--p-muted); font-weight: 600; font-size: 14px; cursor: pointer;
}
.p-scale button:hover { color: var(--p-text); }
.p-scale button[aria-pressed="true"] { color: var(--p-on-brand); }
.p-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--p-border); background: var(--p-surface); color: var(--p-text-2); font-weight: 600; font-size: 14px; cursor: pointer;
}
.p-btn:hover { background: var(--p-border-soft); color: var(--p-text); }
.p-btn svg { width: 16px; height: 16px; }

/* Toolbar */
.p-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px 12px; }
.p-search {
  display: flex; align-items: center; gap: 8px; width: min(480px, 100%); height: 40px; padding: 0 12px;
  background: var(--p-surface); border: 1px solid var(--p-border); border-radius: 10px; color: var(--p-faint);
}
.p-search svg { width: 16px; height: 16px; flex-shrink: 0; }
.p-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--p-text); font-size: 14px; font-family: inherit; }
.p-search input::placeholder { color: var(--p-faint); }
.p-tools { display: flex; gap: 10px; }
.p-tools .p-menu .p-pop { left: auto; right: 0; }

/* Timeline */
.p-board {
  margin: 0 24px 32px; background: var(--p-surface); border: 1px solid var(--p-border); border-radius: 14px;
  overflow: auto; max-height: calc(100vh - 44px - 160px); position: relative;
}
.p-grid { position: relative; min-width: max-content; }
.p-row { display: flex; }
.p-rail {
  position: sticky; left: 0; z-index: 20; flex: 0 0 236px; width: 236px; background: var(--p-surface-2);
  border-right: 1px solid var(--p-border); box-shadow: var(--p-shadow-rail);
}
.p-head { position: sticky; top: 0; z-index: 30; background: var(--p-surface); border-bottom: 1px solid var(--p-border); }
.p-head .p-rail { z-index: 40; background: var(--p-surface); display: flex; align-items: flex-end; padding: 0 16px 10px; height: 80px; }
.p-rail-label { font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--p-muted); text-transform: uppercase; }
.p-scale-area { position: relative; }
.p-periods { position: relative; height: 38px; background: var(--p-surface-2); border-bottom: 1px solid var(--p-border-soft); }
.p-period { position: absolute; top: 0; height: 38px; display: flex; align-items: center; padding: 0 12px; border-left: 1px solid var(--p-border); }
.p-period span { font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--p-muted); text-transform: uppercase; }
.p-ticks { position: relative; height: 42px; }
.p-tick { position: absolute; top: 0; height: 42px; display: flex; align-items: center; justify-content: center; border-left: 1px solid var(--p-border-soft); font-size: 10px; font-weight: 600; color: var(--p-faint); letter-spacing: .06em; text-transform: uppercase; }
.p-today-pill {
  position: absolute; top: 10px; /* sits in the month row, above the week labels */ transform: translateX(-50%); z-index: 5; height: 18px; min-width: 54px; padding: 0 10px;
  border-radius: 9999px; background: var(--p-brand-accent); color: var(--p-on-brand); font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.p-lane { border-bottom: 1px solid var(--p-border-soft); }
.p-lane .p-rail { padding: 14px 16px; cursor: pointer; text-align: left; border-top: 0; border-left: 0; border-bottom: 0; font: inherit; color: inherit; display: block; }
.p-lane .p-rail:hover { background: var(--p-border-soft); }
.p-lane-name { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; color: var(--p-text); }
.p-lane-name svg { width: 16px; height: 16px; color: var(--p-faint); transition: transform .15s; }
.p-lane.collapsed .p-lane-name svg { transform: rotate(-90deg); }
.p-lane-count { margin: 2px 0 0 24px; font-size: 12px; color: var(--p-muted); }
.p-track { position: relative; min-height: 96px; }
.p-lane.collapsed .p-track { min-height: 52px; }
.p-gridline { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--p-border-soft); }
.p-gridline.major { border-left-color: var(--p-border); }
.p-today-line { position: absolute; top: 0; bottom: 0; z-index: 4; border-left: 2px solid var(--p-brand-line); pointer-events: none; }
.p-card {
  position: absolute; height: 52px; display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-radius: 10px;
  border: 1px solid var(--p-card-gray-bd); background: var(--p-card-gray-bg); color: var(--p-text); font-weight: 700; font-size: 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,.05); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none;
}
.p-card:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,.1); }
.p-card.green { background: var(--p-card-green-bg); border-color: var(--p-card-green-bd); }
.p-card.amber { background: var(--p-card-amber-bg); border-color: var(--p-card-amber-bd); }
.p-card.purple { background: var(--p-card-purple-bg); border-color: var(--p-card-purple-bd); }
.p-empty {
  position: sticky; left: 260px; display: inline-block; margin: 28px 0; padding: 10px 14px; border: 1px dashed var(--p-border);
  border-radius: 10px; background: var(--p-surface); color: var(--p-muted); font-size: 13px; max-width: 520px;
}
.p-board-note {
  position: sticky; left: 0; display: flex; gap: 10px; align-items: flex-start; padding: 14px 20px; border-top: 1px solid var(--p-border);
  background: var(--p-surface); color: var(--p-muted); font-size: 13px;
}
.p-board-note strong { color: var(--p-text); }
.p-board-note a { color: var(--p-brand); font-weight: 600; text-decoration: none; }
.p-backlog { margin: 0 24px 24px; padding: 16px 20px; background: var(--p-surface); border: 1px solid var(--p-border); border-radius: 14px; display: none; }
.p-backlog.open { display: block; }
.p-backlog h2 { margin: 0 0 8px; font-size: 15px; color: var(--p-text); }
.p-backlog ul { margin: 0; padding-left: 18px; color: var(--p-text-2); }
.p-backlog li { margin: 4px 0; }
.p-hidden { display: none !important; }
.p-condensed .p-track { min-height: 60px; }
.p-condensed .p-card { height: 32px; font-size: 12px; border-radius: 8px; }

@media (max-width: 900px) {
  .p-header { padding: 12px 16px; }
  .p-toolbar { padding: 12px 16px 8px; }
  .p-board { margin: 0 16px 24px; }
  .p-rail { flex-basis: 160px; width: 160px; }
  .p-menus { display: none; }
}
@media (prefers-reduced-motion: reduce) { .p-scale-thumb, .p-menu-btn svg, .p-lane-name svg, .p-card { transition: none; } }
