/* ============================================================
   بصماتي — Export Card (.ecard)  ·  DARK-LUMINOUS "biometric" theme
   ------------------------------------------------------------
   The CENTERPIECE artifact. Captured by html2canvas + printed to PDF,
   so the captured node (.ecard and ALL descendants) is restricted to:
     ✓ solid + linear/radial-gradient fills
     ✓ borders, border-radius
     ✓ box-shadow (tested, used sparingly for depth)
   and MUST NOT use (html2canvas drops/garbles them):
     ✗ backdrop-filter   ✗ filter:   ✗ clip-path (CSS)   ✗ CSS mask
   All "glow" here is faked with layered gradients + soft borders +
   box-shadow — never with blur/filter.

   Print-safe: print-color-adjust:exact is kept so the deep-navy fills
   render as real dark fills (not a washed-out gray halo).

   IMMUTABLE shift colors — never swap:
     ص (morning) = #F4A23C  (orange · var(--day))
     م (night)   = #5773FF  (blue   · var(--night))

   Structure / class names / ids are kept EXACTLY as export-card.js emits.
   The only additions are optional, backward-compatible hooks
   (.efoot .stamp, .efoot .qr) used when export-card.js provides them.
   Fixed 900px width → crisp at 2× capture, no phone horizontal scroll.

   Fonts: Reem Kufi (headings/numerals) + IBM Plex Sans Arabic (text).
   Imported here so the card is self-contained at capture time and does
   NOT depend on theme.css being present.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&family=Reem+Kufi:wght@500;600;700&display=swap');

/* ── self-contained shift-color + surface vars (inlined; no theme.css needed) ──
   export-card.js sets --day / --night live via setProperty for tenant colors,
   but the spec pins the marked-cell + badge colors to the immutable values, so
   we define a private, non-overridable set used ONLY for the glowing marks. */
.ecard{
  /* immutable mark colors (private — JS --day/--night only theme accents) */
  --am:      #F4A23C;   --am-d:  #C9740E;   --am-soft: rgba(244,162,60,.16);
  --pm:      #5773FF;   --pm-d:  #2E45C9;   --pm-soft: rgba(87,115,255,.18);
  /* dark surfaces */
  --c-bg:    #070A12;
  --c-bg2:   #0B0F1C;
  --c-panel: #111726;
  --c-panel2:#0E1422;
  --c-line:  rgba(255,255,255,.085);
  --c-line2: rgba(255,255,255,.05);
  --c-fg:    #EEF1F8;
  --c-soft:  #AEB7CE;
  --c-mute:  #717C95;

  width:900px;box-sizing:border-box;
  font-family:'IBM Plex Sans Arabic','Cairo',system-ui,sans-serif;
  color:var(--c-fg);
  background:
    radial-gradient(900px 420px at 100% -8%, rgba(244,162,60,.18) 0%, transparent 58%),
    radial-gradient(900px 460px at -6% 8%, rgba(87,115,255,.20) 0%, transparent 60%),
    radial-gradient(700px 600px at 50% 118%, rgba(70,199,226,.08) 0%, transparent 62%),
    linear-gradient(180deg, var(--c-bg2) 0%, var(--c-bg) 100%);
  border:1px solid rgba(255,255,255,.07);
  border-radius:30px;overflow:hidden;
  -webkit-print-color-adjust:exact;print-color-adjust:exact;
  box-shadow:0 1px 0 rgba(255,255,255,.05) inset, 0 40px 90px -40px rgba(0,0,0,.9);
}
.ecard *{ -webkit-print-color-adjust:exact;print-color-adjust:exact; box-sizing:border-box }

/* ============================================================
   HEADER — luminous arc ص-orange → м-blue
   ============================================================ */
