/* ============================================================
   SOMARGES Portal — Complete Stylesheet
   LCDP Design System · Glass-morphism · RTL/LTR · Responsive
   ============================================================ */

/* ─── CSS Variables (matched to LCDP) ─── */
:root {
  --primary: #2e7d32;
  --primary-light: #4caf50;
  --primary-dark: #1b5e20;
  --accent: #ff9800;
  --danger: #d32f2f;
  --warning: #f57c00;
  --success: #388e3c;
  --info: #1976d2;

  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-bg-strong: rgba(255, 255, 255, 0.88);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  --glass-blur: blur(20px);

  --text-primary: #1a1a2e;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-on-primary: #ffffff;

  --bg-card: var(--glass-bg);

  --header-height: 64px;
  --nav-height: 64px;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;

  --font-main: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Tahoma, sans-serif;

  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Dark Mode ─── */
@media (prefers-color-scheme: dark) {
  :root {
    --glass-bg: rgba(30, 30, 30, 0.78);
    --glass-bg-strong: rgba(30, 30, 30, 0.92);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --text-primary: #e8f0e8;
    --text-secondary: #b0c4b0;
    --text-muted: #7a8e7a;
  }
}

/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  color: var(--text-primary);
  background: transparent;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ─── LCDP Animated Background (used on all pages) ─── */
.lcdp-bg {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: -2;
  background: linear-gradient(135deg,
    #e8f5e9 0%,
    #c8e6c9 25%,
    #a5d6a7 50%,
    #81c784 75%,
    #66bb6a 100%
  );
}

.lcdp-bg::before {
  content: '';
  position: absolute;
  top: -20%; right: -10%;
  width: 60%; height: 60%;
  background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, transparent 70%);
  border-radius: 50%;
}

.lcdp-bg::after {
  content: '';
  position: absolute;
  bottom: -30%; left: -20%;
  width: 80%; height: 80%;
  background: radial-gradient(circle, rgba(129,199,132,0.5) 0%, transparent 60%);
  border-radius: 50%;
}

.bg-shape {
  position: fixed;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  animation: bgFloat 20s infinite ease-in-out;
  z-index: -1;
}
.bg-shape:nth-child(2) { width: 300px; height: 300px; top: 10%; left: -5%; animation-delay: 0s; }
.bg-shape:nth-child(3) { width: 200px; height: 200px; top: 60%; right: -5%; animation-delay: -5s; }
.bg-shape:nth-child(4) { width: 150px; height: 150px; bottom: 10%; left: 20%; animation-delay: -10s; }

@keyframes bgFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-20px) scale(1.05); }
}

[dir="rtl"] body {
  font-family: var(--font-main);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* ─── Language Visibility ─── */
body.lang-ar .fr-only { display: none !important; }
body.lang-fr .ar-only { display: none !important; }
body.lang-ar .ar-only { display: inline; }
body.lang-fr .fr-only { display: inline; }

/* ─── Glass Morphism Utilities ─── */
.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
}

.glass-strong {
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
}

/* ─── Buttons (LCDP style) ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: var(--text-on-primary);
}
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: var(--text-on-primary);
}

.btn-danger {
  background: var(--danger);
  color: var(--text-on-primary);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.85rem;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  font-size: 1.2rem;
}

/* ============================================================
   LANDING PAGE
   ============================================================ */

.landing-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 20px;
  text-align: center;
}

.landing-somarges-logo {
  height: 28px;
  opacity: 0.6;
  margin-bottom: 24px;
  transition: opacity var(--transition);
}
.landing-somarges-logo:hover { opacity: 1; }

.landing-project-logo {
  width: 100px;
  height: 100px;
  max-width: 100px;
  max-height: 100px;
  border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  object-fit: cover;
  margin-bottom: 20px;
}

.landing-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.landing-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-weight: 400;
}

/* Role List — Vertical Full-Width Cards */
.role-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 440px;
  margin-bottom: 28px;
}

