:root {
  --bg-deep: #F7FAFC;
  --glass: rgba(255, 255, 255, 0.92);
  --border: rgba(148, 163, 184, 0.22);
  --text: #1F2937;
  --muted: #6B7280;
  --brand: #16B6B0;
  --scroll-track: rgba(226, 232, 240, 0.95);
  --scroll-thumb: linear-gradient(180deg, rgba(20, 184, 166, 0.72), rgba(59, 130, 246, 0.68));
  --scroll-thumb-hover: linear-gradient(180deg, rgba(13, 148, 136, 0.9), rgba(37, 99, 235, 0.82));
  --scroll-thumb-border: rgba(248, 250, 252, 0.95);
}
html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background:
    radial-gradient(1200px 700px at 10% 20%, rgba(20,184,166,.10), transparent 55%),
    radial-gradient(900px 600px at 85% 30%, rgba(59,130,246,.10), transparent 55%),
    radial-gradient(900px 700px at 40% 95%, rgba(148,163,184,.10), transparent 60%),
    linear-gradient(180deg, #f8fafc, #eef2f7);
  color: var(--text);
}
html[dir="rtl"] body { font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
h1, h2, h3 { letter-spacing: .2px; }
h1 { font-weight: 800; line-height: 1.1; }
h2 { font-weight: 700; line-height: 1.2; }
h3 { font-weight: 700; line-height: 1.25; }
body.en { --text: #1F2937; --muted: #6B7280; }
html,
body,
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(20, 184, 166, 0.72) rgba(226, 232, 240, 0.95);
}
body:not(.cq-light) {
  --scroll-track: rgba(226, 232, 240, 0.95);
  --scroll-thumb: linear-gradient(180deg, rgba(20, 184, 166, 0.72), rgba(59, 130, 246, 0.68));
  --scroll-thumb-hover: linear-gradient(180deg, rgba(13, 148, 136, 0.9), rgba(37, 99, 235, 0.82));
  --scroll-thumb-border: rgba(248, 250, 252, 0.95);
}
body.cq-light {
  --scroll-track: rgba(226, 232, 240, 0.95);
  --scroll-thumb: linear-gradient(180deg, rgba(20, 184, 166, 0.72), rgba(59, 130, 246, 0.68));
  --scroll-thumb-hover: linear-gradient(180deg, rgba(13, 148, 136, 0.9), rgba(37, 99, 235, 0.82));
  --scroll-thumb-border: rgba(248, 250, 252, 0.95);
}
::-webkit-scrollbar,
.app-scrollbar::-webkit-scrollbar,
.custom-scrollbar::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track,
.app-scrollbar::-webkit-scrollbar-track,
.custom-scrollbar::-webkit-scrollbar-track {
  background: var(--scroll-track);
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.14);
}
::-webkit-scrollbar-thumb,
.app-scrollbar::-webkit-scrollbar-thumb,
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 999px;
  border: 2px solid var(--scroll-thumb-border);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}
