*{
margin:0;
padding:0;
box-sizing:border-box;
font-family:Arial;
}

body{
background:#f1f5f9;
overflow-x:hidden;
}

.layout{
display:flex;
min-height:100vh;
}

.sidebar{
width:260px;
background:white;
padding:20px;
border-right:1px solid #ddd;
display:flex;
flex-direction:column;
gap:15px;
}

.logo{
font-size:38px;
color:#2563eb;
margin-bottom:20px;
}

.sidebar button{
padding:18px;
border:none;
border-radius:14px;
background:#e2e8f0;
cursor:pointer;
font-size:20px;
font-weight:bold;
text-align:left;
}

.sidebar button:hover{
background:#2563eb;
color:white;
}

.main-content{
flex:1;
padding:30px;
overflow:hidden;
position: relative; /* لضمان ثبات الهيدر المطلق فوق الصفحات */
padding-top: 110px; /* حجز مساحة علوية لمنع تداخل كروت الصفحات */
}

.sidebar-btn.active{
    background:#2563eb;
    color:white;
}

.login-page{
display:flex;
justify-content:center;
align-items:center;
height:100vh;
background:#f1f5f9;
}

.login-card{
width:420px;
background:white;
padding:40px;
border-radius:24px;
box-shadow:0 5px 20px rgba(0,0,0,0.08);
display:flex;
flex-direction:column;
gap:18px;
}

.login-title{
font-size:42px;
color:#2563eb;
margin:0;
text-align:center;
}

.login-subtitle{
text-align:center;
color:#64748b;
margin-bottom:10px;
}

.login-card input{
padding:16px;
border:1px solid #dbe1ea;
border-radius:14px;
font-size:16px;
outline:none;
}

.login-card button{
background:#2563eb;
color:white;
border:none;
padding:16px;
border-radius:14px;
font-size:16px;
font-weight:bold;
cursor:pointer;
}

/* ACCOUNTS */
.accounts-page{
padding:30px;
}

.accounts-header{
display:flex;
justify-content:space-between;
align-items:center;
margin-bottom:25px;
}

.accounts-title{
font-size:34px;
font-weight:700;
color:#2563eb;
margin:0;
}

.add-user-btn{
background:#2563eb;
color:white;
border:none;
padding:14px 20px;
border-radius:14px;
font-weight:600;
cursor:pointer;
}

.accounts-card{
background:white;
padding:25px;
border-radius:24px;
box-shadow:0 4px 15px rgba(0,0,0,0.05);
}

.accounts-table{
width:100%;
border-collapse:collapse;
}

.accounts-table th{
text-align:left;
padding:16px;
font-size:14px;
color:#64748b;
border-bottom:1px solid #e2e8f0;
}

.accounts-table td{
padding:18px 16px;
border-bottom:1px solid #f1f5f9;
font-size:15px;
}

.user-role{
background:#eff6ff;
color:#2563eb;
padding:6px 12px;
border-radius:999px;
font-size:13px;
font-weight:600;
display:inline-block;
}

.user-status{
background:#dcfce7;
color:#166534;
padding:6px 12px;
border-radius:999px;
font-size:13px;
font-weight:600;
display:inline-block;
}

.table-actions{
display:flex;
gap:10px;
}

.edit-user-btn{
background:#0f172a;
color:white;
border:none;
padding:10px 14px;
border-radius:10px;
cursor:pointer;
}

.delete-user-btn{
background:#ef4444;
color:white;
border:none;
padding:10px 14px;
border-radius:10px;
cursor:pointer;
}

/* 🌟 TOP BRAND BAR - البار العلوي الموحد والمعدل بشكل جذري منعا للتداخل */
.top-brand-bar {
    position: absolute !important;
    top: 30px !important;
    left: 30px !important;
    right: 30px !important;
    height: 60px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important; /* اسم النظام يسار وزر طلال يمين */
    box-sizing: border-box !important;
    z-index: 1000 !important;
}

/* اسم البرنامج (أقصى اليسار) */
#topSystemName {
    font-size: 36px !important;
    font-weight: 800 !important;
    color: #111827 !important;
    margin: 0 !important;
    line-height: 1 !important;
}

/* حاوية القائمة المنسدلة للمستخدم */
.user-dropdown {
    position: relative !important;
}