.role-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  color: inherit;
  text-align: start;
}
.role-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  border-color: var(--primary-light);
  text-decoration: none;
}
.role-card:active {
  transform: translateY(0);
}

.role-card-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(46, 125, 50, 0.08);
  border-radius: 12px;
}

.role-card-info {
  flex: 1;
  min-width: 0;
}

.role-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.role-card-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.role-card-arrow {
  font-size: 1.4rem;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform var(--transition);
}
.role-card:hover .role-card-arrow {
  color: var(--primary);
  transform: translateX(3px);
}
[dir="rtl"] .role-card:hover .role-card-arrow {
  transform: translateX(-3px);
}

/* Landing Footer */
.landing-footer {
  margin-top: 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.landing-footer-logo {
  height: 20px;
  opacity: 0.4;
  margin-bottom: 6px;
}

.landing-footer p {
  margin: 2px 0;
}

.lang-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
  margin-bottom: 20px;
  font-family: inherit;
}
.lang-toggle-btn:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */

.login-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 20px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 36px 28px;
  text-align: center;
  border-radius: 28px;
}

.login-logo {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  object-fit: cover;
  margin-bottom: 16px;
}

.login-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.login-step {
  width: 100%;
}

.login-step.hidden { display: none; }

.form-group {
  margin-bottom: 18px;
  text-align: start;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-select {
  /* Hidden native select — keeps form values working */
  display: none;
}

/* ── Custom Dropdown ── */
.custom-select {
  position: relative;
  width: 100%;
}

.custom-select-trigger {
  width: 100%;
  padding: 13px 40px 13px 16px;
  border: 1.5px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  font-size: 0.92rem;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  transition: all 0.25s ease;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  min-height: 48px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  user-select: none;
}

[dir="rtl"] .custom-select-trigger {
  padding: 13px 16px 13px 40px;
}

.custom-select-trigger.placeholder {
  color: var(--text-muted);
}

.custom-select-trigger.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(0,0,0,0.03);
}

/* Chevron */
.custom-select-trigger::after {
  content: '';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%) rotate(0deg);
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: translateY(-60%) rotate(45deg);
  transition: transform 0.25s ease;
}

[dir="rtl"] .custom-select-trigger::after {
  right: auto;
  left: 16px;
}

.custom-select.open .custom-select-trigger::after {
  transform: translateY(-30%) rotate(-135deg);
}

.custom-select.open .custom-select-trigger {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1), 0 4px 12px rgba(0,0,0,0.08);
  border-radius: 14px 14px 4px 4px;
}

/* Dropdown panel */
.custom-select-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 200;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1.5px solid var(--primary);
  border-top: none;
  border-radius: 0 0 14px 14px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.2s ease;
  opacity: 0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.custom-select.open .custom-select-options {
  max-height: 240px;
  overflow-y: auto;
  opacity: 1;
}

.custom-select-options::-webkit-scrollbar {
  width: 4px;
}
.custom-select-options::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 4px;
}

/* Individual option */
.custom-select-option {
  padding: 12px 16px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(0,0,0,0.03);
}

.custom-select-option:last-child {
  border-bottom: none;
}

.custom-select-option:hover {
  background: rgba(46, 125, 50, 0.06);
}

.custom-select-option.selected {
  background: rgba(46, 125, 50, 0.1);
  font-weight: 600;
  color: var(--primary);
}

.custom-select-option.selected::before {
  content: '✓';
  margin-inline-end: 8px;
  font-weight: 700;
  color: var(--primary);
}

.login-continue-btn {
  width: 100%;
  padding: 14px;
  margin-top: 8px;
}

.google-btn-wrap {
  display: flex;
  justify-content: center;
  padding: 20px 0;
  min-height: 60px;
}

.login-back-link {
  display: inline-block;
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
}
.login-back-link:hover { color: var(--primary); }

.login-error {
  background: rgba(211, 47, 47, 0.08);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-top: 12px;
  display: none;
}
.login-error.visible { display: block; }

