/* ── CSS Variables (defaults, overridden inline from DB) ─────────────── */
:root {
  --brand-primary:    #E84B37;
  --brand-primary-dk: #c73a28;
  --brand-primary-lt: #f26a58;
  --sidebar-bg:       #0f1117;
  --sidebar-hover:    rgba(255,255,255,.07);
  --sidebar-active:   rgba(232,75,55,.18);
  --topbar-bg:        #0f1117;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-xs: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.07), 0 4px 16px rgba(0,0,0,.04);
  --shadow-md: 0 4px 20px rgba(0,0,0,.10), 0 8px 32px rgba(0,0,0,.06);
  --ease-out: cubic-bezier(.22,.68,0,1.2);
}

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

body {
  background: #f0f2f7;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: #1e293b;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

/* Inter font via Google Fonts if available */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── Top Navbar ──────────────────────────────────────────────────────── */
.topbar {
  background: var(--topbar-bg);
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 58px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  z-index: 1040;
  box-shadow: 0 1px 0 rgba(255,255,255,.05), 0 4px 20px rgba(0,0,0,.4);
  gap: 14px;
  backdrop-filter: blur(12px);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.topbar-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
  filter: brightness(1.05);
}

.topbar-divider {
  width: 1px;
  height: 24px;
  background: rgba(255,255,255,.10);
  flex-shrink: 0;
}

.topbar-app-name {
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255,255,255,.5);
  letter-spacing: .4px;
  white-space: nowrap;
}

.topbar-spacer { flex: 1; }

/* ── Global Search ───────────────────────────────────────────────────── */
.topbar-search { position: relative; }

.search-input-wrap { position: relative; }

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,.35);
  font-size: 13px;
  pointer-events: none;
}

.search-input {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.85);
  font-size: 13px;
  padding: 6px 12px 6px 32px;
  width: 220px;
  transition: background .18s, border-color .18s, width .25s var(--ease-out);
  outline: none;
}

.search-input::placeholder { color: rgba(255,255,255,.30); }

.search-input:focus {
  background: rgba(255,255,255,.13);
  border-color: rgba(255,255,255,.22);
  width: 280px;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #1e2130;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 2000;
  overflow: hidden;
  display: none;
}

.search-dropdown.open { display: block; }

.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  text-decoration: none;
  transition: background .12s;
  border-bottom: 1px solid rgba(255,255,255,.05);
}

.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: rgba(255,255,255,.06); }

