/* =========================================================
   app.css — نظام تقارير (RTL) — نسخة محسّنة 2026 (Drop-in)
   ✅ تحافظ على أسماء الكلاسات الحالية
   ✅ تحسين بصري + UX + مكوّنات إضافية بدون كسر القوالب
  ✅ تحسينات طباعة + دعم safe-area + RTL + Dark
   ✅ إصلاحات توافق (color-mix / backdrop-filter / iOS)
========================================================= */

/* ========== 1) Design Tokens ========== */
:root{
  /* Typography */
  --font: "Cairo", system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans Arabic", sans-serif;

  /* Brand */
  --brand: #006c35;
  --brand-700: #00542a;
  --brand-ink: #073b2a;
  --brand-ghost: rgba(0,108,53,.10);

  --accent: #b9975b;
  --danger: #b4232f;
  --warning: #c78a1f;
  --info: #0072bc;

  /* Neutrals */
  --ink: #10251f;
  --ink-soft: #27433a;
  --muted: #64736e;
  --bg: #f4f7f3;
  --card: #ffffff;
  --line: rgba(16,37,31,.14);
  --line-2: rgba(0,108,53,.10);

  /* Radii */
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;

  /* Shadows */
  --shadow-sm: 0 4px 14px rgba(2,6,23,.06);
  --shadow:    0 10px 28px rgba(2,6,23,.10);
  --shadow-lg: 0 22px 60px rgba(2,6,23,.14);

  /* Focus ring */
  --ring: 0 0 0 3px rgba(185,151,91,.26);

  /* Tap target */
  --tap: 48px;

  /* Spacing */
  --s-1: 6px;
  --s-2: 10px;
  --s-3: 14px;
  --s-4: 18px;
  --s-5: 24px;
  --s-6: 32px;

  /* Motion */
  --t-fast: .12s;
  --t: .18s;
  --ease: cubic-bezier(.2,.8,.2,1);

  /* Z */
  --z-header: 20;
  --z-modal: 80;
  --z-toast: 90;

  /* Safe areas */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

/* Dark mode (يدوي عبر data-theme="dark") */
html[data-theme="dark"]{
  color-scheme: dark;
  --bg:#050816;
  --card: rgba(15,23,42,.86);
  --line: rgba(148,163,184,.16);
  --line-2: rgba(148,163,184,.10);
  --ink:#e5e7eb;
  --ink-soft:#e2e8f0;
  --muted: rgba(226,232,240,.70);
  --shadow-sm: 0 8px 26px rgba(0,0,0,.35);
  --shadow:    0 16px 48px rgba(0,0,0,.45);
  --shadow-lg: 0 24px 72px rgba(0,0,0,.55);
}

/* ========== 2) Reset / Base ========== */
*{box-sizing:border-box}
html,body{
  margin:0;
  padding:0;
  height:100%;
  width:100%;
  overflow-x:hidden;
}

/* RTL safety: إذا dir="rtl" موجود لن يضر */
html{direction: rtl}

body{
  font-family: var(--font);
  font-size: 0.94rem;
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;

  /* Background ناعم */
  background:
    radial-gradient(1200px 520px at 10% 0%, rgba(0,108,53,.10), transparent 60%),
    radial-gradient(900px 420px at 90% 10%, rgba(22,132,91,.10), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg));
}

img{max-width:100%;display:block}
a{color:inherit;text-underline-offset:3px}
a:hover{color:var(--brand)}
button,input,select,textarea{font:inherit}
::selection{background:rgba(0,108,53,.18)}

:focus-visible{outline:none; box-shadow: var(--ring); border-color: rgba(0,108,53,.35)}

/* Reduce motion */
@media (prefers-reduced-motion: reduce){
  *{animation:none!important;transition:none!important;scroll-behavior:auto!important}
}

/* Helpers */
.muted{color:var(--muted)}
.sr-only{
  position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;
  overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;
}
.divider{height:1px;background:var(--line-2);margin:var(--s-4) 0}

/* ========== 3) Layout Helpers ========== */
.container{
  width:100%;
  max-width:1240px;
  margin-inline:auto;
  padding:0 clamp(12px, 3vw, 24px);
}

body.page{
  min-height:100dvh;
  display:flex;
  flex-direction:column;
}

.page-main{
  flex:1 0 auto;
  padding-block:clamp(12px, 2.5vw, 24px);
  animation:fadeUp .45s var(--ease) both;
}

@keyframes fadeUp{
  from{opacity:0;transform:translateY(10px)}
  to{opacity:1;transform:none}
}

.row-between{display:flex;align-items:center;justify-content:space-between;gap:10px}
.stack{display:grid;gap:var(--s-3)}
.grid{display:grid;gap:var(--s-3)}
.grid-2{grid-template-columns:repeat(2,1fr)}
@media(min-width: 900px){
  .grid-3{grid-template-columns:repeat(3,1fr)}
  .grid-4{grid-template-columns:repeat(4,1fr)}
}

/* Visibility helpers */
.desktop-only{display:block}
.mobile-only{display:none}

/* ========== 4) Header / Nav ========== */
.site-header{
  background:rgba(255,255,255,.86);
  border-bottom:1px solid var(--line-2);
  position:sticky;
  top:0;
  z-index:var(--z-header);
  backdrop-filter:blur(10px) saturate(180%);
}
@supports not (backdrop-filter: blur(10px)){
  .site-header{background:#fff}
}
html[data-theme="dark"] .site-header{background:rgba(10,16,32,.70)}

.brand{
  font-weight:950;
  color:var(--ink);
  display:flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
  letter-spacing:.2px;
}
.brand img{
  width:40px;height:40px;
  object-fit:contain;
  border-radius:12px;
  border:1px solid var(--line-2);
  background:rgba(255,255,255,.60);
}

.nav .link{
  margin-inline:6px;
  color:var(--brand);
  text-decoration:none;
  font-weight:900;
  padding:8px 10px;
  border-radius:12px;
  transition:transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.nav .link:hover{background:var(--brand-ghost);transform:translateY(-1px)}
.nav .link[aria-current="page"]{background:var(--brand-ghost);color:var(--brand-700)}

/* ========== 5) Cards / Sections ========== */
.card{
  background:var(--card);
  border:1px solid var(--line-2);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-sm);
  padding:16px;
}

.card.soft{background:rgba(255,255,255,.86)} /* fallback */
html[data-theme="dark"] .card.soft{background:rgba(15,23,42,.72)}
@supports (background: color-mix(in srgb, white 50%, transparent)){
  .card.soft{background:color-mix(in srgb, var(--card) 86%, transparent)}
}

.section-title{
  margin:4px 0 12px;
  font-size:1.08rem;
  font-weight:950;
  color:var(--ink);
}
.section-sub{
  margin:-8px 0 10px;
  color:var(--muted);
  font-weight:800;
  font-size:.92rem;
}

/* ========== 6) Buttons ========== */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:var(--tap);
  padding:10px 14px;
  border-radius:12px;
  border:1px solid transparent;
  cursor:pointer;
  font-weight:950;
  text-decoration:none;
  transition:
    transform var(--t-fast) var(--ease),
    box-shadow var(--t) var(--ease),
    background var(--t) var(--ease),
    border-color var(--t) var(--ease),
    opacity var(--t) var(--ease);
  user-select:none;
  -webkit-tap-highlight-color:transparent;
}
.btn:hover{transform:translateY(-1px);box-shadow:0 10px 26px rgba(2,6,23,.10)}
.btn:active{transform:translateY(0)}
.btn:disabled,
.btn[aria-disabled="true"]{
  opacity:.55;
  cursor:not-allowed;
  transform:none!important;
  box-shadow:none!important;
}

.btn-sm{min-height:40px;padding:8px 12px;border-radius:12px;font-weight:900}
.btn-lg{min-height:56px;padding:12px 16px;border-radius:14px}
.btn-block{width:100%}

