/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Global reset & typography - Removed, Tailwind provides these via preflight */

/* FullCalendar: tint the "today" cell in the app's blue instead of the default yellow */
.fc .fc-day-today,
.fc .fc-daygrid-day.fc-day-today,
.fc .fc-timegrid-col.fc-day-today {
  background-color: #eff6ff !important; /* Tailwind blue-50 */
}

.fc .fc-daygrid-day.fc-day-today .fc-daygrid-day-number {
  color: #1d4ed8; /* Tailwind blue-700 */
  font-weight: 600;
}
/*
 * FullCalendar: hue is the item's kind, status is opacity and strike. The feed
 * sends `kind-<kind>` and `status-<status>` class names and no colour, and
 * this block is the one palette: FullCalendar's own event rules read these
 * custom properties, and the legend swatch (`.kind-swatch`) reads the same
 * ones, so the legend and the events cannot disagree. Every filled kind keeps
 * white text at 4.5:1 or better; the deadline is the marker and is outlined
 * rather than filled, so it differs in shape and not only in hue.
 */
.fc .kind-subject_visit,    .kind-swatch.kind-subject_visit    { --fc-event-bg-color: #2563eb; --fc-event-border-color: #2563eb; } /* blue-600 */
.fc .kind-monitoring_visit, .kind-swatch.kind-monitoring_visit { --fc-event-bg-color: #7c3aed; --fc-event-border-color: #7c3aed; } /* violet-600 */
.fc .kind-meeting,          .kind-swatch.kind-meeting          { --fc-event-bg-color: #64748b; --fc-event-border-color: #64748b; } /* slate-500 */
.fc .kind-lab_task,         .kind-swatch.kind-lab_task         { --fc-event-bg-color: #0f766e; --fc-event-border-color: #0f766e; } /* teal-700 */
.fc .kind-pharmacy_task,    .kind-swatch.kind-pharmacy_task    { --fc-event-bg-color: #047857; --fc-event-border-color: #047857; } /* emerald-700 */
.fc .kind-training,         .kind-swatch.kind-training         { --fc-event-bg-color: #db2777; --fc-event-border-color: #db2777; } /* pink-600 */
.fc .kind-other,            .kind-swatch.kind-other            { --fc-event-bg-color: #6b7280; --fc-event-border-color: #6b7280; } /* gray-500 */
.fc .kind-deadline,         .kind-swatch.kind-deadline         { --fc-event-bg-color: #fffbeb; --fc-event-border-color: #d97706; --fc-event-text-color: #b45309; } /* amber-50 / amber-600 / amber-700 */

.fc .status-completed { opacity: 0.6; }
.fc .status-cancelled,
.fc .status-not_performed { opacity: 0.5; text-decoration: line-through; }

/*
 * Certainty tiers of the visit forecast (FS-03 §7A.1, SJ-UX-10): told apart
 * without reading the legend — committed solid, proposed hatched, projected
 * outlined — and the legend is painted from the same classes, so a chip and
 * its key cannot disagree. Shape carries the difference, not hue alone.
 */
.tier-mark { display: inline-flex; align-items: center; justify-content: center; border-radius: 0.25rem; border: 1px solid #1d4ed8; }
.tier-committed { background-color: #1d4ed8; color: #ffffff; }                                   /* blue-700 */
.tier-proposed  { background-image: repeating-linear-gradient(135deg, #bfdbfe 0 3px, #ffffff 3px 6px); color: #1e3a8a;
                  text-shadow: 0 0 2px #ffffff, 0 0 2px #ffffff; } /* blue-200 hatch; the halo keeps the count legible on it */
.tier-projected { background-color: #ffffff; border-style: dashed; border-color: #60a5fa; color: #1e40af; } /* blue-400 outline */

.kind-swatch {
  display: inline-block;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 0.1875rem;
  background-color: var(--fc-event-bg-color);
  border: 1px solid var(--fc-event-border-color);
  vertical-align: baseline;
}

/*
 * The schedule diagram (FS-03 SJ-FR-18, `protocol_schedules/_diagram`). The
 * glyph is the mode, the arc is the rule, the band is the group, and colour
 * is reserved for state: blue-600 for the node under the pointer and the arcs
 * that touch it, red-600 for a node the validator names. Plain CSS rather
 * than utilities because schedule_builder_controller toggles `.sb-lit` and
 * `.sb-dim` on these elements and Tailwind only generates what it reads.
 * Values are Tailwind's: gray-300 #d1d5db, gray-400 #9ca3af, gray-600 #4b5563,
 * gray-900 #111827, blue-600 #2563eb, blue-700 #1d4ed8, red-600 #dc2626,
 * slate-50 #f8fafc, slate-200 #e2e8f0, slate-400 #94a3b8, slate-500 #64748b.
 */
.sb { font-family: ui-sans-serif, system-ui, sans-serif; }
.sb text { fill: #111827; }
.sb-rail { stroke: #d1d5db; stroke-width: 2; }
.sb-arc { fill: none; stroke: #9ca3af; stroke-width: 1.5; }
.sb-edge-extra .sb-arc { stroke-dasharray: 4 3; }
.sb-arrow { fill: #9ca3af; stroke: none; }
.sb-edge-label { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; font-weight: 500; fill: #4b5563; }
.sb-edge.sb-lit .sb-arc { stroke: #2563eb; stroke-width: 2; }
.sb-edge.sb-lit .sb-arrow { fill: #2563eb; }
.sb-edge.sb-lit .sb-edge-label { fill: #1d4ed8; font-weight: 600; }
.sb-dim { opacity: 0.3; }
.sb-glyph { stroke-width: 2; stroke: #111827; fill: #ffffff; }
.sb-node-visit .sb-glyph { fill: #111827; }
.sb-node-remote .sb-glyph { stroke-dasharray: 3 3; }
.sb-node-red .sb-glyph { stroke: #dc2626; }
.sb-node-red.sb-node-visit .sb-glyph { fill: #dc2626; }
.sb-node { outline: none; }
a.sb-node { cursor: pointer; }
a.sb-node:hover .sb-glyph, .sb-node:focus-visible .sb-glyph { stroke: #2563eb; stroke-width: 3; }
a.sb-node-visit:hover .sb-glyph, .sb-node-visit:focus-visible .sb-glyph { fill: #2563eb; }
.sb-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; font-weight: 600; }
.sb-tag { font-family: ui-sans-serif, system-ui, sans-serif; font-size: 11px; font-weight: 600; fill: #1d4ed8; }
.sb-name { font-size: 12px; fill: #4b5563; }
.sb-date { font-size: 12px; font-variant-numeric: tabular-nums; }
.sb-window, .sb-cycle { font-size: 11px; fill: #9ca3af; font-variant-numeric: tabular-nums; }
.sb-conflict { fill: #dc2626; font-weight: 600; }
.sb-band rect { fill: #f8fafc; stroke: #e2e8f0; }
.sb-band .sb-loop { fill: none; stroke: #94a3b8; stroke-width: 1.5; }
.sb-band .sb-arrow { fill: #94a3b8; }
.sb-band-label { font-size: 11px; fill: #64748b; }
.sb-band-red rect { stroke: #dc2626; }
.sb-handle { outline: none; cursor: pointer; }
.sb-handle circle { fill: #ffffff; stroke: #d1d5db; stroke-width: 1.5; }
.sb-handle path { fill: none; stroke: #9ca3af; stroke-width: 1.5; }
.sb-handle:hover circle, .sb-handle:focus-visible circle { stroke: #2563eb; }
.sb-handle:hover path, .sb-handle:focus-visible path { stroke: #2563eb; }
