/* ============================================================
   DAWATI — Global Design System
   RTL-first | Dark gold theme | Arabic primary | Hebrew admin
   Pattern: RentManager §14 (CSS custom properties + viewEnterBase)
   ============================================================ */

/* ── Google Fonts — Noto Sans Arabic ──────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@300;400;500;600;700&family=Rubik:wght@300;400;500;600;700&display=swap');

/* ── Western Numeral Override ──────────────────────────────
   Noto Sans Arabic substitutes digits (0-9) with Arabic-Indic
   forms (٠١٢٣) via the 'locl' OpenType feature when lang="ar".
   This @font-face intercepts U+0030-0039 (ASCII digits) and
   routes them through a system font that never substitutes them.
   ─────────────────────────────────────────────────────────── */
@font-face {
  font-family: 'Dawati-Numerals';
  src: local('Arial'), local('Helvetica Neue'), local('Helvetica'), local('Segoe UI');
  unicode-range: U+0030-0039, U+002E, U+002C, U+0025, U+002B, U+002D;
}

/* ── CSS Custom Properties ────────────────────────────────── */
:root {
  /* Brand (Deep Emerald Green) */
  --primary:        #125B50;
  --primary-rgb:    18, 91, 80;
  --primary-dark:   #0D423A;
  --primary-light:  #E8F2F0;
  --primary-ring:   rgba(18, 91, 80, 0.25);

  /* Brand Accents (Gold) */
  --accent-gold:    #C9A84C;
  --accent-gold-dark: #A07830;
  --accent-gold-bg: rgba(201, 168, 76, 0.12);

  /* Surfaces (Light Premium) */
  --bg:             #FDFCF9; /* Clean Ivory */
  --surface:        #FFFFFF; /* Pure White */
  --surface-2:      #F7F9F8; /* Soft emerald/grey tint */
  --surface-3:      #EEF2F0;
  --border:         rgba(18, 91, 80, 0.12);
  --border-strong:  rgba(18, 91, 80, 0.25);
  --border-color:   var(--border); /* alias — used in inline styles & standalone pages */

  /* Text */
  --text:           #125B50; /* Deep Emerald Green */
  --text-muted:     #6C757D; /* Warm Grey */
  --text-dim:       #333333; /* Deep Gray */
  --text-inverse:   #FFFFFF;

  /* Semantic */
  --success:        #2E7D32;
  --success-bg:     rgba(46, 125, 50, 0.12);
  --warning:        #ED6C02;
  --warning-bg:     rgba(237, 108, 2, 0.12);
  --error:          #D32F2F;
  --error-bg:       rgba(211, 47, 47, 0.12);
  --info:           #0288D1;
  --info-bg:        rgba(2, 136, 209, 0.12);

  /* Danger alias (consistent with RentManager) */
  --danger:         var(--error);
  --danger-bg:      var(--error-bg);

  /* Shadows (Glassmorphism & Depth) */
  --shadow-sm:      0 2px 8px rgba(18, 91, 80, 0.05);
  --shadow-md:      0 4px 16px rgba(18, 91, 80, 0.08);
  --shadow-lg:      0 12px 32px rgba(18, 91, 80, 0.1);
  --shadow-premium: 0 4px 24px rgba(18, 91, 80, 0.06), 0 1px 3px rgba(18, 91, 80, 0.04);

  /* Radius */
  --radius-sm:      6px;
  --radius:         10px;
  --radius-lg:      16px;
  --radius-xl:      24px;

  /* Spacing */
  --sidebar-w:      240px;
  --topbar-h:       60px;

  /* Transitions */
  --transition:     150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-md:  220ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  direction: rtl;
  scroll-behavior: smooth;
  /* Prevent iOS/Android from adjusting font sizes on orientation change */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: 'Dawati-Numerals', 'Noto Sans Arabic', 'Rubik', 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh; /* Dynamic viewport height: accounts for collapsible browser bars */
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Remove tap flash on all interactive elements ─────────── */
*, *::before, *::after {
  -webkit-tap-highlight-color: transparent;
}

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar              { width: 6px; height: 6px; }
::-webkit-scrollbar-track        { background: var(--surface); }
::-webkit-scrollbar-thumb        { background: var(--surface-3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover  { background: var(--primary-dark); }

/* ── Selection ────────────────────────────────────────────── */
::selection { background: var(--primary-ring); color: var(--text); }

/* ── View Transition (RentManager canonical: viewEnterBase) ─ */
@keyframes viewEnterBase {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Loading dots (SweetAlert2 loading modal) ─────────────── */
@keyframes swalDot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40%            { transform: scale(1);   opacity: 1; }
}

/* ============================================================
   APP LAYOUT
   ============================================================ */

#app-shell {
  display: flex;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* ── Sidebar ──────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  height: 100dvh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  right: 0;
  z-index: 100;
  transition: transform var(--transition-md);
  overflow: hidden;
}

#sidebar-header {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

#sidebar-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
}

#sidebar-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.5px;
}

#sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.nav-section-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px 16px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  margin: 1px 8px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  border: none;
  background: none;
  width: calc(100% - 16px);
  text-align: right;
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  border-right: 3px solid var(--accent-gold);
}

.nav-item .nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-badge {
  margin-right: auto;
  background: var(--error);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

#sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}

/* ── Main content ─────────────────────────────────────────── */
#main-content {
  flex: 1;
  margin-right: var(--sidebar-w);
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transition: margin var(--transition-md);
}

/* ── Top bar ──────────────────────────────────────────────── */
#topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 90;
}

#topbar-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

#topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

#topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-ring);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
}

/* ── Page content area ────────────────────────────────────── */
#page-content {
  flex: 1;
  padding: 24px;
  max-width: 1200px;
  width: 100%;
}

/* ============================================================
   VIEW SYSTEM — Role-gated SPA sections
   ============================================================ */

.view {
  display: none !important;
  flex-direction: column;
  gap: 20px;
  animation: viewEnterBase 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Login view — always accessible (no role needed) */
#view-login {
  display: block !important;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0;
  background: none;
  position: relative;
  overflow: hidden;
}

/* When a role is set, login hides */
body[data-role] #view-login { display: none !important; }

/* Login state: remove app-shell constraints so split fills viewport */
body:not([data-role]) #main-content { margin-right: 0; }
body:not([data-role]) #page-content  { padding: 0; max-width: none; }