.btn-primary{
  background:linear-gradient(135deg, var(--brand), #006c35);
  color:#fff;
  border-color:rgba(0,108,53,.35);
}
.btn-primary:hover{background:linear-gradient(135deg, var(--brand-700), #00542a)}
.btn-accent{
  background:linear-gradient(135deg, var(--accent), #35a96f);
  color:#fff;
  border-color:rgba(22,132,91,.30);
}
.btn-accent:hover{filter:brightness(.98)}
.btn-danger{
  background:linear-gradient(135deg, var(--danger), #ef4444);
  color:#fff;
  border-color:rgba(220,38,38,.30);
}
.btn-danger:hover{filter:brightness(.98)}
.btn-outline{
  background:transparent;
  color:var(--brand);
  border-color:rgba(0,108,53,.25);
}
.btn-outline:hover{background:var(--brand-ghost)}

/* Loading state: ضع data-loading="1" */
.btn[data-loading="1"]{pointer-events:none;opacity:.85}
.btn[data-loading="1"]::after{
  content:"";
  width:16px;height:16px;
  border-radius:999px;
  border:2px solid rgba(255,255,255,.55);
  border-top-color:rgba(255,255,255,1);
  animation:spin .8s linear infinite;
}
.btn.btn-outline[data-loading="1"]::after{
  border-color:rgba(0,108,53,.30);
  border-top-color:rgba(0,108,53,1);
}
@keyframes spin{to{transform:rotate(360deg)}}

/* ========== 6.5) Admin / Dashboard Helpers ========== */
.page-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:14px;
}
.page-head .page-title{
  margin:0;
  font-weight:950;
  color:var(--ink-soft);
  font-size:1.18rem;
}
.page-head .page-subtitle{
  margin:4px 0 0;
  color:var(--muted);
  font-weight:800;
}

.page-hero{
  border:1px solid var(--line-2);
  background:
    radial-gradient(900px 380px at 15% 10%, rgba(255,255,255,.16), transparent 55%),
    linear-gradient(135deg, var(--brand-700), var(--info));
  color:#fff;
  box-shadow:var(--shadow);
}
.page-hero .page-title,
.page-hero .page-subtitle{color:#fff}
.page-hero .hero-badge{
  background:rgba(255,255,255,.14);
  border:1px solid rgba(255,255,255,.22);
  border-radius:999px;
  padding:10px 12px;
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:950;
}
.page-hero .hero-ava{
  width:38px;height:38px;
  border-radius:999px;
  background:rgba(2,6,23,.18);
  border:1px solid rgba(255,255,255,.18);
  display:grid;
  place-items:center;
  font-weight:950;
}

.kpi-grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:12px;
}
@media(min-width: 900px){
  .kpi-grid{grid-template-columns:repeat(4,1fr)}
}
.kpi{
  background:var(--card);
  border:1px solid var(--line-2);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-sm);
  padding:14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.kpi .num{font-weight:950;font-size:1.45rem;line-height:1;color:var(--ink)}
.kpi .lbl{color:var(--muted);font-weight:900;margin-top:6px}
.kpi .kpi-ico{
  width:42px;height:42px;
  border-radius:14px;
  display:grid;
  place-items:center;
  border:1px solid rgba(15,23,42,.06);
}
.kpi .kpi-ico.info{background:rgba(0,108,53,.10);color:var(--brand)}
.kpi .kpi-ico.warn{background:rgba(245,158,11,.14);color:var(--warning)}
.kpi .kpi-ico.danger{background:rgba(220,38,38,.12);color:var(--danger)}
.kpi .kpi-ico.ok{background:rgba(22,132,91,.12);color:var(--accent)}

.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  font-size:.82rem;
  font-weight:950;
  border:1px solid var(--line-2);
  background:rgba(148,163,184,.14);
  color:var(--ink);
  white-space:nowrap;
}
.badge.success{background:rgba(22,132,91,.12);color:var(--accent);border-color:rgba(22,132,91,.22)}
.badge.warning{background:rgba(245,158,11,.14);color:var(--warning);border-color:rgba(245,158,11,.28)}
.badge.danger{background:rgba(220,38,38,.12);color:var(--danger);border-color:rgba(220,38,38,.24)}
.badge.info{background:rgba(0,108,53,.10);color:var(--brand);border-color:rgba(0,108,53,.20)}

/* ========== 7) Forms / Inputs ========== */
label{font-weight:900;color:var(--ink-soft)}
.helptext{color:var(--muted);font-weight:800;font-size:.88rem;margin-top:6px}
.required-star{color:var(--danger);margin-inline-start:4px}

.errorlist{
  margin:10px 0 0;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(220,38,38,.22);
  background:rgba(220,38,38,.08);
  color:rgba(220,38,38,.96);
  font-weight:900;
  list-style:none;
}
.errorlist li{margin:0}

.form-grid{display:grid;grid-template-columns:1fr;gap:12px}

.input,.textarea,.select,
input[type="date"],input[type="number"],input[type="text"],input[type="file"],input[type="password"],input[type="search"],textarea,select{
  width:100%;
  padding:11px 12px;
  border:1px solid rgba(15,23,42,.14);
  border-radius:12px;
  background:var(--card);
  color:var(--ink);
  box-shadow:0 1px 0 rgba(2,6,23,.02);
  transition:box-shadow var(--t) var(--ease), border-color var(--t) var(--ease), background var(--t) var(--ease);
}
textarea,.textarea{min-height:110px;resize:vertical}
input::placeholder,textarea::placeholder{color:rgba(100,116,139,.85)}
input:focus,textarea:focus,select:focus{outline:none;box-shadow:var(--ring);border-color:rgba(0,108,53,.35)}
input:disabled,textarea:disabled,select:disabled{opacity:.65;cursor:not-allowed}

/* File input nicer */
input[type="file"]{padding:10px}
input[type="file"]::file-selector-button{
  border:1px solid rgba(0,108,53,.25);
  background:var(--brand-ghost);
  color:var(--brand-700);
  border-radius:10px;
  padding:8px 12px;
  font-weight:900;
  cursor:pointer;
  margin-inline-end:10px;
}

/* Filters */
.filters{display:grid;grid-template-columns:1fr;gap:10px;margin:8px 0 12px}
.filters .actions{display:flex;gap:8px;flex-wrap:wrap}

/* ========== 8) Tables / Cards responsive list ========== */
.table-wrap{display:none;overflow:auto}
.table-wrap,.table-responsive{
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}
.table-wrap::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar{height:10px}
.table-wrap::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb{background:rgba(100,116,139,.35);border-radius:999px}

table{width:100%;border-collapse:collapse;background:transparent}
thead th{
  background:rgba(248,250,252,.9);
  color:var(--muted);
  font-weight:950;
}
html[data-theme="dark"] thead th{background:rgba(148,163,184,.08)}
th,td{
  padding:12px 10px;
  border-bottom:1px solid var(--line-2);
  text-align:center;
  vertical-align:middle;
}

/* Zebra */
tbody tr:nth-child(odd) td{background:rgba(2,6,23,.012)}
html[data-theme="dark"] tbody tr:nth-child(odd) td{background:rgba(255,255,255,.03)}
tbody tr:hover td{background:rgba(0,108,53,.04)}

/* Sticky header */
.table-sticky thead th{position:sticky;top:0;z-index:2}

/* Cards (mobile) */
.cards{display:grid;grid-template-columns:1fr;gap:12px}
.card-row{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.card-row span{color:var(--muted);font-size:.92rem;font-weight:900}
.card-row b{color:var(--ink)}

/* Responsive table helper */
.rtable{width:100%;border-collapse:collapse}
@media(max-width: 860px){
  .rtable thead{display:none}
  .rtable,.rtable tbody,.rtable tr,.rtable td{display:block;width:100%}
  .rtable tr{
    border:1px solid var(--line-2);
    border-radius:var(--radius-lg);
    margin:10px 0;
    background:var(--card);
    box-shadow:var(--shadow-sm);
    overflow:hidden;
  }
  .rtable td{border-bottom:1px dashed var(--line-2);text-align:right;padding:12px}
  .rtable td:last-child{border-bottom:0}
  .rtable td[data-label]::before{
    content:attr(data-label);
    display:inline-block;
    margin-inline-start:6px;
    color:var(--muted);
    font-weight:950;
  }
}

/* ========== 9) Images / Thumbs ========== */
.imgs{display:flex;gap:8px;flex-wrap:wrap}
.imgs img{
  width:100%;
  max-width:110px;
  height:auto;
  border-radius:12px;
  border:1px solid var(--line-2);
  box-shadow:0 8px 18px rgba(2,6,23,.06);
  cursor:zoom-in;
  transition:transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.imgs img:hover{transform:translateY(-1px);box-shadow:0 14px 28px rgba(2,6,23,.12)}

/* Attachment grid */
.attach-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:10px;
}
@media(min-width: 768px){
  .attach-grid{grid-template-columns:repeat(4, minmax(0,1fr))}
}
.attach-item{
  border:1px solid var(--line-2);
  border-radius:14px;
  overflow:hidden;
  background:var(--card);
  box-shadow:var(--shadow-sm);
}
.attach-item img{width:100%;height:110px;object-fit:cover}
.attach-meta{padding:10px}
.attach-name{font-weight:950;font-size:.92rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.attach-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}

/* ========== 9.5) Modal ========== */
.modal{
  position:fixed;
  inset:0;
  background:rgba(2,6,23,.62);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:var(--z-modal);
  padding:clamp(12px, 3vw, 24px);
}
.modal.is-open{display:flex}
.modal-card{
  width:min(980px, 100%);
  background:var(--card);
  border:1px solid var(--line-2);
  border-radius:var(--radius-xl);
  box-shadow:var(--shadow-lg);
  overflow:hidden;
}
.modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:12px 14px;
  border-bottom:1px solid var(--line-2);
}
.modal-title{font-weight:950}
.modal-body{padding:12px}
.modal-body img{width:100%;height:auto;border-radius:14px;border:1px solid var(--line-2)}
.modal-close{
  min-height:40px;
  padding:8px 12px;
  border-radius:12px;
  border:1px solid rgba(15,23,42,.14);
  background:transparent;
  cursor:pointer;
  font-weight:950;
}

/* ========== 10) Pagination ========== */
.pgn{display:flex;gap:8px;justify-content:center;margin-top:14px;flex-wrap:wrap}
.pgn a,.pgn span{
  padding:9px 12px;
  border:1px solid rgba(15,23,42,.14);
  border-radius:12px;
  text-decoration:none;
  color:var(--ink);
  background:var(--card);
  font-weight:950;
  transition:background var(--t) var(--ease), transform var(--t-fast) var(--ease);
}
.pgn a:hover{background:rgba(0,108,53,.06);transform:translateY(-1px)}
.pgn .active{background:var(--brand);color:#fff;border-color:var(--brand)}

/* ========== 11) Messages (legacy) ========== */
.messages{margin-block:12px}
.msg{
  padding:10px 12px;
  border-radius:12px;
  background:rgba(239,246,255,.92);
  border:1px solid #bfdbfe;
  box-shadow:var(--shadow-sm);
  font-weight:900;
}
.msg.success{background:rgba(240,255,246,.92);border-color:#c8f3d6;color:#064e3b}
.msg.error{background:rgba(255,240,240,.92);border-color:#ffd4d4;color:#7f1d1d}
.msg.warning{background:rgba(255,251,235,.92);border-color:#fed7aa;color:#7c2d12}
.msg.info{background:rgba(239,246,255,.92);border-color:#bfdbfe;color:#0b1b3a}

/* Toast */
.toast{
  position:fixed;
  inset-inline:12px;
  bottom:calc(12px + var(--safe-bottom));
  z-index:var(--z-toast);
  display:none;
}
.toast.is-open{display:block}
.toast-card{
  max-width:640px;
  margin-inline:auto;
  background:var(--card);
  border:1px solid var(--line-2);
  border-radius:16px;
  box-shadow:var(--shadow-lg);
  padding:12px 14px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.toast-title{font-weight:950}
.toast-text{color:var(--muted);font-weight:800;margin-top:4px}
.toast-x{
  border:1px solid rgba(15,23,42,.14);
  background:transparent;
  border-radius:12px;
  padding:8px 10px;
  cursor:pointer;
  font-weight:950;
}

/* ========== 12) Footer ========== */
.site-footer{
  margin-top:auto;
  color:#e7eefc;
  background:linear-gradient(180deg,#0b1220 0%, #0e1a2f 100%);
  position:relative;
}
.site-footer::before{
  content:"";
  position:absolute;
  inset:0 0 auto 0;
  height:3px;
  background:linear-gradient(90deg, var(--brand), var(--accent));
  opacity:.95;
}
.footer-wrap{
  display:grid;
  gap:12px;
  align-items:center;
  padding:18px 0;
}
.f-brand{display:flex;align-items:center;gap:12px}
.f-brand img{
  width:44px;height:44px;border-radius:12px;padding:8px;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.12);
}
.f-title{font-weight:950}
.f-sub{font-size:.92rem;opacity:.88}
.f-nav{display:flex;flex-wrap:wrap;gap:10px}
.f-nav a{
  color:#d7e3ff;
  text-decoration:none;
  padding:8px 10px;
  border-radius:12px;
  font-weight:950;
}
.f-nav a:hover{background:rgba(255,255,255,.08)}
.f-copy{font-size:.9rem;color:#b6c3df}

/* ========== 12.5) To top (FAB) ========== */
.to-top{
  position:fixed;
  left:clamp(12px, 2vw, 16px);
  bottom:calc(12px + var(--safe-bottom));
  width:48px;
  height:48px;
  border-radius:16px;
  border:1px solid var(--line-2);
  background:var(--card);
  color:var(--ink);
  box-shadow:var(--shadow);
  display:none;
  place-items:center;
  cursor:pointer;
  z-index:var(--z-header);
}
.to-top:hover{transform:translateY(-1px)}
.to-top:active{transform:translateY(0)}

/* ========== 13) Responsive ========== */
@media (min-width: 768px){
  .filters{grid-template-columns:repeat(4, 1fr);align-items:end}
  .cards{display:none}
  .table-wrap{display:block}
  .footer-wrap{grid-template-columns:auto 1fr auto}
  .f-copy{text-align:end}
}

@media (max-width: 820px){
  .desktop-only{display:none!important}
  .mobile-only{display:block!important}
  .row-between{flex-wrap:wrap}
}

/* Prevent iOS zoom-on-focus */
@media (max-width: 520px){
  input[type="text"], input[type="password"], input[type="search"], input[type="number"], input[type="date"],
  textarea, select{font-size:16px}
}

/* TV / large screens */
@media (min-width: 1400px){
  body{font-size:18px}
  .container{max-width:1400px}
  th,td{padding:14px 12px}
  .card{padding:18px}
}

/* =========================================================
  14) Print (تقارير/طباعة) — محسّن
   - يخفي عناصر الواجهة
   - يمنع قص الصور/التواقيع
   - يسمح للنص بالتمدد
========================================================= */
@media print{
  /* Hide UI */
  .site-header, .site-footer, .nav, .pgn, .toast, .messages, .to-top{display:none!important}

  /* IMPORTANT: لا تُخفِ .btn عالميًا لأن صفحة report_print فيها زر طباعة/تحميل
     إذا كنت تريد إخفاء أزرار معينة ضع عليها class="no-print" */
  .no-print{display:none!important}

  body{background:#fff!important}
  a{text-decoration:none!important;color:#111827!important}

  .card{
    box-shadow:none!important;
    border-color:#e5e7eb!important;
  }

  /* ثبات الألوان عند الطباعة قدر الإمكان */
  *{-webkit-print-color-adjust: exact; print-color-adjust: exact;}

  /* منع قص العناصر الحساسة */
  .photo-item, .imgs img,
  .attach-item, .attach-grid,
  .signatures-area, .sign-box, .sign-card{
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* اسمح للنص أن يكسر بحرية (حتى ما يزاحم الصور) */
  .description-box{
    break-inside: auto;
    page-break-inside: auto;
  }
}

/* =========================================================
   15) Compatibility + Mobile UX add-ons (safe append)
========================================================= */

/* Better interactive focus */
a:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible{
  outline:none;
  box-shadow:var(--ring);
}

/* Prevent iOS styling + nicer selects */
button, input, textarea, select{
  -webkit-appearance:none;
  appearance:none;
}
select{
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(100,116,139,.9) 50%),
    linear-gradient(135deg, rgba(100,116,139,.9) 50%, transparent 50%);
  background-position: 16px calc(50% - 2px), 10px calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat:no-repeat;
  padding-inline-start:12px;
  padding-inline-end:34px;
}

/* Sticky action bar (optional) */
.sticky-actions{
  position:sticky;
  bottom:0;
  z-index:5;
  background:rgba(255,255,255,.86);
  backdrop-filter:blur(10px) saturate(160%);
  border-top:1px solid var(--line-2);
  padding:10px 12px;
  padding-bottom:calc(10px + var(--safe-bottom));
}
html[data-theme="dark"] .sticky-actions{background:rgba(10,16,32,.72)}

/* Bottom sheet (optional) */
.sheet{
  position:fixed;
  inset:0;
  z-index:var(--z-modal);
  display:none;
}
.sheet.is-open{display:block}
.sheet-backdrop{position:absolute;inset:0;background:rgba(2,6,23,.55)}
.sheet-panel{
  position:absolute;
  inset-inline:0;
  bottom:0;
  border-radius:18px 18px 0 0;
  background:var(--card);
  border:1px solid var(--line-2);
  box-shadow:var(--shadow-lg);
  max-height:min(78vh, 680px);
  overflow:auto;
  padding:12px 14px;
  padding-bottom:calc(14px + var(--safe-bottom));
}
.sheet-grab{
  width:56px;height:5px;border-radius:999px;
  background:rgba(100,116,139,.35);
  margin:6px auto 10px;
}
.sheet-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.sheet-title{font-weight:950}
.sheet-actions{display:flex;gap:8px;flex-wrap:wrap}

/* Bottom nav (optional) */
.bottom-nav{
  position:fixed;
  inset-inline:12px;
  bottom:calc(12px + var(--safe-bottom));
  z-index:var(--z-header);
  display:none;
  background:rgba(255,255,255,.86);
  border:1px solid var(--line-2);
  border-radius:18px;
  box-shadow:var(--shadow);
  backdrop-filter:blur(10px) saturate(180%);
  padding:8px 10px;
}
.bottom-nav .items{display:flex;justify-content:space-between;gap:8px}
.bottom-nav a{
  flex:1;
  min-height:44px;
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  text-decoration:none;
  font-weight:950;
  color:var(--muted);
  transition:background var(--t) var(--ease), color var(--t) var(--ease);
}
.bottom-nav a:hover{background:rgba(0,108,53,.08);color:var(--brand)}
.bottom-nav a[aria-current="page"]{background:var(--brand-ghost);color:var(--brand-700)}
html[data-theme="dark"] .bottom-nav{background:rgba(10,16,32,.72)}
@media (max-width: 820px){
  .bottom-nav{display:block}
  body.has-bottom-nav .site-footer{padding-bottom:86px}
}

/* Skeleton */
.skeleton{
  position:relative;
  overflow:hidden;
  background:rgba(148,163,184,.18);
  border-radius:12px;
}
.skeleton::after{
  content:"";
  position:absolute;
  inset:0;
  transform:translateX(-100%);
  background:linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  animation:shimmer 1.1s linear infinite;
}
html[data-theme="dark"] .skeleton::after{
  background:linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent);
}
@keyframes shimmer{to{transform:translateX(100%)}}

/* Empty state */
.empty{
  text-align:center;
  padding:18px 14px;
  border:1px dashed var(--line);
  border-radius:var(--radius-lg);
  background:rgba(0,108,53,.04);
}
.empty .title{font-weight:950;margin:0 0 6px}
.empty .hint{color:var(--muted);font-weight:800;margin:0}


/* =========================================================
   16) Base Shell (Header/Drawer/Menus/PWA) — moved from base.html
   هدفه: تقليل التكرار + صيانة أسهل + نفس الواجهة
========================================================= */

/* Skip link */
.skip-link{
  position:absolute;
  top:10px;
  right:10px;
  z-index:9999;
  background:var(--card);
  border:1px solid var(--line-2);
  border-radius:14px;
  padding:10px 12px;
  font-weight:950;
  text-decoration:none;
  transform:translateY(-140%);
  box-shadow:var(--shadow-lg);
}
.skip-link:focus{transform:none}

/* Progress bar */
.progress-bar{
  position:fixed;
  top:0;
  right:0;
  height:3px;
  width:0;
  background:linear-gradient(90deg, var(--brand), var(--accent));
  z-index:9999;
  transition:width .2s ease;
}

/* Header shell (تعزيز بسيط فوق الموجود في app.css) */
.site-header{
  transition: box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
.site-header.scrolled{ box-shadow: var(--shadow); }

.hdr{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:72px;
  padding:10px 0;
}

/* Brand */
.hdr-brand{
  display:flex;
  align-items:center;
  gap:12px;
  text-decoration:none;
  color:var(--ink);
  min-width:220px;
}
.hdr-brand img{
  width:42px;height:42px;
  border-radius:14px;
  border:1px solid var(--line-2);
  background:rgba(255,255,255,.65);
  object-fit:contain;
}
.hdr-brand-txt{display:grid;gap:2px;min-width:0}
.hdr-brand-name{font-weight:950;font-size:1.05rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hdr-brand-sub{font-weight:800;color:var(--muted);font-size:.88rem;white-space:nowrap}
@media(max-width:520px){.hdr-brand-sub{display:none}}

/* Desktop nav tabs */
.hdr-nav{
  display:flex;
  align-items:center;
  gap:6px;
  margin-inline-start:18px;
  margin-inline-end:auto;
  flex-wrap:wrap;
}
@media(max-width:1024px){.hdr-nav{display:none}}

.tab{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:44px;
  padding:0 14px;
  border-radius:999px;
  text-decoration:none;
  font-weight:950;
  color:var(--ink);
  border:1px solid transparent;
  transition: background var(--t) var(--ease), transform var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.tab:hover{background:var(--brand-ghost);color:var(--brand);transform:translateY(-1px)}
.tab.is-active{background:var(--brand-ghost);color:var(--brand-700);border-color:rgba(0,108,53,.18)}

.pill{
  min-width:22px;height:22px;border-radius:999px;
  background:var(--danger);color:#fff;
  display:inline-grid;place-items:center;
  font-size:.78rem;padding:0 7px;font-weight:950;
}

/* Right actions */
.hdr-actions{display:flex;align-items:center;gap:10px}

/* Icon buttons */
.icon-btn{
  position:relative;
  display:grid;
  place-items:center;
  width:44px;height:44px;
  border-radius:999px;
  border:1px solid var(--line-2);
  background:var(--card);
  color:var(--ink);
  text-decoration:none;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}
.icon-btn:hover{transform:translateY(-1px);box-shadow:var(--shadow-sm);border-color:rgba(0,108,53,.18)}
.dot{
  position:absolute;
  top:6px;
  left:6px;
  min-width:18px;height:18px;border-radius:999px;
  background:var(--danger);color:#fff;
  font-size:.72rem;
  display:grid;place-items:center;
  padding:0 5px;font-weight:950;
}

/* Hamburger */
.hamburger{
  display:none;
  width:var(--tap);height:var(--tap);
  border-radius:14px;
  border:1px solid var(--line-2);
  background:var(--card);
  align-items:center;
  justify-content:center;
  gap:4px;
  cursor:pointer;
}
.hamburger span{display:block;width:18px;height:2px;background:var(--ink);border-radius:2px;transition:all .18s ease;opacity:.9}
.hamburger.active span:nth-child(1){transform:translateY(4px) rotate(45deg)}
.hamburger.active span:nth-child(2){opacity:0}
.hamburger.active span:nth-child(3){transform:translateY(-4px) rotate(-45deg)}
@media(max-width:1024px){
  .hamburger{display:flex}
  .hdr-actions .icon-btn,
  .hdr-actions #openSchoolModal{display:none}
}

/* Drawer actions (mobile header row) */
.drawer-actions{
  display:none;
  padding:16px;
  gap:12px;
  justify-content:center;
  border-bottom:1px solid var(--line-2);
  background:rgba(2,6,23,.02);
}
@media(max-width:1024px){.drawer-actions{display:flex}}

/* User menu */
.userbox{position:relative}
.avatar{
  width:44px;height:44px;border-radius:999px;
  display:grid;place-items:center;
  font-weight:950;
  border:1px solid rgba(0,108,53,.18);
  background:var(--brand-ghost);
  color:var(--brand-ink);
  cursor:pointer;
  transition:transform var(--t-fast) var(--ease);
}
.avatar:hover{transform:translateY(-1px)}
.menu{
  position:absolute;
  inset:calc(100% + 10px) 0 auto auto;
  min-width:230px;
  background:var(--card);
  border:1px solid var(--line-2);
  border-radius:14px;
  box-shadow:var(--shadow-lg);
  padding:8px;
  opacity:0;
  transform:translateY(-6px) scale(.98);
  pointer-events:none;
  transition:all .18s ease;
  z-index:var(--z-modal);
}
.menu.open{opacity:1;transform:none;pointer-events:auto}
.menu .mi{
  display:flex;gap:10px;align-items:center;
  padding:10px 12px;border-radius:12px;
  color:var(--ink);text-decoration:none;font-weight:900;
}
.menu .mi:hover{background:var(--line-2)}
.menu .meta{color:var(--muted);font-weight:800;font-size:.9rem}

/* Drawer overlay + panel */
.drawer-overlay{
  position:fixed;inset:0;
  background:rgba(2,6,23,.45);
  backdrop-filter:blur(6px);
  z-index:calc(var(--z-header) + 1);
  opacity:0;
  visibility:hidden;
  transition:opacity var(--t) var(--ease), visibility var(--t) var(--ease);
}
.drawer-overlay.show{opacity:1;visibility:visible}

.drawer{
  position:fixed;
  top:0;right:0;left:auto !important;bottom:0;
  width:min(340px, 88vw);
  background:var(--card);
  border-left:1px solid var(--line-2);
  z-index:calc(var(--z-header) + 100);
  transform:translateX(100%);
  visibility:hidden;
  transition:transform .3s var(--ease), visibility 0s .3s;
  display:flex;
  flex-direction:column;
  overflow:auto;
  padding-bottom:var(--safe-bottom);
}
html[dir="rtl"] .drawer{transform:translateX(100%);right:0;left:auto !important}
html[dir="rtl"] .drawer.open{transform:translateX(0)}
.drawer.open{
  transform:translateX(0);
  visibility:visible;
  transition:transform .3s var(--ease), visibility 0s 0s;
}
.drawer-head{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:12px;border-bottom:1px solid var(--line-2);
}
.drawer-title{font-weight:950}
.drawer-nav{display:grid;padding:12px;gap:10px}
.drawer-nav a{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:12px;border:1px solid var(--line-2);
  border-radius:14px;text-decoration:none;font-weight:950;
  background:rgba(2,6,23,.01);
  transition:background var(--t) var(--ease), transform var(--t-fast) var(--ease), border-color var(--t) var(--ease);
}
.drawer-nav a:hover{background:rgba(0,108,53,.06);transform:translateY(-1px)}
.drawer-nav a.is-active{border-color:rgba(0,108,53,.22);background:var(--brand-ghost);color:var(--brand-700)}
.drawer-footer{margin-top:auto;padding:12px;border-top:1px solid var(--line-2);display:grid;gap:10px}

/* Subscription banner */
.sub-banner{
  border-bottom:1px solid rgba(245,158,11,.28);
  background:rgba(255,251,235,.94);
  color:#7c2d12;
  padding:12px 0;
  font-weight:950;
}
html[data-theme="dark"] .sub-banner{
  background:rgba(124,45,18,.22);
  color:#fde68a;
  border-bottom-color:rgba(245,158,11,.22);
}
.sub-banner a{font-weight:950;text-decoration:underline;margin-inline-start:8px}

/* PWA install banner */
.pwa-banner{
  position:fixed;
  right:14px;left:14px;
  bottom:calc(14px + var(--safe-bottom));
  z-index:var(--z-toast);
  display:none;
}
.pwa-banner.open{display:block}
.pwa-card{
  background:var(--card);
  border:1px solid var(--line-2);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-lg);
  padding:12px;
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:space-between;
}
.pwa-text{min-width:0}
.pwa-title{font-weight:950;margin:0;color:var(--ink)}
.pwa-sub{margin:2px 0 0;color:var(--muted);font-weight:800;font-size:.92rem}
.pwa-actions{display:flex;gap:10px;align-items:center;flex:0 0 auto}
.pwa-btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  min-height:44px;padding:0 14px;border-radius:12px;border:1px solid transparent;
  cursor:pointer;font-weight:950;text-decoration:none;background:var(--brand);color:#fff;
}
.pwa-btn:hover{filter:saturate(1.05) brightness(.98)}
.pwa-close{
  width:44px;height:44px;border-radius:12px;border:1px solid var(--line-2);
  background:var(--card);color:var(--ink);cursor:pointer;display:grid;place-items:center;
}
.pwa-close:hover{box-shadow:var(--shadow-sm)}

/* School modal */
.school-modal{
  position:fixed;inset:0;z-index:var(--z-modal);
  display:none;place-items:center;padding:12px;
  background:rgba(2,6,23,.55);
  backdrop-filter:blur(8px);
}
.school-modal.open{display:grid}
.school-panel{
  width:min(560px, 94vw);
  max-height:min(80vh, 720px);
  background:var(--card);
  border:1px solid var(--line-2);
  border-radius:var(--radius-xl);
  box-shadow:var(--shadow-lg);
  overflow:hidden;
  display:flex;
  flex-direction:column;
  transform:scale(.98) translateY(10px);
  transition:transform .2s var(--ease);
}
.school-modal.open .school-panel{transform:none}
.school-panel-h{
  padding:14px 16px;
  border-bottom:1px solid var(--line-2);
  display:flex;align-items:center;justify-content:space-between;gap:10px;
}
.school-panel-h b{font-weight:950}
.school-panel-close{
  width:44px;height:44px;border-radius:999px;border:1px solid var(--line-2);
  background:var(--card);cursor:pointer;
}
.school-panel-b{padding:14px 16px;display:grid;gap:12px;overflow:auto}
.school-search{min-height:48px}
.school-list{margin:0;padding:0;list-style:none;display:grid;gap:10px}
.school-item{
  width:100%;
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  border:1px solid var(--line-2);
  border-radius:14px;
  background:rgba(2,6,23,.01);
  padding:12px 14px;
  cursor:pointer;
  font-weight:950;
  text-align:right;
  transition:transform var(--t-fast) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}
.school-item:hover{transform:translateY(-1px);box-shadow:var(--shadow-sm);border-color:rgba(0,108,53,.18)}
.school-item.current-school{opacity:.75;cursor:not-allowed}
.school-item-text{display:grid;gap:2px;min-width:0}
.school-item-text b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.school-item small{color:var(--muted);font-weight:800;font-size:.85rem}
.school-item .tag{
  padding:6px 10px;border-radius:999px;border:1px solid var(--line-2);
  background:rgba(148,163,184,.14);
  font-size:.8rem;font-weight:950;white-space:nowrap;min-width:66px;text-align:center;
}

/* =========================================================
   Subscription page (my_subscription.html)
   - Scoped under .sub-wrap to avoid cross-page conflicts
   ========================================================= */

.sub-wrap{
  --s-radius: 16px;
  --s-shadow: 0 16px 40px rgba(2,6,23,.10);
  --s-ring: 0 0 0 4px rgba(0,108,53,.18);
  --t: var(--t-fast);

  max-width: 1100px;
  margin: 0 auto;
  padding: 18px;
}

.sub-wrap .sub-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom: 18px;
}

.sub-wrap .sub-h1{
  margin:0;
  font-weight: 950;
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
  color: var(--ink);
  letter-spacing: -.3px;
}

.sub-wrap .sub-school{
  margin-top: 6px;
  color: var(--muted);
  font-weight: 850;
}

.sub-wrap .sub-grid{
  display:grid;
  gap: 14px;
}

@media(min-width: 980px){
  .sub-wrap .sub-grid{ grid-template-columns: 1fr 1fr; align-items:start; }
}

/* Card helpers (مع بقاء .card الأساسية) */
.sub-wrap .sub-card{
  border-radius: var(--s-radius);
  box-shadow: var(--s-shadow);
}

html[data-theme="dark"] .sub-wrap .sub-card{
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
}

.sub-wrap .sub-title{
  margin:0 0 12px 0;
  font-weight: 950;
  color: var(--ink);
  display:flex;
  gap:10px;
  align-items:center;
}

/* Plan hero */
.sub-wrap .plan-hero{
  display:flex;
  gap:12px;
  align-items:center;
  padding: 14px;
  border-radius: 14px;
  background: rgba(219,234,254,.65);
  border: 1px solid rgba(15,143,135,.25);
}

html[data-theme="dark"] .sub-wrap .plan-hero{
  background: rgba(30,58,138,.22);
  border-color: rgba(15,143,135,.25);
}

.sub-wrap .plan-hero .icon{
  width: 44px; height: 44px;
  border-radius: 14px;
  display:grid; place-items:center;
  background: rgba(0,108,53,.14);
  border: 1px solid rgba(0,108,53,.22);
  color: rgba(0,108,53,.95);
  font-size: 20px;
  flex: 0 0 auto;
}

.sub-wrap .plan-hero .name{
  font-weight: 950;
  color: #00542a;
}

html[data-theme="dark"] .sub-wrap .plan-hero .name{
  color: #bfdbfe;
}

.sub-wrap .plan-hero .meta{
  margin-top: 4px;
  font-weight: 850;
  color: rgba(30,58,138,.90);
  font-size: .95rem;
}

html[data-theme="dark"] .sub-wrap .plan-hero .meta{
  color: rgba(191,219,254,.85);
}

/* Stats */
.sub-wrap .stats{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.sub-wrap .stat{
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--line-2), var(--card));
  text-align:center;
}

html[data-theme="dark"] .sub-wrap .stat{
  background: rgba(20,35,73,.35);
  border-color: #1b2744;
}

.sub-wrap .stat .v{
  font-weight: 950;
  font-size: 1.55rem;
  color: var(--ink);
  line-height: 1.1;
}

.sub-wrap .stat .l{
  margin-top: 6px;
  font-weight: 850;
  color: var(--muted);
  font-size: .95rem;
}

/* Bank details (page scoped) */
.sub-wrap .bank-box{
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: linear-gradient(180deg, var(--line-2), var(--card));
}

.sub-wrap .bank-grid{
  display:grid;
  gap: 10px;
}

@media(min-width: 980px){
  .sub-wrap .bank-grid{ grid-template-columns: 1fr 1fr; }
}

.sub-wrap .bank-item{
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: var(--card);
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 10px;
}

.sub-wrap .bank-label{ color: var(--muted); font-weight: 950; margin-bottom: 6px; }
.sub-wrap .bank-value{ color: var(--ink); font-weight: 950; word-break: break-word; }
.sub-wrap .bank-mono{ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }

.sub-wrap .copy-btn{
  min-height: 40px;
  display:inline-flex;
  align-items:center;
  gap: 8px;
  white-space: nowrap;
}

.sub-wrap .bank-note{
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px dashed var(--line);
  color: var(--muted);
  font-weight: 900;
  background: rgba(0,0,0,.02);
}

html[data-theme="dark"] .sub-wrap .bank-note{ background: rgba(255,255,255,.04); }

/* Badges */
.sub-wrap .sbadge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding: 7px 12px;
  border-radius: 999px;
  font-weight: 950;
  font-size: .86rem;
  white-space:nowrap;
}

.sub-wrap .sb-active{ background: rgba(16,185,129,.14); border: 1px solid rgba(16,185,129,.25); color: rgba(16,185,129,.98); }
.sub-wrap .sb-expired{ background: rgba(239,68,68,.14); border: 1px solid rgba(239,68,68,.25); color: rgba(239,68,68,.98); }
.sub-wrap .sb-pending{ background: rgba(245,158,11,.16); border: 1px solid rgba(245,158,11,.25); color: rgba(245,158,11,.98); }

/* Form */
.sub-wrap .fg{ margin-bottom: 14px; }

.sub-wrap .lbl{
  display:block;
  font-weight: 950;
  margin-bottom: 8px;
  color: var(--ink);
}

.sub-wrap .in,
.sub-wrap .sel,
.sub-wrap .ta{
  width:100%;
  padding: 12px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  outline: none;
  transition: var(--t);
}

.sub-wrap .in:focus,
.sub-wrap .sel:focus,
.sub-wrap .ta:focus{
  border-color: rgba(0,108,53,.45);
  box-shadow: var(--s-ring);
}

.sub-wrap .help{
  margin-top: 6px;
  font-weight: 850;
  font-size: .9rem;
  color: var(--muted);
}

.sub-wrap .sub-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top: 10px;
}

.sub-wrap .sub-actions .btn{ min-height: 44px; }

/* Receipt preview */
.sub-wrap .rprev{
  display:none;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow:hidden;
  background: var(--card);
}

.sub-wrap .rprev img{
  width:100%;
  max-height: 280px;
  object-fit: contain;
  display:block;
  background: #0b1220;
}

.sub-wrap .rprev .meta{
  padding: 10px 12px;
  background: var(--line-2);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-weight: 850;
  font-size: .92rem;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
}

/* Table */
.sub-wrap .twrap{ overflow-x:auto; }

.sub-wrap .tbl{
  width:100%;
  border-collapse:collapse;
  min-width: 640px;
}

.sub-wrap .tbl th{
  text-align:right;
  padding: 12px;
  border-bottom: 2px solid var(--line);
  color: var(--muted);
  font-weight: 950;
  font-size: .92rem;
  white-space: nowrap;
}

.sub-wrap .tbl td{
  padding: 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  vertical-align: top;
}

.sub-wrap .note-dim{ color: var(--muted); font-weight: 850; }

/* Empty state */
.sub-wrap .empty{
  padding: 18px;
  border-radius: 16px;
  border: 1px dashed var(--line);
  background: linear-gradient(180deg, var(--card), var(--line-2));
  color: var(--muted);
  font-weight: 900;
  text-align:center;
}

.sub-wrap .empty .ico{ font-size: 40px; margin-bottom: 8px; }

@media (prefers-reduced-motion: reduce){
  .sub-wrap *{ transition:none !important; }
}

/* =====================================================================
   Extracted template CSS (page-scoped)
   ===================================================================== */

/* ===== Home: reports/templates/reports/home.html ===== */
.home-wrap{
  --h-radius: 18px;
  --h-shadow: 0 18px 50px rgba(2,6,23,.10);
  --h-ring: 0 0 0 4px rgba(0,108,53,.20);
  --t: var(--t-fast);
}

/* HERO */
.home-wrap .home-hero{
  position:relative;
  overflow:hidden;
  border-radius: var(--h-radius);
  background:
    radial-gradient(900px 380px at 15% 0%, rgba(255,255,255,.22), transparent 60%),
    radial-gradient(900px 420px at 95% 85%, rgba(16,185,129,.18), transparent 55%),
    linear-gradient(135deg, #006c35 0%, #00542a 55%, #073b2a 100%);
  color:#fff;
  box-shadow: var(--h-shadow);
  border: 1px solid rgba(255,255,255,.14);
}

.home-wrap .home-hero::before{
  content:"";
  position:absolute;
  inset:-2px;
  background:
    radial-gradient(closest-side, rgba(255,255,255,.14), transparent 60%) 20% 15%/220px 220px no-repeat,
    radial-gradient(closest-side, rgba(255,255,255,.10), transparent 60%) 85% 70%/260px 260px no-repeat;
  pointer-events:none;
  opacity:.85;
}

.home-wrap .home-hero-inner{
  position:relative;
  padding: clamp(16px, 3vw, 28px);
  display:grid;
  gap:16px;
}

.home-wrap .hero-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

.home-wrap .hero-title{
  margin:0;
  font-weight: 950;
  letter-spacing: -.5px;
  line-height:1.2;
  font-size: clamp(1.35rem, 3.2vw, 2.05rem);
  color:#eef2ff;
}

.home-wrap .hero-sub{
  margin:8px 0 0;
  font-weight: 800;
  opacity:.92;
  max-width: 740px;
  font-size: clamp(.98rem, 1.8vw, 1.12rem);
}

.home-wrap .hero-meta{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  font-weight: 900;
  opacity:.95;
}

.home-wrap .hero-chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  white-space:nowrap;
}
.home-wrap .hero-chip i{ opacity:.95; }

.home-wrap .hero-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top: 2px;
}

/* أزرار داخل الهيرو فقط */
.home-wrap .hero-actions .btn{
  border-radius: 999px;
  min-height: 44px;
  padding: 10px 16px;
  border-color: rgba(255,255,255,.18);
  transition: var(--t);
}
.home-wrap .btn-hero{
  background:#fff;
  color:#00542a;
  border-color:#fff;
}
.home-wrap .btn-hero:hover{
  transform: translateY(-2px);
  box-shadow: 0 18px 35px rgba(2,6,23,.18);
}
.home-wrap .btn-hero-outline{
  background: rgba(255,255,255,.10);
  color:#eef2ff;
  border-color: rgba(255,255,255,.22);
}
.home-wrap .btn-hero-outline:hover{
  background: rgba(255,255,255,.16);
  transform: translateY(-2px);
}

/* Layout */
.home-wrap .home-grid{
  display:grid;
  gap:14px;
  margin-top: 14px;
}
@media(min-width: 980px){
  .home-wrap .home-grid{
    grid-template-columns: 1.35fr .65fr;
    align-items:start;
  }
}

/* KPI */
.home-wrap .kpis{
  display:grid;
  gap:12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.home-wrap .kpi{
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--line-2), var(--card));
  padding: 14px;
  position:relative;
  overflow:hidden;
  transition: var(--t);
}
.home-wrap .kpi:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(2,6,23,.08);
}
html[data-theme="dark"] .home-wrap .kpi{
  background: linear-gradient(180deg, #122043, #0f1629);
  border-color: #1b2744;
}

.home-wrap .kpi .v{
  font-weight: 950;
  font-size: clamp(1.2rem, 2.2vw, 1.65rem);
  color: var(--ink);
  line-height:1.1;
}
.home-wrap .kpi .l{
  margin-top: 6px;
  font-weight: 900;
  color: var(--muted);
  font-size: .95rem;
}
.home-wrap .kpi .bub{
  position:absolute;
  left: 12px;
  bottom: 12px;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display:grid;
  place-items:center;
  background: rgba(0,108,53,.10);
  border: 1px solid rgba(0,108,53,.18);
  color: rgba(0,108,53,.95);
}
.home-wrap .kpi.kpi-green .bub{ background: rgba(16,185,129,.10); border-color: rgba(16,185,129,.20); color: rgba(16,185,129,.95); }
.home-wrap .kpi.kpi-amber .bub{ background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.22); color: rgba(245,158,11,.95); }
.home-wrap .kpi.kpi-red   .bub{ background: rgba(239,68,68,.10);  border-color: rgba(239,68,68,.22);  color: rgba(239,68,68,.95); }

/* Modern list rows (scoped) */
.home-wrap .list{
  display:grid;
  gap:10px;
}
.home-wrap .item{
  display:grid;
  grid-template-columns: 1fr auto;
  gap:10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--line-2);
  text-decoration:none;
  color: inherit;
  transition: var(--t);
}
.home-wrap .item:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(2,6,23,.07);
  background: rgba(219,234,254,.60);
}
html[data-theme="dark"] .home-wrap .item{ background: rgba(20,35,73,.40); border-color:#1b2744; }
html[data-theme="dark"] .home-wrap .item:hover{ background: rgba(26,44,83,.70); }

.home-wrap .item strong{
  font-weight: 950;
  color: var(--ink);
  display:block;
}
.home-wrap .item .meta{
  margin-top: 4px;
  font-weight: 800;
  color: var(--muted);
  font-size: .95rem;
}

/* Pill (new) */
.home-wrap .hpill{
  align-self:center;
  justify-self:end;
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 950;
  font-size: .85rem;
  color:#fff;
  white-space:nowrap;
}
.home-wrap .hp-blue{ background:#006c35; }
.home-wrap .hp-green{ background:#16845b; }
.home-wrap .hp-amber{ background:#b9975b; }
.home-wrap .hp-red{ background:#ef4444; }
.home-wrap .hp-gray{ background:#64748b; }

/* Empty state */
.home-wrap .empty{
  padding: 14px;
  border-radius: 16px;
  border: 1px dashed var(--line);
  background: linear-gradient(180deg, var(--card), var(--line-2));
  color: var(--muted);
  font-weight: 850;
}
.home-wrap .empty b{ color: var(--ink); }

/* Reduce motion */
@media (prefers-reduced-motion: reduce){
  .home-wrap .kpi,
  .home-wrap .item,
  .home-wrap .hero-actions .btn{
    transition:none !important;
  }
  .home-wrap .kpi:hover,
  .home-wrap .item:hover,
  .home-wrap .hero-actions .btn:hover{
    transform:none !important;
  }
}

/* ===== Home Notification Modal (center) ===== */
.home-wrap .hn-overlay{
  position: fixed;
  inset: 0;
  background: rgba(2,6,23,.55);
  z-index: 12500;
  display: none;
  place-items: center;
  padding: 12px;
}
.home-wrap .hn-overlay.is-open{ display: grid; }
.home-wrap .hn-modal{
  width: min(560px, 94vw);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 40px 90px rgba(2,6,23,.28);
  overflow: hidden;
}
.home-wrap .hn-hd{
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: linear-gradient(180deg, var(--line-2), var(--card));
}
.home-wrap .hn-hd .ttl{
  margin: 0;
  font-weight: 950;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}
.home-wrap .hn-close{
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  cursor: pointer;
  font-weight: 900;
  color: var(--ink);
}
.home-wrap .hn-bd{ padding: 14px 16px; }
.home-wrap .hn-title{ font-weight: 950; margin: 0 0 8px 0; color: var(--ink); }
.home-wrap .hn-body{ color: var(--ink); font-weight: 800; line-height: 1.8; }
.home-wrap .hn-meta{
  margin-top: 10px;
  color: var(--muted);
  font-weight: 800;
  font-size: .95rem;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

/* ===== My Reports: reports/templates/reports/my_reports.html ===== */
.mr-wrap{
  --mr-radius: 18px;
  --mr-shadow: 0 18px 50px rgba(2,6,23,.08);
  --mr-shadow-2: 0 10px 26px rgba(2,6,23,.10);
  --mr-ring: 0 0 0 4px rgba(0,108,53,.18);
  --mr-t: var(--t-fast);
}

.mr-container{
  max-width: 1260px;
  margin: 0 auto;
  padding: 16px 12px;
}

/* ===== Stats ===== */
.mr-stats{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap:12px;
  margin-bottom: 14px;
}
.mr-stat{
  background: linear-gradient(180deg, var(--line-2), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--mr-radius);
  padding: 14px;
  display:flex;
  gap:12px;
  align-items:center;
  box-shadow: var(--mr-shadow);
}
.mr-stat-ico{
  width: 46px; height: 46px;
  border-radius: 14px;
  display:grid; place-items:center;
  border: 1px solid rgba(0,108,53,.15);
  background: rgba(0,108,53,.10);
  color: rgba(0,108,53,.95);
  flex: 0 0 auto;
}
.mr-stat-ico.green{ border-color: rgba(16,185,129,.18); background: rgba(16,185,129,.10); color: rgba(16,185,129,.95); }
.mr-stat-ico.amber{ border-color: rgba(245,158,11,.20); background: rgba(245,158,11,.12); color: rgba(245,158,11,.95); }

.mr-stat .num{
  font-weight: 950;
  font-size: 1.35rem;
  color: var(--ink);
  line-height: 1.1;
}
.mr-stat .lbl{
  margin-top: 4px;
  font-weight: 850;
  color: var(--muted);
  font-size: .95rem;
}

html[data-theme="dark"] .mr-stat{
  background: linear-gradient(180deg, #122043, #0f1629);
  border-color: #1b2744;
}

/* ===== Main Card ===== */
.mr-card{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--mr-radius);
  overflow:hidden;
  box-shadow: var(--mr-shadow);
}
.mr-hd{
  padding: 14px 16px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  flex-wrap:wrap;
  gap:10px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--line-2), var(--card));
}
.mr-title{
  margin:0;
  font-weight: 950;
  display:flex;
  align-items:center;
  gap:10px;
  color: var(--ink);
  font-size: 1.2rem;
}

/* ===== Filters ===== */
.mr-filters{
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(219,234,254,.55);
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:flex-end;
}
html[data-theme="dark"] .mr-filters{
  background: rgba(26,44,83,.42);
}

.mr-field{
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width: 180px;
}
.mr-field.grow{ flex: 1; min-width: 240px; }

.mr-field label{
  font-size: .82rem;
  font-weight: 900;
  color: var(--muted);
}

.mr-input{
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  font-weight: 850;
  outline: none;
  transition: var(--mr-t);
  min-height: 44px;
}
.mr-input:focus{
  box-shadow: var(--mr-ring);
  border-color: rgba(0,108,53,.45);
}
html[data-theme="dark"] .mr-input{
  border-color: #1b2744;
  background: rgba(15,22,41,.85);
}

.mr-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

/* ===== Table ===== */
.mr-table-wrap{ overflow-x:auto; }
.mr-table{
  width:100%;
  border-collapse: collapse;
  text-align:right;
}
.mr-table thead th{
  background: rgba(248,250,252,.90);
  border-bottom: 2px solid var(--line);
  padding: 12px 12px;
  font-weight: 950;
  font-size: .9rem;
  color: var(--muted);
  position: sticky;
  top: 0;
  z-index: 5;
  white-space: nowrap;
}
html[data-theme="dark"] .mr-table thead th{
  background: rgba(15,22,41,.95);
  border-bottom-color: #1b2744;
}

.mr-table tbody td{
  padding: 12px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
html[data-theme="dark"] .mr-table tbody td{
  border-bottom-color:#1b2744;
}

.mr-date{
  font-weight: 950;
  color: var(--ink);
}
.mr-day{
  margin-top: 3px;
  font-size: .85rem;
  font-weight: 850;
  color: var(--muted);
}

.mr-rpt{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.mr-rpt .t{
  font-weight: 950;
  color: var(--ink);
  line-height: 1.25;
}
.mr-chip{
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 950;
  font-size: .82rem;
  background: rgba(0,108,53,.10);
  border: 1px solid rgba(0,108,53,.18);
  color: rgba(0,108,53,.95);
}
html[data-theme="dark"] .mr-chip{
  background: rgba(0,108,53,.14);
  border-color: rgba(0,108,53,.22);
}

.mr-idea{
  max-width: 320px;
  font-size: .95rem;
  font-weight: 800;
  color: var(--muted);
  display:-webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow:hidden;
}

/* thumbnails */
.mr-imgs{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  align-items:center;
}
.mr-thumb{
  width: 42px; height: 42px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--line);
  cursor: zoom-in;
  background: rgba(148,163,184,.12);
  transition: var(--mr-t);
}
.mr-thumb:hover{
  transform: translateY(-1px);
  box-shadow: var(--mr-shadow-2);
  border-color: rgba(0,108,53,.35);
}
html[data-theme="dark"] .mr-thumb{
  border-color:#1b2744;
}

/* actions */
.mr-actions-cell{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}
.mr-iconbtn{
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  display:grid;
  place-items:center;
  transition: var(--mr-t);
}
.mr-iconbtn:hover{
  color: rgba(0,108,53,.95);
  border-color: rgba(0,108,53,.35);
  transform: translateY(-1px);
}
.mr-iconbtn.danger{
  color: rgba(239,68,68,.92);
  border-color: rgba(239,68,68,.25);
}
.mr-iconbtn.danger:hover{
  color: rgba(239,68,68,.95);
  border-color: rgba(239,68,68,.35);
}
html[data-theme="dark"] .mr-iconbtn{
  border-color:#1b2744;
  background: rgba(15,22,41,.85);
}

/* ===== Empty ===== */
.mr-empty{
  padding: 44px 16px;
  text-align:center;
}
.mr-empty .ico{
  font-size: 2.6rem;
  opacity: .28;
  margin-bottom: 10px;
}
.mr-empty h3{
  margin: 0 0 6px;
  font-weight: 950;
  color: var(--muted);
}
.mr-empty p{
  margin: 0;
  font-weight: 850;
  color: var(--muted);
}

/* ===== Mobile Cards ===== */
.mr-mobile{
  display:none;
  padding: 12px 12px 16px;
  gap:12px;
  flex-direction:column;
}
.mr-mcard{
  border: 1px solid var(--line);
  border-radius: var(--mr-radius);
  background: linear-gradient(180deg, var(--line-2), var(--card));
  padding: 14px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
html[data-theme="dark"] .mr-mcard{
  background: rgba(20,35,73,.40);
  border-color:#1b2744;
}
.mr-mtop{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
}
.mr-mdate{
  font-size: .9rem;
  font-weight: 850;
  color: var(--muted);
}
.mr-mtitle{
  margin: 6px 0 0;
  font-weight: 950;
  color: var(--ink);
  font-size: 1.05rem;
}
.mr-mbody{
  font-size: .95rem;
  font-weight: 800;
  color: var(--muted);
  line-height: 1.7;
}
.mr-mfoot{
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}
html[data-theme="dark"] .mr-mfoot{
  border-top-color:#1b2744;
}

/* Mobile polish: bigger tap targets in cards */
@media (max-width: 820px){
  .mr-mobile .mr-actions-cell{ gap:10px; }
  .mr-mobile .mr-iconbtn{ width:44px; height:44px; border-radius:14px; }
}

/* ===== Pagination ===== */
.mr-pager{
  padding: 14px 16px 18px;
  display:flex;
  justify-content:center;
  gap:10px;
  align-items:center;
}
.mr-page{
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  text-decoration:none;
  color: var(--ink);
  font-weight: 900;
  background: var(--card);
  transition: var(--mr-t);
}
.mr-page:hover{
  transform: translateY(-1px);
  border-color: rgba(0,108,53,.35);
}
.mr-page.active{
  background: rgba(0,108,53,.95);
  border-color: rgba(0,108,53,.95);
  color: #fff;
}
html[data-theme="dark"] .mr-page{
  border-color:#1b2744;
  background: rgba(15,22,41,.85);
}

/* ===== Modal Gallery ===== */
.mr-modal{
  position: fixed;
  inset: 0;
  background: rgba(2,6,23,.92);
  z-index: 14000;
  display: none;
  place-items: center;
  padding: 14px;
}
.mr-modal.is-open{ display:grid; }

.mr-modal-inner{
  width: min(980px, 96vw);
  display:grid;
  gap:12px;
}

.mr-modal-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}

.mr-modal-close{
  width: 44px; height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  color:#fff;
  cursor:pointer;
  font-weight: 950;
}
.mr-modal-close:hover{
  background: rgba(255,255,255,.14);
}

.mr-modal-img{
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
  background: rgba(255,255,255,.03);
}

.mr-modal-nav{
  display:flex;
  justify-content:center;
  gap:12px;
}
.mr-navbtn{
  width: 54px; height: 54px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  color:#fff;
  cursor:pointer;
  display:grid;
  place-items:center;
  font-weight: 950;
  transition: var(--mr-t);
}
.mr-navbtn:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.14);
}

/* ===== Responsive ===== */
@media (max-width: 920px){
  .mr-table-wrap{ display:none; }
  .mr-mobile{ display:flex; }
  .mr-hd{ align-items:flex-start; }
}

/* ===== My Requests: reports/templates/reports/my_requests.html ===== */
.req-scope .wrap{max-width:1200px;margin:0 auto;padding:16px 12px}

/* ===== Hero ===== */
.req-scope .hero{
  border-radius:22px;
  color:#fff;
  box-shadow: var(--shadow, 0 18px 50px rgba(2,6,23,.10));
  padding:18px 20px;
  display:flex;align-items:center;justify-content:space-between;gap:14px;
  background:
    radial-gradient(900px 380px at 15% 10%, rgba(255,255,255,.16), transparent 55%),
    linear-gradient(135deg, var(--brand), #0072bc);
}
.req-scope .hero .title{
  margin:0;font-weight:950;font-size:1.45rem;
  display:flex;align-items:center;gap:10px;
}
.req-scope .hero .title i{opacity:.95}
.req-scope .you-chip{
  background:rgba(255,255,255,.14);
  border:1px solid rgba(255,255,255,.22);
  border-radius:999px;
  padding:10px 12px;
  display:flex;align-items:center;gap:10px;
  backdrop-filter:saturate(160%) blur(8px);
  -webkit-backdrop-filter:saturate(160%) blur(8px);
}
.req-scope .you-ava{
  width:38px;height:38px;border-radius:999px;
  background:rgba(2,6,23,.18);
  display:grid;place-items:center;
  border:1px solid rgba(255,255,255,.18);
}
.req-scope .you-ava span{font-weight:950}
.req-scope .you-name{font-weight:950;line-height:1}
.req-scope .you-role{display:block;margin-top:3px;font-size:.8rem;opacity:.92;font-weight:850}

/* ===== Toolbar ===== */
.req-scope .toolbar{
  margin-top:14px;
  background:var(--card);
  border:1px solid var(--line);
  border-radius:18px;
  box-shadow: var(--shadow, 0 18px 50px rgba(2,6,23,.10));
  padding:12px;
  display:flex;gap:10px;flex-wrap:wrap;align-items:center;
}
.req-scope .tb-group{display:flex;gap:10px;align-items:center;flex-wrap:wrap}

.req-scope .input,
.req-scope .select{
  border:1px solid var(--line);
  border-radius:14px;
  background: #fff;
  color: var(--ink);
  padding:10px 12px;
  font-size:.95rem;
  min-height:44px;
  outline: none;
}
html[data-theme="dark"] .req-scope .input,
html[data-theme="dark"] .req-scope .select{
  background: rgba(15,23,42,.55);
  border-color: #1b2744;
  color: var(--ink);
}
.req-scope .input:focus,
.req-scope .select:focus{
  box-shadow: 0 0 0 4px rgba(0,108,53,.18);
  border-color: rgba(0,108,53,.45);
}

.req-scope .input{min-width:min(380px, 100%);}
.req-scope .select{min-width:180px}

.req-scope .btnx{
  border:1px solid #c7d2fe;
  border-radius:14px;
  background:#eef2ff;
  color:#073b2a;
  font-weight:950;
  padding:10px 14px;
  min-height:44px;
  cursor:pointer;
  text-decoration:none;
  display:inline-flex;align-items:center;gap:8px;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, filter .15s ease;
}
.req-scope .btnx:hover{background:#e0e7ff;border-color:#b6c3ff;transform:translateY(-1px)}
.req-scope .btnx:active{transform:none}

.req-scope .btnx.primary{
  background:var(--brand);
  border-color:var(--brand);
  color:#fff;
}
.req-scope .btnx.primary:hover{filter:brightness(.98)}

.req-scope .btnx.sm{
  padding:8px 10px;
  min-height:38px;
  border-radius:12px;
  font-size:.92rem;
}

.req-scope .view-switch{margin-inline-start:auto;display:flex;gap:8px}
.req-scope .view-switch a{
  padding:9px 12px;border-radius:12px;border:1px solid var(--line);
  background:#fff;font-weight:950;color:#073b2a;text-decoration:none;min-height:44px;
  display:inline-flex;align-items:center;gap:8px;
}
html[data-theme="dark"] .req-scope .view-switch a{
  background: rgba(15,23,42,.55);
  border-color:#1b2744;
  color: var(--ink);
}
.req-scope .view-switch .active{background:var(--brand);color:#fff;border-color:var(--brand)}

.req-scope .hintline{
  width:100%;
  display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;
  color:var(--muted);
  font-weight:850;
  padding-top:6px;
}

/* ===== Stats ===== */
.req-scope .stats{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-top:14px}
.req-scope .stat{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:16px;
  box-shadow: var(--shadow, 0 18px 50px rgba(2,6,23,.10));
  padding:16px;
  display:flex;align-items:center;justify-content:space-between;gap:10px;
}
.req-scope .stat .num{font-weight:950;font-size:1.45rem;line-height:1}
.req-scope .stat .lbl{color:var(--muted);font-weight:850;margin-top:6px}
.req-scope .ico{
  width:42px;height:42px;border-radius:14px;
  display:grid;place-items:center;
  border:1px solid rgba(15,23,42,.06);
  font-weight:950;
}
.req-scope .ico.o{background:#ecfdf5;color:#065f46}
.req-scope .ico.i{background:#f5f3ff;color:#5b21b6}
.req-scope .ico.d{background:#e0f2fe;color:#075985}
.req-scope .ico.r{background:#fee2e2;color:#991b1b}
html[data-theme="dark"] .req-scope .ico{border-color: rgba(255,255,255,.06)}

/* ===== List Cards ===== */
.req-scope .list{margin-top:12px;display:grid;gap:12px}
.req-scope .ticket{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:16px;
  box-shadow: var(--shadow, 0 18px 50px rgba(2,6,23,.10));
  padding:14px;
  display:grid;
  grid-template-columns:1fr 290px;
  gap:16px;
  position:relative;
  overflow:hidden;
}
.req-scope .ticket::after{
  content:"";
  position:absolute;top:0;bottom:0;left:0;width:6px;background:rgba(148,163,184,.55);
}

.req-scope .t-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:6px}
.req-scope .tid{
  background:#eef2ff;color:#00542a;border:1px solid #c7d2fe;
  border-radius:999px;padding:6px 10px;font-weight:950;font-size:.85rem;
}
.req-scope .t-title{margin:0;font-weight:950;color:var(--ink);font-size:1.08rem}
.req-scope .t-title a{color:inherit;text-decoration:none}
.req-scope .t-title a:hover{color:var(--brand)}

.req-scope .meta{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
.req-scope .pill{
  border:1px solid var(--line);
  border-radius:999px;
  background:#f8fafc;
  padding:8px 12px;
  display:inline-flex;align-items:center;gap:8px;
  font-size:.9rem;
  color:var(--ink);
  font-weight:850;
}
html[data-theme="dark"] .req-scope .pill{
  background: rgba(15,23,42,.35);
  border-color:#1b2744;
}
.req-scope .dot{width:8px;height:8px;border-radius:999px}
.req-scope .dot.a{background:#06b6d4}
.req-scope .dot.b{background:linear-gradient(135deg,#006c35,#16845b)}
.req-scope .dot.c{background:#94a3b8}

.req-scope .last-note{
  margin-top:10px;
  border:1px dashed var(--line);
  border-radius:14px;
  background:linear-gradient(180deg,#ffffff,#fbfdff);
  padding:10px 12px;
  color:var(--muted);
  font-weight:850;
}
html[data-theme="dark"] .req-scope .last-note{
  background: linear-gradient(180deg, rgba(15,23,42,.45), rgba(15,23,42,.25));
  border-color:#1b2744;
}
.req-scope .last-note b{color:var(--ink)}

.req-scope .aside{display:flex;flex-direction:column;gap:10px;align-items:flex-start;justify-content:center}
.req-scope .badge2{
  --bg:#f1f5f9;--fg:#0f172a;--bd:#e2e8f0;
  background:var(--bg);color:var(--fg);border:1px solid var(--bd);
  padding:10px 14px;border-radius:14px;font-weight:950;
  display:inline-flex;align-items:center;gap:8px;
  white-space:nowrap;
}
.req-scope .b-open{--bg:#ecfdf5;--fg:#065f46;--bd:#a7f3d0}
.req-scope .b-in{--bg:#f5f3ff;--fg:#5b21b6;--bd:#ddd6fe}
.req-scope .b-done{--bg:#e0f2fe;--fg:#075985;--bd:#bae6fd}
.req-scope .b-rej{--bg:#fee2e2;--fg:#991b1b;--bd:#fecaca}

.req-scope .meter{
  height:7px;width:100%;
  border-radius:999px;
  background:#eef2f7;border:1px solid #e6ebf2;
  overflow:hidden;
}
html[data-theme="dark"] .req-scope .meter{
  background: rgba(148,163,184,.18);
  border-color:#1b2744;
}
.req-scope .fill{height:100%;display:block;width:100%}
.req-scope .m-open .fill{width:34%;background:linear-gradient(90deg,#35a96f,#16845b)}
.req-scope .m-in .fill{width:67%;background:linear-gradient(90deg,#a78bfa,#b9975b)}
.req-scope .m-done .fill{width:100%;background:linear-gradient(90deg,#0f8f87,#006c35)}
.req-scope .m-rej .fill{width:100%;background:linear-gradient(90deg,#fda4af,#ef4444)}

.req-scope .ticket.state-open::after{background:#16845b}
.req-scope .ticket.state-in::after{background:#b9975b}
.req-scope .ticket.state-done::after{background:#006c35}
.req-scope .ticket.state-rej::after{background:#ef4444}

/* ===== Table ===== */
.req-scope .table-wrap{
  margin-top:12px;
  background:var(--card);
  border:1px solid var(--line);
  border-radius:16px;
  box-shadow: var(--shadow, 0 18px 50px rgba(2,6,23,.10));
  overflow:auto;
}
.req-scope table{width:100%;border-collapse:collapse}
.req-scope thead th{
  background:#f8fafc;border-bottom:1px solid var(--line);
  padding:12px 10px;text-align:right;
  color:var(--ink);font-weight:950;white-space:nowrap;
}
html[data-theme="dark"] .req-scope thead th{
  background: rgba(15,23,42,.45);
  border-color:#1b2744;
}
.req-scope td{border-bottom:1px solid var(--line);padding:11px 10px;white-space:nowrap}
html[data-theme="dark"] .req-scope td{border-color:#1b2744}
.req-scope .tbl-id{font-weight:950;color:#00542a}
html[data-theme="dark"] .req-scope .tbl-id{color: #93c5fd}
.req-scope .tbl-title a{text-decoration:none;color:var(--ink);font-weight:950}
.req-scope .tbl-title a:hover{color:var(--brand)}
.req-scope .note-preview{max-width:520px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-weight:850}

/* ===== Empty state ===== */
.req-scope .empty{
  margin-top:12px;
  border:1px dashed var(--line);
  border-radius:18px;
  background:linear-gradient(180deg,#ffffff,#fbfdff);
  padding:18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  color:var(--muted);
  font-weight:950;
}
html[data-theme="dark"] .req-scope .empty{
  background: linear-gradient(180deg, rgba(15,23,42,.45), rgba(15,23,42,.25));
  border-color:#1b2744;
}
.req-scope .empty .big{font-size:1.05rem;color:var(--ink)}
.req-scope .empty .sub{font-weight:850;margin-top:4px;color:var(--muted)}
.req-scope .empty .spark{
  width:52px;height:52px;border-radius:18px;
  display:grid;place-items:center;
  background:rgba(0,108,53,.08);
  border:1px solid rgba(0,108,53,.18);
  color:var(--brand);
  font-size:1.2rem;
}

/* ===== Pager ===== */
.req-scope .pager{display:flex;gap:8px;justify-content:center;margin-top:14px;flex-wrap:wrap}
.req-scope .pager a, .req-scope .pager span{
  background:#fff;border:1px solid var(--line);border-radius:12px;
  padding:9px 12px;text-decoration:none;color:var(--ink);font-weight:950;
}
html[data-theme="dark"] .req-scope .pager a,
html[data-theme="dark"] .req-scope .pager span{
  background: rgba(15,23,42,.55);
  border-color:#1b2744;
}
.req-scope .pager .current{
  background:#eef2ff;border-color:#c7d2fe;color:#073b2a;
}
html[data-theme="dark"] .req-scope .pager .current{
  background: rgba(0,108,53,.18);
  border-color: rgba(0,108,53,.28);
  color: var(--ink);
}

/* Responsive */
@media (max-width: 980px){
  .req-scope .ticket{grid-template-columns:1fr}
  .req-scope .stats{grid-template-columns:repeat(2,1fr)}
  .req-scope .view-switch{width:100%;margin-inline-start:0}
  .req-scope .view-switch a{flex:1;justify-content:center}
  .req-scope .input{min-width: 100%;}
}
@media (max-width: 560px){
  .req-scope .stats{grid-template-columns:1fr}
}

@media (prefers-reduced-motion: reduce){
  .req-scope .btnx{transition:none !important}
  .req-scope .btnx:hover{transform:none !important}
}

/* ===== My Profile: reports/templates/reports/my_profile.html ===== */
.myp-wrap{max-width:1100px;margin:0 auto;padding:clamp(10px,2.2vw,18px)}
.myp-shell{background:var(--card);border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow);overflow:hidden}
.myp-head{padding:18px 18px;border-bottom:1px solid var(--line)}
.myp-title{margin:0;font-weight:950;font-size:1.25rem;color:var(--ink);display:flex;align-items:center;gap:10px}
.myp-sub{margin:8px 0 0;color:var(--muted);font-weight:850;line-height:1.8}

.myp-body{padding:16px}
.myp-grid{display:grid;gap:14px}
@media(min-width:980px){.myp-grid{grid-template-columns:1fr 1fr}}

.myp-card{background:var(--card);border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow-sm);padding:14px}
.myp-card h2{margin:0 0 10px;font-weight:950;color:var(--ink);font-size:1.05rem;display:flex;align-items:center;gap:10px}

.myp-rows{display:grid;gap:10px}
.myp-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border-radius:14px;border:1px solid var(--line);background:rgba(248,250,252,.65)}
html[data-theme="dark"] .myp-row{background:rgba(255,255,255,.03)}
.myp-row span{color:var(--muted);font-weight:900}
.myp-row b{color:var(--ink);font-weight:950}

.myp-list{margin:0;padding-right:18px}
.myp-list li{margin:6px 0;color:var(--ink);font-weight:850}
.myp-muted{color:var(--muted);font-weight:900}

.myp-form{display:grid;gap:12px}
.myp-form label{font-weight:900;color:var(--ink);margin-bottom:6px;display:block}
.myp-errors{border:1px solid rgba(239,68,68,.25);background:rgba(239,68,68,.10);border-radius:14px;padding:12px;color:var(--ink);font-weight:850;line-height:1.8}
.myp-err{color:rgba(239,68,68,.95);margin-top:6px;font-weight:850}

/* ===== Notifications: reports/templates/reports/my_notifications.html ===== */
.notif-scope{
  --primary: #006c35;
  --secondary:#b9975b;
  --success:#16845b;
  --danger:#ef4444;

  --bg: var(--bg, #f8fafc);
  --card: var(--card, #ffffff);
  --text: var(--ink, #0f172a);
  --text-light: var(--muted, #64748b);
  --border: var(--line, #e2e8f0);

  --radius-lg:20px;
  --radius-md:12px;
  --shadow: 0 10px 40px rgba(2,6,23,.08);
  --gradient: linear-gradient(135deg,var(--primary),var(--secondary));
  --t: var(--t-fast, all .25s ease);

  --safe-top: env(safe-area-inset-top,0px);
  --safe-bottom: env(safe-area-inset-bottom,0px);
}

html[data-theme="dark"] .notif-scope{
  --bg: var(--bg, #0b1223);
  --card: var(--card, #0f1629);
  --text: var(--ink, #e5e7eb);
  --text-light: var(--muted, #a3b2c7);
  --border: var(--line, #1b2744);
  --shadow: 0 18px 55px rgba(0,0,0,.35);
}

.notif-scope .notif-container{
  max-width: 1400px;
  margin-inline: auto;
  padding: 20px;
}

.notif-scope .page-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin: 0 0 22px;
  flex-wrap:wrap;
}

.notif-scope .page-title{
  margin:0;
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  font-weight: 950;
  display:flex;
  align-items:center;
  gap:12px;
  background: var(--gradient);
  background-clip:text;
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
}

.notif-scope .chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 950;
  font-size: .9rem;
  border: 1px solid var(--border);
  background: rgba(15,143,135,.08);
  color: #00542a;
}
html[data-theme="dark"] .notif-scope .chip{
  background: rgba(15,143,135,.16);
  color: #c7d2fe;
}

.notif-scope .chip.danger{
  background: rgba(239,68,68,.10);
  border-color: rgba(239,68,68,.25);
  color: #b91c1c;
}
html[data-theme="dark"] .notif-scope .chip.danger{
  color: #fecaca;
}

.notif-scope .chip.muted{
  background: rgba(148,163,184,.10);
  border-color: var(--border);
  color: var(--text-light);
}

.notif-scope .head-actions{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  align-items:center;
}

.notif-scope .btn-outline{
  padding: 12px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--card);
  font-weight: 900;
  color: var(--text);
  cursor: pointer;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  gap:8px;
  transition: var(--t);
}
.notif-scope .btn-outline:hover{
  border-color: rgba(0,108,53,.55);
  box-shadow: 0 8px 22px rgba(2,6,23,.08);
  transform: translateY(-2px);
}

.notif-scope .toggle{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-weight: 900;
  color: var(--text);
  user-select:none;
}
.notif-scope .toggle input{ width:18px; height:18px; }

.notif-scope .cards{ display:grid; gap:20px; }
@media (min-width:768px){ .notif-scope .cards{ grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (min-width:1200px){ .notif-scope .cards{ grid-template-columns:repeat(3,minmax(0,1fr)); } }

.notif-scope .n-card{
  position:relative;
  display:flex;
  flex-direction:column;
  gap:16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: var(--t);
  overflow:hidden;
}
.notif-scope .n-card::before{
  content:"";
  position:absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: var(--gradient);
}
.notif-scope .n-card:hover{
  transform: translateY(-4px);
  box-shadow: 0 22px 60px rgba(2,6,23,.12);
}
html[data-theme="dark"] .notif-scope .n-card:hover{
  box-shadow: 0 28px 80px rgba(0,0,0,.45);
}

.notif-scope .n-card.read{
  background:
    linear-gradient(180deg, rgba(15,143,135,.06), transparent),
    var(--card);
}

.notif-scope .n-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.notif-scope .n-title{
  margin:0;
  font-weight: 950;
  color: var(--text);
  display:flex;
  align-items:center;
  gap:10px;
  font-size: 1.12rem;
  line-height: 1.35;
}

.notif-scope .n-time{
  white-space:nowrap;
  color: var(--text-light);
  font-weight: 850;
  font-size: .9rem;
  display:flex;
  align-items:center;
  gap:6px;
}

.notif-scope .n-body{
  color: var(--text);
  font-weight: 800;
  line-height: 1.85;
  overflow-wrap:anywhere;
  display:-webkit-box;
  -webkit-box-orient:vertical;
  --lines:6;
  line-clamp: var(--lines);
  -webkit-line-clamp: var(--lines);
  overflow:hidden;
  margin: 2px 0 4px;
  background: rgba(148,163,184,.08);
  padding: 12px;
  border-radius: 12px;
  border-inline-start: 4px solid rgba(0,108,53,.95);
}
@media (max-width:900px){ .notif-scope .n-body{ --lines:5; } }
@media (max-width:600px){ .notif-scope .n-body{ --lines:4; } }
html[data-theme="dark"] .notif-scope .n-body{
  background: rgba(148,163,184,.10);
  border-inline-start-color: rgba(15,143,135,.9);
}

.notif-scope .sender{
  display:flex;
  align-items:center;
  gap:12px;
  color: var(--text);
  flex-wrap:wrap;
}

.notif-scope .avatar-dot{
  width:12px;height:12px;border-radius:50%;
  background: rgba(0,108,53,.95);
  box-shadow: 0 0 0 3px rgba(0,108,53,.20);
}
.notif-scope .read .avatar-dot{
  background: rgba(16,185,129,.95);
  box-shadow: 0 0 0 3px rgba(16,185,129,.20);
}

.notif-scope .sender-name{ font-weight: 950; }
.notif-scope .sender-role{ color: var(--text-light); font-weight: 850; font-size: .9rem; }

.notif-scope .n-actions{
  margin-top:auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
.notif-scope .n-actions .left{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; }

.notif-scope .btn-sm{
  padding:10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  font-weight: 900;
  text-decoration:none;
  color: var(--text);
  display:inline-flex;
  align-items:center;
  gap:8px;
  transition: var(--t);
  font-size: .9rem;
  cursor:pointer;
}
.notif-scope .btn-sm:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(2,6,23,.10);
}

.notif-scope .btn-sm.primary{
  background: rgba(0,108,53,.95);
  border-color: rgba(0,108,53,.95);
  color:#fff;
}

.notif-scope .btn-sm.ghost{
  background: rgba(15,143,135,.10);
  border-color: rgba(15,143,135,.20);
  color: #00542a;
}
html[data-theme="dark"] .notif-scope .btn-sm.ghost{
  color: #c7d2fe;
}

.notif-scope .btn-sm.success{
  background: rgba(16,185,129,.12);
  border-color: rgba(16,185,129,.22);
  color: #065f46;
}
html[data-theme="dark"] .notif-scope .btn-sm.success{
  color: #bbf7d0;
}

.notif-scope .time-badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:10px 14px;
  border-radius: 999px;
  background: rgba(0,108,53,.08);
  border: 1px solid rgba(0,108,53,.18);
  color: #073b2a;
  font-weight: 950;
  font-size: .9rem;
}
html[data-theme="dark"] .notif-scope .time-badge{
  color: #c7d2fe;
  background: rgba(15,143,135,.14);
  border-color: rgba(15,143,135,.22);
}

.notif-scope .empty{
  padding: 40px 20px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  text-align:center;
  color: var(--text-light);
  font-weight: 950;
  font-size: 1.05rem;
}
.notif-scope .empty i{
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: .5;
  display:block;
}

.notif-scope .pager{
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:center;
  margin-top: 28px;
  flex-wrap:wrap;
}
.notif-scope .pager a,
.notif-scope .pager span{
  padding:10px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  font-weight: 950;
  text-decoration:none;
  color: var(--text);
  transition: var(--t);
}
.notif-scope .pager a:hover{
  background: rgba(0,108,53,.95);
  color:#fff;
  border-color: rgba(0,108,53,.95);
}
.notif-scope .pager .on{
  background: var(--gradient);
  color:#fff;
  border-color: rgba(0,108,53,.55);
}

/* ===== Modal (ID based, works even if moved to <body>) ===== */
#nModal{
  position:fixed;
  inset:0;
  z-index:2147483647;
  display:none;
  place-items:center;
  padding:20px;
  padding-top: calc(20px + env(safe-area-inset-top,0px));
  padding-bottom: calc(20px + env(safe-area-inset-bottom,0px));
  opacity:0;
  visibility:hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
#nModal.open{
  display:grid;
  opacity:1;
  visibility:visible;
}
#nModal::before{
  content:"";
  position:absolute;
  inset:0;
  background: rgba(2,6,23,.68);
  backdrop-filter: blur(4px);
  pointer-events:none;
}

#nModal .modal{
  position:relative;
  z-index:1;
  width: min(760px, 96vw);
  max-height: 90vh;
  overflow:auto;
  background: var(--card, #fff);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(2,6,23,.35);
  transform: translateY(16px) scale(.985);
  opacity:0;
  transition: transform .25s ease, opacity .25s ease;
  pointer-events:auto;
  outline: none;
}
#nModal.open .modal{
  transform:none;
  opacity:1;
}

#nModal .m-close{
  position:absolute;
  inset-block-start: 16px;
  inset-inline-start: 16px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  background: rgba(239,68,68,.95);
  color:#fff;
  font-size: 18px;
  display:grid;
  place-items:center;
  transition: var(--t, all .25s ease);
  line-height: 1;
}
#nModal .m-close:hover{ transform: scale(1.06); }

#nModal .m-header{
  padding: 22px;
  border-bottom: 1px solid var(--line, #e2e8f0);
  background: linear-gradient(135deg, rgba(248,250,252,.9), rgba(238,242,255,.85));
}
html[data-theme="dark"] #nModal .m-header{
  background: linear-gradient(135deg, rgba(15,22,41,.95), rgba(27,39,68,.9));
}

#nModal .m-title{
  margin: 0 0 10px;
  font-weight: 950;
  color: var(--ink, #0f172a);
  font-size: 1.35rem;
}

#nModal .m-meta{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

#nModal .m-chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  background: rgba(15,143,135,.10);
  border: 1px solid rgba(15,143,135,.20);
  color: #00542a;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 950;
  font-size: .9rem;
}
html[data-theme="dark"] #nModal .m-chip{ color: #c7d2fe; }

#nModal .m-body{
  padding: 22px;
  color: var(--ink, #0f172a);
  line-height: 1.85;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: rgba(148,163,184,.08);
  min-height: 100px;
}
html[data-theme="dark"] #nModal .m-body{ background: rgba(148,163,184,.10); }

#nModal .m-actions{
  padding: 16px 22px;
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  justify-content:flex-end;
  border-top: 1px solid var(--line, #e2e8f0);
  background: rgba(148,163,184,.08);
}
html[data-theme="dark"] #nModal .m-actions{ background: rgba(148,163,184,.10); }

/* Buttons inside modal only */
#nModal .m-btn{
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid var(--line, #e2e8f0);
  background: var(--card, #fff);
  font-weight: 950;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap:8px;
  text-decoration:none;
  color: var(--ink, #0f172a);
  transition: var(--t, all .25s ease);
}
#nModal .m-btn:hover{ transform: translateY(-2px); box-shadow: 0 10px 22px rgba(2,6,23,.12); }

#nModal .m-btn.primary{
  background: var(--gradient);
  color:#fff;
  border-color: transparent;
}
#nModal .m-btn.ghost{
  background: rgba(15,143,135,.10);
  border-color: rgba(15,143,135,.20);
  color: #00542a;
}
html[data-theme="dark"] #nModal .m-btn.ghost{ color: #c7d2fe; }

@media (max-width:600px){
  .notif-scope .notif-container{ padding: 14px; }
  #nModal .modal{ width: 98vw; border-radius: 14px; }
  #nModal .m-close{ width: 36px; height: 36px; font-size: 18px; }
  #nModal .m-header{ padding: 18px; }
  #nModal .m-title{ font-size: 1.15rem; }
  #nModal .m-body{ padding: 18px; font-size: .95rem; }
  #nModal .m-actions{ flex-direction: column-reverse; padding: 12px 16px; }
  #nModal .m-btn{ width: 100%; justify-content:center; padding: 14px; }
}

@media (prefers-reduced-motion: reduce){
  .notif-scope *{ transition:none !important; }
}

/* ===== Assigned To Me: reports/templates/reports/assigned_to_me.html ===== */
.assigned-page{
  --ap-brand: var(--brand, #006c35);
  --ap-accent: var(--accent, #16845b);
  --ap-danger: var(--danger, #ef4444);
  --ap-ink: var(--ink, #0f172a);
  --ap-muted: var(--muted, #64748b);
  --ap-line: var(--line-2, var(--line, #e5e7eb));
  --ap-card: var(--card, #fff);
  --ap-shadow: var(--shadow, 0 14px 36px rgba(2,6,23,.10));
  --t: var(--t-fast);
}

/* Hero (بدون كسر هوية المنصة) */
.assigned-page .page-hero{
  background:
    radial-gradient(900px 240px at 20% 0%, rgba(0,108,53,.22), transparent 55%),
    radial-gradient(700px 260px at 85% 75%, rgba(16,185,129,.16), transparent 60%),
    linear-gradient(135deg, rgba(0,108,53,.95), rgba(14,165,233,.88));
  color:#fff;
  border:none;
}
.assigned-page .user-badge{
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.22);
  padding: 8px 12px;
  border-radius: 999px;
  display:flex;
  align-items:center;
  gap:10px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Stats */
.assigned-page .stats-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.assigned-page .stat-card{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:16px;
}
.assigned-page .stat-icon{
  width:42px;height:42px;border-radius:12px;
  display:grid;place-items:center;
  font-size:1.2rem;
}
.assigned-page .st-new{background:#ecfdf5;color:var(--ap-accent)}
.assigned-page .st-pro{background:#f5f3ff;color:#b9975b}
.assigned-page .st-don{background:#e0f2fe;color:var(--ap-brand)}
.assigned-page .st-rej{background:#fee2e2;color:var(--ap-danger)}

html[data-theme="dark"] .assigned-page .st-new{background:rgba(16,185,129,.14); color:#35a96f}
html[data-theme="dark"] .assigned-page .st-pro{background:rgba(185,151,91,.14); color:#c4b5fd}
html[data-theme="dark"] .assigned-page .st-don{background:rgba(0,108,53,.14); color:#93c5fd}
html[data-theme="dark"] .assigned-page .st-rej{background:rgba(239,68,68,.14); color:#fca5a5}

/* Filters card tweaks */
.assigned-page .filters .actions{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  flex-wrap:wrap;
  align-items:center;
}
.assigned-page .filters .actions .select{width:auto}

/* View switch */
.assigned-page .view-switch{
  margin-top:12px;
  border-top:1px solid var(--ap-line);
  padding-top:12px;
  display:flex;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
}
.assigned-page .view-btn.active{
  background: var(--ap-brand);
  color:#fff;
  border-color: var(--ap-brand);
}

/* List item */
.assigned-page .ticket-item{
  display:grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  transition: var(--t);
}
@media (max-width:768px){
  .assigned-page .ticket-item{grid-template-columns:1fr}
}

/* Meter */
.assigned-page .meter{
  height:6px;
  width:110px;
  background: var(--ap-line);
  border-radius: 999px;
  overflow:hidden;
  margin-top:8px;
}
.assigned-page .meter-fill{height:100%;display:block;border-radius:999px}

/* Badges (✅ renamed to avoid conflicts) */
.assigned-page .ap-badge{
  padding:4px 10px;
  border-radius:10px;
  font-size:.85rem;
  font-weight:900;
  display:inline-flex;
  align-items:center;
  gap:6px;
  border:1px solid transparent;
  white-space:nowrap;
}
.assigned-page .ap-bg-new{background:#ecfdf5;color:var(--ap-accent);border-color:rgba(16,185,129,.2)}
.assigned-page .ap-bg-pro{background:#f5f3ff;color:#b9975b;border-color:rgba(185,151,91,.2)}
.assigned-page .ap-bg-don{background:#e0f2fe;color:var(--ap-brand);border-color:rgba(0,108,53,.2)}
.assigned-page .ap-bg-rej{background:#fee2e2;color:var(--ap-danger);border-color:rgba(239,68,68,.2)}
.assigned-page .ap-bg-oth{background:#f1f5f9;color:#334155;border-color:rgba(148,163,184,.35)}
html[data-theme="dark"] .assigned-page .ap-bg-oth{background:rgba(148,163,184,.14); color:#e2e8f0; border-color:rgba(148,163,184,.22)}

/* Table polish */
.assigned-page .table-wrap table{width:100%;border-collapse:collapse}
.assigned-page .table-wrap th,
.assigned-page .table-wrap td{
  padding:12px;
  border-bottom:1px solid var(--ap-line);
  text-align:center;
  vertical-align:middle;
}
.assigned-page .table-wrap th{font-weight:900}
.assigned-page .table-wrap td.title{text-align:right;font-weight:800}
.assigned-page .table-wrap tr:hover{background:rgba(0,108,53,.04)}
html[data-theme="dark"] .assigned-page .table-wrap tr:hover{background:rgba(148,163,184,.08)}

/* Mobile tweaks */
@media (max-width:520px){
  .assigned-page .filters > div{grid-column:1 / -1 !important}
  .assigned-page .filters .actions{width:100%;flex-direction:column;align-items:stretch}
  .assigned-page .filters .actions .select,
  .assigned-page .filters .actions .btn{width:100%;justify-content:center}
  .assigned-page .view-switch{width:100%;justify-content:stretch}
  .assigned-page .view-switch .btn{flex:1;justify-content:center}
  .assigned-page .ticket-item > div:last-child{align-items:stretch !important}
  .assigned-page .btn-detail{width:100%;justify-content:center}
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce){
  .assigned-page .ticket-item,
  .assigned-page .view-btn{
    transition:none !important;
  }
}

/* ===== Royal Ministry Theme bundled from royal-theme.css ===== */
/* =========================================================
   Royal Ministry Theme
   Global visual layer for all templates.
   Palette inspired by the Saudi Ministry of Education identity:
   green, blue/teal knowledge tones, and restrained ceremonial gold.
========================================================= */

:root {
  --font: "Cairo", system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans Arabic", sans-serif;
  --font-base: "Cairo", system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans Arabic", sans-serif;

  --moe-green: #006c35;
  --moe-green-700: #00542a;
  --moe-green-900: #073b2a;
  --moe-teal: #0f8f87;
  --moe-blue: #0072bc;
  --royal-gold: #b9975b;
  --royal-gold-strong: #8d6b2f;
  --royal-ink: #10251f;
  --royal-night: #081d19;
  --royal-pearl: #fbfaf6;
  --royal-mist: #eef7f3;

  --brand: var(--moe-green);
  --brand-700: var(--moe-green-700);
  --brand-ink: var(--moe-green-900);
  --brand-alpha: rgba(0, 108, 53, .94);
  --brand-ghost: rgba(0, 108, 53, .10);
  --accent: var(--royal-gold);
  --accent-hover: var(--royal-gold-strong);
  --info: var(--moe-blue);
  --success: #16845b;
  --warning: #c78a1f;
  --danger: #b4232f;

  --ink: var(--royal-ink);
  --ink-soft: #27433a;
  --muted: #64736e;
  --text-main: var(--royal-ink);
  --text-muted: #68766f;
  --text-light: #8d9b95;
  --bg: #f4f7f3;
  --bg-body: #f4f7f3;
  --bg-sub: #edf5ef;
  --card: rgba(255, 255, 255, .93);
  --surface: rgba(255, 255, 255, .94);
  --line: rgba(16, 37, 31, .12);
  --line-2: rgba(0, 108, 53, .10);
  --border-light: rgba(0, 108, 53, .13);
  --border-focus: rgba(185, 151, 91, .48);

  --radius-sm: 8px;
  --radius: 10px;
  --radius-lg: 12px;
  --radius-xl: 14px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 12px;

  --ring: 0 0 0 3px rgba(185, 151, 91, .26);
  --shadow-xs: 0 1px 2px rgba(8, 29, 25, .05);
  --shadow-sm: 0 8px 20px rgba(8, 29, 25, .07);
  --shadow: 0 18px 44px rgba(8, 29, 25, .10);
  --shadow-xl: 0 24px 70px rgba(8, 29, 25, .14);
  --shadow-lg: 0 30px 90px rgba(8, 29, 25, .16);
  --shadow-glass: 0 18px 60px rgba(0, 108, 53, .08);
}

html[data-theme="dark"] {
  --bg: #061512;
  --bg-body: #061512;
  --bg-sub: #0b211c;
  --card: rgba(10, 31, 27, .88);
  --surface: rgba(9, 27, 24, .92);
  --line: rgba(205, 225, 216, .14);
  --line-2: rgba(205, 225, 216, .09);
  --border-light: rgba(205, 225, 216, .14);
  --ink: #edf6f1;
  --ink-soft: #d9ebe3;
  --muted: rgba(220, 235, 228, .74);
  --text-main: #edf6f1;
  --text-muted: rgba(220, 235, 228, .74);
  --text-light: rgba(220, 235, 228, .58);
  --brand: #35b978;
  --brand-700: #22a567;
  --brand-ink: #b8f0d1;
  --brand-ghost: rgba(53, 185, 120, .16);
  --accent: #d4b16d;
  --accent-hover: #e0c27e;
}

html,
body,
button,
input,
select,
textarea {
  font-family: var(--font) !important;
  letter-spacing: 0;
}

body {
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 92% -8%, rgba(0, 108, 53, .14), transparent 62%),
    radial-gradient(740px 360px at 6% 10%, rgba(0, 114, 188, .10), transparent 60%),
    linear-gradient(180deg, #f8fbf7 0%, var(--bg) 46%, #f7f7f1 100%) !important;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    linear-gradient(135deg, rgba(185, 151, 91, .08), transparent 30%),
    repeating-linear-gradient(135deg, rgba(0, 108, 53, .025) 0 1px, transparent 1px 22px);
}

html[data-theme="dark"] body {
  background:
    radial-gradient(760px 380px at 82% -8%, rgba(53, 185, 120, .13), transparent 64%),
    radial-gradient(680px 360px at 10% 12%, rgba(0, 114, 188, .10), transparent 60%),
    linear-gradient(180deg, #061512 0%, #071c18 100%) !important;
}

::selection {
  background: rgba(185, 151, 91, .28);
}

a:hover {
  color: var(--brand-700);
}

.site-header {
  background: rgba(251, 250, 246, .88) !important;
  border-bottom: 1px solid rgba(0, 108, 53, .12) !important;
  box-shadow: 0 8px 30px rgba(8, 29, 25, .06) !important;
}

.site-header.scrolled {
  background: rgba(251, 250, 246, .96) !important;
  box-shadow: 0 18px 46px rgba(8, 29, 25, .10) !important;
}

html[data-theme="dark"] .site-header,
html[data-theme="dark"] .site-header.scrolled {
  background: rgba(6, 21, 18, .88) !important;
}

.hdr-brand img,
.brand img,
.footer-logo img {
  border-radius: 10px !important;
  border: 1px solid rgba(185, 151, 91, .30) !important;
  background: #fff !important;
}

.hdr-brand-name,
.brand-copy strong,
.footer-logo-text h3 {
  color: var(--brand-ink) !important;
  font-weight: 900 !important;
}

.hdr-brand-sub,
.brand-copy span {
  color: var(--royal-gold-strong) !important;
  font-weight: 800 !important;
}

.hdr-nav {
  background: rgba(0, 108, 53, .065) !important;
  border-color: rgba(0, 108, 53, .12) !important;
}

.hdr-nav .tab,
.drawer-nav a,
.bottom-nav a {
  color: var(--ink-soft) !important;
}

.hdr-nav .tab:hover,
.drawer-nav a:hover,
.drawer-nav a.is-active,
.bottom-nav a:hover {
  color: var(--brand-700) !important;
  background: rgba(0, 108, 53, .10) !important;
}

.hdr-nav .tab.is-active,
.bottom-nav a[aria-current="page"] {
  color: var(--brand-700) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(252, 248, 239, .90)) !important;
  box-shadow: 0 10px 26px rgba(8, 29, 25, .07), inset 0 -2px 0 rgba(185, 151, 91, .45) !important;
}

.progress-bar,
.site-footer::before,
.footer-line,
.section-accent {
  background: linear-gradient(90deg, var(--moe-green), var(--moe-blue), var(--royal-gold)) !important;
}

.card,
.panel,
.box,
.tile,
.kpi,
.stat-card,
.metric-card,
.dashboard-card,
.app-card,
.modal-card,
.school-panel,
.drawer,
.table-wrap,
.table-responsive,
.filters,
.empty-state,
.n-card,
.price-card,
.footer-card {
  background: var(--card) !important;
  border-color: var(--line-2) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-sm) !important;
}

.card:hover,
.panel:hover,
.tile:hover,
.kpi:hover,
.stat-card:hover,
.dashboard-card:hover,
.app-card:hover,
.price-card:hover {
  box-shadow: var(--shadow) !important;
}

.page-hero,
.hero-card,
.hero-panel,
.admin-hero,
.dashboard-hero,
.welcome-card,
.assigned-page .page-hero,
.support-scope .hero,
.req-scope .hero,
[class*="hero"] {
  border-color: rgba(185, 151, 91, .24) !important;
}

.page-hero,
.admin-hero,
.dashboard-hero,
.welcome-card,
.assigned-page .page-hero,
.support-scope .hero,
.req-scope .hero {
  background:
    radial-gradient(920px 300px at 14% 0%, rgba(185, 151, 91, .20), transparent 60%),
    radial-gradient(760px 320px at 84% 78%, rgba(0, 114, 188, .16), transparent 62%),
    linear-gradient(135deg, var(--moe-green-900), var(--moe-green) 58%, #0f8f87) !important;
  color: #fff !important;
  box-shadow: var(--shadow) !important;
}

.page-hero *,
.admin-hero *,
.dashboard-hero *,
.welcome-card *,
.assigned-page .page-hero *,
.support-scope .hero *,
.req-scope .hero * {
  color: inherit;
}

.section-title,
.page-title,
h1,
h2,
h3 {
  color: var(--ink);
  letter-spacing: 0 !important;
}

.page-hero .page-title,
.page-hero h1,
.page-hero h2,
.admin-hero h1,
.dashboard-hero h1 {
  color: #fff !important;
}

.muted,
.section-sub,
.page-subtitle,
.helptext,
.meta,
small {
  color: var(--muted);
}

.btn,
button,
input[type="submit"],
input[type="button"] {
  border-radius: 10px !important;
}

.btn-primary,
.btn-accent,
.btn-login,
.reset-btn.primary,
.pwa-btn,
.submit-btn,
.primary,
button.primary,
input[type="submit"] {
  background: linear-gradient(135deg, var(--moe-green), var(--moe-green-700)) !important;
  border-color: rgba(0, 108, 53, .42) !important;
  color: #fff !important;
  box-shadow: 0 14px 30px rgba(0, 108, 53, .22) !important;
}

.btn-primary:hover,
.btn-accent:hover,
.btn-login:hover,
.reset-btn.primary:hover,
.pwa-btn:hover,
.submit-btn:hover,
.primary:hover,
button.primary:hover {
  background: linear-gradient(135deg, var(--moe-green-700), var(--royal-night)) !important;
  box-shadow: 0 18px 42px rgba(0, 108, 53, .28) !important;
}

.btn-outline,
.btn-soft,
.secondary,
button.secondary {
  background: rgba(255, 255, 255, .78) !important;
  border-color: rgba(185, 151, 91, .34) !important;
  color: var(--brand-ink) !important;
}

.btn-outline:hover,
.btn-soft:hover,
.secondary:hover,
button.secondary:hover {
  background: rgba(0, 108, 53, .09) !important;
  border-color: rgba(0, 108, 53, .24) !important;
  color: var(--brand-700) !important;
}

.icon-btn:hover,
.footer-social a:hover {
  background: var(--brand) !important;
  border-color: var(--brand) !important;
  color: #fff !important;
}

.avatar,
.logo-circle,
.kpi .kpi-ico.info,
.action-icon,
.stat-icon,
.avatar-dot {
  background:
    linear-gradient(135deg, rgba(0, 108, 53, .14), rgba(185, 151, 91, .16)) !important;
  color: var(--brand-700) !important;
}

.avatar {
  background: linear-gradient(135deg, var(--moe-green), var(--royal-gold)) !important;
  color: #fff !important;
}

.badge.info,
.badge.open,
.chip,
.tag,
.pill,
.time-badge,
[class*="badge"],
[class*="chip"] {
  border-color: rgba(0, 108, 53, .18);
}

.badge.info,
.chip,
.time-badge {
  background: rgba(0, 108, 53, .10) !important;
  color: var(--brand-700) !important;
}

.badge.success,
.msg.success {
  background: rgba(22, 132, 91, .10) !important;
  border-color: rgba(22, 132, 91, .24) !important;
  color: #146747 !important;
}

.badge.warning,
.msg.warning {
  background: rgba(185, 151, 91, .15) !important;
  border-color: rgba(185, 151, 91, .30) !important;
  color: #7c5b23 !important;
}

.badge.danger,
.msg.error {
  background: rgba(180, 35, 47, .10) !important;
  border-color: rgba(180, 35, 47, .24) !important;
  color: #8f1d28 !important;
}

.msg {
  border-inline-start: 4px solid var(--accent) !important;
  border-right-width: 0 !important;
  border-radius: 12px !important;
}

input:not([type="checkbox"]):not([type="radio"]),
textarea,
select,
.input,
.textarea,
.select,
.form-input {
  background: rgba(255, 255, 255, .92) !important;
  border-color: rgba(16, 37, 31, .15) !important;
  border-radius: 10px !important;
  color: var(--ink) !important;
}

input:focus,
textarea:focus,
select:focus,
.form-input:focus {
  border-color: rgba(185, 151, 91, .58) !important;
  box-shadow: var(--ring) !important;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--brand);
}

thead th {
  background:
    linear-gradient(180deg, rgba(0, 108, 53, .08), rgba(185, 151, 91, .07)) !important;
  color: var(--brand-ink) !important;
}

tbody tr:hover td {
  background: rgba(0, 108, 53, .045) !important;
}

.table-wrap::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb {
  background: rgba(0, 108, 53, .35) !important;
}

.site-footer {
  color: rgba(255, 255, 255, .88) !important;
  background:
    radial-gradient(900px 360px at 92% 0%, rgba(185, 151, 91, .14), transparent 62%),
    linear-gradient(180deg, #0d2d25 0%, #071815 100%) !important;
}

.site-footer h3,
.site-footer h4,
.site-footer .footer-logo-text h3,
.site-footer a:hover {
  color: #fff !important;
}

.site-footer .footer-desc,
.site-footer .footer-copyright,
.site-footer .footer-contact-item,
.site-footer .footer-links a,
.site-footer .footer-logo-text p {
  color: rgba(255, 255, 255, .68) !important;
}

.footer-badge {
  background: rgba(255, 255, 255, .08) !important;
  border-color: rgba(255, 255, 255, .14) !important;
  color: rgba(255, 255, 255, .82) !important;
}

.drawer,
.school-panel,
.userbox .menu {
  background: rgba(251, 250, 246, .97) !important;
  border-color: rgba(185, 151, 91, .22) !important;
}

html[data-theme="dark"] .drawer,
html[data-theme="dark"] .school-panel,
html[data-theme="dark"] .userbox .menu {
  background: rgba(8, 29, 25, .97) !important;
}

.to-top {
  background: linear-gradient(135deg, var(--moe-green), var(--royal-gold)) !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, .24) !important;
}

.pwa-card {
  background: rgba(251, 250, 246, .96) !important;
  border-color: rgba(185, 151, 91, .28) !important;
}

/* Standalone marketing/auth pages */
.nav-shell .nav,
.auth-card,
.drawer-panel,
.hero-window,
.ribbon-card,
.proof-tile,
.impact-card,
.feature-card,
.result-card,
.showcase-card,
.pricing-shell,
.advisor-panel,
.final-cta,
.faq-item,
.footer-card {
  border-color: rgba(185, 151, 91, .22) !important;
  border-radius: 12px !important;
  box-shadow: var(--shadow-sm) !important;
}

.nav-shell .nav,
.auth-card,
.drawer-panel {
  background: rgba(251, 250, 246, .90) !important;
  backdrop-filter: blur(18px) saturate(160%);
}

.auth-card {
  max-width: 460px;
  overflow: hidden;
}

.auth-card::before,
.final-cta::before,
.pricing-shell::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--moe-green), var(--moe-blue), var(--royal-gold));
  pointer-events: none;
}

.brand-stripe {
  background: linear-gradient(90deg, var(--moe-green), var(--moe-blue), var(--royal-gold)) !important;
}

.logo-circle {
  border-color: rgba(185, 151, 91, .30) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .72), var(--shadow-sm) !important;
}

.brand-title,
.hero-copy h1,
.section-head h2,
.final-cta h2,
.footer h2 {
  color: var(--brand-ink) !important;
}

.hero-copy h1 .accent,
.nav-links a:hover,
.link:hover,
.section-label,
.eyebrow,
.impact-card strong {
  color: var(--brand-700) !important;
}

.eyebrow {
  background: linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(248, 244, 234, .88)) !important;
  border-color: rgba(185, 151, 91, .26) !important;
}

.hero-window {
  color: #fff !important;
  background:
    radial-gradient(720px 300px at 8% 0%, rgba(185, 151, 91, .18), transparent 62%),
    radial-gradient(620px 280px at 100% 86%, rgba(0, 114, 188, .14), transparent 64%),
    linear-gradient(180deg, #0d2d25, #061512) !important;
  box-shadow: 0 42px 110px rgba(8, 29, 25, .22) !important;
}

.pulse-chip i,
.footer-kicker i,
.footer-list i,
.contact-item i {
  color: var(--royal-gold) !important;
}

.overlay-stat strong,
.window-title strong {
  color: var(--brand-ink) !important;
}

.hero-actions .btn,
.final-actions .btn,
.footer-cta-stack .btn {
  min-height: 50px;
}

.footer {
  color: rgba(255, 255, 255, .88) !important;
  background:
    radial-gradient(900px 360px at 92% 0%, rgba(185, 151, 91, .15), transparent 62%),
    linear-gradient(180deg, #0d2d25 0%, #071815 100%) !important;
}

.footer h2,
.footer h3,
.footer strong,
.footer .brand-copy strong {
  color: #fff !important;
}

.footer p,
.footer a,
.footer span,
.footer-bottom {
  color: rgba(255, 255, 255, .68) !important;
}

.footer a:hover {
  color: #fff !important;
}

.mobile-sticky-cta {
  background: rgba(251, 250, 246, .94) !important;
  border-top: 1px solid rgba(185, 151, 91, .24) !important;
}

.notif-scope,
.assigned-page,
.req-scope,
.support-scope,
.pay-detail,
.subscription-page,
.home-wrap {
  --primary: var(--brand);
  --secondary: var(--royal-gold);
  --gradient: linear-gradient(135deg, var(--moe-green), var(--moe-blue));
  --c-brand: var(--brand);
  --ap-brand: var(--brand);
  --ap-accent: var(--royal-gold);
}

.notif-scope .page-title,
.notif-scope .n-card::before,
.notif-scope .pager .on,
#nModal .m-btn.primary {
  background: linear-gradient(135deg, var(--moe-green), var(--moe-blue)) !important;
}

/* Shared royal treatment for late-migrated templates */
.royal-page {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: clamp(16px, 2.5vw, 28px) 0;
  direction: rtl;
}

.royal-page--narrow {
  width: min(860px, calc(100% - 28px));
}

.royal-hero,
.royal-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(185, 151, 91, .22);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(251, 250, 246, .91)),
    radial-gradient(circle at 92% 0%, rgba(185, 151, 91, .16), transparent 32%),
    radial-gradient(circle at 8% 100%, rgba(15, 143, 135, .11), transparent 30%);
  box-shadow: 0 22px 58px rgba(16, 37, 31, .10);
}

.royal-hero::before,
.royal-panel::before {
  content: "";
  position: absolute;
  inset-inline: 20px;
  top: 0;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--royal-gold), var(--brand), transparent);
}

.royal-hero {
  padding: clamp(20px, 3vw, 30px);
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.royal-panel {
  padding: clamp(16px, 2.4vw, 24px);
}

.royal-title {
  margin: 0;
  color: var(--ink);
  font-weight: 950;
  line-height: 1.35;
  letter-spacing: 0;
}

.royal-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.9;
}

.royal-kicker,
.royal-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin-bottom: 10px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(185, 151, 91, .26);
  background: rgba(185, 151, 91, .10);
  color: var(--brand);
  font-weight: 950;
  font-size: .9rem;
}

.royal-actions,
.royal-form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.royal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.royal-field {
  display: grid;
  gap: 7px;
}

.royal-field.full {
  grid-column: 1 / -1;
}

.royal-field .form-label,
.royal-field label {
  color: var(--ink);
  font-weight: 900;
}

.royal-note {
  padding: 12px 14px;
  border: 1px solid rgba(185, 151, 91, .22);
  border-radius: 14px;
  background: rgba(185, 151, 91, .08);
  color: var(--muted);
  font-weight: 850;
  line-height: 1.85;
}

.royal-table-wrap {
  overflow: auto;
  border: 1px solid rgba(185, 151, 91, .18);
  border-radius: 16px;
  background: var(--card);
}

.royal-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.royal-table th,
.royal-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: middle;
}

.royal-table th {
  color: var(--brand);
  font-weight: 950;
  background: linear-gradient(180deg, rgba(185, 151, 91, .13), rgba(0, 108, 53, .05));
}

.royal-table tbody tr:hover {
  background: rgba(0, 108, 53, .035);
}

.royal-table tbody tr:last-child td {
  border-bottom: 0;
}

.royal-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--line-2);
  color: var(--muted);
  font-weight: 950;
  white-space: nowrap;
}

.royal-status.ok {
  background: rgba(22, 132, 91, .11);
  border-color: rgba(22, 132, 91, .22);
  color: var(--success);
}

.royal-status.warn {
  background: rgba(185, 151, 91, .13);
  border-color: rgba(185, 151, 91, .27);
  color: var(--royal-gold-strong);
}

.royal-status.danger {
  background: rgba(220, 38, 38, .09);
  border-color: rgba(220, 38, 38, .20);
  color: var(--danger);
}

.royal-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
  font-weight: 900;
}

.royal-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 18px 0;
  direction: rtl;
  flex-wrap: wrap;
}

.royal-pagination__meta {
  padding: 8px 13px;
  border: 1px solid rgba(185, 151, 91, .20);
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  color: var(--muted);
  font-weight: 900;
}

@media (max-width: 760px) {
  .royal-hero {
    display: grid;
  }

  .royal-grid {
    grid-template-columns: 1fr;
  }

  .royal-actions .btn,
  .royal-form-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Mobile responsiveness guardrails across all templates */
@media screen and (max-width: 768px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  main,
  .container,
  .page-main,
  .card,
  .panel,
  .box,
  .tile,
  .royal-page,
  [class$="-page"],
  [class$="-wrap"],
  [class$="-scope"],
  [class$="-container"] {
    min-width: 0;
    max-width: 100%;
  }

  img,
  video,
  canvas,
  iframe,
  svg {
    max-width: 100%;
  }

  input,
  select,
  textarea,
  button,
  .btn {
    max-width: 100%;
  }

  .btn,
  button[type="submit"],
  .royal-actions,
  .royal-form-actions,
  .actions,
  .row-actions,
  .hero-actions,
  .header-actions {
    flex-wrap: wrap;
  }

  .table-responsive,
  .royal-table-wrap,
  .table-container,
  .tblwrap,
  .pt-table-responsive,
  .aa-table-wrap,
  [class*="table-wrap"],
  [class*="table-responsive"] {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    max-width: 100%;
  }

  pre,
  code,
  .mono {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
}

@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .notif-scope .page-title {
    background-clip: text !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
  }
}

.hp-blue,
.btn-detail,
.view-btn.active,
.req-scope .view-switch .active {
  background: var(--brand) !important;
  border-color: var(--brand) !important;
  color: #fff !important;
}

@media (max-width: 768px) {
  body.not-home .card,
  body.not-home .app-card,
  body.not-home .panel,
  body.not-home .box,
  body.not-home .tile,
  body.not-home .kpi-card,
  body.not-home .stat-card {
    border-radius: 10px !important;
  }
}

@media print {
  :root {
    --font: "Cairo", "Noto Naskh Arabic", Tahoma, Arial, sans-serif;
  }

  body {
    background: #fff !important;
  }
}

