:root {
  --background: #eaf8fc;
  --foreground: #0e1a3a;
  --card: #ffffff;
  --primary: #00718f;
  --primary-foreground: #ffffff;
  --secondary: #e6f8fc;
  --muted: #e9f0f4;
  --muted-foreground: #005a73;
  --destructive: #b42318;
  --border: color-mix(in srgb, #0e1a3a 14%, transparent);
  --ring: #0086a8;
  --chart-1: #0086a8;
  --chart-2: #00c4e6;
  --chart-3: #00718f;
  --chart-4: #78d6ff;
  --chart-5: #b42318;
  --sidebar: #0e1a3a;
  --sidebar-foreground: #eaf8fc;
  --sidebar-accent: #0a3f52;
  --radius: 1rem;
  --font-sans: "Archivo", "IBM Plex Sans Arabic", ui-sans-serif, system-ui, sans-serif;
  --font-heading: "Space Grotesk", "Archivo", "IBM Plex Sans Arabic", sans-serif;
  color-scheme: light;
}
html.dark {
  --background: #0e1a3a;
  --foreground: #eaf8fc;
  --card: #0a3f52;
  --primary: #00c4e6;
  --primary-foreground: #0e1a3a;
  --secondary: #0a3f52;
  --muted: #0a3f52;
  --muted-foreground: #78d6ff;
  --border: color-mix(in srgb, #78d6ff 28%, transparent);
  --ring: #00c4e6;
  --chart-1: #00c4e6;
  --chart-2: #78d6ff;
  --chart-3: #0086a8;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font-sans);
  color: var(--foreground);
  background-color: var(--background);
  background-image:
    radial-gradient(ellipse 70% 55% at 18% 0%, #dff6fe 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 90% 40%, #f3fdff 0%, transparent 70%);
  background-attachment: fixed;
}
html.dark body {
  background-color: #0e1a3a;
  background-image:
    radial-gradient(ellipse 70% 55% at 18% 0%, color-mix(in srgb, #00c4e6 32%, #0e1a3a) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 90% 40%, color-mix(in srgb, #0086a8 40%, #0e1a3a) 0%, transparent 68%);
}
html[dir="rtl"] body, html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3 {
  font-family: "IBM Plex Sans Arabic", "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
}
h1, h2, h3 { font-family: var(--font-heading); letter-spacing: -0.025em; margin: 0; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
.shell { min-height: 100vh; }
.aside {
  display: none;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-direction: column;
  background: var(--sidebar);
  color: var(--sidebar-foreground);
}
.aside-pad { padding: 1.25rem 1rem; }
.side-nav { display: grid; gap: 0.25rem; padding: 0 0.75rem; }
.side-link {
  display: flex; align-items: center; gap: 0.5rem; min-height: 2.75rem;
  padding: 0 0.75rem; border-radius: 0.75rem; text-decoration: none; font-size: 0.875rem;
  color: color-mix(in srgb, var(--sidebar-foreground) 80%, transparent);
}
.side-link.on { background: var(--sidebar-accent); color: var(--sidebar-foreground); }
.aside-foot { margin-top: auto; border-top: 1px solid color-mix(in srgb, #eaf8fc 25%, transparent); padding: 1rem; }
@media (min-width: 1024px) {
  .shell { display: grid; grid-template-columns: 240px 1fr; }
  .aside { display: flex; }
  .mobile-only { display: none !important; }
  .desk-search { display: block !important; }
  .main { padding-bottom: 2.5rem; }
}
.brand-header {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--background) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid color-mix(in srgb, var(--foreground) 25%, transparent);
}
.header-row { display: flex; align-items: center; gap: 0.5rem; height: 3.5rem; padding: 0 0.75rem; }
@media (min-width: 1024px) { .header-row { padding: 0 1.5rem; } }
.brand-note {
  background: #e6f8fc; color: #005a73;
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 1rem; font-size: 0.875rem; line-height: 1.5;
}
html.dark .brand-note {
  background: color-mix(in srgb, #00c4e6 16%, #0a3f52);
  color: #eaf8fc;
  border-color: var(--border);
}
.main { width: 100%; max-width: 48rem; margin: 0 auto; padding: 1.25rem 1rem 7rem; }
@media (min-width: 1024px) { .main.wide { max-width: 72rem; } .main.portal { max-width: 64rem; } }
.main.portal { max-width: 64rem; display: grid; gap: 1.25rem; padding-bottom: 6rem; }
@media (min-width: 1024px) { .main.portal { padding: 1.25rem 1.5rem 2.5rem; } }
.brand-bar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 40;
  background: color-mix(in srgb, var(--background) 88%, transparent);
  backdrop-filter: blur(8px);
  border-top: 2px solid color-mix(in srgb, var(--foreground) 20%, transparent);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; min-height: 4rem; font-size: 11px; font-weight: 500; text-decoration: none;
  background: none; border: 0; color: var(--muted-foreground); cursor: pointer;
}
.tab.on { color: var(--primary); }
.badge-count {
  position: absolute; top: -6px; inset-inline-end: -8px;
  min-width: 1rem; border-radius: 999px; background: var(--destructive);
  color: #fff; font-size: 10px; text-align: center; padding: 0 4px;
}
.stack { display: grid; gap: 1.5rem; }
.stack-sm { display: grid; gap: 0.75rem; }
.stack-md { display: grid; gap: 1.25rem; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.between { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; }
.muted { color: var(--muted-foreground); }
.sm { font-size: 0.875rem; }
.xs { font-size: 0.75rem; }
.lg { font-size: 1.125rem; }
.xl { font-size: 1.25rem; }
.h1 { font-size: 1.875rem; font-weight: 600; margin-top: 0.25rem; }
.h2 { font-size: 1.25rem; font-weight: 600; }
.card, .panel, .kpi {
  border-radius: 1rem;
  border: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(14, 26, 58, 0.12);
}
.card, .panel {
  background-color: #fff;
  background-image: linear-gradient(165deg, color-mix(in srgb, #fff 70%, #e6f8fc) 0%, #fff 46%, color-mix(in srgb, #fff 82%, #78d6ff) 100%);
}
.kpi {
  background-color: #fff;
  background-image: linear-gradient(155deg, color-mix(in srgb, #00c4e6 22%, #fff) 0%, #fff 48%, color-mix(in srgb, #78d6ff 28%, #fff) 100%);
}
html.dark .card, html.dark .panel, html.dark .kpi {
  background-color: #0a3f52;
  background-image: linear-gradient(165deg, color-mix(in srgb, #00c4e6 18%, #0a3f52) 0%, #0a3f52 52%, color-mix(in srgb, #0086a8 22%, #0e1a3a) 100%);
  color: #eaf8fc;
  box-shadow: 0 6px 18px rgba(14, 26, 58, 0.35);
}
.pad { padding: 1rem; }
.overdue { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--destructive) 50%, transparent); }
.btn, .touch {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; width: 100%; border-radius: 0.75rem; border: 1px solid transparent;
  padding: 0 1rem; font-size: 1rem; font-weight: 500; text-decoration: none; cursor: pointer;
  background: var(--secondary); color: var(--foreground);
}
.btn-primary, .bg-primary {
  background-color: #00718f;
  background-image: linear-gradient(180deg, #00718f 0%, #005a73 100%);
  color: #fff;
  box-shadow: inset 0 1px 0 color-mix(in srgb, #00c4e6 65%, #fff), 0 6px 18px rgba(14, 26, 58, 0.12);
}
html.dark .btn-primary, html.dark .bg-primary {
  background-color: #00c4e6;
  background-image: linear-gradient(180deg, #78d6ff 0%, #00c4e6 100%);
  color: #0e1a3a;
}
.btn-outline { background: transparent; border-color: var(--border); }
.btn-danger { background: transparent; color: var(--destructive); border-color: color-mix(in srgb, var(--destructive) 40%, transparent); }
.btn-wa { background: #128c7e; color: #fff; }
.btn-auto { width: auto; }
.btn:disabled { opacity: 0.55; cursor: default; }
.field { display: grid; gap: 0.375rem; font-size: 0.875rem; font-weight: 500; }
.input, .select, textarea.input {
  width: 100%; min-height: 3rem; border-radius: 0.75rem; border: 1px solid var(--border);
  background: var(--card); padding: 0.5rem 0.75rem; font-size: 1rem; outline: none;
}
textarea.input { min-height: 5rem; }
.input:focus, .select:focus { border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 40%, transparent); }
.hint {
  background: #e6f8fc; color: #005a73; border: 1px solid var(--border);
  border-radius: 0.75rem; padding: 0.75rem 1rem; font-size: 0.875rem; line-height: 1.5;
}
html.dark .hint { background: color-mix(in srgb, #00c4e6 16%, #0a3f52); color: #eaf8fc; }
.flash { border-radius: 0.75rem; padding: 0.75rem 1rem; font-size: 0.875rem; }
.flash-ok { background: #e6f8fc; color: #005a73; }
.flash-bad { background: color-mix(in srgb, #b42318 12%, #fff); color: #b42318; }
.empty { padding: 1rem 0; }
.pill, .chip {
  display: inline-flex; align-items: center; min-height: 1.75rem; border-radius: 999px;
  padding: 0 0.6rem; font-size: 0.75rem; font-weight: 500; text-decoration: none; white-space: nowrap;
}
.pill-high { background: #00718f; color: #fff; }
.pill-mid { background: #00c4e6; color: #0e1a3a; }
.pill-low { background: var(--muted); color: var(--foreground); }
.pill-gem { background: #78d6ff; color: #0e1a3a; }
.pill-ex { background: #e6f8fc; color: #005a73; }
.pill-off { background: #e6f8fc; color: #005a73; }
.pill-on { background: #00718f; color: #fff; }
.pill-demo { background: #00c4e6; color: #0e1a3a; }
.chips { display: flex; gap: 0.5rem; overflow-x: auto; padding-bottom: 0.25rem; }
.chip { border: 1px solid var(--border); background: transparent; color: var(--foreground); min-height: 2.25rem; padding: 0 0.8rem; cursor: pointer; }
.chip.on { background: var(--primary); color: var(--primary-foreground); border-color: transparent; }
.cols { display: grid; gap: 0.75rem; }
@media (min-width: 640px) { .cols-2 { grid-template-columns: 1fr 1fr; } .sm-span-2 { grid-column: span 2; } }
@media (min-width: 1024px) {
  .cols-4 { grid-template-columns: repeat(4, 1fr); }
  .cols-3 { grid-template-columns: repeat(3, 1fr); }
  .lg-2 { grid-template-columns: 1fr 1fr; }
  .lg-span-3 { grid-column: span 3; }
}
.hero {
  background-color: #0e1a3a; color: #eaf8fc;
  background-image:
    radial-gradient(ellipse 55% 42% at 0% 0%, #00c4e6 0%, transparent 68%),
    radial-gradient(ellipse 48% 40% at 100% 100%, #0086a8 0%, transparent 70%),
    radial-gradient(ellipse 36% 28% at 80% 12%, #78d6ff 0%, transparent 72%);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 2rem 1.5rem; min-height: 42vh;
}
.login { min-height: 100vh; }
@media (min-width: 1024px) { .login { display: grid; grid-template-columns: 1fr 1fr; } .hero { min-height: 100vh; padding: 2rem 2.5rem; } }
.login-form { display: flex; align-items: center; padding: 2.5rem 1.5rem; }
.login-box { width: 100%; max-width: 24rem; margin: 0 auto; }
.bars { display: flex; align-items: flex-end; gap: 0.5rem; min-height: 140px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.25rem; height: 140px; justify-content: flex-end; }
.bar { width: 100%; border-radius: 0.4rem 0.4rem 0 0; background: var(--chart-1); min-height: 2px; }
.bar.alt { background: var(--chart-2); }
.sheet {
  position: fixed; z-index: 50; background: var(--sidebar); color: var(--sidebar-foreground);
  inset-block: 0; inset-inline-start: 0; width: 18rem; padding: 1rem;
  box-shadow: 0 12px 40px rgba(14, 26, 58, 0.35);
}
html[dir="rtl"] .sheet { inset-inline-start: auto; inset-inline-end: 0; }
.sheet.bottom {
  inset: auto 0 0 0; width: auto; background: var(--card); color: var(--foreground);
  border-radius: 1rem 1rem 0 0; padding: 0.75rem;
}
.backdrop { position: fixed; inset: 0; background: rgba(14, 26, 58, 0.35); z-index: 45; border: 0; }
.logo-dark { display: none; }
html.dark .logo-light { display: none; }
html.dark .logo-dark { display: block; }
.icon-btn {
  display: inline-flex; width: 3rem; height: 3rem; align-items: center; justify-content: center;
  border-radius: 0.75rem; border: 0; background: transparent; cursor: pointer;
}
.view-as { background: #0e1a3a; color: #fff; text-align: center; padding: 0.5rem 1rem; font-size: 0.875rem; }
.link { color: #00718f; font-weight: 500; font-size: 0.875rem; }
html.dark .link { color: #78d6ff; }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.num { font-variant-numeric: tabular-nums; }
.pre { white-space: pre-wrap; }
.ltr { direction: ltr; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.rel { position: relative; }