/* Super Admin views */
body[data-role="superAdmin"] #view-sa-dashboard.active,
body[data-role="superAdmin"] #view-sa-events.active,
body[data-role="superAdmin"] #view-sa-venues.active,
body[data-role="superAdmin"] #view-sa-templates.active,
body[data-role="superAdmin"] #view-sa-themes.active,
body[data-role="superAdmin"] #view-sa-notifications.active,
body[data-role="superAdmin"] #view-sa-settings.active,
body[data-role="superAdmin"] #view-sa-whatsapp.active,
body[data-role="superAdmin"] #view-sa-packages.active,
body[data-role="superAdmin"] #view-sa-registrations.active { display: flex !important; }

/* Groom views */
body[data-role="groom"] #view-groom-dashboard.active,
body[data-role="groom"] #view-groom-collaborators.active,
body[data-role="groom"] #view-groom-verified.active,
body[data-role="groom"] #view-groom-settings.active { display: flex !important; }

/* Collaborator + Partner (venue) views — both use data-role="collaborator" */
body[data-role="collaborator"] #view-collab.active,
body[data-role="collaborator"] #view-partner-import.active,
body[data-role="collaborator"] #view-partner-pending.active { display: flex !important; }

/* Sidebar: show only when authenticated */
#sidebar { display: none; }
body[data-role] #sidebar { display: flex; }

/* ── Role-gated navigation sections ──────────────────────────
   ALL nav groups are hidden by default.
   Only the group matching the authenticated role is shown.
   This is the fix for "all users see all menus" bug.
   ─────────────────────────────────────────────────────────── */
.sa-nav, .groom-nav, .collab-nav { display: none; }

body[data-role="superAdmin"]   .sa-nav    { display: block; }
body[data-role="groom"]        .groom-nav { display: block; }
body[data-role="collaborator"] .collab-nav { display: block; }

/* Topbar: show only when authenticated */
#topbar { display: none; }
body[data-role] #topbar { display: flex; }

/* ============================================================
   COMPONENTS
   ============================================================ */

/* ── Card ─────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Stats box ────────────────────────────────────────────── */
.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.stat-box:hover { box-shadow: var(--shadow-md); }

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.stat-sub {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  min-height: 44px; /* Apple HIG touch target */
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  outline: none;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--primary);
  color: var(--text-inverse);
}
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); box-shadow: 0 4px 16px var(--primary-ring); }

.btn-secondary {
  background: var(--surface);
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-secondary:hover:not(:disabled) { background: var(--primary-light); }

.btn-danger {
  background: var(--error);
  color: #fff;
}
.btn-danger:hover:not(:disabled) { background: #c62828; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }

.btn-sm { padding: 6px 12px; min-height: 32px; font-size: 0.82rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 28px; min-height: 52px; font-size: 1rem; border-radius: var(--radius-lg); }

.btn-icon {
  padding: 8px;
  min-height: 36px;
  min-width: 36px;
  border-radius: var(--radius-sm);
}

/* ── Form inputs ──────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-label .required { color: var(--error); margin-right: 2px; }

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  min-height: 44px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  direction: rtl;
}

.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-dim); }

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.form-input.is-error,
.form-select.is-error { border-color: var(--error); }

.form-error {
  font-size: 0.78rem;
  color: var(--error);
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-textarea { min-height: 90px; resize: vertical; line-height: 1.5; }

.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239A8A6A' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 12px center; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* ── Checkbox / Toggle ────────────────────────────────────── */
.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-muted);
  min-height: 44px;
}

.form-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Table ────────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

thead { background: var(--surface-2); }

th {
  padding: 12px 16px;
  text-align: right;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
  overflow-wrap: break-word;
}

tbody tr:last-child td { border-bottom: none; }

tbody tr:hover { background: var(--surface-2); }

