/* ═══════════════════════════════════════════════════════════════════
   AV CLIENT PORTAL — Dark Dashboard
   ═══════════════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────────────── */
:root {
  --color-bg:            #0e1512;
  --color-surface:       #141d19;
  --color-surface-2:     #1b2620;
  --color-border:        #263329;
  --color-border-light:  #1d2a24;
  --color-text:          #dce8e3;
  --color-text-muted:    #87a09a;
  --color-text-subtle:   #4f6860;

  --color-accent:        #019496;
  --color-accent-bright: #01aeb0;
  --color-accent-dim:    #016b6c;
  --color-accent-glow:   rgba(1,148,150,0.18);
  --color-accent-text:   #00c8ca;

  --color-success:       #27b471;
  --color-success-bg:    rgba(39,180,113,0.12);
  --color-warning:       #d99030;
  --color-warning-bg:    rgba(217,144,48,0.12);
  --color-danger:        #d95252;
  --color-danger-bg:     rgba(217,82,82,0.12);

  --color-internal-header: #1c1000;
  --color-internal-accent: #c96810;
  --color-internal-bg:     #1c1508;
  --color-internal-border: #634010;
  --color-internal-text:   #edd080;

  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', Consolas, 'Courier New', monospace;

  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow:    0 2px 8px rgba(0,0,0,0.45), 0 1px 3px rgba(0,0,0,0.25);
  --shadow-md: 0 6px 24px rgba(0,0,0,0.55), 0 2px 8px rgba(0,0,0,0.3);

  --header-height:   64px;
  --phase-band-height: 42px;
  --content-max:     1240px;
}

/* ── Light mode overrides ──────────────────────────────────────── */
body.theme-light {
  --color-bg:            #f4f6f5;
  --color-surface:       #ffffff;
  --color-surface-2:     #eef1f0;
  --color-border:        #d4dbd8;
  --color-border-light:  #e2e8e6;
  --color-text:          #0f1f1b;
  --color-text-muted:    #4a6460;
  --color-text-subtle:   #8aa39d;

  --color-accent:        #019496;
  --color-accent-bright: #017a7c;
  --color-accent-dim:    #d0f0f0;
  --color-accent-glow:   rgba(1,148,150,0.12);
  --color-accent-text:   #006e70;

  --color-success:       #1a9a5a;
  --color-success-bg:    rgba(26,154,90,0.1);
  --color-warning:       #b87020;
  --color-warning-bg:    rgba(184,112,32,0.1);
  --color-danger:        #c03838;
  --color-danger-bg:     rgba(192,56,56,0.1);

  --color-internal-header: #fff8ed;
  --color-internal-accent: #b85c0a;
  --color-internal-bg:     #fff3e0;
  --color-internal-border: #e8c070;
  --color-internal-text:   #7a3e00;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow:    0 2px 8px rgba(0,0,0,0.1), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 6px 24px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
}

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-sans); background: var(--color-bg); color: var(--color-text); line-height: 1.6; min-height: 100vh; }
a { color: var(--color-accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4 { font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
img { max-width: 100%; display: block; }
#app { display: flex; flex-direction: column; min-height: 100vh; }

/* ── Internal Banner ────────────────────────────────────────────── */
#internal-banner {
  display: none;
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--color-internal-accent);
  color: #fff;
  text-align: center;
  padding: 6px 16px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
body.internal-view #internal-banner { display: block; }
body.internal-view #site-header { top: 31px; }
body.internal-view #dashboard-side { top: calc(var(--header-height) + var(--phase-band-height) + 51px); }

/* ── Header ─────────────────────────────────────────────────────── */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: #0a100d;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 20px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}
body.internal-view #site-header {
  background: var(--color-internal-header);
  border-bottom-color: var(--color-internal-border);
}

.header-brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  border-right: 1px solid var(--color-border);
  padding-right: 20px;
  flex-shrink: 0;
}
.header-brand .company {
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent-text);
}
.header-brand .tagline {
  font-size: 0.71rem;
  color: var(--color-text-subtle);
}

.header-project { flex: 1; min-width: 0; }
.header-project .project-name {
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
  color: var(--color-text);
}
.header-project .project-meta {
  font-size: 0.72rem;
  color: var(--color-text-subtle);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.header-status {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 4px 12px 4px 10px;
}
.header-status .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-success);
  animation: pulse 2.5s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.header-status .status-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

#theme-toggle-btn {
  padding: 5px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  line-height: 1;
}
#theme-toggle-btn:hover {
  background: var(--color-surface-2);
  border-color: var(--color-accent-dim);
}

#view-toggle-btn {
  padding: 5px 13px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
#view-toggle-btn:hover {
  background: var(--color-surface-2);
  border-color: var(--color-accent-dim);
  color: var(--color-accent-text);
}
body.internal-view #view-toggle-btn {
  border-color: var(--color-internal-border);
  color: var(--color-internal-text);
}

/* ── Phase Band ─────────────────────────────────────────────────── */
#phase-band {
  background: #0a120f;
  border-bottom: 1px solid var(--color-border);
  padding: 0 24px;
  position: sticky;
  top: var(--header-height);
  z-index: 90;
}
body.internal-view #phase-band { top: calc(var(--header-height) + 31px); }

.phase-band-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: var(--content-max);
  margin: 0 auto;
  height: var(--phase-band-height);
}

.phase-ps-track {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}
.phase-seg {
  width: 22px;
  height: 4px;
  border-radius: 2px;
  background: var(--color-border);
  flex-shrink: 0;
  transition: background 0.2s, box-shadow 0.2s;
}
.phase-seg.complete { background: var(--color-accent-dim); }
.phase-seg.active {
  background: var(--color-accent);
  box-shadow: 0 0 8px var(--color-accent-glow);
  width: 28px;
}

.phase-band-label {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--color-text-subtle);
}
.phase-band-label strong {
  color: var(--color-accent-text);
  font-weight: 600;
}

/* ── Dashboard Layout ───────────────────────────────────────────── */
#dashboard-wrap {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  max-width: var(--content-max);
  margin: 0 auto;
  width: 100%;
  padding: 20px 24px 60px;
  align-items: start;
}

#dashboard-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#dashboard-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: calc(var(--header-height) + var(--phase-band-height) + 20px);
}

/* ── Dash Cards ─────────────────────────────────────────────────── */
.dash-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.dash-card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--color-border-light);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background 0.1s;
}
.dash-card-header::-webkit-details-marker { display: none; }
.dash-card-header:hover { background: rgba(255,255,255,0.015); }
.dash-card[open] > .dash-card-header { border-bottom-color: var(--color-border-light); }

.dash-card-header-text { flex: 1; min-width: 0; }

.dash-card-eyebrow {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent-text);
  margin-bottom: 4px;
}
.dash-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.01em;
}
.dash-card-title-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.dash-card-meta {
  font-size: 0.74rem;
  color: var(--color-text-subtle);
}
.dash-card-chevron {
  width: 26px;
  height: 26px;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  color: var(--color-text-subtle);
  flex-shrink: 0;
  margin-top: 2px;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.2s;
}
.dash-card-header:hover .dash-card-chevron {
  border-color: var(--color-accent-dim);
  color: var(--color-accent-text);
}
.dash-card[open] .dash-card-chevron {
  transform: rotate(180deg);
  background: var(--color-accent-glow);
  border-color: var(--color-accent-dim);
  color: var(--color-accent-text);
}

