/* Qayyim Identity 2.1 — «نور» light layer.
   One removable file on top of qayyim.css: delete its <link> in base.html and the product returns to 2.0 exactly.
   The palette does not change. What changes is light and depth: the dark surfaces are lit from within (an aurora of the
   identity's own teal and mauve over the khatam pattern), white surfaces float on shadows tinted with the ink, and
   motion is spent in a few places where it carries meaning:
     · the landing hero: the payout sheet draws its rows and its deed links in order, once — «كل رقم بسنده»
     · moving between pages: a cross-fade that keeps the sidebar still (View Transitions, no script)
     · figures that measure something (progress bars, the health ring) fill to their value
     · anything you can press answers the pointer: lift, press, a focus ring that glows
   prefers-reduced-motion turns every movement off; browsers without a feature keep the 2.0 look. */

:root{
  --aurora:radial-gradient(65% 85% at 100% 0%,rgba(32,182,165,.34) 0%,rgba(32,182,165,0) 62%),
           radial-gradient(75% 95% at 0% 100%,rgba(122,110,134,.55) 0%,rgba(122,110,134,0) 64%),
           radial-gradient(45% 55% at 25% 0%,rgba(149,137,159,.22) 0%,rgba(149,137,159,0) 70%);
  --lift:0 1px 2px rgba(60,52,72,.06),0 14px 34px -20px rgba(60,52,72,.38);
  --lift-hi:0 2px 4px rgba(60,52,72,.06),0 22px 48px -22px rgba(60,52,72,.50);
  --glow-teal:0 0 0 4px rgba(32,182,165,.20);
  --hair-light:inset 0 1px 0 rgba(255,255,255,.10);
}

/* ---------- selection, scrollbars ---------- */
::selection{background:rgba(32,182,165,.26);color:inherit}
html{scrollbar-color:var(--platinum) transparent}

/* ---------- dark surfaces: lit from within ---------- */
.side,.dash-head,.ctaband,.authpanel,.mhero,.footer,.sanad{
  background-color:var(--ink);background-image:var(--aurora);background-repeat:no-repeat}
.side{box-shadow:inset -1px 0 0 rgba(255,255,255,.05)}
[dir=rtl] .side{box-shadow:inset 1px 0 0 rgba(255,255,255,.05)}
.dash-head,.ctaband,.mhero{box-shadow:var(--hair-light),var(--lift)}
.side .switch{background:rgba(255,255,255,.07);box-shadow:var(--hair-light);backdrop-filter:blur(6px)}
.nav{transition:background-color .18s var(--ease),color .18s var(--ease)}
.nav.on{background:linear-gradient(90deg,rgba(32,182,165,.16),rgba(255,255,255,.06));box-shadow:var(--hair-light)}
[dir=rtl] .nav.on{background:linear-gradient(270deg,rgba(32,182,165,.16),rgba(255,255,255,.06))}
.nav.on::before{box-shadow:0 0 12px 1px rgba(32,182,165,.65)}

/* the aurora breathes slowly where the brand speaks first: the landing hero and the sign-in panel */
@keyframes fx-drift{0%,100%{background-position:0 0,0 0,0 0}50%{background-position:-40px 30px,30px -20px,20px 10px}}
.sanad,.authpanel{background-size:140% 140%,140% 140%,140% 140%;animation:fx-drift 22s ease-in-out infinite}

/* ---------- white surfaces: tinted depth ---------- */
.card{box-shadow:0 1px 2px rgba(60,52,72,.04)}
a.card:hover,.who-row:hover,.svc-card:hover{transform:translateY(-2px);box-shadow:var(--lift-hi);border-color:var(--platinum)}
a.card:active,.who-row:active{transform:translateY(0)}

/* glass bars: the app's top bar and the site's nav let the page pass under them */
@supports (backdrop-filter:blur(1px)){
  header.top{background:rgba(255,255,255,.80);backdrop-filter:saturate(1.4) blur(12px)}
  .webnav{background:rgba(255,255,255,.76);backdrop-filter:saturate(1.4) blur(14px)}
}
/* and gain a hairline shadow once the page scrolls under them (scroll-driven, no script) */
@supports (animation-timeline:scroll()){
  @keyframes fx-bar-shadow{from{box-shadow:none}to{box-shadow:0 10px 30px -22px rgba(60,52,72,.55)}}
  header.top,.webnav{animation:fx-bar-shadow linear both;animation-timeline:scroll(root);animation-range:0 120px}
}