.ecard .ehead{
  position:relative;overflow:hidden;
  padding:34px 38px 30px;
  background:
    radial-gradient(560px 300px at 96% -40%, rgba(244,162,60,.55) 0%, rgba(244,162,60,0) 62%),
    radial-gradient(560px 320px at -6% 150%, rgba(87,115,255,.55) 0%, rgba(87,115,255,0) 64%),
    linear-gradient(108deg, #11192E 0%, #0C1325 52%, #0A1020 100%);
  border-bottom:1px solid rgba(255,255,255,.07);
}
/* top hairline arc — orange→blue gradient strip = the "arc" accent */
.ecard .ehead::before{content:"";position:absolute;top:0;inset-inline:0;height:4px;
  background:linear-gradient(90deg, var(--pm) 0%, #7FA0FF 22%, #C9CFE6 50%, #FFC58A 78%, var(--am) 100%);
  opacity:.95}
/* soft inner emboss highlight under the arc */
.ecard .ehead::after{content:"";position:absolute;top:4px;inset-inline:0;height:60px;
  background:linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,0));
  pointer-events:none}
.ecard .ehead>*{position:relative;z-index:1}

.ecard .ehead .brandrow{display:flex;align-items:center;gap:13px;margin-bottom:16px}
.ecard .ehead .blogo{flex:0 0 auto;width:48px;height:48px;display:block;border-radius:14px;
  background:linear-gradient(150deg, rgba(244,162,60,.22), rgba(87,115,255,.22));
  border:1px solid rgba(255,255,255,.22);padding:8px;box-sizing:border-box;
  box-shadow:0 6px 18px -8px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.04) inset}
/* SOLID fill (NOT background-clip:text) — gradient text is unreliable under
   html2canvas (renders transparent), so we keep the wordmark a warm-white. */
.ecard .ehead .bname{font-family:'Reem Kufi',sans-serif;font-size:32px;font-weight:700;
  line-height:1;letter-spacing:-.5px;color:#FFF4E8;
  text-shadow:0 1px 0 rgba(0,0,0,.25)}
.ecard .ehead .bsub{font-size:12.5px;font-weight:600;color:var(--c-soft);margin-top:4px;letter-spacing:.2px}
.ecard .ehead .mpill{margin-inline-start:auto;display:inline-flex;align-items:center;gap:7px;
  background:linear-gradient(160deg, rgba(255,255,255,.10), rgba(255,255,255,.03));
  border:1px solid rgba(255,255,255,.18);color:var(--c-fg);
  border-radius:999px;padding:9px 16px;font-size:13px;font-weight:700;white-space:nowrap;
  box-shadow:0 6px 16px -10px rgba(0,0,0,.7)}

.ecard .ehead .u{font-size:14px;font-weight:700;color:var(--c-soft);letter-spacing:.2px}
.ecard .ehead .who{font-family:'Reem Kufi',sans-serif;font-size:30px;font-weight:600;
  margin-top:9px;line-height:1.18;color:#FFFFFF}

.ecard .ehead .chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:15px}
.ecard .ehead .chips .ch{display:inline-flex;align-items:center;gap:5px;
  background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.13);
  border-radius:999px;padding:6px 13px;font-size:12.5px;font-weight:600;color:var(--c-soft)}
.ecard .ehead .chips .ch b{font-weight:800;color:var(--c-fg)}

/* ============================================================
   STATS STRIP — glowing tiles
   ============================================================ */
.ecard .estats{display:grid;grid-template-columns:repeat(3,1fr);gap:13px;
  padding:20px 38px;
  background:linear-gradient(180deg, rgba(255,255,255,.018), rgba(255,255,255,0));
  border-bottom:1px solid var(--c-line2)}
.ecard .estat{position:relative;display:flex;align-items:center;gap:14px;
  background:linear-gradient(160deg, var(--c-panel) 0%, var(--c-panel2) 100%);
  border:1px solid var(--c-line);border-radius:18px;padding:15px 17px;
  box-shadow:0 1px 0 rgba(255,255,255,.04) inset, 0 16px 34px -22px rgba(0,0,0,.9)}