.dash-card-body { padding: 18px 22px; }
.dash-card-body--flush { padding: 12px 14px; }

/* ── Latest Week (featured card body) ──────────────────────────── */
.dash-card-body .week-summary {
  font-size: 0.92rem;
  line-height: 1.72;
  color: var(--color-text);
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--color-border-light);
}
.dash-card-body .week-highlights-label {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
  margin-bottom: 10px;
}
.dash-card-body .week-highlights {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dash-card-body .week-highlights li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}
.dash-card-body .week-highlights li::before {
  content: "→";
  color: var(--color-accent-text);
  font-size: 0.72rem;
  margin-top: 3px;
  flex-shrink: 0;
  font-weight: 700;
}

/* ── Weekly Update Cards (in accordion) ────────────────────────── */
.week-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: 10px;
  overflow: hidden;
}
.week-card:last-child { margin-bottom: 0; }

.week-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  background: var(--color-surface-2);
  transition: background 0.1s;
}
.week-card-header:hover { background: rgba(255,255,255,0.04); }
.week-card.expanded .week-card-header { border-bottom: 1px solid var(--color-border); }

.week-number-badge {
  background: var(--color-accent);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 20px;
  flex-shrink: 0;
}
.week-date-range { font-size: 0.84rem; font-weight: 500; color: var(--color-text); flex: 1; }
.week-summary-preview {
  font-size: 0.76rem;
  color: var(--color-text-subtle);
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.week-expand-icon {
  color: var(--color-text-subtle);
  font-size: 0.75rem;
  flex-shrink: 0;
  transition: transform 0.2s;
}
.week-card.expanded .week-expand-icon { transform: rotate(180deg); }

.week-card-body { display: none; padding: 18px 16px; }
.week-card.expanded .week-card-body { display: block; }

.week-card .week-summary {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--color-text-muted);
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--color-border-light);
}
.week-card .week-highlights-label {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
  margin-bottom: 8px;
}
.week-card .week-highlights { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.week-card .week-highlights li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}
.week-card .week-highlights li::before {
  content: "→";
  color: var(--color-accent-text);
  font-size: 0.72rem;
  margin-top: 3px;
  flex-shrink: 0;
  font-weight: 700;
}
.week-photos-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--color-border-light);
}

/* ── Records Divider ────────────────────────────────────────────── */
.records-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0 6px;
}
.records-divider span {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
  white-space: nowrap;
  flex-shrink: 0;
}
.records-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

/* ── Detail Drop (accordion) ────────────────────────────────────── */
.detail-drop {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.detail-drop-summary {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background 0.1s;
}
.detail-drop-summary::-webkit-details-marker { display: none; }
.detail-drop-summary:hover { background: var(--color-surface-2); }
.detail-drop[open] > .detail-drop-summary {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-2);
}

.dd-main { flex: 1; min-width: 0; }
.dd-title-row { display: flex; align-items: center; gap: 10px; }
.dd-title { font-size: 0.93rem; font-weight: 600; color: var(--color-text); }
.dd-count { font-size: 0.72rem; color: var(--color-text-subtle); flex-shrink: 0; }
.dd-subtitle {
  display: block;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-top: 3px;
  line-height: 1.4;
}
.dd-chevron {
  width: 26px;
  height: 26px;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  color: var(--color-text-subtle);
  flex-shrink: 0;
  margin-top: 1px;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.2s;
}
.detail-drop-summary:hover .dd-chevron {
  border-color: var(--color-accent-dim);
  color: var(--color-accent-text);
}
.detail-drop[open] .dd-chevron {
  transform: rotate(180deg);
  background: var(--color-accent-glow);
  border-color: var(--color-accent-dim);
  color: var(--color-accent-text);
}

.detail-drop-body { padding: 18px 20px; }
.dd-note {
  font-size: 0.82rem;
  color: var(--color-text-subtle);
  margin-bottom: 14px;
  font-style: italic;
}

/* Internal drop */
.internal-drop { border-color: var(--color-internal-border); }
.internal-drop > .detail-drop-summary { background: var(--color-internal-bg); align-items: center; }
.internal-drop > .detail-drop-summary:hover { background: rgba(99,64,16,0.3); }
.internal-drop[open] > .detail-drop-summary { border-bottom-color: var(--color-internal-border); }
.internal-drop > .detail-drop-body { background: var(--color-internal-bg); }

.internal-pill {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--color-internal-accent);
  color: #fff;
  padding: 2px 7px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* ── Side Cards ─────────────────────────────────────────────────── */
.side-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.side-card-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-2);
}
.side-card-icon { font-size: 0.9rem; opacity: 0.7; flex-shrink: 0; }
.side-card-title {
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  flex: 1;
}
.side-card-count {
  font-size: 0.72rem;
  color: var(--color-accent-text);
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Open Items Sidebar ─────────────────────────────────────────── */
#open-items-list { padding: 4px 0; }
.open-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--color-border-light);
  transition: background 0.1s;
}
.open-item:last-child { border-bottom: none; }
.open-item:hover { background: var(--color-surface-2); }
.open-item-question {
  font-size: 0.83rem;
  color: var(--color-text);
  line-height: 1.45;
}
.open-item-footer {
  display: flex;
  align-items: center;
  gap: 6px;
}
.open-item-owner {
  font-size: 0.71rem;
  color: var(--color-text-subtle);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.open-item-due {
  font-size: 0.7rem;
  color: var(--color-text-subtle);
  white-space: nowrap;
}
.open-item-due.open-item-overdue {
  color: var(--color-danger);
  font-weight: 600;
}

/* ── Billing Sidebar ────────────────────────────────────────────── */
#billing-kpis { padding: 12px 16px 4px; display: flex; flex-direction: column; gap: 9px; }
.billing-kpi-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.billing-kpi-row.highlight {
  background: var(--color-accent-glow);
  border-radius: var(--radius);
  padding: 7px 10px;
  margin: 0 -4px;
}
.bkr-label {
  font-size: 0.71rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-subtle);
}
.bkr-value {
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.bkr-value.accent { color: var(--color-accent-text); }
.bkr-value.sm { font-size: 0.83rem; }
.billing-pre-note {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  line-height: 1.55;
  padding: 10px 16px 12px;
  border-top: 1px solid var(--color-border-light);
  margin-top: 4px;
}

/* ── Schedule ───────────────────────────────────────────────────── */
.schedule-list { display: flex; flex-direction: column; padding: 4px 0; }
.schedule-item {
  display: flex;
  gap: 10px;
  padding: 9px 16px;
  align-items: flex-start;
  border-bottom: 1px solid var(--color-border-light);
  transition: background 0.1s;
}
.schedule-item:last-child { border-bottom: none; }
.schedule-item:hover { background: var(--color-surface-2); }
.schedule-date {
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--color-text-muted);
  width: 52px;
  flex-shrink: 0;
  padding-top: 3px;
  font-variant-numeric: tabular-nums;
}
.schedule-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-border);
  flex-shrink: 0;
  margin-top: 5px;
}
.schedule-item.complete    .schedule-dot { background: var(--color-success); }
.schedule-item.in-progress .schedule-dot { background: var(--color-accent); box-shadow: 0 0 0 3px var(--color-accent-glow); }
.schedule-milestone {
  font-size: 0.83rem;
  color: var(--color-text-muted);
  flex: 1;
  line-height: 1.4;
}
.schedule-item.complete    .schedule-milestone { text-decoration: line-through; color: var(--color-text-subtle); }
.schedule-item.in-progress .schedule-milestone { color: var(--color-text); font-weight: 500; }