.search-result-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.search-result-icon.type-asset { background: rgba(59,130,246,.2); color: #60a5fa; }
.search-result-icon.type-user  { background: rgba(16,185,129,.2); color: #34d399; }
.search-result-icon.type-maintenance { background: rgba(245,158,11,.2); color: #fbbf24; }

.search-result-text { flex: 1; min-width: 0; }
.search-result-label { font-size: 12.5px; color: rgba(255,255,255,.85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-sub   { font-size: 11px; color: rgba(255,255,255,.40); }

.search-result-all {
  display: block;
  text-align: center;
  padding: 8px;
  font-size: 12px;
  color: rgba(255,255,255,.40);
  cursor: pointer;
  transition: background .12s, color .12s;
}

.search-result-all:hover { background: rgba(255,255,255,.05); color: rgba(255,255,255,.7); }

@media (max-width: 768px) {
  .topbar-search { display: none; }
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-username {
  color: rgba(255,255,255,.80);
  font-size: 13px;
  font-weight: 500;
}

/* ── Sidebar ─────────────────────────────────────────────────────────── */
.sidebar {
  background: var(--sidebar-bg);
  width: 220px;
  height: calc(100vh - 58px);
  position: fixed;
  top: 58px;
  left: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 6px 32px;
  z-index: 1030;
  border-right: 1px solid rgba(255,255,255,.04);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.08) transparent;
}

.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 4px; }

.sidebar .nav-section-label {
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  color: rgba(255,255,255,.22);
  padding: 8px 10px 2px;
  font-weight: 700;
  display: block;
}

.sidebar .nav-link {
  color: rgba(255,255,255,.60);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 9px;
  transition: background .18s ease, color .18s ease, transform .15s var(--ease-out);
  text-decoration: none;
  margin-bottom: 1px;
  position: relative;
}

.sidebar .nav-link i {
  font-size: 14px;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
  opacity: .8;
  transition: opacity .18s;
}

.sidebar .nav-link:hover {
  background: var(--sidebar-hover);
  color: rgba(255,255,255,.92);
  transform: translateX(2px);
}

.sidebar .nav-link:hover i { opacity: 1; }

.sidebar .nav-link.active {
  background: var(--sidebar-active);
  color: #fff;
  font-weight: 600;
}

.sidebar .nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--brand-primary);
}

/* ── Main content wrapper ────────────────────────────────────────────── */
.page-wrapper {
  margin-top: 58px;
  margin-left: 220px;
  padding: 28px 28px 48px;
  min-height: calc(100vh - 58px);
  animation: fadeSlideUp .3s var(--ease-out) both;
}

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

/* ── Page header ─────────────────────────────────────────────────────── */
.page-header {
  margin-bottom: 24px;
}
.page-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 3px;
  letter-spacing: -.2px;
}
.page-header p {
  color: #64748b;
  font-size: 13px;
  margin: 0;
}

/* ── Cards ───────────────────────────────────────────────────────────── */
.card {
  border: 1px solid rgba(0,0,0,.055);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  background: #fff;
  transition: box-shadow .2s ease, transform .2s var(--ease-out);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  background: transparent;
  border-bottom: 1px solid #f1f5f9;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
  padding: 14px 18px;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: -.1px;
}

/* ── Stat cards ──────────────────────────────────────────────────────── */
.stat-card {
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  color: #fff;
  position: relative;
  overflow: hidden;
  border: none !important;
  box-shadow: var(--shadow-md);
  transition: transform .22s var(--ease-out), box-shadow .22s ease;
}

.stat-card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
}

.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.12) 0%, transparent 60%);
  pointer-events: none;
}

.stat-card::after {
  content: '';
  position: absolute;
  right: -24px; bottom: -24px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,.10);
}

.stat-card .stat-number {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 6px;
  letter-spacing: -.5px;
}

.stat-card .stat-label {
  font-size: 12px;
  opacity: .85;
  font-weight: 500;
}

/* ── Tables ──────────────────────────────────────────────────────────── */
.table th {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: #94a3b8;
  background: #f8fafc;
  border-bottom: 1px solid #e8edf3;
  padding: 10px 14px;
  font-weight: 700;
}

.table td {
  vertical-align: middle;
  font-size: 13.5px;
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}

.table tbody tr:last-child td { border-bottom: none; }

.table-hover tbody tr {
  transition: background .12s ease;
}

.table-hover tbody tr:hover td {
  background: #f8fafc;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .1px;
  transition: all .18s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background .15s;
}

.btn:hover::after { background: rgba(255,255,255,.08); }
.btn:active { transform: scale(.97); }

.btn-primary {
  background: var(--brand-primary) !important;
  border-color: var(--brand-primary) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(232,75,55,.35);
}

.btn-primary:hover, .btn-primary:focus {
  background: var(--brand-primary-dk) !important;
  border-color: var(--brand-primary-dk) !important;
  box-shadow: 0 4px 14px rgba(232,75,55,.45) !important;
  transform: translateY(-1px);
}

.btn-outline-primary {
  color: var(--brand-primary) !important;
  border-color: var(--brand-primary) !important;
  background: transparent !important;
}

.btn-outline-primary:hover {
  background: var(--brand-primary) !important;
  color: #fff !important;
  box-shadow: 0 2px 10px rgba(232,75,55,.30);
  transform: translateY(-1px);
}

