/* AORTA v2 — Brand: #FF0000 red / Neue Haas Grotesk / Black & White */

:root {
  --red:        #FF0000;
  --red-dark:   #cc0000;
  --black:      #111111;
  --grey-dark:  #333333;
  --grey-mid:   #666666;
  --grey-light: #e0e0e0;
  --grey-bg:    #f4f4f4;
  --white:      #ffffff;
  --radius:     3px;
  --font:       "Neue Haas Grotesk Display Pro", "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif;

  /* WBS depth accent colours */
  --d0-bg:     #f0f3f8;  --d0-bar: #2E4057;
  --d1-bg:     #f0f8f3;  --d1-bar: #3a7d44;
  --d2-bg:     #fffaee;  --d2-bar: #c9a000;
  --d3-bg:     #fff5f0;  --d3-bar: #c85a00;
  --d4-bg:     #f7f7f7;  --d4-bar: #888888;
}

/* ── Reset ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  font-size: 15px;
  color: var(--black);
  background: var(--grey-bg);
  line-height: 1.4;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ── Sidebar layout ──────────────────────────────────────────────────── */
:root {
  --sidebar-w: 200px;
  --sidebar-collapsed: 0px;
}

/* Sidebar panel */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: #000;
  border-right: 3px solid var(--red);
  display: flex;
  flex-direction: column;
  z-index: 300;
  transform: translateX(-100%);
  transition: transform 0.2s ease;
  overflow: hidden;
}

body.sidebar-open .sidebar {
  transform: translateX(0);
}

/* Brand row */
.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px 16px;
  background: #000;
  border-bottom: 1px solid #1a1a1a;
  flex-shrink: 0;
}
.sidebar-brand-link { display: flex; align-items: center; }
.brand-aorta {
  font-size: 18px;
  font-weight: 700;
  color: var(--red);
  letter-spacing: 3px;
}

/* Close button */
.sidebar-toggle {
  background: none;
  border: none;
  color: #888;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
  transition: color 0.15s;
}
.sidebar-toggle:hover { color: var(--white); }

/* Nav links */
.sidebar-nav {
  flex: 1;
  background: #000;
  overflow-y: auto;
  padding: 8px 0;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }

.sidebar-section {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--red);
  padding: 12px 16px 3px;
  margin-top: 2px;
}
.sidebar-divider {
  height: 1px;
  background: #2a2a2a;
  margin: 4px 12px;
}
.sidebar-link {
  display: block;
  color: #aaa;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 16px;
  border-radius: 0;
  transition: color 0.12s, background 0.12s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-link:hover  { color: var(--white); background: rgba(255,255,255,0.05); }
.sidebar-link.active { color: var(--white); border-left: 2px solid var(--red); padding-left: 14px; }
.sidebar-link-admin  { color: var(--red); }
.sidebar-link-admin:hover { color: #ff4444; }
.sidebar-link-admin.active { color: var(--white); }

/* Footer */
.sidebar-footer {
  flex-shrink: 0;
  background: #000;
  border-top: 1px solid #1a1a1a;
  padding: 10px 0 6px;
}
.sidebar-user {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #e0e0e0;
  padding: 2px 16px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-signout { color: #666; font-size: 11px; }
.sidebar-signout:hover { color: var(--red); background: none; }
.sidebar-signout-btn {
  display: block;
  width: calc(100% - 24px);
  margin: 6px 12px 0;
  padding: 8px 12px;
  background: var(--red);
  color: #fff !important;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background 0.15s;
}
.sidebar-signout-btn:hover { background: #cc0000; color: #fff !important; }
.sidebar-version {
  display: block;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  margin-top: 6px;
  letter-spacing: 0.06em;
}

/* Open button (hamburger, shown when sidebar is collapsed) */
.sidebar-open-btn {
  position: fixed;
  top: 12px; left: 10px;
  z-index: 299;
  background: #000;
  border: 1px solid #333;
  color: #888;
  font-size: 16px;
  width: 32px; height: 32px;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s, border-color 0.15s;
  opacity: 1;
  transition: opacity 0.2s;
}
.sidebar-open-btn:hover { color: var(--white); border-color: #555; }
body.sidebar-open .sidebar-open-btn { opacity: 0; pointer-events: none; }

/* ── Main content area ───────────────────────────────────────────────── */
.main-content {
  padding: 20px 24px;
  margin-left: 0;
  transition: margin-left 0.2s ease;
  min-height: 100vh;
}
body.sidebar-open .main-content {
  margin-left: var(--sidebar-w);
}

/* Legacy aliases (used by some page templates) */
.nav-link {
  color: #888;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover  { color: var(--white); background: rgba(255,255,255,0.06); }
.nav-link.active { color: var(--white); }

/* ── Schedule page header ────────────────────────────────────────────── */
.schedule-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.schedule-title { display: flex; align-items: baseline; gap: 12px; }
.schedule-title h1 { font-size: 16px; font-weight: 700; }
.project-name { font-size: 13px; color: var(--grey-mid); }

.schedule-controls { display: flex; align-items: center; gap: 12px; }

.project-select {
  padding: 5px 10px;
  border: 1px solid var(--grey-light);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 12px;
  background: var(--white);
  cursor: pointer;
  color: var(--black);
}
.project-select:focus { outline: none; border-color: var(--red); }

.project-chip {
  padding: 4px 10px;
  background: var(--black);
  color: var(--white);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.synced-at { font-size: 11px; color: var(--grey-mid); white-space: nowrap; }

/* ── Schedule tree container ─────────────────────────────────────────── */
.schedule-tree {
  background: var(--white);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Column grid — shared between header, WBS summary, and activity row */
.tree-cols {
  display: grid;
  grid-template-columns: minmax(220px,1fr) 110px 90px 90px 48px 80px;
  align-items: center;
  gap: 6px;
}

/* ── Column headers ──────────────────────────────────────────────────── */
.tree-header {
  display: grid;
  grid-template-columns: minmax(220px,1fr) 110px 90px 90px 48px 80px;
  gap: 6px;
  padding: 7px 12px;
  background: var(--black);
  color: var(--white);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  position: sticky;
  top: 46px;
  z-index: 100;
}

/* ── WBS nodes ───────────────────────────────────────────────────────── */
details.wbs-node {
  border-bottom: 1px solid var(--grey-light);
}
details.wbs-node:last-child { border-bottom: none; }

/* Remove default triangle */
details.wbs-node > summary { list-style: none; cursor: pointer; }
details.wbs-node > summary::-webkit-details-marker { display: none; }

.wbs-summary {
  display: grid;
  grid-template-columns: minmax(220px,1fr) 110px 90px 90px 48px 80px;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  transition: filter 0.1s;
  user-select: none;
}
.wbs-summary:hover { filter: brightness(0.97); }

/* Rotate toggle arrow when open */
.wbs-toggle { display: inline-block; font-size: 9px; color: var(--grey-mid); transition: transform 0.15s; }
details[open] > summary .wbs-toggle { transform: rotate(90deg); }

.wbs-name-cell { display: flex; align-items: center; gap: 7px; }

.wbs-code {
  font-size: 10px;
  color: var(--grey-mid);
  font-family: "Courier New", monospace;
  white-space: nowrap;
}
.wbs-name { font-weight: 600; font-size: 13px; }
.wbs-count { font-size: 10px; color: var(--grey-mid); }

/* Depth-based colours */
.depth-0 > summary { background: var(--d0-bg); border-left: 4px solid var(--d0-bar); }
.depth-1 > summary { background: var(--d1-bg); border-left: 4px solid var(--d1-bar); }
.depth-2 > summary { background: var(--d2-bg); border-left: 4px solid var(--d2-bar); }
.depth-3 > summary { background: var(--d3-bg); border-left: 4px solid var(--d3-bar); }
.depth-4 > summary { background: var(--d4-bg); border-left: 4px solid var(--d4-bar); }

/* Children area */
.wbs-children { border-left: 3px solid var(--grey-light); }

/* ── Activity rows ───────────────────────────────────────────────────── */
.activity-row {
  display: grid;
  grid-template-columns: minmax(220px,1fr) 110px 90px 90px 48px 80px;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 5px 20px;
  border-bottom: 1px solid #f0f0f0;
  background: var(--white);
  transition: background 0.1s;
}
.activity-row:last-child { border-bottom: none; }
.activity-row:hover { background: #fafafa; }

/* HTMX loading state */
.activity-row.htmx-request { opacity: 0.6; pointer-events: none; }

.act-name-cell { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.act-code { font-size: 10px; color: var(--grey-mid); font-family: "Courier New", monospace; }
.act-name { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-date { font-size: 11px; color: var(--grey-mid); white-space: nowrap; }
.act-pct  { font-size: 11px; color: var(--grey-mid); text-align: right; white-space: nowrap; }
.act-action { display: flex; align-items: center; }

/* ── Status badges ───────────────────────────────────────────────────── */
.status-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.status-not-started { background: #ebebeb; color: #555; }
.status-in-progress { background: #e0f0ff; color: #1060a0; }
.status-completed   { background: #e0f5e8; color: #1a6630; }

/* ── Action buttons ──────────────────────────────────────────────────── */
.btn-start,
.btn-done {
  padding: 3px 10px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.btn-start { background: var(--red);   color: var(--white); }
.btn-done  { background: #1a6630;      color: var(--white); }
.btn-start:hover, .btn-done:hover { opacity: 0.82; }
.btn-start:active, .btn-done:active { opacity: 0.7; }

/* ── Empty / error states ────────────────────────────────────────────── */
.empty-state {
  padding: 48px 20px;
  text-align: center;
  color: var(--grey-mid);
  line-height: 1.8;
}
.empty-state strong { color: var(--black); }
.error-state {
  padding: 14px 16px;
  background: #fff0f0;
  color: #a00;
  border-radius: var(--radius);
  border-left: 4px solid var(--red);
  font-size: 13px;
}

/* ── Login page ──────────────────────────────────────────────────────── */
.login-wrap  { max-width: 360px; margin: 80px auto; }
.login-card  { background: var(--white); padding: 36px 32px; border-radius: 6px; box-shadow: 0 2px 12px rgba(0,0,0,0.10); }

.login-brand { text-align: center; margin-bottom: 28px; }
.brand-aorta-large { font-size: 32px; font-weight: 700; color: var(--red); letter-spacing: 4px; }
.brand-sub   { font-size: 11px; color: var(--grey-mid); margin-top: 4px; letter-spacing: 0.3px; }
.brand-slogan { font-size: 14px; color: var(--red); margin-top: 8px; letter-spacing: 0.2px; font-style: italic; }

.form-group         { margin-bottom: 14px; }
.form-group label   { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; color: var(--grey-dark); margin-bottom: 4px; }
.form-group input   { width: 100%; padding: 8px 10px; border: 1px solid var(--grey-light); border-radius: var(--radius); font-family: var(--font); font-size: 13px; }
.form-group input:focus { outline: none; border-color: var(--red); }

.btn-primary {
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 10px;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.85; }

.error-msg {
  padding: 9px 12px;
  background: #fff0f0;
  color: #a00;
  border-left: 3px solid var(--red);
  border-radius: var(--radius);
  font-size: 12px;
  margin-bottom: 16px;
}

.success-msg {
  padding: 9px 12px;
  background: #f0fff4;
  color: #1a6630;
  border-left: 3px solid #1a6630;
  border-radius: var(--radius);
  font-size: 12px;
  margin-bottom: 16px;
}

/* ── Forgot password section ─────────────────────────────────────────── */
.forgot-password-section {
  margin-top: 20px;
  border-top: 1px solid var(--grey-light);
  padding-top: 14px;
}

.forgot-password-section details > summary {
  list-style: none;
  cursor: pointer;
}
.forgot-password-section details > summary::-webkit-details-marker { display: none; }

.forgot-password-toggle {
  font-size: 11px;
  color: var(--grey-mid);
  cursor: pointer;
  user-select: none;
}
.forgot-password-toggle:hover { color: var(--red); }

.forgot-password-form { padding-top: 4px; }

.btn-secondary {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 9px;
  background: var(--white);
  color: var(--red);
  border: 1.5px solid var(--red);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-secondary:hover { background: var(--red); color: var(--white); }

/* ── Home dashboard ───────────────────────────────────────────────────── */

.home-alert {
  padding: 10px 14px;
  background: #fff0f0;
  color: #a00;
  border-left: 4px solid var(--red);
  border-radius: var(--radius);
  font-size: 12px;
  margin-bottom: 16px;
}

/* Metric cards */
.metric-row {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.metric-card {
  flex: 1;
  min-width: 140px;
  background: var(--white);
  border-radius: 4px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
  text-align: center;
}

.metric-card--highlight {
  border-top: 3px solid var(--red);
}

.metric-value {
  font-size: 30px;
  font-weight: 700;
  color: var(--black);
  line-height: 1.1;
}

.metric-label {
  font-size: 11px;
  color: var(--grey-mid);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 4px;
}

/* Section label */
.section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--grey-mid);
  margin-bottom: 8px;
}

/* Milestone cards */
.milestone-row {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.milestone-card {
  flex: 1;
  min-width: 160px;
  background: var(--white);
  border-radius: 4px;
  padding: 12px 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}

.milestone-name {
  font-size: 11px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.milestone-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--black);
  line-height: 1.1;
  margin-bottom: 4px;
}

.milestone-delta {
  font-size: 13px;
  font-weight: 600;
  color: #28a745;
}

/* Divider */
.home-divider {
  border: none;
  border-top: 1px solid var(--grey-light);
  margin: 20px 0;
}

/* Chart containers */
.chart-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.chart-card {
  background: var(--white);
  border-radius: 4px;
  padding: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
  overflow: hidden;
}

.chart-card--full {
  margin-bottom: 12px;
}

.chart-empty {
  padding: 40px;
  text-align: center;
  color: var(--grey-mid);
  font-size: 12px;
}

/* Detail panels */
.detail-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.detail-panel {
  background: var(--white);
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
  overflow: hidden;
}

.detail-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--grey-bg);
  border-bottom: 1px solid var(--grey-light);
}

.detail-panel-header--red   { border-left: 3px solid var(--red); }
.detail-panel-header--orange { border-left: 3px solid #c85a00; }

.detail-panel-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--black);
}

.detail-panel-count {
  font-size: 10px;
  color: var(--grey-mid);
}

.detail-list {
  max-height: 260px;
  overflow-y: auto;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-bottom: 1px solid #f4f4f4;
  font-size: 11px;
}

.detail-item:last-child { border-bottom: none; }
.detail-item--overdue  { background: #fff8f8; }
.detail-item--7d       { background: #fff8f0; }

.detail-item-name {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.detail-code {
  font-size: 9px;
  color: var(--grey-mid);
  font-family: "Courier New", monospace;
}

.detail-name {
  font-size: 11px;
  color: var(--black);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-date { font-size: 10px; color: var(--grey-mid); white-space: nowrap; }
.detail-date--red    { color: #a00; font-weight: 600; }
.detail-date--orange { color: #c85a00; font-weight: 600; }

.detail-empty {
  padding: 24px 12px;
  text-align: center;
  font-size: 11px;
  color: var(--grey-mid);
}

/* Responsive: collapse chart columns and detail panels on narrow screens */
@media (max-width: 900px) {
  .chart-row-2  { grid-template-columns: 1fr; }
  .detail-row   { grid-template-columns: 1fr; }
  .milestone-row { flex-direction: column; }
}

/* ── Shared page header (Work Flow, future pages) ─────────────────── */
.page-wrap { padding: 0; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.page-header-left { display: flex; align-items: baseline; gap: 12px; }
.page-title { font-size: 16px; font-weight: 700; }
.sync-ts { font-size: 11px; color: var(--grey-mid); }
.project-label-single { font-size: 12px; color: var(--grey-mid); }
.alert-info {
  padding: 12px 16px;
  background: #fff8e1;
  border-left: 3px solid #f5a623;
  border-radius: var(--radius);
  font-size: 13px;
  color: #5d4037;
  margin-bottom: 16px;
}
.project-selector-form { display: inline; }

/* ── Work Flow page ──────────────────────────────────────────────── */
.wf-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  background: #F5F5F5;
  border: 1px solid #DDD;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  flex-wrap: wrap;
}

.wf-filters { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.wf-search-input {
  width: 280px;
  padding: 5px 10px;
  border: 1px solid #CCC;
  border-radius: 6px;
  font-size: 13px;
  font-family: var(--font);
  outline: none;
}
.wf-search-input:focus { border-color: var(--red); }

.wf-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 12px;
  color: #555;
}
.wf-toggle-wrap {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}
.wf-toggle-wrap input { opacity: 0; width: 0; height: 0; position: absolute; }
.wf-toggle-track {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #CCC;
  border-radius: 20px;
  transition: background 0.3s;
}
.wf-toggle-thumb {
  position: absolute;
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background: #FFF;
  border-radius: 50%;
  transition: transform 0.3s;
}

.wf-export-btns { display: flex; gap: 6px; }
.btn-export {
  padding: 5px 12px;
  font-size: 12px;
  font-family: var(--font);
  background: var(--black);
  color: var(--white);
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-export:hover { background: #333; }
.btn-excel { display: none; } /* unhide: remove this line */

.wf-table-wrap {
  height: 65vh;
  overflow: auto;
  border: 1px solid #DDD;
  border-radius: 0 0 4px 4px;
}
.wf-table {
  border-collapse: collapse;
  width: 100%;
}

.wf-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.wf-legend span {
  padding: 2px 10px;
  border-radius: 3px;
  font-size: 11px;
}
.wf-legend-done { background: #C6EFCE; }
.wf-legend-prog { background: #FFBF69; }
.wf-legend-none { background: #FFF; border: 1px solid #CCC; }
.wf-legend-count { color: var(--grey-mid); font-size: 11px; padding: 0 !important; background: none !important; }

.wf-detail-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--grey-light);
}
.wf-detail-title { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.wf-detail-input {
  width: 100%;
  max-width: 400px;
  padding: 7px 12px;
  border: 1px solid var(--grey-light);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  margin-bottom: 12px;
}
.wf-detail-input:focus { border-color: var(--red); }
.wf-detail-result { font-family: var(--font); }

/* ── Additional legend items ─────────────────────────────────────────── */
.wf-legend-item {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 3px;
  font-size: 11px;
}

/* ── Progress Chart legend ───────────────────────────────────────────── */
.pc-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--grey-dark);
}
.pc-legend-swatch {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.10);
}

/* ── Admin / shared UI components ─────────────────────────────── */

/* Alerts */
.alert { padding: 10px 14px; border-radius: 4px; font-size: 13px; margin-bottom: 16px; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* Badges */
.badge { display:inline-block; padding:2px 8px; border-radius:10px; font-size:11px; font-weight:600; }
.badge-active { background:#d4edda; color:#155724; }
.badge-invited { background:#fff3cd; color:#856404; }
.badge-inactive { background:#f8d7da; color:#721c24; }
.badge-deleted { background:#e9ecef; color:#6c757d; }

/* Buttons */
.btn {
  display: inline-flex !important;
  align-items: center;
  width: auto !important;
  margin-top: 0 !important;
  padding: 7px 14px;
  border: 1px solid #ccc;
  border-radius: var(--radius);
  background: #f0f0f0;
  color: #333;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
  line-height: 1.3;
}
.btn:hover { background: #e0e0e0; }
.btn-warn { background: #ff9800; color: #fff; border-color: #ff9800; }
.btn-warn:hover { background: #e68900; }
.btn-danger { background: #dc3545; color: #fff; border-color: #dc3545; }
.btn-danger:hover { background: #c82333; }
.btn-success { background: #1a7a35; color: #fff; border-color: #1a7a35; }
.btn-success:hover { background: #155e29; }
.btn.btn-primary { background: var(--red); color: #fff; border-color: var(--red); }
.btn.btn-primary:hover { opacity: 0.88; }
.btn-sm { padding: 3px 10px !important; font-size: 12px; }
.modal-footer .btn-primary { background: #1a7a35; border-color: #1a7a35; }
.modal-footer .btn-primary:hover { opacity: 1; background: #155e29; }
.action-cell { white-space: nowrap; }
.action-cell form { display: inline; }

/* Forms */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-input { width: 100%; box-sizing: border-box; padding: 6px 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 13px; font-family: inherit; }
.form-input:focus { outline: none; border-color: var(--red); }
label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 3px; color: #444; }

/* Checkbox grids */
.checkbox-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.checkbox-label { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 400; color: #333; cursor: pointer; padding: 3px 8px; border: 1px solid #ddd; border-radius: 4px; }
.checkbox-label:hover { background: #f5f5f5; }
.checkbox-grid-inline { display: flex; flex-wrap: wrap; gap: 4px; }
.checkbox-label-sm { display: flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 400; color: #333; cursor: pointer; }

/* Expandable cards (details/summary) */
.expandable-card { border: 1px solid #e0e0e0; border-radius: 4px; }
.expandable-summary { padding: 10px 14px; cursor: pointer; font-size: 14px; list-style: none; display: flex; align-items: center; gap: 6px; user-select: none; }
.expandable-summary::-webkit-details-marker { display: none; }
.expandable-summary::before { content: "▶"; font-size: 10px; color: #999; transition: transform 0.15s; }
details[open] .expandable-summary::before { transform: rotate(90deg); }
.expandable-body { padding: 14px; border-top: 1px solid #e0e0e0; }

/* Table header bar */
.table-header-bar { background: #1a1a1a; color: #fff; padding: 5px 10px; font-size: 11px; font-weight: 700; border-radius: 4px 4px 0 0; }

/* List rows */
.list-row { padding: 6px 10px; font-size: 12px; border: 1px solid #ddd; border-top: none; }
.list-row:last-child { border-radius: 0 0 4px 4px; }

/* Modal dialogs */
.modal-dialog { border: none; border-radius: 6px; padding: 0; min-width: 500px; max-width: 700px; box-shadow: 0 8px 32px rgba(0,0,0,0.18); position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); margin: 0; }
.modal-sm { min-width: 360px; max-width: 440px; }
.modal-dialog::backdrop { background: rgba(0,0,0,0.4); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid #e0e0e0; }
.modal-header h2 { margin: 0; font-size: 16px; }
.modal-close { background: none; border: none; font-size: 16px; cursor: pointer; color: #888; padding: 2px 6px; }
.modal-close:hover { color: #333; }
.modal-dialog form { padding: 16px 18px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; padding-top: 12px; border-top: 1px solid #eee; }

/* Text helpers */
.text-danger { color: #721c24; }

/* ── Help ──────────────────────────────────────────────── */
/* Sidebar help button */
.sidebar-help-btn {
  display: block; text-align: center;
  margin: 6px 12px 2px;
  padding: 4px 0; border-radius: 6px;
  background: transparent; color: #777;
  border: none;
  font-size: 11px; font-weight: 500; text-decoration: none;
  transition: color .15s;
}
.sidebar-help-btn:hover, .sidebar-help-btn.active {
  color: #ccc;
}

/* Floating page-level help button */
.help-fab {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #888; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; line-height: 1;
  border: none; cursor: pointer;
  opacity: 0.5;
  box-shadow: none;
  z-index: 1000;
  transition: background .15s, opacity .15s;
}
.help-fab:hover {
  background: #555;
  opacity: 1;
}

/* Help modal content styles (shared with help.html page) */
.help-content         { font-size: 14px; line-height: 1.75; color: #222; }
.help-content h3      { font-size: 15px; font-weight: 700; color: #1A1A1A;
  margin: 20px 0 8px; padding-bottom: 4px; border-bottom: 1px solid #eee; }
.help-content h4      { font-size: 14px; font-weight: 700; margin: 14px 0 4px; }
.help-content p       { margin: 0 0 10px; }
.help-content ul, .help-content ol { margin: 6px 0 12px 20px; }
.help-content li      { margin-bottom: 4px; }
.help-content strong  { font-weight: 700; color: #1A1A1A; }
.help-content table   { border-collapse: collapse; width: 100%; margin: 12px 0 18px; font-size: 13px; }
.help-content th      { background: #1A1A1A; color: #fff; text-align: left; padding: 7px 12px; font-weight: 600; }
.help-content td      { padding: 6px 12px; border-bottom: 1px solid #eee; }
.help-content tr:nth-child(even) td { background: #fafafa; }
.help-content blockquote {
  margin: 12px 0; padding: 10px 16px;
  border-left: 3px solid #CC0000; background: #FFF5F5;
  border-radius: 0 6px 6px 0; font-size: 13px; color: #555;
}
.help-content code    { background: #f0f0f0; padding: 1px 5px; border-radius: 3px;
  font-family: monospace; font-size: 12px; }

/* Floating support button */
.support-fab {
  position: fixed;
  bottom: 62px; right: 24px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #888; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; line-height: 1;
  cursor: pointer; border: none;
  opacity: 0.5;
  box-shadow: none;
  z-index: 1000;
  transition: background .15s, opacity .15s;
}
.support-fab:hover { background: #555; opacity: 1; }

/* Support modal */
.support-modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 2000;
  align-items: center; justify-content: center;
}
.support-modal-overlay.open { display: flex; }
.support-modal {
  background: #fff; border-radius: 8px;
  padding: 24px 28px; width: 380px; max-width: 95vw;
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
}
.support-modal h3 { margin: 0 0 14px; font-size: 15px; }
.support-modal label { display: block; font-size: 12px; color: #555; margin-bottom: 4px; }
.support-modal input,
.support-modal textarea {
  width: 100%; box-sizing: border-box;
  border: 1px solid #ccc; border-radius: 4px;
  padding: 7px 9px; font-size: 13px;
  margin-bottom: 12px; font-family: inherit;
}
.support-modal textarea { resize: vertical; min-height: 90px; }
.support-modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
.support-modal-actions button {
  padding: 7px 18px; border-radius: 4px;
  font-size: 13px; cursor: pointer; border: none;
}
.support-modal-actions .btn-cancel { background: #eee; color: #333; }
.support-modal-actions .btn-send   { background: #FF0000; color: #fff; font-weight: 600; }
.support-modal-actions .btn-send:disabled { background: #aaa; cursor: default; }
.support-modal-msg { font-size: 12px; margin-top: 6px; text-align: right; }