/* full schedule (accordion): no outer padding, badge at end */
.schedule-list-full { padding: 0; }
.schedule-list-full .schedule-item { padding: 9px 0; }

/* ── Badges ─────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-active       { background: var(--color-success-bg);  color: var(--color-success); }
.badge-pending      { background: rgba(255,255,255,0.05);   color: var(--color-text-subtle); border: 1px solid var(--color-border); }
.badge-in-progress  { background: var(--color-accent-glow); color: var(--color-accent-text); }
.badge-proposed     { background: var(--color-warning-bg);  color: var(--color-warning); }
.badge-approved     { background: var(--color-success-bg);  color: var(--color-success); }
.badge-declined     { background: var(--color-danger-bg);   color: var(--color-danger); }
.badge-open         { background: var(--color-warning-bg);  color: var(--color-warning); }
.badge-complete     { background: var(--color-success-bg);  color: var(--color-success); }
.badge-draft        { background: rgba(255,255,255,0.05);   color: var(--color-text-subtle); border: 1px solid var(--color-border); }
.badge-paid         { background: var(--color-success-bg);  color: var(--color-success); }
.badge-high         { background: var(--color-danger-bg);   color: var(--color-danger); }
.badge-medium       { background: var(--color-warning-bg);  color: var(--color-warning); }
.badge-low          { background: rgba(255,255,255,0.05);   color: var(--color-text-subtle); border: 1px solid var(--color-border); }
.badge-engaged      { background: var(--color-accent-glow); color: var(--color-accent-text); }
.badge-scheduling   { background: var(--color-warning-bg);  color: var(--color-warning); }
.badge-coordinating { background: var(--color-accent-glow); color: var(--color-accent-text); }
.badge-on-call      { background: rgba(255,255,255,0.05);   color: var(--color-text-subtle); border: 1px solid var(--color-border); }

/* ── Tables ─────────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.data-table th {
  text-align: left;
  padding: 8px 10px;
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-2);
}
.data-table td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: top;
  line-height: 1.45;
  color: var(--color-text-muted);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: rgba(255,255,255,0.02); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; font-size: 0.83rem; }
.data-table .mono { font-family: var(--font-mono); font-size: 0.78rem; color: var(--color-text-subtle); }
.data-table .text-muted { color: var(--color-text-subtle); }
.data-table .totals-row td {
  font-weight: 700;
  background: var(--color-surface-2);
  border-top: 2px solid var(--color-border);
  font-size: 0.87rem;
  color: var(--color-text);
}
.data-table .table-note { font-size: 0.74rem; color: var(--color-text-subtle); margin-top: 3px; }

/* ── Photo Gallery ──────────────────────────────────────────────── */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }

.photo-card {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}
.photo-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--color-accent-dim);
}
.photo-thumb { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.photo-placeholder-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--color-surface-2) 0%, var(--color-border) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--color-text-subtle);
}
.photo-placeholder-thumb .photo-icon { font-size: 1.5rem; opacity: 0.45; }
.photo-placeholder-thumb .photo-label { font-size: 0.63rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.photo-card-caption { padding: 8px 10px; border-top: 1px solid var(--color-border-light); }
.photo-card-caption .caption-text { font-size: 0.77rem; color: var(--color-text-muted); line-height: 1.4; }
.photo-card-caption .caption-date { font-size: 0.69rem; color: var(--color-text-subtle); margin-top: 2px; }

/* ── Weekly Progress Cards (client-facing work summary) ─────────── */
.progress-week {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 10px;
}
.progress-week:last-child { margin-bottom: 0; }

.progress-week-hd {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-border);
}
.pw-date { font-size: 0.84rem; font-weight: 500; color: var(--color-text); flex: 1; }
.pw-hours {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-accent-text);
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.progress-week-body { padding: 18px 18px 16px; }
.pw-brief {
  font-size: 0.9rem;
  line-height: 1.72;
  color: var(--color-text);
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border-light);
}
.pw-section-label {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
  margin-bottom: 9px;
  margin-top: 14px;
}
.pw-section-label:first-of-type { margin-top: 0; }

.pw-work-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; }
.pw-work-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.87rem;
  color: var(--color-text-muted);
  line-height: 1.45;
}
.pw-work-list li::before {
  content: "✓";
  color: var(--color-success);
  font-size: 0.72rem;
  margin-top: 3px;
  flex-shrink: 0;
  font-weight: 700;
}
.pw-pending li::before {
  content: "→";
  color: var(--color-accent-text);
}

/* ── Phases List (accordion) ────────────────────────────────────── */
#phase-list { display: flex; flex-direction: column; gap: 6px; }
.phase-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border-light);
  background: var(--color-surface-2);
}
.phase-item.in-progress {
  border-color: var(--color-accent-dim);
  background: var(--color-accent-glow);
}
.phase-num { font-size: 0.72rem; font-weight: 700; color: var(--color-text-subtle); width: 20px; flex-shrink: 0; }
.phase-item.in-progress .phase-num { color: var(--color-accent-text); }
.phase-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-border); flex-shrink: 0; }
.phase-item.complete    .phase-dot { background: var(--color-success); }
.phase-item.in-progress .phase-dot { background: var(--color-accent); box-shadow: 0 0 0 3px var(--color-accent-glow); }
.phase-name { font-size: 0.87rem; flex: 1; color: var(--color-text-muted); }
.phase-item.in-progress .phase-name { font-weight: 600; color: var(--color-text); }

/* ── Trade Grid ─────────────────────────────────────────────────── */
.trade-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.trade-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 13px 15px;
  background: var(--color-surface-2);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.trade-name { font-size: 0.87rem; font-weight: 600; color: var(--color-text); }
.trade-contact { font-size: 0.75rem; color: var(--color-text-subtle); }
.trade-scope {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-top: 6px;
  border-top: 1px solid var(--color-border-light);
  padding-top: 8px;
}

/* ── Internal Notes ─────────────────────────────────────────────── */
.internal-note {
  border: 1px solid var(--color-internal-border);
  border-left: 3px solid var(--color-internal-accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 11px 14px;
  margin-bottom: 8px;
  background: rgba(201,104,16,0.06);
}
.internal-note:last-child { margin-bottom: 0; }
.internal-note .note-meta {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-internal-accent);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.internal-note .note-text {
  font-size: 0.85rem;
  color: var(--color-internal-text);
  line-height: 1.65;
}

/* ── Billing Section Label ──────────────────────────────────────── */
.billing-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
  margin-bottom: 10px;
}

/* ── Empty State ────────────────────────────────────────────────── */
.empty-state {
  padding: 24px 16px;
  text-align: center;
  color: var(--color-text-subtle);
  font-size: 0.83rem;
  border: 1.5px dashed var(--color-border);
  border-radius: var(--radius);
  line-height: 1.6;
}

