/* Arbah v3 — Daily Site Report surface-specific styles.
 *
 * EVERY rule is scoped under `.av3` so it can only resolve when the v3 flag
 * is active; legacy + v2 DOM is never touched. These rules cover ONLY the
 * pieces the shared v3 primitives (arbah-v3-primitives.css) don't express:
 *   • the project/date picker field row (labels + controls)
 *   • the clickable site-photo grid (responsive, lightbox-trigger buttons)
 *   • the safety incident / toolbox list rows
 *   • a couple of typographic helpers (big crew numeral, work-done prose,
 *     section count badge, weather metric row, sign-off name)
 * Colors/fonts/radii all read from the locked --arbah-* tokens.
 *
 * <link rel="stylesheet" href="/src/design/arbah-v3-dailyreport.css"> */

/* ── Picker field row ── */
.av3 .daily-report .dr-pickers {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
}
.av3 .daily-report .dr-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.av3 .daily-report .dr-flabel {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--arbah-ink-subtle);
}
/* Style the page-provided <select>/<input> controls to match v3 inputs
 * without the page needing to know v3 class names. */
.av3 .daily-report .dr-field select,
.av3 .daily-report .dr-field input[type="date"] {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--arbah-border-strong);
  border-radius: var(--r-8);
  background: var(--arbah-surface);
  color: var(--arbah-ink);
  font-family: var(--font-sans);
  font-size: 13.5px;
}
[dir="rtl"] .av3 .daily-report .dr-field select,
[dir="rtl"] .av3 .daily-report .dr-field input[type="date"] {
  font-family: var(--font-sans-ar);
}
.av3 .daily-report .dr-field select:focus,
.av3 .daily-report .dr-field input[type="date"]:focus {
  outline: 2px solid var(--arbah-navy-500);
  outline-offset: 1px;
}

/* ── Weather metric row ── */
.av3 .daily-report .dr-metric-row {
  display: flex;
  align-items: center;
  gap: 11px;
}
.av3 .daily-report .dr-metric-ico {
  width: 36px;
  height: 36px;
  border-radius: var(--r-8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.av3 .daily-report .dr-metric-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--arbah-ink);
  line-height: 1.4;
}

/* ── Manpower card: per-trade count rows + bold bronze-mono TOTAL ── */
.av3 .daily-report .dr-mp {
  display: flex;
  flex-direction: column;
}
.av3 .daily-report .dr-mp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--arbah-border);
  font-size: 13px;
}
.av3 .daily-report .dr-mp-trade {
  color: var(--arbah-ink-muted);
  min-width: 0;
  word-break: break-word;
}
.av3 .daily-report .dr-mp-n {
  font-weight: 600;
  color: var(--arbah-ink);
  white-space: nowrap;
}
.av3 .daily-report .dr-mp-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 9px;
  font-size: 13px;
  font-weight: 700;
  color: var(--arbah-ink);
}
.av3 .daily-report .dr-mp-total-n {
  color: var(--arbah-bronze-700);
  font-weight: 700;
  white-space: nowrap;
}

/* ── Delays / Issues banner — warning tone (primitive .notice is info/blue;
 *    the mockup uses amber). Scoped override of the warning palette only. ── */
.av3 .daily-report .error-banner.dr-issue {
  background: var(--arbah-warning-soft);
  border-color: #F0D69A;
  color: var(--arbah-warning);
}

/* ── Crew big numeral ── */
.av3 .daily-report .dr-bignum {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 600;
  color: var(--arbah-ink);
  line-height: 1.1;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.av3 .daily-report .dr-bignum-unit {
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--arbah-ink-muted);
}
[dir="rtl"] .av3 .daily-report .dr-bignum-unit { font-family: var(--font-sans-ar); }

/* ── Work-done / notes prose ── */
.av3 .daily-report .dr-prose {
  font-size: 13.5px;
  color: var(--arbah-ink);
  line-height: 1.65;
  word-break: break-word;
}
.av3 .daily-report .dr-prose--muted { color: var(--arbah-ink-muted); }
.av3 .daily-report .dr-notes {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--arbah-border);
}

