:root{
    --bg:#f3efe5;
    --bg-soft:#fbf8f0;
    --card:#fffdf7;
    --text:#13261d;
    --muted:#687167;
    --primary:#0a4a2f;
    --primary-dark:#063720;
    --primary-soft:#e9f3eb;
    --gold:#d4a851;
    --gold-dark:#b9882e;
    --gold-soft:#fbf0d7;
    --border:#e7dcc7;
    --success:#138a4b;
    --danger:#dc2626;
    --warning:#d89518;
    --shadow:0 14px 38px rgba(5,40,25,.075);
    --sidebar-width:260px;
    --content-padding:24px;
    --radius-lg:20px;
    --radius-md:14px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth;font-size:15.5px}
body{
    margin:0;
    font-family:Tahoma, Arial, sans-serif;
    background:
        radial-gradient(circle at 8% 0%, rgba(212,168,81,.13), transparent 28%),
        radial-gradient(circle at 96% 92%, rgba(10,74,47,.10), transparent 30%),
        linear-gradient(180deg,#f7f1e5 0,#f3efe5 100%);
    color:var(--text);
    line-height:1.62;
    font-size:15px;
}
a{color:inherit;text-decoration:none}
button,input,select,textarea{font-family:inherit}
.app-shell{display:flex;min-height:100vh;align-items:stretch}
.sidebar{
    width:var(--sidebar-width);
    min-width:var(--sidebar-width);
    background:
        radial-gradient(circle at 15% 8%, rgba(212,168,81,.18), transparent 28%),
        linear-gradient(180deg,#073d25 0,#052b1b 100%);
    color:#fff;
    padding:18px 18px 22px;
    position:sticky;
    top:0;
    height:100vh;
    border-left:1px solid rgba(212,168,81,.24);
    box-shadow:-12px 0 35px rgba(4,37,24,.16) inset;
    overflow:auto;
}
.sidebar:before{
    content:"";
    position:absolute;
    inset:0;
    pointer-events:none;
    opacity:.16;
    background:
        repeating-radial-gradient(ellipse at 8% 10%, transparent 0 16px, rgba(212,168,81,.55) 17px 18px, transparent 19px 34px),
        repeating-radial-gradient(ellipse at 95% 98%, transparent 0 18px, rgba(212,168,81,.45) 19px 20px, transparent 21px 38px);
    mix-blend-mode:screen;
}
.sidebar > *{position:relative;z-index:1}
.brand{
    display:grid;
    gap:6px;
    justify-items:center;
    text-align:center;
    padding:4px 4px 18px;
    margin-bottom:14px;
    border-bottom:1px solid rgba(212,168,81,.22);
}
.brand-logo{
    width:132px;
    max-width:100%;
    height:auto;
    display:block;
    filter:drop-shadow(0 10px 18px rgba(0,0,0,.16));
}
.brand-title{
    color:#fff7df;
    font-weight:800;
    font-size:14px;
    letter-spacing:.1px;
    line-height:1.45;
}
.brand small{display:block;color:#ead7a7;margin-top:1px;font-size:12.5px;line-height:1.45}
.brand-icon{
    width:42px;height:42px;border-radius:14px;
    background:linear-gradient(135deg,var(--gold),#f3d98c);
    color:#123121;
    display:flex;align-items:center;justify-content:center;
    font-weight:800;font-size:18px;
}
.sidebar nav{display:grid;gap:7px}
.sidebar nav a{
    padding:10px 12px;
    border-radius:13px;
    color:#f7ecd0;
    border:1px solid transparent;
    transition:.18s ease;
    font-weight:800;
    font-size:15px;
    line-height:1.45;
}
.sidebar nav a:hover{
    background:rgba(255,255,255,.08);
    color:#fff;
    border-color:rgba(212,168,81,.26);
    transform:translateX(-2px);
}
.main-content{flex:1;padding:var(--content-padding);min-width:0;overflow:hidden}
.topbar{
    display:flex;justify-content:space-between;gap:16px;align-items:flex-start;
    margin-bottom:20px;
}
.topbar h1{margin:0;font-size:24px;line-height:1.35;color:#10281b;letter-spacing:-.2px;font-weight:900}
.topbar p{margin:3px 0 0;color:var(--muted);font-size:14.5px}
.card{
    background:linear-gradient(180deg,#fffdf7 0,#fbf7ee 100%);
    border:1px solid var(--border);
    border-radius:var(--radius-lg);
    padding:20px;
    box-shadow:var(--shadow);
    margin-bottom:18px;
}
.card h2{margin-top:0;margin-bottom:12px;font-size:22px;line-height:1.35;color:#10281b;font-weight:900}
.card h3{margin-top:0;margin-bottom:10px;font-size:18px;line-height:1.35;color:#10281b;font-weight:900}
.card p{font-size:15px;margin-top:0}
.grid{display:grid;gap:14px}
.grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.grid-4{grid-template-columns:repeat(4,minmax(0,1fr))}
.stat{display:flex;justify-content:space-between;align-items:center;position:relative;overflow:hidden;min-height:92px}
.stat:after{
    content:"";
    width:68px;height:68px;border-radius:999px;
    background:rgba(212,168,81,.12);
    position:absolute;left:-22px;bottom:-24px;
}
.stat strong{font-size:30px;line-height:1;color:#063720;position:relative;z-index:1;font-weight:900}
.stat span{color:var(--muted);position:relative;z-index:1;font-weight:800;font-size:14.5px}
.btn{
    display:inline-flex;align-items:center;justify-content:center;gap:7px;
    border:0;border-radius:13px;padding:10px 16px;
    background:linear-gradient(135deg,var(--gold),#e8c46d);
    color:#112418;cursor:pointer;font-weight:800;
    box-shadow:0 9px 18px rgba(184,136,46,.16);
    transition:.18s ease;
    font-size:14.5px;
    line-height:1.35;
    min-height:42px;
}
.btn:hover{background:linear-gradient(135deg,#e2bb60,var(--gold-dark));transform:translateY(-1px)}
.btn-outline{
    background:#fffaf0;color:var(--primary);
    border:1px solid rgba(212,168,81,.45);
    box-shadow:none;
}
.btn-outline:hover{background:var(--gold-soft);color:#082d1b}
.btn-danger{background:#dc2626;color:#fff;box-shadow:0 9px 18px rgba(220,38,38,.13)}
.btn-danger:hover{background:#b91c1c;color:#fff}
.btn-sm{padding:7px 11px;border-radius:11px;font-size:13px;min-height:34px}
.form-group{margin-bottom:13px}
label{display:block;margin-bottom:6px;font-weight:800;color:#17281e;font-size:14.5px;line-height:1.45}
input,select,textarea{
    width:100%;border:1px solid var(--border);border-radius:13px;
    padding:10px 12px;background:#fffefa;color:var(--text);font:inherit;
    font-size:14.5px;
    outline:none;
    transition:.18s ease;
    min-height:42px;
}
input[type="checkbox"], input[type="radio"]{min-height:auto}
input:focus,select:focus,textarea:focus{
    border-color:var(--gold);
    box-shadow:0 0 0 4px rgba(212,168,81,.14);
}
textarea{min-height:100px;resize:vertical}
.table-wrap{
    overflow:auto;border:1px solid var(--border);border-radius:17px;background:#fffdf7;
    box-shadow:0 7px 20px rgba(5,40,25,.035);
}
table{width:100%;border-collapse:collapse;min-width:720px;font-size:14.5px}
th,td{padding:12px 13px;border-bottom:1px solid var(--border);text-align:right;vertical-align:middle;line-height:1.55}
th{background:#f5ead4;color:#183324;font-weight:900;white-space:nowrap}
td{font-weight:500}
tr:last-child td{border-bottom:0}
tr:hover td{background:#fff9ea}
.badge{display:inline-flex;align-items:center;justify-content:center;border-radius:999px;padding:4px 10px;font-size:12.5px;font-weight:800;line-height:1.4;white-space:nowrap}
.badge-success{background:#dff4e8;color:#0c6d3b}
.badge-muted{background:#f0eadf;color:#70624b}
.alert{border-radius:15px;padding:11px 13px;margin-bottom:15px;font-size:14.5px;line-height:1.55}
.alert-success{background:#dcfce7;color:#166534;border:1px solid #bbf7d0}
.alert-danger{background:#fee2e2;color:#991b1b;border:1px solid #fecaca}
.alert-info{background:#fff3d3;color:#7a4d0d;border:1px solid #f5d48a}
.login-page{
    min-height:100vh;display:grid;place-items:center;padding:20px;
    background:
        linear-gradient(rgba(2,35,21,.60),rgba(2,35,21,.72)),
        url('../images/twteen-bg.jpg') center/cover no-repeat;
}
.login-page:before{
    content:"";
    position:fixed;
    inset:0;
    pointer-events:none;
    background:radial-gradient(circle at 50% 43%, rgba(212,168,81,.16), transparent 25%);
}
.login-card{
    max-width:440px;width:100%;position:relative;z-index:1;
    background:rgba(255,253,247,.95);
    border-color:rgba(212,168,81,.38);
    backdrop-filter:blur(10px);
}
.login-logo{text-align:center;margin-bottom:18px}
.login-logo .brand-icon{margin:0 auto 10px}
.login-brand-logo{
    width:190px;
    max-width:78%;
    height:auto;
    display:block;
    margin:0 auto 10px;
    background:#063720;
    border-radius:17px;
    padding:14px 18px;
    box-shadow:0 16px 32px rgba(6,55,32,.20);
}
.login-logo h1{margin:8px 0 6px;color:#10281b;font-size:25px;line-height:1.35}
.muted{color:var(--muted)}
.actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.empty{padding:26px;text-align:center;color:var(--muted);font-size:14.5px}
.login-links{text-align:center;margin-top:14px;font-size:14.5px}
.login-links a{color:var(--primary);font-weight:800}
.login-links a:hover{color:var(--gold-dark);text-decoration:underline}
.inline-form{display:inline-flex;margin:0}
.table-wrap .actions{justify-content:flex-start}
.filter-card{background:linear-gradient(180deg,#fffdf7 0,#f7efe0 100%)}
.filter-header{display:flex;justify-content:space-between;gap:14px;align-items:flex-start;margin-bottom:14px}
.filter-header h2{margin-top:0;margin-bottom:4px;color:#10281b;font-size:21px}
.filter-summary{
    background:#fff1cf;color:#7a4d0d;border:1px solid #f1d28d;
    border-radius:14px;padding:9px 13px;white-space:nowrap;font-weight:800;font-size:14px;
}
.filter-form .form-group{margin-bottom:0}
.filter-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}
.section-title-row{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:13px}
.section-title-row h2{margin:0;color:#10281b;font-size:22px}
.wide-field{grid-column:span 2}
/* تنسيق موحد لقوائم اختيار الموظفين والدورات */
.employee-picker,
.course-company-picker{
    font-size:14px;
    border-radius:16px;
}
.employee-check,
.course-company-row{
    padding:9px 10px;
}
.employee-check strong,
.course-company-row strong{font-size:14.5px}
.employee-check span,
.course-company-row p,
.helper-note{font-size:12.5px;line-height:1.55}
.picker-actions{gap:7px;margin-top:9px}
.employee-picker-search{margin-bottom:9px}
/* تحسين التناسق داخل النماذج الطويلة */
form .grid + .form-group{margin-top:12px}
.card > form:last-child{margin-bottom:0}
@media(max-width:1280px){
    :root{--sidebar-width:248px;--content-padding:22px}
    .brand-logo{width:122px}
    .sidebar nav a{font-size:14.5px;padding:9px 11px}
    .topbar h1{font-size:23px}
    .card{padding:18px}
    .stat strong{font-size:28px}
}
@media(max-width:1100px){
    .grid-4{grid-template-columns:repeat(2,minmax(0,1fr))}
    .grid-3{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:900px){
    .app-shell{display:block}
    .sidebar{width:auto;min-width:0;height:auto;position:relative;border-left:0;border-bottom:1px solid rgba(212,168,81,.28);padding:16px}
    .brand{padding-bottom:14px;margin-bottom:12px}
    .brand-logo{width:118px}
    .sidebar nav{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
    .main-content{padding:16px;overflow:visible}
    .grid-3,.grid-2{grid-template-columns:1fr}
    .topbar{align-items:flex-start;flex-direction:column}
    table{min-width:680px}
}
@media(max-width:700px){
    html{font-size:15px}
    .filter-header{flex-direction:column}
    .filter-summary{white-space:normal;width:100%}
    .grid-4{grid-template-columns:1fr}
    .wide-field{grid-column:auto}
    .login-brand-logo{width:180px}
    .sidebar nav{grid-template-columns:1fr}
    .card{padding:16px;border-radius:18px}
    .section-title-row{align-items:flex-start;flex-direction:column}
}

/* LMS_LAYOUT_PATCH_2_5_1_FORCE_COMPACT
   هذا الجزء مقصود يكون في نهاية الملف حتى يجبر المتصفح على استخدام المقاسات الجديدة. */
:root{
    --sidebar-width:230px !important;
    --content-padding:18px !important;
    --radius-lg:18px !important;
}
body{font-size:14px !important;line-height:1.55 !important}
.sidebar{
    width:230px !important;
    min-width:230px !important;
    padding:14px 14px 18px !important;
}
.brand{gap:4px !important;padding:0 4px 14px !important;margin-bottom:12px !important}
.brand-logo{width:108px !important}
.brand-title{font-size:13px !important;line-height:1.35 !important}
.brand small{font-size:12px !important}
.sidebar nav{gap:5px !important}
.sidebar nav a{font-size:14px !important;padding:9px 10px !important;border-radius:12px !important;line-height:1.35 !important}
.main-content{padding:18px !important}
.topbar{margin-bottom:16px !important;align-items:flex-start !important}
.topbar h1{font-size:22px !important;line-height:1.35 !important}
.topbar p{font-size:13.5px !important}
.card{padding:16px !important;border-radius:18px !important;margin-bottom:16px !important}
.card h2{font-size:20px !important;margin-bottom:10px !important}
.card h3{font-size:17px !important}
.card p{font-size:14px !important;line-height:1.65 !important}
.grid{gap:12px !important}
.stat{min-height:78px !important;padding:16px !important}
.stat:after{width:58px !important;height:58px !important;left:-18px !important;bottom:-20px !important}
.stat strong{font-size:26px !important}
.stat span{font-size:13.5px !important}
.btn{font-size:13.5px !important;padding:8px 14px !important;min-height:38px !important;border-radius:12px !important}
.btn-sm{font-size:12.5px !important;padding:6px 10px !important;min-height:32px !important}
label{font-size:13.5px !important;margin-bottom:5px !important}
input,select,textarea{font-size:13.5px !important;min-height:40px !important;padding:9px 11px !important;border-radius:12px !important}
textarea{min-height:92px !important}
table{font-size:13.5px !important;min-width:680px !important}
th,td{padding:10px 11px !important;line-height:1.5 !important}
.badge{font-size:12px !important;padding:3px 9px !important}
.filter-header{margin-bottom:12px !important}
.filter-header h2,.section-title-row h2{font-size:20px !important}
.filter-summary{font-size:13px !important;padding:8px 12px !important}
.actions{gap:6px !important}
.employee-picker,.course-company-picker{font-size:13px !important}
.employee-check,.course-company-row{padding:7px 9px !important}
.employee-check strong,.course-company-row strong{font-size:13.5px !important}
.employee-check span,.course-company-row p,.helper-note{font-size:12px !important}
.login-card{max-width:410px !important;padding:18px !important}
.login-brand-logo{width:170px !important;padding:12px 16px !important}
.login-logo h1{font-size:22px !important}
@media(max-width:1280px){
    :root{--sidebar-width:220px !important;--content-padding:16px !important}
    .sidebar{width:220px !important;min-width:220px !important}
    .brand-logo{width:102px !important}
    .sidebar nav a{font-size:13.5px !important;padding:8px 9px !important}
    .topbar h1{font-size:21px !important}
    .card{padding:15px !important}
    .stat strong{font-size:25px !important}
}
@media(max-width:900px){
    .sidebar{width:auto !important;min-width:0 !important;height:auto !important;padding:14px !important}
    .main-content{padding:14px !important;overflow:visible !important}
}
