/* FarmGrinde — page-specific layout. */

/* ── Today: the top-N priority cards ────────────────────────────────────── */

.priority-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 36px; }
.priority-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px 20px;
  box-shadow: var(--shadow);
  position: relative;
  display: flex;
  flex-direction: column;
}
.priority-rank {
  position: absolute;
  top: -10px; left: 18px;
  background: var(--pine);
  color: var(--paper-raised);
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 600;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid; place-items: center;
}
.priority-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.priority-entity {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--ink-soft);
}
.priority-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; line-height: 1.35; }
.priority-detail { font-size: 13px; color: var(--ink-soft); line-height: 1.5; flex: 1; }
.priority-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.priority-why { font-size: 11px; color: var(--ink-faint); }

.weather-tag {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 4px;
}
.weather-tag.dry { background: var(--timber-tint); color: var(--timber-ink); }
.weather-tag.wet { background: var(--pine-tint); color: var(--pine); }
.weather-tag.any { background: var(--paper-sunk); color: var(--ink-soft); }
.weather-tag.blocked { background: var(--rust-tint); color: var(--rust); }

/* ── ticket stubs ───────────────────────────────────────────────────────── */

.ticket-stat { font-family: var(--font-mono); font-size: 34px; font-weight: 600; color: var(--pine); line-height: 1; }
.ticket-stat span { font-size: 18px; color: var(--ink-soft); font-weight: 500; }
.ticket-label { font-size: 13px; color: var(--ink-soft); margin-top: 4px; }

.ticket-stubs { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 26px; }
.stub {
  width: 34px; height: 48px;
  border-radius: 4px;
  position: relative;
  background: var(--pine);
  cursor: default;
}
.stub.in_progress { background: var(--timber); }
.stub.not_started { background: transparent; border: 1.5px dashed var(--line-strong); }
.stub::before, .stub::after {
  content: "";
  position: absolute;
  width: 8px; height: 8px;
  background: var(--paper-raised);
  border-radius: 50%;
  left: 50%; transform: translateX(-50%);
}
.stub::before { top: -4px; }
.stub::after  { bottom: -4px; }
.stub.not_started::before, .stub.not_started::after { background: var(--paper); }

.chart-wrap { border-top: 1px solid var(--line); padding-top: 20px; }
.chart-title { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 10px; }
.chart-host { min-height: 190px; }

/* ── map ────────────────────────────────────────────────────────────────── */

.map-layout { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.map-host {
  height: 620px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
  background: var(--paper-sunk);
}
.leaflet-container { font-family: var(--font-sans); background: var(--paper-sunk); }
.comp-label {
  background: rgba(251, 250, 244, 0.88);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 11px; font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  box-shadow: none;
}
.map-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: calc(var(--header-h) + 20px); }
.map-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--ink-soft); }
.legend-key { display: flex; align-items: center; gap: 6px; }
.legend-swatch { width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--line-strong); }

.comp-detail-empty { padding: 26px 6px; text-align: center; color: var(--ink-soft); font-size: 13px; }
.comp-figs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.comp-fig { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.comp-fig-label { font-size: 11px; color: var(--ink-soft); }
.comp-fig-value { font-family: var(--font-mono); font-size: 15px; font-weight: 600; }

.note-list { display: flex; flex-direction: column; max-height: 260px; overflow-y: auto; }
.note-item { padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px; }
.note-item:first-child { border-top: none; }
.note-head { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.note-kind { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; background: var(--paper-sunk); color: var(--ink-soft); }
.note-kind.fire, .note-kind.breakdown { background: var(--rust-tint); color: var(--rust); }
.note-kind.hail { background: var(--timber-tint); color: var(--timber-ink); }
.note-kind.disc, .note-kind.harvest { background: var(--pine-tint); color: var(--pine); }
.note-date { font-size: 11px; color: var(--ink-faint); font-family: var(--font-mono); }
.note-body { color: var(--ink-soft); line-height: 1.5; }

.dropzone {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 26px 18px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
  background: var(--paper);
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.dropzone.drag { border-color: var(--pine); background: var(--pine-tint); }

/* ── reports ────────────────────────────────────────────────────────────── */

.report-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.report-figure { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.report-figure-label { font-size: 12px; color: var(--ink-soft); margin-bottom: 6px; }
.report-figure-value { font-family: var(--font-mono); font-size: 22px; font-weight: 600; }
.report-figure-value.pine { color: var(--pine); }
.report-figure-value.rust { color: var(--rust); }

/* ── settings ───────────────────────────────────────────────────────────── */

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }

/* ── filters ────────────────────────────────────────────────────────────── */

.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.filter-bar .input { width: auto; min-width: 150px; }
.filter-bar .grow { flex: 1; min-width: 180px; }

@media (max-width: 1100px) {
  .map-layout { grid-template-columns: 1fr; }
  .map-side { position: static; }
  .map-host { height: 440px; }
}

@media (max-width: 980px) {
  .priority-grid { grid-template-columns: 1fr; }
  .report-grid { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .report-grid { grid-template-columns: 1fr; }
  .comp-figs { grid-template-columns: 1fr; }
}
