/* وضع داكن مريح للعين: يغطي مساحة العمل كاملة مع تباين واضح للنصوص والحقول. */
body[data-theme="dark-comfort"]{
  color-scheme:dark;
  --bg:#17191b;
  --ink:#f1f4f5;
  --muted:#b6c0c4;
  --line:#3b4245;
  --blue:#23b8cc;
  --blue-soft:#173840;
  --side:#111719;
  --brand:#23b8cc;
  --brand-dark:#0c5966;
  --brand-soft:#173840;
  --brand-ink:#8eeaf4;
  --brand-gradient:linear-gradient(145deg,#24464c,#183337 52%,#101719);
  --brand-shadow:#00000055;
  background:#17191b!important;
  color:#f1f4f5!important;
}
body[data-theme="dark-comfort"] .app-shell,
body[data-theme="dark-comfort"] main,
body[data-theme="dark-comfort"] .content,
body[data-theme="dark-comfort"] #appContent,
body[data-theme="dark-comfort"] .school-home{background:#17191b!important;color:#f1f4f5!important}
body[data-theme="dark-comfort"] .sidebar{background:linear-gradient(180deg,#172023,#101416)!important;color:#edf3f4!important;border-left:1px solid #394245!important}
body[data-theme="dark-comfort"] .workspace,
body[data-theme="dark-comfort"] .user{background:#20272a!important;border-color:#3d474a!important}
body[data-theme="dark-comfort"] .nav-item{color:#d6dee0!important}
body[data-theme="dark-comfort"] .nav-item:hover,
body[data-theme="dark-comfort"] .nav-item.active{background:#27373b!important;color:#fff!important}
body[data-theme="dark-comfort"] .topbar{background:#202326!important;border-color:#3b4245!important;color:#f1f4f5!important}
body[data-theme="dark-comfort"] :is(.card,.stat,.products-panel,.class-card,.attendance-board,.attendance-card,.quick-card,.accounts-hero,.school-home-hero,.manager-note,.pos-cart,.pos-product,.price-drawer,.role-item,.permission-list label,.institution-form label,.addon-card,.quote-summary,.support-ticket-card,.lead-card,.alert-card){background:#222527!important;color:#f1f4f5!important;border-color:#41484b!important;box-shadow:0 10px 24px #00000025!important}
body[data-theme="dark-comfort"] :is(.modal-card,.child-form section,.detailed-report,.report-summary,.enrollment-head,.form-footer){background:#24282a!important;color:#f1f4f5!important;border-color:#434b4e!important}
body[data-theme="dark-comfort"] :is(input,select,textarea,.pos-search,.filter-button,.icon-btn,.date-btn,.secondary,.customer-select,.theme-card){background:#191c1e!important;color:#f5f7f8!important;border-color:#4a5356!important}
body[data-theme="dark-comfort"] :is(input,textarea)::placeholder{color:#929da1!important}
body[data-theme="dark-comfort"] :is(h1,h2,h3,h4,b,strong,label,.page-title h1,.card-head h3,.products-table td:first-child){color:#f5f7f8!important}
body[data-theme="dark-comfort"] :is(p,small,.muted,.page-title p,.card-head span,.products-count,.stat-top,.products-table td){color:#b8c2c5!important}
body[data-theme="dark-comfort"] .products-table th{background:#191c1e!important;color:#d5dddf!important;border-color:#41484b!important}
body[data-theme="dark-comfort"] .products-table td{background:#232729!important;border-color:#3b4245!important}
body[data-theme="dark-comfort"] .products-table tr:hover td{background:#293033!important}
body[data-theme="dark-comfort"] :is(.product-mini,.stat-icon,.role-icon,.enrollment-head>span,.drawer-icon){background:#173840!important;color:#8eeaf4!important}
body[data-theme="dark-comfort"] :is(.teacher-row,.product-visual,.cart-emoji,.quick-grid button,.access-note,.voucher-total){background:#292e30!important;color:#e8edef!important;border-color:#41484b!important}
body[data-theme="dark-comfort"] .modal{background:#060809cc!important}
body[data-theme="dark-comfort"] .close,
body[data-theme="dark-comfort"] .close-drawer{background:#303638!important;color:#fff!important}
body[data-theme="dark-comfort"] .primary{background:#129caf!important;color:#fff!important;box-shadow:0 5px 14px #0006!important}
body[data-theme="dark-comfort"] .theme-preview.dark-comfort{background:#222527!important;border:1px solid #555e61}
body[data-theme="dark-comfort"] .theme-preview.dark-comfort i:first-child{background:#111719!important}
.theme-preview.dark-comfort{background:#222527!important;border:1px solid #555e61}
.theme-preview.dark-comfort i:first-child{background:#111719!important}
body[data-theme="dark-comfort"] a{color:#73dce8}
body[data-theme="dark-comfort"] *{scrollbar-color:#536064 #191c1e}
/* واجهة الروضة */
body[data-theme="dark-comfort"] .modern-home{background:linear-gradient(135deg,#17191b,#1e2224 52%,#17191b)!important}
body[data-theme="dark-comfort"] .home-backdrop{background:linear-gradient(90deg,#17191bf2,#202426f5)!important;opacity:1!important}
body[data-theme="dark-comfort"] .home-backdrop:after{background:radial-gradient(circle at 85% 15%,#23b8cc18 0 10%,transparent 11%),radial-gradient(circle at 12% 83%,#77d8c518 0 11%,transparent 12%)!important}
body[data-theme="dark-comfort"] :is(.show-sidebar-btn,.home-date,.welcome-kicker,.search-input-wrap,.system-search-results,.home-child-spotlight,.institution-card,.support-card,.home-command-grid .home-modules,.insight-progress,.insight-reminder,.daily-suggestion,.insight-stats article){background:#232729!important;color:#f1f4f5!important;border-color:#444c4f!important;box-shadow:0 12px 28px #0004!important}
body[data-theme="dark-comfort"] :is(.overview-card,.home-module){background:#292e30!important;border:1px solid #465054!important;box-shadow:0 12px 28px #0003!important}
body[data-theme="dark-comfort"] :is(.overview-card>span,.module-icon,.spotlight-title>span,.support-icon,.footer-card-head>span){background:#173840!important;color:#8eeaf4!important}
body[data-theme="dark-comfort"] :is(.home-welcome h1,.home-school-name span,.overview-card b,.module-copy b,.spotlight-title h2,.child-main b,.home-section-label span,.insight-head span,.insight-reminder b,.daily-suggestion b,.footer-card-head h2,.support-card h2,.institution-details b){color:#f3f6f7!important}
body[data-theme="dark-comfort"] :is(.home-welcome p,.home-school-name small,.overview-card small,.overview-card em,.module-copy small,.spotlight-title p,.child-main small,.child-quick-data dt,.child-quick-data dd,.home-section-label small,.insight-head small,.insight-meta,.insight-stats small,.insight-reminder p,.daily-suggestion small,.footer-card-head p,.support-card p,.institution-details small){color:#bac4c7!important}
body[data-theme="dark-comfort"] .module-number{color:#93a5aa!important}
body[data-theme="dark-comfort"] .child-quick-data dl div{border-color:#465054!important}
body[data-theme="dark-comfort"] .daily-suggestion textarea{background:#191c1e!important;color:#f5f7f8!important;border-color:#4a5356!important}
body[data-theme="dark-comfort"] .support-links a{background:#173840!important;color:#8eeaf4!important}
/* واجهة المدرسة والفصول */
body[data-theme="dark-comfort"] .school-home{background:#17191b!important;border-color:#41484b!important}
body[data-theme="dark-comfort"] .school-home-hero{background:linear-gradient(115deg,#26383c,#1e2c2f 60%,#172023)!important;border:1px solid #465054!important;box-shadow:0 16px 34px #0004!important}
body[data-theme="dark-comfort"] .school-announcement,
body[data-theme="dark-comfort"] .school-stage-summary>div,
body[data-theme="dark-comfort"] .school-quick button,
body[data-theme="dark-comfort"] .school-room,
body[data-theme="dark-comfort"] .stage-empty{background:#232729!important;color:#f1f4f5!important;border-color:#444c4f!important;box-shadow:0 10px 24px #0003!important}
body[data-theme="dark-comfort"] :is(.school-announcement b,.school-quick h2,.school-grades-title h2,.school-quick button b,.school-room h3,.school-stage-summary b){color:#f4f7f8!important}
body[data-theme="dark-comfort"] :is(.school-announcement p,.school-quick button small,.school-room p,.school-stage-summary small,.stage-empty){color:#bac4c7!important}
body[data-theme="dark-comfort"] :is(.school-announcement button,.school-grades-title button){background:#173840!important;color:#8eeaf4!important;border-color:#35626a!important}
body[data-theme="dark-comfort"] .school-quick button i{color:#72dce8!important}
body[data-theme="dark-comfort"] .school-home-actions button{background:#2b3336!important;border-color:#687477!important;color:#fff!important}
/* بوابة ولي الأمر الداخلية */
body[data-theme="dark-comfort"] :is(.parent-portal-screen,.parent-portal-main){background:#17191b!important;color:#f1f4f5!important}
body[data-theme="dark-comfort"] :is(.parent-welcome,.parent-child-card,.parent-finance-section,.parent-request-section,.child-portfolio-profile,.private-banner,.pickup-class-card,.accounts-panel,.zatca-workspace,.branches-card,.year-archive-card,.regional-agent-hub,#regionalAgentHub){background:#232729!important;background-image:none!important;color:#f1f4f5!important;border-color:#444c4f!important}
body[data-theme="dark-comfort"] :is(.parent-welcome h1,.parent-child-card h2,.child-portfolio-profile h2,.private-banner b,.pickup-class-card b,.accounts-panel h3,.zatca-workspace h3,.branches-card h3,.year-archive-card h3,#regionalAgentHub h3){color:#f4f7f8!important}
body[data-theme="dark-comfort"] :is(.parent-welcome p,.parent-child-card p,.child-portfolio-profile p,.private-banner p,.pickup-class-card small){color:#bac4c7!important}
body[data-theme="dark-comfort"] #topbarLogout{background:#273033!important;color:#f4f7f8!important;border-color:#4b5659!important}
body[data-theme="dark-comfort"] :is(.balance-category,.pickup-class-card>header span,.finance-head>b,.supply-code,.report-icon){background:#173840!important;color:#8eeaf4!important;border-color:#35626a!important}
body[data-theme="dark-comfort"] :is(.purchases-summary-stats,.report-color-card,.supply-card-head,.balance-summary article){background:#232729!important;background-image:none!important;color:#f1f4f5!important;border-color:#444c4f!important}
/* تحويل تلقائي لأي سطح فاتح في الوحدات القديمة أو الصفحات المنشأة ديناميكيًا. */
body[data-theme="dark-comfort"] .dark-auto-surface{background:#232729!important;background-image:none!important;color:#f1f4f5!important;border-color:#444c4f!important;box-shadow:none!important}
body[data-theme="dark-comfort"] :is(.dark-auto-surface h1,.dark-auto-surface h2,.dark-auto-surface h3,.dark-auto-surface h4,.dark-auto-surface b,.dark-auto-surface strong,.dark-auto-surface label){color:#f4f7f8!important}
body[data-theme="dark-comfort"] :is(.dark-auto-surface p,.dark-auto-surface small,.dark-auto-surface span){color:#bac4c7!important}
body[data-theme="dark-comfort"] :is(.employee-of-week-card,.employee-of-week-card .eow-metrics span,.manager-ticker,.ticker-title,.ticker-window){background:#232729!important;background-image:none!important;color:#f1f4f5!important;border-color:#444c4f!important}
body[data-theme="dark-comfort"] :is(.eow-heading span,.eow-heading>b,.eow-person b,.eow-metrics b,.employee-of-week-card p,.employee-of-week-card p b,.ticker-title,.ticker-track span){color:#f1f4f5!important}
body[data-theme="dark-comfort"] :is(.eow-heading small,.eow-person small,.eow-metrics small){color:#bac4c7!important}
/* مركز التنبيهات العلوي مضغوط ولا يحجز مساحة الصفحة. */
.school-alert-center{margin:0 0 8px!important;padding:6px 10px!important;border-radius:11px!important;max-height:190px;overflow:auto}
.school-alert-center>header{margin:0!important;min-height:30px!important}
.school-alert-center>header b{font-size:13px!important}
.school-alert-center>header small{display:none!important}
.school-alert-center>header>span{padding:3px 7px!important;font-size:10px!important}
.school-alert-empty{padding:1px 0!important;margin:0!important;font-size:10px!important;line-height:1.2!important}
.school-alert{padding:7px 9px!important;margin-top:5px!important;grid-template-columns:28px 1fr auto!important;gap:7px!important}
.school-alert>span{font-size:17px!important}.school-alert b{font-size:12px!important}.school-alert p,.school-alert small{font-size:10px!important}.school-alert button{padding:6px 8px!important;font-size:10px!important}
/* شاشة الدخول لا تتأثر باختيار ألوان النظام. */
body[data-theme="dark-comfort"] #loginScreen{color-scheme:light!important;background:#f4fafb!important;color:#123348!important}
body[data-theme="dark-comfort"] #loginScreen .login-panel{background:#f4fafb!important;color:#123348!important}
body[data-theme="dark-comfort"] #loginScreen :is(.login-card,.parent-login-card){background:#fff!important;color:#123348!important;border-color:#dbe7e9!important}
body[data-theme="dark-comfort"] #loginScreen :is(h1,h2,h3,h4,b,strong,label,p,small,span){color:revert!important}
body[data-theme="dark-comfort"] #loginScreen :is(input,select,textarea){background:#fff!important;color:#183443!important;border-color:#d4e2e6!important}
/* بطاقة الطالب مستند رسمي فاتح ومستقل عن مظهر الشاشة. */
body[data-theme="dark-comfort"] .child-id-card{color-scheme:light!important;background:#fff!important;background-image:none!important;color:#243754!important;border-color:#dce4ea!important}
body[data-theme="dark-comfort"] .child-id-card :is(header,section,div,footer,span,b,strong,small,p,h1,h2,h3){background-color:transparent!important;color:revert!important;border-color:#e2e8ec!important;box-shadow:none!important}
body[data-theme="dark-comfort"] .child-id-card .card-brand{color:#087f94!important}
@media print{body[data-theme="dark-comfort"],body[data-theme="dark-comfort"] *{color-scheme:light!important}}