.login-spinner {
  display: none;
  margin: 16px auto;
}
.login-spinner.visible { display: block; }

/* ============================================================
   DASHBOARD — BANK-APP STYLE HEADER
   Top bar: [Profile+Bell] ——— [Logo] ——— [Menu☰]
   Info bar below: Owner name, property details
   ============================================================ */

.dash-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
}

/* ── Top Row: profile | logo | menu ── */
.header-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  height: 60px;
}

.header-start {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-profile-pic {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.8);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  cursor: pointer;
}

.header-bell {
  position: relative;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: background var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.header-bell:hover { background: rgba(0,0,0,0.06); }

.header-bell svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--text-primary);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header-bell-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 9px;
  height: 9px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid white;
  display: none;
}
.header-bell-badge.visible { display: block; }

.header-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.header-logo {
  height: 36px;
  max-width: 140px;
  width: auto;
  object-fit: contain;
}

.header-end {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.header-menu-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background var(--transition);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.header-menu-btn:hover { background: rgba(0,0,0,0.06); }

.menu-line {
  display: block;
  width: 24px;
  height: 2.5px;
  background: var(--primary-dark);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* ── Profile Dropdown (click profile pic) ── */
.profile-dropdown {
  position: absolute;
  top: 58px;
  z-index: 150;
  width: 240px;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.25s ease;
}

[dir="ltr"] .profile-dropdown { left: 16px; }
[dir="rtl"] .profile-dropdown { right: 16px; }

.profile-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.profile-dropdown-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  margin-bottom: 12px;
}

.profile-dropdown-pic {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.profile-dropdown-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.profile-dropdown-email {
  font-size: 0.72rem;
  color: var(--text-muted);
  word-break: break-all;
}

.profile-logout-btn {
  width: 100%;
  padding: 10px;
  background: transparent;
  border: 1px solid rgba(211,47,47,0.3);
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--danger);
  transition: all var(--transition);
  font-family: inherit;
  text-align: center;
}
.profile-logout-btn:hover {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

/* ── Info Strip below top bar ── */
.header-info-strip {
  text-align: center;
  padding: 6px 16px 12px;
  border-top: 1px solid rgba(0,0,0,0.04);
}

.header-owner-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.header-property-info {
  font-size: 0.82rem;
  color: var(--primary);
  font-weight: 600;
}

.header-lang-btn {
  display: inline-flex;
  align-items: center;
  margin-top: 4px;
  padding: 3px 14px;
  background: rgba(46,125,50,0.08);
  border: none;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--primary);
  transition: all var(--transition);
  font-family: inherit;
}
.header-lang-btn:hover {
  background: rgba(46,125,50,0.15);
}

/* ============================================================
   SLIDE-OUT MENU DRAWER
   ============================================================ */

.menu-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.menu-overlay.open {
  opacity: 1;
  visibility: visible;
}

.menu-drawer {
  position: fixed;
  top: 0;
  width: 300px;
  max-width: 85vw;
  height: 100%;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 201;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  box-shadow: 4px 0 24px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
}

/* LTR: drawer slides from left */
[dir="ltr"] .menu-drawer {
  left: 0;
  transform: translateX(-100%);
}
[dir="ltr"] .menu-drawer.open {
  transform: translateX(0);
}

/* RTL: drawer slides from right */
[dir="rtl"] .menu-drawer {
  right: 0;
  transform: translateX(100%);
}
[dir="rtl"] .menu-drawer.open {
  transform: translateX(0);
}

.menu-drawer-header {
  padding: 24px 20px 16px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  text-align: center;
}

.menu-drawer-logo {
  height: 40px;
  margin-bottom: 8px;
}

.menu-drawer-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.menu-section {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.menu-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.menu-contact-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: rgba(46,125,50,0.05);
  border-radius: 12px;
  margin-bottom: 8px;
}

.menu-contact-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.menu-contact-icon svg {
  width: 20px;
  height: 20px;
  fill: white;
}

.menu-contact-info {
  flex: 1;
  min-width: 0;
}

.menu-contact-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.menu-contact-role {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.menu-contact-detail {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--primary);
  margin-top: 2px;
  direction: ltr; /* phone numbers and emails always LTR */
  text-align: left;
}

.menu-contact-detail a {
  color: var(--primary);
  text-decoration: none;
  direction: ltr;
  unicode-bidi: plaintext;
}
.menu-contact-detail a:hover {
  text-decoration: underline;
}

.menu-footer {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid rgba(0,0,0,0.06);
}

.menu-logout-btn {
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 1px solid rgba(211,47,47,0.3);
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--danger);
  transition: all var(--transition);
  font-family: inherit;
}
.menu-logout-btn:hover {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

/* ============================================================
   DASHBOARD — BOTTOM NAVIGATION (Bank-App Dark Style, Scrollable)
   ============================================================ */

.bottom-nav-wrap {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
}

/* Scroll indicator triangle */
.nav-scroll-hint {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.3s ease;
}

[dir="ltr"] .nav-scroll-hint { right: 0; }
[dir="rtl"] .nav-scroll-hint { left: 0; }

.nav-scroll-hint svg {
  width: 10px;
  height: 16px;
  fill: rgba(255,255,255,0.6);
  filter: drop-shadow(-2px 0 4px rgba(0,0,0,0.3));
}

/* Flip arrow for RTL */
[dir="rtl"] .nav-scroll-hint svg {
  transform: rotate(180deg);
}

.nav-scroll-hint.hidden {
  opacity: 0;
}

.bottom-nav {
  height: var(--nav-height);
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  padding: 0 4px;
  background: var(--primary-dark);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
}
.bottom-nav::-webkit-scrollbar { display: none; }

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: rgba(255,255,255,0.5);
  font-size: 0.65rem;
  font-weight: 500;
  border-radius: 0;
  transition: all var(--transition);
  flex-shrink: 0;
  min-width: 72px;
  white-space: nowrap;
  font-family: inherit;
  position: relative;
  scroll-snap-align: center;
}