.btn-outline-secondary:hover {
  transform: translateY(-1px);
}

.btn-outline-danger:hover {
  transform: translateY(-1px);
}

.btn-success {
  box-shadow: 0 2px 8px rgba(16,185,129,.30);
}
.btn-success:hover {
  box-shadow: 0 4px 14px rgba(16,185,129,.40) !important;
  transform: translateY(-1px);
}

/* ── Badges ──────────────────────────────────────────────────────────── */
.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 6px;
  letter-spacing: .2px;
}

/* ── Pagination ──────────────────────────────────────────────────────── */
.page-link {
  color: var(--brand-primary);
  border-radius: var(--radius-sm) !important;
  margin: 0 2px;
  border: 1px solid #e2e8f0;
  transition: all .15s ease;
}

.page-link:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  transform: translateY(-1px);
}

.page-item.active .page-link {
  background: var(--brand-primary) !important;
  border-color: var(--brand-primary) !important;
  box-shadow: 0 2px 8px rgba(232,75,55,.35);
}

/* ── Alerts ──────────────────────────────────────────────────────────── */
.alert {
  border-radius: var(--radius-md);
  font-size: 13.5px;
  border: none;
  backdrop-filter: blur(4px);
  animation: slideInDown .25s var(--ease-out) both;
}

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

.alert-success { background: #f0fdf4; color: #166534; box-shadow: 0 0 0 1px #bbf7d0; }
.alert-danger  { background: #fff1f2; color: #9f1239; box-shadow: 0 0 0 1px #fecdd3; }
.alert-warning { background: #fffbeb; color: #92400e; box-shadow: 0 0 0 1px #fde68a; }
.alert-info    { background: #eff6ff; color: #1e40af; box-shadow: 0 0 0 1px #bfdbfe; }

/* ── Form controls ───────────────────────────────────────────────────── */
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border: 1.5px solid #e2e8f0;
  font-size: 13.5px;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.form-control:focus, .form-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(232,75,55,.10);
}

.form-label.fw-semibold {
  color: #374151;
  font-size: 12.5px;
  letter-spacing: .1px;
}

/* ── Progress bars ───────────────────────────────────────────────────── */
.progress {
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar {
  transition: width .6s var(--ease-out);
}

/* ── List group ──────────────────────────────────────────────────────── */
.list-group-item {
  border-color: #f1f5f9;
  font-size: 13.5px;
  transition: background .12s;
}

/* ── Modal ───────────────────────────────────────────────────────────── */
.modal-content {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}

.modal-header {
  border-bottom: 1px solid #f1f5f9;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* ── QR print ────────────────────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .btn, .alert, .page-header .btn { display: none !important; }
  .page-wrapper { margin: 0 !important; padding: 0 !important; }
}

/* ── Login page ──────────────────────────────────────────────────────── */
.login-page {
  background: linear-gradient(135deg, #0a0e1a 0%, #0f1117 50%, #0d1526 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232,75,55,.08) 0%, transparent 70%);
  top: -200px; right: -200px;
  pointer-events: none;
}

.login-page::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,.06) 0%, transparent 70%);
  bottom: -100px; left: -100px;
  pointer-events: none;
}

.login-card {
  width: 420px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.05);
  animation: fadeSlideUp .4s var(--ease-out) both;
  position: relative;
  z-index: 1;
}

.login-brand-panel {
  background: rgba(255,255,255,.03);
  padding: 36px 32px 26px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,.06);
  position: relative;
}

.login-brand-panel::after {
  content: '';
  position: absolute;
  bottom: 0; left: 32px; right: 32px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--brand-primary), transparent);
}

.login-brand-logo {
  height: 52px;
  width: auto;
  margin-bottom: 14px;
}

.login-brand-sub {
  font-size: 11px;
  color: rgba(255,255,255,.35);
  margin: 0;
  letter-spacing: .8px;
  text-transform: uppercase;
}

