/* Recurring component recipes from the design handoff.
   No shadows on dark surfaces. No frosted cards, no glass. No noise or
   grain. No coloured left borders. No icons — status is a coloured dot,
   the only glyph is the arrow, and everything else is a text label. */

/* ---- Buttons --------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  font: 450 var(--fs-meta) / 1 var(--font);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  white-space: nowrap;
  transition: filter var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
}
.btn:active:not(:disabled) { transform: scale(.98); }

/* Primary: the gradient, used sparingly. Brightens on hover, never
   changes hue. */
.btn-primary {
  background: var(--gradient-1);
  color: var(--surface-app);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }

/* Secondary: outline */
.btn-secondary {
  padding: 14px 24px;
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
}
.btn-secondary:hover:not(:disabled) { border-color: var(--text-primary); }

/* Neutral: solid off-white */
.btn-neutral {
  background: var(--surface-light);
  color: var(--surface-app);
}
.btn-neutral:hover:not(:disabled) { filter: brightness(1.08); }

/* Risk: red outline, for override paths that should feel deliberate */
.btn-risk {
  padding: 14px 24px;
  border: 1px solid var(--status-risk-border);
  color: var(--status-risk);
}
.btn-risk:hover:not(:disabled) { border-color: var(--status-risk); }

.btn-sm { padding: 12px 24px; font-size: 11px; }
.btn-xs { padding: 9px 16px; font-size: 10px; }
.btn-block { width: 100%; }

/* ---- Chips and pills -------------------------------------------------- */

/* Status pill: an optional leading dot in the same colour, then a label. */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hairline);
  font: 450 var(--fs-label) / 1 var(--font);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text-secondary);
}
.pill-ok   { border-color: var(--status-ok-border);   color: var(--status-ok); }
.pill-warn { border-color: var(--status-warn-border); color: var(--status-warn); }
.pill-risk { border-color: var(--status-risk-border); color: var(--status-risk); }

/* Tinted topic chip, used in the conversation feed */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--neutral-tint);
  font: 450 var(--fs-label) / 1.3 var(--font);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.chip-ok   { background: var(--status-ok-tint);   color: var(--status-ok); }
.chip-warn { background: var(--status-warn-tint); color: var(--status-warn); }
.chip-risk { background: var(--status-risk-tint); color: var(--status-risk); }

/* Filter chip: a selectable pill in a filter row */
.fchip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-hairline);
  font: 450 11px / 1 var(--font);
  letter-spacing: .06em;
  color: var(--text-secondary);
  transition: border-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
}
.fchip:hover { border-color: var(--border-strong); }
.fchip[aria-pressed="true"] {
  background: var(--surface-light);
  border-color: var(--surface-light);
  color: var(--surface-app);
}
.fchip-ok[aria-pressed="false"]   { border-color: var(--status-ok-border);   color: var(--status-ok); }
.fchip-warn[aria-pressed="false"] { border-color: var(--status-warn-border); color: var(--status-warn); }
.fchip-risk[aria-pressed="false"] { border-color: var(--status-risk-border); color: var(--status-risk); }
.fchip .count { color: inherit; opacity: .6; }

/* ---- Status dots ------------------------------------------------------ */

.dot {
  width: 8px; height: 8px;
  border-radius: var(--radius-pill);
  flex: none;
  background: var(--text-meta);
}
.dot-5 { width: 5px; height: 5px; }
.dot-6 { width: 6px; height: 6px; }
.dot-7 { width: 7px; height: 7px; }
.dot-9 { width: 9px; height: 9px; }
.dot-ok   { background: var(--status-ok); }
.dot-warn { background: var(--status-warn); }
.dot-risk { background: var(--status-risk); }
.dot-future {
  background: var(--surface-app);
  border: 1px solid var(--border-strong);
}
.dot-current {
  background: var(--surface-app);
  border: 2px solid var(--status-warn);
}