.nav-item:hover {
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.06);
}

.nav-item.active {
  color: #ffffff;
  background: transparent;
}

/* Active indicator line on top */
.nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 3px;
  background: white;
  border-radius: 0 0 3px 3px;
}

.nav-item-icon {
  width: 28px;
  height: 28px;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-item-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item-label {
  line-height: 1.2;
}

/* Desktop: center the buttons */
@media (min-width: 769px) {
  .bottom-nav {
    justify-content: center;
  }
  .nav-scroll-hint { display: none; }
}

/* ============================================================
   DASHBOARD — MAIN CONTENT
   ============================================================ */

.dash-main {
  padding-top: 160px; /* clear fixed header: topbar 60px + info strip ~80px + safety margin */
  padding-bottom: calc(var(--nav-height) + 20px);
  padding-left: 16px;
  padding-right: 16px;
  max-width: 900px;
  margin: 0 auto;
}

.dash-section {
  display: none;
  animation: fadeIn 0.3s ease;
}
.dash-section.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.section-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.card {
  padding: 20px;
  margin-bottom: 16px;
}

/* ============================================================
   ARROW CHEVRON TIMELINE (Contribution Progress)
   Horizontal arrow steps: grey=not due, green=paid, red=overdue, blue=partial
   ============================================================ */

.progress-section-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.arrow-timeline {
  direction: ltr; /* Always LTR for left-to-right progress */
  padding: 4px 0 16px;
  margin-bottom: 12px;
}

/* Top: number track with connecting line */
.arrow-timeline-track {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.arrow-track-step {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  background: #bdbdbd;
  transition: background 0.3s ease;
  position: relative;
}

.arrow-track-step.paid   { background: #43a047; }
.arrow-track-step.partial { background: #1e88e5; }
.arrow-track-step.overdue { background: #d32f2f; }
.arrow-track-step.upcoming { background: #bdbdbd; }

.arrow-track-step svg { width: 14px; height: 14px; }

.arrow-track-line {
  flex: 1;
  height: 3px;
  background: #e0e0e0;
  min-width: 16px;
  border-radius: 2px;
}

.arrow-track-line.done    { background: #43a047; }
.arrow-track-line.partial-line { background: #1e88e5; }

/* Overdue days row */
.arrow-overdue-row {
  display: flex;
  margin-bottom: 4px;
}

.arrow-overdue-cell {
  flex: 1;
  text-align: center;
  min-height: 16px;
}

.arrow-overdue-text {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--danger);
  white-space: nowrap;
}

/* Arrow chevrons row */
.arrow-chevron-row {
  display: flex;
  gap: 3px;
  margin-bottom: 6px;
}

.arrow-chevron {
  flex: 1;
  position: relative;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9e9e9e;
  background: #e0e0e0;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%);
  transition: background 0.3s ease;
}

.arrow-chevron:first-child {
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%);
  border-radius: 6px 0 0 6px;
}

.arrow-chevron:last-child {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 12px 50%);
  border-radius: 0 6px 6px 0;
}

.arrow-chevron.upcoming  { background: #e0e0e0; color: #9e9e9e; }
.arrow-chevron.paid      { background: linear-gradient(135deg, #66bb6a, #43a047); color: white; }
.arrow-chevron.partial   { background: linear-gradient(135deg, #42a5f5, #1e88e5); color: white; }
.arrow-chevron.overdue   { background: linear-gradient(135deg, #ef5350, #d32f2f); color: white; }

.arrow-chevron-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  position: relative;
  z-index: 1;
}

/* Label row below arrows */
.arrow-label-row {
  display: flex;
  gap: 3px;
}

.arrow-label-cell {
  flex: 1;
  text-align: center;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.3;
}

.arrow-label-cell.paid    { color: #43a047; }
.arrow-label-cell.partial { color: #1e88e5; }
.arrow-label-cell.overdue { color: #d32f2f; }

/* Stat value danger variant (red when due > 0) */
.stat-value.stat-danger {
  color: var(--danger);
}

/* ── Request/Complaint Status Tracker ── */
.status-tracker { margin-top: 8px; }

.status-tracker-empty {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.status-tracker-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255,255,255,0.6);
  border-radius: 12px;
  margin-bottom: 8px;
  border: 1px solid rgba(0,0,0,0.05);
}

.status-tracker-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}

.status-tracker-icon.pending     { background: rgba(255,152,0,0.12); }
.status-tracker-icon.resolved    { background: rgba(76,175,80,0.12); }
.status-tracker-icon.in-progress { background: rgba(33,150,243,0.12); }

.status-tracker-info { flex: 1; min-width: 0; }

.status-tracker-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.status-tracker-date {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.status-tracker-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 50px;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-tracker-badge.pending     { background: rgba(255,152,0,0.12); color: #e65100; }
.status-tracker-badge.resolved    { background: rgba(76,175,80,0.12); color: #2e7d32; }
.status-tracker-badge.in-progress { background: rgba(33,150,243,0.12); color: #1565c0; }

@media (max-width: 480px) {
  .arrow-chevron { height: 34px; }
  .arrow-chevron-label { font-size: 0.62rem; }
  .arrow-label-cell { font-size: 0.55rem; }
  .arrow-track-step { width: 24px; height: 24px; font-size: 0.65rem; }
  .arrow-overdue-text { font-size: 0.52rem; }
}

/* ============================================================
   STATS ROW
   ============================================================ */

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  text-align: center;
  padding: 16px 12px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============================================================
   TABLE
   ============================================================ */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 16px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table th {
  text-align: start;
  padding: 10px 12px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid rgba(0, 0, 0, 0.08);
  white-space: nowrap;
  font-size: 0.8rem;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: rgba(46, 125, 50, 0.03);
}

/* Status badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-paid {
  background: rgba(56, 142, 60, 0.12);
  color: var(--success);
}

.badge-unpaid {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-muted);
}

.badge-overdue {
  background: rgba(211, 47, 47, 0.1);
  color: var(--danger);
}

.badge-pending {
  background: rgba(255, 152, 0, 0.1);
  color: var(--warning);
}

.badge-resolved {
  background: rgba(56, 142, 60, 0.1);
  color: var(--success);
}

.badge-in-progress {
  background: rgba(25, 118, 210, 0.1);
  color: var(--info);
}

/* ============================================================
   SEARCH & FILTER BAR
   ============================================================ */

.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 180px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  font-size: 0.9rem;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color var(--transition);
}
.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.filter-select {
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  font-size: 0.85rem;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ============================================================
   NOTIFICATION PANEL
   ============================================================ */

.notif-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 89;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.notif-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.notif-panel {
  position: fixed;
  top: var(--header-height);
  bottom: var(--nav-height);
  width: 320px;
  max-width: 85vw;
  z-index: 90;
  overflow-y: auto;
  padding: 16px;
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-left: 1px solid var(--glass-border);
  transition: transform 0.3s ease;
}

/* RTL: panel on right */
[dir="rtl"] .notif-panel {
  right: 0;
  left: auto;
  transform: translateX(110%);
  border-left: none;
  border-right: 1px solid var(--glass-border);
}

/* LTR: panel on right */
[dir="ltr"] .notif-panel {
  right: 0;
  left: auto;
  transform: translateX(110%);
}

.notif-panel.open {
  transform: translateX(0) !important;
}

.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.notif-panel-title {
  font-size: 1rem;
  font-weight: 700;
}

.notif-close-btn {
  background: transparent;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 50%;
  transition: background var(--transition);
}
.notif-close-btn:hover { background: rgba(0, 0, 0, 0.06); }

.notif-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notif-item {
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.notif-item-title {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.notif-item-body {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.notif-item-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.notif-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  padding: 40px 0;
}

/* ============================================================
   DOCUMENT LINKS
   ============================================================ */

.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.doc-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  transition: all var(--transition);
  text-decoration: none;
  color: inherit;
}
.doc-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  text-decoration: none;
}

.doc-link-icon {
  font-size: 1.5rem;
}

.doc-link-text {
  font-size: 0.9rem;
  font-weight: 600;
}

/* ============================================================
   FORM EMBED (IFRAME)
   ============================================================ */

.form-embed {
  width: 100%;
  min-height: 500px;
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.5);
}

/* ============================================================
   DONUT CHART (Syndic/Admin)
   ============================================================ */

.donut-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.donut-svg {
  width: 140px;
  height: 140px;
}

.donut-legend {
  font-size: 0.85rem;
}

.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.donut-legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* ============================================================
   LOADING & EMPTY STATES
   ============================================================ */

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(0, 0, 0, 0.08);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
  opacity: 0.5;
}

.empty-state-text {
  font-size: 0.9rem;
}

.no-data-msg {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  padding: 20px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
  .landing-title { font-size: 1.4rem; }
  .landing-project-logo { width: 80px; height: 80px; }
  .role-list { max-width: 100%; }
  .role-card { padding: 14px 16px; }

  .dash-main { padding-left: 12px; padding-right: 12px; }

  .stats-row { grid-template-columns: repeat(2, 1fr); }

  .header-project-name { font-size: 0.88rem; }
  .header-logout-btn span.fr-only,
  .header-logout-btn span.ar-only { display: none !important; }
}

@media (max-width: 480px) {
  .landing-page { padding: 24px 16px; }
  .login-card { padding: 28px 20px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .doc-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */

.hidden { display: none !important; }
.text-center { text-align: center; }
.text-start { text-align: start; }
.text-primary { color: var(--primary); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