/* ── Utilities ──────────────────────────────────────────────────── */
.hidden      { display: none !important; }
.text-muted  { color: var(--color-text-muted); }
.text-subtle { color: var(--color-text-subtle); }
.text-sm     { font-size: 0.82rem; }
.text-xs     { font-size: 0.73rem; }
.mono        { font-family: var(--font-mono); font-size: 0.83rem; }
.divider     { border: none; border-top: 1px solid var(--color-border-light); margin: 14px 0; }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 1060px) {
  #dashboard-wrap { grid-template-columns: 1fr 290px; gap: 16px; padding: 16px 16px 48px; }
}
@media (max-width: 820px) {
  #dashboard-wrap { grid-template-columns: 1fr; }
  #dashboard-side { position: static; }
  .header-brand { display: none; }
}
@media (max-width: 600px) {
  #site-header { padding: 0 14px; gap: 10px; }
  #phase-band { padding: 0 14px; }
  #dashboard-wrap { padding: 12px 12px 40px; gap: 10px; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .trade-grid { grid-template-columns: 1fr; }
  .header-status { display: none; }
  .week-summary-preview { display: none; }
}
@media (max-width: 420px) {
  #view-toggle-btn { font-size: 0.68rem; padding: 4px 9px; }
}

/* ── Print ──────────────────────────────────────────────────────── */
@media print {
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #internal-banner, #view-toggle-btn, [data-internal="true"] { display: none !important; }
  #site-header {
    position: static;
    background: #036969 !important;
    color: #fff !important;
    padding: 14px 20px;
    box-shadow: none;
    border: none;
  }
  .header-brand .company, .header-brand .tagline,
  .header-project .project-name, .header-project .project-meta,
  .header-status .status-label { color: #fff !important; }
  #phase-band { display: none; }
  #dashboard-wrap { display: block; padding: 0; }
  #dashboard-side { display: none; }
  .detail-drop { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; }
  .dash-card { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; }
  .photo-grid { grid-template-columns: repeat(4, 1fr); }
  .trade-grid { grid-template-columns: repeat(3, 1fr); }
  @page { margin: 1.6cm 2cm; size: A4 portrait; }
  body { font-size: 10pt; }
}

/* ── Portal Gate ─────────────────────────────────────────────────────────────── */

#portal-gate {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

/* ── Shared brand mark ─────────────────────────────────────────────────────── */

.pa-brand-mark {
  width: 28px;
  height: 28px;
  background: var(--color-accent);
  border-radius: 7px;
  flex-shrink: 0;
}
.pa-brand-mark--sm {
  width: 22px;
  height: 22px;
  border-radius: 5px;
}

/* ── Gate card brand row ───────────────────────────────────────────────────── */

.gate-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}


#portal-gate.hidden { display: none !important; }

#portal-gate-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 44px 40px;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gate-logo {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-accent-text);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.gate-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 4px;
}

#gate-clientname,
#gate-username,
#gate-code {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text);
  font-size: 0.95rem;
  padding: 11px 13px;
  width: 100%;
  box-sizing: border-box;
  letter-spacing: 0.02em;
  font-family: inherit;
}

#gate-clientname:focus,
#gate-username:focus,
#gate-code:focus { outline: none; border-color: var(--color-accent); }

#gate-code { letter-spacing: 0.1em; }

.gate-staff-row { display: flex; flex-direction: column; gap: 0; margin-top: -4px; }

.gate-staff-toggle {
  background: none;
  border: none;
  color: var(--color-text-subtle);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.78rem;
  padding: 2px 0;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.gate-staff-toggle:hover { color: var(--color-text); }

.gate-error { color: #e07070; font-size: 0.85rem; }

#gate-submit {
  background: var(--color-accent);
  border: none;
  color: #fff;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 12px;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.15s;
}

#gate-submit:hover:not(:disabled) { background: var(--color-accent-bright); }
#gate-submit:disabled { opacity: 0.5; cursor: not-allowed; }


/* ── Portal Edit Button (header) ──────────────────────────────────────────────── */

#portal-edit-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 5px 10px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

#portal-edit-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

#portal-edit-btn.active {
  background: rgba(240, 160, 48, 0.15);
  border-color: #f0a030;
  color: #f0a030;
}

/* ── Edit Dirty Indicator (small floating badge) ─────────────────────────────── */

#edit-indicator {
  align-items: center;
  background: var(--color-surface);
  border: 1px solid rgba(240, 160, 48, 0.4);
  border-radius: 8px;
  bottom: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  display: flex;
  gap: 6px;
  padding: 7px 12px;
  position: fixed;
  right: 20px;
  z-index: 400;
}

#edit-indicator.hidden { display: none !important; }