.table-empty {
  text-align: center;
  padding: 40px;
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* ── Badges / Status ─────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-success  { background: var(--success-bg);  color: var(--success); }
.badge-warning  { background: var(--warning-bg);  color: var(--warning); }
.badge-error    { background: var(--error-bg);    color: var(--error); }
.badge-info     { background: var(--info-bg);     color: var(--info); }
.badge-muted    { background: var(--surface-2);   color: var(--text-muted); }
.badge-gold     { background: var(--accent-gold-bg); color: var(--accent-gold-dark); }

/* Event status badges */
.status-draft    { background: var(--surface-3); color: var(--text-muted); }
.status-active   { background: var(--info-bg);    color: var(--info); }
.status-launched { background: var(--accent-gold-bg); color: var(--accent-gold-dark); }
.status-locked   { background: var(--error-bg);   color: var(--error); }
.status-deleted  { background: var(--surface-2);  color: var(--text-dim); }

/* ── Modal backdrop ───────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-premium);
  animation: viewEnterBase 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-lg  { max-width: 760px; }
.modal-sm  { max-width: 400px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-body    { padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.modal-footer  { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition);
}
.btn-close:hover { color: var(--text); }

/* ── Page header ──────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.page-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.page-actions { display: flex; gap: 8px; align-items: center; }

/* ── Search / filter bar ──────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-input-wrap .search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
  width: 16px;
  height: 16px;
}

.search-input-wrap .form-input { padding-right: 36px; }

/* ── Divider ──────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

/* ── Empty state ──────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 12px;
  color: var(--text-dim);
  text-align: center;
}

.empty-state-icon { opacity: 0.4; color: var(--text-muted); }
.empty-state h3   { font-size: 1rem; color: var(--text-muted); font-weight: 600; }
.empty-state p    { font-size: 0.85rem; max-width: 300px; }

/* ── Spinner ──────────────────────────────────────────────── */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin  { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ── Notification bell badge ──────────────────────────────── */
.notif-badge {
  position: absolute;
  top: -4px;
  left: -4px;
  width: 18px;
  height: 18px;
  background: var(--error);
  color: #fff;
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Tag chips (reminder days) ────────────────────────────── */
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tag .tag-remove {
  cursor: pointer;
  color: var(--text-dim);
  padding: 1px;
  border-radius: 50%;
  display: flex;
  align-items: center;
}

.tag .tag-remove:hover { color: var(--error); }

/* ── WhatsApp colors ──────────────────────────────────────── */
.btn-whatsapp { background: #25D366; color: #fff; }
.btn-whatsapp:hover:not(:disabled) { background: #1ea855; }

/* ── Gender selector (3 + neutral) ───────────────────────── */
.gender-btn-group { display: flex; gap: 6px; }

.gender-btn {
  flex: 1;
  padding: 8px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  transition: all var(--transition);
}

.gender-btn:hover { border-color: var(--primary); color: var(--text); }
.gender-btn.active { background: rgba(201,168,76,0.15); border-color: var(--primary); color: var(--primary); }

/* ── Alert bar (inline) ───────────────────────────────────── */
.alert-bar {
  padding: 12px 16px;
  border-radius: var(--radius);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.alert-bar-warning { background: var(--warning-bg); border: 1px solid rgba(255,152,0,0.2); color: var(--warning); }
.alert-bar-error   { background: var(--error-bg);   border: 1px solid rgba(244,67,54,0.2); color: var(--error); }
.alert-bar-success { background: var(--success-bg); border: 1px solid rgba(76,175,80,0.2); color: var(--success); }
.alert-bar-info    { background: var(--info-bg);    border: 1px solid rgba(33,150,243,0.2); color: var(--info); }

/* ── Progress bar ─────────────────────────────────────────── */
.progress-bar {
  height: 8px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-dark), var(--primary));
  border-radius: 4px;
  transition: width 600ms ease;
}

/* ── Pagination ───────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  padding: 12px 0;
}

.pagination .btn { min-width: 36px; }

/* ── Login page — full rebuild ────────────────────────────── */

/* ── Ambient glow blobs (VS-SHIFT_APP pattern adapted to DAWATI emerald palette) */
.login-blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(90px);
  z-index: 0;
}
.login-blob-1 {
  width: 55vmin; height: 55vmin;
  background: rgba(18, 91, 80, 0.18);   /* deep emerald */
  top: -15%; left: -10%;
}
.login-blob-2 {
  width: 65vmin; height: 65vmin;
  background: rgba(201, 168, 76, 0.12); /* gold */
  bottom: -20%; right: -15%;
}
.login-blob-3 {
  width: 40vmin; height: 40vmin;
  background: rgba(18, 91, 80, 0.1);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}

/* ── Language toggle bar (top corner, RTL: top-left) */
.login-lang-bar {
  position: absolute;
  top: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 10;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
}
.lang-sep {
  color: var(--border-strong);
  font-size: 0.75rem;
  user-select: none;
}
.lang-pill {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 10px;
  transition: color var(--transition);
}
html[lang="ar"] .lang-pill[data-lang="ar"],
html[lang="he"] .lang-pill[data-lang="he"] {
  color: var(--primary);
}

/* ── Glass login card */
.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 28px;
  padding: 36px 32px 32px;
  box-shadow: 0 20px 60px rgba(18, 91, 80, 0.12), 0 4px 16px rgba(18, 91, 80, 0.06);
  display: flex;
  flex-direction: column;
  gap: 22px;
  animation: loginCardEnter 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes loginCardEnter {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Logo section */
.login-logo {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.login-logo-img {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(18, 91, 80, 0.2);
  object-fit: cover;
}
.login-logo .logo-text {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 3px;
  line-height: 1;
}
.login-logo .logo-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

/* ── Tab switcher */
.login-tab-bar {
  display: flex;
  background: var(--surface-2);
  border-radius: 14px;
  padding: 4px;
  gap: 2px;
}
.login-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 2px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.70rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 10px;
  transition: all var(--transition);
  font-family: inherit;
  white-space: normal;
  line-height: 1.1;
  text-align: center;
}
.login-tab-icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}
.login-tab.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(18, 91, 80, 0.12);
}
.login-tab:not(.active):hover { color: var(--primary); background: rgba(18,91,80,0.05); }

/* ── Form body */
.login-form-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Input with icon */
.input-with-icon {
  position: relative;
}
.input-icon {
  position: absolute;
  top: 50%;
  right: 13px;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
  flex-shrink: 0;
}
.form-input.has-icon {
  padding-right: 40px;
}

/* ── Form hint text */
.form-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 4px;
  padding-right: 2px;
}

/* ── Login submit button (gradient emerald) */
.btn-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 13px 20px;
  background: linear-gradient(135deg, var(--primary) 0%, #1a7a6a 100%);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(18, 91, 80, 0.30);
  transition: all var(--transition-md);
  margin-top: 4px;
}
.btn-login:hover {
  box-shadow: 0 10px 28px rgba(18, 91, 80, 0.38);
  transform: translateY(-1px);
}
.btn-login:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 4px 12px rgba(18, 91, 80, 0.25);
}

/* ── Topbar language toggle */
.topbar-lang-toggle {
  display: flex;
  gap: 3px;
  margin-left: 12px;
  margin-right: 12px;
}
.topbar-lang-toggle .lang-pill-sm {
  padding: 4px 10px;
  font-size: 0.72rem;
}

/* ── Sidebar language toggle */
.sidebar-lang-toggle {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}
.lang-pill-sm {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  padding: 5px 8px;
  text-align: center;
  transition: all var(--transition);
}
html[lang="ar"] .lang-pill-sm[data-lang="ar"],
html[lang="he"] .lang-pill-sm[data-lang="he"] {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-ring);
}

/* ── SweetAlert2 overrides — dark gold theme ─────────────── */
.swal2-popup.swal-popup {
  background: var(--surface) !important;
  color: var(--text) !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: var(--radius-xl) !important;
  box-shadow: var(--shadow-premium) !important;
  font-family: 'Dawati-Numerals', 'Noto Sans Arabic', sans-serif !important;
}

.swal2-popup.swal-popup .swal2-title { color: var(--text) !important; font-size: 1.05rem !important; font-weight: 700 !important; }
.swal2-popup.swal-popup .swal2-html-container { color: var(--text-muted) !important; font-size: 0.9rem !important; }
.swal2-popup.swal-popup .swal2-icon { border: none !important; margin: 12px auto 4px !important; }

/* ── Utility classes ──────────────────────────────────────── */
.d-flex         { display: flex; }
.d-none         { display: none !important; }
.align-center   { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8          { gap: 8px; }
.gap-12         { gap: 12px; }
.gap-16         { gap: 16px; }
.mt-4           { margin-top: 4px; }
.mt-8           { margin-top: 8px; }
.mt-16          { margin-top: 16px; }
.mt-24          { margin-top: 24px; }
.text-muted     { color: var(--text-muted); }
.text-primary   { color: var(--primary); }
.text-error     { color: var(--error); }
.text-success   { color: var(--success); }
.text-sm        { font-size: 0.82rem; }
.text-xs        { font-size: 0.75rem; }
.fw-600         { font-weight: 600; }
.fw-700         { font-weight: 700; }
.w-full         { width: 100%; }
.relative       { position: relative; }
.truncate       { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  #sidebar {
    width: 280px;
    overflow: hidden;
    transform: translateX(100%);
    box-shadow: var(--shadow-lg);
  }

  #sidebar.open { transform: translateX(0); }

  #main-content { margin-right: 0; }

  #page-content { padding: 16px; }

  .form-grid-2,
  .form-grid-3  { grid-template-columns: 1fr; }

  .modal        { margin: 8px; max-width: calc(100vw - 16px); }

  .stats-grid   { grid-template-columns: repeat(2, 1fr); }

  /* ── Mobile Card Tables ────────────────────────── */
  .table-wrapper { border: none; background: transparent; }
  table { width: 100%; display: block; border: none; font-size: 0.85rem; }
  thead { display: none; }
  tbody { display: block; width: 100%; }
  
  tr {
    display: block;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    padding: 8px 0;
  }
  
  td {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 8px 16px;
    border-bottom: 1px solid var(--surface-2);
    text-align: right;
    min-height: 40px;
  }
  
  td:last-child { border-bottom: none; }
  
  td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-left: auto; /* Pushes content to the left while label stays right in RTL */
    padding-left: 12px;
  }
}

