/* ==========================================================
   EventFlow v2 - Main Stylesheet
   ========================================================== */

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #a5b4fc;
  --secondary: #8b5cf6;
  --accent: #ec4899;

  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-muted: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --text: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow: 0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.06);
  --shadow-xl: 0 25px 50px -12px rgba(0,0,0,.18);

  --header-h: 70px;
  --sidebar-w: 260px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Cairo', 'Tajawal', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Tahoma, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
[dir="ltr"] body { font-family: 'Inter', system-ui, -apple-system, sans-serif; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color .15s; }
a:hover { color: var(--primary-dark); }
h1,h2,h3,h4,h5 { margin: 0 0 .5em; font-weight: 700; line-height: 1.3; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--text-muted); }

/* ==========================================================
   Icon system - SVG sizing
   ========================================================== */
i[data-icon] {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1em; height: 1em; line-height: 1;
  vertical-align: -0.125em; flex-shrink: 0;
}
i[data-icon] svg {
  width: 100%; height: 100%; display: block;
  pointer-events: none;
}
.text-end { text-align: end; }
.text-center { text-align: center; }
.mt-2 { margin-top: .5rem; } .mt-3 { margin-top: 1rem; } .mt-4 { margin-top: 1.5rem; } .mt-5 { margin-top: 2rem; }
.mb-2 { margin-bottom: .5rem; } .mb-3 { margin-bottom: 1rem; } .mb-4 { margin-bottom: 1.5rem; } .mb-5 { margin-bottom: 2rem; }
.p-0 { padding: 0; }
.inline-form { display: inline; }
.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ==========================================================
   Buttons
   ========================================================== */
.btn-primary, .btn-secondary, .btn-ghost, .btn-danger, .btn-success {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 10px 18px; border-radius: var(--radius);
  font-weight: 600; font-size: 14px; cursor: pointer; transition: all .2s;
  border: 1px solid transparent; text-decoration: none; line-height: 1;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white; border: none;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(99,102,241,.35); color: white; }
.btn-secondary { background: var(--bg-card); border: 1px solid var(--border-strong); color: var(--text); }
.btn-secondary:hover { background: var(--bg-muted); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg-muted); color: var(--text); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; color: white; }
.btn-success { background: var(--success); color: white; }
.btn-block { display: flex; width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  background: var(--bg-muted); color: var(--text-muted); border: none;
  cursor: pointer; transition: all .15s;
}
.btn-icon:hover { background: var(--primary); color: white; }
.btn-icon-danger:hover { background: var(--danger); color: white; }
.btn-icon i { width: 16px; height: 16px; }

/* ==========================================================
   Forms
   ========================================================== */
.form-group { margin-bottom: 14px; display: flex; flex-direction: column; }
.form-group label { font-weight: 600; margin-bottom: 6px; font-size: 13px; color: var(--text); }
.form-group small { color: var(--text-muted); font-size: 12px; margin-top: 4px; }
.form-grid-2, .form-grid-3 { display: grid; gap: 14px; }
.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-grid-2 .full, .form-grid-3 .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; padding: 18px 0; border-top: 1px solid var(--border); }

input[type=text], input[type=email], input[type=password], input[type=tel], input[type=url],
input[type=number], input[type=date], input[type=time], input[type=datetime-local],
input[type=search], select, textarea {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border-strong);
  border-radius: var(--radius); background: white; font-family: inherit;
  /* 16px prevents iOS Safari from zooming the page when a field gets focus */
  font-size: 16px;
  color: var(--text); transition: all .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
textarea { resize: vertical; min-height: 80px; }

.input-icon { position: relative; flex: 1; min-width: 200px; }
.input-icon i { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-start: 12px; color: var(--text-muted); width: 16px; height: 16px; }
.input-icon input { padding-inline-start: 38px; }

.color-input { display: flex; gap: 6px; align-items: center; }
.color-input input[type=color] { width: 50px; height: 40px; padding: 2px; cursor: pointer; }
.color-input input[type=text] { flex: 1; }

.icon-select { font-family: 'Inter', sans-serif; }

/* Switch */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; }
.switch input { display: none; }
.slider { position: absolute; inset: 0; background: var(--border-strong); border-radius: 24px; cursor: pointer; transition: .3s; }
.slider::before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: white; border-radius: 50%; transition: .3s; }
[dir="rtl"] .slider::before { left: auto; right: 3px; }
.switch input:checked + .slider { background: var(--success); }
[dir="ltr"] .switch input:checked + .slider::before { transform: translateX(18px); }
[dir="rtl"] .switch input:checked + .slider::before { transform: translateX(-18px); }
.switch-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; }

/* ==========================================================
   Cards
   ========================================================== */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden;
}
.card + .card { margin-top: 18px; }
.card-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
}
.card-header h3 { margin: 0; font-size: 16px; }
.card-actions { display: flex; gap: 6px; }
.card-body { padding: 20px; }

/* ==========================================================
   Badges / Pills
   ========================================================== */
