:root {
  --brand-dark: #1a1a1a;
  --brand-blue: #1e3a8a;
  --brand-blue-light: #2563eb;
  --brand-accent: #3b82f6;
  --brand-white: #ffffff;
  --brand-bg: #f8fafc;
  --brand-border: #e2e8f0;
  --brand-text: #1e293b;
  --brand-muted: #64748b;
  --brand-success: #16a34a;
  --brand-warning: #d97706;
  --brand-danger: #dc2626;
  --condition-low: #ef4444;
  --condition-mid: #f59e0b;
  --condition-high: #22c55e;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--brand-bg);
  color: var(--brand-text);
  margin: 0;
  min-height: 100vh;
}

body[dir="rtl"] {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

/* ── Navbar ── */
.navbar-brand img { height: 40px; }
.navbar { background: var(--brand-dark) !important; }
.navbar-dark .navbar-brand, .navbar-dark .nav-link { color: var(--brand-white) !important; }
.navbar-dark .nav-link:hover { color: var(--brand-accent) !important; }

/* ── Splash Screen ── */
#splash-screen {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--brand-white);
  transition: opacity 0.5s ease;
}
#splash-screen img { max-width: 320px; width: 80vw; }
#splash-screen.fade-out { opacity: 0; pointer-events: none; }

/* ── Cards ── */
.card { border: 1px solid var(--brand-border); border-radius: 12px; }
.card-header { background: var(--brand-blue); color: white; border-radius: 12px 12px 0 0 !important; }
.card-header h5, .card-header h4 { margin: 0; }

/* ── Buttons ── */
.btn-primary { background: var(--brand-blue-light); border-color: var(--brand-blue-light); }
.btn-primary:hover { background: var(--brand-blue); border-color: var(--brand-blue); }
.btn-brand { background: var(--brand-dark); color: white; border: none; }
.btn-brand:hover { background: var(--brand-blue); color: white; }

/* ── Progress Bars ── */
.progress { height: 8px; border-radius: 4px; }
.progress-bar { background: var(--brand-blue-light); }
.progress-bar.bg-success { background: var(--brand-success) !important; }

/* ── Room buttons on summary ── */
.room-btn {
  display: flex; flex-direction: column; align-items: center;
  padding: 16px 12px; border-radius: 12px;
  border: 2px solid var(--brand-border);
  background: white; cursor: pointer;
  transition: all 0.2s;
  text-decoration: none; color: var(--brand-text);
  min-width: 130px;
}
.room-btn:hover { border-color: var(--brand-blue-light); background: #eff6ff; color: var(--brand-text); }
.room-btn .room-icon { font-size: 2rem; margin-bottom: 8px; }
.room-btn .room-name { font-weight: 600; text-align: center; font-size: 0.9rem; }
.room-btn .room-pct { font-size: 0.75rem; color: var(--brand-muted); margin-top: 4px; }

/* ── Condition Slider ── */
.condition-slider-wrap { display: flex; align-items: center; gap: 12px; }
.condition-slider { flex: 1; }
.condition-value {
  min-width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem;
  background: var(--brand-border); color: var(--brand-muted);
}
.condition-value.low  { background: var(--condition-low);  color: white; }
.condition-value.mid  { background: var(--condition-mid);  color: white; }
.condition-value.high { background: var(--condition-high); color: white; }
.btn-clear-condition {
  background: none; border: none; color: var(--brand-muted);
  cursor: pointer; font-size: 0.85rem; padding: 0 2px;
  line-height: 1; flex-shrink: 0;
}
.btn-clear-condition:hover { color: var(--brand-danger); }

/* ── Image thumbnails ── */
.thumb-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.thumb-wrap { position: relative; width: 80px; height: 80px; }
.thumb-wrap img {
  width: 80px; height: 80px; object-fit: cover;
  border-radius: 8px; cursor: pointer; border: 2px solid var(--brand-border);
}
.thumb-delete {
  position: absolute; top: -6px; right: -6px;
  background: var(--brand-danger); color: white;
  border: none; border-radius: 50%; width: 20px; height: 20px;
  font-size: 0.75rem; cursor: pointer; display: flex;
  align-items: center; justify-content: center; line-height: 1;
}

/* ── Property row ── */
.property-row { border-bottom: 1px solid var(--brand-border); padding: 16px 0; }
.property-row:last-child { border-bottom: none; }
.property-name { font-weight: 600; margin-bottom: 8px; }

/* ── Forms list ── */
.month-header {
  font-size: 1rem; font-weight: 700; color: var(--brand-blue);
  text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 2px solid var(--brand-blue); padding-bottom: 4px;
  margin: 24px 0 12px;
}
.form-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--brand-border);
}
.form-row:last-child { border-bottom: none; }
.form-info { flex: 1; }
.form-info .client { font-weight: 600; }
.form-info .address { color: var(--brand-muted); font-size: 0.875rem; }

/* ── Shared form ── */
.shared-header { text-align: center; padding: 24px 0; border-bottom: 2px solid var(--brand-border); margin-bottom: 24px; }
.shared-header img { max-width: 260px; width: 70vw; }
.shared-room { margin-bottom: 32px; }
.shared-room-title {
  font-size: 1.1rem; font-weight: 700;
  background: var(--brand-blue); color: white;
  padding: 8px 16px; border-radius: 8px; margin-bottom: 16px;
}
.condition-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px; border-radius: 50%;
  font-weight: 700; color: white; font-size: 0.9rem;
  background: var(--condition-mid);
}
.condition-badge.low { background: var(--condition-low); }
.condition-badge.high { background: var(--condition-high); }

/* ── Login ── */
.login-card { max-width: 400px; margin: 80px auto; }
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo img { max-width: 220px; width: 70vw; }

/* ── Offline banner ── */
#offline-banner {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--brand-warning); color: white;
  text-align: center; padding: 10px; z-index: 1000; font-weight: 600;
}

/* ── Utilities ── */
.text-muted { color: var(--brand-muted) !important; }
.badge-condition { font-size: 0.75rem; }

@media (max-width: 576px) {
  .room-btn { min-width: 100px; padding: 12px 8px; }
  .room-btn .room-icon { font-size: 1.5rem; }
}