@media (max-width: 480px) {
  .stats-grid  { grid-template-columns: 1fr; }
  .login-card  { padding: 24px 20px; }
  .page-title  { font-size: 1.1rem; }
}

/* ============================================================
   SPLIT-SCREEN LOGIN — Phase 11 Premium Rebuild
   Desktop: hero panel (right, RTL) + form panel (left, RTL)
   Mobile:  single column, gradient background, glass card feel
   ============================================================ */

/* Main 2-column split */
.login-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ── HERO PANEL ─────────────────────────────────────────── */
.login-hero {
  background: linear-gradient(160deg, #0a3d34 0%, #125B50 45%, #0c4840 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 52px;
}

/* Ambient glow blobs inside hero */
.hero-blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.hero-blob-1 {
  width: 340px; height: 340px;
  background: rgba(201, 168, 76, 0.18);
  filter: blur(90px);
  top: -100px; right: -80px;
}
.hero-blob-2 {
  width: 280px; height: 280px;
  background: rgba(255, 255, 255, 0.05);
  filter: blur(70px);
  bottom: -80px; left: -60px;
}
.hero-blob-3 {
  width: 220px; height: 220px;
  background: rgba(201, 168, 76, 0.07);
  filter: blur(60px);
  top: 50%; left: 35%;
  transform: translate(-50%, -50%);
}

/* Subtle dot-grid overlay */
.hero-lattice {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.055) 1px, transparent 1px);
  background-size: 26px 26px;
  pointer-events: none;
}

/* Content wrapper inside hero */
.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end; /* RTL: align to right */
  gap: 28px;
  width: 100%;
  max-width: 400px;
  direction: rtl;
  text-align: right;
}

/* Logo brand cluster */
.hero-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.hero-logo-img {
  width: 68px; height: 68px;
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.12);
  object-fit: cover;
  flex-shrink: 0;
}
.hero-logo-name {
  font-size: 2.1rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 5px;
  line-height: 1;
}
.hero-logo-ar {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
  letter-spacing: 1px;
  margin-top: 4px;
}

/* Gold accent divider */
.hero-divider {
  width: 52px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
  border-radius: 1px;
  opacity: 0.75;
  align-self: flex-end;
}

/* Arabic quote */
.hero-quote {
  border: none;
  margin: 0; padding: 0;
}
.hero-quote p {
  font-size: 1.3rem;
  font-weight: 600;
  color: rgba(255,255,255,0.88);
  line-height: 1.7;
  font-style: italic;
}

/* Feature pills */
.hero-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.hero-feature-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 13px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 20px;
  color: rgba(255,255,255,0.72);
  font-size: 0.77rem;
  font-weight: 500;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Copyright footer */
.hero-footer {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.28);
  letter-spacing: 0.3px;
  margin-top: 20px;
}

/* ── FORM PANEL ─────────────────────────────────────────── */
.login-form-panel {
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0 52px 52px;
  overflow-y: auto;
  direction: rtl;
}

/* Top bar: lang capsule */
.form-panel-topbar {
  display: flex;
  align-items: center;
  padding-top: 28px;
  margin-bottom: 40px;
}

/* ── Capsule lang toggle */
.lang-capsule {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 3px;
  direction: ltr; /* always LTR so AR left, HE right */
  user-select: none;
  cursor: pointer;
}
.lang-capsule-slider {
  position: absolute;
  top: 3px; bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 1px 6px rgba(18, 91, 80, 0.15);
  transition: transform 220ms cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(0);
  z-index: 0;
  pointer-events: none;
}
/* Slide right when Hebrew active */
html[lang="he"] .lang-capsule-slider {
  transform: translateX(100%);
}
.lang-cap-btn {
  position: relative;
  z-index: 1;
  flex: 1;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.79rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  padding: 5px 16px;
  border-radius: 18px;
  transition: color 150ms;
  white-space: nowrap;
}
html[lang="ar"] .lang-cap-btn[data-lang="ar"],
html[lang="he"] .lang-cap-btn[data-lang="he"] {
  color: var(--primary);
}

/* Mobile-only brand logo (hidden desktop) */
.login-logo-mobile {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 28px;
  width: 100%;
}
.login-logo-img-sm {
  width: 120px; height: 120px;
  border-radius: 24px;
  object-fit: cover;
  box-shadow: 0 12px 40px rgba(18, 91, 80, 0.25), 0 0 0 1px rgba(18,91,80,0.1);
}
.login-logo-wordmark {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 6px;
  text-align: center;
}
.logo-text-sm {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 3px;
}

/* Greeting heading */
.login-greeting { margin-bottom: 28px; }
.login-greeting-title {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.15;
  margin-bottom: 7px;
}
.login-greeting-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* ── Tab track with sliding indicator */
/* Override old .login-tab-bar (wrapper now transparent — track handles styling) */
.login-form-panel .login-tab-bar {
  background: none;
  padding: 0;
  border-radius: 0;
  gap: 0;
}
.login-tab-track {
  position: relative;
  display: flex;
  background: var(--surface-2);
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 24px;
}
.login-tab-indicator {
  position: absolute;
  top: 4px; bottom: 4px;
  /* width = 1/2 of track minus padding (2 tabs: groom + admin) */
  width: calc((100% - 8px) / 2);
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(18, 91, 80, 0.12);
  /* Initial position: groom tab (index 0, rightmost in RTL) */
  /* JS sets translateX via inline style */
  right: 4px;
  transition: transform 220ms cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
  pointer-events: none;
}
/* Tab buttons inside track */
.login-tab-track .login-tab {
  position: relative;
  z-index: 1;
  background: none;
  box-shadow: none;
}
.login-tab-track .login-tab.active {
  background: none;
  box-shadow: none;
  color: var(--primary);
}