::-webkit-scrollbar-thumb:hover,
.app-scrollbar::-webkit-scrollbar-thumb:hover,
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb-hover);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: #0f172a;
  cursor: pointer;
  transition: all .2s ease;
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.08);
  user-select: none;
}
.btn:hover {
  background: #ffffff;
  border-color: rgba(20, 184, 166, 0.24);
  color: #0f766e;
  box-shadow: 0 14px 30px rgba(20, 184, 166, 0.12);
}
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.16), 0 10px 22px rgba(2, 6, 23, 0.08);
}
.btn:not(.btn-primary):not(.btn-ghost) {
  background: rgba(255,255,255,0.92);
  border-color: rgba(148, 163, 184, 0.22);
  color: #0f172a;
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.08);
}
.btn:not(.btn-primary):not(.btn-ghost):hover {
  background: #ffffff;
  border-color: rgba(20, 184, 166, 0.24);
  color: #0f766e;
  box-shadow: 0 14px 30px rgba(20, 184, 166, 0.12);
}
.btn:not(.btn-primary):not(.btn-ghost):focus-visible {
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.16), 0 10px 22px rgba(2, 6, 23, 0.08);
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: #16B6B0;
  border-color: #0FA7A1;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(22, 182, 176, 0.35);
}
.btn-primary:hover {
  background: #0FA7A1;
  border-color: #0D9488;
}
.btn-ghost {
  background: rgba(255,255,255,0.92);
  border-color: rgba(148, 163, 184, 0.22);
  color: #0f172a;
}
/* Safe area for fixed footers across pages */
body { padding-bottom: 60px; }
/* Generic centered container for content sections */
.page-container { max-width: 1200px; margin-inline: auto; padding-inline: 16px; }
canvas#bg-canvas {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  z-index: -1; pointer-events: none;
  opacity: 0.22;
  filter: saturate(0.7) brightness(1.08);
}
.brand-bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}
.brand-bar img { height: 28px; }
.brand-name { font-weight: 600; color: #1F2937; }
.brand-info { margin-left: auto; color: var(--muted); font-size: 0.85rem; }
.side-menu-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: none; z-index: 40;
}
.side-menu-overlay.open { display: block; }
.side-menu {
  position: fixed; top: 0; right: -320px; width: 320px; height: 100vh; z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px) saturate(140%);
  border-left: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: -10px 0 28px rgba(2, 6, 23, 0.08);
  transition: right 0.3s ease;
  display: flex; flex-direction: column;
  --side-link-pad-x: 12px;
  --side-link-gap: 10px;
  --side-icon-size: 34px;
  --side-logo-width: 114px;
  --side-logo-offset: 20px;
}
.side-menu.open { right: 0; }
.side-menu-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 16px var(--side-logo-offset) 14px 54px;
  min-height: 78px;
}
.side-menu-logo {
  position: absolute;
  top: calc(50% + 10px);
  right: var(--side-logo-offset);
  transform: translateY(-50%);
  width: var(--side-logo-width);
  height: auto;
  object-fit: contain;
  object-position: right center;
  clip-path: none;
  background: transparent;
  mix-blend-mode: normal;
  filter: none;
  margin: 0;
}
.close-menu-btn {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  background:none;
  border:none;
  color:#0f172a;
  font-size:24px;
  cursor:pointer;
}
.side-menu-nav { display:flex; flex-direction:column; padding: 8px; gap: 4px; }
.side-link { display:flex; align-items:center; gap:var(--side-link-gap); padding:10px var(--side-link-pad-x); color:#334155; text-decoration:none; border-radius:10px; }
.side-link:hover, .side-link.active { background: rgba(20, 184, 166, 0.1); }
.side-link.active { background: rgba(20, 184, 166, 0.14); color: #0f766e; }
.side-link .nav-icon {
  width: var(--side-icon-size);
  height: var(--side-icon-size);
  flex: 0 0 var(--side-icon-size);
  position: relative;
  font-size: 0;
  border: 1px solid #BDEDE6;
  border-radius: 0;
  clip-path: polygon(25% 6%, 75% 6%, 94% 50%, 75% 94%, 25% 94%, 6% 50%);
  background: #E6F7F4;
  box-shadow: 0 4px 12px rgba(15,174,155,0.08);
}
.side-link .nav-icon::before {
  content: "";
  position: absolute;
  inset: 6px;
  background: #0FAE9B;
  -webkit-mask: var(--nav-icon) no-repeat center / contain;
  mask: var(--nav-icon) no-repeat center / contain;
  transition: background .2s ease, transform .2s ease;
}
.side-link:hover .nav-icon,
.side-link.active .nav-icon {
  background: linear-gradient(135deg, rgba(240,253,250,0.98), rgba(239,246,255,0.96));
  border-color: rgba(20,184,166,0.22);
  box-shadow: 0 12px 26px rgba(20,184,166,0.12);
}
.side-link:hover .nav-icon::before,
.side-link.active .nav-icon::before {
  background: #0FAE9B;
  transform: scale(1.02);
}
.icon-home { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.85' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10.5 12 4l9 6.5'/%3E%3Cpath d='M5.5 9.5V20H18.5V9.5'/%3E%3Cpath d='M10 20v-5h4v5'/%3E%3C/svg%3E"); }
.icon-tasks { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.85' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='6.5' y='4' width='11' height='16' rx='2.2'/%3E%3Cpath d='M9 4.5h6'/%3E%3Cpath d='m9 12.5 2.2 2.2 4.6-4.6'/%3E%3C/svg%3E"); }
.icon-employees { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.85' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 19v-1.2a3.8 3.8 0 0 0-3.8-3.8H8.8A3.8 3.8 0 0 0 5 17.8V19'/%3E%3Ccircle cx='10.5' cy='8.5' r='3'/%3E%3Cpath d='M19 19v-1a3 3 0 0 0-2.2-2.9'/%3E%3Cpath d='M15.8 5.7a3 3 0 0 1 0 5.6'/%3E%3C/svg%3E"); }
.icon-violations { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.85' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.8 18.5 6.8v4.6c0 4.4-2.8 7.1-6.5 8.8-3.7-1.7-6.5-4.4-6.5-8.8V6.8L12 3.8Z'/%3E%3Cpath d='M12 8.4v4.5'/%3E%3Ccircle cx='12' cy='16.5' r='1' fill='black' stroke='none'/%3E%3C/svg%3E"); }
.icon-training { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.85' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8.5 12 4l9 4.5-9 4.5L3 8.5Z'/%3E%3Cpath d='M7 10.6V15l5 2.5 5-2.5v-4.4'/%3E%3Cpath d='M21 9v5'/%3E%3C/svg%3E"); }
.icon-health { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.85' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.2 8.8c0 6.2-8.2 10.6-8.2 10.6S3.8 15 3.8 8.8c0-2.4 1.9-4.3 4.3-4.3 1.5 0 2.9.7 3.9 1.9 1-1.2 2.4-1.9 3.9-1.9 2.4 0 4.3 1.9 4.3 4.3Z'/%3E%3Cpath d='M7 12h3l1.5-3 2.5 6 1.6-3H17'/%3E%3C/svg%3E"); }
.icon-branches { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.85' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8.5h16'/%3E%3Cpath d='M5.2 8.5 6.7 4.5h10.6l1.5 4'/%3E%3Cpath d='M6 8.5v8.5h12V8.5'/%3E%3Cpath d='M10 17v-4h4v4'/%3E%3C/svg%3E"); }
.icon-licenses { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.85' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3.5H7.2a1.7 1.7 0 0 0-1.7 1.7v13.6a1.7 1.7 0 0 0 1.7 1.7h9.6a1.7 1.7 0 0 0 1.7-1.7V8.5Z'/%3E%3Cpath d='M14 3.5v5h5'/%3E%3Cpath d='m9.2 14 2.1 2.1 4.5-4.5'/%3E%3C/svg%3E"); }
.icon-records { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.85' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.8 7.2h5l1.9 2h9.5v8.6a1.7 1.7 0 0 1-1.7 1.7H5.5a1.7 1.7 0 0 1-1.7-1.7V8.9a1.7 1.7 0 0 1 1.7-1.7Z'/%3E%3C/svg%3E"); }
.icon-housings { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.85' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 10 12 4l7.5 6v9.5H4.5V10Z'/%3E%3Cpath d='M9.5 19.5v-5h5v5'/%3E%3C/svg%3E"); }
.icon-transports { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.85' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 16.5h14l-1.2-5-2-4H8.2l-2 4Z'/%3E%3Ccircle cx='8' cy='16.5' r='1.7'/%3E%3Ccircle cx='16' cy='16.5' r='1.7'/%3E%3Cpath d='M6.5 11.5h11'/%3E%3C/svg%3E"); }
.icon-reports { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.85' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 19V11'/%3E%3Cpath d='M10 19V5'/%3E%3Cpath d='M15 19v-7'/%3E%3Cpath d='M20 19V8'/%3E%3Cpath d='M3 19h18'/%3E%3C/svg%3E"); }
.icon-login { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.85' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='10' cy='8' r='3'/%3E%3Cpath d='M4.8 19a5.2 5.2 0 0 1 10.4 0'/%3E%3Cpath d='M15.5 11.5H20'/%3E%3Cpath d='m18 9 2 2.5-2 2.5'/%3E%3C/svg%3E"); }
.icon-admin { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.85' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.8 18.5 6.8v4.6c0 4.4-2.8 7.1-6.5 8.8-3.7-1.7-6.5-4.4-6.5-8.8V6.8L12 3.8Z'/%3E%3Cpath d='m9.5 12.2 1.8 1.8 3.7-3.7'/%3E%3C/svg%3E"); }
.lang-switch .lang-btn {
  background: rgba(255,255,255,0.92); border: 1px solid rgba(148, 163, 184, 0.22);
  color: #0f172a; padding: 5px 10px; min-width: 52px; font-size: 12px; font-weight: 600; border-radius: 9px; cursor: pointer;
  letter-spacing: .4px;
  transition: all .2s ease;
}
.lang-switch .lang-btn:hover {
  background: rgba(20,184,166,0.1);
  border-color: rgba(20,184,166,0.24);
  color: #0f766e;
}
.sidebar-footer .sidebar-devline {
  color: #6B7280;
  font-size: 0.72rem;
}
@media (max-width: 768px) {
  .side-menu .sidebar-footer {
    margin-top: 16px !important;
    padding-top: 12px !important;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
  .side-menu .sidebar-footer .gradient-text {
    font-size: 0.82rem !important;
    line-height: 1.5 !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }
  .side-menu .sidebar-footer .sidebar-devline {
    font-size: 0.7rem !important;
    line-height: 1.4 !important;
  }
}
.services-modal { position: fixed; inset: 0; display: none; z-index: 60; }
.services-modal.open { display:flex; align-items:center; justify-content:center; }
.services-modal-content {
  width: min(1100px, 92vw);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(2, 6, 23, 0.12);
  padding: 16px;
}
.services-header { display:flex; align-items:center; justify-content:space-between; }
.toolbar { display:flex; gap:10px; margin: 12px 0; flex-wrap: wrap; }
.toolbar-btn {
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: #0f172a; padding: 8px 12px; border-radius: 10px; cursor: pointer;
}
.glass-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(18px);
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}
.glass-nav .max-w-7xl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.glass-nav a {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--muted);
  transition: .2s ease;
  white-space: nowrap;
}
.glass-nav a:hover {
  color: var(--text);
  background: rgba(20, 184, 166, 0.06);
  border-color: rgba(20, 184, 166, 0.12);
}
.glass-nav a.active, .glass-nav a.nav-active {
  color: var(--text);
  background: rgba(20,184,166,.10);
  border-color: rgba(20,184,166,.25);
}
.glass-nav button {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255,255,255,0.92);
  color: #0f172a;
  transition: .2s ease;
}
.glass-nav button:hover {
  background: rgba(20, 184, 166, 0.08);
  border-color: rgba(20, 184, 166, 0.22);
}
.logout-btn {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  color: #dc2626;
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
}
.logout-btn:hover {
  background: rgba(239,68,68,0.14);
  border-color: rgba(239,68,68,0.28);
}
.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(148,163,184,0.24);
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(2,6,23,0.08);
}
.user-badge:hover {
  background: #ffffff;
  border-color: rgba(20,184,166,0.28);
}
.user-avatar {
  width: 22px; height: 22px; border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, rgba(20,184,166,0.95), rgba(13,148,136,0.95));
  box-shadow: 0 0 0 2px rgba(20,184,166,0.18), 0 10px 22px rgba(20,184,166,0.25);
}
.user-menu {
  position: absolute;
  right: 12px; top: 48px;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(148,163,184,0.22);
  border-radius: 12px;
  box-shadow: 0 18px 36px rgba(2,6,23,0.12);
  padding: 8px;
  display: none;
  min-width: 180px;
}
.user-menu.open { display: block; }
.user-menu a, .user-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: #334155;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.user-menu a:hover, .user-menu button:hover {
  background: rgba(20, 184, 166, 0.08);
  color: #0f766e;
}
.kpi-grid { display:grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.kpi-card {
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px; padding: 12px;
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.06);
}
.kpi-title { color: var(--muted); font-size: 0.85rem; }
.services-table-wrapper { margin-top: 12px; overflow: auto; max-height: 50vh; }
table { width: 100%; border-collapse: collapse; color: #1F2937; }
thead { background: rgba(248, 250, 252, 0.96); }
th, td { padding: 8px 10px; border-bottom: 1px solid rgba(148, 163, 184, 0.16); text-align: left; }