.badge {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: 999px; font-size: 11px; font-weight: 700;
  background: var(--bg-muted); color: var(--text);
}
.badge-active, .badge-success, .badge-published, .badge-active { background: #dcfce7; color: #166534; }
.badge-draft, .badge-pending, .badge-inactive { background: #f1f5f9; color: #475569; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger, .badge-archived { background: #fee2e2; color: #991b1b; }
.badge-closed { background: #f3e8ff; color: #6b21a8; }

.counter-pill {
  display: inline-block; min-width: 28px; padding: 2px 10px; border-radius: 999px;
  background: var(--primary); color: white; font-weight: 700; font-size: 12px; text-align: center;
}

.role-pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.role-super_admin { background: #fef3c7; color: #92400e; }
.role-admin { background: #dbeafe; color: #1e40af; }
.role-event_manager { background: #f3e8ff; color: #6b21a8; }
.role-scanner { background: #d1fae5; color: #065f46; }

/* ==========================================================
   Tables
   ========================================================== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; }
.table th { background: var(--bg-muted); font-weight: 700; padding: 10px 14px; text-align: start; font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
.table td { padding: 12px 14px; border-top: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:hover { background: rgba(99,102,241,.03); }
.cell-strong { font-weight: 600; }
.cell-muted { font-size: 12px; color: var(--text-muted); }

/* User cell */
.user-cell { display: flex; gap: 10px; align-items: center; }
.user-avatar-sm {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white; font-weight: 700; display: flex; align-items: center; justify-content: center;
}

/* Category cell */
.cat-cell { display: flex; gap: 10px; align-items: center; }
.cat-icon { width: 36px; height: 36px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: white; }
.cat-icon i { width: 18px; height: 18px; }

/* ==========================================================
   Toolbar
   ========================================================== */
.page-toolbar {
  display: flex; gap: 10px; justify-content: space-between; align-items: center;
  margin-bottom: 16px; flex-wrap: wrap;
}
.toolbar-search {
  display: flex; gap: 8px; flex: 1; flex-wrap: wrap; max-width: 700px;
}
.toolbar-search select { width: auto; min-width: 130px; }

/* ==========================================================
   Pagination
   ========================================================== */
.pagination {
  display: flex; gap: 4px; justify-content: center; margin: 20px 0;
}
.pagination a {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 10px; border-radius: 8px;
  background: var(--bg-card); color: var(--text); border: 1px solid var(--border);
  font-weight: 600; font-size: 14px;
}
.pagination a:hover { background: var(--bg-muted); }
.pagination a.active { background: var(--primary); color: white; border-color: var(--primary); }
.pagination a.disabled { pointer-events: none; opacity: .4; }
.pagination .dots { display: inline-flex; align-items: center; padding: 0 6px; color: var(--text-muted); }

/* ==========================================================
   Empty states
   ========================================================== */
.empty-state, .empty-state-large {
  text-align: center; padding: 30px 20px; color: var(--text-muted);
}
.empty-state-large { padding: 60px 20px; }
.empty-icon {
  width: 80px; height: 80px; border-radius: 50%; background: var(--bg-muted);
  display: inline-flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.empty-icon i { width: 36px; height: 36px; color: var(--text-light); }

/* ==========================================================
   Alerts
   ========================================================== */
.alert {
  padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px;
  border-inline-start: 4px solid; font-size: 14px;
}
.alert-success { background: #f0fdf4; border-color: var(--success); color: #166534; }
.alert-error, .alert-danger { background: #fef2f2; border-color: var(--danger); color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: var(--warning); color: #92400e; }
.alert-info { background: #eff6ff; border-color: var(--info); color: #1e40af; }

/* ==========================================================
   Toast
   ========================================================== */
.toast-container {
  position: fixed; bottom: 20px; inset-inline-end: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px; max-width: 360px;
}
.toast {
  background: white; border-radius: var(--radius); padding: 12px 16px;
  box-shadow: var(--shadow-lg); border-inline-start: 4px solid var(--primary);
  animation: slideIn .3s ease;
}
.toast-success { border-color: var(--success); }
.toast-error { border-color: var(--danger); }
.toast-warning { border-color: var(--warning); }
@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ==========================================================
   ADMIN LAYOUT
   ========================================================== */
.admin-body { background: var(--bg); }
.admin-shell { display: flex; min-height: 100vh; }

/* Sidebar */
.admin-sidebar {
  width: var(--sidebar-w); background: white;
  border-inline-end: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; bottom: 0; inset-inline-start: 0;
  z-index: 100; transition: transform .3s ease;
  overflow-y: auto;
}
.admin-sidebar-header {
  padding: 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h);
}
.admin-logo img { max-height: 38px; max-width: 160px; }
.admin-logo-text { font-size: 22px; font-weight: 800; color: var(--primary); }
.admin-sidebar-close {
  display: none; background: none; border: none; cursor: pointer;
  width: 36px; height: 36px; border-radius: 8px; color: var(--text-muted);
}
.admin-sidebar-close:hover { background: var(--bg-muted); }

.admin-nav { flex: 1; padding: 12px 0; }
.admin-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 20px; color: var(--text); font-weight: 500; font-size: 14px;
  border-inline-start: 3px solid transparent;
  transition: all .15s;
}
.admin-nav a:hover { background: var(--bg-muted); color: var(--primary); }
.admin-nav a.active {
  background: linear-gradient(90deg, rgba(99,102,241,.08), transparent);
  color: var(--primary);
  border-inline-start-color: var(--primary);
}
.admin-nav a i { width: 18px; height: 18px; flex-shrink: 0; }
.admin-nav-group {
  padding: 14px 20px 6px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; color: var(--text-light); letter-spacing: .05em;
}

.admin-sidebar-foot { padding: 12px; border-top: 1px solid var(--border); }
.admin-user-card {
  display: flex; align-items: center; gap: 10px; padding: 10px;
  border-radius: var(--radius); background: var(--bg-muted);
}
.user-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white; font-weight: 700; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-muted); }
.user-logout { width: 32px; height: 32px; border-radius: 6px; background: white; display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.user-logout:hover { background: var(--danger); color: white; }
.user-logout i { width: 16px; height: 16px; }

/* Main */
.admin-main {
  flex: 1; margin-inline-start: var(--sidebar-w);
  display: flex; flex-direction: column; min-height: 100vh;
}
.admin-topbar {
  height: var(--header-h); padding: 0 24px; background: white;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  position: sticky; top: 0; z-index: 50;
}
.admin-page-title { margin: 0; font-size: 19px; font-weight: 700; }
.admin-topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 8px; background: var(--bg-muted); color: var(--text); font-size: 13px;
}
.topbar-link:hover { background: var(--primary); color: white; }
.topbar-link i { width: 14px; height: 14px; }
.lang-switch { font-weight: 700; min-width: 36px; justify-content: center; }

.admin-content { flex: 1; padding: 22px; }

.admin-footer {
  background: white; border-top: 1px solid var(--border);
  padding: 14px 24px; display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-muted);
}
.admin-footer a { font-weight: 600; }
.admin-footer-by { display: flex; align-items: center; gap: 6px; }

/* Mobile bar */
.admin-mobilebar {
  display: none; height: var(--header-h); padding: 0 14px; background: white;
  border-bottom: 1px solid var(--border);
  align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 60;
}
.admin-toggle {
  width: 40px; height: 40px; border: none; background: var(--bg-muted);
  border-radius: 8px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 4px; cursor: pointer;
}
.admin-toggle span {
  display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px;
}
.admin-mobilebar-title { flex: 1; font-weight: 700; font-size: 16px; }
.admin-mobilebar-link {
  width: 40px; height: 40px; border-radius: 8px; background: var(--bg-muted);
  display: flex; align-items: center; justify-content: center; color: var(--text);
}

.admin-overlay {
  display: none; position: fixed; inset: 0; background: rgba(15,23,42,.5);
  z-index: 90; backdrop-filter: blur(2px);
}
.admin-overlay.show { display: block; }

/* ==========================================================
   Stats grids (Dashboard + Event detail)
   ========================================================== */
.stats-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.stat-card {
  background: white; border-radius: var(--radius-lg);
  border: 1px solid var(--border); padding: 18px;
  display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center;
  position: relative; overflow: hidden;
  transition: all .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-card::before {
  content: ""; position: absolute; top: 0; inset-inline-start: 0;
  width: 4px; height: 100%; background: var(--primary);
}
.stat-primary::before { background: linear-gradient(180deg, #6366f1, #8b5cf6); }
.stat-secondary::before { background: linear-gradient(180deg, #ec4899, #f97316); }
.stat-info::before { background: linear-gradient(180deg, #06b6d4, #3b82f6); }
.stat-accent::before { background: linear-gradient(180deg, #10b981, #059669); }
.stat-icon {
  width: 50px; height: 50px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(139,92,246,.12));
  color: var(--primary); display: flex; align-items: center; justify-content: center;
}
.stat-secondary .stat-icon { background: linear-gradient(135deg, rgba(236,72,153,.12), rgba(249,115,22,.12)); color: #ec4899; }
.stat-info .stat-icon { background: linear-gradient(135deg, rgba(6,182,212,.12), rgba(59,130,246,.12)); color: #0ea5e9; }
.stat-accent .stat-icon { background: linear-gradient(135deg, rgba(16,185,129,.12), rgba(5,150,105,.12)); color: #10b981; }
.stat-icon i { width: 24px; height: 24px; }
.stat-value { font-size: 26px; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.stat-foot {
  grid-column: 1 / -1; padding-top: 10px; border-top: 1px dashed var(--border);
  font-size: 12px; color: var(--text-muted);
}

/* Mini stats row */
.mini-stats {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.mini-stat {
  background: white; border-radius: var(--radius); border: 1px solid var(--border);
  padding: 12px; display: flex; align-items: center; gap: 10px;
}
.mini-icon { width: 38px; height: 38px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mini-icon i { width: 18px; height: 18px; }
.mini-num { font-size: 20px; font-weight: 800; line-height: 1; }
.mini-label { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* Welcome banner */
.welcome-banner {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white; padding: 22px 26px; border-radius: var(--radius-lg); margin-bottom: 18px;
  display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap;
  position: relative; overflow: hidden;
}
.welcome-banner::after {
  content: ""; position: absolute; right: -40px; top: -40px;
  width: 200px; height: 200px; background: rgba(255,255,255,.1); border-radius: 50%;
}
.welcome-text h2 { margin: 0 0 4px; color: white; }
.welcome-text .muted { color: rgba(255,255,255,.85); }
.welcome-banner .btn-primary {
  background: white; color: var(--primary); position: relative; z-index: 1;
}
.welcome-banner .btn-primary:hover { background: white; transform: translateY(-1px); color: var(--primary); }

/* Dashboard 2-col grids */
.dash-grid { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }

/* Charts */
.chart-card { min-height: 280px; }
.chart-legend { display: flex; gap: 20px; padding-top: 12px; border-top: 1px solid var(--border); margin-top: 12px; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; }
.chart-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-inline-end: 6px; vertical-align: middle; }
.pie-legend { padding-top: 12px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.pie-legend-item { display: flex; align-items: center; gap: 8px; }
.pie-legend-dot { width: 12px; height: 12px; border-radius: 3px; }
.pie-legend-num { margin-inline-start: auto; font-weight: 700; }

/* Event lists */
.event-list { list-style: none; margin: 0; padding: 0; }
.event-list li { border-bottom: 1px solid var(--border); }
.event-list li:last-child { border-bottom: none; }
.event-list a {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 12px; padding: 12px 16px; align-items: center; color: var(--text);
}
.event-list a:hover { background: var(--bg-muted); color: var(--text); }
.event-list-date {
  width: 50px; height: 50px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white; display: flex; flex-direction: column;
  align-items: center; justify-content: center; flex-shrink: 0;
}
.event-list-date strong { font-size: 18px; line-height: 1; }
.event-list-date span { font-size: 10px; opacity: .9; }
.event-list-info { min-width: 0; }
.event-list-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-list-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 8px; flex-wrap: wrap; margin-top: 3px; }
.event-list-meta i { width: 12px; height: 12px; vertical-align: middle; }
.event-list-arrow { width: 14px; height: 14px; color: var(--text-light); }
[dir="rtl"] .event-list-arrow { transform: scaleX(-1); }
.cat-mini { padding: 1px 8px; border-radius: 999px; background: var(--primary); color: white; font-size: 10px; font-weight: 700; }

/* Top events list */
.top-events-list { list-style: none; margin: 0; padding: 0; }
.top-events-list li {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border); align-items: center;
}
.top-events-list li:last-child { border-bottom: none; }
.rank { font-size: 13px; font-weight: 800; color: var(--text-light); }
.top-event-title { font-weight: 600; color: var(--text); }
.top-event-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.top-event-rate { font-size: 14px; font-weight: 800; color: var(--primary); }
.progress-bar { height: 5px; background: var(--bg-muted); border-radius: 999px; margin-top: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 999px; }

/* Scan list */
.scan-list { list-style: none; margin: 0; padding: 0; }
.scan-list li {
  display: flex; gap: 10px; align-items: center; padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.scan-list li:last-child { border-bottom: none; }
.scan-result { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.scan-result i { width: 14px; height: 14px; }
.scan-result-success { background: #dcfce7; color: #16a34a; }
.scan-result-already_used, .scan-result-duplicate { background: #fef3c7; color: #d97706; }
.scan-result-not_found, .scan-result-invalid, .scan-result-expired { background: #fee2e2; color: #dc2626; }
.scan-info { flex: 1; min-width: 0; }
.scan-time { font-size: 11px; flex-shrink: 0; }

/* Activity */
.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-list li {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
}
.activity-list li:last-child { border-bottom: none; }
.activity-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--primary); margin-top: 6px; flex-shrink: 0;
}
.activity-text { font-size: 13px; line-height: 1.5; }
.activity-time { font-size: 11px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }

/* ==========================================================
   Events grid (cards)
   ========================================================== */
.events-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.event-card {
  background: white; border-radius: var(--radius-lg); border: 1px solid var(--border);
  overflow: hidden; transition: all .2s; display: flex; flex-direction: column;
}
.event-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.event-cover {
  height: 140px; background: linear-gradient(135deg, var(--primary), var(--secondary));
  background-size: cover; background-position: center;
  position: relative;
}
.event-cover-fallback {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
}
.event-cover-fallback i { width: 56px; height: 56px; color: rgba(255,255,255,.55); }
.event-status-badge { position: absolute; top: 10px; inset-inline-end: 10px; }
.event-cat-tag {
  position: absolute; bottom: 10px; inset-inline-start: 10px;
  color: white; padding: 3px 12px; border-radius: 999px; font-size: 11px; font-weight: 700;
  backdrop-filter: blur(8px);
}
.event-body { padding: 14px 16px; flex: 1; }
.event-title {
  font-size: 16px; margin-bottom: 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.event-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.event-meta i { width: 13px; height: 13px; vertical-align: middle; margin-inline-end: 3px; }
.event-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  padding: 10px; background: var(--bg-muted); border-radius: var(--radius);
}
.estat { text-align: center; }
.estat-num { font-weight: 800; color: var(--primary); font-size: 16px; }
.estat-label { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.event-actions { display: flex; gap: 6px; padding: 0 16px 14px; align-items: center; }
.event-actions .btn-secondary { flex: 1; }

/* Event detail */
.event-detail-header {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  background-size: cover; background-position: center;
  border-radius: var(--radius-lg); padding: 30px; color: white;
  display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap;
}
.event-detail-header h1 { color: white; margin: 8px 0; font-size: 26px; }
.event-detail-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; }
.event-detail-meta .badge { background: rgba(255,255,255,.2); color: white; }
.event-detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.event-detail-actions .btn-secondary { background: rgba(255,255,255,.95); color: var(--text); }
.event-detail-grid { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.detail-list { display: flex; flex-direction: column; gap: 8px; }
.detail-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.detail-row:last-child { border: none; }
.phase-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.phase-list li { display: flex; gap: 10px; align-items: center; color: var(--text-muted); padding: 6px 0; }
.phase-list i { width: 16px; height: 16px; color: var(--primary); }

/* Cover uploader */
.cover-uploader { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.cover-preview {
  width: 100%; max-width: 480px; aspect-ratio: 16/9;
  border: 2px dashed var(--border-strong); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; background: var(--bg-muted);
}
.cover-preview img { width: 100%; height: 100%; object-fit: cover; }
.cover-placeholder { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text-muted); }
.cover-placeholder i { width: 36px; height: 36px; }
.cover-actions { display: flex; gap: 8px; }

/* Assign cards */
.assign-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.assign-card {
  display: flex; align-items: center; gap: 10px; padding: 12px;
  border: 2px solid var(--border); border-radius: var(--radius); cursor: pointer;
  background: white; transition: all .15s;
}
.assign-card:hover { border-color: var(--primary-light); }
.assign-card.checked { border-color: var(--primary); background: rgba(99,102,241,.04); }
.assign-card input { display: none; }
.assign-card-body { flex: 1; }
.assign-card-title { font-weight: 600; margin-bottom: 4px; }
.assign-card-meta { font-size: 11px; color: var(--text-muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.assign-card-meta i { width: 12px; height: 12px; }
.assign-card-check {
  width: 24px; height: 24px; border-radius: 50%; background: var(--bg-muted);
  display: flex; align-items: center; justify-content: center; color: white; flex-shrink: 0;
}
.assign-card.checked .assign-card-check { background: var(--primary); }
.assign-card.checked .assign-card-check i { width: 14px; height: 14px; }
.assign-card:not(.checked) .assign-card-check i { display: none; }

/* ==========================================================
   PUBLIC SITE
   ========================================================== */
.public-body { background: white; }

/* Public navbar */
.public-nav {
  position: sticky; top: 0; background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border); z-index: 50;
}
.nav-inner {
  height: 70px; display: flex; align-items: center; justify-content: space-between;
}
.nav-logo img { max-height: 40px; }
.nav-logo-text { font-size: 22px; font-weight: 800; color: var(--primary); }
.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-links a {
  padding: 8px 14px; color: var(--text); font-weight: 500;
  border-radius: 8px; font-size: 14px;
}
.nav-links a:hover, .nav-links a.active { background: var(--bg-muted); color: var(--primary); }
.nav-links .lang-link { font-weight: 700; }
.btn-nav-cta {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white !important; padding: 9px 18px !important; margin-inline-start: 4px;
}
.btn-nav-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(99,102,241,.3); background: linear-gradient(135deg, var(--primary), var(--secondary)) !important; color: white !important; }

.nav-toggle {
  display: none; width: 40px; height: 40px; background: none; border: none;
  flex-direction: column; gap: 5px; cursor: pointer; padding: 0;
  align-items: center; justify-content: center;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; }

/* Hero */
.hero {
  position: relative; padding: 60px 0 80px; overflow: hidden;
  background: linear-gradient(180deg, #fafafe 0%, white 100%);
}
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.hero-shape { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .35; }
.hero-shape-1 { width: 500px; height: 500px; background: var(--primary); top: -200px; right: -100px; }
.hero-shape-2 { width: 350px; height: 350px; background: var(--accent); bottom: -100px; left: -50px; }
.hero-shape-3 { width: 280px; height: 280px; background: var(--secondary); top: 40%; left: 30%; opacity: .15; }
.hero-inner {
  position: relative; display: grid; grid-template-columns: 1fr 1fr;
  gap: 50px; align-items: center;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; background: rgba(99,102,241,.1);
  border: 1px solid rgba(99,102,241,.2);
  border-radius: 999px; color: var(--primary); font-size: 13px; font-weight: 600;
  margin-bottom: 20px;
}
.dot-pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--primary);
  box-shadow: 0 0 0 0 rgba(99,102,241,.5); animation: pulse 2s infinite;
}
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(99,102,241,.5)} 70%{box-shadow:0 0 0 10px rgba(99,102,241,0)} 100%{box-shadow:0 0 0 0 rgba(99,102,241,0)} }

.hero-title { font-size: 48px; line-height: 1.15; margin-bottom: 20px; font-weight: 800; }
.hero-sub { font-size: 18px; color: var(--text-muted); margin-bottom: 28px; max-width: 600px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 30px; }

.btn-hero-primary, .btn-hero-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 28px; border-radius: 12px; font-weight: 700; font-size: 15px;
  transition: all .2s; cursor: pointer; border: none;
}
.btn-hero-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary)); color: white;
  box-shadow: 0 10px 25px -5px rgba(99,102,241,.4);
}
.btn-hero-primary:hover { transform: translateY(-2px); box-shadow: 0 15px 30px -5px rgba(99,102,241,.5); color: white; }
.btn-hero-ghost { background: white; color: var(--text); border: 1px solid var(--border-strong); }
.btn-hero-ghost:hover { background: var(--bg-muted); }

.hero-trust { display: flex; gap: 18px; flex-wrap: wrap; }
.trust-item { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 13px; }
.trust-item i { width: 16px; height: 16px; color: var(--success); }

.hero-visual { position: relative; height: 400px; }
.hero-card-stack { position: relative; width: 100%; height: 100%; }
.hero-card {
  position: absolute; background: white; border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,.18);
  padding: 16px 20px; display: flex; gap: 14px; align-items: center;
  width: 290px; animation: float 4s ease-in-out infinite;
}
.hero-card-1 { top: 20px; right: 0; }
.hero-card-2 { top: 140px; right: -40px; animation-delay: .5s; }
.hero-card-3 { top: 270px; right: 30px; animation-delay: 1s; }
[dir="ltr"] .hero-card-1 { right: auto; left: 0; }
[dir="ltr"] .hero-card-2 { right: auto; left: -40px; }
[dir="ltr"] .hero-card-3 { right: auto; left: 30px; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.hcard-icon {
  width: 50px; height: 50px; border-radius: 12px;
  background: rgba(99,102,241,.12); color: var(--primary);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.hcard-icon i { width: 22px; height: 22px; }
.hcard-title { font-weight: 700; font-size: 15px; margin-bottom: 2px; }
.hcard-sub { font-size: 12px; color: var(--text-muted); }

/* Stats bar */
.stats-bar {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  padding: 50px 0; color: white;
}
.stats-bar-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; text-align: center;
}
.stat-item .stat-num { font-size: 36px; font-weight: 800; line-height: 1; }
.stat-item .stat-text { font-size: 14px; opacity: .9; margin-top: 6px; }

/* Section heads */
.section-head { text-align: center; max-width: 700px; margin: 0 auto 40px; }
.section-eyebrow {
  display: inline-block; padding: 4px 14px; background: rgba(99,102,241,.1);
  border-radius: 999px; color: var(--primary); font-size: 13px; font-weight: 700;
  margin-bottom: 12px;
}
.section-head h2 { font-size: 36px; margin-bottom: 12px; }
.section-sub { font-size: 17px; color: var(--text-muted); margin: 0; }

.how-section, .features-section, .usecases-section, .cta-section { padding: 70px 0; }
.usecases-section, .features-section { background: #fafbfd; }

/* How it works */
.how-grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.how-card {
  background: white; padding: 28px 22px; border-radius: var(--radius-lg);
  border: 1px solid var(--border); position: relative; transition: all .2s;
}
.how-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--primary-light); }
.how-num {
  position: absolute; top: -16px; inset-inline-start: 22px;
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px;
  box-shadow: 0 6px 14px rgba(99,102,241,.3);
}
.how-icon {
  width: 56px; height: 56px; border-radius: 14px;
  background: rgba(99,102,241,.1); color: var(--primary);
  display: flex; align-items: center; justify-content: center; margin: 8px 0 14px;
}
.how-icon i { width: 26px; height: 26px; }
.how-card h3 { font-size: 18px; margin-bottom: 8px; }
.how-card p { font-size: 14px; color: var(--text-muted); margin: 0; }

/* Features */
.features-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.feature-card {
  background: white; padding: 24px; border-radius: var(--radius-lg);
  border: 1px solid var(--border); transition: all .2s;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.feat-icon { width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.feat-icon i { width: 22px; height: 22px; }
.feature-card h3 { font-size: 17px; margin-bottom: 8px; }
.feature-card p { font-size: 14px; color: var(--text-muted); margin: 0; }

/* Use cases */
.usecase-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.usecase-card {
  background: white; padding: 24px 16px; border-radius: var(--radius); border: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-align: center; transition: all .2s;
}
.usecase-card:hover { transform: translateY(-3px); border-color: var(--primary-light); color: var(--primary); }
.usecase-card i { width: 32px; height: 32px; color: var(--primary); }
.usecase-card span { font-weight: 600; font-size: 14px; }

/* CTA */
.cta-card {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-xl); padding: 50px 40px; color: white;
  display: flex; gap: 30px; align-items: center; flex-wrap: wrap;
  position: relative; overflow: hidden;
}
.cta-card::before {
  content: ""; position: absolute; right: -100px; top: -100px;
  width: 350px; height: 350px; background: rgba(255,255,255,.1); border-radius: 50%;
}
.cta-text { flex: 1; min-width: 250px; position: relative; z-index: 1; }
.cta-text h2 { color: white; font-size: 30px; margin-bottom: 8px; }
.cta-text p { color: rgba(255,255,255,.9); margin: 0; font-size: 16px; }
.cta-actions { display: flex; gap: 12px; flex-wrap: wrap; position: relative; z-index: 1; }
.cta-card .btn-hero-primary { background: white; color: var(--primary); }
.cta-card .btn-hero-primary:hover { background: white; color: var(--primary); transform: translateY(-2px); }
.cta-card .btn-hero-ghost { background: rgba(255,255,255,.15); color: white; border-color: rgba(255,255,255,.3); }
.cta-card .btn-hero-ghost:hover { background: rgba(255,255,255,.25); }

/* ==========================================================
   PUBLIC FOOTER
   ========================================================== */
.public-footer { background: #0f172a; color: #cbd5e1; padding: 50px 0 0; margin-top: 60px; }
.footer-grid { display: grid; gap: 40px; grid-template-columns: 1.5fr 1fr 1.5fr; padding-bottom: 36px; }
.footer-col h4 { color: white; font-size: 16px; margin-bottom: 18px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-col ul a { color: #cbd5e1; font-size: 14px; }
.footer-col ul a:hover { color: white; }
.footer-logo img { max-height: 40px; }
.footer-logo-text { font-size: 22px; font-weight: 800; color: white; }
.footer-tagline { color: #94a3b8; margin: 12px 0 6px; font-size: 14px; }
.footer-desc { color: #94a3b8; font-size: 13px; line-height: 1.7; margin: 0 0 18px; max-width: 380px; }
.footer-social { display: flex; gap: 8px; }
.footer-social a {
  width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,.06);
  color: #cbd5e1; display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.footer-social a:hover { background: var(--primary); color: white; transform: translateY(-2px); }
.footer-social i { width: 18px; height: 18px; }

.footer-contact { gap: 12px !important; }
.footer-contact li { display: flex; gap: 10px; align-items: center; }
.footer-contact a { display: flex; gap: 10px; align-items: center; }
.footer-contact .ic {
  width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.06);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  color: var(--primary-light);
}
.footer-contact i { width: 16px; height: 16px; }

/* Footer bottom */
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08); padding: 18px 0;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 10px; font-size: 13px; color: #94a3b8;
}
.footer-credit { display: flex; align-items: center; gap: 6px; }
.credit-by { color: #94a3b8; }
.credit-company {
  color: white; font-weight: 700; display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
}
.credit-company:hover { background: var(--primary); color: white; transform: translateY(-1px); }
.credit-company i { width: 14px; height: 14px; }

/* ==========================================================
   ERROR PAGES
   ========================================================== */
.error-page { padding: 80px 20px; text-align: center; max-width: 500px; margin: 0 auto; }
.error-page h1 { font-size: 80px; margin: 0; color: var(--primary); }
.error-page .error-icon { font-size: 60px; margin-bottom: 20px; }

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 1024px) {
  .form-grid-3 { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero-inner { gap: 30px; }
  .hero-title { font-size: 38px; }
}

@media (max-width: 880px) {
  .admin-sidebar { transform: translateX(-100%); width: 280px; box-shadow: var(--shadow-xl); }
  [dir="rtl"] .admin-sidebar { transform: translateX(100%); }
  .admin-sidebar.show { transform: translateX(0); }
  .admin-sidebar-close { display: flex; align-items: center; justify-content: center; }
  .admin-main { margin-inline-start: 0; }
  .admin-mobilebar { display: flex; }
  .admin-topbar { display: none; }
  .dash-grid, .event-detail-grid { grid-template-columns: 1fr; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: 1fr; }

  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .hero-title { font-size: 32px; }
  .hero-sub { font-size: 16px; }
  .stats-bar-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
  .stat-item .stat-num { font-size: 28px; }
  .section-head h2 { font-size: 28px; }

  .nav-toggle { display: flex; }
  .nav-links {
    display: none; position: absolute; top: 100%; inset-inline: 0;
    background: white; flex-direction: column; padding: 14px;
    border-top: 1px solid var(--border); gap: 4px;
    box-shadow: var(--shadow-lg);
  }
  .nav-links.show { display: flex; }
  .nav-links a { width: 100%; padding: 12px 16px; }

  .footer-grid { grid-template-columns: 1fr; gap: 30px; }

  .cta-card { padding: 30px 24px; }
  .cta-text h2 { font-size: 24px; }
}

@media (max-width: 600px) {
  body { font-size: 14px; }
  .container { padding: 0 14px; }
  .admin-content { padding: 14px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 22px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .mini-stats { grid-template-columns: 1fr 1fr; }
  .events-grid { grid-template-columns: 1fr; }
  .page-toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-search { flex-direction: column; }
  .toolbar-search > * { width: 100%; min-width: 0; }
  .input-icon { min-width: 0; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions > * { width: 100%; }
  .welcome-banner { padding: 18px; }
  .welcome-text h2 { font-size: 20px; }
  .event-detail-header { padding: 20px; }
  .event-detail-header h1 { font-size: 20px; }
  .stats-bar-grid { grid-template-columns: 1fr 1fr; }
  .stat-item .stat-num { font-size: 24px; }
  .hero { padding: 40px 0 60px; }
  .hero-title { font-size: 26px; }
  .hero-sub { font-size: 15px; }
  .section-head h2 { font-size: 24px; }
  .how-section, .features-section, .usecases-section, .cta-section { padding: 50px 0; }
  .table th, .table td { padding: 8px 10px; font-size: 13px; }
  .user-cell { gap: 6px; }
  .user-avatar-sm { width: 30px; height: 30px; font-size: 13px; }

  /* Fix admin grids on tiny screens */
  .stat-card { grid-template-columns: 1fr; gap: 8px; }
  .stat-card::before { width: 3px; }
  .stat-foot { grid-column: 1; }

  .footer-bottom { flex-direction: column; text-align: center; }
}

@media (max-width: 380px) {
  .stats-grid, .mini-stats { grid-template-columns: 1fr; }
}

/* ==========================================================
   AUTH PAGES (login, forgot password)
   ========================================================== */
.auth-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 20%, rgba(99,102,241,.15), transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(236,72,153,.12), transparent 40%),
    linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.auth-wrapper {
  width: 100%; max-width: 440px;
}
.auth-card {
  background: white; border-radius: var(--radius-xl); padding: 38px 36px;
  box-shadow: 0 25px 50px -12px rgba(15,23,42,.18), 0 10px 25px -5px rgba(99,102,241,.1);
  border: 1px solid rgba(99,102,241,.08);
}
.auth-brand {
  text-align: center; margin-bottom: 24px;
}
.auth-brand img { max-height: 56px; max-width: 200px; margin: 0 auto; }
.auth-brand-text {
  display: inline-block; font-size: 28px; font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.auth-title {
  font-size: 24px; font-weight: 800; margin: 0 0 6px; text-align: center;
}
.auth-subtitle {
  text-align: center; color: var(--text-muted); margin: 0 0 26px; font-size: 14px;
}
.auth-form {
  display: flex; flex-direction: column; gap: 14px;
}
.auth-form .input-icon {
  position: relative; min-width: 0;
}
.auth-form .input-icon i[data-icon] {
  position: absolute; top: 50%; transform: translateY(-50%); inset-inline-start: 14px;
  width: 18px; height: 18px; color: var(--text-muted); pointer-events: none;
}
.auth-form input[type=email],
.auth-form input[type=password],
.auth-form input[type=text] {
  width: 100%; padding: 13px 16px; padding-inline-start: 44px;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: white; font-size: 15px; transition: all .2s;
}
.auth-form input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99,102,241,.12);
}
.toggle-password {
  position: absolute; top: 50%; transform: translateY(-50%); inset-inline-end: 12px;
  background: none; border: none; cursor: pointer; padding: 6px;
  color: var(--text-muted); border-radius: 6px;
}
.toggle-password:hover { color: var(--primary); background: var(--bg-muted); }
.toggle-password i[data-icon] { width: 18px; height: 18px; }
.form-row {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 10px; margin-top: -4px;
}
.checkbox {
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; font-size: 13px; color: var(--text-muted); user-select: none;
}
.checkbox input[type=checkbox] {
  width: 18px; height: 18px; cursor: pointer; accent-color: var(--primary);
}
.link-muted {
  color: var(--text-muted); font-size: 13px; font-weight: 500;
}
.link-muted:hover { color: var(--primary); }
.auth-form .btn-primary {
  margin-top: 8px; padding: 14px 18px; font-size: 15px;
}
.auth-footer {
  margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border);
  text-align: center;
}
.auth-footer .lang-switch {
  display: inline-flex; padding: 6px 16px; border-radius: 999px;
  background: var(--bg-muted); color: var(--text); font-size: 13px; font-weight: 600;
}
.auth-footer .lang-switch:hover { background: var(--primary); color: white; }
.auth-card .alert {
  margin-bottom: 18px;
}

/* Mobile auth */
@media (max-width: 480px) {
  .auth-card { padding: 28px 22px; border-radius: var(--radius-lg); }
  .auth-title { font-size: 20px; }
  .auth-form input { font-size: 16px; /* prevents iOS zoom */ }
}

/* ==========================================================
   FIX: Constrain icon sizes in specific contexts
   ========================================================== */
.footer-contact i[data-icon] { width: 16px; height: 16px; }
.footer-social a i[data-icon] { width: 18px; height: 18px; }
.btn-icon i[data-icon] { width: 16px; height: 16px; }
.event-list-meta i[data-icon] { width: 12px; height: 12px; }
.event-meta i[data-icon] { width: 13px; height: 13px; }
.detail-row i[data-icon] { width: 14px; height: 14px; }

/* Stat icons */
.stat-icon i[data-icon] { width: 24px; height: 24px; }
.mini-icon i[data-icon] { width: 18px; height: 18px; }
.feat-icon i[data-icon] { width: 22px; height: 22px; }
.how-icon i[data-icon] { width: 26px; height: 26px; }
.empty-icon i[data-icon] { width: 36px; height: 36px; }
.usecase-card i[data-icon] { width: 32px; height: 32px; }
.cat-icon i[data-icon] { width: 18px; height: 18px; }
.scan-result i[data-icon] { width: 14px; height: 14px; }
.event-cover-fallback i[data-icon] { width: 56px; height: 56px; }
.cover-placeholder i[data-icon] { width: 36px; height: 36px; }
.assign-card-check i[data-icon] { width: 14px; height: 14px; }
.event-list-arrow { width: 14px; height: 14px; }
.event-list-arrow[data-icon] { width: 14px; height: 14px; }
.hero-card i[data-icon] { width: 22px; height: 22px; }
.trust-item i[data-icon] { width: 16px; height: 16px; }
.btn-hero-primary i[data-icon],
.btn-hero-ghost i[data-icon] { width: 18px; height: 18px; }
.btn-primary i[data-icon],
.btn-secondary i[data-icon] { width: 16px; height: 16px; }
.btn-nav-cta i[data-icon] { width: 16px; height: 16px; }
.admin-nav i[data-icon] { width: 18px; height: 18px; }
.user-logout i[data-icon] { width: 16px; height: 16px; }
.topbar-link i[data-icon] { width: 14px; height: 14px; }
.input-icon i[data-icon] { width: 16px; height: 16px; }
.event-detail-meta i[data-icon] { width: 14px; height: 14px; }
.phase-list i[data-icon] { width: 16px; height: 16px; }
.admin-mobilebar-link i[data-icon] { width: 18px; height: 18px; }
.admin-sidebar-close i[data-icon] { width: 16px; height: 16px; }
.event-actions i[data-icon] { width: 14px; height: 14px; }
.credit-company i[data-icon] { width: 14px; height: 14px; }
.scan-list i[data-icon] { width: 14px; height: 14px; }
.activity-list i[data-icon] { width: 14px; height: 14px; }

/* ==========================================================
   ABOUT / FEATURES public pages
   ========================================================== */
.page-hero {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white; padding: 80px 0 60px; text-align: center;
  position: relative; overflow: hidden;
}
.page-hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.1), transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,.08), transparent 50%);
}
.page-hero-content { position: relative; z-index: 1; }
.page-hero h1 { color: white; font-size: 44px; margin-bottom: 12px; font-weight: 800; }
.page-hero p { font-size: 18px; opacity: .92; max-width: 700px; margin: 0 auto; }
.page-section { padding: 60px 0; }
.page-section.alt { background: #fafbfd; }

.about-grid {
  display: grid; gap: 40px; grid-template-columns: 1fr 1fr; align-items: center;
}
.about-img-wrap {
  position: relative; aspect-ratio: 4/3; border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-xl);
}
.about-img-wrap i[data-icon] { width: 120px; height: 120px; color: rgba(255,255,255,.5); }
.about-text h2 { font-size: 32px; margin-bottom: 16px; }
.about-text p { color: var(--text-muted); margin-bottom: 14px; line-height: 1.8; }
.about-points { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-direction: column; gap: 12px; }
.about-points li { display: flex; gap: 10px; align-items: start; }
.about-points li .check {
  width: 22px; height: 22px; border-radius: 50%; background: var(--success);
  color: white; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.about-points li .check i[data-icon] { width: 12px; height: 12px; }

.values-grid {
  display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.value-card {
  background: white; border-radius: var(--radius-lg); padding: 26px;
  border: 1px solid var(--border); text-align: center; transition: all .2s;
}
.value-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.value-icon {
  width: 64px; height: 64px; border-radius: 16px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(236,72,153,.12));
  color: var(--primary);
}
.value-icon i[data-icon] { width: 28px; height: 28px; }
.value-card h3 { font-size: 17px; margin-bottom: 8px; }
.value-card p { color: var(--text-muted); font-size: 14px; margin: 0; }

@media (max-width: 880px) {
  .about-grid { grid-template-columns: 1fr; gap: 30px; }
  .page-hero h1 { font-size: 30px; }
  .page-hero { padding: 50px 0 40px; }
}

/* ==========================================================
   CONTACT page
   ========================================================== */
.contact-grid {
  display: grid; gap: 30px; grid-template-columns: 1fr 1.5fr;
}
.contact-info { display: flex; flex-direction: column; gap: 14px; }
.contact-info-card {
  background: white; border-radius: var(--radius-lg); padding: 20px;
  border: 1px solid var(--border); display: flex; gap: 14px; align-items: center;
  transition: all .2s;
}
.contact-info-card:hover { transform: translateX(4px); box-shadow: var(--shadow); }
[dir="rtl"] .contact-info-card:hover { transform: translateX(-4px); }
.contact-info-icon {
  width: 50px; height: 50px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(139,92,246,.12));
  color: var(--primary); display: flex; align-items: center; justify-content: center;
}
.contact-info-icon i[data-icon] { width: 22px; height: 22px; }
.contact-info-card h4 { margin: 0 0 4px; font-size: 14px; }
.contact-info-card p { margin: 0; color: var(--text-muted); font-size: 13px; }
.contact-info-card a { color: var(--text); }
.contact-form-card {
  background: white; border-radius: var(--radius-lg); padding: 30px;
  border: 1px solid var(--border);
}

@media (max-width: 880px) {
  .contact-grid { grid-template-columns: 1fr; }
}
/* ==========================================================
   EventFlow Design Module CSS
   ========================================================== */

/* ==========================================================
   Toolbar back button
   ========================================================== */
.toolbar-back .btn-ghost {
  padding: 8px 14px;
  display: inline-flex; gap: 8px; align-items: center;
}
[dir="rtl"] .toolbar-back .btn-ghost i[data-icon="arrow"] { transform: scaleX(-1); }

/* ==========================================================
   Designs grid
   ========================================================== */
.designs-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.design-card {
  background: white; border-radius: var(--radius-lg);
  border: 1px solid var(--border); overflow: hidden;
  display: flex; flex-direction: column; transition: all .2s;
}
.design-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.design-thumb {
  position: relative; aspect-ratio: 4/3; background: #f1f5f9;
  overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.design-thumb img {
  width: 100%; height: 100%; object-fit: contain; background: #f8fafc;
}
.design-default-badge {
  position: absolute; top: 10px; inset-inline-end: 10px;
  display: inline-flex; align-items: center; gap: 4px;
}
.design-default-badge i[data-icon] { width: 12px; height: 12px; }
.design-type-badge {
  position: absolute; top: 10px; inset-inline-start: 10px;
  background: rgba(15,23,42,.7); color: white;
  padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
  backdrop-filter: blur(4px);
}
.design-type-honor { background: linear-gradient(135deg, #c9a227, #f59e0b); }
.design-type-badge i[data-icon] { width: 12px; height: 12px; }
.design-body { padding: 14px 16px; flex: 1; }
.design-name {
  font-size: 16px; margin: 0 0 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.design-meta {
  display: flex; gap: 10px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-muted);
}
.design-meta i[data-icon] { width: 12px; height: 12px; vertical-align: middle; margin-inline-end: 3px; }
.design-actions {
  display: flex; gap: 6px; padding: 0 16px 14px; align-items: center;
}
.design-actions .btn-block { flex: 1; }
.design-actions .btn-block i[data-icon] { width: 14px; height: 14px; }

/* ==========================================================
   Design upload zone
   ========================================================== */
.design-upload-zone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius-lg);
  padding: 40px 20px; text-align: center; background: #fafbfd;
  cursor: pointer; transition: all .2s;
  min-height: 200px;
  display: flex; align-items: center; justify-content: center;
}
.design-upload-zone:hover, .design-upload-zone.drag-over {
  border-color: var(--primary); background: rgba(99,102,241,.05);
}
.upload-zone-content { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.upload-zone-content i[data-icon] {
  width: 60px; height: 60px; color: var(--text-light);
  background: white; border-radius: 50%; padding: 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 8px;
}
.upload-zone-content h4 { margin: 0; }
.upload-zone-preview {
  display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%;
}
.upload-zone-preview img {
  max-width: 100%; max-height: 300px; border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ==========================================================
   DESIGN VISUAL EDITOR
   ========================================================== */
.design-editor-shell {
  background: #1e293b;
  margin: -22px;
  min-height: calc(100vh - var(--header-h));
  display: flex; flex-direction: column;
}
@media (max-width: 880px) {
  .design-editor-shell { margin: -14px; min-height: calc(100vh - var(--header-h)); }
}

.editor-toolbar {
  background: #0f172a; color: white; padding: 12px 18px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  border-bottom: 1px solid rgba(255,255,255,.1);
  position: sticky; top: 0; z-index: 50;
}
.editor-toolbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1; }
.editor-toolbar .btn-ghost { color: #cbd5e1; padding: 8px 12px; }
.editor-toolbar .btn-ghost:hover { background: rgba(255,255,255,.08); color: white; }
[dir="rtl"] .editor-toolbar .btn-ghost i[data-icon="arrow"] { transform: scaleX(-1); }

.editor-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.editor-name-input {
  background: transparent; border: none; color: white; font-size: 16px; font-weight: 700;
  padding: 4px 8px; border-radius: 6px; max-width: 250px;
}
.editor-name-input:hover { background: rgba(255,255,255,.06); }
.editor-name-input:focus { background: rgba(255,255,255,.1); outline: 2px solid var(--primary); }
.editor-event-name { font-size: 12px; color: #94a3b8; padding: 0 8px; }

.editor-toolbar-right { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }
.editor-toolbar-right .btn-secondary {
  background: rgba(255,255,255,.08); color: white; border-color: rgba(255,255,255,.15);
}
.editor-toolbar-right .btn-secondary:hover { background: rgba(255,255,255,.15); }
.editor-toolbar-right .btn-secondary i[data-icon] { width: 16px; height: 16px; }
.editor-toolbar-right .btn-primary i[data-icon] { width: 16px; height: 16px; }

/* Editor body */
.editor-body {
  display: grid; grid-template-columns: 1fr 320px;
  flex: 1; min-height: 0;
}

/* Canvas */
.editor-canvas-wrap {
  background: #1e293b;
  background-image:
    linear-gradient(45deg, rgba(255,255,255,.02) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,.02) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,.02) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.02) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  padding: 30px;
  display: flex; align-items: center; justify-content: center;
  overflow: auto;
}
.editor-canvas {
  position: relative; max-width: 100%; max-height: 100%;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,.5);
  background: white;
  user-select: none;
}
.editor-canvas img {
  display: block; max-width: 100%; max-height: calc(100vh - 200px);
  pointer-events: none;
  user-select: none;
}

/* Editor fields (draggable) */
.editor-field {
  position: absolute; cursor: move;
  border: 2px dashed rgba(99,102,241,.6);
  background: rgba(99,102,241,.08);
  display: flex; align-items: center; justify-content: center;
  padding: 4px;
  transition: border-color .15s, box-shadow .15s;
}
.editor-field:hover, .editor-field.focused {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99,102,241,.15);
}
.editor-field.is-dragging {
  border-style: solid; border-color: var(--accent);
  box-shadow: 0 0 0 6px rgba(236,72,153,.2);
}
.editor-field .field-label {
  position: absolute; top: -24px; inset-inline-start: 0;
  background: var(--primary); color: white;
  padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 700;
  pointer-events: none;
}
.editor-field-honor .field-label { background: linear-gradient(135deg, #c9a227, #f59e0b); }
.field-name-text {
  display: inline-block; width: 100%;
  white-space: nowrap; overflow: hidden;
}
.field-honor-text {
  display: inline-block; font-weight: 700;
}
.editor-field-qr { background: rgba(99,102,241,.05); }
.qr-placeholder {
  width: 100%; height: 100%;
  color: rgba(99,102,241,.7);
}
.qr-placeholder svg { width: 100%; height: 100%; display: block; }

/* Resize handle */
.resize-handle {
  position: absolute; width: 14px; height: 14px;
  background: var(--primary); border: 2px solid white;
  border-radius: 50%; cursor: nwse-resize;
  z-index: 5;
}
.handle-br { bottom: -8px; inset-inline-end: -8px; }

/* Preview mode (hide editor chrome) */
.editor-canvas.preview-mode .editor-field {
  border: none; background: transparent; cursor: default;
}
.editor-canvas.preview-mode .field-label,
.editor-canvas.preview-mode .resize-handle { display: none; }
.editor-canvas.preview-mode .editor-field-qr {
  background: white; border: 1px solid rgba(0,0,0,.1);
}

body.editor-dragging { cursor: move; user-select: none; }
body.editor-dragging * { user-select: none; }

/* Sidebar */
.editor-sidebar {
  background: white; border-inline-start: 1px solid var(--border);
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
}
.editor-tab-buttons {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--border);
}
.editor-tab-btn {
  background: none; border: none; padding: 12px 8px;
  cursor: pointer; font-family: inherit; font-size: 12px;
  color: var(--text-muted); display: flex; flex-direction: column;
  align-items: center; gap: 4px; border-bottom: 3px solid transparent;
  transition: all .15s;
}
.editor-tab-btn:hover { background: var(--bg-muted); color: var(--text); }
.editor-tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); background: rgba(99,102,241,.04); }
.editor-tab-btn i[data-icon] { width: 18px; height: 18px; }

.editor-tab-panel {
  padding: 18px; overflow-y: auto; flex: 1;
}
.editor-tab-panel h4 {
  margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
  font-size: 14px; color: var(--text);
}

.editor-control { margin-bottom: 14px; }
.editor-control > label {
  display: block; font-size: 12px; font-weight: 600;
  margin-bottom: 6px; color: var(--text-muted);
}
.editor-control small {
  display: block; margin-top: 4px; font-size: 11px; color: var(--text-light);
}
.grid-2-tight { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.control-num {
  display: flex; align-items: center; gap: 4px;
  background: var(--bg-muted); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 8px;
}
.control-num span:first-child {
  font-size: 11px; color: var(--text-muted); font-weight: 600; min-width: 20px;
}
.control-num input {
  flex: 1; min-width: 0; border: none; background: transparent;
  padding: 4px; font-size: 13px; text-align: center;
}
.control-num input:focus { outline: none; }
.control-num .suffix { font-size: 11px; color: var(--text-light); }

/* Button group */
.btn-group {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  gap: 4px; background: var(--bg-muted); padding: 3px; border-radius: 8px;
}
.btn-toggle {
  background: transparent; border: none; padding: 7px 6px;
  cursor: pointer; font-family: inherit; font-size: 12px;
  border-radius: 6px; color: var(--text-muted); font-weight: 600;
  transition: all .15s;
}
.btn-toggle:hover { background: rgba(99,102,241,.1); color: var(--primary); }
.btn-toggle.active { background: white; color: var(--primary); box-shadow: var(--shadow-sm); }

.info-box {
  background: var(--bg-muted); padding: 8px 12px;
  border-radius: 6px; font-size: 13px; font-weight: 600;
}

/* Editor responsive */
@media (max-width: 880px) {
  .editor-body { grid-template-columns: 1fr; }
  .editor-sidebar {
    border-inline-start: none; border-top: 1px solid var(--border);
    max-height: 50vh;
  }
  .editor-canvas-wrap { padding: 16px; }
  .editor-canvas img { max-height: calc(50vh - 40px); }
  .editor-name-input { max-width: 150px; font-size: 14px; }
  .editor-toolbar-right .btn-secondary span { display: none; }
}

@media (max-width: 600px) {
  .editor-toolbar { padding: 10px 12px; }
  .editor-toolbar-left { flex: 1; min-width: 0; gap: 8px; }
  .editor-toolbar-left .btn-ghost span { display: none; }
  .editor-event-name { display: none; }
}

/* ==========================================================
   FORM BUILDER (Phase 4)
   ========================================================== */
.fields-list { list-style: none; margin: 0; padding: 0; }
.field-row {
  display: grid; grid-template-columns: auto auto 1fr auto;
  gap: 12px; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  background: white; transition: background .15s;
}
.field-row:last-child { border-bottom: none; }
.field-row:hover { background: var(--bg-muted); }
.field-row.dragging { opacity: .4; background: rgba(99,102,241,.05); border-color: var(--primary); }
.field-drag-handle {
  cursor: grab; color: var(--text-light);
  width: 28px; height: 28px; display: flex;
  align-items: center; justify-content: center; border-radius: 6px;
}
.field-drag-handle:hover { background: var(--bg-muted); color: var(--text); }
.field-drag-handle:active { cursor: grabbing; }
.field-drag-handle i[data-icon] { width: 16px; height: 16px; }

.field-type-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(139,92,246,.12));
  color: var(--primary); display: flex; align-items: center; justify-content: center;
}
.field-type-icon i[data-icon] { width: 18px; height: 18px; }
.field-info { min-width: 0; }
.field-row .field-label {
  font-weight: 600; display: flex; align-items: center; gap: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.field-required { color: var(--danger); font-weight: 800; }
.field-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 10px; flex-wrap: wrap; margin-top: 3px; }
.field-meta i[data-icon] { width: 12px; height: 12px; vertical-align: middle; margin-inline-end: 3px; }
.field-type-badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  background: var(--bg-muted); color: var(--text-muted); font-size: 11px; font-weight: 600;
}
.field-key {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  background: var(--bg-muted); padding: 1px 8px; border-radius: 4px; font-size: 11px;
}
.field-options-count { color: var(--text-light); }
.field-actions { display: flex; gap: 4px; }
.field-system-badge {
  display: inline-flex; align-items: center; gap: 3px;
  background: #dcfce7; color: #166534; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
}
.field-system-badge i[data-icon] { width: 10px; height: 10px; }

.options-list { display: flex; flex-direction: column; gap: 8px; }
.option-row {
  display: grid;
  grid-template-columns: auto 1fr 1fr auto auto;
  gap: 8px; align-items: center;
}
.option-row input {
  padding: 8px 12px; border: 1px solid var(--border-strong);
  border-radius: 8px; font-size: 13px; min-width: 0;
}
.option-drag {
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  cursor: grab; color: var(--text-light); border-radius: 6px;
}
.option-drag:hover { background: var(--bg-muted); color: var(--text); }

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.55); backdrop-filter: blur(4px);
  z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  background: white; border-radius: var(--radius-lg);
  max-width: 640px; width: 100%; max-height: 85vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-xl);
  animation: slideUp .25s ease;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.modal-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-header h3 { margin: 0; font-size: 17px; }
.modal-body { padding: 20px; overflow-y: auto; }

.templates-grid {
  display: grid; gap: 10px;
  grid-template-columns: 1fr;
  margin-top: 14px;
}
@media (min-width: 600px) { .templates-grid { grid-template-columns: 1fr 1fr; } }
.template-card {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 12px; align-items: center;
  padding: 12px; border: 1px solid var(--border); border-radius: var(--radius);
  background: white; transition: all .15s;
}
.template-card:hover { border-color: var(--primary-light); box-shadow: var(--shadow-sm); }
.template-card.already-added { opacity: .55; background: var(--bg-muted); }
.template-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(139,92,246,.12));
  color: var(--primary); display: flex; align-items: center; justify-content: center;
}
.template-icon i[data-icon] { width: 18px; height: 18px; }
.template-name { font-weight: 600; font-size: 14px; }
.template-meta { font-size: 11px; color: var(--text-muted); display: flex; gap: 6px; flex-wrap: wrap; margin-top: 3px; align-items: center; }
.btn-template-add {
  background: var(--primary); color: white; border: none;
  padding: 6px 14px; border-radius: 8px; cursor: pointer;
  font-size: 12px; font-weight: 700; font-family: inherit;
  transition: all .15s; flex-shrink: 0;
}
.btn-template-add:hover:not(:disabled) { background: var(--primary-dark); }
.btn-template-add:disabled { background: var(--border-strong); color: var(--text-muted); cursor: not-allowed; }

@media (max-width: 600px) {
  .field-row { grid-template-columns: auto 1fr auto; }
  .field-type-icon { display: none; }
  .option-row {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
  }
  .option-row .option-drag { grid-column: 1 / -1; }
  .option-row input[name*="value"] { grid-column: 1 / 2; }
  .option-row .btn-icon-danger { grid-column: 2 / 3; justify-self: end; }
}

code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  background: var(--bg-muted); padding: 1px 6px; border-radius: 4px; font-size: 12px;
}

/* ==========================================================
   PHASE 5: INVITEES + IMPORT + SEND
   ========================================================== */

/* Status tabs */
.status-tabs {
  display: flex; gap: 4px; overflow-x: auto;
  background: white; border-radius: var(--radius);
  border: 1px solid var(--border); padding: 4px;
  margin-bottom: 14px;
  -webkit-overflow-scrolling: touch;
}
.status-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px;
  color: var(--text-muted); font-size: 13px; font-weight: 600;
  white-space: nowrap; transition: all .15s;
  flex-shrink: 0;
}
.status-tab:hover { background: var(--bg-muted); color: var(--text); }
.status-tab.active { background: var(--primary); color: white; }
.status-tab.active:hover { background: var(--primary-dark); color: white; }
.status-tab .count {
  display: inline-flex; min-width: 22px; height: 18px; padding: 0 6px;
  border-radius: 999px; background: rgba(255,255,255,.25);
  align-items: center; justify-content: center; font-size: 11px;
}
.status-tab:not(.active) .count { background: var(--bg-muted); color: var(--text-muted); }

/* Bulk toolbar */
.bulk-toolbar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.bulk-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Import wizard */
.import-step .step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white; font-weight: 800; font-size: 14px; margin-inline-end: 8px;
}
.success-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 80px; height: 80px; border-radius: 50%;
  background: #dcfce7; color: var(--success);
  margin: 0 auto 16px;
}
.success-icon i[data-icon] { width: 40px; height: 40px; }

/* Mapping grid */
.mapping-grid {
  display: grid; gap: 10px;
  grid-template-columns: 1fr;
  background: var(--bg-muted); border-radius: var(--radius);
  padding: 14px;
}
@media (min-width: 600px) {
  .mapping-grid { grid-template-columns: 1fr 1fr; }
}
.mapping-row {
  display: flex; gap: 10px; align-items: center;
  background: white; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--border);
}
.mapping-row label { flex-shrink: 0; min-width: 140px; font-size: 13px; }
.mapping-row select { flex: 1; min-width: 0; }

/* Method cards */
.method-cards {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.method-card {
  border: 2px solid var(--border); border-radius: var(--radius);
  padding: 14px; cursor: pointer; background: white;
  transition: all .15s; position: relative;
}
.method-card:hover { border-color: var(--primary-light); }
.method-card.disabled { opacity: .5; cursor: not-allowed; }
.method-card input { position: absolute; opacity: 0; }
.method-card:has(input:checked) { border-color: var(--primary); background: rgba(99,102,241,.04); }
.method-card-body { display: flex; gap: 12px; align-items: center; }
.method-card-body i[data-icon] {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(139,92,246,.12));
  color: var(--primary); border-radius: 10px;
  padding: 8px; box-sizing: border-box;
}
.method-name { font-weight: 700; font-size: 14px; }
.method-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Target options */
.target-options { display: flex; gap: 12px; flex-wrap: wrap; }
.target-radio {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px;
  background: var(--bg-muted); border: 2px solid transparent;
  cursor: pointer; font-size: 13px; font-weight: 600; user-select: none;
}
.target-radio:has(input:checked) { background: rgba(99,102,241,.08); border-color: var(--primary); color: var(--primary); }
.target-radio input { accent-color: var(--primary); }

/* Mobile */
@media (max-width: 600px) {
  .mapping-row { flex-direction: column; align-items: stretch; }
  .mapping-row label { min-width: 0; }
}

/* ==========================================================
   v6 PATCH — UI POLISH FIXES
   ========================================================== */

/* ===== Settings tabs (was missing!) ===== */
.settings-tabs {
  display: flex; gap: 4px; margin-bottom: 22px;
  background: white; padding: 6px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-sm);
}
.settings-tabs a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 13px; font-weight: 600;
  white-space: nowrap; flex-shrink: 0;
  transition: all .15s;
  text-decoration: none;
}
.settings-tabs a:hover { background: var(--bg-muted); color: var(--text); }
.settings-tabs a.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: 0 4px 12px rgba(99,102,241,.3);
}
.settings-tabs a.active:hover { color: white; }
.settings-tabs a i[data-icon] { width: 16px; height: 16px; flex-shrink: 0; }

