/* Tamreed Masr Desktop UI v1 — progressive visual layer, no route/data changes */
:root{
 --tm-desk-navy:#162b4f;--tm-desk-navy2:#233e6c;--tm-desk-accent:#2864cf;
 --tm-desk-accent2:#174ba3;--tm-desk-bg:#e9edf4;--tm-desk-white:#fff;
 --tm-desk-line:#c5cfdf;--tm-desk-ink:#172842;--tm-desk-muted:#61718b;
 --tm-desk-header-h:164px;--tm-desk-status-h:27px;
}
html:has(body.tm-desktop-active){scroll-padding-top:var(--tm-desk-header-h);}
body.tm-desktop-active{background:var(--tm-desk-bg)!important;color:var(--tm-desk-ink);padding:0 0 var(--tm-desk-status-h)!important;font-family:"Segoe UI",Tahoma,Arial,sans-serif!important;}
body.tm-desktop-active .tm-desk-chrome,body.tm-desktop-active .tm-desk-status,body.tm-desktop-active .tm-desk-overlay{box-sizing:border-box;font-family:"Segoe UI",Tahoma,Arial,sans-serif;}
.tm-desk-chrome{position:sticky;top:0;width:100%;z-index:9500;direction:ltr;background:#f7f9fc;border-bottom:1px solid #9eb1ce;box-shadow:0 3px 10px rgba(17,40,82,.12);color:var(--tm-desk-ink);}
.tm-desk-titlebar{height:45px;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:0 14px;background:linear-gradient(90deg,#142a4d,#234576);color:#fff;}
.tm-desk-brand{display:flex;align-items:center;gap:10px;white-space:nowrap;min-width:0;font-weight:700;font-size:13px;letter-spacing:.1px;}
.tm-desk-mark{width:26px;height:26px;display:grid;place-items:center;background:#3b70d8;border:1px solid #7199ec;border-radius:5px;font-size:15px;color:#fff;box-shadow:inset 0 1px #ffffff40;}
.tm-desk-brandname{overflow:hidden;text-overflow:ellipsis;}
.tm-desk-windowtitle{font-size:12px;color:#d9e6ff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:40vw;}
.tm-desk-windowactions{display:flex;gap:9px;align-items:center;flex-shrink:0;}
.tm-desk-clock{font-size:12px;font-variant-numeric:tabular-nums;color:#d9e6ff;}
.tm-desk-menubar{height:31px;position:relative;display:flex;align-items:stretch;gap:0;border-bottom:1px solid #cfdae8;background:#f7f9fc;padding:0 10px;}
.tm-desk-button{border:1px solid transparent!important;background:transparent!important;box-shadow:none!important;color:#1f3659!important;font-weight:600!important;font-size:12px!important;font-family:inherit!important;line-height:1.25!important;min-height:0!important;min-width:0!important;height:29px;padding:5px 12px!important;border-radius:3px!important;white-space:nowrap;cursor:pointer;display:inline-flex;justify-content:center;align-items:center;gap:7px;width:auto!important;}
.tm-desk-button:hover,.tm-desk-button[aria-expanded=true]{background:#e1eafa!important;border-color:#b6c7e5!important;text-decoration:none!important;}
.tm-desk-button:focus-visible,.tm-desk-menuitem:focus-visible,.tm-desk-result:focus-visible,.tm-desk-tablink:focus-visible{outline:2px solid #1257bf;outline-offset:-2px;}
.tm-desk-dropdown{position:absolute;top:30px;left:10px;width:min(300px,95vw);background:white;border:1px solid #a7b8d1;border-radius:4px;box-shadow:0 16px 30px #122f5560;padding:5px;max-height:65vh;overflow:auto;z-index:2;}
.tm-desk-dropdown[hidden],.tm-desk-overlay[hidden]{display:none!important;}
.tm-desk-menuitem{display:block;box-sizing:border-box;color:#193454!important;font-family:inherit!important;text-decoration:none!important;font-size:12px!important;font-weight:500!important;text-align:start!important;direction:auto;width:100%!important;border:0!important;border-radius:3px!important;background:none!important;line-height:1.5!important;padding:9px 10px!important;min-height:34px!important;cursor:pointer;}
.tm-desk-menuitem:hover{background:#e8f0ff!important;}
.tm-desk-toolbar{display:flex;direction:ltr;align-items:center;gap:7px;padding:7px 12px;height:47px;background:linear-gradient(180deg,#fdfefe,#edf2f9);border-bottom:1px solid #ccd7e5;}
.tm-desk-toolbar .tm-desk-button{height:31px!important;border:1px solid #b8c9df!important;background:#fff!important;box-shadow:0 1px 1px #152c4c14!important;padding:6px 12px!important;}
.tm-desk-toolbar .tm-desk-button:hover{background:#e5efff!important;border-color:#80a3e2!important;}
.tm-desk-toolbar .tm-desk-iconbutton{font-size:19px!important;width:37px!important;padding:3px!important;}
.tm-desk-toolbar-sep{height:26px;width:1px;background:#bdcadd;margin:0 4px;flex:none;}
.tm-desk-breadcrumb{margin-left:auto;max-width:48vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;direction:rtl;color:#677892;font-size:11px;font-weight:600;}
.tm-desk-tabs{display:flex;align-items:end;gap:4px;direction:ltr;padding:4px 9px 0;height:42px;overflow:auto hidden;background:#e5ebf4;scrollbar-width:thin;}
.tm-desk-tab{display:flex;align-items:center;flex-shrink:0;max-width:235px;border:1px solid #b4c3d9;border-bottom:0;background:#d9e2ef;border-radius:5px 5px 0 0;height:33px;color:#405574;box-shadow:inset 0 1px white;}
.tm-desk-tab.active{background:#fff;border-color:#93afd7;box-shadow:inset 0 3px #2b64cc;color:#173b73;font-weight:700;height:36px;}
.tm-desk-tablink{font:inherit;font-size:11.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:7px 9px;color:inherit!important;text-decoration:none!important;min-width:30px;direction:rtl;}
.tm-desk-tabclose{padding:0!important;width:22px!important;height:22px!important;font-size:16px!important;color:#536a89!important;margin:0 3px;}
.tm-desk-status{position:fixed;bottom:0;right:0;left:0;z-index:9550;height:var(--tm-desk-status-h);background:#e9eef7;border-top:1px solid #b9cadf;display:flex;align-items:center;justify-content:space-between;gap:15px;padding:0 15px;color:#38516f;font-size:10px;direction:rtl;box-shadow:0 -2px 8px #1b325b14;white-space:nowrap;}
.tm-desk-status span{overflow:hidden;text-overflow:ellipsis;}
.tm-desk-overlay{position:fixed;inset:0;z-index:9600;background:rgba(7,23,46,.55);display:grid;place-items:start center;padding:13vh 15px 25px;overflow:auto;}
.tm-desk-dialog{width:min(580px,100%);background:#fff;border:1px solid #6686b7;box-shadow:0 24px 60px #05132660;border-radius:7px;overflow:hidden;direction:rtl;color:var(--tm-desk-ink);}
.tm-desk-dialog-header{display:flex;align-items:center;justify-content:space-between;background:#1a3764;color:#fff;padding:11px 17px;gap:8px;}
.tm-desk-dialog-title{font:700 16px "Segoe UI",Tahoma,sans-serif!important;color:#fff!important;margin:0!important;}
.tm-desk-dialog-close{color:#fff!important;font-size:22px!important;border-color:#7d9ec9!important;height:28px!important;}
.tm-desk-search{display:block;width:calc(100% - 30px)!important;margin:15px!important;padding:12px!important;background:#f8fbff!important;border:1px solid #9fb5d6!important;border-radius:4px!important;min-height:43px!important;font:inherit!important;color:#162f52!important;}
.tm-desk-search[hidden]{display:none!important;}
.tm-desk-searchresults{padding:10px 15px 18px;max-height:52vh;overflow:auto;}
.tm-desk-result{display:block!important;background:#f6f9fe!important;border:1px solid #d7e1ef!important;color:#22497c!important;padding:10px!important;border-radius:4px!important;margin:6px 0!important;font-size:12px!important;text-decoration:none!important;}
.tm-desk-result:hover{background:#e7f0ff!important;border-color:#9bbde8!important;}
.tm-desk-helptext{margin:8px 0!important;font-size:13px;color:#2a4060;}
.tm-desk-noresults{font-size:12px;color:#667a92;}
/* Shared component language: flatter Windows-like controls, denser tables and panels. */
body.tm-desktop-active :is(.card,.panel,.edu-card,.his-panel,.hms-card,.p4-card,.nl-card,.tw-card,.nl-panel,.tw-panel,.p4-panel){border-radius:6px!important;box-shadow:0 1px 3px #1b3d6814!important;border-color:#c7d3e3!important;}
body.tm-desktop-active :is(input,select,textarea){border-radius:4px;accent-color:#2565d4;}
body.tm-desktop-active :is(table) {border-collapse:separate;border-spacing:0;border:1px solid #c8d4e5;background:white;font-variant-numeric:tabular-nums;}
body.tm-desktop-active :is(thead th){background:#e9f0fa!important;color:#1b3966!important;border-bottom:1px solid #b8cce4!important;font-weight:700;}
body.tm-desktop-active :is(tbody tr:nth-child(even)){background:#f7faff;}
body.tm-desktop-active :is(tbody tr:hover){background:#eaf2ff;}
body.tm-desktop-active :is(.btn,.nl-btn,.p4-btn,.tw-btn,.his-btn,.vh-button){border-radius:4px!important;}
body.tm-desktop-active :is(h1){font-size:clamp(24px,2.2vw,34px);}
body.tm-desktop-active :is(h2){font-size:clamp(19px,1.7vw,26px);}
body.tm-desktop-active :is(.container){max-width:1480px;}
/* Desktop shell applied to each independent Laravel workspace. */
body.tm-desktop-active :is(.tw-layout,.nl-shell,.p4-app,.edu-shell,.staff-shell){min-height:calc(100dvh - var(--tm-desk-header-h) - var(--tm-desk-status-h))!important;}
body.tm-desktop-active :is(.tw-sidebar,.nl-sidebar,.p4-side,.edu-sidebar,.staff-sidebar){top:var(--tm-desk-header-h)!important;max-height:calc(100dvh - var(--tm-desk-header-h) - var(--tm-desk-status-h))!important;height:auto;min-height:0;background:#182e52!important;color:#eef5ff!important;padding-top:14px!important;}
body.tm-desktop-active :is(.tw-sidebar,.nl-sidebar,.p4-side,.edu-sidebar,.staff-sidebar) a{border-radius:4px!important;}
body.tm-desktop-active :is(.tw-sidebar,.nl-sidebar,.p4-side,.edu-sidebar,.staff-sidebar) a:hover{background:#2c4d7a!important;}
body.tm-desktop-active :is(.tw-nav-link.active,.nl-nav-link.active,.p4-side-nav a.active,.edu-sidebar a.active){background:#2b63bf!important;color:#fff!important;}
body.tm-desktop-active :is(.tw-area,.nl-area,.p4-main,.edu-main,.staff-content){min-width:0!important;background:#e8edf5!important;}
body.tm-desktop-active :is(.tw-topbar,.nl-topbar,.p4-topbar,.edu-topbar,.staff-topbar){border-radius:0!important;background:#fff!important;border-bottom:1px solid #c5d2e3!important;box-shadow:none!important;}
body.tm-desktop-active :is(.tw-framebox,.tw-main,.nl-main,.p4-content,.edu-body,.staff-main){background:#eef2f8!important;}
body.tm-desktop-active :is(.tw-stage,.tw-home-card,.nl-stats>*,.nl-widget,.p4-metric,.edu-module-card){border-radius:5px!important;}
body.tm-desktop-active :is(.tw-sidebar,.nl-sidebar,.p4-side) :is(.tw-brand,.nl-brand,.p4-logo){padding-bottom:12px!important;}
/* Public pages also look like an app, while keeping forms and consent flows intact. */
body.tm-desktop-active .public-header{position:relative!important;top:auto!important;background:#fff!important;box-shadow:0 1px 2px #20385817!important;border-bottom:1px solid #b9c9dd!important;}
body.tm-desktop-active .public-footer{border-top:3px solid #315f9f!important;}
body.tm-desktop-active .edu-landing{padding:40px 0!important;background:linear-gradient(105deg,#172e51,#285a9b)!important;}
body.tm-desktop-active .edu-public-section{padding-top:27px!important;}
body.tm-desktop-active .edu-hero{gap:28px!important;}
/* Compact mode is optional and accessible from View menu. */
body.tm-desk-compact :is(.tw-card,.nl-card,.p4-card,.card,.his-panel){padding:12px!important;}
body.tm-desk-compact :is(td,th){padding:5px 7px!important;font-size:12px!important;}
body.tm-desk-compact :is(.tw-main,.nl-main,.p4-content,.edu-body,.staff-main){padding:12px!important;}
/* Same desktop palette is retained inside embedded modules, without duplicated application chrome. */
body.tm-desktop-active.tm-desktop-embedded{padding-bottom:0!important;}
body.tm-desktop-active.tm-desktop-embedded :is(.tw-layout,.nl-shell,.p4-app,.edu-shell,.staff-shell){min-height:100dvh!important;}
body.tm-desktop-active.tm-desktop-embedded :is(.tw-sidebar,.nl-sidebar,.p4-side,.edu-sidebar,.staff-sidebar){top:0!important;max-height:100dvh!important;}
/* Never show nested desktop chrome inside same-origin training iframe. */
body.tm-desktop-embedded .tm-desk-chrome,body.tm-desktop-embedded .tm-desk-status{display:none!important;}
@media(max-width:900px){
 :root{--tm-desk-header-h:132px;}
 .tm-desk-titlebar{height:40px;}.tm-desk-brand{font-size:11px;}.tm-desk-windowtitle{display:none;}
 .tm-desk-toolbar{height:39px;padding:4px 8px;}.tm-desk-toolbar .tm-desk-button{height:29px!important;padding:5px 8px!important;}
 .tm-desk-breadcrumb{display:none;}.tm-desk-tabs{height:33px;}.tm-desk-tab{height:26px;}.tm-desk-tab.active{height:29px;}
 body.tm-desktop-active :is(.tw-sidebar,.nl-sidebar,.p4-side,.edu-sidebar,.staff-sidebar){top:var(--tm-desk-header-h)!important;}
 .tm-desk-status{font-size:9px;padding:0 8px;}
 .tm-desk-status span:last-child{display:none;}
}
@media(max-width:560px){
 :root{--tm-desk-header-h:125px;}
 .tm-desk-titlebar{height:36px;}.tm-desk-windowactions .tm-desk-clock{display:none;}
 .tm-desk-menubar{height:28px;padding:0 3px;}.tm-desk-menu-trigger{padding:4px 8px!important;font-size:11px!important;}
 .tm-desk-toolbar{height:35px;}.tm-desk-toolbar .tm-desk-button{font-size:11px!important;padding:4px 6px!important;}
 .tm-desk-toolbar-sep{display:none;}.tm-desk-tabs{height:26px;padding-top:2px;}.tm-desk-tablink{font-size:10px;padding:4px 6px;}
 body.tm-desktop-active .edu-hero{grid-template-columns:1fr!important;}
}
@media print{
 .tm-desk-chrome,.tm-desk-status,.tm-desk-overlay{display:none!important;}
 body.tm-desktop-active{background:#fff!important;padding:0!important;}
 body.tm-desktop-active :is(.tw-sidebar,.nl-sidebar,.p4-side,.edu-sidebar,.staff-sidebar){display:none!important;}
}
@media(prefers-reduced-motion:reduce){.tm-desk-chrome *, .tm-desk-overlay *{transition:none!important;animation:none!important;}}
