/* Marketing suite — shell matches subcontractor-management.html; pair with css/jrco-brand.css */

:root {
  --red: #E24B4A;
  --red-dark: #c13f3f;
  --red-bg: rgba(226, 75, 74, 0.12);
  --black: #ffffff;
  --charcoal: #ffffff;
  --steel: #F4F4F4;
  --mid: #E6E6E6;
  --border: #D9D9D9;
  --off-white: #202020;
  --muted: #666666;
  --amber: #BA7517;
  --green: #1F4D0F;
  --blue: #404040;
  --radius: 0;
  --shadow: 0 10px 24px rgba(32, 32, 31, 0.08);
  --banner-dark: #202020;
  --table-head-bg: #F4F4F4;
  --grid: rgba(32, 32, 32, 0.06);
  --grid-q: rgba(32, 32, 32, 0.14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(135deg, rgba(230, 230, 230, 0.55), transparent 32%), #ffffff;
  color: #202020;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Header (subcontractor parity) ── */
header {
  background: #202020;
  border-bottom: 0;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 200;
  flex-wrap: wrap;
}

.header-left { display: flex; align-items: center; gap: 16px; }
.header-right { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.logo-img { height: 32px; width: auto; display: block; flex-shrink: 0; object-fit: contain; }
.logo-divider { width: 1px; height: 28px; background: rgba(230, 230, 230, 0.22); flex-shrink: 0; }
.header-title {
  font-family: "Arial Black", Arial, Helvetica, sans-serif;
  font-size: 22px;
  letter-spacing: -0.03em;
  color: #E6E6E6;
  line-height: 1.1;
  text-transform: uppercase;
  font-weight: 800;
}
.header-sub {
  font-size: 11px;
  color: #BFBFBF;
  letter-spacing: 0.5px;
  font-weight: 300;
  text-transform: uppercase;
  margin-top: 1px;
}

.btn-nav {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 0;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1px solid rgba(230, 230, 230, 0.24);
  color: #E6E6E6;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.btn-nav:hover:not(.btn-nav-primary) { color: #fff; border-color: #E92A2C; background: rgba(233, 42, 44, 0.1); }
.btn-nav.active { border-color: #E92A2C; color: #fff; cursor: default; }
.btn-nav-primary {
  background: linear-gradient(135deg, #E92A2C 0%, #A71F23 100%);
  border-color: transparent;
  color: #fff;
  font-family: "Arial Black", Arial, Helvetica, sans-serif;
  letter-spacing: -0.02em;
}
.btn-nav-primary:hover {
  background: linear-gradient(135deg, #E92A2C 0%, #A71F23 100%) !important;
  border-color: transparent !important;
  color: #fff !important;
}
.nav-divider { width: 1px; height: 20px; background: rgba(230, 230, 230, 0.22); }
.user-pill { cursor: pointer; }
.nav-seg { display: inline-flex; border: 1px solid rgba(230, 230, 230, 0.24); }
.nav-seg .btn-nav { border: none; }
.nav-seg .btn-nav + .btn-nav { border-left: 1px solid rgba(230, 230, 230, 0.24); }
.zoom-label {
  font-size: 10px;
  color: #BFBFBF;
  min-width: 58px;
  text-align: center;
  letter-spacing: 0.3px;
}

/* ── Status bar ── */
.status-bar {
  font-size: 12px;
  min-height: 32px;
  padding: 6px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}
.status-ok { color: var(--green); }
.status-err { color: #E92A2C; }
.status-loading { color: var(--muted); }

/* ── Toolbar / filters (Command Center za-* pattern) ── */
.mkt-toolbar,
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  min-height: 46px;
}
.za-field { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.za-lbl {
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
}
.za-ctrl {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0;
  color: var(--off-white);
  font-size: 12px;
  padding: 6px 10px;
  outline: none;
  height: 34px;
  cursor: pointer;
  min-width: 180px;
}
.za-ctrl:focus { border-color: #404040; }
.za-note { font-size: 12px; color: var(--muted); }

/* ── Legend strip ── */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.legend-item { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--off-white); }
.legend-swatch { width: 14px; height: 14px; border-radius: 0; flex-shrink: 0; }
.legend-count { color: var(--muted); font-size: 10px; }

/* ── Sync warning ── */
.sync-warning {
  display: none;
  margin: 0;
  padding: 10px 16px;
  border-bottom: 1px solid #f0c9ca;
  background: rgba(233, 42, 44, 0.06);
  color: #202020;
  font-size: 12px;
  line-height: 1.45;
}
.sync-warning.open { display: block; }
.sync-warning strong { color: #A71F23; }

/* ── Gantt ── */
.gantt-scroll {
  overflow: auto;
  height: calc(100vh - 64px - 32px - 46px - 49px);
  position: relative;
  background: #fff;
}
.gantt-inner { position: relative; }

.axis {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--axis-h, 40px);
  background: var(--table-head-bg);
  border-bottom: 1px solid var(--border);
}
.axis-corner {
  position: sticky;
  left: 0;
  z-index: 45;
  display: inline-block;
  width: var(--left-w, 340px);
  height: var(--axis-h, 40px);
  background: var(--table-head-bg);
  border-right: 1px solid var(--border);
  vertical-align: top;
}
.axis-month {
  position: absolute;
  top: 0;
  height: var(--axis-h, 40px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 6px;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  pointer-events: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.axis-month .yr { color: var(--off-white); font-size: 9px; }

.grid-line { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--grid); z-index: 1; }
.grid-line.q { background: var(--grid-q); }
.today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, #E92A2C, #A71F23);
  z-index: 3;
}
.today-flag {
  position: absolute;
  top: 2px;
  transform: translateX(-50%);
  z-index: 41;
  background: linear-gradient(90deg, #E92A2C, #A71F23);
  color: #fff;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 0;
  white-space: nowrap;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 700;
}

.row { position: relative; height: var(--row-h, 44px); }
.row:nth-child(odd):not(.group-header) .track { background: #fafafa; }
.row.group-header { height: var(--group-h, 28px); }
.row.section-header { height: calc(var(--group-h, 28px) + 4px); }

.group-label {
  position: sticky;
  left: 0;
  z-index: 22;
  width: var(--left-w, 340px);
  height: var(--group-h, 28px);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  background: var(--banner-dark);
  border-right: 1px solid var(--banner-dark);
  font-family: "Arial Black", Arial, Helvetica, sans-serif;
  font-size: 12px;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: #fff;
  vertical-align: top;
  font-weight: 800;
}
.group-dot { width: 5px; height: 14px; flex-shrink: 0; transform: skewX(-26deg); background: linear-gradient(135deg, #E92A2C, #A71F23); border-radius: 0; }
.group-count { font-size: 9px; color: rgba(255, 255, 255, 0.72); letter-spacing: 0; text-transform: none; font-weight: 400; }
.group-band {
  position: absolute;
  top: 0;
  left: var(--left-w, 340px);
  right: 0;
  height: var(--group-h, 28px);
  border-bottom: 1px solid var(--border);
  background: rgba(32, 32, 32, 0.04);
}

.row-label {
  position: sticky;
  left: 0;
  z-index: 20;
  width: var(--left-w, 340px);
  height: var(--row-h, 44px);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: #fff;
  border-right: 1px solid var(--border);
  font-size: 12px;
  overflow: hidden;
  vertical-align: top;
  min-width: 0;
  border-bottom: 1px solid #eee;
}
.row-dot { width: 8px; height: 8px; border-radius: 0; flex-shrink: 0; margin-top: 1px; }
.row-label-inner {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}
.row-title {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  color: #202020;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-meta {
  font-size: 9px;
  line-height: 1.2;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.02em;
}
.track {
  position: absolute;
  top: 0;
  left: var(--left-w, 340px);
  right: 0;
  height: var(--row-h, 44px);
  border-bottom: 1px solid #eee;
}

.bar {
  position: absolute;
  top: 6px;
  height: calc(var(--row-h, 44px) - 12px);
  border-radius: 0;
  z-index: 5;
  cursor: default;
  display: flex;
  align-items: center;
  padding: 0 6px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.bar-progress {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: rgba(0, 0, 0, 0.18);
  pointer-events: none;
  z-index: 0;
}
.bar-label {
  position: relative;
  z-index: 1;
  font-size: 10px;
  line-height: 1;
  color: #202020;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-label .bar-pct { font-size: 9px; font-weight: 500; margin-left: 5px; opacity: 0.85; }

.empty, .loading {
  padding: 60px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-top-color: #E92A2C;
  border-radius: 50%;
  animation: mkt-spin 0.7s linear infinite;
  margin: 0 auto 14px;
}
@keyframes mkt-spin { to { transform: rotate(360deg); } }

#tooltip {
  position: fixed;
  z-index: 100;
  display: none;
  max-width: 320px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0;
  box-shadow: var(--shadow);
  padding: 10px 12px;
  font-size: 12px;
  pointer-events: none;
}
#tooltip .tt-title { font-weight: 700; margin-bottom: 6px; color: #202020; }
#tooltip .tt-row { color: var(--muted); font-size: 10.5px; margin-top: 2px; }
#tooltip .tt-src { display: inline-flex; align-items: center; gap: 6px; }

.badge {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 0;
  background: #f0f0f0;
  color: #404040;
  border: 1px solid #e0e0e0;
  margin-left: 4px;
}
.bar, .row-label[data-i] { cursor: pointer; }

/* ── Profile modal ── */
#profile-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#profile-modal.open { display: flex; }
.profile-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0;
  box-shadow: var(--shadow);
  width: 420px;
  max-width: 100%;
  padding: 20px;
  position: relative;
}
.profile-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, #E92A2C, #A71F23);
  pointer-events: none;
}
.profile-card h3 {
  font-family: "Arial Black", Arial, Helvetica, sans-serif;
  letter-spacing: -0.03em;
  margin: 0 0 6px;
  text-transform: uppercase;
  font-weight: 800;
}
.profile-card p { font-size: 12px; color: var(--muted); margin: 0 0 14px; line-height: 1.45; }
.profile-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  cursor: pointer;
}
.profile-option input { margin-top: 3px; accent-color: #E92A2C; }
.profile-option strong { display: block; font-size: 13px; margin-bottom: 2px; color: #202020; }
.profile-option span { font-size: 11px; color: var(--muted); }
.profile-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* ── Calendar month view ── */
.subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.month-nav { display: flex; align-items: center; gap: 12px; }
.month-title {
  font-family: "Arial Black", Arial, Helvetica, sans-serif;
  font-size: 28px;
  letter-spacing: -0.03em;
  line-height: 1;
  min-width: 230px;
  text-transform: uppercase;
  font-weight: 800;
}
.nav-btn {
  background: #fff;
  border: 1px solid var(--border);
  color: #202020;
  width: 30px;
  height: 30px;
  border-radius: 0;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}
.nav-btn:hover { border-color: #E92A2C; }
.cal-wrap { padding: 16px; }
.cal-dow {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 1px;
}
.cal-dow div {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 8px;
  background: var(--table-head-bg);
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 0;
  overflow: hidden;
}
.cal-cell {
  background: #fff;
  min-height: 116px;
  min-width: 0;
  overflow: hidden;
  padding: 5px 6px 7px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.cal-cell.other { background: #fafafa; }
.cal-cell.other .cal-daynum { color: #bbb; }
.cal-cell.today { background: rgba(233, 42, 44, 0.06); }
.cal-daynum { font-size: 11px; color: var(--muted); align-self: flex-end; }
.cal-cell.today .cal-daynum {
  color: #fff;
  background: linear-gradient(90deg, #E92A2C, #A71F23);
  border-radius: 0;
  padding: 1px 7px;
  font-weight: 700;
}
.cal-events { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow: hidden; }
.cal-event {
  background: var(--src);
  color: #202020;
  border-radius: 0;
  padding: 2px 5px;
  font-size: 10.5px;
  line-height: 1.25;
  cursor: default;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid rgba(0, 0, 0, 0.06);
}
.cal-event .ev-time { font-weight: 700; opacity: 0.8; margin-right: 3px; }
.cal-more { font-size: 9.5px; color: var(--muted); padding: 0 2px; cursor: pointer; }
.cal-loc {
  font-size: 8px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 1px 2px 0;
  border-top: 1px solid var(--border);
  margin-top: 2px;
}

/* ── Collateral intake chat (Brand Guidelines 5.15.2025 — paper / ink / JR red) ── */
.intake-assistant-card .card-head {
  font-family: "Arial Black", Arial, Helvetica, sans-serif !important;
  letter-spacing: -0.03em !important;
  color: #202020 !important;
}

.intake-chat-thread {
  max-height: 380px;
  overflow-y: auto;
  background: var(--table-head-bg) !important;
  border: 1px solid var(--border) !important;
  border-radius: 0 !important;
  padding: 12px;
  margin-bottom: 12px;
}

.intake-chat-bubble {
  padding: 12px 14px;
  margin-bottom: 8px;
  max-width: 94%;
  font-size: 14px;
  line-height: 1.55;
  border-radius: 0 !important;
  color: #202020 !important;
}

.intake-chat-bubble p,
.intake-chat-bubble strong,
.intake-chat-bubble em {
  color: #202020 !important;
}

.intake-chat-assistant {
  background: #ffffff !important;
  border: 1px solid var(--border) !important;
}

.intake-chat-user {
  background: rgba(233, 42, 44, 0.08) !important;
  border: 1px solid var(--border) !important;
  margin-left: auto;
  text-align: right;
}

.intake-chat-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.intake-chat-input {
  flex: 1;
  min-width: 200px;
  min-height: 56px;
  background: #ffffff !important;
  border: 1px solid var(--border) !important;
  color: #202020 !important;
  border-radius: 0 !important;
}

.intake-chat-input::placeholder {
  color: #666666 !important;
}

.intake-chat-footer {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 10px;
  flex-wrap: wrap;
}

.intake-chat-apply {
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid #1F4D0F !important;
  background: #e7f0e3 !important;
  border-radius: 0 !important;
  color: #202020 !important;
}

.intake-chat-apply .form-hint {
  color: #404040 !important;
}