/* ===== Form fields list — reinforce styles ===== */
.fields-list,
ul.fields-list {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block;
}
.fields-list .field-row,
ul.fields-list li.field-row {
  list-style: none !important;
  display: grid !important;
  grid-template-columns: auto auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: white;
  transition: background .15s;
}
.fields-list .field-row::marker,
ul.fields-list li.field-row::marker { content: none !important; }
.fields-list .field-row:last-child { border-bottom: none; }
.fields-list .field-row:hover { background: var(--bg-muted); }
.fields-list .field-row.dragging { opacity: .4; background: rgba(99,102,241,.06); }

.field-drag-handle {
  cursor: grab; color: var(--text-light);
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
}
.field-drag-handle:hover { background: var(--bg-muted); color: var(--text); }
.field-drag-handle:active { cursor: grabbing; }
.field-drag-handle i[data-icon] { width: 18px; height: 18px; }

.field-type-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(139,92,246,.12));
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.field-type-icon i[data-icon] { width: 20px; height: 20px; }

/* ===== Modal (templates picker) — make it not break out ===== */
.modal-overlay {
  position: fixed !important;
  inset: 0;
  background: rgba(15,23,42,.6) !important;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  z-index: 9999 !important;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
  animation: fadeIn .2s ease;
}
.modal-card {
  background: white;
  border-radius: var(--radius-lg);
  max-width: 720px;
  width: 100%;
  max-height: calc(100vh - 80px);
  display: flex; flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,.5);
  position: relative;
  animation: slideUp .25s ease;
  overflow: hidden;
}
.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  background: linear-gradient(180deg, white, #fafbfd);
  flex-shrink: 0;
}
.modal-header h3 { margin: 0; font-size: 17px; font-weight: 700; }
.modal-body {
  padding: 22px;
  overflow-y: auto;
  flex: 1;
}
.templates-grid {
  display: grid; gap: 10px;
  grid-template-columns: 1fr;
  margin-top: 14px;
}
@media (min-width: 600px) { .templates-grid { grid-template-columns: 1fr 1fr; } }
.template-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px; align-items: center;
  padding: 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: white;
  transition: all .15s;
}
.template-card:hover:not(.already-added) {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(99,102,241,.12);
  transform: translateY(-1px);
}
.template-card.already-added { opacity: .5; background: var(--bg-muted); }
.template-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(139,92,246,.12));
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.template-icon i[data-icon] { width: 20px; height: 20px; }
.template-name { font-weight: 700; font-size: 14px; line-height: 1.3; }
.template-meta {
  font-size: 11px; color: var(--text-muted);
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; align-items: center;
}
.btn-template-add {
  background: var(--primary); color: white; border: none;
  padding: 8px 16px; border-radius: 8px; cursor: pointer;
  font-size: 12px; font-weight: 700; font-family: inherit;
  white-space: nowrap;
  transition: all .15s; flex-shrink: 0;
}
.btn-template-add:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: scale(1.05);
}
.btn-template-add:disabled {
  background: var(--border-strong);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* ===== Design upload zone — much nicer ===== */
.design-upload-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 44px 24px;
  text-align: center;
  background: linear-gradient(180deg, #fafbfd, #f4f6fa);
  cursor: pointer;
  transition: all .2s ease;
  min-height: 240px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
}
.design-upload-zone:hover,
.design-upload-zone.drag-over {
  border-color: var(--primary);
  background: linear-gradient(180deg, rgba(99,102,241,.04), rgba(139,92,246,.06));
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -10px rgba(99,102,241,.25);
}
.upload-zone-content {
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
}
.upload-icon {
  width: 76px; height: 76px;
  background: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px -8px rgba(99,102,241,.3);
  margin-bottom: 14px;
  color: var(--primary);
}
.upload-icon i[data-icon] { width: 32px; height: 32px; }
.upload-zone-content h4 {
  margin: 0; font-size: 17px;
  color: var(--text);
}
.upload-zone-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}
.upload-zone-preview img {
  max-width: 100%;
  max-height: 320px;
  border-radius: var(--radius);
  box-shadow: 0 12px 32px -8px rgba(0,0,0,.18);
  border: 4px solid white;
}
.upload-preview-info {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap; justify-content: center;
  background: white; padding: 8px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}