/* ── Floating Label Inputs */
.float-group {
  position: relative;
  display: flex;
  flex-direction: column;
}
.float-input {
  width: 100%;
  height: 54px;
  padding: 20px 44px 6px 14px; /* top for floated label, right for icon */
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  direction: rtl;
}
.float-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
  background: #fff;
}
/* Floating label: starts centered, flies up on focus/filled */
.float-label {
  position: absolute;
  top: 50%;
  right: 44px; /* leave room for the icon on the right */
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  pointer-events: none;
  transition: top 180ms cubic-bezier(0.4, 0, 0.2, 1),
              transform 180ms cubic-bezier(0.4, 0, 0.2, 1),
              font-size 180ms,
              color 180ms;
  transform-origin: right top;
  white-space: nowrap;
}
.float-input:focus + .float-label,
.float-input:not(:placeholder-shown) + .float-label {
  top: 3px;
  transform: translateY(0) scale(0.76);
  color: var(--primary);
}
/* Icon inside float group */
.float-icon {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  width: 17px; height: 17px;
  color: var(--text-muted);
  pointer-events: none;
  flex-shrink: 0;
}
/* Code input — uppercase, letter-spacing, LTR */
.float-input.code-input {
  letter-spacing: 2.5px;
  font-weight: 600;
  text-transform: uppercase;
  direction: ltr;
  text-align: right;
}

/* Login form container */
.login-form { flex: 1; display: flex; flex-direction: column; width: 100%; }
.login-form-body { display: flex; flex-direction: column; gap: 16px; }

/* ── Responsive: ≤ 900px — single column mobile layout ─── */
@media (max-width: 900px) {
  .login-split {
    grid-template-columns: 1fr;
  }
  .login-hero {
    display: none; /* Full hero hidden on mobile */
  }
  .login-form-panel {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0 24px 44px;
    background: linear-gradient(160deg, #e8f2ef 0%, #f7faf9 35%, #fff 100%);
    /* ── CENTERED LAYOUT on narrow screens ── */
    align-items: center;
  }

  /* Lang capsule — centered at top */
  .form-panel-topbar {
    padding-top: 22px;
    margin-bottom: 28px;
    width: 100%;
    max-width: 440px;
    justify-content: center;
  }

  /* Mobile logo — centered */
  .login-logo-mobile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 440px;
    margin-bottom: 20px;
  }

  /* Greeting title — centered */
  .login-greeting {
    text-align: center;
    width: 100%;
    max-width: 440px;
  }
  .login-greeting-title { font-size: 1.55rem; }

  /* Tab track — full width with max-width cap */
  .login-form-panel .login-tab-bar,
  .login-tab-track {
    width: 100%;
    max-width: 440px;
  }

  /* Forms — full width, centered, capped */
  .login-form,
  .login-form-body {
    width: 100%;
    max-width: 440px;
  }
}

@media (max-width: 480px) {
  .login-form-panel { padding: 0 20px 36px; }
  .login-greeting-title { font-size: 1.35rem; }
  /* Increase top-padding so floated label (bottom ~14px) leaves ≥8px gap to typed text */
  .float-input { height: 56px; padding-top: 24px; }
  .lang-cap-btn { padding: 5px 12px; }
}

/* ============================================================
   GROOM DASHBOARD — Phase 11 Premium Components
   groom.html only. Apple-level glassmorphism + bottom nav.
   ============================================================ */

/* ── Auth Loading Overlay ─────────────────────────────────── */
.auth-loading-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(160deg, #0a3d34 0%, #125B50 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 300ms ease;
}
.auth-loading-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}
.auth-loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.auth-loading-logo {
  width: 72px; height: 72px;
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  animation: authLogoPulse 1.8s ease-in-out infinite;
}
@keyframes authLogoPulse {
  0%, 100% { transform: scale(1);    opacity: 1; }
  50%       { transform: scale(1.05); opacity: 0.85; }
}
.auth-loading-wordmark {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 5px;
  opacity: 0.9;
}
.auth-loading-spinner {
  width: 28px; height: 28px;
  border: 2.5px solid rgba(255,255,255,0.2);
  border-top-color: rgba(255,255,255,0.8);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ── User Avatar Circle ───────────────────────────────────── */
.user-avatar-circle {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  border: 2px solid var(--primary-ring);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
}
.user-avatar-sm { width: 30px; height: 30px; font-size: 0.78rem; }

/* ── Topbar event info (desktop only) ─────────────────────── */
.topbar-event-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}
.topbar-event-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
}
.topbar-view-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

/* ── Countdown Badge ─────────────────────────────────────── */
.countdown-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.countdown-badge.upcoming {
  background: rgba(18, 91, 80, 0.1);
  color: var(--primary);
  border: 1px solid var(--primary-ring);
}
.countdown-badge.today {
  background: var(--accent-gold-bg);
  color: var(--accent-gold-dark);
  border: 1px solid rgba(201,168,76,0.3);
}
.countdown-badge.past {
  background: var(--surface-3);
  color: var(--text-muted);
}

/* ── Event subtitle (below page header) ──────────────────── */
.groom-event-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ── Glassmorphism Stat Cards ─────────────────────────────── */
.groom-stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}

.stat-card-glass {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 20px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow: 0 4px 20px rgba(18,91,80,0.08), 0 1px 4px rgba(18,91,80,0.04);
  transition: transform var(--transition-md), box-shadow var(--transition-md);
  cursor: default;
}
.stat-card-glass:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(18,91,80,0.13), 0 2px 8px rgba(18,91,80,0.06);
}

/* Color variants */
.stat-glass-primary { background: linear-gradient(135deg, rgba(18,91,80,0.08) 0%, rgba(18,91,80,0.04) 100%); }
.stat-glass-success { background: linear-gradient(135deg, rgba(46,125,50,0.10) 0%, rgba(46,125,50,0.04) 100%); }
.stat-glass-error   { background: linear-gradient(135deg, rgba(211,47,47,0.09) 0%, rgba(211,47,47,0.04) 100%); }
.stat-glass-warning { background: linear-gradient(135deg, rgba(237,108,2,0.10) 0%, rgba(237,108,2,0.04) 100%); }
.stat-glass-gold    { background: linear-gradient(135deg, rgba(201,168,76,0.12) 0%, rgba(201,168,76,0.04) 100%); }

/* Icon wrapper */
.stat-glass-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  flex-shrink: 0;
}
.stat-glass-primary .stat-glass-icon { background: rgba(18,91,80,0.12);  color: var(--primary); }
.stat-glass-success .stat-glass-icon { background: rgba(46,125,50,0.12);  color: var(--success); }
.stat-glass-error   .stat-glass-icon { background: rgba(211,47,47,0.12);  color: var(--error); }
.stat-glass-warning .stat-glass-icon { background: rgba(237,108,2,0.12);  color: var(--warning); }
.stat-glass-gold    .stat-glass-icon { background: rgba(201,168,76,0.15); color: var(--accent-gold-dark); }

