/* === Client Protection === */
body { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; }
input, textarea, [contenteditable] { -webkit-user-select: text; -moz-user-select: text; -ms-user-select: text; user-select: text; }

/* ============================================================
   SHARED STYLES - Technical Fast Path
   Used by all admin, portal, login, and landing pages
   ============================================================ */

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

/* === Base Body === */
body {
  background: linear-gradient(135deg, #1a1210 0%, #2a1c18 50%, #1f1510 100%);
  color: #fff; font-family: 'Poppins', sans-serif; min-height: 100vh;
  --aurora-1: rgba(201,169,110,0.07); --aurora-2: rgba(139,105,20,0.05); --aurora-3: rgba(212,165,116,0.04);
  --orb-1: rgba(201,169,110,0.15); --orb-2: rgba(139,105,20,0.12);
  --primary: #c9a96e; --primary2: #8b6914; --accent: #d4a574;
}
body.ar { font-family: 'Cairo', sans-serif; direction: rtl; }

/* Admin pages - match customer index.php solid background */
body.admin { background: #1a1210; }

/* Portal purple theme override */
body[data-theme="portal"] {
  --aurora-1: rgba(161,140,209,0.07); --aurora-2: rgba(251,194,235,0.05); --aurora-3: rgba(161,140,209,0.04);
  --orb-1: rgba(161,140,209,0.15); --orb-2: rgba(251,194,235,0.12);
  --primary: #a18cd1; --primary2: #fbc2eb; --accent: #a18cd1;
}

/* === Background Animation === */
.bg-anim { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; overflow: hidden; }
.aurora { position: absolute; border-radius: 50%; filter: blur(80px); will-change: transform; }
.aurora-1 { width: 600px; height: 600px; background: var(--aurora-1); top: -10%; left: -5%; animation: aurora-drift-1 25s ease-in-out infinite; }
.aurora-2 { width: 500px; height: 500px; background: var(--aurora-2); bottom: -10%; right: -5%; animation: aurora-drift-2 30s ease-in-out infinite; }
.aurora-3 { width: 400px; height: 400px; background: var(--aurora-3); top: 40%; left: 50%; animation: aurora-drift-3 35s ease-in-out infinite; }
.orb { position: absolute; border-radius: 50%; will-change: transform; }
.orb-1 { width: 6px; height: 6px; background: var(--orb-1); top: 20%; left: 15%; box-shadow: 0 0 15px var(--orb-1); animation: orb-float-1 18s ease-in-out infinite; }
.orb-2 { width: 4px; height: 4px; background: var(--orb-2); top: 60%; left: 75%; box-shadow: 0 0 12px var(--orb-2); animation: orb-float-2 22s ease-in-out infinite; }
.orb-3 { width: 5px; height: 5px; background: var(--orb-1); top: 80%; left: 30%; box-shadow: 0 0 14px var(--orb-1); animation: orb-float-3 20s ease-in-out infinite; }
.orb-4 { width: 3px; height: 3px; background: var(--orb-2); top: 35%; left: 85%; box-shadow: 0 0 10px var(--orb-2); animation: orb-float-4 24s ease-in-out infinite; }
.orb-5 { width: 5px; height: 5px; background: var(--orb-1); top: 10%; left: 60%; box-shadow: 0 0 13px var(--orb-1); animation: orb-float-1 16s ease-in-out infinite reverse; }
.orb-6 { width: 4px; height: 4px; background: var(--orb-2); top: 70%; left: 45%; box-shadow: 0 0 11px var(--orb-2); animation: orb-float-2 26s ease-in-out infinite reverse; }
@keyframes aurora-drift-1 { 0%,100%{transform:translate(0,0) scale(1)} 33%{transform:translate(80px,40px) scale(1.1)} 66%{transform:translate(-40px,80px) scale(.95)} }
@keyframes aurora-drift-2 { 0%,100%{transform:translate(0,0) scale(1)} 33%{transform:translate(-60px,-50px) scale(1.05)} 66%{transform:translate(50px,-30px) scale(1.1)} }
@keyframes aurora-drift-3 { 0%,100%{transform:translate(0,0) scale(1);opacity:.7} 50%{transform:translate(-70px,40px) scale(1.15);opacity:1} }
@keyframes orb-float-1 { 0%,100%{transform:translate(0,0);opacity:.6} 25%{transform:translate(30px,-40px);opacity:1} 50%{transform:translate(-20px,-80px);opacity:.7} 75%{transform:translate(40px,-30px);opacity:.9} }
@keyframes orb-float-2 { 0%,100%{transform:translate(0,0);opacity:.5} 25%{transform:translate(-40px,30px);opacity:.8} 50%{transform:translate(20px,60px);opacity:1} 75%{transform:translate(-30px,20px);opacity:.6} }
@keyframes orb-float-3 { 0%,100%{transform:translate(0,0);opacity:.7} 50%{transform:translate(50px,-50px);opacity:1} }
@keyframes orb-float-4 { 0%,100%{transform:translate(0,0);opacity:.6} 33%{transform:translate(-30px,-40px);opacity:1} 66%{transform:translate(20px,30px);opacity:.5} }

/* === Hero Entrance Animations === */
@keyframes hero-enter { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
.hero-anim { opacity: 0; animation: hero-enter 0.8s ease forwards; }
.hero-anim-1 { animation-delay: 0s; }
.hero-anim-2 { animation-delay: 0.15s; }
.hero-anim-3 { animation-delay: 0.3s; }
.hero-anim-4 { animation-delay: 0.45s; }
.hero-anim-5 { animation-delay: 0.6s; }
@media (prefers-reduced-motion: reduce) { .hero-anim { opacity: 1; animation: none; } }

/* === Scroll Reveal === */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal .reveal-child { opacity: 0; transform: translateY(20px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.visible .reveal-child { opacity: 1; transform: translateY(0); }
.reveal.visible .reveal-child:nth-child(1) { transition-delay: 0.05s; }
.reveal.visible .reveal-child:nth-child(2) { transition-delay: 0.1s; }
.reveal.visible .reveal-child:nth-child(3) { transition-delay: 0.15s; }
.reveal.visible .reveal-child:nth-child(4) { transition-delay: 0.2s; }
.reveal.visible .reveal-child:nth-child(5) { transition-delay: 0.25s; }
.reveal.visible .reveal-child:nth-child(6) { transition-delay: 0.3s; }
@media (prefers-reduced-motion: reduce) { .reveal, .reveal .reveal-child { opacity: 1; transform: none; transition: none; } }

/* === Sidebar === */
.sidebar {
  position: fixed; top: 0; left: 0; width: 250px; height: 100vh;
  background: rgba(255,255,255,0.03); border-right: 1px solid rgba(255,255,255,0.08);
  display: flex; flex-direction: column; z-index: 30; transition: transform 0.3s;
}
body.ar .sidebar, [dir="rtl"] .sidebar { left: auto; right: 0; border-right: none; border-left: 1px solid rgba(255,255,255,0.08); }
.sidebar-logo {
  padding: 24px 20px; border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 600;
}
.sidebar-logo i {
  font-size: 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.sidebar-nav { flex: 1; padding: 16px 0; overflow-y: auto; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px; padding: 12px 24px;
  color: rgba(255,255,255,0.6); text-decoration: none; font-size: 14px;
  transition: all 0.2s; border-left: 3px solid transparent;
}
body.ar .sidebar-nav a, [dir="rtl"] .sidebar-nav a { border-left: none; border-right: 3px solid transparent; }
.sidebar-nav a:hover, .sidebar-nav a.active {
  color: #fff; background: rgba(201,169,110,0.1); border-left-color: var(--primary);
}
body.ar .sidebar-nav a:hover, body.ar .sidebar-nav a.active, [dir="rtl"] .sidebar-nav a:hover, [dir="rtl"] .sidebar-nav a.active { border-left-color: transparent; border-right-color: var(--primary); }
.sidebar-nav a i { width: 20px; text-align: center; }
.sidebar-footer {
  padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; flex-direction: column; gap: 8px;
}
.sidebar-footer button {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; color: rgba(255,255,255,0.7); cursor: pointer;
  font-size: 13px; font-family: inherit; transition: all 0.2s; width: 100%;
}
.sidebar-footer button:hover { background: rgba(255,255,255,0.1); color: #fff; }
.logout-btn { color: #ff6b6b !important; }
.logout-btn:hover { background: rgba(255,107,107,0.1) !important; }

/* === Mobile Toggle === */
.menu-toggle {
  display: none; position: fixed; top: 16px; left: 16px; z-index: 40;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15);
  color: #fff; width: 44px; height: 44px; border-radius: 10px; cursor: pointer; font-size: 18px;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
body.ar .menu-toggle, [dir="rtl"] .menu-toggle { left: auto; right: 16px; }

/* === Main Content === */
.main { margin-left: 250px; padding: 24px 32px; min-height: 100vh; }
body.ar .main, [dir="rtl"] .main { margin-left: 0; margin-right: 250px; }

/* === Top Bar === */
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.topbar h1 { font-size: 24px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 16px; }

/* === Notifications === */
.notif-wrapper { position: relative; }
.notif-btn {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
  color: #fff; width: 44px; height: 44px; border-radius: 10px; cursor: pointer; font-size: 16px; position: relative;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.notif-badge {
  position: absolute; top: -4px; right: -4px; background: #ff6b6b;
  color: #fff; font-size: 10px; font-weight: 700; min-width: 18px; height: 18px;
  border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.notif-badge.hidden { display: none; }
.notif-dropdown {
  display: none; position: absolute; top: 50px; right: 0; width: 320px;
  background: rgba(26,18,16,0.98); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px; overflow: hidden; z-index: 50; box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
body.ar .notif-dropdown, [dir="rtl"] .notif-dropdown { right: auto; left: 0; }
.notif-dropdown.show { display: block; }
.notif-header { padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,0.08); font-size: 14px; font-weight: 600; }
.notif-item { padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.05); cursor: pointer; transition: background 0.2s; }
.notif-item:hover { background: rgba(201,169,110,0.1); }
.notif-item-name { font-size: 13px; font-weight: 500; }
.notif-item-service { font-size: 12px; color: rgba(255,255,255,0.5); }
.notif-item-time { font-size: 11px; color: rgba(255,255,255,0.3); margin-top: 2px; }
.notif-empty { padding: 20px; text-align: center; color: rgba(255,255,255,0.4); font-size: 13px; }
.user-info { display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,0.7); font-size: 13px; }
.user-info i { color: var(--primary); }

/* === Stats Cards === */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 28px; }
.stat-card {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px; padding: 24px; transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card-icon {
  width: 44px; height: 44px; border-radius: 12px; display: flex;
  align-items: center; justify-content: center; font-size: 18px; margin-bottom: 14px;
}
.stat-card-icon.blue { background: rgba(201,169,110,0.15); color: #c9a96e; }
.stat-card-icon.green { background: rgba(67,233,123,0.15); color: #43e97b; }
.stat-card-icon.purple { background: rgba(161,140,209,0.15); color: #a18cd1; }
.stat-card-icon.orange { background: rgba(255,193,7,0.15); color: #ffc107; }
.stat-card-value {
  font-size: 28px; font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.stat-card-label { font-size: 13px; color: rgba(255,255,255,0.5); margin-top: 4px; }

/* === Filters === */
.filters { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; align-items: center; }
.filters input, .filters select {
  padding: 10px 14px; background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12); border-radius: 10px;
  color: #fff; font-size: 13px; font-family: inherit; outline: none;
}
.filters input:focus, .filters select:focus { border-color: var(--primary); }
.filters input::placeholder { color: rgba(255,255,255,0.3); }
.filters select option { background: #2a1c18; color: #fff; }
.filter-search { flex: 1; min-width: 200px; }
.filter-btn {
  padding: 10px 18px; border: none; border-radius: 10px; cursor: pointer;
  font-size: 13px; font-family: inherit; font-weight: 500; transition: all 0.2s;
}
.btn-apply { background: linear-gradient(135deg, var(--primary), var(--primary2)); color: #fff; }
.btn-apply:hover { box-shadow: 0 4px 15px rgba(201,169,110,0.4); }
.btn-reset { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.7); border: 1px solid rgba(255,255,255,0.12); }
.btn-reset:hover { background: rgba(255,255,255,0.12); }
.btn-export { background: rgba(67,233,123,0.15); color: #43e97b; border: 1px solid rgba(67,233,123,0.3); }
.btn-export:hover { background: rgba(67,233,123,0.25); }

/* === Table === */
.table-wrapper {
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px; overflow: visible;
}
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  padding: 14px 16px; text-align: left; font-size: 12px; font-weight: 600;
  color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 0.5px;
  background: rgba(201,169,110,0.06); border-bottom: 1px solid rgba(255,255,255,0.08); white-space: nowrap;
}
body.ar th, [dir="rtl"] th { text-align: right; }
td {
  padding: 14px 16px; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,0.04);
  max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
tr:hover { background: rgba(201,169,110,0.04); }
tr.unread { background: rgba(201,169,110,0.06); }
tr.unread:hover { background: rgba(201,169,110,0.08); }

/* === Badges === */
.badge { display: inline-block; padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.badge-new { background: rgba(67,233,123,0.15); color: #43e97b; }
.badge-reviewing, .badge-in_progress { background: rgba(201,169,110,0.15); color: #c9a96e; }
.badge-contacted, .badge-pending, .badge-waiting { background: rgba(255,193,7,0.15); color: #ffc107; }
.badge-completed, .badge-resolved, .badge-closed, .badge-paid { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.6); }
.badge-rejected, .badge-cancelled, .badge-lost, .badge-overdue { background: rgba(255,107,107,0.15); color: #ff6b6b; }
.badge-open { background: rgba(67,233,123,0.15); color: #43e97b; }
.badge-draft { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.5); }
.badge-sent, .badge-qualified { background: rgba(201,169,110,0.15); color: #c9a96e; }
.badge-won, .badge-accepted { background: rgba(67,233,123,0.15); color: #43e97b; }

/* === Action Buttons === */
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.act-btn {
  width: 32px; height: 32px; border-radius: 8px; border: none;
  cursor: pointer; font-size: 13px; display: flex; align-items: center;
  justify-content: center; transition: all 0.2s;
}
.act-view { background: rgba(201,169,110,0.15); color: #c9a96e; }
.act-view:hover { background: rgba(201,169,110,0.3); }
.act-edit { background: rgba(67,233,123,0.15); color: #43e97b; }
.act-edit:hover { background: rgba(67,233,123,0.3); }
.act-print { background: rgba(67,233,123,0.15); color: #43e97b; }
.act-print:hover { background: rgba(67,233,123,0.3); }
.act-delete { background: rgba(255,107,107,0.15); color: #ff6b6b; }
.act-delete:hover { background: rgba(255,107,107,0.3); }

/* === Pagination === */
.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 16px; border-top: 1px solid rgba(255,255,255,0.06); }
.page-btn {
  padding: 8px 14px; background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1); border-radius: 8px;
  color: rgba(255,255,255,0.7); cursor: pointer; font-size: 13px; font-family: inherit;
}
.page-btn:hover { background: rgba(201,169,110,0.15); color: #fff; }
.page-btn.active { background: linear-gradient(135deg, var(--primary), var(--primary2)); color: #fff; border-color: transparent; }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.page-info { color: rgba(255,255,255,0.5); font-size: 13px; }

/* === Modal === */
.modal-overlay {
  display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.6); z-index: 100; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.show { display: flex; }
.modal {
  background: rgba(26,18,16,0.98); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px; width: 90%; max-width: 600px; max-height: 85vh;
  overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.modal-header h2 { font-size: 18px; font-weight: 600; }
.modal-close { background: none; border: none; color: rgba(255,255,255,0.5); font-size: 20px; cursor: pointer; }
.modal-close:hover { color: #fff; }
.modal-body { padding: 24px; }
.detail-row { display: flex; gap: 12px; margin-bottom: 16px; align-items: flex-start; }
.detail-label { min-width: 100px; font-size: 12px; color: rgba(255,255,255,0.5); text-transform: uppercase; padding-top: 2px; }
.detail-value { font-size: 14px; flex: 1; word-break: break-word; }
.status-select {
  padding: 6px 12px; background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15); border-radius: 8px;
  color: #fff; font-size: 13px; font-family: inherit; cursor: pointer;
}
.status-select option { background: #2a1c18; }

/* === Notes === */
.notes-section { margin-top: 20px; border-top: 1px solid rgba(255,255,255,0.08); padding-top: 20px; }
.notes-section h3 { font-size: 15px; margin-bottom: 12px; }
.note-item { padding: 12px; background: rgba(255,255,255,0.04); border-radius: 10px; margin-bottom: 8px; }
.note-meta { font-size: 11px; color: rgba(255,255,255,0.4); margin-bottom: 4px; }
.note-text { font-size: 13px; }
.note-add { display: flex; gap: 8px; margin-top: 12px; }
.note-input {
  flex: 1; padding: 10px 14px; background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12); border-radius: 10px;
  color: #fff; font-size: 13px; font-family: inherit; outline: none; resize: none;
}
.note-input:focus { border-color: var(--primary); }
.note-submit {
  padding: 10px 16px; background: linear-gradient(135deg, var(--primary), var(--primary2));
  border: none; border-radius: 10px; color: #fff; cursor: pointer; font-size: 13px; font-family: inherit; white-space: nowrap;
}

/* === Delete Modal === */
.delete-modal .modal { max-width: 400px; text-align: center; }
.delete-modal .modal-body { padding: 30px; }
.delete-icon { font-size: 48px; color: #ff6b6b; margin-bottom: 16px; }
.delete-text { font-size: 15px; margin-bottom: 24px; color: rgba(255,255,255,0.8); }
.delete-actions { display: flex; gap: 12px; justify-content: center; }
.btn-cancel {
  padding: 10px 24px; background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12); border-radius: 10px; color: #fff; cursor: pointer; font-family: inherit;
}
.btn-confirm-delete {
  padding: 10px 24px; background: #ff6b6b; border: none; border-radius: 10px;
  color: #fff; cursor: pointer; font-family: inherit; font-weight: 600;
}
.empty-state { text-align: center; padding: 48px 20px; color: rgba(255,255,255,0.4); }
.empty-state i { font-size: 48px; margin-bottom: 16px; display: block; }

/* === Toast === */
.toast {
  position: fixed; bottom: 24px; right: 24px; padding: 14px 24px;
  border-radius: 12px; font-size: 13px; font-weight: 500; z-index: 200;
  transform: translateY(100px); opacity: 0; transition: all 0.3s; max-width: calc(100vw - 48px);
}
body.ar .toast, [dir="rtl"] .toast { right: auto; left: 24px; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast-success { background: rgba(67,233,123,0.2); border: 1px solid rgba(67,233,123,0.4); color: #43e97b; }
.toast-error { background: rgba(255,107,107,0.2); border: 1px solid rgba(255,107,107,0.4); color: #ff6b6b; }

/* === Accessibility === */
@media (prefers-reduced-motion: reduce) { .aurora, .orb { animation: none !important; } }

/* === Print === */
@media print {
  body { background: #fff !important; color: #000 !important; }
  .sidebar, .topbar, .filters, .pagination, .actions, .menu-toggle,
  .notif-wrapper, .modal-overlay, .sidebar-footer, .bg-anim, .sidebar-overlay { display: none !important; }
  .main { margin: 0 !important; padding: 20px !important; }
  .stat-card { border: 1px solid #ddd; }
  .stat-card-value { color: #333 !important; -webkit-text-fill-color: #333 !important; }
  table { border: 1px solid #ddd; }
  th { background: #f5f5f5 !important; color: #333 !important; }
  td { color: #333; border-bottom: 1px solid #eee; }
  .badge { border: 1px solid #ddd; }
}

/* === Responsive 1024px === */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* === Responsive 768px === */
@media (max-width: 768px) {
  /* Sidebar - hide off-screen */
  .sidebar { transform: translateX(-100%); width: 280px; }
  body.ar .sidebar, [dir="rtl"] .sidebar { transform: translateX(100%); }
  .sidebar.open, body.ar .sidebar.open, [dir="rtl"] .sidebar.open { transform: translateX(0) !important; }
  .sidebar-logo { padding: 16px; font-size: 14px; }
  .sidebar-nav a { padding: 12px 16px; font-size: 13px; }
  .sidebar-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 25; }
  .sidebar-overlay.show { display: block; }

  /* Menu Toggle - show on mobile */
  .menu-toggle { display: flex; align-items: center; justify-content: center; }

  /* Main Content - remove sidebar margin */
  .main { margin-left: 0 !important; margin-right: 0 !important; padding: 16px; padding-top: 70px; }

  /* Topbar */
  .topbar { position: relative; z-index: 50; flex-direction: column; align-items: stretch; gap: 12px; }
  .topbar h1 { font-size: 20px; }
  .topbar-right { width: 100%; display: flex; justify-content: space-between; align-items: center; flex-direction: row-reverse; }
  body.ar .topbar-right, [dir="rtl"] .topbar-right { flex-direction: row; }

  /* Notifications */
  .notif-wrapper { position: relative; z-index: 51; }
  .notif-dropdown, body.ar .notif-dropdown { position: fixed !important; top: auto; width: calc(100vw - 32px); max-width: 360px; left: 16px !important; right: 16px !important; transform: none !important; z-index: 999; }

  /* Stats */
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-card { padding: 16px; }
  .stat-card-value { font-size: 22px; }
  .stat-card-label { font-size: 12px; }

  /* Filters */
  .filters { flex-direction: column; }
  .filters input, .filters select { width: 100%; }
  .filter-search { min-width: auto; width: 100%; }
  .filter-btn { width: 100%; min-height: 44px; }
  .filters label { width: 100%; font-size: 12px; }

  /* Form Inputs - prevent iOS zoom */
  input, select, textarea { font-size: 16px !important; }

  /* Table responsive - horizontal scroll */
  .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 600px; }
  th, td { padding: 10px 8px; font-size: 12px; white-space: nowrap; }

  /* Touch targets */
  .act-btn { min-width: 44px; min-height: 44px; font-size: 15px; }
  .page-btn { min-height: 44px; padding: 10px 16px; }

  /* Modals */
  .modal { width: 95vw !important; max-width: none !important; margin: 10px; max-height: 90vh; overflow-y: auto; }
  .modal-header { padding: 16px; }
  .modal-body { padding: 16px; }
  .modal-header h2 { font-size: 18px; }
  .form-grid { grid-template-columns: 1fr !important; }

  /* Detail rows */
  .detail-row { flex-direction: column; gap: 4px; }
  .detail-label { min-width: auto; }

  /* Buttons */
  .btn-save, .btn-create { width: 100%; text-align: center; padding: 12px; }
  .delete-actions { flex-direction: column; }
  .delete-actions button { width: 100%; }

  /* Settings */
  .settings-grid { grid-template-columns: 1fr !important; }
  .settings-card { margin-bottom: 16px; }
  .settings-card-body { padding: 16px; }
  .toggle-group { flex-wrap: wrap; }
  .sections-table th, .sections-table td { padding: 10px 6px; font-size: 13px; }

  /* Background - reduce for performance */
  .aurora { filter: blur(60px); }
  .aurora-3 { display: none; }
  .orb-4, .orb-5, .orb-6 { display: none; }

  /* Toast - center on mobile */
  .toast, body.ar .toast { left: 16px !important; right: 16px !important; max-width: none; }

  /* Section headers */
  .section-header { flex-wrap: wrap; gap: 8px; }
  .section-actions { flex-wrap: wrap; gap: 8px; }
}

/* === Extra small screens === */
@media (max-width: 480px) {
  .main { padding: 12px; padding-top: 66px; }
  .topbar h1 { font-size: 18px; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card-value { font-size: 20px; }
  .modal { margin: 5px; }
  th, td { padding: 8px 6px; font-size: 11px; }
  .topbar-right { gap: 8px; }
  .user-info span { display: none; }
}
