/* ============================================================
   Arbah v1 — Role landings (Round 4 PR 13)
   Covers 3 role-variant landing pages — ClientHome (default
   route for client role), EngineerToday (#/today), and
   DailyReport (#/daily-report) — under .arbah-v1. Legacy paint
   byte-identical when the flag is off.

   Reads tokens from src/design/arbah-tokens.css. High cross-PR
   reuse — references documented per section.

   !important policy: 0 in this file.
   ============================================================ */

/* -- Shared wrappers ---------------------------------------- */
.arbah-v1 .client-home,
.arbah-v1 .engineer-today,
.arbah-v1 .daily-report {
  background: var(--arbah-bg);
  font-family: var(--arbah-font-sans);
  color: var(--arbah-text);
}

/* =====  CLIENT HOME  ====================================== */
/* The client landing already wraps content in
   `max-w-3xl mx-auto p-4 sm:p-6 space-y-6`. Our additions
   re-paint the hero strip, the progress card, and references
   for photo/RFI sub-surfaces. */

.arbah-v1 .client-home .hero-strip,
.arbah-v1 .hero-strip {
  background: var(--arbah-surface);
  border: 1px solid var(--arbah-border);
  border-radius: var(--arbah-radius-lg);
  box-shadow: var(--arbah-shadow-sm);
  overflow: hidden;
  position: relative;
  font-family: var(--arbah-font-sans);
}
.arbah-v1 .hero-strip .hero-image,
.arbah-v1 .hero-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 7;
  background: var(--arbah-navy-100);
  overflow: hidden;
}
.arbah-v1 .hero-image img,
.arbah-v1 .hero-strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.arbah-v1 .hero-overlay {
  position: absolute;
  inset: 0;
  /* navy-900 @ 60% blended into a top-fading gradient so the
     image stays visible up top and the title sits readable
     against a tinted bottom band. */
  background: linear-gradient(
    to top,
    rgba(10, 27, 46, 0.6) 0%,
    rgba(10, 27, 46, 0.4) 35%,
    rgba(10, 27, 46, 0.05) 70%,
    rgba(10, 27, 46, 0) 100%
  );
  pointer-events: none;
}
.arbah-v1 .hero-content {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: var(--arbah-space-4) var(--arbah-space-5);
  color: #FFFFFF;
}
.arbah-v1 .hero-welcome {
  font-family: var(--arbah-font-sans);
  font-weight: 500;
  font-size: var(--arbah-text-xs);
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 var(--arbah-space-1) 0;
}
.arbah-v1 .hero-title {
  font-family: var(--arbah-font-sans);
  font-weight: 700;
  font-size: var(--arbah-text-2xl);
  line-height: 1.15;
  color: #FFFFFF;
  margin: 0;
}
.arbah-v1 .hero-meta,
.arbah-v1 .hero-strip .hero-meta {
  font-family: var(--arbah-font-sans);
  font-weight: 500;
  font-size: var(--arbah-text-sm);
  color: rgba(255, 255, 255, 0.95);
  margin: var(--arbah-space-1) 0 0 0;
}