/* Hint line below upload */
.hint-line {
  display: flex; gap: 10px; align-items: flex-start;
  margin-top: 10px;
  padding: 10px 14px;
  background: rgba(99,102,241,.06);
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.6;
}
.hint-line i[data-icon] {
  width: 16px; height: 16px;
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 2px;
}

/* ===== Status tabs improvements (invitees page) ===== */
.status-tabs {
  display: flex; gap: 4px;
  overflow-x: auto;
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 6px;
  margin-bottom: 14px;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-sm);
}
.status-tabs::-webkit-scrollbar { height: 3px; }
.status-tabs::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }
.status-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 13px; font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all .15s;
  text-decoration: none;
}
.status-tab:hover {
  background: var(--bg-muted);
  color: var(--text);
}
.status-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: 0 4px 12px rgba(99,102,241,.3);
}
.status-tab.active:hover { color: white; }
.status-tab .count {
  display: inline-flex;
  min-width: 22px; height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--bg-muted);
  color: var(--text-muted);
  align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.status-tab.active .count {
  background: rgba(255,255,255,.25);
  color: white;
}

/* ===== Method cards (send invitations) — fix highlight ===== */
.method-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  background: white;
  transition: all .15s;
  position: relative;
  user-select: none;
}
.method-card:hover:not(.disabled) {
  border-color: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.method-card input[type="radio"] {
  position: absolute;
  opacity: 0; pointer-events: none;
}
.method-card.disabled {
  opacity: .5;
  cursor: not-allowed;
  background: var(--bg-muted);
}
.method-card:has(input[type="radio"]:checked) {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(99,102,241,.04), rgba(139,92,246,.04));
  box-shadow: 0 4px 14px rgba(99,102,241,.18);
}