/* Value (big number) */
.stat-glass-val {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
  letter-spacing: -0.5px;
}
.stat-glass-primary .stat-glass-val { color: var(--primary-dark); }
.stat-glass-success .stat-glass-val { color: var(--success); }
.stat-glass-error   .stat-glass-val { color: var(--error); }
.stat-glass-warning .stat-glass-val { color: var(--warning); }
.stat-glass-gold    .stat-glass-val { color: var(--accent-gold-dark); }

/* Label */
.stat-glass-label {
  font-size: 0.77rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.2px;
}

/* Ambient glow behind card */
.stat-glass-glow {
  position: absolute;
  width: 80px; height: 80px;
  border-radius: 50%;
  bottom: -20px; left: -20px;
  filter: blur(28px);
  pointer-events: none;
  opacity: 0.5;
}
.stat-glass-primary .stat-glass-glow { background: rgba(18,91,80,0.25); }
.stat-glass-success .stat-glass-glow { background: rgba(46,125,50,0.25); }
.stat-glass-error   .stat-glass-glow { background: rgba(211,47,47,0.20); }
.stat-glass-warning .stat-glass-glow { background: rgba(237,108,2,0.20); }
.stat-glass-gold    .stat-glass-glow { background: rgba(201,168,76,0.25); }

/* ── Skeleton Loaders ─────────────────────────────────────── */
.skeleton-block { display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
.skeleton-line {
  height: 14px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  border-radius: 6px;
  animation: shimmer 1.4s ease-in-out infinite;
}
.skeleton-line.short { width: 55%; }
@keyframes shimmer {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}

/* ── Bottom Navigation Bar (iOS-style, mobile only) ──────── */
#groom-bottom-nav {
  display: none; /* hidden on desktop */
}

@media (max-width: 768px) {
  /* Push page content up so bottom nav doesn't cover it */
  .has-bottom-nav #page-content {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }

  #groom-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(60px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(18, 91, 80, 0.08);
    z-index: 150; /* above vertex-footer (z-index:100) */
    justify-content: space-around;
    align-items: stretch;
  }

  .bottom-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 4px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    transition: color var(--transition), transform var(--transition);
    -webkit-tap-highlight-color: transparent;
    border-radius: 0;
    min-height: 44px;
  }

  .bottom-nav-btn:active { transform: scale(0.92); }

  .bottom-nav-btn.active {
    color: var(--primary);
  }
  .bottom-nav-btn.active .bottom-nav-icon {
    filter: drop-shadow(0 0 4px rgba(18,91,80,0.3));
  }

  .bottom-nav-btn.bottom-nav-logout { color: var(--text-muted); }
  .bottom-nav-btn.bottom-nav-logout:active { color: var(--error); }

  .bottom-nav-icon {
    width: 22px; height: 22px;
    flex-shrink: 0;
    transition: transform var(--transition);
  }
  .bottom-nav-btn.active .bottom-nav-icon { transform: translateY(-1px); }

  .bottom-nav-label {
    line-height: 1;
    text-align: center;
    white-space: nowrap;
  }

  /* Hide desktop topbar elements on mobile */
  .topbar-event-info { display: none !important; }
  .btn-label-desktop { display: none; }
}

/* ── Sidebar hamburger: hidden on desktop, shown on mobile ── */
#btn-sidebar-toggle { display: none; }
@media (max-width: 768px) {
  #btn-sidebar-toggle { display: flex; }
}

/* ── Groom view-specific CSS fix ─────────────────────────── */
/* On groom.html, groom-nav is always-visible (no body[data-role] wait needed
   in CSS since setAppRole is called during auth). Keep the existing rule. */

/* ── Mobile: topbar view title (shown on small screens) ──── */
@media (max-width: 768px) {
  #topbar-title { display: block !important; }
}

/* ── Sidebar mobile open state + dim overlay ────────────── */
@media (max-width: 768px) {
  #sidebar {
    width: 280px;
    overflow: hidden;
    transform: translateX(100%); /* RTL: slides in from right */
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    position: fixed;
    top: 0; bottom: 0; right: 0;
    z-index: 200;
  }
  #sidebar.open {
    transform: translateX(0);
    box-shadow: -8px 0 32px rgba(0,0,0,0.25);
  }
  body.sidebar-open::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 199;
    animation: fadeIn 0.2s ease;
  }
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

  #main-content { margin-right: 0 !important; }
  .btn-label-desktop { display: none; }
}

/* ── Partner bottom nav (teal dark theme) ─────────────────── */
#partner-bottom-nav { display: none; }

@media (max-width: 768px) {
  #partner-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: calc(60px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(13,26,28,0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(13,115,119,0.25);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.22);
    z-index: 150; /* above vertex-footer (z-index:100) */
    justify-content: space-around;
    align-items: stretch;
  }
  #partner-bottom-nav .bottom-nav-btn       { color: rgba(255,255,255,0.45); }
  #partner-bottom-nav .bottom-nav-btn.active { color: #14BDAC; }
}

/* ── .form-control alias (legacy super-admin code) ───────── */
.form-control {
  width: 100%;
  padding: 10px 14px;
  min-height: 44px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  direction: rtl;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

/* ── .data-table alias (super-admin.js inline HTML) ─────── */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.data-table th {
  padding: 12px 16px; text-align: right; font-weight: 600;
  color: var(--text-muted); font-size: 0.78rem; text-transform: uppercase;
  letter-spacing: 0.05em; border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--surface-2); }

/* ── Btn semantic variants (super-admin.js inline HTML) ──── */
.btn-info    { background: var(--info);    color: #fff; }
.btn-info:hover:not(:disabled)    { background: #0278b8; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover:not(:disabled) { background: #d45900; }
.btn-error   { background: var(--error);   color: #fff; }
.btn-error:hover:not(:disabled)   { background: #c62828; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #1b5e20; }

/* ── Layout utilities ────────────────────────────────────── */
.w-full            { width: 100%; }
.btn-label-desktop { display: inline; }
.text-center       { text-align: center; }
.d-none            { display: none !important; }

/* ── Form error message (partner / groom modals) ─────────── */
.form-error-msg {
  font-size: 0.78rem;
  color: var(--error);
  padding: 6px 0;
}

/* ═══════════════════════════════════════════════════════════
   VERTEX FOOTER — Global branded strip
   Appears on every DAWATI portal page
   ═══════════════════════════════════════════════════════════ */
.vertex-footer {
  width: 100%;
  padding: 10px 20px;
  background: var(--primary);
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  z-index: 100;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.10);
}

.vertex-footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 1200px;
  margin: 0 auto;
}

.vertex-footer-logo {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  object-fit: contain;
  opacity: 0.92;
}

.vertex-footer-text {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.82);
  letter-spacing: 0.3px;
}

.vertex-footer-text strong {
  color: #ffffff;
  font-weight: 700;
}

/* Don't show global Vertex Footer on login view (it's in hero panel) */
#view-login.view.active ~ .vertex-footer,
body:not([data-role]) .vertex-footer {
  display: none;
}

/* Add bottom padding to main-content when footer is sticky */
#main-content {
  padding-bottom: 50px;
}