/* Progress card (overall progress + days-to-completion). */
.arbah-v1 .client-progress-card,
.arbah-v1 .client-home .client-progress-card {
  background: var(--arbah-surface);
  border: 1px solid var(--arbah-border);
  border-radius: var(--arbah-radius-lg);
  box-shadow: var(--arbah-shadow-sm);
  padding: var(--arbah-space-5);
  font-family: var(--arbah-font-sans);
}
.arbah-v1 .client-progress-label {
  font-family: var(--arbah-font-sans);
  font-weight: 600;
  font-size: var(--arbah-text-xs);
  color: var(--arbah-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.arbah-v1 .client-progress-value {
  font-family: var(--arbah-font-sans);
  font-weight: 700;
  font-size: var(--arbah-text-3xl);
  color: var(--arbah-navy-700);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  unicode-bidi: plaintext;
}
.arbah-v1 .client-progress-bar {
  height: 12px;
  background: var(--arbah-navy-50);
  border-radius: var(--arbah-radius-full);
  overflow: hidden;
}
.arbah-v1 .client-progress-bar-fill {
  height: 100%;
  background: var(--arbah-bronze-500);
  border-radius: var(--arbah-radius-full);
  transition: width var(--arbah-duration-base) var(--arbah-ease-standard);
}

/* Photo gallery — reuses PR #114 .photo-card / .photo-thumb
   patterns. The legacy ClientHome markup uses a different
   gallery structure; we expose .client-home-gallery as the
   container hook and paint the immediate children with the
   same hover affordance. */
.arbah-v1 .client-home-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--arbah-space-3);
}
.arbah-v1 .client-home-gallery > * {
  background: var(--arbah-surface);
  border-radius: var(--arbah-radius-md);
  box-shadow: var(--arbah-shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--arbah-duration-base) var(--arbah-ease-standard);
}
.arbah-v1 .client-home-gallery > *:hover {
  box-shadow: var(--arbah-shadow-md);
}

/* RFI cards — alias of PR #117 .rfi-card visual shape. */
.arbah-v1 .client-home .rfi-card,
.arbah-v1 .client-home-rfi-card {
  background: var(--arbah-surface);
  border: 1px solid var(--arbah-border);
  border-radius: var(--arbah-radius-md);
  box-shadow: var(--arbah-shadow-sm);
  padding: var(--arbah-space-4);
  font-family: var(--arbah-font-sans);
}
.arbah-v1 .client-home-rfi-title {
  font-family: var(--arbah-font-sans);
  font-weight: 600;
  font-size: var(--arbah-text-base);
  color: var(--arbah-navy-700);
}

/* =====  ENGINEER TODAY  =================================== */
/* The Today page uses a single-column max-w-2xl layout with
   distinct sections: vantage selector + capture zone + tasks +
   log form. We re-paint each section's surface + the bronze
   primary buttons. */