/* ===== Page toolbar (back button improvements) ===== */
.page-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.toolbar-back .btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 14px;
  color: var(--text-muted);
}
.toolbar-back .btn-ghost:hover {
  background: var(--bg-muted);
  color: var(--text);
}
[dir="rtl"] .toolbar-back .btn-ghost i[data-icon="arrow"] {
  transform: scaleX(-1);
}

/* ===== Empty state polish ===== */
.empty-state-large {
  text-align: center;
  padding: 60px 20px;
}
.empty-state-large .empty-icon {
  width: 80px; height: 80px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99,102,241,.1), rgba(139,92,246,.1));
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.empty-state-large .empty-icon i[data-icon] {
  width: 36px; height: 36px;
}
.empty-state-large h3 { margin: 0 0 6px; font-size: 18px; }
.empty-state-large p { margin: 0; max-width: 420px; margin-inline: auto; line-height: 1.6; }

/* ===== Bulk toolbar polish ===== */
.bulk-toolbar {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
}
.bulk-toolbar .checkbox {
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer;
  font-weight: 600;
}
.bulk-actions {
  display: flex; gap: 8px; align-items: center;
}
.bulk-actions .btn-sm {
  padding: 7px 14px;
  font-size: 13px;
}

/* ===== Mobile polish ===== */
@media (max-width: 600px) {
  .page-toolbar > div { width: 100%; }
  .page-toolbar .toolbar-back { width: auto; }
  .settings-tabs a { padding: 8px 12px; font-size: 12.5px; }
  .design-upload-zone { padding: 32px 16px; min-height: 200px; }
  .upload-icon { width: 60px; height: 60px; }
  .upload-icon i[data-icon] { width: 26px; height: 26px; }
  .fields-list .field-row { padding: 12px 14px; gap: 10px; }
  .field-type-icon { width: 36px; height: 36px; }
  .modal-overlay { padding: 16px 12px; }
  .modal-card { max-height: calc(100vh - 32px); }
}

