/* ============================================================
   EPW Base — Shared design tokens & component classes
   Extracted from assigning.css, nextsteps.css, wip.css, timeline.css
   ADR-044 Phase B4 · Azia Light Theme
   ============================================================ */

/* ---- View Container ---- */
.epw-view {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  background: #F9FAFB;
  color: #475569;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  overflow: hidden;
  border-left: 5px solid var(--page-accent, #0693E3);
}

/* Watermark disabled — JPG has opaque dark background; re-enable with transparent PNG */
.epw-view::before {
  content: none;
}

/* ---- Header ---- */
.epw-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 28px;
  min-height: 90px;
  z-index: 250;
  flex-shrink: 0;
  border-bottom: 4px solid #0693E3;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.epw-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.epw-header-logo {
  width: 48px;
  height: 48px;
  color: #0693E3;
  opacity: 0.85;
  flex-shrink: 0;
  border-radius: 50%;
}

.epw-title {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #172351;
  cursor: pointer;
}

.epw-subtitle {
  font-size: 0.75rem;
  font-weight: 400;
  color: rgba(71, 85, 105, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-left: 4px;
}

.epw-header-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.epw-header-quote {
  flex: 1;
  text-align: center;
  padding: 0 24px;
}

.epw-quote-text {
  font-size: 0.78rem;
  font-style: italic;
  color: rgba(71, 85, 105, 0.55);
  line-height: 1.4;
  margin: 0;
}

.epw-header-right {
  display: flex;
  gap: 5px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 10px;
  padding: 4px;
  flex-shrink: 0;
}


/* ---- Nav Badge (KPI count on tab buttons) ---- */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  margin-right: 5px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: #E8740C;
  border: 2px solid #C55A00;
  border-radius: 12px;
  vertical-align: middle;
}
/* .nav-badge:empty — removed; badges always show old|new split */

/* Badge split: old | new */
.nav-badge-has-new {
  padding: 0;
  background: none;
  border: none;
  gap: 0;
}
.nav-badge-has-new .badge-old {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 18px;
  padding: 0 4px;
  font-size: 0.6rem;
  font-weight: 700;
  color: #fff;
  background: #94A3B8;
  border-radius: 10px 0 0 10px;
  border: 2px solid #7C8BA1;
  border-right: none;
}
.nav-badge-has-new .badge-sep {
  display: inline-block;
  width: 1px;
  height: 18px;
  background: rgba(255,255,255,0.5);
}
.nav-badge-has-new .badge-new {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 18px;
  padding: 0 4px;
  font-size: 0.6rem;
  font-weight: 700;
  color: #fff;
  background: #E8740C;
  border-radius: 0 10px 10px 0;
  border: 2px solid #C55A00;
  border-left: none;
}
.nav-badge-all-old .badge-new {
  background: #CBD5E1;
  border-color: #94A3B8;
  opacity: 0.6;
}

/* ---- Bundle Collapse/Expand (shared across Next Steps, WIP, Outputs) ---- */
.wip-bundle-chevron {
  display: inline-block;
  cursor: pointer;
  font-size: 0.7rem;
  margin-right: 6px;
  color: #64748b;
  transition: transform 0.15s;
  user-select: none;
}
.wip-bundle-chevron:hover { color: #0693E3; }
.wip-chevron-open { color: #0693E3; }
.wip-bundle-summary {
  display: inline-block;
  margin-left: 10px;
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 500;
}
.wip-project-row { background: rgba(6, 147, 227, 0.03); }

/* ---- KPI Banner ---- */
.epw-kpi-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 28px;
  flex-shrink: 0;
  z-index: 5;
  background: rgba(168, 85, 247, 0.06);
  border-bottom: 1px solid rgba(168, 85, 247, 0.12);
}
.epw-kpi-banner-label {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--page-accent, #0693E3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  -webkit-text-stroke: 0.5px #1e293b;
  paint-order: stroke fill;
}
.epw-kpi-banner-num {
  font-size: 1rem;
  font-weight: 700;
  color: rgba(168, 85, 247, 0.95);
}
.epw-kpi-banner-desc {
  font-size: 0.7rem;
  color: rgba(71, 85, 105, 0.6);
  margin-left: 2px;
}

/* ---- Filter Bar ---- */
.epw-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 28px;
  flex-shrink: 0;
  z-index: 5;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.95);
}