.arbah-v1 .engineer-today .engineer-section,
.arbah-v1 .engineer-section {
  background: var(--arbah-surface);
  border: 1px solid var(--arbah-border);
  border-radius: var(--arbah-radius-lg);
  box-shadow: var(--arbah-shadow-sm);
  padding: var(--arbah-space-5);
  font-family: var(--arbah-font-sans);
}
.arbah-v1 .engineer-section + .engineer-section {
  margin-top: var(--arbah-space-4);
}
.arbah-v1 .engineer-section-label {
  font-family: var(--arbah-font-sans);
  font-weight: 600;
  font-size: var(--arbah-text-xs);
  color: var(--arbah-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 var(--arbah-space-2) 0;
}

/* Photo capture launcher — reuses the PR #114
   .photo-upload-zone dashed pattern but with a bronze
   accent on hover. */
.arbah-v1 .engineer-capture-zone,
.arbah-v1 .engineer-today .engineer-capture-zone {
  background: var(--arbah-surface);
  border: 2px dashed var(--arbah-border);
  border-radius: var(--arbah-radius-lg);
  padding: var(--arbah-space-5);
  text-align: center;
  cursor: pointer;
  transition: background-color var(--arbah-duration-fast) var(--arbah-ease-standard),
              border-color var(--arbah-duration-fast) var(--arbah-ease-standard);
}
.arbah-v1 .engineer-capture-zone:hover {
  background: var(--arbah-bronze-50);
  border-color: var(--arbah-bronze-500);
}
.arbah-v1 .engineer-capture-title {
  font-family: var(--arbah-font-sans);
  font-weight: 600;
  font-size: var(--arbah-text-lg);
  color: var(--arbah-navy-700);
  margin: var(--arbah-space-2) 0 var(--arbah-space-1) 0;
}
.arbah-v1 .engineer-capture-hint {
  font-family: var(--arbah-font-sans);
  font-size: var(--arbah-text-sm);
  color: var(--arbah-text-muted);
}

/* Engineer task row — slim variant of PR #113 .task-card,
   stripped to a single-line summary since the Today view shows
   day-relevant tasks only. */
.arbah-v1 .engineer-task-list {
  display: flex;
  flex-direction: column;
  gap: var(--arbah-space-2);
}
.arbah-v1 .engineer-task-row {
  background: var(--arbah-surface);
  border: 1px solid var(--arbah-border);
  border-radius: var(--arbah-radius-md);
  padding: var(--arbah-space-3);
  font-family: var(--arbah-font-sans);
  display: flex;
  align-items: center;
  gap: var(--arbah-space-3);
  transition: background-color var(--arbah-duration-fast) var(--arbah-ease-standard);
}
.arbah-v1 .engineer-task-row:hover {
  background: var(--arbah-navy-50);
}
.arbah-v1 .engineer-task-title {
  font-family: var(--arbah-font-sans);
  font-weight: 500;
  font-size: var(--arbah-text-sm);
  color: var(--arbah-navy-700);
  flex: 1 1 auto;
  min-width: 0;
}
.arbah-v1 .engineer-task-due {
  font-family: var(--arbah-font-sans);
  font-size: var(--arbah-text-xs);
  color: var(--arbah-text-muted);
}

/* Quick-action tiles — alias of PR #118 .report-tile. */
.arbah-v1 .quick-action-tile {
  background: var(--arbah-surface);
  border: 1px solid var(--arbah-border);
  border-radius: var(--arbah-radius-lg);
  box-shadow: var(--arbah-shadow-sm);
  padding: var(--arbah-space-5);
  font-family: var(--arbah-font-sans);
  cursor: pointer;
  transition: box-shadow var(--arbah-duration-base) var(--arbah-ease-standard),
              transform var(--arbah-duration-base) var(--arbah-ease-standard);
}
.arbah-v1 .quick-action-tile:hover {
  box-shadow: var(--arbah-shadow-md);
  transform: scale(1.02);
}
.arbah-v1 .quick-action-tile .quick-action-icon {
  color: var(--arbah-bronze-500);
}

/* Primary action button — capture / mark-done / submit all
   share a bronze paint when used inside engineer-today. */
.arbah-v1 .engineer-today .btn-primary,
.arbah-v1 .engineer-primary-btn,
.arbah-v1 .engineer-today button[type="submit"] {
  background: var(--arbah-bronze-500);
  color: #FFFFFF;
  border: none;
  border-radius: var(--arbah-radius-md);
  padding: var(--arbah-space-2) var(--arbah-space-4);
  font-family: var(--arbah-font-sans);
  font-weight: 600;
  font-size: var(--arbah-text-sm);
  cursor: pointer;
  transition: background-color var(--arbah-duration-fast) var(--arbah-ease-standard);
}
.arbah-v1 .engineer-today .btn-primary:hover,
.arbah-v1 .engineer-primary-btn:hover,
.arbah-v1 .engineer-today button[type="submit"]:hover {
  background: var(--arbah-bronze-700);
}
.arbah-v1 .engineer-today .btn-primary:active,
.arbah-v1 .engineer-primary-btn:active,
.arbah-v1 .engineer-today button[type="submit"]:active {
  background: var(--arbah-bronze-800);
}

/* =====  DAILY REPORT  ===================================== */
/* DailyReport renders multiple summary cards + a workdone block
   + a list of attachments. The render is currently read-only
   (it reflects the day's logs) but we treat each card as a
   form-style "section" with the same surface treatment so a
   future editable form variant inherits the look. */

.arbah-v1 .daily-report .daily-report-section,
.arbah-v1 .daily-report-section {
  background: var(--arbah-surface);
  border: 1px solid var(--arbah-border);
  border-radius: var(--arbah-radius-lg);
  box-shadow: var(--arbah-shadow-sm);
  padding: var(--arbah-space-6);
  font-family: var(--arbah-font-sans);
}
.arbah-v1 .daily-report-section + .daily-report-section {
  margin-top: var(--arbah-space-4);
}
.arbah-v1 .daily-report-section-title,
.arbah-v1 .daily-report-section-label {
  font-family: var(--arbah-font-sans);
  font-weight: 600;
  font-size: var(--arbah-text-lg);
  color: var(--arbah-navy-700);
  margin: 0 0 var(--arbah-space-3) 0;
}
.arbah-v1 .daily-report-meta-label {
  font-family: var(--arbah-font-sans);
  font-weight: 500;
  font-size: var(--arbah-text-xs);
  color: var(--arbah-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.arbah-v1 .daily-report-meta-value {
  font-family: var(--arbah-font-sans);
  font-size: var(--arbah-text-base);
  color: var(--arbah-text);
}

/* Form fields — PR #109 login input pattern. */
.arbah-v1 .daily-report input[type="text"],
.arbah-v1 .daily-report input[type="email"],
.arbah-v1 .daily-report input[type="tel"],
.arbah-v1 .daily-report input[type="number"],
.arbah-v1 .daily-report input[type="date"],
.arbah-v1 .daily-report select,
.arbah-v1 .daily-report textarea {
  background: var(--arbah-surface);
  border: 1px solid var(--arbah-border);
  border-radius: var(--arbah-radius-md);
  padding: var(--arbah-space-2) var(--arbah-space-3);
  font-family: var(--arbah-font-sans);
  font-size: var(--arbah-text-sm);
  color: var(--arbah-text);
  width: 100%;
}
.arbah-v1 .daily-report input:focus,
.arbah-v1 .daily-report select:focus,
.arbah-v1 .daily-report textarea:focus {
  border-color: var(--arbah-navy-700);
  box-shadow: var(--arbah-focus-ring-glow);
  outline: none;
}

/* Photo attachments grid — alias of PR #114 .photos-grid. */
.arbah-v1 .daily-report-attachments {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--arbah-space-3);
}
.arbah-v1 .daily-report-attachment {
  background: var(--arbah-surface);
  border-radius: var(--arbah-radius-md);
  box-shadow: var(--arbah-shadow-sm);
  overflow: hidden;
  aspect-ratio: 1;
}
.arbah-v1 .daily-report-attachment img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Submit + secondary buttons. */
.arbah-v1 .daily-report-submit,
.arbah-v1 .daily-report .btn-primary,
.arbah-v1 .daily-report button[type="submit"]:not(.btn-ghost) {
  background: var(--arbah-bronze-500);
  color: #FFFFFF;
  border: none;
  border-radius: var(--arbah-radius-md);
  padding: var(--arbah-space-2) var(--arbah-space-4);
  font-family: var(--arbah-font-sans);
  font-weight: 600;
  font-size: var(--arbah-text-sm);
  cursor: pointer;
  transition: background-color var(--arbah-duration-fast) var(--arbah-ease-standard);
}
.arbah-v1 .daily-report-submit:hover,
.arbah-v1 .daily-report button[type="submit"]:not(.btn-ghost):hover {
  background: var(--arbah-bronze-700);
}
.arbah-v1 .daily-report-submit:active {
  background: var(--arbah-bronze-800);
}

/* =====  Mobile (375x812)  ================================= */
@media (max-width: 640px) {
  /* Hero strip: collapse to a title-only band; image drops. */
  .arbah-v1 .hero-image {
    aspect-ratio: 21 / 9;
  }
  .arbah-v1 .hero-title {
    font-size: var(--arbah-text-xl);
  }

  /* Client home gallery: 2 columns at phone width. */
  .arbah-v1 .client-home-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--arbah-space-2);
  }

  /* Daily report sections: reduced padding. */
  .arbah-v1 .daily-report-section {
    padding: var(--arbah-space-4);
  }

  /* Quick-action tiles: 2 columns at phone width. */
  .arbah-v1 .quick-action-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =====  AR / RTL  ========================================= */
/* All directional rules use logical properties (inset-inline-*,
   margin-inline, padding-inline-*) so [dir="rtl"] flips them
   automatically — no per-rule overrides needed. Plex Sans
   Arabic is first in --arbah-font-sans, so AR labels pick it
   up everywhere. Currency-like values (progress %, days
   countdown) carry `unicode-bidi: plaintext` so digits stay
   LTR inside an RTL container. */