/* التنسيق المعدل للزر ليبقى ثابتا في أقصى اليمين باللون الأزرق المعتمد لديك */
.user-btn {
    background: #2563eb !important;
    color: white !important;
    border: none !important;
    padding: 14px 24px !important;
    border-radius: 14px !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    cursor: pointer !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2) !important;
    white-space: nowrap !important;
}

.user-btn:hover {
    background: #1d4ed8 !important;
}

.user-menu {
    position: absolute !important;
    top: 55px !important;
    right: 0 !important;
    background: white !important;
    width: 220px !important;
    border-radius: 18px !important;
    padding: 10px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12) !important;
    z-index: 9999 !important;
}

.user-menu.hidden {
    display: none !important;
}

.user-menu-role {
    padding: 14px;
    font-size: 14px;
    font-weight: 700;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 10px;
}

.user-menu button {
    width: 100%;
    border: none;
    background:#f8fafc;
    padding:14px;
    margin-bottom:8px;
    border-radius:12px;
    cursor:pointer;
    font-size:14px;
    text-align:left;
}

.user-menu button:hover {
    background:#eff6ff;
}

/* SIDEBAR LOGO - سنترة اللوغو في القائمة الجانبية بالكامل */
.sidebar-logo-wrapper {
    width: 100% !important;
    height: 140px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 10px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

#sidebarLogo {
    height: auto !important;
    max-height: 100% !important;
    object-fit: contain !important;
    display: block !important;
    transition: width 0.1s ease !important;
}

/* MODAL */
.modal{
position:fixed;
top:0;
left:0;
width:100%;
height:100%;
background:rgba(15,23,42,0.45);
display:flex;
align-items:center;
justify-content:center;
z-index:9999;
}

.modal.hidden{
display:none;
}

.modal-content{
background:white;
width:420px;
padding:30px;
border-radius:24px;
box-shadow:0 20px 60px rgba(0,0,0,0.18);
display:flex;
flex-direction:column;
gap:16px;
}

.modal-header{
display:flex;
justify-content:space-between;
align-items:center;
margin-bottom:10px;
}

.close-modal-btn{
border:none;
background:#f1f5f9;
width:38px;
height:38px;
border-radius:10px;
cursor:pointer;
font-size:18px;
}

.modal-content input,
.modal-content select,
.dropdown-toggle{
width:100%;
height:56px;
padding:0 18px;
border-radius:18px;
border:1px solid #dbe1ea;
font-size:16px;
outline:none;
background:white;
}

.save-user-btn{
background:#2563eb;
color:white;
border:none;
padding:14px;
border-radius:14px;
font-size:15px;
font-weight:600;
cursor:pointer;
}

/* PERMISSIONS */
.permissions-box{
background:#f8fafc;
padding:16px;
border-radius:16px;
display:flex;
flex-direction:column;
gap:12px;
}

.permissions-box label{
display:flex;
align-items:center;
gap:10px;
font-size:14px;
cursor:pointer;
}

.permissions-box input{
width:18px;
height:18px;
}

#toastContainer{
position:fixed;
top:20px;
right:20px;
z-index:999999;
display:flex;
flex-direction:column;
gap:12px;
}

.toast{
min-width:280px;
padding:16px 20px;
border-radius:14px;
color:#fff;
font-size:15px;
font-weight:600;
box-shadow:0 10px 25px rgba(0,0,0,0.15);
animation:toastSlide 0.3s ease;
}

.toast-success{
background:#16a34a;
}

.toast-error{
background:#dc2626;
}

.toast-warning{
background:#f59e0b;
}

@keyframes toastSlide{
from{
opacity:0;
transform:translateX(100px);
}
to{
opacity:1;
transform:translateX(0);
}
}

.dropdown-item{
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s;
}

.dropdown-item:hover{
    background: #f3f6fc;
}

.check-icon{
    color: #2d63ea;
    font-size: 18px;
    font-weight: bold;
}

.hidden{
    display: none;
}

.dropdown-toggle{
cursor:pointer;
display:flex;
align-items:center;
justify-content:space-between;
transition:0.2s;
color:#222;
font-weight:500;
}

.dropdown-toggle:hover{
    border-color: #2d63ea;
}