/* ---------- buttons: they answer the pointer ---------- */
.btn{position:relative;overflow:hidden;isolation:isolate;transition:background-color .18s var(--ease),border-color .18s var(--ease),box-shadow .18s var(--ease),transform .12s var(--ease)}
.btn:not(.secondary):not(.ghost){box-shadow:var(--hair-light),0 6px 16px -10px rgba(60,52,72,.7)}
.btn:active{transform:translateY(1px) scale(.985)}
.btn.teal{background-image:linear-gradient(180deg,rgba(255,255,255,.16),rgba(255,255,255,0));box-shadow:var(--hair-light),0 8px 20px -10px rgba(32,182,165,.75)}
.btn.teal::after,.btn:not(.secondary):not(.ghost):not(.sm)::after{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;
  background:linear-gradient(105deg,transparent 35%,rgba(255,255,255,.26) 50%,transparent 65%);transform:translateX(-120%);transition:transform .7s var(--ease)}
.btn.teal:hover::after,.btn:not(.secondary):not(.ghost):not(.sm):hover::after{transform:translateX(120%)}
[dir=rtl] .btn::after{transform:translateX(120%)}
[dir=rtl] .btn.teal:hover::after,[dir=rtl] .btn:not(.secondary):not(.ghost):not(.sm):hover::after{transform:translateX(-120%)}
.btn.secondary:hover{box-shadow:var(--lift)}

/* ---------- fields and focus ---------- */
input:not([type=checkbox]):not([type=radio]):not([type=file]),select,textarea{transition:border-color .15s var(--ease),box-shadow .15s var(--ease)}
input:not([type=checkbox]):not([type=radio]):focus,select:focus,textarea:focus{border-color:var(--teal-d);box-shadow:var(--glow-teal)}
.btn:focus-visible,a:focus-visible{box-shadow:var(--glow-teal)}

/* ---------- badges ---------- */
.badge{box-shadow:inset 0 0 0 1px rgba(60,52,72,.05)}
@keyframes fx-pulse{0%{box-shadow:0 0 0 0 rgba(242,118,112,.45)}70%{box-shadow:0 0 0 7px rgba(242,118,112,0)}100%{box-shadow:0 0 0 0 rgba(242,118,112,0)}}
.nbell .cnt{animation:fx-pulse 2.6s var(--ease) 3}

/* ---------- figures that measure something fill to their value ---------- */
@keyframes fx-fill{from{transform:scaleX(0)}}
.bar>i{transform-origin:left center;animation:fx-fill 1s var(--ease) .15s both}
[dir=rtl] .bar>i{transform-origin:right center}
@keyframes fx-ring{from{stroke-dashoffset:var(--c)}}
.ring circle.arc{animation:fx-ring 1.2s var(--ease) .2s both}
.ring .lbl b{animation:fx-in .6s var(--ease) .5s both}
@keyframes fx-in{from{opacity:0;transform:translateY(4px)}}

/* ---------- the landing hero: the payout sheet draws itself, once ---------- */
@keyframes fx-row{from{opacity:0;transform:translateY(6px)}}
@keyframes fx-link{from{transform:scaleX(0)}}
.sanad{box-shadow:0 50px 90px -40px rgba(60,52,72,.70),0 30px 120px -50px rgba(32,182,165,.55),0 0 0 1px rgba(255,255,255,.05) inset}
.sanad-sheet{box-shadow:0 18px 40px -24px rgba(0,0,0,.45)}
.sanad-rows>li{animation:fx-row .55s var(--ease) both}
.sanad-rows>li:nth-child(1){animation-delay:.15s}.sanad-rows>li:nth-child(2){animation-delay:.35s}.sanad-rows>li:nth-child(3){animation-delay:.55s}
.sanad-rows>li:nth-child(4){animation-delay:.75s}.sanad-rows>li:nth-child(5){animation-delay:.95s}.sanad-rows>li:nth-child(6){animation-delay:1.15s}
.sanad-rows>li:nth-child(n+7){animation-delay:1.3s}
.sanad-rows li[class*=src-] .why::before{transform-origin:right center;animation:fx-link .5s var(--ease) both}
[dir=ltr] .sanad-rows li[class*=src-] .why::before{transform-origin:left center}
.sanad-rows>li:nth-child(2) .why::before{animation-delay:.6s}.sanad-rows>li:nth-child(4) .why::before{animation-delay:1s}
.sanad-rows>li:nth-child(5) .why::before{animation-delay:1.2s}.sanad-rows>li:nth-child(6) .why::before{animation-delay:1.4s}

