
.customize-trigger{min-height:36px;padding:0 11px;border:1px solid var(--line);border-radius:11px;background:var(--white);color:var(--cocoa);display:inline-flex;align-items:center;justify-content:center;gap:7px;font:800 12px Tajawal,Arial,sans-serif;cursor:pointer}.customize-trigger span{white-space:nowrap}
.customize-trigger svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.class-level-tools{display:flex;align-items:center;gap:7px}
.class-note-icon{width:31px;height:31px;border:1px solid var(--line);border-radius:9px;background:var(--white);color:var(--cocoa);display:grid;place-items:center}
.class-note-icon svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.class-tools-under-year{margin-top:7px!important}
.class-schedule-icon{width:auto!important;min-width:36px;padding:5px 9px!important;display:inline-flex!important;align-items:center;gap:6px;font:800 11px Tajawal,Arial,sans-serif}
.class-schedule-icon span{white-space:nowrap}
.quick .qico{display:grid;place-items:center}
.quick .qico svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
body.midad-customizing .quick,body.midad-customizing .mobile-nav button{position:relative;outline:1px dashed #b7a18d;outline-offset:2px;touch-action:pan-y}
.midad-remove-item{position:absolute;top:6px;left:6px;z-index:5;width:25px;height:25px;border:0;border-radius:50%;background:#c83f3f;color:#fff;font:900 19px/1 Arial,sans-serif;display:none;box-shadow:0 2px 7px #0002}
body.midad-customizing .midad-remove-item{display:grid;place-items:center}
body.midad-customizing .quick{padding-top:35px}
body.midad-customizing .mobile-nav button{padding-top:24px}
.midad-custom-panel{display:grid;gap:12px}
.midad-custom-panel p{font-size:12px;color:var(--muted);line-height:1.8;margin:0}
.midad-custom-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.midad-custom-option{border:1px solid var(--line);border-radius:11px;background:var(--white);padding:10px;color:var(--deep);font-weight:800;text-align:right}
.midad-custom-option:disabled{opacity:.4}
body.midad-night .customize-trigger,body.midad-night .class-note-icon{background:var(--cream);color:var(--deep);border-color:var(--line)}
body.midad-night .quick{background:var(--white);border-color:var(--line);color:var(--ink)}
body.midad-night .quick b,body.midad-night .item-card h3,body.midad-night .section-title h3,body.midad-night .page-head h1,body.midad-night .student-home-tile strong{color:var(--deep)}
body.midad-night .quick small,body.midad-night .page-head p,body.midad-night .section-title p{color:var(--muted)}
body.midad-night .hero{background:linear-gradient(125deg,#263a2d,#304b38 65%,#405b45);border-color:#405b45}
body.midad-night .hero h2{color:#edf5eb}body.midad-night .hero p{color:#c3d2c2}body.midad-night .hero-kicker{color:#c7ddc6}
body.midad-night .sidebar{background:#202e25;color:#d9e6d7;border:1px solid var(--line)}
body.midad-night .nav button{color:#c3d2c2}body.midad-night .nav button.active{background:#35483a;color:#edf4ec}
body.midad-night .table-wrap{background:var(--white);border-color:var(--line)}
body.midad-night th{background:#304437;color:#d9e6d7}body.midad-night td{color:#d3dfd1;border-color:var(--line)}
body.midad-night .empty{background:#202e25;border-color:#536c58;color:var(--muted)}
body.midad-night .empty strong{color:var(--deep)}
body.midad-night .stat{background:var(--white);border-color:var(--line)}
body.midad-night .stat-icon,.midad-night .mini-icon,.midad-night .item-symbol,.midad-night .quick .qico{background:#35483a;color:#d4e4d1}
body.midad-night .modal{background:var(--paper);color:var(--ink)}
body.midad-night .modal-head h2,body.midad-night .form-field label{color:var(--deep)}
body.midad-night .form-field input,body.midad-night .form-field select,body.midad-night .form-field textarea{background:#202e25!important;color:#edf4ec!important;border-color:#536c58!important}
body.midad-night .btn.secondary{background:#35483a;color:#e7f0e6}
body.midad-night .btn.danger{background:#573431;color:#ffd9d4}
body.midad-night .midad-custom-option{background:var(--white);color:var(--ink);border-color:var(--line)}
body.midad-night .student-home-tile{background:linear-gradient(145deg,#26362c,#202e25);border-color:var(--line);color:var(--ink)}
body.midad-night .student-tile-icon{background:#35483a!important;color:#d4e4d1!important}
body.midad-night .student-home-tile small{color:var(--muted)}
@media(max-width:760px){.customize-trigger{width:auto;min-width:92px;height:38px;padding:0 12px;flex:0 0 auto}.customize-trigger span{display:inline!important;visibility:visible!important}.midad-custom-options{grid-template-columns:1fr 1fr}}

.mobile-nav [hidden]{display:none!important}
body.student-mode .mobile-nav{display:none!important}

/* Touch-friendly drag and drop while customizing */
body.midad-customizing .quick,body.midad-customizing .mobile-nav button{touch-action:none;user-select:none;-webkit-user-select:none;cursor:grab}
body.midad-customizing .quick:active,body.midad-customizing .mobile-nav button:active{cursor:grabbing}

/* Inline customization mode: edit directly on the page */
body.midad-customizing .quick,body.midad-customizing .mobile-nav button{position:relative;outline:1px dashed #8ca995;outline-offset:2px;touch-action:none;user-select:none;-webkit-user-select:none;cursor:grab}
body.midad-customizing .quick:active,body.midad-customizing .mobile-nav button:active{cursor:grabbing}
.midad-remove-item{position:absolute;top:5px;left:5px;z-index:8;width:27px;height:27px;border:0;border-radius:50%;background:#b94c49;color:#fff;font:900 20px/1 Arial,sans-serif;display:none;place-items:center;box-shadow:0 2px 7px #0002;padding:0}
body.midad-customizing .midad-remove-item{display:grid}
body.midad-customizing .quick{padding-top:36px}
body.midad-customizing .mobile-nav button{padding-top:23px}
.midad-add-shelf{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:12px 0;padding:12px 13px;border:1px dashed #a9bcae;border-radius:14px;background:#f1f6f1}
.midad-add-shelf[hidden]{display:none!important}
.midad-add-label{width:100%;font-size:11px;font-weight:900;color:#54735c}
.midad-add-option{border:1px solid #d7e3d8;border-radius:10px;background:#fff;color:#315b3d;padding:8px 11px;font:800 12px Tajawal,Arial,sans-serif}
.midad-add-option:active{background:#e7f0e8}
#midad-edit-bar{position:fixed;z-index:90;bottom:18px;left:50%;transform:translateX(-50%);width:min(560px,calc(100% - 24px));display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 12px;border:1px solid #d9e4da;border-radius:15px;background:#fff;box-shadow:0 10px 35px #233d2a24;color:#35533d;font:800 12px Tajawal,Arial,sans-serif}
#midad-edit-bar[hidden]{display:none!important}
#midad-edit-bar button{border:0;border-radius:9px;padding:9px 12px;font:800 11px Tajawal,Arial,sans-serif;white-space:nowrap}
#midad-edit-bar .midad-edit-reset{background:#f1f4f1;color:#5c6d60}
#midad-edit-bar .midad-edit-done{background:#2d7049;color:#fff}
#midad-nav-add-shelf{position:fixed;z-index:85;bottom:82px;left:12px;right:12px;max-height:35vh;overflow:auto;box-shadow:0 8px 25px #0002}
body.student-mode #midad-edit-bar,body.student-mode .midad-add-shelf{display:none!important}
@media(max-width:760px){#midad-edit-bar{bottom:10px}#midad-edit-bar>span{font-size:10px}.midad-add-shelf{gap:6px;padding:10px}.midad-add-option{font-size:11px;padding:7px 9px}}

/* Mobile customization controls stay clear of the bottom navigation */
#midad-edit-bar{z-index:45;bottom:18px}
#midad-nav-add-shelf{z-index:42;bottom:86px;max-height:24vh;left:10px;right:10px}
@media(max-width:760px){#midad-edit-bar{bottom:calc(76px + env(safe-area-inset-bottom));width:calc(100% - 18px);justify-content:center;flex-wrap:wrap}#midad-edit-bar>span{flex:1 1 100%;text-align:center}#midad-nav-add-shelf{bottom:calc(138px + env(safe-area-inset-bottom));max-height:22vh}body.midad-customizing .mobile-nav button{padding-top:0!important}body.midad-customizing .quick{padding-top:36px}.midad-remove-item{pointer-events:auto;touch-action:manipulation}}
.schedule-grid{display:grid;grid-template-columns:1.2fr .8fr;gap:15px;margin-top:14px}.schedule-file-line{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:14px}.schedule-publish-row{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-top:15px;padding:11px 13px;border-radius:12px;background:#f1f6f1;color:#385c40;font-size:12px}.schedule-publish-row label{display:flex;align-items:center;gap:8px;font-weight:800}.schedule-publish-row input{width:17px;height:17px;accent-color:#39764b}@media(max-width:760px){.schedule-grid{grid-template-columns:1fr}}