/* On venue.html, rsvp.html pages — footer inside screen container */
.screen .vertex-footer {
  position: relative;
  border-top: 1px solid var(--c-border, rgba(0,0,0,0.1));
  background: transparent;
  box-shadow: none;
  margin-top: 16px;
}

.screen .vertex-footer .vertex-footer-text {
  color: var(--c-muted, #9A8A6A);
}

/* ── Settings + Verified Guests View Extras ──────────────── */
#settings-completed-bar,
#settings-guests-bar {
  min-width: 4px;
}

#view-sa-settings .card-header { padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }

#verified-results .verified-result-item {
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  margin-bottom: 10px;
}

#verified-results .verified-result-item .result-name {
  font-weight: 600;
  font-size: 0.93rem;
  margin-bottom: 4px;
}

#verified-results .verified-result-item .result-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════
   CAMPAIGN STEPPER (Phase 11.19)
   3-step visual progress for groom campaign
   ═══════════════════════════════════════════════════════════ */
.campaign-stepper-wrap {
  padding: 16px;
}

.campaign-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  gap: 0;
}

.campaign-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
}

.step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 2px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.campaign-step.step-active .step-circle {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-ring);
  color: #fff;
  font-size: 0.85rem;
}

.campaign-step.step-done .step-circle {
  background: var(--success, #16A34A);
  border-color: var(--success, #16A34A);
  color: #fff;
  font-size: 0.85rem;
}

.step-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  text-align: center;
  max-width: 70px;
}

.campaign-step.step-active .step-label { color: var(--primary); font-weight: 600; }
.campaign-step.step-done  .step-label  { color: var(--success, #16A34A); }

.step-connector {
  flex: 1;
  height: 2px;
  background: var(--border-strong);
  min-width: 24px;
  max-width: 48px;
  margin-bottom: 22px;
  transition: background 0.3s ease;
}
.step-connector.connector-done { background: var(--success, #16A34A); }

/* Step panels */
.campaign-step-panel {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.campaign-step-panel.step-panel-dimmed {
  opacity: 0.5;
  pointer-events: none;
}

.step-panel-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 0.88rem;
}

.step-panel-body {
  padding: 14px;
}

/* ── Campaign test message: 2-col on desktop, 1-col on mobile ── */
.test-msg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
@media (max-width: 768px) {
  .test-msg-grid {
    grid-template-columns: 1fr;
  }
  .test-msg-radios {
    flex-wrap: wrap;
    row-gap: 6px;
  }
}

/* ── WhatsApp message preview bubble (campaign step 1) ── */
.wa-msg-preview {
  margin-bottom: 14px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(37,211,102,0.25);
  background: #f0fdf4;
}
.wa-preview-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #15803d;
  background: rgba(37,211,102,0.1);
  border-bottom: 1px solid rgba(37,211,102,0.2);
}
.wa-bubble {
  padding: 10px 12px 6px;
  background: #dcf8c6;
  border-radius: 0 8px 8px 8px;
  margin: 10px 12px 10px auto;
  max-width: 86%;
  width: fit-content;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12);
  direction: rtl;
}
.wa-bubble-text {
  font-size: 0.82rem;
  line-height: 1.55;
  color: #111;
  word-break: break-word;
  font-family: system-ui, sans-serif;
}
.wa-bubble-meta {
  text-align: left;
  font-size: 0.68rem;
  color: #667781;
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════
   STEP F — 11.34: FLOATING LABELS on form inputs
   ═══════════════════════════════════════════════════════════ */
.form-group-floating {
  position: relative;
  margin-bottom: 0;
}

.form-group-floating .form-input {
  padding-top: 20px;
  padding-bottom: 6px;
}

.form-label-floating {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  font-size: 0.85rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: all 0.2s ease;
  background: transparent;
}

.form-group-floating .form-input:focus ~ .form-label-floating,
.form-group-floating .form-input:not(:placeholder-shown) ~ .form-label-floating {
  top: 8px;
  transform: none;
  font-size: 0.68rem;
  color: var(--primary);
}

/* ═══════════════════════════════════════════════════════════
   STEP F — 11.32: BODY SCROLL LOCK
   Applied when a modal is open
   ═══════════════════════════════════════════════════════════ */
body.modal-open {
  overflow: hidden;
  /* On iOS, keep position to prevent bounce */
  position: fixed;
  width: 100%;
}

/* ═══════════════════════════════════════════════════════════
   STEP F — 11.33: SKELETON LOADERS
   Full-page and card-level skeleton states
   ═══════════════════════════════════════════════════════════ */
.skeleton-block {
  padding: 16px;
}

.skeleton-line {
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(90deg,
    var(--surface-3) 25%,
    var(--surface-2) 50%,
    var(--surface-3) 75%
  );
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  margin-bottom: 10px;
}

.skeleton-line.short { width: 60%; }
.skeleton-line.xshort { width: 35%; }

.skeleton-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-3);
  animation: skeleton-shimmer 1.4s ease infinite;
  background-size: 400% 100%;
}

.skeleton-card {
  background: var(--surface-2);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 12px;
}

@keyframes skeleton-shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Stat card skeleton */
.stat-card-glass.skeleton-loading .stat-glass-val {
  background: var(--surface-3);
  color: transparent;
  border-radius: 6px;
  animation: skeleton-shimmer 1.4s ease infinite;
  background-size: 400% 100%;
}

/* ═══════════════════════════════════════════════════════════
   STEP F — 11.35: PULL-TO-REFRESH
   Visual indicator for mobile pull gesture
   ═══════════════════════════════════════════════════════════ */
.ptr-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 0;
  overflow: hidden;
  transition: height 0.2s ease;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 500;
}

.ptr-indicator.ptr-visible { height: 48px; }

.ptr-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--primary-ring);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ═══════════════════════════════════════════════════════════
   STEP F — 11.36: SEARCH TERM HIGHLIGHTING
   ═══════════════════════════════════════════════════════════ */
