/* MKB - plain CSS, no build step and nothing fetched from the internet. */
:root{
  --navy:#0f172a; --brand:#4f46e5; --brand-dark:#312e81;
  --ink:#1e293b; --muted:#64748b; --line:#e2e8f0; --bg:#f8fafc;
  --ok:#059669; --okbg:#ecfdf5; --bad:#be123c; --badbg:#fff1f2; --warn:#b45309; --warnbg:#fffbeb;
  --radius:14px;
}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--ink);
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;font-size:15px;line-height:1.55}
a{color:var(--brand);text-decoration:none}
a:hover{text-decoration:underline}
h1{font-size:26px;margin:0 0 4px}
h2{font-size:19px;margin:0 0 6px}
h3{font-size:16px;margin:0 0 10px}

.topbar{display:flex;align-items:center;gap:28px;background:var(--navy);color:#e2e8f0;padding:0 24px;height:62px;position:sticky;top:0;z-index:10}
.brand{display:flex;align-items:center;gap:10px;color:#fff;font-weight:700;font-size:17px}
.brand img{width:34px;height:34px;object-fit:contain;border-radius:8px;background:#fff}
.nav{display:flex;gap:6px;flex:1}
.nav a{color:#cbd5e1;padding:8px 13px;border-radius:9px;font-size:14px;font-weight:500}
.nav a:hover{background:rgba(255,255,255,.08);color:#fff;text-decoration:none}
.user{display:flex;align-items:center;gap:14px}
.who{text-align:right;line-height:1.25}
.who strong{display:block;font-size:14px;color:#fff}
.role{font-size:11px;padding:1px 8px;border-radius:999px;background:#334155;color:#cbd5e1}
.role-super{background:var(--brand);color:#fff}
.role-edit{background:#0369a1;color:#fff}

.page{max-width:1180px;margin:0 auto;padding:26px 24px 60px}
.page-head{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;flex-wrap:wrap;margin-bottom:20px}
.section-title{margin:0 0 12px}
.muted{color:var(--muted)}
.small{font-size:12.5px}
.nowrap{white-space:nowrap}
.right{text-align:right}
.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.row.tight{gap:6px}
.inline{display:inline}

.card{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:20px;margin-bottom:16px}
.card.narrow{max-width:680px}
.empty{color:var(--muted);text-align:center;padding:34px}
.split{display:grid;grid-template-columns:1fr 320px;gap:20px;align-items:start}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(290px,1fr));gap:16px}
@media(max-width:900px){.split{grid-template-columns:1fr}}

.post-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.post h2,.post h3{margin:0}
.post-body{color:#334155;margin:10px 0 14px;white-space:pre-wrap}
.prose{white-space:pre-wrap;margin:14px 0 18px}

.tags{display:flex;gap:6px;flex-wrap:wrap}
.tag{display:inline-block;font-size:11.5px;padding:2px 9px;border-radius:999px;background:#f1f5f9;color:#475569;border:1px solid var(--line)}
.tag-pin{background:var(--warnbg);color:var(--warn);border-color:#fde68a}
.tag-ok{background:var(--okbg);color:var(--ok);border-color:#a7f3d0}

/* The signature line under every piece of content. */
.stamp{margin-top:12px;padding-top:10px;border-top:1px dashed var(--line);font-size:12.5px;color:var(--muted)}
.stamp .sep{margin:0 8px;opacity:.5}

.list{list-style:none;margin:0 0 12px;padding:0}
.list li{padding:8px 0;border-bottom:1px solid #f1f5f9;display:flex;justify-content:space-between;gap:10px}
.list li:last-child{border-bottom:0}

.table{width:100%;border-collapse:collapse;background:#fff;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden}
.table th{text-align:left;font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);background:#f8fafc;padding:11px 14px;border-bottom:1px solid var(--line)}
.table td{padding:12px 14px;border-bottom:1px solid #f1f5f9;vertical-align:top}
.table tr:last-child td{border-bottom:0}

label{display:block;font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);margin:14px 0 5px}
label.check{display:flex;align-items:center;gap:8px;text-transform:none;font-size:14px;color:var(--ink);letter-spacing:0}
/* Tick boxes and radios must keep their natural size - stretching them to
   100% is what pushed the label text to the far side of the form. */
input[type=checkbox],input[type=radio]{width:auto;flex:none;margin:0}
input,select,textarea{width:100%;padding:9px 11px;border:1px solid #cbd5e1;border-radius:10px;font:inherit;background:#fff}
input:focus,select:focus,textarea:focus{outline:2px solid #c7d2fe;border-color:var(--brand)}
.row input,.row select{width:auto;flex:1;min-width:120px}
.filters{display:flex;gap:10px;margin-bottom:16px;flex-wrap:wrap}
.filters select,.filters input{width:auto;min-width:180px}

.btn{display:inline-flex;align-items:center;gap:7px;padding:9px 15px;border-radius:10px;border:1px solid #cbd5e1;background:#fff;color:var(--ink);font:inherit;font-weight:500;cursor:pointer}
.btn:hover{background:#f8fafc;text-decoration:none}
.btn-primary{background:var(--brand);border-color:var(--brand);color:#fff}
.btn-primary:hover{background:var(--brand-dark)}
.btn-danger{background:#fff;border-color:#fecdd3;color:var(--bad)}
.btn-danger:hover{background:var(--badbg)}
.btn-quiet{background:#f8fafc}
.btn-block{width:100%;justify-content:center;margin-top:14px}
.linkbtn{background:none;border:0;color:var(--muted);cursor:pointer;font-size:15px;padding:0 2px}
.linkbtn:hover{color:var(--bad)}

.chip{display:inline-flex;align-items:center;gap:6px;background:#f1f5f9;border:1px solid var(--line);border-radius:999px;padding:3px 10px;margin:0 5px 5px 0;font-size:13px}

.alert{padding:11px 14px;border-radius:11px;margin-bottom:16px;font-size:14px}
.alert-ok{background:var(--okbg);border:1px solid #a7f3d0;color:#065f46}
/* The tag helper always renders the summary; this class means it holds no
   errors, so without this it shows as an empty red box. */
.validation-summary-valid{display:none}
.attachments{margin-top:22px;border-top:1px solid var(--line);padding-top:14px}
.attachments h3{margin:0 0 8px;font-size:15px}
.filelist{list-style:none;margin:0;padding:0}
.filelist li{display:flex;align-items:center;gap:10px;padding:7px 0;border-bottom:1px solid var(--line)}
.filelist li:last-child{border-bottom:0}
.filelist a{font-weight:600}
.alert-bad{background:var(--badbg);border:1px solid #fecdd3;color:#9f1239}
.alert:empty{display:none}

.viewer{background:#fff;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;margin-bottom:12px}
.viewer object{width:100%;height:78vh;display:block;border:0}

.legend ul{margin:8px 0;padding-left:20px}
.legend li{margin:4px 0}

.login-body{display:flex;align-items:center;justify-content:center;min-height:100vh;background:linear-gradient(160deg,#0f172a,#312e81)}
.login-card{background:#fff;border-radius:18px;padding:34px;width:100%;max-width:400px;text-align:center;box-shadow:0 20px 50px rgba(0,0,0,.3)}
.login-card h1{margin:12px 0 2px}
.login-card label{text-align:left}
.login-logo{width:92px;height:92px;object-fit:contain}
.login-card .btn{margin-top:18px}

.foot{text-align:center;color:var(--muted);font-size:12.5px;padding:18px}
.dept h2{margin-bottom:4px}

/* ---------------------------------------------------------------------------
   Arabic / right-to-left.
   dir="rtl" on <html> flips text and most layout automatically; these rules
   handle the few places that need explicit attention.
   --------------------------------------------------------------------------- */
body.rtl { font-family: "Segoe UI", Tahoma, "Noto Naskh Arabic", system-ui, sans-serif; }
body.rtl .who { text-align: left; }
body.rtl .right { text-align: left; }
body.rtl .table th,
body.rtl .table td { text-align: right; }
body.rtl .stamp .sep { margin: 0 8px; }
/* Indentation and borders are direction-specific, so mirror them. */
body.rtl label { text-align: right; }
body.rtl .login-card label { text-align: right; }
body.rtl .chip .linkbtn { margin-right: 2px; margin-left: 0; }

.langswitch a {
  display: inline-block;
  padding: 5px 11px;
  border-radius: 9px;
  font-size: 13px;
  color: #cbd5e1;
  border: 1px solid rgba(255,255,255,.18);
}
.langswitch a:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }

.login-lang { margin-top: 14px; font-size: 13px; }

.logo-preview {
  width: 72px; height: 72px; flex: 0 0 auto;
  border: 1px solid var(--line); border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; background: #fff;
}
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