.epw-filter-pills {
  display: flex;
  gap: 6px;
}

.epw-filter-pill {
  padding: 5px 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.02);
  color: rgba(71, 85, 105, 0.6);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.epw-filter-pill:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #475569;
  border-color: rgba(0, 0, 0, 0.12);
}

.epw-filter-active {
  background: rgba(6, 147, 227, 0.1);
  color: #0693E3;
  border-color: rgba(6, 147, 227, 0.3);
}

.epw-summary-info {
  margin-left: auto;
  font-size: 0.7rem;
  color: rgba(71, 85, 105, 0.5);
}


/* ---- View Button (nav toggle) ---- */
.epw-view-btn {
  padding: 6px 16px;
  border: none;
  background: transparent;
  color: rgba(71, 85, 105, 0.8);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.epw-view-btn:hover {
  color: #475569;
  background: rgba(0, 0, 0, 0.04);
}

.epw-view-active {
  color: #0693E3;
  background: rgba(6, 147, 227, 0.1);
}


/* ---- Action Buttons ---- */
.epw-btn {
  padding: 7px 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #FFFFFF;
  color: rgba(71, 85, 105, 0.8);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.epw-btn:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #475569;
}

.epw-btn-confirm {
  background: rgba(34, 197, 94, 0.12);
  color: rgba(34, 197, 94, 0.9);
  border-color: rgba(34, 197, 94, 0.25);
}

.epw-btn-confirm:hover {
  background: rgba(34, 197, 94, 0.2);
}

.epw-btn-dismiss {
  color: rgba(71, 85, 105, 0.5);
}


/* ---- Detail Panel (slide from right) ---- */
.epw-detail {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  background: #FFFFFF;
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-left: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08);
  z-index: 200;
  overflow-y: auto;
  padding: 24px;
  transform: translateX(100%);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.1) transparent;
}

.epw-detail-open {
  transform: translateX(0);
  opacity: 1;
}

.epw-detail-close {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #FFFFFF;
  color: rgba(71, 85, 105, 0.7);
  font-size: 18px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.epw-detail-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #475569;
}