/* the hero stage: the sheet sits in a pool of the identity's light on a faint khatam field */
.hero-sanad{position:relative;isolation:isolate}
.hero-sanad::before{content:"";position:absolute;z-index:-1;pointer-events:none;inset:-40px 0 -20px;
  background:radial-gradient(38% 55% at 22% 48%,rgba(32,182,165,.22) 0%,rgba(32,182,165,0) 70%),
             radial-gradient(30% 45% at 38% 62%,rgba(149,137,159,.22) 0%,rgba(149,137,159,0) 70%)}
[dir=ltr] .hero-sanad::before{transform:scaleX(-1)}
.hero-sanad::after{content:"";position:absolute;z-index:-1;pointer-events:none;inset:-40px 0 -20px;
  background:var(--khatam);background-size:56px 56px;filter:invert(1);opacity:.05;
  -webkit-mask-image:radial-gradient(40% 60% at 25% 50%,#000 0%,transparent 80%);mask-image:radial-gradient(40% 60% at 25% 50%,#000 0%,transparent 80%)}
[dir=ltr] .hero-sanad::after{-webkit-mask-image:radial-gradient(40% 60% at 75% 50%,#000 0%,transparent 80%);mask-image:radial-gradient(40% 60% at 75% 50%,#000 0%,transparent 80%)}
@media (max-width:900px){.hero-sanad::after{display:none}.hero-sanad::before{inset:auto 0 -20px;height:70%;background:radial-gradient(60% 50% at 50% 60%,rgba(32,182,165,.16) 0%,rgba(32,182,165,0) 70%)}}

/* the public site's section backgrounds: a faint khatam field fading out, so white is never flat */
.section.alt,.pains,.proofs{position:relative;isolation:isolate}
.section.alt::before,.pains::before,.proofs::before{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;
  background:var(--khatam);background-size:56px 56px;filter:invert(1);opacity:.035;
  -webkit-mask-image:radial-gradient(70% 60% at 50% 0%,#000 0%,transparent 75%);mask-image:radial-gradient(70% 60% at 50% 0%,#000 0%,transparent 75%)}

/* ---------- moving between pages ---------- */
@view-transition{navigation:auto}
.side{view-transition-name:fx-side}
header.top{view-transition-name:fx-top}
::view-transition-old(root),::view-transition-new(root){animation-duration:.22s;animation-timing-function:var(--ease)}
::view-transition-old(fx-side),::view-transition-new(fx-side),::view-transition-old(fx-top),::view-transition-new(fx-top){animation:none}

/* ---------- busy buttons shimmer while the server works ---------- */
@keyframes fx-shimmer{to{background-position:-200% 0}}
.btn.busy{background-image:linear-gradient(90deg,rgba(255,255,255,0) 0%,rgba(255,255,255,.22) 50%,rgba(255,255,255,0) 100%);background-size:200% 100%;animation:fx-shimmer 1.2s linear infinite}

/* ======================================================================================================
   Stronger light (2.1b): the first pass was too quiet to notice. The same ideas, at a level you can see.
   ====================================================================================================== */

/* the whole product sits on a soft mesh of the identity's light instead of flat grey */
body{background-color:var(--paper);
  background-image:radial-gradient(55% 45% at 100% 0%,rgba(32,182,165,.13) 0%,rgba(32,182,165,0) 70%),
                   radial-gradient(50% 50% at 0% 100%,rgba(149,137,159,.20) 0%,rgba(149,137,159,0) 70%),
                   radial-gradient(35% 30% at 55% 35%,rgba(242,180,95,.06) 0%,rgba(242,180,95,0) 70%);
  background-attachment:fixed}

/* white surfaces become frosted glass over that light */
@supports (backdrop-filter:blur(1px)){
  .card,.kpi{background:rgba(255,255,255,.78);backdrop-filter:saturate(1.5) blur(14px);border-color:rgba(255,255,255,.9);box-shadow:var(--lift)}
  .card .card{background:rgba(255,255,255,.6)}
}
/* a gradient edge lights up on cards you can press */
a.card,.who-row{position:relative}
a.card::before,.who-row::before{content:"";position:absolute;inset:-1px;border-radius:inherit;padding:1px;pointer-events:none;opacity:0;transition:opacity .25s var(--ease);
  background:linear-gradient(135deg,var(--teal),rgba(149,137,159,.6) 50%,var(--apricot));
  -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;mask-composite:exclude}
a.card:hover::before,.who-row:hover::before{opacity:1}

/* the welcome band: a slow living gradient between ink and a teal-tinted ink */
@keyframes fx-flow{0%,100%{background-position:0% 50%,0 0}50%{background-position:100% 50%,0 0}}
.dash-head{background-image:linear-gradient(115deg,#3C3448 0%,#4A3F5C 35%,#2F4F57 65%,#3C3448 100%),var(--aurora);background-size:220% 220%,100% 100%;
  animation:fx-flow 16s ease-in-out infinite}
.dash-head h2{text-shadow:0 2px 18px rgba(32,182,165,.35)}

/* sidebar: the light gathers on the active item */
.side{background-image:radial-gradient(90% 40% at 100% 0%,rgba(32,182,165,.28) 0%,rgba(32,182,165,0) 70%),
                       radial-gradient(100% 45% at 0% 100%,rgba(122,110,134,.55) 0%,rgba(122,110,134,0) 70%)}
.nav.on{background:linear-gradient(90deg,rgba(32,182,165,.28),rgba(32,182,165,.06));box-shadow:inset 0 0 0 1px rgba(32,182,165,.35),0 8px 24px -12px rgba(32,182,165,.6)}
[dir=rtl] .nav.on{background:linear-gradient(270deg,rgba(32,182,165,.28),rgba(32,182,165,.06))}
.nav:not(.on):hover{background:rgba(255,255,255,.07)}

/* primary actions carry the teal as light, not only as paint */
.btn.teal{background-image:linear-gradient(135deg,#2BC9B7 0%,#20B6A5 45%,#1A9C8E 100%);box-shadow:inset 0 1px 0 rgba(255,255,255,.35),0 10px 26px -10px rgba(32,182,165,.85)}
.btn.teal:hover{box-shadow:inset 0 1px 0 rgba(255,255,255,.35),0 14px 32px -10px rgba(32,182,165,.95)}
.btn:not(.secondary):not(.ghost):not(.teal):not(.danger){background-image:linear-gradient(135deg,#4A4157 0%,#3C3448 60%,#2E2838 100%)}

/* the landing stage: a breathing aurora behind the sheet, a light that runs around its edge, two glass notes floating */
main#main{overflow-x:clip}
.sanad-stage{position:relative;min-width:0;isolation:isolate}
.sanad-stage::before{content:"";position:absolute;z-index:-1;inset:-12% -8%;border-radius:50%;filter:blur(40px);pointer-events:none;
  background:conic-gradient(from 0deg,rgba(32,182,165,.55),rgba(149,137,159,.55),rgba(242,180,95,.35),rgba(32,182,165,.55));
  animation:fx-spin 18s linear infinite;opacity:.55}
@keyframes fx-spin{to{transform:rotate(360deg)}}
@property --fx-a{syntax:"<angle>";inherits:false;initial-value:0deg}
.sanad{position:relative}
.sanad::after{content:"";position:absolute;inset:0;border-radius:inherit;padding:1.5px;pointer-events:none;
  background:conic-gradient(from var(--fx-a),transparent 0 70%,rgba(32,182,165,.95) 80%,rgba(255,255,255,.9) 85%,transparent 92%);
  -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;mask-composite:exclude;
  animation:fx-edge 6s linear infinite}
@keyframes fx-edge{to{--fx-a:360deg}}
.fx-chip{position:absolute;z-index:2;display:inline-flex;align-items:center;gap:8px;padding:9px 14px;border-radius:999px;font-size:13.5px;font-weight:700;color:var(--ink);
  background:rgba(255,255,255,.82);backdrop-filter:blur(12px) saturate(1.5);box-shadow:0 14px 34px -14px rgba(60,52,72,.55),inset 0 0 0 1px rgba(255,255,255,.9);white-space:nowrap}
.fx-chip i{width:20px;height:20px;border-radius:50%;flex:none;display:grid;place-items:center}
.fx-tick{background:var(--teal)}.fx-tick::after{content:"";width:9px;height:5px;border:2px solid #fff;border-top:0;border-right:0;transform:rotate(-45deg) translate(1px,-1px)}
.fx-seal{background:var(--ink)}.fx-seal::after{content:"";width:8px;height:8px;border-radius:2px;border:2px solid var(--apricot)}
.fx-chip.c1{top:-18px;inset-inline-start:-26px;animation:fx-float 6s ease-in-out infinite}
.fx-chip.c2{bottom:-26px;inset-inline-end:-24px;animation:fx-float 7s ease-in-out -2s infinite}
@keyframes fx-float{0%,100%{transform:translateY(0)}50%{transform:translateY(-10px)}}
@media (max-width:900px){.fx-chip.c1{inset-inline-start:8px;top:-16px}.fx-chip.c2{inset-inline-end:8px;bottom:-18px}.sanad-stage::before{inset:-6% -4%}}

/* the sign-in panel and the CTA band get the same living gradient as the welcome band */
.authpanel,.ctaband{background-image:linear-gradient(125deg,#3C3448 0%,#4A3F5C 40%,#2F4F57 70%,#3C3448 100%),var(--aurora);background-size:220% 220%,100% 100%;animation:fx-flow 18s ease-in-out infinite}

/* ======================================================================================================
   Colour balance (2.1c). Measured on the app's main pages: teal, the brand's lead accent, was under 1% of the
   accent pixels on some screens while coral (the alarm colour) took 60–70%, mostly from the sidebar's counters.
   Rule kept from here on: neutrals carry the page, ink carries structure, teal leads the accents, apricot marks
   "needs attention" and coral only "late or at risk".
   ====================================================================================================== */
.nav .cnt{background:rgba(255,255,255,.14);color:#fff;box-shadow:inset 0 0 0 1px rgba(255,255,255,.18)}
.nav.on .cnt{background:var(--teal);color:var(--ink);box-shadow:none}
.card-head .ic,.card-head h3>svg,.card-head h2>svg,.pagehead h1>svg{color:var(--teal-d)}
.cy-seg a.on{box-shadow:inset 0 -2px 0 var(--teal),var(--shadow)}
.flash{border-inline-start:3px solid var(--teal)}.flash.err{border-inline-start-color:var(--coral)}.flash.warn{border-inline-start-color:var(--apricot)}

/* ---------- motion that answers: flashes arrive, disclosures open smoothly, the bell rings once ---------- */
@keyframes fx-arrive{from{opacity:0;transform:translateY(-8px)}}
.flash{animation:fx-arrive .35s var(--ease) both}
:root{interpolate-size:allow-keywords}
details::details-content{block-size:0;overflow-y:clip;transition:block-size .28s var(--ease),content-visibility .28s allow-discrete}
details[open]::details-content{block-size:auto}
details>summary{transition:color .15s var(--ease)}
@keyframes fx-ring-bell{0%,100%{transform:rotate(0)}15%{transform:rotate(14deg)}30%{transform:rotate(-12deg)}45%{transform:rotate(8deg)}60%{transform:rotate(-5deg)}75%{transform:rotate(2deg)}}
.nbell:has(.cnt) svg{transform-origin:50% 10%;animation:fx-ring-bell 1s var(--ease) .8s 1}
.tabbar a{transition:color .18s var(--ease)}
.tabbar a.on svg{animation:fx-in .3s var(--ease) both}

/* ---------- print and reduced motion ---------- */
@media print{body,.side,.dash-head,.ctaband,.mhero,.sanad{background-image:none!important}.card,.kpi{backdrop-filter:none!important;background:#fff!important}.fx-chip,.sanad-stage::before{display:none}header.top,.webnav{backdrop-filter:none!important}}
@media (prefers-reduced-motion:reduce){
  .sanad,.authpanel,.ctaband,.dash-head,.sanad::after,.sanad-stage::before,.fx-chip,.sanad-rows>li,.sanad-rows .why::before,.bar>i,.ring circle.arc,.ring .lbl b,.nbell .cnt,.btn.busy,.flash,.nbell svg,.tabbar a.on svg{animation:none!important}
  details::details-content{transition:none}
  .btn::after{display:none}
  a.card:hover,.who-row:hover,.svc-card:hover{transform:none}
  @view-transition{navigation:none}
}