/* Fix info icon for hint */

/* ==========================================================
   v6.1 — RICH EMAIL EDITOR
   ========================================================== */
.rich-editor-label {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.rich-editor-tabs {
  display: inline-flex;
  background: var(--bg-muted);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.rich-tab-btn {
  padding: 6px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all .15s;
}
.rich-tab-btn:hover { color: var(--text); }
.rich-tab-btn.active {
  background: white;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.rich-tab-btn i[data-icon] { width: 13px; height: 13px; }

.rich-editor {
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  background: white;
  overflow: hidden;
  transition: border-color .15s;
}
.rich-editor:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99,102,241,.08);
}

.rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 8px;
  background: linear-gradient(180deg, #fafbfd, #f4f6fa);
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.rich-toolbar button {
  width: 32px; height: 32px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .12s;
  padding: 0;
}
.rich-toolbar button:hover {
  background: rgba(99,102,241,.1);
  color: var(--primary);
}
.rich-toolbar button.btn-mini-primary {
  width: auto;
  padding: 0 12px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  font-size: 12px;
  font-weight: 600;
  gap: 5px;
  height: 32px;
}
.rich-toolbar button.btn-mini-primary:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(99,102,241,.3);
}
.rich-toolbar button i[data-icon] { width: 15px; height: 15px; }
.rich-toolbar button.btn-mini-primary i[data-icon] { width: 13px; height: 13px; }
.rich-sep {
  width: 1px;
  height: 22px;
  background: var(--border);
  margin: 0 4px;
  flex-shrink: 0;
}
.rich-toolbar select {
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 8px;
  font-family: inherit;
  font-size: 12px;
  background: white;
  cursor: pointer;
  color: var(--text);
}

/* Color picker */
.rich-color-picker {
  position: relative;
  display: inline-flex;
}
.rich-color-picker input[type="color"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  pointer-events: none;
}
.color-square {
  display: block;
  width: 18px; height: 18px;
  border-radius: 4px;
  background: #6366f1;
  border: 2px solid white;
  box-shadow: 0 0 0 1px var(--border);
}

.rich-content {
  padding: 16px 20px;
  min-height: 220px;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  overflow-y: auto;
  max-height: 500px;
}
.rich-content h2 { font-size: 22px; margin: 12px 0; color: var(--primary); }
.rich-content h3 { font-size: 18px; margin: 10px 0; }
.rich-content p { margin: 8px 0; }
.rich-content a {
  color: var(--primary);
  text-decoration: underline;
}
.rich-content strong { font-weight: 700; }
.rich-content ul, .rich-content ol {
  padding-inline-start: 24px;
  margin: 8px 0;
}
.rich-content[contenteditable]:empty::before {
  content: 'اكتب محتوى البريد هنا...';
  color: var(--text-light);
}

/* Mobile */
@media (max-width: 600px) {
  .rich-toolbar { padding: 6px; gap: 2px; }
  .rich-toolbar button { width: 30px; height: 30px; }
  .rich-toolbar button.btn-mini-primary { font-size: 11px; padding: 0 10px; }
  .rich-toolbar select { font-size: 11px; max-width: 100px; }
  .rich-sep { margin: 0 2px; }
  .rich-content { padding: 12px; min-height: 180px; }
}

/* ==========================================================
   v6.2 — UPLOAD ZONE TOGGLE FIX
   ========================================================== */
.upload-zone-preview[hidden],
.upload-zone-content[hidden] { display: none !important; }

/* ==========================================================
   PHASE 6: PUBLIC INVITATION PORTAL
   ========================================================== */
.invite-design-card {
  background: white;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 25px 60px -15px rgba(0,0,0,.35);
  position: relative;
  animation: inviteFadeIn .5s ease;
}
@keyframes inviteFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.invite-canvas {
  position: relative;
  width: 100%;
  user-select: none;
  background: white;
}
.invite-canvas img#designBg {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

/* Name overlay */
.canvas-name {
  position: absolute;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  line-height: 1.2;
}

/* QR overlay */
.canvas-qr {
  position: absolute;
  transform: translate(-50%, -50%);
  aspect-ratio: 1/1;
}
.qr-box {
  width: 100%; height: 100%;
  background: white;
  padding: 6px;
  border-radius: 6px;
  box-sizing: border-box;
  box-shadow: 0 4px 14px rgba(0,0,0,.12);
}
.qr-box canvas, .qr-box img {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* Honor label */
.canvas-honor {
  position: absolute;
  transform: translate(-50%, -50%);
  font-weight: 700;
  text-align: center;
  pointer-events: none;
  white-space: nowrap;
}

/* Fallback when no design */
.invite-fallback {
  padding: 60px 30px;
  text-align: center;
  background: linear-gradient(180deg, #fafbfd, #ffffff);
}
.invite-fallback h1 {
  color: #6366f1;
  font-size: 26px;
  margin: 0 0 18px;
}

/* Details card */
.invite-details-card {
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 18px;
  padding: 22px;
  color: white;
}
.invite-details-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1fr;
}
.invite-detail-item {
  display: flex; gap: 12px; align-items: center;
}
.invite-detail-item i[data-icon] {
  width: 36px; height: 36px;
  background: rgba(255,255,255,.15);
  border-radius: 10px;
  padding: 8px; box-sizing: border-box;
  flex-shrink: 0;
  color: white;
}
.invite-detail-item small {
  display: block;
  font-size: 11px;
  opacity: .7;
  margin-bottom: 2px;
}
.invite-detail-item strong {
  font-size: 14px;
  display: block;
}

/* Status card (registered) */
.invite-status-card {
  background: white;
  border-radius: 20px;
  padding: 32px 24px;
  text-align: center;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.2);
}
.invite-status-card .status-icon {
  width: 76px; height: 76px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.invite-status-card.status-registered .status-icon {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 8px 24px -6px rgba(16,185,129,.5);
}
.invite-status-card .status-icon i[data-icon] { width: 36px; height: 36px; }
.invite-status-card h3 {
  margin: 0 0 6px;
  font-size: 22px;
  color: #059669;
}
.invite-status-card p { color: #6b7280; margin: 0 0 22px; }
.invite-actions {
  display: flex; gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.invite-actions button {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  transition: all .15s;
}
.invite-actions .btn-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
}
.invite-actions .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px -4px rgba(99,102,241,.5); }
.invite-actions .btn-secondary {
  background: #f3f4f6;
  color: #374151;
}

/* Form card */
.invite-form-card {
  background: white;
  border-radius: 20px;
  padding: 28px 22px;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.2);
}
.invite-form-card .form-group {
  margin-bottom: 14px;
}
.invite-form-card label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #374151;
}
.invite-form-card .required { color: #dc2626; }
.invite-form-card input,
.invite-form-card select,
.invite-form-card textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  background: #fafbfd;
  transition: all .15s;
}
.invite-form-card input:focus,
.invite-form-card select:focus,
.invite-form-card textarea:focus {
  outline: none;
  border-color: #6366f1;
  background: white;
  box-shadow: 0 0 0 4px rgba(99,102,241,.1);
}
.invite-form-card .form-heading {
  font-size: 15px;
  color: #6366f1;
  margin: 18px 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid rgba(99,102,241,.15);
}
.invite-form-card .form-divider {
  border: none;
  border-top: 1px dashed #e5e7eb;
  margin: 18px 0;
}

.radio-group {
  display: flex; flex-direction: column; gap: 8px;
}
.radio-option {
  display: flex; gap: 10px; align-items: center;
  padding: 11px 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  cursor: pointer;
  transition: all .15s;
  font-weight: 500;
}
.radio-option:hover { border-color: #6366f1; background: rgba(99,102,241,.04); }
.radio-option:has(input:checked) {
  border-color: #6366f1;
  background: rgba(99,102,241,.08);
  font-weight: 700;
}
.radio-option input { accent-color: #6366f1; flex-shrink: 0; }

.error-msg {
  display: block;
  color: #dc2626;
  font-size: 12px;
  margin-top: 4px;
  font-weight: 600;
  min-height: 14px;
}
.error-msg:empty { display: none; }

.invite-form-actions {
  margin-top: 22px;
  display: flex; flex-direction: column; gap: 8px;
}
.btn-block-lg {
  width: 100%;
  padding: 14px 24px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all .15s;
}
.btn-block-lg.btn-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  box-shadow: 0 8px 22px -6px rgba(99,102,241,.5);
}
.btn-block-lg.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px -6px rgba(99,102,241,.6);
}
.btn-block-lg.btn-primary:disabled { opacity: .7; cursor: wait; }
.btn-block-lg.btn-ghost {
  background: transparent;
  color: #6b7280;
  border: 1.5px solid #e5e7eb;
}
.btn-block-lg.btn-ghost:hover { background: #f9fafb; }

/* Mobile */
@media (max-width: 600px) {
  .invite-details-grid { grid-template-columns: 1fr; }
  .invite-form-card { padding: 22px 18px; }
  .invite-status-card { padding: 26px 18px; }
}

/* ==========================================================
   v6.3 — CRON & SETTINGS HELP
   ========================================================== */

/* Provider cards (Gmail, Outlook, Taqnyat, etc.) */
.provider-cards {
  display: flex; flex-direction: column;
  gap: 10px;
}
.provider-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: white;
  overflow: hidden;
  transition: border-color .15s;
}
.provider-card[open] { border-color: var(--primary); }
.provider-card summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  display: flex; gap: 14px; align-items: center;
  user-select: none;
  transition: background .15s;
}
.provider-card summary::-webkit-details-marker { display: none; }
.provider-card summary:hover { background: rgba(99,102,241,.04); }
.provider-card summary > div:nth-child(2) { flex: 1; }
.provider-card summary strong { display: block; font-size: 14.5px; }
.provider-card summary small { color: var(--text-muted); font-size: 12px; }
.provider-card summary i[data-icon="arrow"] {
  width: 18px; height: 18px;
  color: var(--text-muted);
  transition: transform .2s;
}
.provider-card[open] summary i[data-icon="arrow"] { transform: rotate(90deg); }
[dir="rtl"] .provider-card[open] summary i[data-icon="arrow"] { transform: rotate(-90deg); }

