/* Admin layout must always scroll the document */
html,body{height:auto!important;min-height:100vh!important;overflow-x:hidden!important;overflow-y:visible!important}
.admin-layout,.admin-main{min-height:100vh!important}
.admin-content{overflow:visible!important;padding-bottom:48px!important}
.admin-sidebar{height:100vh!important;height:100dvh!important;max-height:100dvh;top:0!important;bottom:0!important;overflow:hidden}
.admin-sidebar .sidebar-nav{min-height:0;overflow-y:auto}
html{scrollbar-gutter:stable;overflow-y:scroll!important;overflow-anchor:none}
body{overflow-y:visible!important}
.az-finance-hub{display:flex;gap:6px;flex-wrap:wrap;margin:0 0 12px;padding:8px;background:#f8fafc;border:1px solid #eef2f7;border-radius:12px;align-items:center}
.az-finance-hub button{border:1px solid #e2e8f0;background:#fff;color:#475569;border-radius:9px;padding:7px 12px;font:inherit;font-size:11.5px;font-weight:800;cursor:pointer;white-space:nowrap}
.az-finance-hub button:hover{background:#eef2ff;color:#4338ca;border-color:#c7d2fe}
.az-finance-hub button.active{background:linear-gradient(135deg,#4338ca,#7c3aed);color:#fff;border-color:#4338ca;box-shadow:0 6px 14px rgba(67,56,202,.22)}
.fa-wrap > .fa-optabs{display:none!important}
@media(max-width:700px){.az-finance-hub{overflow-x:auto;flex-wrap:nowrap;padding:7px}.az-finance-hub button{padding:6px 9px;font-size:10.5px}}
.sidebar-footer{flex-shrink:0}
.az-parent-picker{display:inline-flex;align-items:center;gap:6px;background:#eef2ff;border:1px solid #c7d2fe;border-radius:10px;padding:4px 8px;margin-inline-start:10px;font-size:11px;font-weight:800;color:#4338ca;max-width:260px}
.az-parent-picker select{border:0;background:#fff;border-radius:7px;padding:4px 6px;font:inherit;font-size:11px;font-weight:800;color:#1e293b;max-width:150px;outline:0}
.az-parent-picker i{font-size:11px}
@media(max-width:720px){.az-parent-picker{margin:0;max-width:180px}.az-parent-picker select{max-width:110px}}
@media(max-width:1024px){.admin-sidebar{height:100dvh!important}}
.admin-content section.admin-page{overflow:visible!important}
@media(max-width:900px){.admin-content{padding-bottom:90px!important}}

:root{
  --az-primary:#4f46e5;
  --az-primary-2:#7c3aed;
  --az-ink:#0f172a;
  --az-muted:#64748b;
  --az-border:#e8ecf4;
  --az-bg:#f1f5f9;
  --az-radius:18px;
  --az-radius-sm:12px;
  --az-shadow:0 8px 26px rgba(28,39,75,.06);
  --az-shadow-lg:0 20px 46px rgba(28,39,75,.14);
  --az-gradient:linear-gradient(135deg,#312e81,#4f46e5 55%,#7c3aed);
}
.admin-content{background:var(--az-bg)}
.admin-content .admin-page{padding-top:2px}
.admin-content .admin-page-header,
.admin-content .az-page-head{background:transparent}
.admin-content .admin-button{border-radius:11px;font-weight:900;transition:transform .16s ease,box-shadow .16s ease,background .16s ease}
.admin-content .admin-button.primary{background:var(--az-gradient);color:#fff;box-shadow:0 8px 20px rgba(79,70,229,.24)}
.admin-content .admin-button.primary:hover{transform:translateY(-1px);box-shadow:0 12px 26px rgba(79,70,229,.3)}
.admin-content .admin-button.secondary{background:#eef2ff;color:#4338ca;border:1px solid #e0e7ff}
.admin-content .admin-button.danger{background:#fef2f2;color:#b91c1c}
.admin-content input:not([type="checkbox"]):not([type="radio"]),
.admin-content select,
.admin-content textarea{border-radius:10px;border-color:var(--az-border);background:#f8fafc;transition:border-color .15s ease,box-shadow .15s ease}
.admin-content input:focus,
.admin-content select:focus,
.admin-content textarea:focus{outline:0;border-color:#a5b4fc;box-shadow:0 0 0 3px rgba(99,102,241,.14)}
.admin-content table{border-radius:14px;overflow:hidden}
.admin-content table thead th{background:#f8fafc;color:#64748b;font-weight:900}
.admin-content table tbody tr:hover{background:#fafbff}
.az-hero{position:relative;overflow:hidden;border-radius:22px;padding:22px;background:var(--az-gradient);color:#fff;display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;box-shadow:0 18px 42px rgba(79,70,229,.22);margin-bottom:14px}
.az-hero:after{content:'';position:absolute;width:240px;height:240px;border-radius:50%;background:rgba(255,255,255,.12);inset:auto -60px -120px auto}
.az-hero h1{margin:8px 0 4px;font-size:23px}
.az-hero p{margin:0;font-size:12px;color:#e0e7ff}
.az-kicker{font-size:10px;font-weight:900;background:rgba(255,255,255,.16);border-radius:999px;padding:4px 10px;display:inline-flex;gap:6px;align-items:center}
.az-card{background:#fff;border:1px solid var(--az-border);border-radius:var(--az-radius);padding:16px;box-shadow:var(--az-shadow);display:flex;flex-direction:column;gap:9px}
.az-card h3{margin:0;font-size:14px;display:flex;align-items:center;gap:8px;color:#1e293b}
.az-badge{display:inline-flex;align-items:center;gap:4px;font-size:9.5px;font-weight:900;border-radius:999px;padding:3px 9px;background:#eef2ff;color:#4338ca}
.az-badge.ok{background:#ecfdf5;color:#047857}
.az-badge.warn{background:#fff7ed;color:#c2410c}
.az-badge.off{background:#fef2f2;color:#b91c1c}
.az-btn{border:0;border-radius:10px;padding:9px 13px;font:inherit;font-size:11px;font-weight:900;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:6px}
.az-btn.primary{background:var(--az-gradient);color:#fff;box-shadow:0 6px 16px rgba(79,70,229,.25)}
.az-btn.secondary{background:#eef2ff;color:#4338ca}
.az-btn.danger{background:#fef2f2;color:#b91c1c}
.az-empty{text-align:center;border:1px dashed #cbd5e1;border-radius:14px;padding:22px;color:#94a3b8;font-size:11px}
.az-toast{position:fixed;bottom:20px;inset-inline-start:20px;z-index:90000;background:#0f172a;color:#fff;border-radius:12px;padding:11px 16px;font-size:12px;font-weight:800;box-shadow:0 14px 34px rgba(15,23,42,.3);display:none}
.az-toast.show{display:block;animation:azToastIn .2s ease}
@keyframes azToastIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.admin-content ::-webkit-scrollbar{width:9px;height:9px}
.admin-content ::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:999px}
.admin-content ::-webkit-scrollbar-thumb:hover{background:#94a3b8}
@media(max-width:700px){.az-hero{padding:17px}.az-hero h1{font-size:19px}}

/* Dynamic CRUD */
.az-crud-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:10px;margin-bottom:12px}
.az-crud-stat{background:#fff;border:1px solid var(--az-border);border-radius:14px;padding:12px;display:flex;align-items:center;gap:10px;box-shadow:var(--az-shadow)}
.az-crud-stat i{width:36px;height:36px;border-radius:11px;background:#eef2ff;color:#4338ca;display:grid;place-items:center}
.az-crud-stat b{display:block;font-size:18px;color:var(--az-ink)}.az-crud-stat span{font-size:10px;color:#94a3b8;font-weight:800}
.az-crud-toolbar{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:10px}
.az-crud-search{flex:1;min-width:220px;display:flex;align-items:center;gap:7px;background:#fff;border:1px solid var(--az-border);border-radius:11px;padding:0 11px;box-shadow:var(--az-shadow)}
.az-crud-search i{color:#94a3b8;font-size:12px}.az-crud-search input{flex:1;border:0!important;background:transparent!important;padding:10px 0!important;box-shadow:none!important}
.az-crud-card{background:#fff;border:1px solid var(--az-border);border-radius:18px;box-shadow:var(--az-shadow);overflow:hidden}
.az-crud-table{width:100%;border-collapse:collapse;font-size:11px}
.az-crud-table th{background:#f8fafc;color:#64748b;font-size:10px;text-align:start;padding:10px}
.az-crud-table td{padding:9px 10px;border-top:1px solid #f1f5f9;color:#334155}
.az-crud-table tbody tr:hover{background:#fafbff}
.az-crud-table-wrap{overflow:auto;max-height:62vh}
.az-crud-actions{display:flex;gap:5px}
.az-icon-btn{width:30px;height:30px;border:1px solid var(--az-border);background:#fff;border-radius:9px;color:#64748b;cursor:pointer;display:inline-grid;place-items:center;font-size:11px}
.az-icon-btn:hover{background:#f1f5f9;color:#334155}.az-icon-btn.danger:hover{background:#fef2f2;color:#dc2626;border-color:#fecaca}
.az-crud-pager{display:flex;justify-content:center;align-items:center;gap:10px;padding:10px;border-top:1px solid #f1f5f9;font-size:11px;font-weight:800;color:#64748b}
.az-modal{position:fixed;inset:0;z-index:70000;background:rgba(2,6,23,.65);display:flex;align-items:center;justify-content:center;padding:16px}
.az-modal-box{background:#fff;border-radius:16px;width:min(620px,96vw);max-height:92vh;overflow:auto;box-shadow:var(--az-shadow-lg)}
.az-modal-head{display:flex;justify-content:space-between;align-items:center;padding:12px 15px;border-bottom:1px solid #f1f5f9;position:sticky;top:0;background:#fff;z-index:2}
.az-modal-body{padding:14px 15px;display:flex;flex-direction:column;gap:10px}
.az-modal-foot{display:flex;justify-content:flex-end;gap:8px;padding:12px 15px;border-top:1px solid #f1f5f9;position:sticky;bottom:0;background:#fff}
.az-form-field{display:flex;flex-direction:column;gap:5px;font-size:11px;font-weight:800;color:#475569}
.az-form-field input,.az-form-field select,.az-form-field textarea{border:1px solid var(--az-border);border-radius:9px;padding:9px 10px;font:inherit;font-size:11px;background:#f8fafc;width:100%}
.az-form-error{color:#dc2626;font-size:11px;font-weight:800}
.az-lang-tabs{display:flex;gap:5px;flex-wrap:wrap;background:#f8fafc;border:1px solid var(--az-border);border-radius:12px;padding:5px;margin-bottom:4px}
.az-lang-tab{border:0;background:transparent;color:#475569;border-radius:8px;padding:7px 12px;font:inherit;font-size:11px;font-weight:900;cursor:pointer}
.az-lang-tab:hover{background:#eef2ff;color:#4338ca}
.az-lang-tab.on{background:linear-gradient(135deg,#4f46e5,#7c3aed);color:#fff;box-shadow:0 6px 14px rgba(79,70,229,.25)}
@media(max-width:700px){.az-crud-table{font-size:10px}.az-crud-table th,.az-crud-table td{padding:7px}}

/* Unified module headers */
.admin-content section.admin-page > .admin-page-header{
  background:var(--az-gradient);
  border:0;
  border-radius:22px;
  padding:20px 22px;
  margin-bottom:14px;
  color:#fff;
  box-shadow:0 18px 42px rgba(79,70,229,.2);
  position:relative;
  overflow:hidden;
  z-index:1;
}
.admin-content section.admin-page > .admin-page-header:after{
  content:'';
  position:absolute;
  width:220px;height:220px;border-radius:50%;
  background:rgba(255,255,255,.1);
  inset:auto -60px -120px auto;
  pointer-events:none;
}
.admin-content section.admin-page > .admin-page-header h1,
.admin-content section.admin-page > .admin-page-header h2{color:#fff;position:relative;z-index:1}
.admin-content section.admin-page > .admin-page-header p,
.admin-content section.admin-page > .admin-page-header .cls-sub,
.admin-content section.admin-page > .admin-page-header small{color:#e0e7ff !important;position:relative;z-index:1}
.admin-content section.admin-page > .admin-page-header .admin-button.secondary,
.admin-content section.admin-page > .admin-page-header .admin-button.ghost{background:rgba(255,255,255,.16) !important;color:#fff !important;border-color:rgba(255,255,255,.28) !important}
.admin-content section.admin-page > .admin-page-header .admin-button.primary{background:#fff !important;color:#4338ca !important}
.swal2-container{z-index:400000!important}
.az-swal-top{z-index:400001!important}
.spay-pay-btn{transition:.15s}.spay-pay-btn:hover{filter:brightness(1.08)}
.spay-table td .spay-pay-btn{display:inline-flex}
.lib-head,.inv-head,.tr-head,.pm-head,.st-head,.sv-head,.br-head,.crm-head,.rb-head,.cc-head,.oex-head,.lv-head{position:relative;overflow:hidden;border-radius:22px;padding:22px;margin-bottom:16px;background:linear-gradient(135deg,#312e81,#4f46e5 55%,#7c3aed);color:#fff;display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;box-shadow:0 14px 34px rgba(49,46,129,.22)}
.lib-head:after,.inv-head:after,.tr-head:after,.pm-head:after,.st-head:after,.sv-head:after,.br-head:after,.crm-head:after,.rb-head:after,.cc-head:after,.oex-head:after,.lv-head:after{content:'';position:absolute;width:240px;height:240px;border-radius:50%;background:rgba(255,255,255,.12);inset:auto -60px -120px auto;pointer-events:none}
.lib-head h1,.inv-head h1,.tr-head h1,.pm-head h1,.st-head h1,.sv-head h1,.br-head h1,.crm-head h1,.rb-head h1,.cc-head h1,.oex-head h1,.lv-head h1{margin:0 0 5px!important;font-size:22px!important;font-weight:900!important;color:#fff!important;letter-spacing:-.2px}
.lib-head h1 i,.inv-head h1 i,.tr-head h1 i,.pm-head h1 i,.st-head h1 i,.sv-head h1 i,.br-head h1 i,.crm-head h1 i,.rb-head h1 i,.cc-head h1 i,.oex-head h1 i,.lv-head h1 i{color:#fff!important}
.lib-head p,.inv-head p,.tr-head p,.pm-head p,.st-head p,.sv-head p,.br-head p,.crm-head p,.rb-head p,.cc-head p,.oex-head p,.lv-head p{margin:0!important;font-size:12px!important;color:#dbeafe!important}
.lib-head button,.inv-head button,.tr-head button,.pm-head button,.st-head button,.sv-head button,.br-head button,.crm-head button,.rb-head button,.cc-head button,.oex-head button,.lv-head button{box-shadow:none}
.az-hero-kicker{display:inline-flex;align-items:center;gap:6px;font-size:10px;font-weight:900;color:#f8fafc;background:rgba(255,255,255,.18);border:1px solid rgba(255,255,255,.22);border-radius:999px;padding:4px 11px;margin-bottom:7px;position:relative;z-index:1}
.az-hero-kicker:before{content:'◆';font-family:inherit;font-weight:900;font-size:8px;opacity:.85}
.lib-head .lib-btn.secondary,.inv-head .inv-btn.secondary,.tr-head .tr-btn.secondary,.pm-head .pm-btn.secondary,.st-head .st-btn.secondary,.sv-head .sv-btn.secondary,.crm-head .crm-btn.secondary,.rb-head .rb-btn.secondary,.cc-head .cc-btn.secondary,.oex-head .oex-btn.secondary,.lv-head .lv-btn.secondary,.br-head .br-btn.secondary,.lib-head .lib-btn.secondary i,.inv-head .inv-btn.secondary i,.tr-head .tr-btn.secondary i,.pm-head .pm-btn.secondary i,.st-head .st-btn.secondary i,.sv-head .sv-btn.secondary i,.crm-head .crm-btn.secondary i,.rb-head .rb-btn.secondary i,.cc-head .cc-btn.secondary i,.oex-head .oex-btn.secondary i,.lv-head .lv-btn.secondary i,.br-head .br-btn.secondary i{background:#fff!important;color:#3730a3!important;border-color:#fff!important}
.lib-head .lib-btn.primary,.inv-head .inv-btn.primary,.tr-head .tr-btn.primary,.pm-head .pm-btn.primary,.st-head .st-btn.primary,.sv-head .sv-btn.primary,.br-head .br-btn.primary,.crm-head .crm-btn.primary,.rb-head .rb-btn.primary,.cc-head .cc-btn.primary,.oex-head .oex-btn.primary,.lv-head .lv-btn.primary{background:#fff!important;color:#3730a3!important;border-color:#fff!important}
@media(max-width:640px){.lib-head,.inv-head,.tr-head,.pm-head,.st-head,.sv-head,.br-head,.crm-head,.rb-head,.cc-head,.oex-head,.lv-head{padding:17px;border-radius:18px}.lib-head h1,.inv-head h1,.tr-head h1,.pm-head h1,.st-head h1,.sv-head h1,.br-head h1,.crm-head h1,.rb-head h1,.cc-head h1,.oex-head h1,.lv-head h1{font-size:18px}}