.dot-live {
  position: relative;
}
.dot-live::after {
  content: "";
  position: absolute; inset: -3px;
  border-radius: var(--radius-pill);
  border: 1px solid currentColor;
  opacity: .4;
  animation: pulse 1.6s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { opacity: .4; transform: scale(1); }
  50%      { opacity: 0;  transform: scale(1.5); }
}

/* ---- Cards and panels -------------------------------------------------- */

.card {
  background: var(--surface-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-card);
  padding: 26px;
}
.card-lg { padding: 32px; }
.card-sm { padding: 22px; }

.panel {
  background: var(--surface-panel);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-card);
  padding: 26px;
}

.inset {
  background: var(--surface-panel);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-media);
  padding: 16px 18px;
}

/* Row inside a card */
.list-row {
  background: var(--surface-app);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-media);
  padding: 16px 18px;
}
.list-row-card {
  background: var(--surface-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-media);
  padding: 16px 18px;
}

.b-ok   { border-color: var(--status-ok-border); }
.b-warn { border-color: var(--status-warn-border); }
.b-risk { border-color: var(--status-risk-border); }

/* Cards raise 2px on hover, where they are interactive. */
.raise {
  transition: transform var(--dur-base) var(--ease),
              border-color var(--dur-base) var(--ease);
}
.raise:hover { transform: translateY(-2px); border-color: var(--border-strong); }

.dashed {
  border: 1px dashed var(--border-strong);
  background: none;
}

/* ---- Avatars ----------------------------------------------------------- */

.avatar {
  width: 34px; height: 34px;
  border-radius: var(--radius-pill);
  background: var(--surface-well);
  border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  font: 500 11px / 1 var(--font);
  letter-spacing: 0;
  color: var(--text-secondary);
  flex: none;
  overflow: hidden;
}
.avatar-28 { width: 28px; height: 28px; font-size: 10px; }
.avatar-30 { width: 30px; height: 30px; font-size: 11px; }
.avatar-32 { width: 32px; height: 32px; font-size: 11px; }
.avatar-38 { width: 38px; height: 38px; font-size: 12px; }
.avatar-40 { width: 40px; height: 40px; font-size: 12px; }
.avatar-56 { width: 56px; height: 56px; font-size: 15px; }
.avatar-88 { width: 88px; height: 88px; font-size: 22px; }
.avatar-ring-risk { border: 2px solid var(--status-risk); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Media wells -------------------------------------------------------- */

.well {
  background: var(--surface-well);
  border-radius: var(--radius-media);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font: 400 9px / 1.3 var(--font);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-placeholder);
  overflow: hidden;
  flex: none;
}
.well-sm { border-radius: var(--radius-input); }
.well img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Inputs -------------------------------------------------------------- */

.input {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-input);
  border: 1px solid var(--border-hairline);
  background: transparent;
  font: 400 13px / 1.4 var(--font);
  color: var(--text-primary);
  transition: border-color var(--dur-fast) var(--ease);
}
.input:hover { border-color: var(--border-strong); }
.input::placeholder { color: var(--text-placeholder); }
.input-strong { border-color: var(--border-strong); }
.input-warn { border-color: var(--status-warn-border); }

textarea.input {
  resize: vertical;
  min-height: 120px;
  font: 450 16px / 1.6 var(--font);
  letter-spacing: var(--tracking-tight);
}

.field { display: flex; flex-direction: column; gap: 8px; }
.field-box {
  padding: 12px 16px;
  border-radius: var(--radius-input);
  border: 1px solid var(--border-hairline);
  background: var(--surface-app);
  font: 450 var(--fs-row) / var(--lh-row) var(--font);
}

/* Checkbox — the only 4px radius in the system */
.check {
  width: 16px; height: 16px;
  border-radius: var(--radius-check);
  border: 1px solid var(--border-strong);
  background: var(--surface-app);
  flex: none;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease);
}
.check[aria-checked="true"] {
  background: var(--status-ok);
  border-color: var(--status-ok);
}
.check-risk[aria-checked="false"] { border-color: var(--status-risk-border); }

