@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&display=swap');

:root{
    --blue:#0F2742;
    --blue-dark:#081A2E;
    --blue-soft:#FBF7EF;
    --green:#C8A45C;
    --green-dark:#A88333;
    --bg:#F7F4EE;
    --card:#ffffff;
    --text:#1B2A3A;
    --muted:#7A7E86;
    --border:#E5D9C8;
    --shadow:0 16px 34px rgba(10,71,132,.11);
    --radius:18px;
    --sidebar:292px;
}
*{box-sizing:border-box}
body{font-family:'Cairo',Tahoma,sans-serif;background:var(--bg);color:var(--text);margin:0;font-size:15px}
a{text-decoration:none}
.app-shell{display:flex;min-height:100vh}
.sidebar{width:var(--sidebar);background:linear-gradient(180deg,var(--blue-dark),var(--blue) 62%,var(--green));color:#fff;position:fixed;right:0;top:0;height:100vh;overflow:auto;z-index:1000;box-shadow:-10px 0 30px rgba(0,0,0,.13)}
.brand{display:flex;gap:12px;align-items:center;padding:22px;border-bottom:1px solid rgba(255,255,255,.14)}
.brand img{width:74px;height:56px;object-fit:contain;background:#fff;border-radius:16px;padding:6px}
.brand strong{display:block;font-size:15px;font-weight:800;line-height:1.5}
.brand span{font-size:12px;opacity:.85}
.nav-list{padding:14px 12px 26px}
.nav-title{font-size:11px;color:rgba(255,255,255,.64);font-weight:800;margin:18px 10px 8px}
.nav-list a{display:flex;align-items:center;gap:12px;color:rgba(255,255,255,.9);padding:12px 14px;margin:4px 0;border-radius:14px;transition:.18s;border-right:4px solid transparent}
.nav-list a:hover,.nav-list a.active{background:rgba(255,255,255,.16);color:#fff;border-right-color:#D8B774}
.nav-list i{width:23px;text-align:center}
.main{margin-right:var(--sidebar);width:calc(100% - var(--sidebar))}
.topbar{height:72px;background:rgba(255,255,255,.95);border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;padding:0 26px;position:sticky;top:0;z-index:900;backdrop-filter:blur(8px)}
.menu-toggle{display:none;border:0;background:transparent;font-size:22px;color:var(--blue)}
.page-subtitle{color:var(--muted);font-weight:700}
.userbox{display:flex;align-items:center;gap:10px;font-weight:700}
.content{padding:26px}
.page-head{display:flex;justify-content:space-between;gap:16px;align-items:center;margin-bottom:20px}
.page-head h1{font-size:26px;font-weight:800;margin:0;color:#0F2742}
.page-head .text-muted{font-size:13px}
.cardx{background:var(--card);border:1px solid rgba(13,93,184,.08);border-radius:var(--radius);box-shadow:var(--shadow)}
.cardx .card-body{padding:22px}
.btn{border-radius:13px;font-weight:700}
.btn-primary{background:linear-gradient(135deg,var(--blue),var(--green));border:0}
.btn-primary:hover{background:linear-gradient(135deg,var(--blue-dark),var(--green-dark))}
.btn-outline-primary{border-color:var(--blue);color:var(--blue)}
.btn-outline-primary:hover{background:var(--blue);color:#fff}
.form-label{font-weight:700;color:#1F3550}
.form-control,.form-select{border-radius:13px;border-color:var(--border);padding:.74rem .9rem}
.form-control:focus,.form-select:focus{border-color:var(--blue);box-shadow:0 0 0 .2rem rgba(13,93,184,.12)}
.table{vertical-align:middle}
.table thead th{color:#6A5C45;background:#FCFAF5;border-bottom:1px solid var(--border);font-weight:800}
.badge{border-radius:999px;padding:.48rem .72rem}
.stat{position:relative;overflow:hidden}
.stat:before{content:"";position:absolute;width:130px;height:130px;border-radius:50%;background:linear-gradient(135deg,rgba(19,162,74,.16),rgba(13,93,184,.12));left:-35px;top:-35px}
.stat .icon{width:52px;height:52px;border-radius:16px;background:linear-gradient(135deg,var(--blue),var(--green));color:#fff;display:flex;align-items:center;justify-content:center;font-size:22px}
.stat .num{font-size:24px;font-weight:800;margin-top:10px}
.stat .label{color:var(--muted);font-weight:700}
.metrics-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
.metric-box{background:#fff;border:1px solid var(--border);border-radius:18px;padding:18px;box-shadow:var(--shadow)}
.metric-label{color:var(--muted);font-weight:700}
.metric-value{font-size:24px;font-weight:800;margin-top:8px}
.subnav-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
.subnav-card{display:block;background:#fff;border:1px solid var(--border);border-radius:18px;padding:18px;box-shadow:var(--shadow);color:var(--text)}
.subnav-card strong{display:block;margin-bottom:6px}
.subnav-card span{font-size:13px;color:var(--muted)}
.quick-links{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;margin-top:20px}
.quick-link{display:flex;align-items:center;justify-content:center;gap:10px;min-height:58px;border-radius:14px;font-weight:800;border:2px solid var(--border);background:#fff;color:var(--text);transition:.2s}
.quick-link.active{color:#fff;border-color:transparent;background:linear-gradient(135deg,var(--blue),var(--green))}
.quick-link.link-cyan{border-color:#E1C889;color:#A88333}
.quick-link.link-amber{border-color:#E1C889;color:#A88333}
.quick-link.link-gray{border-color:#D7D0C3;color:#7A7E86}
.search-hero{padding:0;overflow:hidden}
.search-hero-head{padding:18px 24px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between}
.search-hero-body{padding:28px 24px}
.big-search-label{font-weight:700;color:var(--blue-dark);margin-bottom:10px}
.big-search-wrap{display:grid;grid-template-columns:1fr 200px;gap:16px;align-items:center}
.big-search-input{position:relative}
.big-search-input .form-control{padding-right:46px;height:50px}
.big-search-input i{position:absolute;right:15px;top:50%;transform:translateY(-50%);color:#B39A67}
.section-mini-title{font-size:13px;color:#8A6B37;font-weight:700;margin:18px 0 10px}
.table-actions{display:flex;gap:8px;flex-wrap:wrap}
.permission-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.permission-box{border:1px solid var(--border);background:#FCFAF5;border-radius:14px;padding:10px}
.login-page{min-height:100vh;background:radial-gradient(circle at top right,rgba(19,162,74,.30),transparent 32%),linear-gradient(135deg,var(--blue-dark),var(--blue));display:flex;align-items:center;justify-content:center;padding:20px}
.login-card{width:100%;max-width:475px;background:#fff;border-radius:26px;overflow:hidden;box-shadow:0 32px 70px rgba(0,0,0,.28)}
.login-top{background:linear-gradient(135deg,var(--blue),var(--green));color:#fff;text-align:center;padding:34px}
.login-top img{width:185px;background:#fff;border-radius:18px;padding:10px;margin-bottom:16px}
.login-body{padding:34px}
.receipt{max-width:780px;margin:auto;background:#fff;border-radius:22px;box-shadow:var(--shadow);padding:30px}
.receipt-logo{height:78px;object-fit:contain}
.receipt-title{border:2px solid var(--blue);color:var(--blue);border-radius:16px;padding:12px;text-align:center;font-weight:800;margin:18px 0}
@media(max-width:900px){
    .sidebar{transform:translateX(100%);transition:.25s}
    body.sidebar-open .sidebar{transform:translateX(0)}
    .main{margin-right:0;width:100%}
    .menu-toggle{display:inline-block}
    .content{padding:16px}
    .quick-links,.subnav-grid,.metrics-grid,.permission-grid{grid-template-columns:1fr}
    .big-search-wrap{grid-template-columns:1fr}
}
@media print{
    .sidebar,.topbar,.no-print{display:none!important}
    .main{margin:0;width:100%}
    .content{padding:0}
    body{background:#fff}
    .receipt{box-shadow:none;border:0;border-radius:0}
}


.print-action-left{
    margin-right:auto;
    display:flex;
    justify-content:flex-start;
    gap:8px;
}
.password-field{
    position:relative;
}
.password-field .form-control{
    padding-left:48px;
}
.toggle-password{
    position:absolute;
    left:10px;
    top:50%;
    transform:translateY(-50%);
    border:0;
    background:transparent;
    color:#0F2742;
    width:36px;
    height:36px;
    border-radius:10px;
}
.toggle-password:hover{
    background:#FBF7EF;
}
.login-options{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:10px;
    margin-bottom:18px;
}
.favicon-note{display:none}
@media print{
    .print-action-left{display:none!important}
}

/* Manarat Al-Asima private identity */
:root{
    --blue:#0f2f4d;
    --blue-dark:#071d32;
    --blue-soft:#eef3f7;
    --green:#b9964f;
    --green-dark:#8d7138;
    --gold:#c5a25c;
    --bg:#f6f1e6;
    --card:#ffffff;
    --text:#102a43;
    --muted:#7f7566;
    --border:#dfd2b2;
    --shadow:0 16px 34px rgba(15,47,77,.12);
}
.sidebar{background:linear-gradient(180deg,#071d32 0%,#0f2f4d 68%,#8d7138 100%)}
.nav-list a:hover,.nav-list a.active{border-right-color:var(--gold);background:rgba(197,162,92,.20)}
.brand img,.login-top img{background:#fffaf0;border:1px solid rgba(197,162,92,.45)}
.btn-primary,.quick-link.active,.stat .icon,.login-top{background:linear-gradient(135deg,#0f2f4d,#c5a25c)!important}
.btn-primary:hover{background:linear-gradient(135deg,#071d32,#8d7138)!important}
.receipt-title{border-color:#c5a25c;color:#0f2f4d;background:#fffaf0}
.table thead th{background:#fffaf0;color:#0f2f4d;border-bottom:2px solid #c5a25c}
.page-head{position:relative;overflow:hidden}
.page-head::after{content:"";position:absolute;left:22px;top:50%;transform:translateY(-50%);width:120px;height:120px;background:url('../img/title-ornament.png') center/contain no-repeat;opacity:.80;pointer-events:none}
@media print{.receipt::before{content:"";position:fixed;inset:0;background:url('../img/manarat-logo.png') center/420px no-repeat;opacity:.035;z-index:-1}}


/* زخرفة شريط عناوين الصفحات بدلاً من الشعار */
.page-head{position:relative;overflow:hidden;padding-left:245px!important;}
.page-head::after{
    content:"";
    position:absolute;
    left:18px;
    top:50%;
    transform:translateY(-50%);
    width:208px;
    height:150%;
    background:url('../img/title-ornament.png') center/contain no-repeat!important;
    opacity:.85!important;
    pointer-events:none;
    z-index:0;
}
.page-head > *{position:relative;z-index:1;}
.topbar{position:sticky;overflow:hidden;}
.topbar::before{
    content:"";
    position:absolute;
    left:18px;
    top:50%;
    transform:translateY(-50%);
    width:72px;
    height:96px;
    background:url('../img/title-ornament.png') center/contain no-repeat;
    opacity:.22;
    pointer-events:none;
}
@media(max-width:768px){
    .page-head{padding-left:24px!important;padding-top:92px!important;}
    .page-head::after{left:50%;top:8px;transform:translateX(-50%);width:140px;height:110px;opacity:.78!important;}
    .topbar::before{display:none;}
}
@media print{.page-head::after,.topbar::before{display:none!important;}}

/* إزالة زخرفة شريط العناوين من النظام */
.page-head{padding-left:0!important;padding-top:0!important;}
.page-head::after,.topbar::before{content:none!important;display:none!important;background:none!important;opacity:0!important;width:0!important;height:0!important;}
@media(max-width:768px){
    .page-head{padding-left:0!important;padding-top:0!important;}
}

/* إعادة حجم شريط عناوين الصفحات كما كان بدون زخرفة */
.page-head{
    padding:28px 32px!important;
    min-height:auto!important;
}
.page-head::after,
.topbar::before{
    content:none!important;
    display:none!important;
    background:none!important;
}
@media(max-width:768px){
    .page-head{
        padding:22px 18px!important;
        padding-top:22px!important;
        padding-left:18px!important;
    }
}


/* تصغير مربع تسجيل الدخول */
.login-card{
    max-width:390px!important;
    border-radius:20px!important;
}
.login-top{
    padding:20px 24px!important;
}
.login-top img{
    width:130px!important;
    padding:7px!important;
    margin-bottom:10px!important;
    border-radius:14px!important;
}
.login-top h3{
    font-size:1.18rem!important;
    margin-bottom:5px!important;
}
.login-top p{
    font-size:.82rem!important;
    margin-bottom:0!important;
    line-height:1.6!important;
}
.login-body{
    padding:22px 26px!important;
}
.login-body .mb-3{
    margin-bottom:.75rem!important;
}
.login-body .form-control{
    padding:.58rem .75rem!important;
    min-height:40px!important;
}
.login-body .form-label{
    font-size:.9rem!important;
    margin-bottom:.35rem!important;
}
.login-options{
    margin-bottom:12px!important;
    font-size:.88rem!important;
}
@media(max-width:480px){
    .login-page{padding:14px!important;}
    .login-card{max-width:94vw!important;}
}


/* تصغير إضافي لمربع حقول تسجيل الدخول */
.login-card{
    max-width:340px!important;
    border-radius:16px!important;
}
.login-top{
    padding:14px 18px!important;
}
.login-top img{
    width:95px!important;
    padding:5px!important;
    margin-bottom:7px!important;
    border-radius:11px!important;
}
.login-top h3{
    font-size:1rem!important;
    margin-bottom:3px!important;
    line-height:1.35!important;
}
.login-top p{
    font-size:.72rem!important;
    line-height:1.45!important;
}
.login-body{
    padding:16px 20px!important;
}
.login-body .mb-3{
    margin-bottom:.55rem!important;
}
.login-body .form-label{
    font-size:.78rem!important;
    margin-bottom:.22rem!important;
}
.login-body .form-control{
    padding:.42rem .62rem!important;
    min-height:34px!important;
    font-size:.84rem!important;
    border-radius:10px!important;
}
.login-body .btn{
    padding:.45rem .75rem!important;
    font-size:.88rem!important;
    border-radius:10px!important;
}
.login-options{
    margin-bottom:8px!important;
    font-size:.78rem!important;
}
.toggle-password{
    width:30px!important;
    height:30px!important;
    left:6px!important;
}
.password-field .form-control{
    padding-left:40px!important;
}
@media(max-width:480px){
    .login-card{max-width:88vw!important;}
}


/* تصغير إضافي نهائي لمربع تسجيل الدخول */
.login-card{
    max-width:310px!important;
    border-radius:14px!important;
}
.login-top{
    padding:12px 15px!important;
}
.login-top img{
    width:82px!important;
    padding:4px!important;
    margin-bottom:6px!important;
    border-radius:10px!important;
}
.login-top h3{
    font-size:.92rem!important;
    margin-bottom:2px!important;
}
.login-top p{
    font-size:.66rem!important;
    line-height:1.35!important;
}
.login-body{
    padding:14px 16px!important;
}
.login-body .mb-3{margin-bottom:.45rem!important;}
.login-body .form-label{
    font-size:.74rem!important;
    margin-bottom:.18rem!important;
}
.login-body .form-control{
    min-height:31px!important;
    font-size:.8rem!important;
    padding:.36rem .56rem!important;
    border-radius:9px!important;
}
.login-body .btn{
    min-height:34px!important;
    font-size:.82rem!important;
    padding:.4rem .7rem!important;
}
.login-options{
    margin-bottom:6px!important;
    font-size:.74rem!important;
}
.toggle-password{
    width:28px!important;
    height:28px!important;
}
.password-field .form-control{
    padding-left:36px!important;
}
@media(max-width:480px){
    .login-card{max-width:84vw!important;}
}

/* ضبط شاشة الدخول لتظهر كاملة تلقائياً بدون قص */
.login-page{
    min-height:100vh!important;
    min-height:100svh!important;
    padding:8px!important;
    align-items:center!important;
    overflow:auto!important;
}
.login-card{
    max-width:285px!important;
    width:100%!important;
    border-radius:13px!important;
    max-height:calc(100svh - 16px)!important;
    overflow:hidden!important;
}
.login-top{
    padding:9px 13px!important;
}
.login-top img{
    width:72px!important;
    max-height:72px!important;
    padding:3px!important;
    margin-bottom:4px!important;
    border-radius:9px!important;
}
.login-top h3{
    font-size:.86rem!important;
    line-height:1.25!important;
    margin:0 0 1px!important;
}
.login-top p{
    font-size:.62rem!important;
    line-height:1.25!important;
    margin:0!important;
}
.login-body{
    padding:11px 14px!important;
}
.login-body .mb-3{
    margin-bottom:.34rem!important;
}
.login-body .form-label{
    font-size:.7rem!important;
    line-height:1.2!important;
    margin-bottom:.14rem!important;
}
.login-body .form-control{
    min-height:28px!important;
    height:28px!important;
    padding:.28rem .5rem!important;
    font-size:.76rem!important;
    border-radius:8px!important;
}
.login-body .btn{
    min-height:31px!important;
    height:31px!important;
    padding:.32rem .65rem!important;
    font-size:.78rem!important;
    border-radius:8px!important;
}
.login-options{
    margin-bottom:5px!important;
    font-size:.7rem!important;
    line-height:1.2!important;
}
.toggle-password{
    width:25px!important;
    height:25px!important;
    left:5px!important;
    font-size:.72rem!important;
}
.password-field .form-control{
    padding-left:32px!important;
}
.login-body .alert{
    padding:5px 8px!important;
    margin-bottom:6px!important;
    font-size:.72rem!important;
}
@media(max-height:620px){
    .login-page{align-items:flex-start!important;padding-top:6px!important;}
    .login-card{max-width:270px!important;}
    .login-top{padding:7px 12px!important;}
    .login-top img{width:62px!important;max-height:62px!important;margin-bottom:3px!important;}
    .login-body{padding:9px 12px!important;}
    .login-body .form-control{height:26px!important;min-height:26px!important;}
    .login-body .btn{height:29px!important;min-height:29px!important;}
}
@media(max-width:480px){
    .login-card{max-width:88vw!important;}
}


/* Login final forced compact fit */
body.login-page{height:auto!important;min-height:100vh!important;padding:6px!important;align-items:center!important;justify-content:center!important;overflow:auto!important;}
.login-card{width:280px!important;max-width:calc(100vw - 18px)!important;border-radius:12px!important;}
.login-top{padding:8px 12px!important;}
.login-top img{width:60px!important;max-height:60px!important;padding:3px!important;margin-bottom:4px!important;}
.login-top h3{font-size:.82rem!important;line-height:1.2!important;margin:0 0 1px!important;}
.login-top p{font-size:.58rem!important;line-height:1.2!important;margin:0!important;}
.login-body{padding:9px 12px 10px!important;}
.login-body .mb-3{margin-bottom:.28rem!important;}
.login-body .form-label{font-size:.66rem!important;line-height:1.1!important;margin-bottom:.1rem!important;}
.login-body .form-control{height:25px!important;min-height:25px!important;padding:.2rem .42rem!important;font-size:.72rem!important;border-radius:7px!important;}
.login-options{margin:2px 0 5px!important;font-size:.66rem!important;line-height:1.1!important;}
.login-body .btn{height:28px!important;min-height:28px!important;padding:.22rem .55rem!important;font-size:.74rem!important;border-radius:7px!important;line-height:1.1!important;}
.toggle-password{width:22px!important;height:22px!important;left:4px!important;font-size:.62rem!important;}
.password-field .form-control{padding-left:28px!important;}
@media(max-height:520px){body.login-page{align-items:flex-start!important;padding-top:3px!important}.login-card{width:260px!important}.login-top{padding:5px 10px!important}.login-top img{width:48px!important;max-height:48px!important;margin-bottom:2px!important}.login-body{padding:7px 10px!important}.login-body .form-control{height:23px!important;min-height:23px!important}.login-body .btn{height:26px!important;min-height:26px!important}}