/* ── Section count badge ── */
.av3 .daily-report .dr-count {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--arbah-ink-subtle);
  margin-inline-start: 2px;
}

/* ── Clickable site-photo grid ── */
.av3 .daily-report .dr-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.av3 .daily-report .dr-photo {
  aspect-ratio: 1;
  border: 1px solid var(--arbah-border);
  border-radius: var(--r-8);
  overflow: hidden;
  padding: 0;
  background: var(--arbah-surface-sunken);
  cursor: pointer;
  display: block;
}
.av3 .daily-report .dr-photo:hover { box-shadow: var(--shadow-md); }
.av3 .daily-report .dr-photo:focus-visible {
  outline: 2px solid var(--arbah-navy-500);
  outline-offset: 1px;
}
.av3 .daily-report .dr-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.av3 .daily-report .dr-photo-ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--arbah-ink-subtle);
}

/* ── Safety lists (incidents / toolbox) ── */
.av3 .daily-report .dr-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.av3 .daily-report .dr-list-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--arbah-border);
}
.av3 .daily-report .dr-list-item:last-child {
  padding-bottom: 0;
  border-bottom: none;
}
.av3 .daily-report .dr-list-main { min-width: 0; flex: 1; }
.av3 .daily-report .dr-list-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--arbah-ink);
  line-height: 1.4;
  word-break: break-word;
}
.av3 .daily-report .dr-list-sub {
  font-size: 11.5px;
  color: var(--arbah-ink-subtle);
  margin-top: 3px;
}

/* ── Sign-off ── */
.av3 .daily-report .dr-signoff-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--arbah-ink);
}
/* Daily Site Report v16 authoring card. It shares the same page grid and
   restrained card language as the other v3 management surfaces. */
.dsr-v16-page {
  padding-block-end: 0;
}

.dsr-v16-card {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
  background: var(--arbah-surface, #fff);
  border: 1px solid var(--arbah-border, #dce3ed);
  border-radius: var(--r-12, 12px);
  box-shadow: var(--shadow-sm, 0 2px 7px rgba(15, 42, 67, .07));
  padding: 20px 22px;
}

.dsr-v16-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.dsr-v16-heading { min-width: 0; }
.dsr-v16-title {
  margin: 0;
  color: var(--arbah-ink, #102a43);
  font-family: var(--font-serif, Georgia, serif);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
}
.dsr-v16-subtitle {
  margin: 5px 0 0;
  color: var(--arbah-ink-muted, #62748a);
  font-size: 13px;
  line-height: 1.45;
}
[dir="rtl"] .dsr-v16-title,
[dir="rtl"] .dsr-v16-subtitle { font-family: var(--font-sans-ar, sans-serif); }

.dsr-v16-alert {
  margin-top: 16px;
  padding: 11px 13px;
  border: 1px solid var(--arbah-danger-border, #fecaca);
  border-radius: 8px;
  background: var(--arbah-danger-soft, #fff1f2);
  color: var(--arbah-danger, #b91c1c);
  font-size: 13px;
  line-height: 1.45;
}

.dsr-v16-create {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--arbah-border, #dce3ed);
  border-radius: 10px;
  background: var(--arbah-surface-sunken, #f7f9fc);
}

.dsr-v16-empty {
  margin-top: 16px;
  padding: 18px;
  border: 1px dashed var(--arbah-border-strong, #c7d2e0);
  border-radius: 10px;
  background: var(--arbah-surface-sunken, #f7f9fc);
  color: var(--arbah-ink-muted, #62748a);
  font-size: 13px;
  text-align: center;
}

.dsr-v16-table-wrap { margin-top: 16px; overflow-x: auto; }
.dsr-v16-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 13px; }
.dsr-v16-card--form { overflow-x: auto; }

@media (max-width: 640px) {
  .dsr-v16-card { padding: 16px; }
  .dsr-v16-head { align-items: stretch; }
  .dsr-v16-heading { flex: 1 1 100%; }
  .dsr-v16-head > .btn-primary { width: 100%; }
}