/* Radio, used in the day picker */
.radio {
  width: 16px; height: 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  flex: none;
}
.radio[aria-checked="true"] {
  background: var(--status-ok);
  border-color: var(--status-ok);
}

/* ---- Label / value pair ------------------------------------------------- */

.lv { display: flex; flex-direction: column; gap: 6px; }
.lv-label {
  font: 450 var(--fs-label) / var(--lh-label) var(--font);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-meta);
}
.lv-value {
  font: 450 var(--fs-row) / 1.5 var(--font);
  color: var(--text-primary);
}

/* Label on the left, value on the right, hairline between rows */
.kv-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-top: 1px solid var(--border-hairline);
}
.kv-row:first-child { border-top: 0; padding-top: 0; }

/* ---- Progress and phase bars --------------------------------------------- */

/* Five-segment phase bar on a project card */
.phasebar { display: flex; gap: 4px; }
.phasebar span {
  flex: 1;
  height: 3px;
  border-radius: var(--radius-pill);
  background: var(--border-hairline);
}
.phasebar .done    { background: var(--status-ok); }
.phasebar .current { background: var(--status-warn); }

/* Load / margin track */
.track {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--border-hairline);
  overflow: hidden;
  position: relative;
}
.track-6 { height: 6px; }
.track > .fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--text-meta);
}
.track > .fill.ok   { background: var(--status-ok); }
.track > .fill.warn { background: var(--status-warn); }
.track > .fill.risk { background: var(--status-risk); }
/* A 1px off-white hairline marking committed spend */
.track > .marker {
  position: absolute;
  top: 0; bottom: 0;
  width: 1px;
  background: var(--surface-light);
}

/* ---- Watermark ------------------------------------------------------------ */
/* The logomark is the brand's only graphic element. Oversized at 5–6%
   opacity, bled off a corner. */
.watermark {
  position: absolute;
  pointer-events: none;
  user-select: none;
  opacity: .06;
  height: 260px;
  width: auto;
  right: -60px;
  top: -40px;
}

/* ---- Modal ---------------------------------------------------------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, .72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fade var(--dur-base) var(--ease);
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 720px;
  max-width: calc(100vw - 64px);
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  background: var(--surface-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-card);
  padding: 36px;
  box-shadow: var(--shadow-modal);
  display: flex;
  flex-direction: column;
  gap: 26px;
  animation: rise var(--dur-base) var(--ease);
}
.modal-wide { width: 860px; }
.modal-risk { border-color: var(--status-risk-border); }
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* When a modal is open the page behind it blurs. */
.app-blurred { filter: blur(2px); opacity: .35; }

.modal-close {
  font: 400 22px / 1 var(--font);
  color: var(--text-meta);
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  transition: color var(--dur-fast) var(--ease);
}
.modal-close:hover { color: var(--text-primary); }

/* ---- Toast ----------------------------------------------------------------- */

.toasts {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}
.toast {
  background: var(--surface-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-media);
  padding: 14px 18px;
  font: 450 13px / 1.4 var(--font);
  max-width: 380px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: rise var(--dur-base) var(--ease);
}
.toast-ok   { border-color: var(--status-ok-border); }
.toast-risk { border-color: var(--status-risk-border); }

/* ---- Empty states ----------------------------------------------------------- */
/* A sentence of plain copy on the surface. No illustration. */
.empty {
  padding: 32px 0;
  font: 400 13px / 1.55 var(--font);
  color: var(--text-meta);
  max-width: 60ch;
}

/* ---- Skeleton loading -------------------------------------------------------- */
.skeleton {
  background: var(--surface-well);
  border-radius: var(--radius-media);
  animation: breathe 1.4s var(--ease) infinite;
}
@keyframes breathe { 0%, 100% { opacity: .5; } 50% { opacity: .8; } }

/* ---- Scroll-in reveal ---------------------------------------------------------- */
/* Fades and short upward translates only. No bounce, no spring. */
.reveal {
  animation: reveal var(--dur-reveal) var(--ease) both;
}
@keyframes reveal {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