mark.search-hl {
  background: rgba(201, 168, 76, 0.3);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

/* ═══════════════════════════════════════════════════════════
   PHASE 11.20 — EVENT SETTINGS INFO ROWS
   ═══════════════════════════════════════════════════════════ */
.settings-info-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.settings-info-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.settings-info-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.settings-info-val {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  word-break: break-word;
}

.settings-info-val.font-mono {
  font-family: monospace;
  letter-spacing: 1px;
  font-size: 1rem;
  color: var(--primary);
}

/* ═══════════════════════════════════════════════════════════
   reCAPTCHA badge — hide default badge (required: visible in ToS)
   ═══════════════════════════════════════════════════════════ */
.grecaptcha-badge {
  visibility: hidden;
}

/* Required: show reCAPTCHA attribution text near submit buttons */
.recaptcha-notice {
  font-size: 0.70rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 6px;
  line-height: 1.4;
}

.recaptcha-notice a {
  color: var(--primary);
  text-decoration: none;
}

/* ═══════════════════════════════════════════════════════════
   MOBILE RESPONSIVE FIXES — Narrow screens (≤ 768px)
   Fixes layout issues on iPhone and all mobile devices
   ═══════════════════════════════════════════════════════════ */

/* ── Hamburger button: hidden on desktop, visible on mobile (CSS-first) */
#btn-sidebar-toggle { display: none; }
@media (max-width: 768px) {
  #btn-sidebar-toggle { display: flex !important; }
}

/* ── Topbar title: hidden on desktop, block on mobile (CSS-first) */
#topbar-title { display: none; }
@media (max-width: 768px) {
  #topbar-title { display: block !important; flex: 1; }
}

/* ── Hide topbar lang toggle on mobile (available in sidebar + bottom nav) */
@media (max-width: 768px) {
  .topbar-lang-toggle { display: none !important; }
}

/* ── Page header: wrap on mobile so title + action button don't overlap */
@media (max-width: 768px) {
  .page-header {
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
  }
  .page-header > div { flex: 1; min-width: 0; }
  .page-header > .page-actions,
  .page-header > button { flex-shrink: 0; }
}

/* ── Card header: wrap on mobile so title + action buttons don't overflow */
@media (max-width: 600px) {
  .card-header {
    flex-wrap: wrap;
    gap: 8px;
  }
  .card-header .card-title { flex: 1; min-width: 0; }
  .card-header .page-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

/* ── Filter bar: full width selects on small screens */
@media (max-width: 480px) {
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-bar .form-select,
  .filter-bar .search-input-wrap {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    flex: none;
  }
}

/* ── Login tab icon: hide on very small screens to save space */
@media (max-width: 360px) {
  .login-tab-icon { display: none; }
  .login-tab { font-size: 0.65rem; padding: 6px 4px; }
  .login-form-panel { padding: 0 14px 28px; }
}

/* ── Topbar: prevent overflow on very small phones */
@media (max-width: 360px) {
  #topbar { padding: 0 8px; gap: 6px; }
  #topbar-title { font-size: 0.88rem; }
}

/* ── Page-content: reduce padding on very small phones */
@media (max-width: 360px) {
  #page-content { padding: 12px; }
  .card { padding: 14px; }
}

/* ═══════════════════════════════════════════════════════════
   MOBILE PARITY — RentManager-level optimizations
   Brings DAWATI to the same mobile quality as RentManager
   ═══════════════════════════════════════════════════════════ */

/* ── 1. iOS Auto-Zoom Prevention ─────────────────────────────
   iOS Safari zooms the page when a focused input has font-size < 16px.
   All inputs, selects and textareas must be at least 16px on mobile.  */
@media (max-width: 768px) {
  input,
  select,
  textarea,
  .form-input,
  .form-select,
  .form-textarea,
  .float-input,
  .form-control,
  .gantt-search-input,
  .swal2-input,
  .swal2-textarea,
  .swal2-select {
    font-size: 16px !important;
  }
}

/* ── 2. Touch-action on interactive elements ─────────────────
   `manipulation` removes the 300ms tap delay on mobile browsers
   and prevents double-tap zoom on buttons and links.           */
@media (max-width: 768px) {
  button,
  a,
  .btn,
  .nav-item,
  .bottom-nav-btn,
  .login-tab,
  .nav-badge,
  .import-path-card {
    touch-action: manipulation;
  }
}

/* ── 3. Momentum Scrolling (iOS) ─────────────────────────────
   `-webkit-overflow-scrolling: touch` gives iOS native inertia
   scrolling to overflowing containers.                         */
@media (max-width: 768px) {
  .view,
  #page-content,
  .table-wrapper,
  .modal-body,
  .login-form-panel {
    -webkit-overflow-scrolling: touch;
  }
}

/* ── 4. Overscroll Behavior ──────────────────────────────────
   Prevents the page from bouncing when scrolling inside
   contained areas (nested scroll containers).                  */
@media (max-width: 768px) {
  .view,
  #page-content {
    overscroll-behavior: contain;
  }
}

/* ── 5. Login + Auth overlay: 100dvh ─────────────────────────
   `100dvh` is the dynamic viewport height — it shrinks when the
   browser's address bar appears, preventing content overflow.  */
.login-form-panel {
  min-height: 100vh;
  min-height: 100dvh;
}
.auth-loading-overlay {
  min-height: 100vh;
  min-height: 100dvh;
}

/* ── 6. Mobile table stability ───────────────────────────────
   `table-layout: fixed` prevents columns from expanding beyond
   their container. Pair with word-break for long Arabic text.  */
@media (max-width: 768px) {
  .table-wrapper table {
    table-layout: fixed;
  }
  .table-wrapper td,
  .table-wrapper th {
    word-break: break-word;
    overflow-wrap: anywhere;
  }
}

/* ── 7. SweetAlert2 popup width fix on mobile ────────────────
   Prevent modals from exceeding the screen on narrow phones.   */
@media (max-width: 768px) {
  .swal2-popup {
    width: calc(100vw - 24px) !important;
    max-width: 420px !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
  }
  .swal2-html-container {
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    max-width: 100% !important;
  }
}

/* ── 8. Landscape keyboard: reduce heights ───────────────────
   When a keyboard pops up in landscape mode the available height
   shrinks dramatically. Compact key UI elements.               */
@media (max-height: 500px) and (orientation: landscape) {
  .login-form-panel { padding-top: 12px; }
  .login-logo-mobile { display: none !important; }
  .login-greeting { margin-bottom: 12px; }
  .form-panel-topbar { margin-bottom: 12px; }
  .float-input { height: 44px; }
}