/* ---- Form Fields ---- */
.epw-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.epw-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.epw-form-group label {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(71, 85, 105, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.epw-form-select,
.epw-form-input,
.epw-form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #FFFFFF;
  color: #475569;
  font-family: inherit;
  font-size: 0.85rem;
  border-radius: 6px;
  box-sizing: border-box;
}

.epw-form-select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 16 16' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

.epw-form-select option {
  background: #FFFFFF;
  color: #475569;
}

.epw-form-textarea {
  min-height: 80px;
  resize: vertical;
}

.epw-form-select:focus,
.epw-form-input:focus,
.epw-form-textarea:focus {
  outline: none;
  border-color: rgba(6, 147, 227, 0.4);
  box-shadow: 0 0 0 2px rgba(6, 147, 227, 0.15);
}


/* ---- Status Badges ---- */
.epw-badge {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 10px;
  white-space: nowrap;
}

.epw-badge-blue {
  background: rgba(59, 130, 246, 0.15);
  color: rgba(96, 165, 250, 0.9);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.epw-badge-green {
  background: rgba(34, 197, 94, 0.15);
  color: rgba(34, 197, 94, 0.9);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.epw-badge-grey {
  background: rgba(148, 163, 184, 0.1);
  color: rgba(148, 163, 184, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.epw-badge-amber {
  background: rgba(245, 158, 11, 0.15);
  color: rgba(251, 191, 36, 0.9);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.epw-badge-teal {
  background: rgba(20, 184, 166, 0.15);
  color: rgba(45, 212, 191, 0.9);
  border: 1px solid rgba(20, 184, 166, 0.25);
}

.epw-badge-purple {
  background: rgba(168, 85, 247, 0.15);
  color: rgba(192, 132, 252, 0.9);
  border: 1px solid rgba(168, 85, 247, 0.25);
}

.epw-badge-red {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}


/* ---- Empty State ---- */
.epw-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
  color: rgba(71, 85, 105, 0.4);
}

.epw-empty-icon {
  font-size: 3rem;
  opacity: 0.3;
}

.epw-empty-text {
  font-size: 0.9rem;
}


/* ---- Scrollable Content Area ---- */
.epw-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px 28px;
  padding-bottom: 10cm;
  z-index: 2;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.1) transparent;
}

/* EPW Template #10: All page scroll containers get 10cm bottom buffer */
.wip-table-container,
.lt-table-container,
.asg-cards,
.nsa-scroll-area,
.sch-table-container,
.sec-body,
.intel-body,
.tools-body,
.forum-body,
.tr-body,
.outputs-table-container {
  padding-bottom: 10cm;
  position: relative;
}

/* "Page End" marker in buffer zone */
.wip-table-container::after,
.lt-table-container::after,
.asg-cards::after,
.nsa-scroll-area::after,
.sch-table-container::after,
.sec-body::after,
.intel-body::after,
.tools-body::after,
.forum-body::after,
.tr-body::after,
.outputs-table-container::after {
  content: '— Page End —';
  display: block;
  text-align: center;
  color: #cbd5e1;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding-top: 3cm;
}

/* "Table End" marker after tables inside scroll containers */
.nsa-pq-table-wrap::after,
.wip-table-container > table::after,
.lt-table-container > table::after,
.sch-table-container > table::after,
.outputs-table-container > table::after,
.sec-body > .sec-table:last-of-type::after {
  content: '— Table End —';
  display: block;
  text-align: center;
  color: #d1d5db;
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding-top: 1.5cm;
}


/* ---- Detail Actions Row ---- */
.epw-detail-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.epw-detail-actions .epw-btn {
  flex: 1;
  text-align: center;
  padding: 10px 16px;
}


/* ---- Responsive ---- */
@media (max-width: 768px) {
  .epw-header { padding: 10px 16px; }
  .epw-filter-bar { padding: 8px 16px; flex-wrap: wrap; }
  .epw-scroll-area { padding: 14px 16px; }
  .epw-detail { width: 100%; border-left: none; }
  .epw-subtitle { display: none; }
  .epw-summary-info { display: none; }
}

@media (max-width: 480px) {
  .epw-header { padding: 8px 12px; }
  .epw-filter-bar { padding: 6px 12px; gap: 8px; }
  .epw-scroll-area { padding: 10px 12px; }
}


/* ---- Sortable Column Headers ---- */
th[data-sortable] {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease;
}

th[data-sortable]:hover {
  color: #0693E3;
}

.epw-sort-arrow {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.55rem;
  opacity: 0.3;
  transition: opacity 0.2s ease, transform 0.2s ease;
  vertical-align: middle;
}

th[data-sort-active] .epw-sort-arrow {
  opacity: 1;
  color: #0693E3;
}

th[data-sort-active="desc"] .epw-sort-arrow {
  transform: rotate(180deg);
}


/* ---- Subsection Search Box ---- */
.epw-subsection-search {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  margin-bottom: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.epw-search-icon {
  font-size: 0.85rem;
  opacity: 0.5;
}

.epw-search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.82rem;
  font-family: inherit;
  color: #1e293b;
  padding: 4px 0;
}

.epw-search-input::placeholder {
  color: #94a3b8;
}

.epw-search-count {
  font-size: 0.72rem;
  color: #64748b;
  white-space: nowrap;
}

.epw-search-clear {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  color: #94a3b8;
  padding: 2px 4px;
  border-radius: 3px;
  line-height: 1;
}

.epw-search-clear:hover {
  color: #ef4444;
  background: #fef2f2;
}

/* Page-level search box (in filter bars) */
.epw-page-search {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  min-width: 200px;
  max-width: 320px;
}
.epw-page-search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.82rem;
  font-family: inherit;
  color: #1e293b;
  padding: 3px 0;
  min-width: 0;
}
.epw-page-search-input::placeholder { color: #94a3b8; }
.epw-page-search-count {
  font-size: 0.72rem;
  color: #64748b;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .epw-subsection-search { padding: 4px 8px; }
  .epw-search-input { font-size: 0.78rem; }
}


/* ---- Page Color System ----
   Each page gets a unique tinted background + header border.
   Colors match PAGE_COLORS in shared.js.
   Body classes (tl-active, schedule-active, etc.) are set by switchToXxxView().
   ---- */

/* Header border colors per page */
body.schedule-active .epw-header,
body.schedule-active [class$="-header"] { border-bottom-color: #3B82F6; }
body.latest-active .epw-header,
body.latest-active [class$="-header"] { border-bottom-color: #EA580C; }
body.asg-active .epw-header,
body.asg-active [class$="-header"] { border-bottom-color: #9333EA; }
body.nsa-active .epw-header,
body.nsa-active [class$="-header"] { border-bottom-color: #D97706; }
body.wip-active .epw-header,
body.wip-active [class$="-header"] { border-bottom-color: #0D9488; }
body.intel-active .epw-header,
body.intel-active [class$="-header"] { border-bottom-color: #4F46E5; }
body.forum-active .epw-header,
body.forum-active [class$="-header"] { border-bottom-color: #E11D48; }
body.security-active .epw-header,
body.security-active [class$="-header"] { border-bottom-color: #92400E; }
body.db-explorer-active .epw-header,
body.db-explorer-active [class$="-header"] { border-bottom-color: #7C3AED; }

/* ---- New Item FAB (ADR-095 Forcing Mechanism) ---- */
#epw-new-item-fab {
  position: fixed;
  bottom: 80px;
  right: 28px;
  z-index: 1000;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: #0693E3;
  color: #fff;
  font-size: 26px;
  font-weight: 300;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(6,147,227,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s;
  font-family: 'Inter', sans-serif;
  line-height: 1;
}
#epw-new-item-fab:hover { transform: scale(1.1); background: #0580c9; }

/* ---- New Item Modal ---- */
#epw-new-item-modal { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; }
.epw-nim-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.3); }
.epw-nim-dialog {
  position: relative;
  background: #fff;
  border-radius: 12px;
  width: 480px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  padding: 0;
}
.epw-nim-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 12px;
  border-bottom: 1px solid #f1f5f9;
}
.epw-nim-header h3 { margin: 0; font-size: 16px; font-weight: 600; color: #1e293b; }
.epw-nim-close {
  background: none; border: none; font-size: 22px; color: #94a3b8;
  cursor: pointer; padding: 0 4px; line-height: 1;
}
.epw-nim-close:hover { color: #475569; }

#epw-nim-form { padding: 16px 20px 20px; }
.epw-nim-row { margin-bottom: 12px; }
.epw-nim-row label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.epw-nim-row input, .epw-nim-row select, .epw-nim-row textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  color: #334155;
  background: #fff;
  box-sizing: border-box;
}
.epw-nim-row input:focus, .epw-nim-row select:focus, .epw-nim-row textarea:focus {
  outline: none;
  border-color: #0693E3;
  box-shadow: 0 0 0 2px rgba(6,147,227,0.1);
}
.epw-nim-row-inline { display: flex; gap: 12px; }
.epw-nim-row-inline > div { flex: 1; }

.epw-nim-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}
.epw-nim-cancel {
  padding: 8px 16px;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  color: #64748b;
  font-family: 'Inter', sans-serif;
}
.epw-nim-submit {
  padding: 8px 20px;
  border: none;
  background: #0693E3;
  color: #fff;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}
.epw-nim-submit:hover { background: #0580c9; }
.epw-nim-result { margin-top: 10px; font-size: 12px; text-align: center; }
.epw-nim-success { color: #16a34a; font-weight: 500; }
.epw-nim-error { color: #dc2626; }
.epw-nim-milestone-entry { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.epw-nim-milestone-entry input { flex: 1; }
.epw-nim-add-milestone, .epw-nim-remove-milestone {
  width: 28px; height: 28px; border: 1px solid #cbd5e1; border-radius: 4px;
  background: #f8fafc; cursor: pointer; font-size: 16px; line-height: 1;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.epw-nim-add-milestone:hover { background: #e2e8f0; }
.epw-nim-remove-milestone:hover { background: #fee2e2; color: #dc2626; }

/* ---- FAB Confirmation Screen ---- */
#epw-nim-confirm {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px 28px;
  text-align: center;
  min-height: 260px;
}
#epw-nim-confirm-canvas {
  border-radius: 50%;
  display: block;
  margin: 0 auto 20px;
}
.epw-nim-confirm-msg {
  font-size: 14px;
  color: #1e293b;
  line-height: 1.6;
  max-width: 340px;
  margin: 0 auto 20px;
}
.epw-nim-confirm-ref {
  display: inline-block;
  font-family: 'Courier New', monospace;
  font-size: 15px;
  font-weight: 700;
  color: #0693E3;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: 4px 12px;
  margin: 6px 0 14px;
  letter-spacing: 0.5px;
}
.epw-nim-confirm-error {
  font-size: 13px;
  color: #dc2626;
  margin: 0 auto 16px;
  max-width: 320px;
}
.epw-nim-confirm-close {
  padding: 9px 28px;
  border: none;
  background: #0693E3;
  color: #fff;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}
.epw-nim-confirm-close:hover { background: #0580c9; }
.epw-nim-project-fields { border-top: 1px solid #e2e8f0; padding-top: 12px; margin-top: 4px; }

/* ---- Return to Top inline links ---- */
.return-to-top-link {
  display: inline-block;
  font-size: 0.7rem;
  color: #0693E3;
  text-decoration: none;
  cursor: pointer;
  margin: 4px 0 12px 0;
  letter-spacing: 0.3px;
  font-weight: 500;
}
.return-to-top-link:hover {
  text-decoration: underline;
  color: #0580c9;
}

/* ---- Page Navigation + Click Path (ADR template for section pages) ---- */
.epw-page-nav {
  padding: 10px 24px;
  font-size: 0.82rem;
  color: #1e293b;
  border-bottom: 1px solid #e2e8f0;
  border-left: 3px solid #64748b;
  background: #f8fafc;
}
.epw-page-nav .page-nav-label {
  font-weight: 600;
  color: #475569;
  margin-right: 4px;
}
.epw-page-nav .page-nav-link {
  color: #475569;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s;
}
.epw-page-nav .page-nav-link:hover {
  color: #1e293b;
  text-decoration: underline;
}
.epw-page-nav .page-nav-link.active {
  font-weight: 600;
  text-decoration: underline;
}
.epw-page-nav .page-nav-sep {
  color: #cbd5e1;
  margin: 0 2px;
}

/* Click Path bar — shows EPW / Page / Section with copy button */
.epw-click-path {
  display: flex;
  align-items: center;
  padding: 6px 24px;
  font-size: 0.78rem;
  color: #64748b;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  border-left: 3px solid #64748b;
  gap: 4px;
  min-height: 30px;
}
.epw-click-path .click-path-label {
  font-weight: 600;
  color: #475569;
  margin-right: 4px;
  white-space: nowrap;
}
.epw-click-path .click-path-crumb {
  color: #64748b;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.epw-click-path .click-path-crumb:hover {
  color: #1e293b;
}
.epw-click-path .click-path-current {
  color: #1e293b;
  font-weight: 500;
  cursor: default;
}
.epw-click-path .click-path-sep {
  color: #cbd5e1;
  margin: 0 2px;
}
.epw-click-path .click-path-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: #94a3b8;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 6px;
  padding: 0;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.epw-click-path .click-path-copy:hover {
  background: rgba(0,0,0,0.06);
  color: #475569;
}
.epw-click-path .click-path-copy.copied {
  color: #22c55e;
}

/* C4 Map link in click-path bar */
.c4-map-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
  text-decoration: none;
  background: rgba(100, 116, 139, 0.08);
  border: 1px solid rgba(100, 116, 139, 0.18);
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.c4-map-link:hover {
  background: rgba(100, 116, 139, 0.15);
  color: #334155;
  border-color: rgba(100, 116, 139, 0.3);
}
.c4-map-link svg {
  flex-shrink: 0;
}
/* BUG-004: Offline state — LikeC4 server not running */
.c4-map-offline {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
  text-decoration: none;
}
/* Also support C4 map link inside outputs breadcrumb bar */
.epw-breadcrumb-bar .c4-map-link {
  margin-left: 8px;
}

/* ---- Collapsible section bodies (wirePageNav template) ---- */
.epw-section-body {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.25s ease;
  max-height: 5000px;
  opacity: 1;
}
.epw-section-body.collapsed {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

/* Chevron indicator on section titles */
.epw-section-chevron {
  display: inline-block;
  font-size: 0.65em;
  margin-right: 8px;
  transition: transform 0.2s ease;
  color: #94a3b8;
  vertical-align: middle;
}

/* ---- EPW Item Comments ---- */
.epw-comments-section {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(6, 147, 227, 0.12);
}
.epw-comments-title {
  font-size: 0.65rem;
  font-weight: 600;
  color: rgba(6, 147, 227, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.epw-comments-list {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 8px;
}
.epw-comments-empty {
  color: #94a3b8;
  font-size: 0.8rem;
  font-style: italic;
}
.epw-comment {
  padding: 6px 8px;
  margin-bottom: 4px;
  background: rgba(241, 245, 249, 0.8);
  border-radius: 5px;
  border-left: 3px solid #0693e3;
}
.epw-comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.epw-comment-author {
  font-size: 0.75rem;
  font-weight: 600;
  color: #334155;
}
.epw-comment-time {
  font-size: 0.7rem;
  color: #94a3b8;
}
.epw-comment-delete {
  margin-left: auto;
  background: none;
  border: none;
  color: #cbd5e1;
  font-size: 1rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.epw-comment-delete:hover { color: #ef4444; }
.epw-comment-body {
  font-size: 0.8rem;
  color: #475569;
  white-space: pre-wrap;
  word-break: break-word;
}
.epw-comments-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.epw-comments-input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.8rem;
  resize: vertical;
  color: #334155;
  box-sizing: border-box;
}
.epw-comments-input:focus {
  border-color: #0693e3;
  outline: none;
  box-shadow: 0 0 0 2px rgba(6, 147, 227, 0.12);
}
.epw-comments-form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}
.epw-comments-author {
  padding: 4px 8px;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  font-size: 0.78rem;
  color: #475569;
  background: #fff;
  cursor: pointer;
}
.epw-comments-add {
  padding: 5px 16px;
  background: #0693e3;
  color: #fff;
  border: none;
  border-radius: 5px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.epw-comments-add:hover { background: #0574b8; }
.epw-comments-add:disabled { opacity: 0.6; cursor: not-allowed; }
.outputs-comments-btn {
  background: none;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  color: #64748B;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 0.78rem;
  transition: all 0.15s;
}
.outputs-comments-btn:hover { border-color: #0693e3; color: #0693e3; }
.outputs-comments-row td { padding: 8px 16px !important; background: rgba(241, 245, 249, 0.5); }

/* ---- Type Filter Pills (Projects / Tasks) ---- */
.epw-type-pills {
  display: flex;
  gap: 6px;
  padding: 8px 24px 4px;
}

.epw-type-pill {
  padding: 5px 16px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.02);
  color: rgba(71, 85, 105, 0.6);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.epw-type-pill:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #475569;
  border-color: rgba(0, 0, 0, 0.15);
}

.epw-type-pill-active {
  background: rgba(6, 147, 227, 0.12);
  color: #0693E3;
  border-color: rgba(6, 147, 227, 0.35);
}

/* ---- Section Headers (PROJECTS / TASKS) ---- */
.epw-section-header td {
  padding: 12px 16px 6px !important;
  border-bottom: 2px solid #e2e8f0;
  background: transparent !important;
}

.epw-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #64748B;
  text-transform: uppercase;
}

.epw-section-count {
  display: inline-block;
  background: #e2e8f0;
  color: #475569;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 10px;
  margin-left: 6px;
  vertical-align: middle;
}
