/* Jamaat flag scheme: green (dominant) + blue (accent) + white. --blue is the flag's blue stripe. */
:root{--green:#08783E;--dark:#07552E;--light:#EAF5EE;--blue:#1E7FD1}
body{font-family:'Noto Naskh Arabic','Inter',system-ui,sans-serif;font-size:14.5px;background:#f4f7f5;color:#1c2b22}
[dir="ltr"] body{font-family:'Inter',system-ui,sans-serif}
h1{font-size:1.35rem}h2{font-size:1.2rem}h3{font-size:1.05rem}
.sidebar{width:260px;min-height:100vh;background-color:#07552E!important;background:#07552E!important;color:#fff;flex-shrink:0;height:100vh;overflow-y:auto;--bs-offcanvas-bg:#07552E}
/* Desktop only: sticky column. On mobile (<992px) Bootstrap's offcanvas MUST stay position:fixed — a sticky sidebar stays in the flex layout, gets flex-shrunk to ~100px, and squeezes the page wider than the viewport (that was the mobile overflow). */
@media (min-width:992px){.sidebar{position:sticky;top:0}}
/* Bootstrap .offcanvas-lg forces background-color:transparent!important below 992px (and on desktop static state) — that is why the menu looked washed out: pale text on a transparent (pale page) background. These rules beat it. */
.sidebar.offcanvas,.sidebar.offcanvas-lg,.sidebar.offcanvas-start{background-color:#07552E!important;background:#07552E!important;--bs-offcanvas-bg:#07552E;color:#fff}
@media (max-width:991.98px){.sidebar{width:280px;max-width:85vw}}
.brand{display:flex;gap:10px;align-items:center;padding:16px 14px 14px;border-bottom:1px solid rgba(255,255,255,.16)}
.brand-mark{width:44px;height:44px;border-radius:12px;background:linear-gradient(135deg,#fff,#D8EFE0);color:var(--dark);display:flex;align-items:center;justify-content:center;font-weight:800;font-size:1.15rem;box-shadow:0 2px 8px rgba(0,0,0,.25);flex-shrink:0}
/* Uploaded organization logo (Settings -> branding): same slot as the "JI"
   tile, white backing so any logo reads on the green sidebar and on print. */
.brand-logo{width:44px;height:44px;object-fit:contain;background:#fff;border-radius:12px;padding:3px;flex-shrink:0;box-shadow:0 2px 8px rgba(0,0,0,.25)}
/* Circulars are official Urdu documents: the letter is always RTL and
   right-aligned, even when the app is switched to English mode. */
.circular-letter{direction:rtl;text-align:right}
.brand-name{font-weight:700;font-size:.95rem;line-height:1.3;color:#fff}
.brand-sub{color:#D8EFE0}
.brand-sub{font-size:.72rem;opacity:.85}
/* VIP grouped menu: section headers are prominent labels with a divider line;
   items have a 28px icon tile; the active item gets a gold start bar + a white
   icon tile so the current page is obvious at a glance. */
.sidebar .nav-link{position:relative;display:flex;align-items:center;gap:10px;color:#E7F6EC;border-radius:10px;margin:2px 0;padding:8px 10px;font-size:.9rem;font-weight:500}
.sidebar .nav-link:hover{background:rgba(255,255,255,.10);color:#fff}
.sidebar .nav-link .mi{width:28px;height:28px;border-radius:8px;background:rgba(255,255,255,.13);display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}
.sidebar .nav-link .mi svg{width:16px;height:16px}
.sidebar .nav-link.active{background:linear-gradient(90deg,rgba(255,255,255,.16),rgba(255,255,255,.05));color:#fff;font-weight:700}
.sidebar .nav-link.active::before{content:'';position:absolute;inset-inline-start:0;top:9px;bottom:9px;width:3px;border-radius:3px;background:var(--blue)}
.sidebar .nav-link.active .mi{background:#fff;color:var(--green)}
.sidebar .nav-sec{display:flex;align-items:center;gap:8px;color:#8FD0A4;font-size:.68rem;font-weight:700;letter-spacing:.12em;padding:16px 10px 6px;text-transform:uppercase}
.sidebar .nav-sec::after{content:'';flex:1;height:1px;background:rgba(255,255,255,.16)}
.sidebar-foot{padding:12px;font-size:.68rem;color:#D8EFE0;text-align:center;border-top:1px solid rgba(255,255,255,.12)}
.main{min-width:0}
.topbar{background:#fff;border-bottom:1px solid #dfe8e2;position:sticky;top:0;z-index:10;flex-wrap:nowrap}
.topbar .btn{white-space:nowrap;flex-shrink:0}
.topbar strong{min-width:0}
/* Language-scoped name fields: in Urdu mode only the Urdu name field shows, in
   English mode only the English one. The hidden mate is filled from the visible
   one on submit (assets/js/app-v1.js) + server fallback (pair_names()), so a
   save is never blocked by the hidden field. */
.lang-ur .lang-en-only{display:none!important}
.lang-en .lang-ur-only{display:none!important}
.card{border:1px solid #dfe8e2;border-radius:12px;box-shadow:0 1px 3px rgba(0,0,0,.05)}
.card-header{background:var(--light);font-weight:600;color:var(--dark)}
.btn-success{background:var(--green);border-color:var(--green)}
.btn-success:hover{background:var(--dark)}
.btn-outline-success{color:var(--green);border-color:var(--green)}
.btn-outline-success:hover{background:var(--green);color:#fff}
.text-success{color:var(--green)!important}
.bg-success{background:var(--green)!important}
.form-label{font-size:13px;font-weight:600;margin-bottom:3px}
.form-control,.form-select{font-size:15px;min-height:38px}
.table{font-size:.88rem}
.table th{background:var(--light);color:var(--dark);white-space:nowrap}
.stat-card{border-top:4px solid var(--green)}
.stat-num{font-size:1.5rem;font-weight:700;color:var(--dark)}
.stat-label{font-size:.75rem;color:#5a6b60}
.nastaliq{font-family:'Noto Nastaliq Urdu','Noto Naskh Arabic',serif;line-height:2}
@media (max-width:640px){.form-control,.form-select{font-size:16px}.stat-num{font-size:1.25rem}}
/* Printed letters (circular / receipt): proper A4 sheet, full width, no app chrome. */
@page{size:A4;margin:14mm 16mm}
@media print{
  .sidebar,.topbar,.btn,.pagination,.no-print,.alert{display:none!important}
  body{background:#fff}
  .card{box-shadow:none;border:none!important;max-width:none!important;width:100%!important}
  .main{margin:0!important}
}

/* Circular letter: ONE Urdu font (Nastaliq) for the whole letter — org name,
   meta, level, subject, body, signature and issued-by alike. Latin bits
   (circular no., dates, English org name, buttons) keep the UI font. */
.circular-letter{font-family:'Noto Nastaliq Urdu','Noto Naskh Arabic',serif;line-height:2}
.circular-letter [dir="ltr"]{font-family:'Inter',system-ui,sans-serif}
.circular-letter .no-print{font-family:'Inter',system-ui,sans-serif}

/* Circular letter: lists + green letterhead name (matches the printed letter),
   and the rich-text editor on the circular form. */
.circular-letter .letter-org{color:var(--green);font-weight:700}
.circular-letter ul,.circular-letter ol{padding-right:1.4rem;margin:0 0 .6rem}
.circular-letter li{margin-bottom:.15rem}
.circular-letter h3{font-weight:700}
.circular-letter h4{font-weight:700}
.circ-editor{min-height:220px;overflow:auto}
.circ-editor.is-empty:before{content:attr(data-placeholder);color:#6c757d}
.circ-toolbar .btn.active{background:#08783E;color:#fff;border-color:#08783E}

/* VIP login page (login.php only) — deep green gradient, glow orbs, glass card. */
body.login-page{min-height:100vh;display:flex;align-items:center;justify-content:center;background:linear-gradient(160deg,#053d20 0%,#07552E 45%,#08783E 100%);position:relative;overflow-x:hidden}
body.login-page:before,body.login-page:after{content:"";position:fixed;border-radius:50%;filter:blur(70px);pointer-events:none}
body.login-page:before{width:420px;height:420px;background:var(--blue);opacity:.25;top:-140px;left:-120px}
body.login-page:after{width:380px;height:380px;background:#4ADE80;opacity:.22;bottom:-150px;right:-100px}
.login-wrap{position:relative;z-index:1;width:100%;max-width:430px;padding:24px 16px}
.login-card{background:rgba(255,255,255,.97);border:1px solid rgba(255,255,255,.65);border-radius:20px;box-shadow:0 24px 60px rgba(0,0,0,.35);padding:32px 28px 24px}
.login-logo{width:88px;height:88px;margin:0 auto 10px;border-radius:50%;background:linear-gradient(135deg,#0A9A4E,#07552E);padding:6px;box-shadow:0 10px 24px rgba(7,85,46,.4)}
.login-logo .brand-logo,.login-logo .brand-mark{width:100%!important;height:100%!important;border-radius:50%!important;margin:0!important}
.login-org{font-family:'Noto Nastaliq Urdu','Noto Naskh Arabic',serif;color:#07552E;line-height:2;font-size:1.25rem}
[dir="ltr"] .login-org{font-family:'Inter',system-ui,sans-serif;font-weight:700;line-height:1.4}
.login-sub{color:#5a6b60;font-size:.85rem}
.login-input{position:relative}
.login-input .form-control{padding-inline-start:42px;height:48px;border-radius:12px}
.login-input .form-control:focus{border-color:#08783E;box-shadow:0 0 0 .25rem rgba(8,120,62,.2)}
.login-input svg{position:absolute;top:50%;transform:translateY(-50%);inset-inline-start:13px;width:20px;height:20px;color:#08783E;pointer-events:none}
.login-btn{background:linear-gradient(135deg,#0A9A4E,#07552E);border:none;border-radius:12px;height:48px;font-weight:700;font-size:1rem;box-shadow:0 8px 20px rgba(7,85,46,.35);transition:transform .15s,box-shadow .15s}
.login-btn:hover,.login-btn:focus{background:linear-gradient(135deg,#0A9A4E,#07552E);transform:translateY(-1px);box-shadow:0 12px 26px rgba(7,85,46,.45)}
.login-foot{color:rgba(255,255,255,.9);font-size:.8rem}

/* Logged-in user chip in the topbar (header.php) — avatar + name, all screens. */
.top-user{padding:2px 10px 2px 2px;border:1px solid #d8e5dc;border-radius:999px;background:#fff;flex-shrink:0}
.top-user:hover{background:#EAF5EE}
.top-avatar{width:32px;height:32px;border-radius:50%;background:linear-gradient(135deg,#0A9A4E,#07552E);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:.8rem;flex-shrink:0}
/* Login version line under the Powered-by footer. */
.login-ver{color:rgba(255,255,255,.65);font-size:.72rem}

/* Icon-only action buttons (individuals list) — soft tint, prominent. */
.act-btn{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;padding:0;border:1px solid transparent;border-radius:9px;text-decoration:none;cursor:pointer;vertical-align:middle}
.act-btn svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.act-view{background:#E8F0FE;color:#0B5ED7}
.act-view:hover{background:#D2E3FC;color:#084298}
.act-edit{background:#EAF5EE;color:#08783E}
.act-edit:hover{background:#D5EBDD;color:#07552E}
.act-del{background:#FDECEA;color:#B91C1C}
.act-del:hover{background:#FADBD8;color:#8B1515}

/* Icon action buttons (v10): all list/grid action columns use icon-only .act-btn.
   Core: .act-view (blue eye), .act-edit (green pencil), .act-del (red trash).
   Extra variants for the actions that are not view/edit/delete. */
.act-void{background:#FEF3C7;color:#92400E}
.act-void:hover{background:#FDE68A;color:#78350F}
.act-doc{background:#E8F0FE;color:#0B5ED7}
.act-doc:hover{background:#D2E3FC;color:#084298}
.act-download{background:#E8F0FE;color:#0B5ED7}
.act-download:hover{background:#D2E3FC;color:#084298}
.act-confirm{background:#EAF5EE;color:#08783E}
.act-confirm:hover{background:#D5EBDD;color:#07552E}
.act-perm{background:#EDE9FE;color:#6D28D9}
.act-perm:hover{background:#DDD6FE;color:#5B21B6}
.act-assign{background:#EDE9FE;color:#6D28D9}
.act-assign:hover{background:#DDD6FE;color:#5B21B6}
.act-toggle{background:#FEF3C7;color:#92400E}
.act-toggle:hover{background:#FDE68A;color:#78350F}
.act-att{background:#EAF5EE;color:#08783E}
.act-att:hover{background:#D5EBDD;color:#07552E}
.act-cancel{background:#FDECEA;color:#B91C1C}
.act-cancel:hover{background:#FADBD8;color:#8B1515}
.act-progress{background:#E8F0FE;color:#0B5ED7}
.act-progress:hover{background:#D2E3FC;color:#084298}