.provider-logo {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px;
  color: white; flex-shrink: 0;
}
.gmail-logo { background: linear-gradient(135deg, #ea4335, #fbbc04); }
.cpanel-logo { background: linear-gradient(135deg, #ff6c2c, #f08c00); font-size: 14px; }
.outlook-logo { background: linear-gradient(135deg, #0078d4, #00a4ef); }
.proapi-logo { background: linear-gradient(135deg, #6366f1, #8b5cf6); font-size: 22px; }
.taqnyat-logo { background: linear-gradient(135deg, #00897b, #00bfa5); }
.jawaly-logo { background: linear-gradient(135deg, #1976d2, #42a5f5); }
.unifonic-logo { background: linear-gradient(135deg, #ff5722, #ff7043); }
.msegat-logo { background: linear-gradient(135deg, #7c4dff, #b388ff); }

.provider-body {
  padding: 16px 18px;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, #fafbfd, white);
}
.provider-body ol {
  padding-inline-start: 20px;
  margin: 0 0 14px;
  line-height: 1.9;
  color: var(--text);
}
.provider-body li { margin-bottom: 4px; }
.provider-body a {
  color: var(--primary);
  text-decoration: underline;
  font-weight: 600;
}
.provider-body code {
  background: rgba(99,102,241,.08);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-family: ui-monospace, monospace;
}

.provider-fields-box {
  background: white;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 2;
}
.provider-fields-box > div {
  display: flex; gap: 8px;
  align-items: baseline;
}
.provider-fields-box strong {
  color: var(--text);
  min-width: 130px;
  flex-shrink: 0;
  font-size: 13px;
}

/* Setup steps */
.setup-step {
  display: flex; gap: 16px;
  padding: 16px 0;
  border-bottom: 1px dashed var(--border);
}
.setup-step:last-child { border-bottom: none; }
.step-num-circle {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  display: inline-flex;
  align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(99,102,241,.3);
}
.step-content { flex: 1; min-width: 0; }
.step-content h4 { margin: 0 0 6px; font-size: 15px; }
.step-content p { margin: 0 0 6px; font-size: 13.5px; line-height: 1.7; }

/* Code blocks */
.code-block {
  position: relative;
  background: #0f172a;
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 8px;
  overflow: hidden;
}
.code-block pre {
  margin: 0;
  color: #cbd5e1;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.7;
  direction: ltr;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-all;
  padding-inline-end: 80px;
}
.copy-btn {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  background: rgba(99,102,241,.2);
  color: white;
  border: 1px solid rgba(99,102,241,.4);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all .15s;
}
.copy-btn:hover { background: rgba(99,102,241,.35); }
.copy-btn i[data-icon] { width: 12px; height: 12px; }

/* Status cards */
.status-card-success { border-left: 4px solid var(--success); }
.status-card-warning { border-left: 4px solid #f59e0b; }
[dir="rtl"] .status-card-success { border-left: none; border-right: 4px solid var(--success); }
[dir="rtl"] .status-card-warning { border-left: none; border-right: 4px solid #f59e0b; }

.status-indicator-large {
  width: 56px; height: 56px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}
.status-indicator-large.pulse-green {
  background: rgba(16,185,129,.15);
}
.status-indicator-large.pulse-green::after {
  content: '';
  position: absolute; inset: 14px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(16,185,129,.6);
  animation: pulse 2s infinite;
}
.status-indicator-large.pulse-amber {
  background: rgba(245,158,11,.15);
}
.status-indicator-large.pulse-amber::after {
  content: '';
  position: absolute; inset: 14px;
  background: #f59e0b;
  border-radius: 50%;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16,185,129,.6); }
  70% { box-shadow: 0 0 0 16px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

/* details summary normalization */
details summary {
  cursor: pointer;
  padding: 8px 0;
  font-weight: 600;
}
details[open] summary { color: var(--primary); }

/* Mobile */
@media (max-width: 600px) {
  .provider-card summary { padding: 12px; gap: 10px; }
  .provider-logo { width: 36px; height: 36px; font-size: 15px; }
  .provider-body { padding: 14px; }
  .provider-fields-box strong { min-width: auto; display: block; margin-bottom: 2px; }
  .provider-fields-box > div { flex-direction: column; gap: 0; line-height: 1.4; margin-bottom: 8px; }
  .setup-step { gap: 12px; padding: 14px 0; }
  .step-num-circle { width: 30px; height: 30px; font-size: 14px; }
  .code-block { padding: 12px; }
  .code-block pre { font-size: 11.5px; padding-inline-end: 70px; }
  .status-indicator-large { width: 44px; height: 44px; }
  .status-indicator-large.pulse-green::after,
  .status-indicator-large.pulse-amber::after { inset: 11px; }
}

/* ==========================================================
   v7 — SCANNER + SHARE MODAL + STATISTICS
   ========================================================== */

/* ===== Share modal (invitee invitation links) ===== */
.link-row {
  display: flex; gap: 8px; align-items: stretch;
}
.link-row input {
  flex: 1; min-width: 0;
  padding: 10px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: 8px;
  font-family: ui-monospace, monospace;
  font-size: 12.5px;
  background: #f8fafc;
}
.link-row input:focus { outline: none; border-color: var(--primary); background: white; }
.link-row .btn-secondary {
  white-space: nowrap;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.share-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 18px;
}
.share-action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: white;
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  transition: all .15s;
}
.share-action-btn:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px -4px rgba(99,102,241,.25);
}
.share-action-btn .share-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  color: white;
}
.whatsapp-btn:hover { border-color: #25D366; }
.telegram-btn:hover { border-color: #0088cc; }
.email-btn:hover { border-color: var(--primary); }
.preview-btn:hover { border-color: #f59e0b; }

@media (max-width: 480px) {
  .share-actions-grid { grid-template-columns: 1fr; }
}

/* ===== Preview banner ===== */
.preview-banner {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  padding: 12px 18px;
  border-radius: 12px;
  display: flex; align-items: center; gap: 14px;
  font-size: 13.5px;
  flex-wrap: wrap;
  box-shadow: 0 8px 20px -6px rgba(245,158,11,.4);
}
.preview-banner > div:first-child { flex: 1; }
.preview-banner strong { display: block; font-size: 15px; }
.preview-banner small { opacity: .9; font-size: 12px; }
.preview-banner .back-to-admin {
  background: rgba(255,255,255,.2);
  color: white;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.preview-banner .back-to-admin:hover { background: rgba(255,255,255,.3); }

/* ===== Scanner ===== */
.scanner-config-card .form-grid-2 {
  margin: 0;
}
.scanner-main-card {
  overflow: hidden;
}
.scanner-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.scanner-stage video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.scanner-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.scanner-frame {
  width: 65%;
  max-width: 320px;
  aspect-ratio: 1/1;
  border: 3px solid rgba(255,255,255,.85);
  border-radius: 24px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.45);
  position: relative;
}
.scanner-frame::before, .scanner-frame::after {
  content: '';
  position: absolute;
  width: 30px; height: 30px;
  border: 4px solid var(--accent, #ec4899);
}
.scanner-frame::before {
  top: -3px; left: -3px;
  border-right: none; border-bottom: none;
  border-radius: 24px 0 0 0;
}
.scanner-frame::after {
  bottom: -3px; right: -3px;
  border-left: none; border-top: none;
  border-radius: 0 0 24px 0;
}
.scanner-line {
  position: absolute;
  top: 50%; left: 17.5%; right: 17.5%;
  max-width: 320px; margin: 0 auto;
  height: 3px;
  background: linear-gradient(90deg, transparent, #10b981, transparent);
  box-shadow: 0 0 12px #10b981;
  animation: scannerLine 2.5s ease-in-out infinite;
}
@keyframes scannerLine {
  0%, 100% { transform: translateY(-130px); opacity: .9; }
  50%      { transform: translateY(130px);  opacity: .6; }
}
.scanner-status {
  position: absolute;
  bottom: 18px;
  inset-inline: 0;
  text-align: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
  text-shadow: 0 2px 6px rgba(0,0,0,.7);
  background: rgba(0,0,0,.4);
  padding: 8px 16px;
  margin: 0 16px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
}
.scanner-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}

/* Scan result */
.scan-result-card .card-body { text-align: center; padding: 28px 20px; }
.scan-icon-large {
  width: 80px; height: 80px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
}
.scan-icon-large i[data-icon] { width: 44px; height: 44px; }
.pulse-green-once {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  animation: pulseOnce .6s ease;
  box-shadow: 0 8px 24px -6px rgba(16,185,129,.5);
}
.warn-orange {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  box-shadow: 0 8px 24px -6px rgba(245,158,11,.5);
}
.fail-red {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  box-shadow: 0 8px 24px -6px rgba(239,68,68,.5);
}
@keyframes pulseOnce {
  0%   { transform: scale(.5); opacity: 0; }
  60%  { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); }
}
.scan-result-success { border: 2px solid var(--success); }
.scan-result-already_used,
.scan-result-wrong_event { border: 2px solid #f59e0b; }
.scan-result-invalid { border: 2px solid var(--danger); }

/* Invitee mini card after scan */
.invitee-card-mini {
  background: var(--bg-muted);
  border-radius: 12px;
  padding: 14px 18px;
  margin-top: 14px;
  display: inline-block;
  min-width: 250px;
  text-align: start;
}
.invitee-mini-name { font-size: 16px; font-weight: 700; }
.invitee-mini-phone { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.invitee-mini-companions { font-size: 13px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
.honor-tag {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: white;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

/* Manual search results */
.search-results-list {
  display: flex; flex-direction: column;
  gap: 6px;
  max-height: 350px;
  overflow-y: auto;
}
.search-result-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: white;
  transition: all .15s;
}
.search-result-item:hover {
  border-color: var(--primary-light);
  background: rgba(99,102,241,.03);
}
.search-result-item .btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* ===== Statistics — status bar list ===== */
.status-bar-list {
  display: flex; flex-direction: column;
  gap: 10px;
}
.status-bar-row {
  display: grid;
  grid-template-columns: 140px 1fr 100px;
  gap: 14px;
  align-items: center;
}
.status-bar-label { font-size: 13px; font-weight: 600; }
.status-bar-track {
  height: 24px;
  background: var(--bg-muted);
  border-radius: 999px;
  overflow: hidden;
}
.status-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width .6s ease;
  min-width: 4px;
}
.status-bar-value {
  text-align: end;
  font-size: 13px;
}

.message-stat-card {
  background: var(--bg-muted);
  border-radius: 12px;
  padding: 16px;
}
.message-stat-card h4 { margin: 0 0 12px; font-size: 14px; }
.msg-stat-row {
  font-size: 13px;
  margin: 6px 0;
}

/* Mobile */
@media (max-width: 600px) {
  .status-bar-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .status-bar-value { text-align: start; }
  .scanner-stage { aspect-ratio: 1/1; }
  .scanner-frame { width: 75%; }
}

/* ==========================================================
   v7.2 — PUBLIC SELF-REGISTRATION
   ========================================================== */
.public-link-card {
  background: linear-gradient(135deg, rgba(99,102,241,.05), rgba(139,92,246,.08));
  border: 1.5px solid rgba(99,102,241,.2);
}
.public-share-buttons {
  display: flex; gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.public-share-buttons .share-action-btn {
  flex: 1;
  min-width: 130px;
}
.public-event-details {
  display: flex; flex-direction: column;
  gap: 8px;
  font-size: 14px;
  line-height: 1.6;
  background: var(--bg-muted);
  padding: 14px 16px;
  border-radius: 10px;
}
.public-event-details strong { color: var(--text); }

/* mail mode picker (v7.1) */
.mail-mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.mail-mode-option {
  display: flex; gap: 14px; align-items: center;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all .15s;
  background: white;
}
.mail-mode-option:hover { border-color: var(--primary-light); }
.mail-mode-option.active {
  border-color: var(--primary);
  background: rgba(99,102,241,.05);
  box-shadow: 0 4px 16px -4px rgba(99,102,241,.25);
}
.mail-mode-option input[type="radio"] { display: none; }
.mode-icon {
  font-size: 28px;
  width: 50px; height: 50px;
  display: inline-flex;
  align-items: center; justify-content: center;
  background: var(--bg-muted);
  border-radius: 12px;
  flex-shrink: 0;
}
.mail-mode-option.active .mode-icon {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
}
.mode-info strong { display: block; font-size: 14px; margin-bottom: 4px; }
.mode-info small { color: var(--text-muted); font-size: 12px; line-height: 1.6; }

@media (max-width: 600px) {
  .mail-mode-grid { grid-template-columns: 1fr; }
  .public-share-buttons .share-action-btn { min-width: 100%; }
}

/* ==========================================================
   v8 — PAGES MODULE + FINAL POLISH
   ========================================================== */

/* Badge variants for pages module */
.badge-info { background: rgba(59,130,246,.12); color: #1d4ed8; }
.badge-secondary { background: rgba(107,114,128,.12); color: #4b5563; }
.badge-warning { background: rgba(245,158,11,.15); color: #b45309; }
.badge-success { background: rgba(16,185,129,.15); color: #047857; }
.badge-danger { background: rgba(239,68,68,.15); color: #b91c1c; }
.badge-info, .badge-secondary, .badge-warning, .badge-success, .badge-danger {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  margin-inline-end: 4px;
}

/* Final polish: smoother transitions everywhere */
.btn-icon, .btn-primary, .btn-secondary, .btn-ghost {
  transition: all .15s ease;
}

/* Make form-grid-3 mobile-friendly */
.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 700px) {
  .form-grid-3 { grid-template-columns: 1fr; }
}

/* ==========================================================
   v9.2-9.4 — DELETE MODAL + READINESS + POLISH
   ========================================================== */

/* === Delete Confirmation Modal === */
.delete-modal-card {
  max-width: 440px;
  text-align: center;
  padding: 36px 30px;
  background: white;
  border-radius: 20px;
  margin: auto;
  box-shadow: 0 25px 60px -15px rgba(0,0,0,.4);
}
.delete-icon-circle {
  width: 88px; height: 88px;
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  color: #dc2626;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  animation: deleteIconPop .35s ease;
}
.delete-icon-circle i[data-icon] { width: 42px; height: 42px; }
@keyframes deleteIconPop {
  0%   { transform: scale(.5); opacity: 0; }
  60%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}
.delete-modal-card h3 {
  margin: 0 0 10px;
  font-size: 24px;
  color: #1f2937;
  font-weight: 800;
}
.delete-modal-card p {
  color: #4b5563;
  margin: 0 0 8px;
  line-height: 1.7;
  font-size: 15px;
}
.delete-modal-actions {
  display: flex; gap: 10px;
  margin-top: 24px;
  justify-content: center;
}
.delete-modal-actions button {
  padding: 12px 28px;
  border-radius: 12px;
  font-weight: 700;
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
  border: none;
  transition: all .15s;
  min-width: 120px;
}
.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  box-shadow: 0 6px 18px -4px rgba(239,68,68,.45);
}
.btn-danger:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -4px rgba(239,68,68,.55);
}
.btn-danger:disabled { opacity: .65; cursor: wait; }
.btn-ghost {
  background: white;
  border: 1.5px solid #e5e7eb;
  color: #6b7280;
  padding: 12px 28px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  transition: all .15s;
}
.btn-ghost:hover { background: #f9fafb; border-color: #d1d5db; }

/* === Readiness Checklist === */
.readiness-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.readiness-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: white;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  font-size: 14.5px;
}
.readiness-list li.done {
  background: linear-gradient(135deg, rgba(16,185,129,.05), rgba(16,185,129,.10));
  border-color: rgba(16,185,129,.3);
  color: #047857;
}
.readiness-list li.pending { border-color: rgba(245,158,11,.3); }
.readiness-list li > i[data-icon] { width: 22px; height: 22px; flex-shrink: 0; }
.readiness-list li.done > i[data-icon] { color: #10b981; }
.readiness-list li.pending > i[data-icon] { color: #f59e0b; }
.readiness-list li > span:not(.badge) { flex: 1; font-weight: 600; }

.btn-sm {
  padding: 6px 16px;
  font-size: 13px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.btn-sm.btn-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
}
.btn-sm.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 14px -4px rgba(99,102,241,.4); }

.btn-icon-success { color: #059669; }
.btn-icon-success:hover { background: rgba(16,185,129,.1); border-color: #059669; }

/* === Drag-over upload zone === */
.upload-zone.dragover {
  border-color: var(--primary, #6366f1) !important;
  background: rgba(99,102,241,.05);
  transform: scale(1.01);
}

/* === Public invite/registration page polish === */
.invite-status-card {
  background: white;
  border-radius: 20px;
  padding: 36px 28px;
  text-align: center;
  box-shadow: 0 12px 32px -10px rgba(0,0,0,.15);
}
.invite-status-card .status-icon {
  width: 84px; height: 84px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.status-registered .status-icon {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #047857;
}
.status-rejected .status-icon {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #b45309;
}
.invite-status-card .status-icon i[data-icon] { width: 40px; height: 40px; }

/* ==========================================================
   v9.5 — BIG SCANNER CAMERA BUTTON + UI POLISH
   ========================================================== */

.btn-block-camera {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 28px 32px !important;
  font-size: 18px !important;
  font-weight: 800 !important;
  border-radius: 18px !important;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  background: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899) !important;
  color: white !important;
  border: none !important;
  box-shadow: 0 12px 32px -8px rgba(99,102,241,.5) !important;
  transition: all .2s !important;
  cursor: pointer;
}
.btn-block-camera:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px -10px rgba(99,102,241,.6) !important;
}
.btn-block-camera:active { transform: translateY(0); }

.scanner-controls {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

/* Make scanner stage prominent */
.scanner-stage {
  position: relative;
  background: #000;
  aspect-ratio: 4/3;
  width: 100%;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
}
.scanner-stage video { width: 100%; height: 100%; object-fit: cover; }
.scanner-overlay {
  position: absolute; inset: 0;
  pointer-events: none;
  display: flex; align-items: center; justify-content: center;
}
.scanner-frame {
  width: 60%; max-width: 280px; aspect-ratio: 1;
  border: 3px solid #10b981;
  border-radius: 24px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.4);
}
.scanner-line {
  position: absolute;
  width: 60%; max-width: 280px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #10b981, transparent);
  animation: scanLine 2.5s ease-in-out infinite;
}
@keyframes scanLine {
  0%, 100% { transform: translateY(-50%); }
  50% { transform: translateY(50%); }
}
.scanner-status {
  position: absolute;
  bottom: 16px; left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.65);
  color: white;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

/* ==========================================================
   v9.8 — PDF NAME CUTOFF FIX + MOBILE NO-ZOOM
   ========================================================== */

/* ----------------------------------------------------------
   v3.2 (May 2026) — VERTICAL CENTERING FIX
   Use CSS grid for the name overlay so the text glyph sits at
   the geometric center of its box. Block layout with line-height
   1.5 + padding produced a slight downward offset because Arabic
   glyph metrics aren't symmetric within the line-box; grid with
   align-items:center fixes that. text-align (right/center/left)
   is preserved because grid gives the implicit item the full
   container width.
   ---------------------------------------------------------- */
.canvas-name {
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap;
  padding: 6px 8px;
  /* line-height kept generous so descenders (ج، ق، ع، م) don't crop */
  line-height: 1.4 !important;
  /* Vertical centering — matches the editor's flex-centered placeholder */
  display: grid !important;
  align-items: center !important;
}

/* Make sure invite-canvas shows full content during PDF generation */
.invite-canvas {
  overflow: visible !important;
}

/* Mobile: prevent zoom-on-focus by keeping inputs ≥16px */
@media (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  input[type="password"],
  input[type="search"],
  input[type="date"],
  input[type="time"],
  input[type="datetime-local"],
  select, textarea {
    font-size: 16px !important;
  }
}
/* ==========================================================
   v10.0 — SCANNER PAGE FOCUSED + FINAL POLISH
   ========================================================== */

/* Scanner page header */
.scanner-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  padding: 18px 22px;
  border-radius: 16px;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px -10px rgba(99,102,241,.4);
}
.scanner-page-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-icon-help {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.2);
  color: white;
  width: 38px; height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.btn-icon-help:hover { background: rgba(255,255,255,.25); }

.scanner-help-card {
  border-left: 3px solid #6366f1;
}

.scanner-config-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Make scanner stage prominent */
.scanner-main-card {
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 12px 32px -10px rgba(0,0,0,.2);
}

/* ==========================================================
   v10.7 — EVENT SELECTOR PAGE: Beautiful tiles with covers
   ========================================================== */

/* === Hero Header === */
.event-selector-hero {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  border-radius: 20px;
  padding: 26px 28px;
  color: white;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: 0 16px 36px -10px rgba(99,102,241,.4);
  position: relative;
  overflow: hidden;
}
.event-selector-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 80% 20%, rgba(255,255,255,.18), transparent 40%),
    radial-gradient(circle at 20% 80%, rgba(255,255,255,.08), transparent 40%);
  pointer-events: none;
}
.event-selector-hero .hero-content {
  display: flex;
  align-items: center;
  gap: 18px;
  position: relative;
  z-index: 1;
}
.event-selector-hero .hero-icon {
  width: 56px; height: 56px;
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  backdrop-filter: blur(8px);
}
.event-selector-hero .hero-icon i {
  width: 28px; height: 28px;
  color: white;
}
.event-selector-hero h1 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -.3px;
}
.event-selector-hero p {
  margin: 0;
  font-size: 14px;
  opacity: .9;
  font-weight: 600;
}
.event-selector-hero .hero-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  background: white;
  color: #4338ca;
  border-radius: 12px;
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  transition: all .2s;
  box-shadow: 0 8px 20px -4px rgba(0,0,0,.2);
  position: relative;
  z-index: 1;
}
.event-selector-hero .hero-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -6px rgba(0,0,0,.25);
}

/* === Tip banner === */
.event-selector-tip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: linear-gradient(135deg, rgba(99,102,241,.06), rgba(139,92,246,.08));
  border: 1px solid rgba(99,102,241,.15);
  border-radius: 12px;
  color: #4338ca;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 16px;
}
.event-selector-tip svg { color: #6366f1; flex-shrink: 0; }

/* === Empty state === */
.event-selector-empty {
  background: white;
  border: 1.5px dashed #d1d5db;
  border-radius: 20px;
  padding: 60px 30px 50px;
  text-align: center;
}
.event-selector-empty .empty-illustration {
  color: #c7d2fe;
  margin-bottom: 18px;
  display: inline-block;
}
.event-selector-empty h3 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 900;
  color: #1f2937;
}
.event-selector-empty p {
  margin: 0 0 24px;
  font-size: 14.5px;
  color: #6b7280;
  line-height: 1.7;
}
.event-selector-empty p strong { color: #4338ca; }
.btn-primary-large {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899);
  color: white;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
  transition: all .2s;
  box-shadow: 0 12px 28px -8px rgba(99,102,241,.5);
}
.btn-primary-large:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px -10px rgba(99,102,241,.6);
}

/* === Grid of event tiles === */
.event-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
}

/* === Single Event Tile === */
.event-tile {
  background: white;
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  border: 1.5px solid #f3f4f6;
  display: flex;
  flex-direction: column;
  transition: all .25s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 2px 8px -2px rgba(0,0,0,.04);
}
.event-tile:hover {
  transform: translateY(-4px);
  border-color: #c7d2fe;
  box-shadow: 0 18px 40px -10px rgba(99,102,241,.25);
}

/* Cover */
.event-tile-cover {
  position: relative;
  width: 100%;
  height: 130px;
  background-size: cover;
  background-position: center;
  background-color: #f3f4f6;
  overflow: hidden;
}
.event-tile-cover-gradient {
  background: linear-gradient(135deg, #667eea, #764ba2 50%, #f093fb);
}
.event-tile-cover-pattern {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.15) 0, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,.1) 0, transparent 40%);
  background-size: 100% 100%;
}
.event-tile-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,.45) 100%);
}
.event-tile-status {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2;
}
.event-tile-status.badge-active,
.event-tile-status.badge-published {
  background: rgba(16,185,129,.92);
  color: white;
}
.event-tile-status.badge-draft {
  background: rgba(107,114,128,.92);
  color: white;
}
.event-tile-status.badge-closed {
  background: rgba(239,68,68,.92);
  color: white;
}
.event-tile-status.badge-archived {
  background: rgba(107,114,128,.92);
  color: white;
}

/* Body */
.event-tile-body {
  padding: 16px 18px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.event-tile-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 800;
  color: #1f2937;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.event-tile-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.event-tile-meta .meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #6b7280;
  font-weight: 600;
}
.event-tile-meta .meta-row svg {
  color: #9ca3af;
  flex-shrink: 0;
}
.event-tile-meta .meta-row span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* CTA bar at bottom */
.event-tile-cta {
  margin-top: auto;
  padding: 12px 18px;
  background: linear-gradient(135deg, rgba(99,102,241,.05), rgba(139,92,246,.08));
  border-top: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: #4338ca;
  transition: all .2s;
}
.event-tile:hover .event-tile-cta {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
}
.event-tile .cta-arrow {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(99,102,241,.12);
  border-radius: 50%;
  transition: all .2s;
}
.event-tile:hover .cta-arrow {
  background: rgba(255,255,255,.25);
  transform: translateX(-3px);
}
[dir="rtl"] .event-tile .cta-arrow svg {
  transform: scaleX(-1);
}

/* Responsive */
@media (max-width: 600px) {
  .event-selector-grid {
    grid-template-columns: 1fr;
  }
  .event-selector-hero {
    padding: 22px 22px;
  }
  .event-selector-hero h1 { font-size: 20px; }
  .event-tile-cover { height: 110px; }
}

/* ==========================================================
   v10.9 — Branding Settings Logo Grid
   ========================================================== */
.logo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px;
}
.logo-slot {
  background: linear-gradient(135deg, #ffffff, #fafafa);
  border: 1.5px solid #e5e7eb;
  border-radius: 16px;
  padding: 18px;
  text-align: center;
  transition: all .2s;
}
.logo-slot:hover {
  border-color: #c7d2fe;
  box-shadow: 0 8px 18px -6px rgba(99,102,241,.15);
}
.logo-slot .logo-label {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: #4338ca;
  margin-bottom: 12px;
}
.logo-slot .logo-preview {
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(135deg, #f9fafb, #f3f4f6);
  border: 2px dashed #e5e7eb;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  overflow: hidden;
  position: relative;
  transition: all .15s;
}
.logo-slot:hover .logo-preview {
  border-color: #c7d2fe;
  background: white;
}
.logo-slot .logo-preview img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}
.logo-slot .logo-placeholder {
  color: #9ca3af;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.logo-slot .logo-placeholder i {
  width: 38px;
  height: 38px;
  color: #c7d2fe;
}
.logo-slot .logo-placeholder::after {
  content: 'لا توجد صورة';
  font-size: 11px;
  color: #9ca3af;
}
.logo-slot .logo-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.logo-slot .logo-actions .btn-sm {
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  transition: all .15s;
  border: 1.5px solid;
}
.logo-slot .btn-secondary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 10px -2px rgba(99,102,241,.4);
}
.logo-slot .btn-secondary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 14px -3px rgba(99,102,241,.5);
}
.logo-slot .btn-danger {
  background: white;
  color: #dc2626;
  border-color: #fecaca;
}
.logo-slot .btn-danger:hover {
  background: #fef2f2;
  border-color: #f87171;
}

/* Responsive */
@media (max-width: 600px) {
  .logo-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .logo-slot { padding: 14px; }
  .logo-slot .logo-label { font-size: 12px; }
}

/* ==========================================================
   v11 — UI Helpers (modals, toasts) — replaces native dialogs
   ========================================================== */

/* === Modal Backdrop === */
.ui-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity .18s ease-out;
  font-family: 'Cairo', 'Tajawal', system-ui, sans-serif;
}
.ui-modal-backdrop.ui-show { opacity: 1; }
.ui-modal-backdrop.ui-hide { opacity: 0; }

/* === Modal Card === */
.ui-modal-card {
  background: white;
  border-radius: 22px;
  padding: 32px 28px 26px;
  text-align: center;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.4), 0 12px 28px -10px rgba(0,0,0,.2);
  transform: scale(.92) translateY(20px);
  opacity: 0;
  transition: transform .22s cubic-bezier(.34,1.56,.64,1), opacity .18s ease-out;
}
.ui-modal-backdrop.ui-show .ui-modal-card { transform: scale(1) translateY(0); opacity: 1; }

/* === Icon === */
.ui-modal-icon {
  width: 76px; height: 76px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: uiIconPop .45s cubic-bezier(.34,1.56,.64,1);
}
@keyframes uiIconPop {
  0%   { transform: scale(.4); opacity: 0; }
  60%  { transform: scale(1.12); }
  100% { transform: scale(1); opacity: 1; }
}
.ui-variant-info    .ui-modal-icon { background: #dbeafe; color: #2563eb; }
.ui-variant-warning .ui-modal-icon { background: #fef3c7; color: #d97706; }
.ui-variant-danger  .ui-modal-icon { background: #fee2e2; color: #dc2626; }
.ui-variant-success .ui-modal-icon { background: #d1fae5; color: #059669; }

/* === Title === */
.ui-modal-title {
  margin: 0 0 8px;
  font-size: 21px;
  font-weight: 900;
  color: #111827;
}
.ui-modal-message {
  margin: 0 0 22px;
  font-size: 14.5px;
  line-height: 1.75;
  color: #4b5563;
}

/* === Actions === */
.ui-modal-actions {
  display: flex;
  gap: 10px;
}
.ui-btn {
  flex: 1;
  padding: 13px 18px;
  border: none;
  border-radius: 13px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all .15s;
  outline: none;
}
.ui-btn:focus-visible {
  outline: 3px solid rgba(99,102,241,.4);
  outline-offset: 2px;
}
.ui-btn-cancel {
  background: #f3f4f6;
  color: #4b5563;
}
.ui-btn-cancel:hover { background: #e5e7eb; }

/* Confirm button variants */
.ui-btn-confirm.ui-btn-info {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  box-shadow: 0 8px 18px -4px rgba(99,102,241,.45);
}
.ui-btn-confirm.ui-btn-warning {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: white;
  box-shadow: 0 8px 18px -4px rgba(245,158,11,.45);
}
.ui-btn-confirm.ui-btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  box-shadow: 0 8px 18px -4px rgba(239,68,68,.45);
}
.ui-btn-confirm.ui-btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 8px 18px -4px rgba(16,185,129,.45);
}
.ui-btn-confirm:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}
.ui-btn-confirm:active { transform: translateY(0); }

/* === Toasts === */
.ui-toast-root {
  position: fixed;
  top: 20px;
  inset-inline-end: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  font-family: 'Cairo', 'Tajawal', system-ui, sans-serif;
}
.ui-toast {
  background: white;
  color: #1f2937;
  padding: 14px 20px;
  border-radius: 14px;
  box-shadow: 0 14px 32px -8px rgba(0,0,0,.25);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 700;
  min-width: 280px;
  max-width: 380px;
  border-inline-start: 4px solid #6366f1;
  transform: translateX(110%);
  opacity: 0;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), opacity .25s;
  pointer-events: auto;
}
[dir="rtl"] .ui-toast { transform: translateX(-110%); }
.ui-toast-show { transform: translateX(0) !important; opacity: 1; }
.ui-toast-hide { transform: translateX(110%) !important; opacity: 0; }
[dir="rtl"] .ui-toast-hide { transform: translateX(-110%) !important; }

.ui-toast-icon {
  width: 28px; height: 28px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 900;
}
.ui-toast-success { border-color: #10b981; }
.ui-toast-success .ui-toast-icon { background: #d1fae5; color: #059669; }
.ui-toast-error   { border-color: #ef4444; }
.ui-toast-error   .ui-toast-icon { background: #fee2e2; color: #dc2626; }
.ui-toast-warning { border-color: #f59e0b; }
.ui-toast-warning .ui-toast-icon { background: #fef3c7; color: #d97706; }
.ui-toast-info    { border-color: #6366f1; }
.ui-toast-info    .ui-toast-icon { background: #e0e7ff; color: #4338ca; }

@media (max-width: 600px) {
  .ui-toast-root {
    top: 14px;
    inset-inline-end: 14px;
    inset-inline-start: 14px;
  }
  .ui-toast { min-width: auto; max-width: none; }
  .ui-modal-card { padding: 28px 22px 22px; }
  .ui-modal-icon { width: 64px; height: 64px; }
  .ui-modal-icon svg { width: 30px; height: 30px; }
  .ui-modal-title { font-size: 18px; }
}