.ei-dot { color: #f0a030; font-size: 0.65rem; }
.ei-label { color: #f0a030; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }

.dirty-pill {
  background: rgba(240, 160, 48, 0.12);
  border: 1px solid rgba(240, 160, 48, 0.35);
  border-radius: 100px;
  color: #f0a030;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 1px 8px;
}

/* ── Section Edit Panels ──────────────────────────────────────────────────────── */

.section-edit-panel {
  background: rgba(240, 160, 48, 0.04);
  border: 1px solid rgba(240, 160, 48, 0.3);
  border-radius: 8px;
  margin-top: 16px;
  padding: 16px;
}

.ep-field { margin-bottom: 12px; }

.ep-label {
  color: var(--color-text-subtle);
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.ep-textarea {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  box-sizing: border-box;
  color: var(--color-text);
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.55;
  min-height: 80px;
  padding: 8px 10px;
  resize: vertical;
  width: 100%;
}

.ep-textarea--sm { min-height: 56px; }
.ep-textarea:focus { border-color: #f0a030; outline: none; }

.ep-input {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text);
  flex: 1;
  font-family: inherit;
  font-size: 0.85rem;
  padding: 6px 9px;
}

.ep-input:focus { border-color: #f0a030; outline: none; }

.ep-select {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text);
  font-family: inherit;
  font-size: 0.82rem;
  padding: 6px 8px;
}

.ep-item-row {
  align-items: center;
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}

.ep-del-btn {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  color: var(--color-text-subtle);
  cursor: pointer;
  flex-shrink: 0;
  font-size: 0.75rem;
  padding: 4px 7px;
}

.ep-del-btn:hover { border-color: #e07070; color: #e07070; }

.ep-add-btn {
  background: none;
  border: 1px dashed var(--color-border);
  border-radius: 6px;
  color: var(--color-text-subtle);
  cursor: pointer;
  font-size: 0.82rem;
  font-family: inherit;
  margin-top: 2px;
  padding: 5px 12px;
}

.ep-add-btn:hover { border-color: var(--color-text-subtle); color: var(--color-text); }

.ep-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.ep-save-btn {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 7px 14px;
}

.ep-save-btn:hover { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }

.ep-publish-btn {
  background: #f0a030;
  border: none;
  border-radius: 6px;
  color: #000;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 7px 14px;
}

.ep-publish-btn:hover:not(:disabled) { background: #d48820; }
.ep-publish-btn:disabled { cursor: default; }

.ep-publish-btn--done {
  background: rgba(92, 186, 122, 0.12);
  border: 1px solid rgba(92, 186, 122, 0.4);
  color: #5cba7a;
}

.add-week-btn {
  background: rgba(240, 160, 48, 0.1);
  border: 1px solid rgba(240, 160, 48, 0.35);
  border-radius: 5px;
  color: #f0a030;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  white-space: nowrap;
}

.add-week-btn:hover { background: rgba(240, 160, 48, 0.2); }

.ep-field--row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.ep-field--row > div { display: flex; flex-direction: column; }

.ep-phase-id-label {
  color: var(--color-text-subtle);
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}

.ep-discard-btn {
  background: none;
  border: none;
  color: var(--color-text-subtle);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.78rem;
  margin-left: auto;
  opacity: 0.6;
  padding: 4px 0;
}

.ep-discard-btn:hover { color: #e07070; opacity: 1; }

.ep-status { font-size: 0.82rem; margin-left: 2px; }
.ep-status--ok  { color: #5cba7a; }
.ep-status--err { color: #e07070; }

.ep-photo-row {
  align-items: center;
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}

.ep-photo-row .ep-photo-url { flex: 3; min-width: 0; }
.ep-photo-row .ep-photo-caption { flex: 2; min-width: 0; }
.ep-photo-row .ep-photo-date { width: 130px; flex-shrink: 0; }

.ep-co-row {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  margin-bottom: 8px;
  padding: 10px 12px;
}

.ep-co-header {
  align-items: center;
  display: flex;
  gap: 8px;
}

.ep-co-id {
  color: var(--color-text-subtle);
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  min-width: 50px;
}

.ep-co-header .ep-co-date { width: 130px; flex-shrink: 0; }
.ep-co-header .ep-co-status { flex-shrink: 0; }
.ep-co-header .ep-del-btn { margin-left: auto; }

.ep-co-row .ep-co-desc { width: 100%; }
.ep-co-row .ep-co-cost { width: 200px; }

/* amber border hint on editable cards in edit mode */
body.edit-mode #latest-week-card,
body.edit-mode #progress-card {
  border-color: rgba(240, 160, 48, 0.35);
}
body.edit-mode #open-items-card,
body.edit-mode #milestones-card {
  outline: 1px solid rgba(240, 160, 48, 0.35);
}
body.edit-mode #changes-drop {
  border-color: rgba(240, 160, 48, 0.35);
}

/* ── Per-section edit affordance (internal/admin view only) ─────────────────── */

.sec-edit-btn {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  min-height: 28px;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 5px;
  color: var(--color-text-subtle);
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}
body.internal-view .sec-edit-btn {
  display: inline-flex;
}
.sec-edit-btn:hover {
  background: var(--color-accent-glow);
  border-color: var(--color-accent-dim);
  color: var(--color-accent-text);
}

@media (max-width: 640px) {
  .sec-edit-btn {
    min-width: 40px;
    min-height: 36px;
    padding: 4px 8px;
    font-size: 0.8rem;
    justify-content: center;
  }
}

/* ── Dashboard Priority Block ───────────────────────────────────────────────── */

.dash-priority-block {
  margin-bottom: 2rem;
}
.dash-priority-block.hidden { display: none; }
.dash-priority-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.admin-link-btn {
  background: none;
  border: none;
  color: var(--color-accent);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
}
.admin-link-btn:hover { opacity: 0.75; text-decoration: underline; }

.dash-pri-compact {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.6rem;
}
.dash-pri-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-border);
  border-radius: 7px;
  padding: 0.55rem 0.85rem;
  min-width: 0;
}
.dash-pri-row--t1 { border-left-color: #019496; }
.dash-pri-row--t2 { border-left-color: #1a4f8a; }
.dash-pri-row--t3 { border-left-color: #d08030; }
.dash-pri-row--t4 { border-left-color: #888; }
.dash-pri-row--snoozed { opacity: 0.55; }
.dash-pri-row-action {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* ── Priorities Tab ─────────────────────────────────────────────────────────── */

.pri-section-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.pri-section-hd .dash-section-label { margin: 0; }

/* Right Now block */
.pri-right-now {
  background: var(--color-accent-glow);
  border: 2px solid var(--color-accent);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.pri-right-now.hidden { display: none; }
.pri-right-now-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.pri-right-now-body { flex: 1; min-width: 0; }
.pri-right-now-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.25rem;
}
.pri-right-now-action {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.2rem;
  line-height: 1.35;
}
.pri-right-now-reason {
  font-size: 0.82rem;
  color: var(--color-text-muted);
}
.pri-right-now-btns {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* Priority card list */
.pri-list { display: flex; flex-direction: column; gap: 0.75rem; }

.pri-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  opacity: 1;
  transition: opacity 0.2s;
}
.pri-card--done   { opacity: 0.45; }
.pri-card--snoozed { opacity: 0.55; }
.pri-card--t1 { border-left-color: #019496; }
.pri-card--t2 { border-left-color: #1a4f8a; }
.pri-card--t3 { border-left-color: #d08030; }
.pri-card--t4 { border-left-color: #888; }

.pri-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.pri-tier-badge {
  display: inline-block;
  padding: 0.15em 0.55em;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.pri-tier-badge--1 { background: #019496; color: #fff; }
.pri-tier-badge--2 { background: #1a4f8a; color: #fff; }
.pri-tier-badge--3 { background: #d08030; color: #fff; }
.pri-tier-badge--4 { background: transparent; color: #888; border: 1.5px solid #888; }

.pri-plevel {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
}
.pri-plevel--1 { color: #e05a5a; }
.pri-plevel--2 { color: #d08030; }
.pri-plevel--3 { color: var(--color-text-muted); }

.pri-card-action {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.4;
}
.pri-card-reason {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}
.pri-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.1rem;
}
.pri-chip {
  display: inline-block;
  padding: 0.1em 0.55em;
  border-radius: 999px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  font-size: 0.7rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}
.pri-card-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.3rem;
}
.pri-btn {
  padding: 0.25em 0.75em;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text-muted);
  transition: background 0.15s, color 0.15s;
}
.pri-btn:hover  { background: var(--color-border); color: var(--color-text); }
.pri-btn--done  { background: #2a6e3f; color: #fff; border-color: #2a6e3f; }
.pri-btn--done:hover { background: #1d5030; }
.pri-btn--del   { color: #e05a5a; }
.pri-btn--del:hover  { background: rgba(224,90,90,0.1); border-color: #e05a5a; color: #e05a5a; }
.pri-snooze-note {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  font-style: italic;
}

/* Flag groups */
.pri-flag-groups { display: flex; flex-direction: column; gap: 0.75rem; }
.pri-flag-group {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
}
.pri-flag-group-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.9rem;
  cursor: pointer;
  user-select: none;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text);
  gap: 0.5rem;
}
.pri-flag-group-hd:hover { background: var(--color-surface); }
.pri-flag-count {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1em 0.5em;
  border-radius: 999px;
  background: var(--color-border);
  color: var(--color-text-muted);
  margin-left: 0.4rem;
}
.pri-flag-chevron { font-size: 0.75rem; color: var(--color-text-muted); }
.pri-flag-group-body { padding: 0; }
.pri-flag-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.9rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.8rem;
}
.pri-flag-row:last-child { border-bottom: none; }
.pri-flag-title { flex: 1; color: var(--color-text); }
.pri-flag-desc  { font-size: 0.72rem; color: var(--color-text-muted); }
.pri-urgency-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.1em 0.55em;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.pri-urgency-badge--critical { background: #e05a5a; color: #fff; }
.pri-urgency-badge--warning  { background: #d08030; color: #fff; }
.pri-urgency-badge--info     { background: var(--color-border); color: var(--color-text-muted); }
.pri-flag-del {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0.1em 0.4em;
  border-radius: 4px;
}
.pri-flag-del:hover { color: #e05a5a; background: rgba(224,90,90,0.1); }

/* Checklist */
.pri-checklist {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.pri-checklist li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.85rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--color-text);
  cursor: pointer;
  user-select: none;
  transition: opacity 0.15s;
}
.pri-checklist li.checked {
  opacity: 0.45;
  text-decoration: line-through;
  color: var(--color-text-muted);
}
.pri-checklist li input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--color-accent);
  flex-shrink: 0;
  cursor: pointer;
}

/* Add/Edit form */
.pri-form {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.pri-form.hidden { display: none; }
.pri-form-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.admin-cancel-btn {
  padding: 0.45em 1.1em;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.admin-cancel-btn:hover { background: var(--color-border); color: var(--color-text); }
.admin-add-btn {
  padding: 0.35em 1em;
  border-radius: 6px;
  border: 1px solid var(--color-accent);
  background: transparent;
  color: var(--color-accent);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.admin-add-btn:hover { background: var(--color-accent-glow); }

/* ── Advisor surface ─────────────────────────────────────────────────────── */

.adv-role-label {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.adv-right-now-block {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 1.5rem;
}

.adv-rn-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
}

.adv-flag-group-hd { cursor: pointer; }

.adv-confidential-label {
  font-weight: 700;
  color: #e08030;
  letter-spacing: 0.03em;
}

.adv-form-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  max-width: 640px;
}

.adv-sug-success {
  margin-top: 10px;
  color: #5ac87a;
  font-size: 0.88rem;
  font-weight: 600;
}

/* ── Advisor process/labor summary table ─────────────────────────────────── */

.adv-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-top: 0.5rem;
}
.adv-summary-table th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 6px 10px;
  border-bottom: 1px solid var(--color-border);
}
.adv-summary-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}
.adv-summary-table tr:last-child td { border-bottom: none; }
.adv-summary-table tr:hover td { background: var(--color-accent-glow); }

/* ── Suggestion cards (advisor surface + admin review) ───────────────────── */

.suggestion-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.suggestion-card--reviewed { opacity: 0.6; }

.suggestion-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.suggestion-type-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 4px;
  background: #5a3fa0;
  color: #fff;
}
.suggestion-type-badge--note   { background: #1a5f7a; }
.suggestion-type-badge--prompt { background: #2d6b3a; }

.suggestion-status-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--color-border);
  color: var(--color-text-muted);
}
.suggestion-status-badge--pending  { background: #7a5a20; color: #f0d080; }
.suggestion-status-badge--accepted { background: #1a5f3a; color: #80e0a0; }
.suggestion-status-badge--dismissed { background: var(--color-border); color: var(--color-text-muted); }

.suggestion-content {
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 6px;
}
.suggestion-context {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}
.suggestion-meta {
  font-size: 0.75rem;
  color: var(--color-text-subtle, var(--color-text-muted));
}
.suggestion-review-note {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-style: italic;
}
.suggestion-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}


/* ── Admin Override Banner ────────────────────────────────────────── */
#admin-override-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  background: #b45309;
  color: #fff;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
#admin-override-banner strong {
  font-weight: 700;
}
.override-exit-btn {
  background: rgba(0,0,0,0.25);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 5px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s;
}
.override-exit-btn:hover {
  background: rgba(0,0,0,0.4);
}
body.has-override-banner {
  padding-top: 40px;
}

/* ── View-As button (People tab) ──────────────────────────────────── */
.viewas-btn {
  background: var(--color-accent, #0d9488);
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.viewas-btn:hover { opacity: 0.85; }
.viewas-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── PIN Change modal ─────────────────────────────────────────────── */
.pin-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pin-modal-overlay.hidden { display: none; }
.pin-modal {
  background: var(--color-bg-card, #1e2130);
  border: 1px solid var(--color-border, rgba(255,255,255,0.1));
  border-radius: 14px;
  padding: 28px 28px 24px;
  width: 340px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 12px 48px rgba(0,0,0,0.5);
}
.pin-modal-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--color-text, #e2e8f0);
}
.pin-modal-desc {
  font-size: 13px;
  color: var(--color-text-muted, #94a3b8);
  margin-bottom: 20px;
  line-height: 1.5;
}
.pin-modal-field { margin-bottom: 14px; }
.pin-modal-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--color-text-muted, #94a3b8);
  margin-bottom: 5px;
}
.pin-modal-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--color-border, rgba(255,255,255,0.12));
  background: var(--color-bg, #141624);
  color: var(--color-text, #e2e8f0);
  font-size: 15px;
  outline: none;
  letter-spacing: 0.1em;
}
.pin-modal-field input:focus {
  border-color: var(--color-accent, #14b8a6);
  box-shadow: 0 0 0 2px rgba(20,184,166,0.18);
}
.pin-modal-error {
  font-size: 13px;
  color: #f87171;
  margin-bottom: 4px;
  min-height: 18px;
}
.pin-modal-error.hidden { display: none; }
.pin-modal-success {
  font-size: 13px;
  color: #34d399;
  margin-bottom: 4px;
}
.pin-modal-success.hidden { display: none; }
.pin-modal-btns {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}
.pin-modal-cancel-btn {
  padding: 8px 18px;
  border-radius: 8px;
  border: 1px solid var(--color-border, rgba(255,255,255,0.12));
  background: transparent;
  color: var(--color-text-muted, #94a3b8);
  font-size: 14px;
  cursor: pointer;
}
.pin-modal-cancel-btn:hover { border-color: var(--color-accent, #14b8a6); color: var(--color-accent, #14b8a6); }
.pin-modal-submit {
  padding: 8px 18px;
  border-radius: 8px;
  border: none;
  background: var(--color-accent, #14b8a6);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.pin-modal-submit:hover { opacity: 0.88; }
.pin-modal-submit:disabled { opacity: 0.55; cursor: not-allowed; }

/* PIN button in header bars */
.pin-change-btn {
  background: transparent;
  border: 1px solid var(--color-border, rgba(255,255,255,0.15));
  color: var(--color-text-muted, #94a3b8);
  border-radius: 7px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.pin-change-btn:hover {
  border-color: var(--color-accent, #14b8a6);
  color: var(--color-accent, #14b8a6);
}
/* Slight size adjustment for field view's compact header */
.fv-pin-btn { padding: 3px 8px; font-size: 10px; }

/* ── Admin Field Notes Panel ─────────────────────────────────────────────── */
.fn-filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.fn-filter-select {
  min-width: 160px;
}
.fn-note-card {
  background: var(--color-surface, #1a2a2a);
  border: 1px solid var(--color-border, rgba(255,255,255,0.1));
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.fn-note-card--resolved {
  opacity: 0.72;
  border-color: var(--color-border, rgba(255,255,255,0.07));
}
.fn-note-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.fn-note-who {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--color-text, #e2e8f0);
}
.fn-note-project {
  font-size: 0.78rem;
  color: var(--color-text-muted, #94a3b8);
  background: var(--color-surface-2, rgba(255,255,255,0.06));
  border-radius: 5px;
  padding: 2px 7px;
}
.fn-note-item-id {
  font-size: 0.75rem;
  color: var(--color-text-subtle, #64748b);
  font-family: monospace;
}
.fn-resolved-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(1,148,150,0.15);
  color: var(--color-accent, #019496);
  border-radius: 5px;
  padding: 2px 8px;
  letter-spacing: 0.03em;
}
.fn-open-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(234,179,8,0.13);
  color: #d4a017;
  border-radius: 5px;
  padding: 2px 8px;
  letter-spacing: 0.03em;
}
.fn-blocker-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(218,84,84,0.15);
  color: #da5454;
  border-radius: 5px;
  padding: 2px 8px;
  letter-spacing: 0.03em;
}
.fn-review-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(240,192,96,0.15);
  color: #f0c060;
  border-radius: 5px;
  padding: 2px 8px;
  letter-spacing: 0.03em;
}
.fn-note-card--review  { border-left: 3px solid #f0c060; padding-left: 9px; }
.fn-note-card--blocker { border-left: 3px solid #da5454; padding-left: 9px; }
.fn-note-time {
  font-size: 0.75rem;
  color: var(--color-text-subtle, #64748b);
  margin-left: auto;
}
.fn-note-text {
  font-size: 0.88rem;
  color: var(--color-text, #e2e8f0);
  line-height: 1.5;
}

/* ── Proposals Tab ──────────────────────────────────────────────── */

/* Task board: task type badge */
.tt-type-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 1px 6px;
  margin-right: 4px;
  vertical-align: middle;
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}
.tt-type-badge.tt-type-walkthrough {
  background: rgba(1,148,150,0.12);
  color: var(--color-accent-text);
  border-color: var(--color-accent-dim);
}
.tt-type-badge.tt-type-proposal_review,
.tt-type-badge.tt-type-proposal-review {
  background: rgba(139,92,246,0.13);
  color: #c4b5fd;
  border-color: rgba(139,92,246,0.35);
}
.tt-type-badge.tt-type-clarification {
  background: rgba(217,144,48,0.12);
  color: var(--color-warning);
  border-color: rgba(217,144,48,0.3);
}
.tt-type-badge.tt-type-general {
  background: transparent;
  color: var(--color-text-subtle);
  border-color: transparent;
  display: none;
}

/* Task board: walkthrough done + review draft buttons */
.prop-wt-done-btn,
.prop-review-btn {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}
.prop-wt-done-btn {
  background: rgba(1,148,150,0.18);
  color: var(--color-accent-text);
  border: 1px solid var(--color-accent-dim);
}
.prop-wt-done-btn:hover { background: rgba(1,148,150,0.3); }
.prop-review-btn {
  background: rgba(139,92,246,0.15);
  color: #c4b5fd;
  border: 1px solid rgba(139,92,246,0.35);
}
.prop-review-btn:hover { background: rgba(139,92,246,0.28); }

/* Proposal list cards */
.prop-list-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.prop-list-card:hover {
  border-color: var(--color-accent-dim);
  background: var(--color-surface-2);
}
.prop-list-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.prop-list-client {
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--color-text);
  flex: 1;
}
.prop-list-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  flex-wrap: wrap;
}
.prop-flag-count {
  background: rgba(217,144,48,0.14);
  color: var(--color-warning);
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 0.76rem;
  font-weight: 600;
}
.prop-list-date {
  margin-left: auto;
  color: var(--color-text-subtle);
  font-size: 0.76rem;
}

/* Proposal status badges */
.prop-status-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 2px 8px;
  white-space: nowrap;
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}
.prop-status-badge--context_incomplete {
  background: rgba(217,82,82,0.12);
  color: var(--color-danger);
  border-color: rgba(217,82,82,0.3);
}
.prop-status-badge--context_ready {
  background: rgba(1,148,150,0.12);
  color: var(--color-accent-text);
  border-color: var(--color-accent-dim);
}
.prop-status-badge--building {
  background: rgba(139,92,246,0.13);
  color: #c4b5fd;
  border-color: rgba(139,92,246,0.3);
  animation: pulse-badge 1.4s ease-in-out infinite;
}
@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.prop-status-badge--build_error {
  background: rgba(217,82,82,0.15);
  color: #f87171;
  border-color: rgba(217,82,82,0.35);
}
.prop-status-badge--flags_pending {
  background: rgba(217,144,48,0.14);
  color: var(--color-warning);
  border-color: rgba(217,144,48,0.3);
}
.prop-status-badge--draft_ready {
  background: rgba(39,180,113,0.12);
  color: var(--color-success);
  border-color: rgba(39,180,113,0.3);
}
.prop-status-badge--on_hold {
  background: rgba(100,116,139,0.15);
  color: #94a3b8;
  border-color: rgba(100,116,139,0.3);
}
.prop-status-badge--approved {
  background: rgba(39,180,113,0.18);
  color: #34d399;
  border-color: rgba(39,180,113,0.4);
  font-weight: 800;
}
.prop-status-badge--delivered {
  background: rgba(1,148,150,0.18);
  color: var(--color-accent-bright);
  border-color: var(--color-accent);
}
.prop-status-badge--lost {
  background: rgba(100,116,139,0.1);
  color: var(--color-text-subtle);
  border-color: rgba(100,116,139,0.2);
  text-decoration: line-through;
}
/* Phase 2 — D-Tools handoff badges */
.prop-status-badge--dtools_ready {
  background: rgba(139,92,246,0.16);
  color: #c4b5fd;
  border-color: rgba(139,92,246,0.4);
}
.prop-status-badge--dtools_in_progress {
  background: rgba(56,189,248,0.14);
  color: #7dd3fc;
  border-color: rgba(56,189,248,0.35);
  animation: pulse-badge 1.6s ease-in-out infinite;
}
.prop-status-badge--entered_in_dtools {
  background: rgba(1,148,150,0.16);
  color: var(--color-accent-bright);
  border-color: var(--color-accent);
}
.prop-status-badge--proposal_sent {
  background: rgba(217,144,48,0.18);
  color: var(--color-warning);
  border-color: rgba(217,144,48,0.4);
  font-weight: 800;
}
.prop-status-badge--closed_won {
  background: rgba(39,180,113,0.22);
  color: #34d399;
  border-color: rgba(39,180,113,0.5);
  font-weight: 800;
}
.prop-status-badge--closed_lost {
  background: rgba(100,116,139,0.12);
  color: var(--color-text-subtle);
  border-color: rgba(100,116,139,0.25);
  text-decoration: line-through;
}

/* Phase 2 — audit trail + inline forms + toast */
.prop-audit {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--color-border-light);
}
.prop-audit-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0 0;
  font-size: 0.82rem;
  line-height: 1.7;
}
.prop-audit-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  padding: 3px 0;
  border-bottom: 1px dotted var(--color-border-light);
}
.prop-audit-list li:last-child { border-bottom: none; }
.prop-audit-label {
  font-weight: 600;
  color: var(--color-text);
  min-width: 180px;
}
.prop-audit-time {
  color: var(--color-text-muted);
  font-size: 0.78rem;
}
.prop-audit-user {
  color: var(--color-text-subtle);
  font-size: 0.78rem;
  font-style: italic;
}
.prop-audit-extra {
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--color-text);
}
.prop-audit-tag {
  display: inline-block;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 4px;
  font-family: monospace;
  font-size: 0.78rem;
  color: var(--color-accent-text);
}
.prop-audit-link {
  color: var(--color-accent-text);
  word-break: break-all;
  margin-left: 4px;
}
.prop-audit-overdue {
  color: var(--color-danger);
  font-weight: 700;
}
.prop-action-hint {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  align-self: center;
}
.prop-inline-form {
  flex-basis: 100%;
  margin-top: 12px;
  padding: 14px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
}
.prop-inline-form.hidden { display: none; }
.prop-inline-form .prop-modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}
.prop-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--color-accent);
  color: var(--color-on-accent, #fff);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 9999;
}
.prop-toast.prop-toast--visible {
  opacity: 1;
  transform: translateY(0);
}

/* Proposal detail bars */
.prop-warnings-bar {
  background: rgba(217,144,48,0.12);
  border: 1px solid rgba(217,144,48,0.3);
  border-radius: var(--radius-sm);
  color: var(--color-warning);
  padding: 10px 14px;
  font-size: 0.84rem;
  line-height: 1.6;
  margin-bottom: 14px;
}
.prop-build-error-bar {
  background: var(--color-danger-bg);
  border: 1px solid rgba(217,82,82,0.3);
  border-radius: var(--radius-sm);
  color: #f87171;
  padding: 10px 14px;
  font-size: 0.84rem;
  line-height: 1.6;
  margin-bottom: 14px;
}

/* Proposal detail actions row */
.prop-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

/* Draft content sections */
.prop-section {
  margin-bottom: 22px;
}
.prop-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 10px;
  border-bottom: 1px solid var(--color-border-light);
  padding-bottom: 6px;
}
.prop-kv-grid {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 4px 14px;
  font-size: 0.86rem;
}
.prop-kv-key {
  color: var(--color-text-muted);
  font-weight: 600;
}
.prop-room-list {
  padding-left: 22px;
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.8;
  color: var(--color-text);
}
.prop-room-summary {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 8px;
}
.prop-room-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--color-accent-text);
  margin-bottom: 4px;
}
.prop-room-systems {
  padding-left: 18px;
  margin: 4px 0;
  font-size: 0.83rem;
  color: var(--color-text);
  line-height: 1.7;
}
.prop-room-notes {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-style: italic;
  margin-top: 4px;
}
.prop-labor-text {
  font-size: 0.86rem;
  color: var(--color-text);
  line-height: 1.6;
  white-space: pre-wrap;
}
.prop-no-draft {
  text-align: center;
  color: var(--color-text-muted);
  padding: 28px 0;
  font-size: 0.9rem;
}

/* Flag cards */
.prop-flag-card {
  background: var(--color-surface-2);
  border: 1px solid rgba(217,144,48,0.28);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
}
.prop-flag-card--resolved {
  opacity: 0.55;
  border-color: var(--color-border);
}
.prop-flag-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.prop-flag-item {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text);
  flex: 1;
}
.prop-flag-resolved-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(39,180,113,0.14);
  color: var(--color-success);
  border-radius: 4px;
  padding: 2px 8px;
  white-space: nowrap;
}
.prop-flag-open-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(217,144,48,0.13);
  color: var(--color-warning);
  border-radius: 4px;
  padding: 2px 8px;
  white-space: nowrap;
}
.prop-flag-reason {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 8px;
}
.prop-flag-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Context form modal overlay */
.prop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  z-index: 900;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px 24px;
  overflow-y: auto;
}
.prop-overlay.hidden { display: none; }

.prop-context-modal {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
}
.prop-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--color-border);
}
.prop-modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
}
.prop-modal-body {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  max-height: calc(100vh - 220px);
}
.prop-modal-body label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 10px;
  margin-bottom: 2px;
  display: block;
}
.prop-modal-body label:first-child { margin-top: 0; }
.prop-required-note {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}
.prop-transcript-area {
  font-family: var(--font-mono);
  font-size: 0.81rem;
  resize: vertical;
  min-height: 140px;
}
.prop-word-count {
  font-size: 0.76rem;
  color: var(--color-text-subtle);
  text-align: right;
  margin-top: 2px;
}
.prop-extract-btn {
  align-self: flex-start;
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 4px;
}
.prop-extract-btn:hover {
  background: var(--color-border);
  color: var(--color-text);
}
.prop-gate-msg {
  background: rgba(217,82,82,0.11);
  border: 1px solid rgba(217,82,82,0.28);
  border-radius: var(--radius-sm);
  color: #f87171;
  padding: 8px 12px;
  font-size: 0.82rem;
  line-height: 1.5;
  margin-top: 6px;
}
.prop-gate-msg.hidden { display: none; }
.prop-modal-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--color-border);
  flex-wrap: wrap;
}
.prop-modal-footer button { flex-shrink: 0; }

/* ── Client showroom modules (Goal 3): System Manual + App Cards ─────────── */
.sysman-room { margin-top: 14px; }
.sysman-room:first-child { margin-top: 4px; }
.sysman-room-name {
  font-size: 13px; font-weight: 700; color: var(--color-accent-text);
  letter-spacing: 0.02em; margin-bottom: 4px;
}
.appcard-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px;
}
.appcard {
  background: var(--color-surface-2); border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: 13px 15px; display: flex; flex-direction: column; gap: 4px;
}
.appcard-name { font-size: 14px; font-weight: 700; color: var(--color-text); }
.appcard-controls { font-size: 12px; color: var(--color-text-muted); }
.appcard-notes { font-size: 12px; color: var(--color-text-subtle); line-height: 1.5; }
.appcard-link {
  margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--color-accent-text);
  text-decoration: none; align-self: flex-start;
}
.appcard-link:hover { text-decoration: underline; }

/* ── Secure Vault ───────────────────────────────────────────────────────── */
.vault-note { font-size: 12px; color: var(--color-text-subtle); margin-bottom: 12px; line-height: 1.5; }
.vault-list { display: flex; flex-direction: column; gap: 10px; }
.vault-row {
  background: var(--color-surface-2); border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: 11px 13px;
}
.vault-row-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.vault-label { font-size: 14px; font-weight: 700; color: var(--color-text); }
.vault-type {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--color-accent-text); background: var(--color-accent-glow);
  padding: 2px 7px; border-radius: 999px;
}
.vault-field { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-top: 3px; flex-wrap: wrap; }
.vault-k { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--color-text-subtle); min-width: 48px; }
.vault-v { color: var(--color-text); font-family: var(--font-mono); }
.vault-secret { letter-spacing: 1px; }
.vault-notes { font-size: 12px; color: var(--color-text-muted); margin-top: 5px; }
.vault-btn {
  font: inherit; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: var(--radius-sm);
  border: 1px solid var(--color-border); background: transparent; color: var(--color-text-muted); cursor: pointer;
}
.vault-btn:hover { border-color: var(--color-accent); color: var(--color-text); }

/* ── Service Requests (Part 2) ──────────────────────────────────────────── */
.svcreq-form { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.svcreq-input { background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius); color: var(--color-text); font: inherit; font-size: 13px; padding: 9px 11px; outline: none; }
.svcreq-input:focus { border-color: var(--color-accent); }
.cp-portal-btn { align-self: flex-start; font: inherit; font-size: 13px; font-weight: 600; padding: 8px 15px; border-radius: var(--radius); border: 1px solid var(--color-accent); background: var(--color-accent); color: #fff; cursor: pointer; }
.cp-portal-btn:hover { background: var(--color-accent-bright); }
.svcreq-status { font-size: 12px; color: var(--color-text-muted); }
.svcreq-list { margin-top: 14px; }
.svcreq-list-h { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--color-text-subtle); margin-bottom: 6px; }
.svcreq-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--color-border-light); font-size: 13px; }
.svcreq-pri { font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.svcreq-pri--high   { background: var(--color-danger-bg);  color: var(--color-danger); }
.svcreq-pri--normal { background: var(--color-accent-glow); color: var(--color-accent-text); }
.svcreq-pri--low    { background: var(--color-surface-2);  color: var(--color-text-muted); }
.svcreq-subj { flex: 1; color: var(--color-text); }
.svcreq-st { font-size: 11px; color: var(--color-text-subtle); text-transform: uppercase; }
