/* ─── Platform - Main Stylesheet ────────────────────────────────── */

/* ── Variables ── */
:root {
  --primary:     #1e3a5f;   /* Deep navy - institutional */
  --primary-l:   #2a5298;
  --accent:      #c8a84b;   /* Gold - prestige */
  --accent-l:    #e8c96b;
  --success:     #10b981;
  --warning:     #f59e0b;
  --danger:      #ef4444;
  --info:        #3b82f6;
  --bg:          #f8fafc;
  --surface:     #ffffff;
  --border:      #e2e8f0;
  --text:        #1e293b;
  --text-muted:  #64748b;
  --sidebar-w:   260px;
  --header-h:    64px;
  --radius:      10px;
  --shadow:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:   0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg:   0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
  --transition:  .2s ease;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 15px; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
[dir="rtl"] body { font-family: 'Segoe UI', 'Noto Sans Arabic', 'Cairo', system-ui, sans-serif; }
[dir="rtl"] :where(p, li, dd, dt, blockquote, figcaption, td, th, label, .card-body, .text-muted, .footer-col a, .footer-contact-row span) {
  unicode-bidi: plaintext;
}
[dir="rtl"] .bidi-latin {
  direction: ltr;
  text-align: left;
}
a { color: var(--primary-l); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; }

/* ── Typography ── */
h1, h2, h3, h4, h5 { font-weight: 700; line-height: 1.3; color: var(--primary); }
h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; }
.text-muted  { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-primary{ color: var(--primary); }

/* ── Utilities ── */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.flex       { display: flex; }
.flex-col   { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1      { gap: .5rem; }
.gap-2      { gap: 1rem; }
.gap-3      { gap: 1.5rem; }
.grid-2     { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3     { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4     { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.mt-1{ margin-top: .5rem; } .mt-2{ margin-top: 1rem; } .mt-3{ margin-top: 1.5rem; }
.mb-1{ margin-bottom: .5rem; } .mb-2{ margin-bottom: 1rem; } .mb-3{ margin-bottom: 1.5rem; }
.p-2{ padding: 1rem; } .p-3{ padding: 1.5rem; } .py-4{ padding: 2rem 0; } .py-6{ padding: 3rem 0; }
.rounded    { border-radius: var(--radius); }
.shadow     { box-shadow: var(--shadow); }
.shadow-md  { box-shadow: var(--shadow-md); }
.text-center{ text-align: center; }
.font-bold  { font-weight: 700; }
.text-sm    { font-size: .875rem; }
.text-lg    { font-size: 1.125rem; }
.w-full     { width: 100%; }
.hidden     { display: none; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .6rem 1.4rem; border-radius: var(--radius);
  font-size: .9rem; font-weight: 600; border: none;
  cursor: pointer; transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-l); color: #fff; }
.btn-accent  { background: var(--accent); color: var(--primary); }
.btn-accent:hover { background: var(--accent-l); }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-sm      { padding: .4rem .9rem; font-size: .8rem; }
.btn-lg      { padding: .85rem 2rem; font-size: 1rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Cards ── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  color: var(--primary);
  display: flex; align-items: center; justify-content: space-between;
}
.card-body   { padding: 1.5rem; }
.card-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); background: var(--bg); }

/* ── Forms ── */
.form-group  { margin-bottom: 1.25rem; }
.form-label  { display: block; font-weight: 600; margin-bottom: .4rem; font-size: .9rem; }
.form-control {
  width: 100%; padding: .65rem 1rem;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  font-size: .9rem; background: var(--surface); color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  outline: none; border-color: var(--primary-l);
  box-shadow: 0 0 0 3px rgba(42,82,152,.12);
}
[dir="rtl"] .form-control { text-align: right; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right .75rem center; background-size: 1.25em; padding-right: 2.5rem; }
[dir="rtl"] .form-select { background-position: left .75rem center; padding-right: 1rem; padding-left: 2.5rem; }

/* ── Alerts ── */
.alert {
  padding: 1rem 1.25rem; border-radius: var(--radius);
  font-size: .9rem; display: flex; align-items: flex-start; gap: .75rem;
  margin-bottom: 1rem; border-left: 4px solid;
}
.alert-success { background: #ecfdf5; color: #065f46; border-color: var(--success); }
.alert-error   { background: #fef2f2; color: #991b1b; border-color: var(--danger); }
.alert-warning { background: #fffbeb; color: #92400e; border-color: var(--warning); }
.alert-info    { background: #eff6ff; color: #1e40af; border-color: var(--info); }
[dir="rtl"] .alert { border-left: none; border-right: 4px solid; }

/* ── Badges / Status ── */
.badge {
  display: inline-flex; align-items: center;
  padding: .2rem .65rem; border-radius: 50px;
  font-size: .75rem; font-weight: 600;
}
.badge-success { background: #dcfce7; color: #16a34a; }
.badge-warning { background: #fef9c3; color: #b45309; }
.badge-danger  { background: #fee2e2; color: #b91c1c; }
.badge-info    { background: #dbeafe; color: #1d4ed8; }
.badge-neutral { background: #f1f5f9; color: #475569; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table       { width: 100%; border-collapse: collapse; font-size: .875rem; }
thead th    { background: var(--bg); color: var(--text-muted); font-weight: 600;
              padding: .75rem 1rem; text-align: left; border-bottom: 2px solid var(--border);
              white-space: nowrap; }
[dir="rtl"] thead th { text-align: right; }
tbody td    { padding: .75rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:hover { background: var(--bg); }
tbody tr:last-child td { border-bottom: none; }

/* ── Pagination ── */
.pagination { display: flex; align-items: center; gap: .5rem; justify-content: center; }
.pagination a, .pagination span {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px;
  font-size: .875rem; font-weight: 500;
  border: 1.5px solid var(--border); color: var(--text);
  transition: all var(--transition);
}
.pagination a:hover      { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .active      { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .disabled    { opacity: .4; pointer-events: none; }

/* ─────────────────────────────────────────────── PUBLIC HEADER ── */
.site-header {
  background: var(--primary);
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  box-shadow: var(--shadow-md);
}
.site-header .inner {
  max-width: 1200px; margin: 0 auto; padding: 0 1.5rem;
  height: 100%; display: flex; align-items: center; justify-content: space-between;
}
.site-logo { display: flex; align-items: center; gap: .75rem; }
.site-logo img { height: 40px; width: auto; }
.site-logo .name { color: #fff; font-weight: 800; font-size: 1.1rem; line-height: 1.2; }
.site-logo .sub  { color: var(--accent-l); font-size: .7rem; font-weight: 400; }

.site-nav { display: flex; align-items: center; gap: .25rem; }
.site-nav a {
  color: rgba(255,255,255,.85); padding: .5rem .85rem;
  border-radius: 6px; font-size: .875rem; font-weight: 500;
  transition: all var(--transition);
}
.site-nav a:hover, .site-nav a.active {
  color: #fff; background: rgba(255,255,255,.12);
}
.site-nav .nav-cta {
  background: var(--accent); color: var(--primary) !important;
  margin-left: .5rem; font-weight: 700;
}
.site-nav .nav-cta:hover { background: var(--accent-l); }

/* ── Lien webmail (en-tête public) ──
   Action secondaire : contour discret, à distinguer du bouton plein « Mon
   espace » sans se confondre avec les codes de langue voisins. L'adresse vient
   du réglage « Accès webmail » de la Configuration SMTP (Org::webmailUrl()) ;
   sans réglage ni serveur SMTP, le bouton reste affiché mais désactivé
   (.nav-webmail-off) plutôt que disparaître, avec une bulle expliquant
   pourquoi (.nav-webmail-tip, ouverte au clic — voir data-webmail-toggle
   dans app.js). */
.nav-webmail {
  display: inline-flex; align-items: center; gap: .4rem; flex-shrink: 0; white-space: nowrap;
  padding: .38rem .8rem; border-radius: 6px;
  border: 1px solid rgba(200,168,75,.45); color: rgba(255,255,255,.9);
  background: transparent; font: inherit;
  text-decoration: none; font-size: .8rem; font-weight: 600;
  transition: all var(--transition);
}
.nav-webmail i { color: var(--accent); font-size: .85rem; }
.nav-webmail:hover { background: rgba(200,168,75,.16); border-color: var(--accent); color: #fff; }

.nav-webmail-wrap { position: relative; }
.nav-webmail-off { cursor: help; border-style: dashed; opacity: .65; }
.nav-webmail-off:hover, .nav-webmail-off:focus-visible { opacity: .9; background: transparent; border-color: rgba(200,168,75,.45); color: rgba(255,255,255,.9); }
.nav-webmail-tip {
  display: none; position: absolute; top: calc(100% + .5rem); right: 0; z-index: 40;
  width: max-content; max-width: 240px; padding: .55rem .75rem; border-radius: 6px;
  background: #1e293b; color: #fff; font-size: .74rem; font-weight: 500; line-height: 1.45;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.nav-webmail-tip.open { display: block; }

.lang-switcher { display: flex; gap: .25rem; margin-left: .75rem; }
.lang-switcher a {
  padding: .3rem .6rem; border-radius: 5px;
  font-size: .75rem; font-weight: 700; color: rgba(255,255,255,.7);
  border: 1px solid rgba(255,255,255,.2);
}
.lang-switcher a.active, .lang-switcher a:hover {
  color: #fff; border-color: rgba(255,255,255,.6); background: rgba(255,255,255,.1);
}
.mobile-lang-menu { display: none; }

.mobile-toggle {
  display: none; background: none; border: none;
  color: #fff; cursor: pointer; padding: .5rem;
}

/* ─── HERO ── */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #2a4a8a 60%, #1a3060 100%);
  color: #fff; padding: 5rem 0 4rem;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M0 0h60v60H0z' fill='none'/%3e%3ccircle cx='30' cy='30' r='1.5' fill='rgba(200,168,75,.15)'/%3e%3c/svg%3e");
}
.hero .container { position: relative; }
.hero h1 { color: #fff; font-size: 2.5rem; margin-bottom: 1rem; }
.hero p  { color: rgba(255,255,255,.85); font-size: 1.1rem; max-width: 600px; }
.hero-search {
  background: #fff; border-radius: 50px;
  display: flex; overflow: hidden;
  max-width: 560px; margin-top: 2rem;
  box-shadow: var(--shadow-lg);
}
.hero-search input {
  flex: 1; padding: .9rem 1.5rem;
  border: none; outline: none; font-size: .95rem;
  color: var(--text);
}
.hero-search button {
  background: var(--accent); color: var(--primary);
  border: none; padding: .9rem 1.75rem;
  font-weight: 700; cursor: pointer; font-size: .9rem;
  transition: background var(--transition);
}
.hero-search button:hover { background: var(--accent-l); }

/* ── Stats strip ── */
.stats-strip {
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.stats-strip .inner {
  max-width: 1200px; margin: 0 auto; padding: 1.5rem;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem;
  text-align: center;
}
.stat-item .num { font-size: 2rem; font-weight: 800; color: var(--primary); }
.stat-item .lbl { font-size: .8rem; color: var(--text-muted); font-weight: 500; margin-top: .2rem; }

/* ── Section ── */
.section       { padding: 4rem 0; }
.section-alt   { background: var(--bg); }
.section-title { text-align: center; margin-bottom: 2.5rem; }
.section-title h2 { font-size: 1.75rem; }
.section-title p  { color: var(--text-muted); margin-top: .5rem; }
.section-title .divider {
  width: 50px; height: 3px;
  background: var(--accent); margin: .75rem auto 0;
  border-radius: 2px;
}

/* ── News card ── */
.news-card { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform var(--transition), box-shadow var(--transition); }
.news-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.news-card img   { width: 100%; height: 180px; object-fit: cover; }
.news-card-body  { padding: 1.25rem; }
.news-card-date  { font-size: .75rem; color: var(--text-muted); margin-bottom: .5rem; }
.news-card h3    { font-size: 1rem; margin-bottom: .5rem; }
.news-card p     { font-size: .85rem; color: var(--text-muted); }
.news-card-cat   { display: inline-block; background: rgba(30,58,95,.08); color: var(--primary); padding: .2rem .65rem; border-radius: 50px; font-size: .7rem; font-weight: 700; margin-bottom: .5rem; }

/* ── Event card ── */
.event-card { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform var(--transition); }
.event-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.event-card img   { width: 100%; height: 160px; object-fit: cover; }
.event-card-body  { padding: 1.25rem; flex: 1; }
.event-card-date  { display: flex; align-items: center; gap: .4rem; color: var(--accent); font-weight: 700; font-size: .85rem; margin-bottom: .5rem; }
.event-card h3    { font-size: 1rem; margin-bottom: .75rem; }
.event-card-price { display: flex; align-items: center; gap: .75rem; }
.event-card-footer{ padding: 1rem 1.25rem; border-top: 1px solid var(--border); }

/* ─────────────────────────────────────────────── DIRECTORY ── */
.dir-search-box {
  background: var(--surface); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow); margin-bottom: 2rem;
}
.dir-search-grid {
  display: grid; grid-template-columns: 2fr 1.5fr 1fr 1fr auto;
  gap: 1rem; align-items: end;
}
.dir-card {
  background: var(--surface); border-radius: var(--radius);
  padding: 1.25rem; box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
  display: flex; gap: 1rem; align-items: flex-start;
  transition: box-shadow var(--transition);
}
[dir="rtl"] .dir-card { border-left: none; border-right: 4px solid var(--primary); }
.dir-card:hover { box-shadow: var(--shadow-md); }
.dir-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.1rem; flex-shrink: 0;
}
.dir-info h4 { font-size: 1rem; margin-bottom: .25rem; }
.dir-meta    { display: flex; flex-wrap: wrap; gap: .5rem .75rem; margin-top: .5rem; }
.dir-meta span { display: flex; align-items: center; gap: .35rem; font-size: .8rem; color: var(--text-muted); }

/* ─────────────────────────────────────────────── AUTH ── */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, #2a4a8a 100%);
  padding: 2rem;
}
.auth-card {
  background: var(--surface); border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,.25);
  padding: 2.5rem; width: 100%; max-width: 420px;
}
.auth-logo   { text-align: center; margin-bottom: 2rem; }
.auth-logo img { height: 60px; margin-bottom: 1rem; }
.auth-logo h2  { font-size: 1.2rem; }
.auth-logo p   { font-size: .85rem; color: var(--text-muted); }

/* ─────────────────────────────────────────────── MEMBER LAYOUT ── */
.app-layout  { display: flex; min-height: 100vh; }
.app-sidebar {
  width: var(--sidebar-w); background: var(--primary);
  position: fixed; top: 0; bottom: 0; left: 0;
  display: flex; flex-direction: column;
  box-shadow: 2px 0 8px rgba(0,0,0,.15);
  z-index: 200; overflow: hidden;
  transition: transform .25s ease;
}
[dir="rtl"] .app-sidebar { left: auto; right: 0; box-shadow: -2px 0 8px rgba(0,0,0,.15); }

/* ── Réduction/affichage de la sidebar (desktop) ── */
.sidebar-collapse-btn {
  position: fixed; top: 1.3rem; left: calc(var(--sidebar-w) - 15px);
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: #fff; border: 2px solid var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; cursor: pointer; z-index: 210;
  box-shadow: 0 2px 8px rgba(0,0,0,.22);
  transition: left .25s ease, transform .2s ease, background .15s ease;
}
.sidebar-collapse-btn:hover { background: var(--primary-l); }
[dir="rtl"] .sidebar-collapse-btn { left: auto; right: calc(var(--sidebar-w) - 15px); }
body.sidebar-hidden .app-sidebar { transform: translateX(-100%); }
[dir="rtl"] body.sidebar-hidden .app-sidebar { transform: translateX(100%); }
body.sidebar-hidden .sidebar-collapse-btn { left: 14px; transform: rotate(180deg); }
[dir="rtl"] body.sidebar-hidden .sidebar-collapse-btn { right: 14px; }
@media (max-width: 768px) { .sidebar-collapse-btn { display: none; } }
.app-sidebar-bg {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: center; opacity: .16;
}
.app-sidebar::before {
  content: ''; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(180deg, rgba(15,37,64,.94), rgba(30,58,95,.9));
}
.app-sidebar-logo, .app-sidebar > .sidebar-nav, .app-sidebar > .sidebar-footer {
  position: relative; z-index: 1;
}
.app-sidebar-logo {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex; align-items: center; gap: .75rem;
}
.app-sidebar-logo img  { height: 36px; }
.app-sidebar-logo small{ color: var(--accent-l); font-size: .75rem; font-weight: 700; display: block; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 1rem 0; }
.sidebar-nav .section-label {
  padding: .5rem 1.5rem; font-size: .65rem;
  font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: rgba(255,255,255,.4);
}
.sidebar-nav .nav-group-toggle {
  width: 100%; background: none; border: none; cursor: pointer;
  font-family: inherit; display: flex; align-items: center; justify-content: space-between;
  padding: .5rem 1.1rem .5rem 1.5rem; font-size: .65rem;
  font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: rgba(255,255,255,.4);
  transition: color .15s ease;
}
[dir="rtl"] .sidebar-nav .nav-group-toggle { padding: .5rem 1.5rem .5rem 1.1rem; }
.sidebar-nav .nav-group-toggle:hover { color: rgba(255,255,255,.75); }
.nav-group-chevron { font-size: .58rem; transition: transform .2s ease; flex-shrink: 0; }
.nav-group-toggle.collapsed .nav-group-chevron { transform: rotate(-90deg); }
[dir="rtl"] .nav-group-toggle.collapsed .nav-group-chevron { transform: rotate(90deg); }
.nav-group-items {
  display: grid; grid-template-rows: 1fr; transition: grid-template-rows .22s ease;
}
.nav-group-items > div { overflow: hidden; }
.nav-group-items.collapsed { grid-template-rows: 0fr; }
.sidebar-nav a {
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem 1.5rem; color: rgba(255,255,255,.75);
  font-size: .875rem; transition: all var(--transition);
  border-left: 3px solid transparent;
}
[dir="rtl"] .sidebar-nav a { border-left: none; border-right: 3px solid transparent; }
.sidebar-nav a:hover, .sidebar-nav a.active {
  color: #fff; background: rgba(255,255,255,.1);
  border-left-color: var(--accent);
}
[dir="rtl"] .sidebar-nav a:hover, [dir="rtl"] .sidebar-nav a.active {
  border-left-color: transparent; border-right-color: var(--accent);
}
.sidebar-nav a .nav-icon { width: 18px; text-align: center; opacity: .8; }
.sidebar-nav a.active .nav-icon { opacity: 1; }

.sidebar-nav .nav-disabled {
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem 1.5rem; color: rgba(255,255,255,.32);
  font-size: .875rem; border-left: 3px solid transparent;
  cursor: not-allowed; user-select: none;
}
[dir="rtl"] .sidebar-nav .nav-disabled { border-left: none; border-right: 3px solid transparent; }
.sidebar-nav .nav-disabled .nav-icon { width: 18px; text-align: center; opacity: .5; }
.sidebar-nav .nav-disabled .nav-lock { margin-left: auto; font-size: .65rem; opacity: .6; }
[dir="rtl"] .sidebar-nav .nav-disabled .nav-lock { margin-left: 0; margin-right: auto; }

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,.1);
}
.sidebar-user {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem .75rem; border-radius: 8px;
  background: rgba(255,255,255,.08);
}
.sidebar-user-av {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .85rem; flex-shrink: 0;
}
.sidebar-user-name { color: #fff; font-size: .8rem; font-weight: 600; }
.sidebar-user-role { color: var(--accent-l); font-size: .7rem; }

.app-main  {
  margin-left: var(--sidebar-w); flex: 1;
  display: flex; flex-direction: column;
  min-height: 100vh;
  transition: margin-left .25s ease;
}
[dir="rtl"] .app-main { margin-left: 0; margin-right: var(--sidebar-w); transition: margin-right .25s ease; }
body.sidebar-hidden .app-main { margin-left: 0; }
[dir="rtl"] body.sidebar-hidden .app-main { margin-right: 0; }

.app-topbar {
  height: var(--header-h); background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 2rem; position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow);
}
.app-topbar-left  { display: flex; align-items: center; gap: 1rem; flex: 1; }
.app-topbar-center { display: flex; align-items: center; justify-content: center; gap: .6rem; flex: 1; min-width: 0; }
.app-topbar-title { font-weight: 700; font-size: 1.1rem; color: var(--primary); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-topbar-org-badge {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .68rem; flex-shrink: 0; letter-spacing: -.02em;
}
.app-topbar-right  { display: flex; align-items: center; gap: 1rem; flex: 1; justify-content: flex-end; }

.app-content { flex: 1; padding: 2rem; }

/* ── Panneau flottant "Qui a accès" (toutes pages admin) ── */
.wax-toggle {
  position: fixed; top: 50%; right: 0; transform: translateY(-50%); z-index: 900;
  background: #1e3a5f; color: #c8a84b; border: none; border-radius: 10px 0 0 10px;
  padding: .75rem .55rem; cursor: pointer; box-shadow: -2px 2px 12px rgba(0,0,0,.18);
  display: flex; flex-direction: column; align-items: center; gap: .4rem;
  font-size: .68rem; font-weight: 700; writing-mode: vertical-rl; text-orientation: mixed;
  transition: right .25s ease;
}
.wax-toggle:hover { background: #2a4a8a; }
.wax-toggle .wax-dot {
  writing-mode: horizontal-tb; width: 9px; height: 9px; border-radius: 50%;
  background: #9ca3af; flex-shrink: 0;
}
.wax-toggle .wax-dot.online { background: #4ade80; animation: db-pulse 2s infinite; }
.wax-toggle.wax-open { right: 300px; }
[dir="rtl"] .wax-toggle { right: auto; left: 0; border-radius: 0 10px 10px 0; box-shadow: 2px 2px 12px rgba(0,0,0,.18); }
[dir="rtl"] .wax-toggle.wax-open { left: 300px; right: auto; }

.wax-panel {
  position: fixed; top: 0; right: -300px; width: 300px; height: 100vh; z-index: 899;
  background: #fff; box-shadow: -6px 0 24px rgba(0,0,0,.14); transition: right .25s ease;
  display: flex; flex-direction: column; border-left: 1px solid #e5e7eb;
}
.wax-panel.wax-open { right: 0; }
[dir="rtl"] .wax-panel { right: auto; left: -300px; border-left: none; border-right: 1px solid #e5e7eb; box-shadow: 6px 0 24px rgba(0,0,0,.14); }
[dir="rtl"] .wax-panel.wax-open { left: 0; right: auto; }
.wax-panel-head {
  padding: 1rem 1.1rem; background: #1e3a5f; color: #fff; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
}
.wax-panel-head h4 { font-size: .82rem; font-weight: 800; margin: 0; display: flex; align-items: center; gap: .4rem; }
.wax-panel-head span { font-size: .68rem; color: #c8a84b; font-weight: 700; }
.wax-panel-close { background: none; border: none; color: rgba(255,255,255,.7); cursor: pointer; font-size: .9rem; padding: .2rem; }
.wax-panel-close:hover { color: #fff; }
.wax-members-online {
  flex-shrink: 0; padding: .7rem 1.1rem; background: #f0fdf4; border-bottom: 1px solid #dcfce7;
  display: flex; align-items: center; gap: .55rem; font-size: .78rem; color: #166534;
}
.wax-members-online i { font-size: .9rem; color: #16a34a; }
.wax-members-online strong { font-size: .95rem; color: #15803d; }
.wax-panel-body { flex: 1; overflow-y: auto; padding: .75rem; display: flex; flex-direction: column; gap: .5rem; }
.wax-chip {
  display: flex; align-items: center; gap: .55rem; padding: .5rem .6rem;
  border-radius: 10px; border: 1px solid #e5e7eb; background: #fafbfd;
}
.wax-av {
  width: 30px; height: 30px; border-radius: 50%; background: #1e3a5f; color: #c8a84b;
  display: flex; align-items: center; justify-content: center; font-size: .65rem; font-weight: 800;
  flex-shrink: 0; position: relative;
}
.wax-dot-badge {
  position: absolute; bottom: -1px; right: -1px; width: 9px; height: 9px; border-radius: 50%;
  border: 2px solid #fff; background: #9ca3af;
}
.wax-dot-badge.online { background: #16a34a; animation: db-pulse 2s infinite; }
.wax-name { font-size: .76rem; font-weight: 700; color: #1e293b; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wax-meta { font-size: .64rem; color: #94a3b8; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wax-status { font-size: .6rem; font-weight: 700; margin-left: auto; white-space: nowrap; flex-shrink: 0; }
.wax-status.online { color: #16a34a; }
.wax-status.offline { color: #94a3b8; }
.wax-empty { font-size: .76rem; color: #94a3b8; text-align: center; padding: 1.5rem .5rem; }
@media (max-width: 640px) {
  .wax-panel { width: 82vw; right: -82vw; }
  .wax-panel.wax-open { right: 0; }
  .wax-toggle.wax-open { right: 82vw; }
}

/* ── KPI Cards ── */
.kpi-grid    { display: grid; grid-template-columns: repeat(4,1fr); gap: 1.25rem; margin-bottom: 1.75rem; }
.kpi-card {
  background: var(--surface); border-radius: var(--radius);
  padding: 1.25rem 1.5rem; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 1.25rem;
  border-top: 4px solid;
}
.kpi-card.blue   { border-color: var(--primary-l); }
.kpi-card.gold   { border-color: var(--accent); }
.kpi-card.green  { border-color: var(--success); }
.kpi-card.red    { border-color: var(--danger); }
.kpi-card.purple { border-color: #7c3aed; }
.kpi-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; flex-shrink: 0;
}
.kpi-card.blue   .kpi-icon { background: rgba(42,82,152,.1); color: var(--primary-l); }
.kpi-card.gold   .kpi-icon { background: rgba(200,168,75,.15); color: var(--accent); }
.kpi-card.green  .kpi-icon { background: rgba(16,185,129,.1); color: var(--success); }
.kpi-card.red    .kpi-icon { background: rgba(239,68,68,.1); color: var(--danger); }
.kpi-card.purple .kpi-icon { background: rgba(124,58,237,.1); color: #7c3aed; }
.kpi-label { font-size: .8rem; color: var(--text-muted); margin-bottom: .25rem; }
.kpi-value { font-size: 1.75rem; font-weight: 800; color: var(--text); line-height: 1; }
.kpi-sub   { font-size: .75rem; color: var(--text-muted); margin-top: .25rem; }

/* ── FOOTER ── */
.site-footer {
  background: var(--primary); color: rgba(255,255,255,.75);
  padding: 3rem 0 1.5rem;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem;
  padding-bottom: 2rem; border-bottom: 1px solid rgba(255,255,255,.1);
}
.footer-logo-name { color: #fff; font-weight: 800; font-size: 1rem; margin-bottom: .25rem; }
.footer-logo-sub  { font-size: .75rem; color: var(--accent-l); }
.footer-desc      { font-size: .85rem; margin-top: .75rem; line-height: 1.7; }
.footer-col h4    { color: #fff; font-weight: 700; font-size: .9rem; margin-bottom: .75rem; }
.footer-col ul    { list-style: none; }
.footer-col li    { margin-bottom: .4rem; }
.footer-col a     { color: rgba(255,255,255,.65); font-size: .85rem; transition: color var(--transition); }
.footer-col a:hover { color: var(--accent-l); }
.footer-contact-row { display: flex; align-items: flex-start; gap: .6rem; margin-bottom: .85rem; font-size: .85rem; }
.footer-contact-row i { color: var(--accent-l); margin-top: .2rem; flex-shrink: 0; width: 1rem; text-align: center; }
.footer-contact-row a { color: var(--accent-l); font-weight: 600; text-decoration: underline; text-decoration-color: rgba(200,168,75,.4); text-underline-offset: 2px; transition: color var(--transition); }
.footer-contact-row a:hover { color: #fff; text-decoration-color: #fff; }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 1.5rem; font-size: .8rem;
}
.footer-bottom .social { display: flex; gap: .75rem; }
.footer-bottom .social a {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,.1); color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.footer-bottom .social a:hover { background: var(--accent); color: var(--primary); }

/* ─────────────────────────── MEGA-MENU DROPDOWN ── */

/* ── Trigger button ── */
.nav-item { position: relative; display: flex; align-items: center; }
.nav-toggle {
  display: inline-flex; align-items: center; gap: .35rem;
  color: rgba(255,255,255,.88); padding: .5rem .9rem;
  border-radius: 8px; font-size: .875rem; font-weight: 600;
  background: none; border: none; font-family: inherit; cursor: pointer;
  transition: all var(--transition); white-space: nowrap; line-height: 1;
}
.nav-toggle:hover { color: #fff; background: rgba(255,255,255,.1); }
/* Actif → teinte or, signature institutionnelle du site */
.nav-item:hover > .nav-toggle,
.nav-item.open  > .nav-toggle { color: var(--accent-l); background: rgba(200,168,75,.18); }
.nav-toggle .chev { font-size: .58rem; transition: transform .22s; }
.nav-item:hover > .nav-toggle .chev,
.nav-item.open  > .nav-toggle .chev { transform: rotate(180deg); }

/* ── Panel — bande or en haut = signature du site ── */
.nav-dropdown {
  position: absolute; top: calc(100% + 12px); left: 50%;
  background: var(--surface);
  border-top: 3px solid var(--accent);
  border-left: 1px solid var(--border); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  border-radius: 14px; padding: 1.3rem 1.1rem 1.1rem;
  box-shadow: 0 20px 50px -10px rgba(15,37,64,.25), 0 4px 18px rgba(0,0,0,.08);
  min-width: 560px; z-index: 200;
  display: flex; flex-direction: row;
  visibility: hidden; opacity: 0; pointer-events: none;
  transform: translateX(-50%) translateY(-8px);
  transition: opacity .22s ease, transform .22s ease, visibility 0s .22s;
}
.nav-item:hover .nav-dropdown,
.nav-item.open  .nav-dropdown {
  visibility: visible; opacity: 1; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
  transition: opacity .22s ease, transform .22s ease;
}
/* Flèche deux couches : or extérieur + blanc intérieur */
.nav-dropdown::before {
  content: ''; position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  border: 10px solid transparent; border-bottom-color: var(--accent);
}
.nav-dropdown::after {
  content: ''; position: absolute; top: -7px; left: 50%; transform: translateX(-50%);
  border: 8px solid transparent; border-bottom-color: var(--surface);
}

/* Largeurs adaptées au contenu : les 560 px de la règle de base sont calibrés
   pour deux colonnes bien remplies. « Présentation » et « Réglementation » n'en
   ont plus qu'une depuis la scission de « À propos », et « Actualités & médias »
   n'aligne que deux liens par colonne. */
.nav-dropdown--single  { min-width: 300px; }
.nav-dropdown--compact { min-width: 420px; }

/* ── Colonnes ── */
.nav-dd-col { flex: 1; padding: 0 .9rem; }
.nav-dd-col + .nav-dd-col { border-left: 1px solid var(--border); }
/* Réglementation empile plusieurs catégories dans une seule colonne : seules
   les suivantes ont besoin d'air au-dessus, la première touche déjà le bord. */
.nav-dd-col-title:not(:first-child) { margin-top: 1rem; }

/* Titre — mirror de .h-sec-head h2 : icône or + navy + barre or ── */
.nav-dd-col-title {
  display: flex; align-items: center; gap: .65rem;
  font-size: .67rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em;
  color: var(--primary); padding-bottom: .7rem;
  border-bottom: 2px solid var(--accent); margin-bottom: .7rem;
}
/* Cercle icône — mirror de .h-visit-ic / .h-access-icon ── */
.dd-ic {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(135deg, rgba(200,168,75,.18) 0%, rgba(200,168,75,.08) 100%);
  border: 1px solid rgba(200,168,75,.25);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .75rem; color: var(--accent);
  box-shadow: 0 1px 3px rgba(200,168,75,.15);
}

/* Liens — spécificité renforcée (.nav-dropdown .nav-dd-link = 20)
   pour écraser .site-nav a (11) et .site-nav a:hover (21) */
.nav-dropdown .nav-dd-link,
.nav-subdropdown .nav-dd-link {
  display: flex; align-items: center; gap: .6rem;
  padding: .46rem .6rem .46rem .7rem; border-radius: 8px;
  font-size: .855rem; font-weight: 500;
  color: var(--text) !important;           /* écrase .site-nav a → blanc */
  background: transparent !important;     /* écrase .site-nav a:hover */
  text-decoration: none; white-space: nowrap;
  border-left: 2px solid transparent;
  transition: background .15s, color .15s, border-color .15s, transform .15s;
}
.nav-dropdown .nav-dd-link i,
.nav-subdropdown .nav-dd-link i {
  font-size: .74rem; color: var(--text-muted); width: 16px;
  text-align: center; flex-shrink: 0; transition: color .15s;
}
.nav-dropdown .nav-dd-link:hover,
.nav-subdropdown .nav-dd-link:hover {
  background: rgba(30,58,95,.06) !important;
  color: var(--primary) !important;
  border-left-color: var(--accent);
  transform: translateX(4px);
}
.nav-dropdown .nav-dd-link:hover i,
.nav-subdropdown .nav-dd-link:hover i { color: var(--accent); }
.nav-dd-divider { border: none; border-top: 1px solid var(--border); margin: .5rem 0; }

/* ── Sous-menu trigger — style .h-doc : bg + border, or au survol ── */
.nav-sub-item { position: relative; }
.nav-sub-toggle {
  display: flex; align-items: center; gap: .55rem; width: 100%;
  padding: .44rem .6rem; margin-top: .3rem; border-radius: 8px;
  font-size: .84rem; font-weight: 600; color: var(--primary);
  cursor: pointer; font-family: inherit; text-align: left;
  background: var(--bg); border: 1.5px solid var(--border);
  transition: border-color .14s, background .14s, transform .14s;
}
.nav-sub-toggle .sub-icon {
  font-size: .72rem; color: var(--accent); width: 16px; text-align: center; flex-shrink: 0;
}
.nav-sub-toggle .chev-r {
  margin-left: auto; font-size: .58rem; color: var(--text-muted); transition: transform .22s, color .14s;
}
.nav-sub-item:hover .nav-sub-toggle,
.nav-sub-item.open  .nav-sub-toggle {
  border-color: var(--accent); background: rgba(200,168,75,.07); transform: translateX(2px);
}
.nav-sub-item:hover .chev-r,
.nav-sub-item.open  .chev-r { color: var(--accent); transform: rotate(90deg); }

/* ── Sous-dropdown — même signature or ── */
.nav-subdropdown {
  position: absolute; left: calc(100% + 8px); top: -4px;
  background: var(--surface);
  border-top: 3px solid var(--accent);
  border-left: 1px solid var(--border); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  border-radius: 14px; padding: .9rem .7rem;
  box-shadow: 0 16px 40px -8px rgba(15,37,64,.2), 0 4px 12px rgba(0,0,0,.06);
  min-width: 215px; z-index: 210; display: block;
  visibility: hidden; opacity: 0; pointer-events: none;
  transform: translateX(-5px);
  transition: opacity .16s, transform .16s, visibility 0s .16s;
}
.nav-sub-item:hover .nav-subdropdown,
.nav-sub-item.open  .nav-subdropdown {
  visibility: visible; opacity: 1; pointer-events: auto;
  transform: translateX(0); transition: opacity .16s, transform .16s;
}

/* ── Mobile panel — dégradé navy profond, or sur les titres ── */
@media (max-width: 768px) {
  .site-nav.mobile-open {
    display: flex !important; flex-direction: column; align-items: stretch;
    position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0;
    background: #0f2540;
    overflow-y: auto; padding: 1.1rem .85rem; z-index: 1000; gap: 0;
  }
  .site-nav.mobile-open > a {
    width: 100%; box-sizing: border-box; padding: .7rem .85rem;
    border-bottom: 1px solid rgba(255,255,255,.07);
  }
  .site-nav.mobile-open .nav-toggle {
    width: 100%; box-sizing: border-box; justify-content: flex-start;
    color: rgba(255,255,255,.88); background: none;
    border-bottom: 1px solid rgba(255,255,255,.07); border-radius: 0; padding: .7rem .85rem;
  }
  .site-nav.mobile-open .nav-item { flex-direction: column; align-items: stretch; }
  .site-nav.mobile-open .nav-item:hover > .nav-toggle,
  .site-nav.mobile-open .nav-item.open  > .nav-toggle { color: var(--accent-l); background: rgba(200,168,75,.1); }
  /* Accordéon */
  .site-nav.mobile-open .nav-dropdown {
    position: static !important; visibility: visible !important; opacity: 1 !important;
    transform: none !important; min-width: 0 !important; width: 100%;
    box-shadow: 0 10px 24px -18px rgba(0,0,0,.55); border-top: 3px solid var(--accent); border-radius: 10px;
    border-left: 1px solid rgba(255,255,255,.14); border-right: 1px solid rgba(255,255,255,.14); border-bottom: 1px solid rgba(255,255,255,.14);
    background: #123052; padding: .8rem .7rem; margin: .35rem 0 .6rem; pointer-events: auto;
    display: none !important; transition: none !important; flex-direction: column;
  }
  .site-nav.mobile-open .nav-dropdown::before,
  .site-nav.mobile-open .nav-dropdown::after { display: none; }
  .site-nav.mobile-open .nav-item.open .nav-dropdown { display: flex !important; }
  .site-nav.mobile-open .nav-dd-col { border: none; padding: .3rem 0; }
  .site-nav.mobile-open .nav-dd-col + .nav-dd-col {
    border-top: 1px solid rgba(255,255,255,.08); margin-top: .5rem; padding-top: .5rem;
  }
  .site-nav.mobile-open .nav-dd-col-title {
    color: #fff;
    border-bottom-color: rgba(200,168,75,.55);
    text-shadow: none;
  }
  .site-nav.mobile-open .dd-ic {
    background: rgba(200,168,75,.18);
    color: var(--accent-l);
    border-color: rgba(200,168,75,.4);
  }
  .site-nav.mobile-open .nav-dropdown .nav-dd-link,
  .site-nav.mobile-open .nav-subdropdown .nav-dd-link {
    color: #fff !important;
    background: transparent !important;
    border-left-color: transparent;
    opacity: 1 !important;
    font-weight: 700;
  }
  .site-nav.mobile-open .nav-dd-link:hover {
    background: rgba(200,168,75,.12) !important; color: var(--accent-l) !important; border-left-color: var(--accent);
  }
  .site-nav.mobile-open .nav-dd-link i { color: rgba(232,201,107,.9) !important; opacity:1 !important; }
  .site-nav.mobile-open .nav-dd-link:hover i { color: var(--accent); }
  .site-nav.mobile-open .nav-sub-toggle {
    color: #fff; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2);
  }
  .site-nav.mobile-open .nav-sub-toggle .sub-icon { color: var(--accent-l); }
  .site-nav.mobile-open .nav-sub-item:hover .nav-sub-toggle,
  .site-nav.mobile-open .nav-sub-item.open  .nav-sub-toggle {
    background: rgba(200,168,75,.12); border-color: var(--accent); color: var(--accent-l);
  }
  .site-nav.mobile-open .nav-subdropdown {
    position: static !important; visibility: visible !important; opacity: 1 !important;
    transform: none !important; box-shadow: none; pointer-events: auto;
    background: rgba(0,0,0,.18); border-top: 1px solid rgba(200,168,75,.35);
    border-left: none; border-right: none; border-bottom: none; border-radius: 8px;
    padding: .5rem .4rem; margin: .3rem 0 .2rem 1.2rem; display: none; transition: none !important;
  }
  .site-nav.mobile-open .nav-sub-item.open .nav-subdropdown { display: block; }
  .site-nav.mobile-open .nav-dd-divider { border-color: rgba(255,255,255,.1); }
  .site-header .inner > div > .lang-switcher { display: none; }
  .site-nav.mobile-open .mobile-lang-menu {
    display:block; margin-top:.9rem; padding:.85rem; border-top:1px solid rgba(255,255,255,.1);
    background:rgba(0,0,0,.16); border-radius:10px;
  }
  .mobile-lang-title {
    display:flex; align-items:center; gap:.5rem; margin-bottom:.65rem;
    color:var(--accent-l); font-size:.72rem; font-weight:800; text-transform:uppercase; letter-spacing:.08em;
  }
  .mobile-lang-options { display:grid; grid-template-columns:repeat(3, 1fr); gap:.45rem; }
  .site-nav.mobile-open .mobile-lang-options a {
    display:flex; align-items:center; justify-content:center; padding:.55rem .45rem; border-radius:8px;
    border:1px solid rgba(255,255,255,.16); color:rgba(255,255,255,.82); font-weight:800; font-size:.78rem;
    background:rgba(255,255,255,.04); pointer-events:auto; position:relative; z-index:1;
  }
  .site-nav.mobile-open .mobile-lang-options a.active,
  .site-nav.mobile-open .mobile-lang-options a:hover {
    color:#0f2540; background:var(--accent-l); border-color:var(--accent-l);
  }
}

/* ─────────────────────────────────────────────── RESPONSIVE ── */
@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(2,1fr); }
  .dir-search-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  h1 { font-size: 1.75rem; }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .stats-strip .inner { grid-template-columns: repeat(2,1fr); }
  .site-nav { display: none; }
  .mobile-toggle { display: block; }
  .app-sidebar { transform: translateX(-100%); transition: transform .3s; }
  [dir="rtl"] .app-sidebar { transform: translateX(100%); }
  body.sidebar-hidden .app-sidebar.open,
  [dir="rtl"] body.sidebar-hidden .app-sidebar.open,
  .app-sidebar.open { transform: translateX(0); }
  .app-main { margin-left: 0; }
  [dir="rtl"] .app-main { margin-right: 0; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .dir-search-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero { padding: 3rem 0 2.5rem; }
  .hero h1 { font-size: 1.75rem; }
  .app-content { padding: 1rem; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .stats-strip .inner { grid-template-columns: 1fr 1fr; }
}

/* ── Smooth fade animation ── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.fade-in { animation: fadeIn .3s ease forwards; }