.login-body {
  background: #fff;
  padding: 28px 32px 32px;
}

/* ── Color swatch preview ────────────────────────────────────────────── */
.color-swatch {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(0,0,0,.08);
  display: inline-block;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform .15s var(--ease-out);
}

.color-swatch:hover { transform: scale(1.1); }

/* ── Branding preview bar ────────────────────────────────────────────── */
.brand-preview-bar {
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

/* ── Skeleton loading shimmer ────────────────────────────────────────── */
@keyframes shimmer {
  from { background-position: -400px 0; }
  to   { background-position: 400px 0; }
}

.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e8edf3 50%, #f1f5f9 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: var(--radius-sm);
}

/* ── Utility: smooth link transitions ────────────────────────────────── */
a { transition: color .15s ease; }

/* ── Code / Asset tag ────────────────────────────────────────────────── */
code.text-primary {
  background: rgba(232,75,55,.08);
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-primary) !important;
}

/* ── Dropdown menus ──────────────────────────────────────────────────── */
.dropdown-menu {
  border: 1px solid #e8edf3;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: 13.5px;
  animation: fadeSlideUp .15s var(--ease-out) both;
}

.dropdown-item {
  border-radius: var(--radius-sm);
  margin: 1px 4px;
  padding: 7px 12px;
  transition: background .12s;
}

/* ── Table action buttons ────────────────────────────────────────────── */
.btn-xs {
  font-size: 11px;
  padding: 3px 8px;
}

/* ═══════════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE  (≤768px)
   ═══════════════════════════════════════════════════════════════════════ */

/* Hamburger toggle button — hidden on desktop */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: rgba(255,255,255,.75);
  font-size: 20px;
  padding: 0 4px;
  cursor: pointer;
  line-height: 1;
  transition: color .15s;
  flex-shrink: 0;
}
.sidebar-toggle:hover { color: #fff; }

/* Sidebar close button — only visible on mobile */
.sidebar-close {
  display: none;
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: rgba(255,255,255,.5);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background .15s, color .15s;
  z-index: 5;
}
.sidebar-close:hover {
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.9);
}

/* Sidebar overlay — darkens content behind open sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 1029;
  backdrop-filter: blur(2px);
  animation: overlayFadeIn .2s ease both;
}

@keyframes overlayFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

body.sidebar-open .sidebar-overlay { display: block; }

@media (max-width: 768px) {

  /* Show hamburger, hide app name on small screens */
  .sidebar-toggle { display: flex; align-items: center; }
  .sidebar-close  { display: block; }

  /* Sidebar slides in from left, hidden by default */
  .sidebar {
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1),
                box-shadow .28s ease;
    top: 0;
    height: 100vh;
    min-height: 100vh;
    padding-top: 52px;
    z-index: 1031;
    box-shadow: none;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(0,0,0,.45);
  }

  /* Content takes full width */
  .page-wrapper {
    margin-left: 0 !important;
    padding: 16px 14px 48px;
  }

  /* Prevent scroll when sidebar open */
  body.sidebar-open { overflow: hidden; }

  /* Cards go full width */
  .col-md-3, .col-md-4, .col-md-6 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  /* Stat cards row: 2-up on small screens */
  .row.g-3 .col-md-3 {
    flex: 0 0 50%;
    max-width: 50%;
  }

  /* Page header stack */
  .page-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px;
  }

  /* Tables: allow horizontal scroll */
  .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Topbar tweaks */
  .topbar { padding: 0 12px; gap: 10px; }
  .topbar-app-name { display: none; }
  .topbar-divider  { display: none; }
}

