/* CIM platform — one stylesheet, no build step. Works RTL (ar/he) and LTR (en). */
:root{
  --ground:#F4F1EA; --card:#FFFFFF; --line:#E6E1D6; --line-strong:#DDD7CA; --soft:#FAF8F3;
  --ink:#1E241B; --muted:#5C5A52; --faint:#6B685E;
  --brand:#3F5A1C; --brand-dark:#2C4012; --brand-tint:#EEF3E3; --brand-bar:#5E7F2A;
  --night:#1E2A17; --night-2:#34452A; --night-ink:#D5DCCB; --lime:#8DB33A;
  --warn:#7A3E0A; --warn-tint:#FBEBD9; --warn-line:#F0CFA8;
  --radius:14px;
}
*{box-sizing:border-box}
body{margin:0;background:var(--ground);color:var(--ink);font-family:'IBM Plex Sans Arabic','IBM Plex Sans Hebrew',system-ui,sans-serif;font-size:15px;line-height:1.5}
a{color:var(--brand);text-decoration:none}a:hover{color:var(--brand-dark)}
h1,h2,h3{margin:0;font-weight:700}h1{font-size:26px}h2{font-size:18px}
.muted{color:var(--muted)}.small{font-size:13px}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}

/* Desktop shell */
.shell{display:flex;flex-wrap:wrap;min-height:100vh}
.sidebar{flex:1 1 248px;max-width:280px;background:var(--night);color:#E9EDE2;padding:24px 16px;display:flex;flex-direction:column;gap:24px}
.brand{display:flex;align-items:center;gap:12px;padding:0 8px}
.logo{width:40px;height:40px;border-radius:10px;background:var(--lime);color:var(--night);display:flex;align-items:center;justify-content:center;font-weight:700}
.nav{display:flex;flex-direction:column;gap:4px}
.nav a{display:flex;align-items:center;gap:12px;padding:12px;border-radius:10px;color:var(--night-ink)}
.nav a:hover{background:var(--night-2);color:#fff}
.nav a.on{background:var(--night-2);color:#fff;font-weight:600}
.main{flex:999 1 560px;min-width:0;padding:32px 40px;display:flex;flex-direction:column;gap:24px}
@media (max-width:820px){.sidebar{max-width:none}.main{padding:20px 16px}}

.topbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px}
.row{display:flex;flex-wrap:wrap;gap:12px;align-items:center}
.grid-4{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:16px}
.cols{display:flex;flex-wrap:wrap;gap:24px;align-items:flex-start}
.cols>.wide{flex:2 1 520px;min-width:0}.cols>.narrow{flex:1 1 300px;min-width:0;display:flex;flex-direction:column;gap:24px}

.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius)}
.card.pad{padding:20px}
.card-head{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px;padding:18px 20px}
.stat{padding:20px;display:flex;flex-direction:column;gap:6px}
.stat b{font-size:32px}
.stat.accent{background:var(--brand-tint);border-color:#C9D8AE}

/* Forms & buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:0 18px;border-radius:10px;border:1px solid var(--line-strong);background:#fff;color:var(--ink);font:inherit;font-weight:600;cursor:pointer}
.btn.primary{background:var(--brand);border-color:var(--brand);color:#fff}
.btn.primary:hover{background:var(--brand-dark)}
.btn.block{width:100%;min-height:52px;font-size:16px}
.chip{display:inline-flex;align-items:center;min-height:36px;padding:0 14px;border-radius:999px;border:1px solid var(--line-strong);background:#fff;color:var(--ink);font-size:13px}
.chip.on{background:var(--brand);border-color:var(--brand);color:#fff}
.field{display:flex;flex-direction:column;gap:6px}
.field label{font-size:14px;font-weight:600}
input[type=text],input[type=search],input[type=email],input[type=password],input[type=date],input[type=number],select,textarea{min-height:44px;border-radius:10px;border:1px solid #CFC8B8;background:#fff;padding:0 12px;font:inherit;color:var(--ink);width:100%}
textarea{padding:10px 12px;min-height:100px}
input:focus,select:focus,textarea:focus,.btn:focus-visible,a:focus-visible{outline:3px solid #B9D77A;outline-offset:1px}
.form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:16px}
.error{color:#9B2C12;font-size:13px}
.flash{background:var(--brand-tint);border:1px solid #C9D8AE;color:var(--brand-dark);padding:12px 16px;border-radius:10px}

/* Tables */
.table-wrap{overflow-x:auto}
table{border-collapse:collapse;width:100%}
th,td{text-align:start;padding:12px 16px;border-bottom:1px solid var(--line);font-size:14px;vertical-align:middle}
th{font-weight:600;color:var(--muted);font-size:13px;background:var(--soft)}
tbody tr:hover{background:#FCFBF8}
.badge{display:inline-block;padding:4px 10px;border-radius:999px;font-size:12px;font-weight:600;background:var(--brand-tint);color:var(--brand-dark)}
.badge.warn{background:var(--warn-tint);color:var(--warn)}
.badge.grey{background:#EFEBE1;color:var(--muted)}
.bar{height:8px;border-radius:4px;background:#EFEBE1}.bar>span{display:block;height:8px;border-radius:4px;background:var(--brand-bar)}
.pager{display:flex;justify-content:space-between;align-items:center;padding:14px 20px;font-size:13px;color:var(--muted)}

/* Mobile shell (lecturer & student) */
.phone{max-width:480px;margin:0 auto;min-height:100vh;display:flex;flex-direction:column}
.phone-head{background:var(--night);color:#fff;padding:20px 20px 24px;display:flex;flex-direction:column;gap:14px}
.phone-head .sub{color:#C9D3BC;font-size:14px}
.phone-body{flex:1;padding:16px 20px 96px;display:flex;flex-direction:column;gap:16px}
.mini-stats{display:flex;gap:10px}.mini-stats div{flex:1;background:var(--night-2);border-radius:12px;padding:10px 12px;display:flex;flex-direction:column}
.mini-stats b{font-size:22px}
.list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.list li,.list a.item{background:#fff;border:1px solid var(--line);border-radius:12px;padding:10px 12px;display:flex;align-items:center;gap:12px;color:var(--ink)}
.avatar{width:40px;height:40px;border-radius:50%;background:#E3E9D6;color:var(--brand);display:flex;align-items:center;justify-content:center;font-weight:700;flex:none}
.toggle input{position:absolute;opacity:0}
.toggle span{display:inline-flex;align-items:center;justify-content:center;min-width:76px;height:40px;border-radius:999px;border:1px solid #B5611A;background:#fff;color:var(--warn);font-size:13px;font-weight:600;cursor:pointer}
.toggle input:checked+span{background:var(--brand);border-color:var(--brand);color:#fff}
.toggle input:focus-visible+span{outline:3px solid #B9D77A}
.sticky-foot{position:sticky;bottom:0;padding:12px 0 8px;background:var(--ground)}
.hero{background:var(--night);color:#fff;border-radius:16px;padding:18px;display:flex;flex-direction:column;gap:8px}
.hero .sub{color:#C9D3BC;font-size:13px}
.tabbar{position:fixed;bottom:0;inset-inline:0;background:#fff;border-top:1px solid var(--line);display:flex;justify-content:space-around;padding:8px 8px 20px;max-width:480px;margin:0 auto}
.tabbar a{min-width:64px;min-height:48px;display:flex;flex-direction:column;align-items:center;gap:2px;font-size:12px;color:var(--muted)}
.tabbar a.on{color:var(--brand);font-weight:600}

/* Login */
.login-top{background:var(--night);color:#fff;padding:28px 24px 40px;display:flex;flex-direction:column;gap:40px}
.lang{display:flex;gap:4px;background:var(--night-2);border-radius:999px;padding:4px}
.lang a{min-height:36px;padding:0 12px;border-radius:999px;color:#fff;display:inline-flex;align-items:center;font-size:13px}
.lang a.on{background:#fff;color:var(--night);font-weight:600}
.badge.info{background:#E4EEF7;color:#1F4C73}