/* colored corner glow per tile (gradient, not filter) */
.ecard .estat::before{content:"";position:absolute;inset:0;border-radius:18px;pointer-events:none;
  background:radial-gradient(120px 90px at 92% -20%, var(--glowc,transparent) 0%, transparent 70%)}
.ecard .estat.s-total{--glowc:rgba(90,139,240,.22)}
.ecard .estat.s-night{--glowc:rgba(87,115,255,.26)}
.ecard .estat.s-shift{--glowc:rgba(244,162,60,.24)}
.ecard .estat .ico{flex:0 0 auto;width:46px;height:46px;border-radius:13px;
  display:flex;align-items:center;justify-content:center;font-size:21px;color:#fff;
  box-shadow:0 8px 20px -10px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.08) inset}
.ecard .estat.s-total .ico{background:linear-gradient(155deg,#5A8BF0,#2E45C9)}
.ecard .estat.s-night .ico{background:linear-gradient(155deg,var(--pm),var(--pm-d))}
.ecard .estat.s-shift .ico{background:linear-gradient(155deg,var(--am),var(--am-d))}
.ecard .estat>div{position:relative;z-index:1}
.ecard .estat .v{font-family:'Reem Kufi',sans-serif;font-size:30px;font-weight:700;line-height:1;color:#fff}
.ecard .estat .l{font-size:12px;font-weight:600;color:var(--c-mute);margin-top:5px}

/* ============================================================
   USER NOTE
   ============================================================ */
.ecard .enote{margin:18px 38px 0;display:flex;gap:12px;align-items:flex-start;
  background:linear-gradient(160deg, rgba(244,162,60,.12), rgba(244,162,60,.04));
  border:1px solid rgba(244,162,60,.34);border-inline-start:5px solid var(--am);
  border-radius:16px;padding:14px 17px}
.ecard .enote .ni{font-size:17px;line-height:1.3;flex:0 0 auto}
.ecard .enote .nt{font-size:13.5px;font-weight:600;color:#F4D5A6;line-height:1.6;
  word-break:break-word;white-space:pre-wrap}

/* ============================================================
   CALENDAR — month grid, glowing marked cells
   ============================================================ */
.ecard .ecalwrap{padding:22px 32px 8px}
.ecard .ecaltitle{display:flex;align-items:center;gap:9px;
  font-family:'Reem Kufi',sans-serif;font-size:17px;font-weight:600;color:#fff;margin:0 4px 14px}
.ecard .ecaltitle .bar{width:5px;height:20px;border-radius:3px;
  background:linear-gradient(160deg,var(--am),var(--pm));
  box-shadow:0 0 0 1px rgba(255,255,255,.06)}
.ecard .ecal{display:grid;grid-template-columns:repeat(7,1fr);gap:8px}
.ecard .ecal .wdh{text-align:center;font-size:11.5px;font-weight:700;color:var(--c-mute);
  padding:4px 0 6px;letter-spacing:.2px}
.ecard .ecal .wdh.we{color:#FF9DB4}

.ecard .ecal .ec{position:relative;border-radius:14px;
  border:1px solid var(--c-line);
  background:linear-gradient(160deg, rgba(255,255,255,.028), rgba(255,255,255,0));
  min-height:66px;padding:8px 4px 7px;
  display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:3px;
  overflow:hidden;box-sizing:border-box;
  box-shadow:0 1px 0 rgba(255,255,255,.03) inset}
.ecard .ecal .ec.blank{border:1px dashed rgba(255,255,255,.06);
  background:rgba(255,255,255,.012);min-height:66px;box-shadow:none}
.ecard .ecal .ec .n{font-family:'Reem Kufi',sans-serif;font-weight:600;font-size:17px;line-height:1;color:var(--c-fg)}
.ecard .ecal .ec .nm{font-size:9px;color:var(--c-mute);font-weight:600}
.ecard .ecal .ec .k{font-size:11px;font-weight:800;margin-top:1px;color:var(--c-soft)}
.ecard .ecal .ec.has-sh{padding-bottom:22px}

/* ص — warm orange GLOW cell (layered gradient + soft inner highlight + glow shadow) */
.ecard .ecal .ec.k-ص{
  border-color:rgba(244,162,60,.55);
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(255,225,180,.45) 0%, transparent 70%),
    linear-gradient(160deg, #F8AE4E 0%, #E5872A 60%, #C9740E 100%);
  color:#3A2406;
  box-shadow:0 0 0 1px rgba(255,200,140,.30) inset, 0 8px 22px -10px rgba(201,116,14,.85)}
.ecard .ecal .ec.k-ص .n{color:#3A2406}
.ecard .ecal .ec.k-ص .k{color:#5A3608}
.ecard .ecal .ec.k-ص .nm{color:rgba(58,36,6,.72)}

/* م — cool blue GLOW cell */
.ecard .ecal .ec.k-م{
  border-color:rgba(87,115,255,.6);
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(190,205,255,.42) 0%, transparent 70%),
    linear-gradient(160deg, #6E86FF 0%, #4257E6 60%, #2E45C9 100%);
  color:#fff;
  box-shadow:0 0 0 1px rgba(180,200,255,.32) inset, 0 8px 22px -10px rgba(46,69,201,.9)}
.ecard .ecal .ec.k-م .n{color:#fff}
.ecard .ecal .ec.k-م .k{color:#EAEFFF}
.ecard .ecal .ec.k-م .nm{color:rgba(255,255,255,.82)}

/* «شفت» day badge */
.ecard .ecal .ec .eshift{position:absolute;top:0;inset-inline-start:0;
  background:linear-gradient(160deg,#FF4D6D,#D11440);color:#fff;
  font-size:8.5px;font-weight:800;padding:2px 8px;border-radius:0 0 10px 0;
  box-shadow:0 2px 6px -1px rgba(0,0,0,.55)}
/* shift name band on a calendar cell */
.ecard .ecal .ec .esname{position:absolute;bottom:0;inset-inline:0;
  font-size:9px;font-weight:700;line-height:1.3;padding:3px 5px;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ecard .ecal .ec .esname.sn-morn{background:rgba(244,162,60,.22);color:#FBD9A4}
.ecard .ecal .ec .esname.sn-night{background:rgba(46,69,201,.85);color:#EAEFFF}

/* ============================================================
   REGISTERED SHIFTS — elevated glass cards (4 per row)
   ============================================================ */
.ecard .eshifts{padding:20px 32px 6px}
.ecard .eshifts .esh{display:flex;align-items:center;gap:9px;
  font-family:'Reem Kufi',sans-serif;font-size:17px;font-weight:600;color:#fff;margin:6px 4px 14px}
.ecard .eshifts .esh .bar{width:5px;height:20px;border-radius:3px;
  background:linear-gradient(160deg,var(--am),var(--am-d))}
.ecard .eshifts .escards{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}
.ecard .eshifts .escard{position:relative;overflow:hidden;
  background:linear-gradient(160deg, var(--c-panel) 0%, var(--c-panel2) 100%);
  border:1px solid var(--c-line);border-radius:16px;padding:13px 14px 14px;
  box-shadow:0 1px 0 rgba(255,255,255,.04) inset, 0 16px 32px -22px rgba(0,0,0,.85)}
.ecard .eshifts .escard::before{content:"";position:absolute;top:0;inset-inline:0;height:4px}
.ecard .eshifts .escard.sc-ص::before{background:linear-gradient(90deg,var(--am),var(--am-d))}
.ecard .eshifts .escard.sc-م::before{background:linear-gradient(90deg,var(--pm),var(--pm-d))}
/* soft tinted corner glow per shift type */
.ecard .eshifts .escard.sc-ص{box-shadow:0 1px 0 rgba(255,255,255,.04) inset, 0 16px 32px -22px rgba(0,0,0,.85), 0 0 36px -20px rgba(244,162,60,.7)}
.ecard .eshifts .escard.sc-م{box-shadow:0 1px 0 rgba(255,255,255,.04) inset, 0 16px 32px -22px rgba(0,0,0,.85), 0 0 36px -20px rgba(87,115,255,.7)}
.ecard .eshifts .sc-top{display:flex;align-items:flex-start;justify-content:space-between;
  gap:6px;margin-top:5px;margin-bottom:11px}
.ecard .eshifts .sc-day{font-family:'Reem Kufi',sans-serif;font-weight:600;font-size:23px;color:#fff;line-height:1}
.ecard .eshifts .sc-wd{font-size:10px;color:var(--c-mute);font-weight:600;margin-top:4px}
.ecard .eshifts .sc-type{font-size:10.5px;font-weight:800;padding:4px 10px;
  border-radius:999px;white-space:nowrap;color:#fff;
  box-shadow:0 0 0 1px rgba(255,255,255,.1) inset}
.ecard .eshifts .sc-type.sc-ص{background:linear-gradient(155deg,var(--am),var(--am-d));color:#3A2406}
.ecard .eshifts .sc-type.sc-م{background:linear-gradient(155deg,var(--pm),var(--pm-d));color:#fff}
.ecard .eshifts .sc-time{display:inline-flex;align-items:center;gap:5px;
  font-size:12px;font-weight:700;color:#D7DEF0;direction:ltr;
  background:rgba(255,255,255,.05);border:1px solid var(--c-line2);
  border-radius:9px;padding:5px 10px}
.ecard .eshifts .sc-name{font-size:11.5px;font-weight:600;color:var(--c-soft);
  margin-top:8px;line-height:1.4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}

/* ============================================================
   LEGEND
   ============================================================ */
.ecard .elg{display:flex;flex-wrap:wrap;gap:18px;align-items:center;
  padding:18px 38px 8px;font-size:12.5px;font-weight:700;color:var(--c-soft)}
.ecard .elg span{display:inline-flex;align-items:center;gap:8px}
.ecard .elg i{display:inline-block;width:16px;height:16px;border-radius:6px;
  box-shadow:0 0 0 1px rgba(255,255,255,.14) inset, 0 4px 10px -4px rgba(0,0,0,.7)}

/* ============================================================
   FOOTER — brand + credit + timestamp + light QR/scan mark
   ============================================================ */
.ecard .efoot{display:flex;align-items:center;gap:14px;flex-wrap:wrap;
  padding:20px 38px 26px;margin-top:8px;
  background:
    radial-gradient(420px 160px at 0% 120%, rgba(244,162,60,.10), transparent 60%),
    radial-gradient(420px 160px at 100% 120%, rgba(87,115,255,.12), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,.02));
  border-top:1px solid var(--c-line)}
.ecard .efoot .ok{display:inline-flex;align-items:center;gap:7px;
  background:linear-gradient(160deg, rgba(54,211,153,.16), rgba(54,211,153,.06));
  border:1px solid rgba(54,211,153,.4);color:#5FE7B5;font-weight:800;font-size:14px;
  padding:9px 16px;border-radius:999px}
.ecard .efoot .credit{font-size:12.5px;font-weight:700;color:var(--c-soft)}
/* timestamp (optional, additive hook) */
.ecard .efoot .stamp{font-size:11.5px;font-weight:600;color:var(--c-mute);direction:ltr}
/* push the QR to the far end */
.ecard .efoot .fspacer{flex:1 1 auto}
/* light "scan"/QR badge — light on dark so it reads/scans; self-contained SVG */
.ecard .efoot .qr{flex:0 0 auto;width:62px;height:62px;border-radius:13px;
  background:#F4F6FC;border:1px solid rgba(255,255,255,.25);padding:7px;box-sizing:border-box;
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 10px 24px -12px rgba(0,0,0,.8)}
.ecard .efoot .qr svg{width:100%;height:100%;display:block}