@media (max-width: 420px) {
  .row.g-3 .col-md-3 {
    flex: 0 0 100%;
    max-width: 100%;
  }
  .page-wrapper { padding: 12px 10px 48px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   RTL SUPPORT  (body.rtl or html[dir="rtl"])
   ═══════════════════════════════════════════════════════════════════════ */

body.rtl,
[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

/* Sidebar moves to right */
body.rtl .sidebar,
[dir="rtl"] .sidebar {
  left: auto;
  right: 0;
  border-right: none;
  border-left: 1px solid rgba(255,255,255,.04);
}

/* Page content shifts right */
body.rtl .page-wrapper,
[dir="rtl"] .page-wrapper {
  margin-left: 0;
  margin-right: 220px;
}

/* Active indicator flips side */
body.rtl .sidebar .nav-link.active::before,
[dir="rtl"] .sidebar .nav-link.active::before {
  left: auto;
  right: 0;
  border-radius: 2px 0 0 2px;
}

/* Hover nudge flips */
body.rtl .sidebar .nav-link:hover,
[dir="rtl"] .sidebar .nav-link:hover {
  transform: translateX(-2px);
}

/* Topbar brand order */
body.rtl .topbar,
[dir="rtl"] .topbar {
  flex-direction: row-reverse;
}

/* Icons and gaps flip */
body.rtl .sidebar .nav-link,
[dir="rtl"] .sidebar .nav-link {
  flex-direction: row-reverse;
}

/* Mobile RTL: sidebar slides from right */
@media (max-width: 768px) {
  body.rtl .sidebar,
  [dir="rtl"] .sidebar {
    transform: translateX(100%);
    left: auto;
    right: 0;
  }

  body.rtl.sidebar-open .sidebar,
  [dir="rtl"] body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.rtl .sidebar-close,
  [dir="rtl"] .sidebar-close {
    right: auto;
    left: 10px;
  }

  body.rtl .page-wrapper,
  [dir="rtl"] .page-wrapper {
    margin-right: 0 !important;
  }
}

/* Dropdown alignment in RTL */
body.rtl .dropdown-menu,
[dir="rtl"] .dropdown-menu {
  text-align: right;
}

/* ═══════════════════════════════════════════════════════════════════════
   PWA INSTALL BANNER  (.pwa-install-banner)
   ═══════════════════════════════════════════════════════════════════════ */

.pwa-install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #0f1117;
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 1050;
  box-shadow: 0 -4px 24px rgba(0,0,0,.35);
  animation: slideUpBanner .3s var(--ease-out) both;
}

@keyframes slideUpBanner {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.pwa-install-banner.hidden { display: none; }

.pwa-install-banner-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: contain;
  flex-shrink: 0;
}

.pwa-install-banner-text {
  flex: 1;
}

.pwa-install-banner-text strong {
  display: block;
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 2px;
}

.pwa-install-banner-text span {
  font-size: 12px;
  color: rgba(255,255,255,.45);
}

.pwa-install-btn {
  background: var(--brand-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .18s ease, transform .15s var(--ease-out);
  flex-shrink: 0;
}

.pwa-install-btn:hover {
  background: var(--brand-primary-dk);
  transform: scale(1.03);
}

.pwa-install-dismiss {
  background: none;
  border: none;
  color: rgba(255,255,255,.35);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color .15s;
  flex-shrink: 0;
}

.pwa-install-dismiss:hover { color: rgba(255,255,255,.7); }

/* ═══════════════════════════════════════════════════════════════════════
   LANGUAGE SWITCHER  (.lang-switcher)
   ═══════════════════════════════════════════════════════════════════════ */

.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 8px;
  padding: 3px 5px;
  flex-shrink: 0;
}

.lang-switcher-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,.45);
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 5px;
  cursor: pointer;
  letter-spacing: .5px;
  transition: background .15s, color .15s;
  line-height: 1.4;
  text-transform: uppercase;
}

.lang-switcher-btn:hover {
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.8);
}

.lang-switcher-btn.active {
  background: var(--brand-primary);
  color: #fff;
  box-shadow: 0 1px 6px rgba(232,75,55,.35);
}
