/* Every appearance override is screen-only, including legacy rules below. */
@media screen{
/* Personal dark theme, deliberately loaded after the shared UI styles.
   Screen only: printed receipts/reports retain their document colors. */
@media screen{
 
 html[data-dm-theme=dark] body,html[data-dm-theme=dark] body #app .shell,html[data-dm-theme=dark] body #app .main,html[data-dm-theme=dark] body #app .premium-teacher-app,html[data-dm-theme=dark] body #app .dm-teacher-messages{background:var(--dm-canvas)!important;color:var(--dm-ink)!important}
 html[data-dm-theme=dark] body #app :is(.topbar,.premium-teacher-head,.mobile-nav,.teacher-bottom-nav,.dm-chat-toolbar,.dm-chat-thread-head,.dm-chat-compose){background:var(--surface)!important;border-color:var(--dm-line)!important;color:var(--dm-ink)!important}
 html[data-dm-theme=dark] body #app :is(.panel,.card,.table-wrap,.economic-overview-card,.kpi,.dashboard-kpi,.student-summary-card,.teacher-payroll-kpi,.teacher-premium-section,.teacher-blocked-card,.dm-master-card,.dm-teacher-home-section,.dm-teacher-overview>button,.premium-teacher-lesson,.teacher-own-course,.attendance-row,.teacher-student-row,.dashboard-date-card,.dm-notice-home,.dm-notice-center-list,.dm-notice-panel,.dm-message-alert){background:var(--surface)!important;border-color:var(--dm-line)!important;color:var(--dm-ink)!important;box-shadow:none!important}
 html[data-dm-theme=dark] body #app :is(h1,h2,h3,.student-name-link,.teacher-name-link,.dm-master-name,.dm-course-fee,.dm-master-pay strong,.dm-teacher-overview strong,.dm-teacher-agenda strong,.dm-teacher-shortcuts strong,.dm-chat-contact-copy strong,.dm-chat-thread-head strong,.mobile-school-brand strong,.teacher-school-brand strong,.kpi strong,.dashboard-kpi strong,.teacher-payroll-kpi strong,.student-summary-card strong,.premium-course-title h3,.teacher-lesson-main h3,.teacher-own-course h3){color:var(--dm-ink)!important}
 html[data-dm-theme=dark] body #app :is(p,small,.panel-sub,.dm-page-kicker,.dm-master-course-count,.dm-course-facts,.dm-course-facts strong,.dm-course-students,.dm-course-heading p,.dm-teacher-overview>button>span,.dm-teacher-priority,.dm-teacher-no-lessons,.dm-teacher-no-lessons strong,.dm-chat-message>small,.table-wrap td,.table-wrap td small,.kpi-label,.kpi>span,.dashboard-kpi>span){color:var(--dm-muted)!important}
 html[data-dm-theme=dark] body #app :is(.panel-head,.dm-master-pay,.dm-course-bottom,.dm-chat-contact,.dm-teacher-agenda>button,.dm-teacher-shortcuts>button,.premium-course-info,.premium-course-price,.table-wrap td,.students-table-wrap tr>td:first-child,.dm-student-actions){border-color:var(--dm-line)!important}
 html[data-dm-theme=dark] body #app :is(.field input,.field select,.field textarea,.toolbar input,.toolbar select,.search-box,.dm-master-search,.dm-communication-search,.dm-chat-compose textarea){background:var(--surface-2)!important;border-color:var(--dm-border-strong)!important;color:var(--dm-ink)!important;box-shadow:none!important}
 html[data-dm-theme=dark] body #app :is(input,textarea)::placeholder{color:var(--dm-muted)!important}
 html[data-dm-theme=dark] body #app .field label{color:var(--dm-muted)!important}
 html[data-dm-theme=dark] body #app :is(.btn-ghost,.icon-btn,.teacher-logout,.dm-chat-toolbar-back,.dm-communication-button,.topbar-scope-chip){background:var(--surface-2)!important;color:var(--dm-ink-2)!important;border-color:var(--dm-border-strong)!important}
 html[data-dm-theme=dark] body #app .btn-primary{background:var(--dm-accent-solid)!important;border-color:var(--dm-accent-solid)!important;color:#fff!important}
 html[data-dm-theme=dark] body #app .btn-soft{background:var(--dm-brand-soft)!important;border-color:var(--dm-brand-border)!important;color:var(--dm-accent-text)!important}
 html[data-dm-theme=dark] body #app .btn-success{background:#2c7153!important;color:#fff!important}
 html[data-dm-theme=dark] body #app :is(.btn-danger,.btn-danger-soft){background:var(--dm-danger-soft)!important;color:var(--dm-danger-text)!important;border-color:var(--dm-danger-border)!important}
 html[data-dm-theme=dark] body #app :is(.tag,.dm-master-courses span,.dm-teacher-agenda-icon,.dm-teacher-shortcuts>button>span,.dm-master-avatar,.dm-chat-avatar,.student-table-avatar,.kpi-icon,.premium-course-initials,.teacher-lesson-initial,.teacher-own-course-initial){background:var(--dm-brand-soft)!important;color:var(--dm-accent-text)!important;border-color:var(--dm-brand-border)!important}
 html[data-dm-theme=dark] body #app :is(.status.ok,.dm-access-stat.green){background:var(--dm-success-soft)!important;color:var(--dm-success-text)!important;border-color:var(--dm-success-border)!important}
 html[data-dm-theme=dark] body #app :is(.status.warn,.dm-access-stat.amber){background:var(--dm-warning-soft)!important;color:var(--dm-warning-text)!important;border-color:var(--dm-warning-border)!important}
 html[data-dm-theme=dark] body #app :is(.status.bad,.dm-access-stat.coral){background:var(--dm-danger-soft)!important;color:var(--dm-danger-text)!important;border-color:var(--dm-danger-border)!important}
 html[data-dm-theme=dark] body #app :is(.amount-due,.dm-master-due,.text-danger){color:var(--dm-danger-text)!important}
 html[data-dm-theme=dark] body #app :is(.amount-ok,.text-success){color:var(--dm-success-text)!important}
 html[data-dm-theme=dark] body #app :is(.mobile-nav button,.teacher-bottom-nav button){color:var(--dm-muted)!important}
 html[data-dm-theme=dark] body #app :is(.mobile-nav button.active,.teacher-bottom-nav button.active,.dm-master-filters button.active,.dm-chat-contact.active){background:var(--dm-brand-soft)!important;color:var(--dm-accent-text)!important}
 html[data-dm-theme=dark] body #app :is(.dm-master-filters,.dm-master-more summary,.dm-master-more>div,.table-wrap th,.dm-chat-day){background:var(--surface-2)!important;border-color:var(--dm-line)!important;color:var(--dm-ink-2)!important}
 html[data-dm-theme=dark] body #app :is(.dm-master-more button,.dm-master-more summary){color:var(--dm-ink-2)!important}
 html[data-dm-theme=dark] body #app :is(.dm-chat-sidebar,.dm-chat-sidebar-head){background:var(--surface)!important;border-color:var(--dm-line)!important}
 html[data-dm-theme=dark] body #app :is(.dm-chat-thread,.dm-chat-messages){background:var(--dm-canvas)!important}
 html[data-dm-theme=dark] body #app .dm-chat-bubble{background:var(--surface-2)!important;color:var(--dm-ink)!important;border-color:var(--dm-border-strong)!important}
 html[data-dm-theme=dark] body #app .dm-chat-message.own .dm-chat-bubble{background:var(--dm-accent-solid)!important;color:#fff!important;border-color:var(--dm-accent-solid)!important}
 html[data-dm-theme=dark] body #app .students-table-wrap tr{background:var(--surface)!important;border-color:var(--dm-line)!important}
 html[data-dm-theme=dark] body #app .students-table-wrap td:before{color:var(--dm-muted)!important}
 html[data-dm-theme=dark] body :is(.modal,.mobile-more-sheet,.dm-message-alert,.dm-notice-panel){background:var(--surface)!important;border-color:var(--dm-line)!important;color:var(--dm-ink)!important}
 html[data-dm-theme=dark] body :is(.modal-head,.modal-foot,.dm-access-head,.mobile-more-grid,.mobile-more-grid button,.mobile-more-logout){background:var(--surface)!important;border-color:var(--dm-line)!important;color:var(--dm-ink)!important}
 html[data-dm-theme=dark] body :is(.modal-body,.dm-access-body){background:var(--dm-canvas)!important;color:var(--dm-ink)!important}
 html[data-dm-theme=dark] body .modal :is(h1,h2,h3,strong,.field label){color:var(--dm-ink)!important}
 html[data-dm-theme=dark] body .modal :is(p,small,.dm-access-clear,.dm-access-intro,.profile-data-list span){color:var(--dm-muted)!important}
 html[data-dm-theme=dark] body .modal :is(.panel,.dm-access-section,.dm-access-stat,.dm-access-teacher-today,.student-profile-head,.teacher-profile-head,.staff-profile-head,.student-profile-kpis>div,.teacher-profile-kpis>div,.student-due-summary-grid>div){background:var(--surface)!important;border-color:var(--dm-line)!important;color:var(--dm-ink)!important}
 html[data-dm-theme=dark] body .modal :is(input,select,textarea,.icon-btn){background:var(--surface-2)!important;border-color:var(--dm-border-strong)!important;color:var(--dm-ink)!important}
 html[data-dm-theme=dark] body .modal .btn-primary{background:var(--dm-accent-solid)!important;border-color:var(--dm-accent-solid)!important;color:#fff!important}
 html[data-dm-theme=dark] body .modal :is(.btn-soft,.btn-ghost){background:var(--surface-2)!important;border-color:var(--dm-border-strong)!important;color:var(--dm-accent-text)!important}
 html[data-dm-theme=dark] body .dm-appearance-options button{background:var(--surface-2)!important;color:var(--dm-ink-2)!important;border-color:var(--dm-border-strong)!important}
 html[data-dm-theme=dark] body .dm-appearance-options button.active{background:var(--dm-brand-soft)!important;border-color:#65a7ff!important;color:var(--dm-accent-text)!important}
 html[data-dm-theme=dark] body :is(.dm-appearance-note,.mobile-more-head small,.dm-message-alert-copy p,.dm-notice-copy p,.dm-notice-copy small){color:var(--dm-muted)!important}
 html[data-dm-theme=dark] body .mobile-more-head strong{color:var(--dm-ink)!important}
 html[data-dm-theme=dark] body .mobile-more-grid button svg{color:var(--dm-accent-text)!important}
 html[data-dm-theme=dark] body .login-card{background:var(--surface)!important;border-color:var(--dm-line)!important;color:var(--dm-ink)!important}
 html[data-dm-theme=dark] body .login-card :is(h1,strong){color:var(--dm-ink)!important}
 html[data-dm-theme=dark] body .login-card :is(p,small,.login-security){color:var(--dm-muted)!important}
 html[data-dm-theme=dark] body .login-card input{background:var(--surface-2)!important;border-color:var(--dm-border-strong)!important;color:var(--dm-ink)!important}
 html[data-dm-theme=dark] body :is(.status.ok,.dm-access-stat.green){background:var(--dm-success-soft)!important;color:var(--dm-success-text)!important;border-color:var(--dm-success-border)!important}
 html[data-dm-theme=dark] body :is(.status.warn,.dm-access-stat.amber){background:var(--dm-warning-soft)!important;color:var(--dm-warning-text)!important;border-color:var(--dm-warning-border)!important}
 html[data-dm-theme=dark] body :is(.status.bad,.dm-access-stat.coral){background:var(--dm-danger-soft)!important;color:var(--dm-danger-text)!important;border-color:var(--dm-danger-border)!important}
}

/* V6.155: cover legacy component surfaces and high-specificity mobile overrides. */
@media screen{
 
 html[data-dm-theme=dark] body #app #content :is(.admin-scope-bar,.admin-dashboard-summary,.admin-dashboard-details,.calendar-premium-toolbar,.month-day,.calendar-day,.report-link-card,.due-card,.money-row,.lesson-row,.renewal-card,.note,.empty-state,.dm-chat-shell,.dm-notice-row){background:var(--surface)!important;border-color:var(--dm-line)!important;color:var(--dm-ink)!important;box-shadow:none!important}
 html[data-dm-theme=dark] body #app #content :is(.admin-scope-copy strong,.quick-item strong,.kpi .label,.dashboard-kpi-action,.admin-dashboard-details>summary,.due-card strong,.money-row strong,.lesson-row strong,.month-event strong,.dm-chat-mobile-peer strong){color:var(--dm-ink)!important}
 html[data-dm-theme=dark] body #app #content :is(.quick-item small,.admin-details-hint,.month-event small,.month-day-header,.dm-communication-empty){color:var(--dm-muted)!important}
 html[data-dm-theme=dark] body #app #content :is(.admin-scope-bar select,.dm-communication-search input,.month-event,.month-event-edit,.existing-student-row,.price-input-wrap,.teacher-edit-action,.premium-course-more,.dm-filter-tabs,.dm-category-tabs button){background:var(--surface-2)!important;border-color:var(--dm-border-strong)!important;color:var(--dm-ink-2)!important}
 html[data-dm-theme=dark] body #app #content :is(.dm-filter-tabs button.active,.dm-category-tabs button.active,.month-day.today){background:var(--dm-brand-soft)!important;border-color:var(--dm-brand-border)!important;color:var(--dm-accent-text)!important}
 html[data-dm-theme=dark] body #app #content .dm-filter-tabs button{color:var(--dm-ink-2)!important}
 html[data-dm-theme=dark] body #app #content :is(.admin-dashboard-summary .quick-item>span,.kpi-icon.cyan,.kpi-icon.pink,.kpi-icon.primary){background:var(--dm-brand-soft)!important;color:var(--dm-accent-text)!important}
 html[data-dm-theme=dark] body #app #content :is(.kpi-icon.orange,.admin-kpi-due){background:var(--dm-warning-soft)!important;border-color:var(--dm-warning-border)!important}
 html[data-dm-theme=dark] body #app #content .kpi-icon.orange{color:var(--dm-warning-text)!important}
 html[data-dm-theme=dark] body #app #content :is(.kpi-icon.red,.admin-kpi-overdue,.admin-kpi-blocked){background:var(--dm-danger-soft)!important;border-color:var(--dm-danger-border)!important}
 html[data-dm-theme=dark] body #app #content .kpi-icon.red{color:var(--dm-danger-text)!important}
 html[data-dm-theme=dark] body #app #content :is(.kpi-icon.green,.admin-kpi-collected,.admin-kpi-clear){background:var(--dm-success-soft)!important;border-color:var(--dm-success-border)!important}
 html[data-dm-theme=dark] body #app #content .kpi-icon.green{color:var(--dm-success-text)!important}
 html[data-dm-theme=dark] body :is(.dm-notice-row,.dm-notice-panel-head,.dm-notice-panel-foot){background:var(--surface)!important;border-color:var(--dm-line)!important;color:var(--dm-ink)!important}
 html[data-dm-theme=dark] body #app #content .dm-notice-row.is-unread,html[data-dm-theme=dark] body .dm-notice-row.is-unread{background:var(--dm-brand-soft)!important}
 html[data-dm-theme=dark] body :is(.dm-notice-copy strong,.dm-notice-panel-head strong,.dm-notice-detail h2){color:var(--dm-ink)!important}
 html[data-dm-theme=dark] body :is(.dm-notice-day,.dm-notice-detail p,.dm-notice-detail small){color:var(--dm-muted)!important}
 html[data-dm-theme=dark] body :is(.dm-notice-read,.dm-notice-icon){background:var(--dm-brand-soft)!important;border-color:var(--dm-brand-border)!important;color:var(--dm-accent-text)!important}
 html[data-dm-theme=dark] body .dm-notice-icon.payments{background:var(--dm-success-soft)!important;color:var(--dm-success-text)!important}
 html[data-dm-theme=dark] body .dm-notice-row.is-important .dm-notice-icon{background:var(--dm-warning-soft)!important;color:var(--dm-warning-text)!important}
 html[data-dm-theme=dark] body .dm-text-button{color:var(--dm-accent-text)!important}
 html[data-dm-theme=dark] body #app .topbar :is(.dm-brand-name,.role-badge){color:var(--dm-ink)!important}
 html[data-dm-theme=dark] body #app .topbar .role-badge{background:var(--surface-2)!important;border-color:var(--dm-border-strong)!important}
 html[data-dm-theme=dark] body #app #content :is(.dm-chat-toolbar,.dm-chat-compose,.dm-chat-thread-head){background:var(--surface)!important;border-color:var(--dm-line)!important;color:var(--dm-ink)!important}
 html[data-dm-theme=dark] body #app #content :is(.dm-chat-thread,.dm-chat-messages){background:var(--dm-canvas)!important}
 html[data-dm-theme=dark] body #app #content :is(.dm-chat-compose textarea,.dm-chat-day){background:var(--surface-2)!important;border-color:var(--dm-border-strong)!important;color:var(--dm-ink-2)!important}
 html[data-dm-theme=dark] body #app #content .dm-chat-bubble{background:var(--surface-2)!important;border-color:var(--dm-border-strong)!important;color:var(--dm-ink)!important;box-shadow:none!important}
 html[data-dm-theme=dark] body #app #content .dm-chat-message.own .dm-chat-bubble{background:var(--dm-accent-solid)!important;border-color:#316b9f!important;color:#fff!important}
 html[data-dm-theme=dark] body #app #content .dm-chat-stamp{color:var(--dm-muted)!important}
 html[data-dm-theme=dark] body #app #content .dm-chat-message.own .dm-chat-stamp{color:#d7eaff!important}
 html[data-dm-theme=dark] body #app #content .dm-chat-toolbar-actions>.dm-chat-sound{color:var(--dm-ink-2)!important}
 html[data-dm-theme=dark] body #app #content .dm-chat-toolbar-actions>.dm-chat-sound[aria-pressed=true]{background:var(--dm-brand-soft)!important;color:var(--dm-accent-text)!important}
 html[data-dm-theme=dark] body .modal :is(.table-wrap,.profile-data-list,.student-profile-notes,.existing-student-row,.price-input-wrap,.note,.card){background:var(--surface)!important;border-color:var(--dm-line)!important;color:var(--dm-ink)!important}
 html[data-dm-theme=dark] body .modal :is(th,td,.profile-data-list>div){background:transparent!important;border-color:var(--dm-line)!important;color:var(--dm-ink-2)!important}
}
@media screen{
 html[data-dm-theme=dark] body #app #content :is(.premium-course-card.dm-course-compact,.premium-course-info,.premium-course-price,.dm-course-footer,.dm-course-students,.calendar-grid,.premium-month-calendar){background:var(--surface)!important;border-color:var(--dm-line)!important;color:var(--dm-ink)!important}
 html[data-dm-theme=dark] body #app #content :is(.premium-course-title h3,.premium-course-title strong,.dm-course-price,.dm-course-top strong){color:var(--dm-ink)!important}
 html[data-dm-theme=dark] body #app #content :is(.dm-chat-sidebar-head,.dm-chat-toolbar-back){background:var(--surface)!important;border-color:var(--dm-line)!important;color:var(--dm-ink-2)!important}
 html[data-dm-theme=dark] body #app #content .dm-chat-toolbar-actions>.dm-chat-menu{color:var(--dm-ink-2)!important}
}
/* V156: remaining legacy settings, filters, economics and profile surfaces. */
@media screen{
 html[data-dm-theme=dark] body #app #content :is(.toolbar,.concept-toolbar,.location-filter,.location-row,.school-registry-preview,.school-due-setting,.economic-card,.economic-kpi,.economic-metric,.report-card,.reminder-row,.renewal-row,.receipt-row,.attendance-course-card,.course-performance-card,.course-performance-row,.teacher-payroll-card,.teacher-payroll-summary,.student-profile-section,.staff-location-summary,.account-toolbar,.school-brand-preview,.branding-preview,.school-logo-preview,.calendar-week-head,.calendar-time-cell){background:var(--surface)!important;border-color:var(--dm-line)!important;color:var(--dm-ink)!important;box-shadow:none!important}
 html[data-dm-theme=dark] body #app #content :is(input:not([data-dm-search-ready]):not([type=color]):not([type=checkbox]):not([type=radio]),select,textarea){background:var(--surface-2)!important;border-color:var(--dm-border-strong)!important;color:var(--dm-ink)!important;box-shadow:none!important}
 html[data-dm-theme=dark] body #app #content :is(.panel-body strong,.location-title strong,.school-registry-preview strong,.economic-value,.economic-metric strong,.teacher-payroll-total,.staff-name-link,.calendar-day-number,.calendar-event-title,.course-performance-name){color:var(--dm-ink)!important}
 html[data-dm-theme=dark] body #app #content :is(.toolbar-counter,.field-help,.school-registry-preview span,.school-registry-preview-title,.school-due-setting small,.economic-label,.chart-label,.chart-legend,.calendar-weekday,.calendar-time-cell,.report-card small,.renewal-row small,.receipt-row small,.dm-course-facts,.teacher-payroll-subtitle){color:var(--dm-muted)!important}
 html[data-dm-theme=dark] body #app #content :is(.location-code-badge,.staff-location-summary,.receipt-status-badge,.course-price-badge,.attendance-summary){background:var(--dm-brand-soft)!important;border-color:var(--dm-brand-border)!important;color:var(--dm-accent-text)!important}
 html[data-dm-theme=dark] body #app #content :is(.amount-due,.amount.bad,.due-amount,.teacher-payroll-due){color:var(--dm-danger-text)!important}
 html[data-dm-theme=dark] body .modal :is(.student-profile-modal,.teacher-profile-modal,.staff-profile-modal,.student-profile-section,.teacher-profile-section,.profile-section,.profile-card,.school-registry-preview,.location-row,.field-help,.student-due-summary,.student-due-summary-grid>div){background:var(--surface)!important;border-color:var(--dm-line)!important;color:var(--dm-ink)!important}
 html[data-dm-theme=dark] body .modal :is(.student-profile-info strong,.teacher-profile-info strong,.staff-profile-info strong,.student-profile-kpis strong,.teacher-profile-kpis strong,.profile-data-list strong,.profile-section strong){color:var(--dm-ink)!important}
 html[data-dm-theme=dark] body .modal :is(.tag,.status:not(.ok):not(.warn):not(.bad),.student-profile-courses .tag,.teacher-profile-courses .tag){background:var(--dm-brand-soft)!important;border-color:var(--dm-brand-border)!important;color:var(--dm-accent-text)!important}
 html[data-dm-theme=dark] body #app #content :is(.hero .eyebrow,.eyebrow,.dashboard-date-card strong,.dashboard-date-card .date-day,.dashboard-date-card .date-month){color:var(--dm-ink-2)!important}
 html[data-dm-theme=dark] body #app #content .dm-chat-body{color:inherit!important}
}
@media screen{
 
 html[data-dm-theme=dark] body #app #content :is(.panel-body,.school-registry-preview,.location-row) :is(label,legend){color:var(--dm-muted)!important}
}
/* V159: complete screen surfaces, including decorative layers and hover states. */
@media screen{
 html[data-dm-theme=dark] body #app #content .premium-course-card::after{background:none!important}
 html[data-dm-theme=dark] body #app #content :is(.home-quick-actions>button,.attendance-date-card,.attendance-lessons-card,.attendance-course-row,.monthly-report-field,.annual-report-field,.teacher-expense-field){background:var(--surface)!important;border-color:var(--dm-line)!important;color:var(--dm-ink)!important;box-shadow:none!important}
 html[data-dm-theme=dark] body #app #content .home-quick-actions>button:hover{background:var(--surface-2)!important;border-color:#526b89!important}
 html[data-dm-theme=dark] body #app #content :is(.home-quick-actions strong,.attendance-lessons-head,.attendance-date-card strong,.dm-course-fee strong){color:var(--dm-ink)!important}
 html[data-dm-theme=dark] body #app #content :is(.attendance-date-icon,.attendance-course-icon,.report-hub-icon){background:var(--dm-brand-soft)!important;color:var(--dm-accent-text)!important}
 html[data-dm-theme=dark] body #app #content .report-hub-card:nth-child(3n+2) .report-hub-icon{background:#34304c!important;color:#d0c1ff!important}
 html[data-dm-theme=dark] body #app #content .report-hub-card:nth-child(3n+3) .report-hub-icon{background:var(--dm-warning-soft)!important;color:var(--dm-warning-text)!important}
 html[data-dm-theme=dark] body :is(#app #content,#modalWrap .modal) .btn-dark{background:var(--dm-accent-solid)!important;border-color:var(--dm-brand-border)!important;color:#fff!important}
 html[data-dm-theme=dark] body :is(#app #content,#modalWrap .modal) .btn-dark:hover{background:#3a70ad!important}
 html[data-dm-theme=dark] body :is(#app #content,#modalWrap .modal) .btn-orange{background:var(--dm-warning-soft)!important;border-color:var(--dm-warning-border)!important;color:var(--dm-warning-text)!important}
 html[data-dm-theme=dark] body :is(#app #content,#modalWrap .modal) .receipt-mini-btn{background:var(--dm-brand-soft)!important;color:var(--dm-accent-text)!important;border:1px solid var(--dm-brand-border)!important;border-radius:8px;padding:5px 8px;text-decoration:none}
 html[data-dm-theme=dark] body :is(#app #content,#modalWrap .modal) .receipt-mini-btn.pending{background:var(--dm-warning-soft)!important;color:var(--dm-warning-text)!important;border-color:var(--dm-warning-border)!important}
 html[data-dm-theme=dark] body :is(#app #content,#modalWrap .modal) :is(.renewal-ok,.receipt-status.active){background:var(--dm-success-soft)!important;border-color:var(--dm-success-border)!important;color:var(--dm-success-text)!important}
 html[data-dm-theme=dark] body :is(#app #content,#modalWrap .modal) .renewal-ok :is(strong,small){color:var(--dm-success-text)!important}
 html[data-dm-theme=dark] body :is(#app #content,#modalWrap .modal) .receipt-status.voided{background:var(--dm-danger-soft)!important;color:var(--dm-danger-text)!important;border-color:var(--dm-danger-border)!important}
 html[data-dm-theme=dark] body #app #content table tbody tr:hover,html[data-dm-theme=dark] body #app #content table tbody tr:hover>td{background:var(--surface-2)!important;color:var(--dm-ink)!important}
 html[data-dm-theme=dark] body #app #content .dm-course-students{background:transparent!important;border:0!important}
 html[data-dm-theme=dark] body #app #content .dm-master-filters button{color:var(--dm-muted)!important}
 html[data-dm-theme=dark] body #app #content .dm-master-filters button.active{color:#fff!important}
 html[data-dm-theme=dark] body #app #content .dm-master-more button:hover{background:var(--surface-2)!important;color:var(--dm-ink)!important}
 html[data-dm-theme=dark] body #app #content .dm-master-more button.danger:hover{background:var(--dm-danger-soft)!important;color:var(--dm-danger-text)!important}
 html[data-dm-theme=dark] body #modalWrap .modal :is(.student-economic-grid,.student-economic-item,.payment-receipt,.receipt-section,.receipt-head,.receipt-note,.receipt-signature){background:var(--surface)!important;border-color:var(--dm-border-strong)!important;color:var(--dm-ink)!important}
 html[data-dm-theme=dark] body #modalWrap .modal .payment-receipt :is(h1,h2,h3,h4,strong,b,div,span,p,td,th,small){color:var(--dm-ink)!important;border-color:var(--dm-border-strong)!important}
 html[data-dm-theme=dark] body #modalWrap .modal .payment-receipt :is(table,thead,tbody,tr,td,th){background:var(--surface)!important}
 html[data-dm-theme=dark] body #modalWrap .modal .panel-head{border-color:var(--dm-line)!important}
 html[data-dm-theme=dark] body #modalWrap .modal .student-profile-avatar{background:var(--dm-brand-soft)!important;color:var(--dm-accent-text)!important}
 html[data-dm-theme=dark] body #modalWrap .modal .student-economic-item :is(strong,small){color:var(--dm-ink)!important}
 html[data-dm-theme=dark] body #modalWrap .dm-search-modal{background:var(--surface)!important;color:var(--dm-ink)!important}
 html[data-dm-theme=dark] body #modalWrap .dm-search-field{background:var(--surface-2)!important;border-color:var(--dm-border-strong)!important;color:var(--dm-muted)!important}
 html[data-dm-theme=dark] body #modalWrap .dm-search-result{background:transparent!important;color:var(--dm-ink)!important;border-color:var(--dm-line)!important}
 html[data-dm-theme=dark] body #modalWrap .dm-search-result:is(:hover,:focus-visible){background:var(--surface-2)!important}
 html[data-dm-theme=dark] body #modalWrap .dm-search-result small,html[data-dm-theme=dark] body #modalWrap .dm-search-status{color:var(--dm-muted)!important}
}
@media screen{
 html[data-dm-theme=dark] body #app #content .dm-master-filters button.active{background:var(--dm-accent-solid)!important;box-shadow:none!important}
 html[data-dm-theme=dark] body #app #content .dm-master-more button.dm-master-state-action{color:var(--dm-danger-text)!important}
 html[data-dm-theme=dark] body #app #content .dm-master-more button.dm-master-state-action:hover{background:var(--dm-danger-soft)!important;color:var(--dm-danger-text)!important}
 html[data-dm-theme=dark] body :is(#app #content,#modalWrap .modal) .receipt-link-badge{background:var(--dm-brand-soft)!important;border-color:var(--dm-brand-border)!important;color:var(--dm-accent-text)!important}
 html[data-dm-theme=dark] body #modalWrap .modal .payment-receipt :is(.receipt-payment,.receipt-items,.receipt-items-title){background:var(--surface-2)!important;border-color:var(--dm-border-strong)!important}
}
/* V160: calendar day popup and lesson edit summary. */
@media screen{
 html[data-dm-theme=dark] body #modalWrap .modal :is(.calendar-day-lesson,.calendar-day-lesson.has-override,.calendar-day-lesson.is-moved,.lesson-edit-summary,.lesson-edit-summary>div){background:var(--surface-2)!important;border-color:var(--dm-border-strong)!important;color:var(--dm-ink)!important}
 html[data-dm-theme=dark] body #modalWrap .modal :is(.calendar-lesson-title-line strong,.calendar-day-time span,.lesson-edit-summary strong){color:var(--dm-ink)!important}
 html[data-dm-theme=dark] body #modalWrap .modal :is(.calendar-day-lesson small,.calendar-day-modal-head .panel-sub,.lesson-edit-summary small){color:var(--dm-muted)!important}
 html[data-dm-theme=dark] body #modalWrap .dm-search-filters button{background:var(--surface-2)!important;color:var(--dm-muted)!important;border-color:var(--dm-border-strong)!important}
 html[data-dm-theme=dark] body #modalWrap .dm-search-filters button[aria-pressed=true]{background:var(--dm-accent-solid)!important;color:#fff!important;border-color:var(--dm-brand-border)!important}
}
@media screen{
 html[data-dm-theme=dark] body :is(#app #content,#modalWrap .modal) .dm-task-row{border-color:var(--dm-line)!important;color:var(--dm-ink)!important}
 html[data-dm-theme=dark] body :is(#app #content,#modalWrap .modal) .dm-task-row strong{color:var(--dm-ink)!important}
 html[data-dm-theme=dark] body :is(#app #content,#modalWrap .modal) .dm-task-row small{color:var(--dm-muted)!important}
 html[data-dm-theme=dark] body :is(#app #content,#modalWrap .modal) .dm-task-row.is-overdue{border-left-color:#e9af79!important}
}
@media screen{
 html[data-dm-theme=dark] body #app .dm-search-banner form{background:var(--surface)!important;border-color:var(--dm-border-strong)!important;box-shadow:none!important}
 html[data-dm-theme=dark] body #app .dm-search-banner input{color:var(--dm-ink)!important}html[data-dm-theme=dark] body #app .dm-search-banner input::placeholder{color:var(--dm-muted)!important}
 html[data-dm-theme=dark] body #app .dm-search-banner button{background:var(--dm-brand-soft)!important;color:var(--dm-accent-text)!important}
 html[data-dm-theme=dark] body :is(#app #content,#modalWrap .modal) :is(.dm-task-filters button,.dm-task-list-search,.dm-task-date-shortcuts button){background:var(--surface-2)!important;border-color:var(--dm-border-strong)!important;color:var(--dm-muted)!important}
 html[data-dm-theme=dark] body #app #content .dm-task-filters button[aria-pressed=true]{background:var(--dm-accent-solid)!important;border-color:var(--dm-brand-border)!important;color:#fff!important}
 html[data-dm-theme=dark] body :is(#app #content,#modalWrap .modal) .dm-task-check{background:var(--dm-success-soft)!important;border-color:var(--dm-success-border)!important;color:var(--dm-success-text)!important}
 html[data-dm-theme=dark] body :is(#app #content,#modalWrap .modal) .dm-task-check:hover{background:#2a5143!important}
 html[data-dm-theme=dark] body :is(#app #content,#modalWrap .modal) .dm-task-date{color:var(--dm-muted)!important}
 html[data-dm-theme=dark] body :is(#app #content,#modalWrap .modal) .dm-task-date.late{color:var(--dm-danger-text)!important}
 html[data-dm-theme=dark] body :is(#app #content,#modalWrap .modal) .dm-task-date.today{color:var(--dm-accent-text)!important}
 html[data-dm-theme=dark] body :is(#app #content,#modalWrap .modal) .dm-task-priority{background:var(--dm-warning-soft)!important;color:var(--dm-warning-text)!important}
 html[data-dm-theme=dark] body #app #content :is(.dm-task-view-all,.dm-task-eyebrow){color:#b3c6df!important}
}
@media screen{
 html[data-dm-theme=dark] body #app #content .dm-agenda-day{background:var(--surface-2)!important;color:var(--dm-ink-2)!important}
 html[data-dm-theme=dark] body #app #content .dm-agenda-day strong{color:var(--dm-ink)!important}
 html[data-dm-theme=dark] body #app #content .dm-agenda-day>span{background:var(--dm-brand-soft)!important;color:var(--dm-accent-text)!important}
 html[data-dm-theme=dark] body #app #content .dm-agenda-day .dm-agenda-day-empty{background:transparent!important;color:#718198!important}
 html[data-dm-theme=dark] body #app #content .dm-agenda-day.late>span{background:var(--dm-warning-soft)!important;color:var(--dm-warning-text)!important}
 html[data-dm-theme=dark] body #app #content .dm-agenda-day.selected{background:var(--dm-accent-solid)!important;border-color:var(--dm-brand-border)!important;color:#fff!important}
 html[data-dm-theme=dark] body #app #content .dm-agenda-day.selected strong{color:#fff!important}
 html[data-dm-theme=dark] body #modalWrap .dm-access-agenda-list button{background:var(--surface-2)!important;color:var(--dm-ink)!important;border-color:var(--dm-border-strong)!important}
 html[data-dm-theme=dark] body #modalWrap .dm-access-agenda-list :is(strong,small){color:var(--dm-ink-2)!important}
 html[data-dm-theme=dark] body #modalWrap .dm-access-agenda-counts{color:var(--dm-muted)!important}
}
@media screen{
 html[data-dm-theme=dark] body #app .topbar .dm-header-search{background:var(--surface-2)!important;border-color:var(--dm-border-strong)!important;color:var(--dm-muted)!important}
 html[data-dm-theme=dark] body #app .topbar .dm-header-search input{color:var(--dm-ink)!important}
 html[data-dm-theme=dark] body #app .topbar .dm-header-search input::placeholder{color:var(--dm-muted)!important}
 html[data-dm-theme=dark] body #app .topbar .dm-header-context .topbar-scope-chip{background:var(--surface-2)!important;color:var(--dm-ink-2)!important;border-color:var(--dm-border-strong)!important}
}
@media screen{
 html[data-dm-theme=dark] body #modalWrap .dm-access-close{background:var(--surface-2)!important;border-color:var(--dm-border-strong)!important;color:var(--dm-ink-2)!important}
 html[data-dm-theme=dark] body #modalWrap .dm-access-close:hover{background:#31445d!important;color:#fff!important}
 html[data-dm-theme=dark] body #modalWrap .dm-access-foot .dm-access-enter{background:linear-gradient(135deg,#356a9d,#234a75)!important;border-color:var(--dm-brand-border)!important;color:#fff!important}
}
@media screen and (max-width:700px){
 html[data-dm-theme=dark] body #app :is(.topbar .topbar-right,.premium-teacher-head .teacher-head-actions){background:var(--surface-2)!important;border-color:var(--dm-border-strong)!important}
 html[data-dm-theme=dark] body #app .topbar .dm-header-context{border-color:var(--dm-line)!important}
 html[data-dm-theme=dark] body #app .topbar .dm-header-context .topbar-scope-chip{background:var(--surface-2)!important;color:var(--dm-ink-2)!important}
}
@media screen{
 html[data-dm-theme=dark] body #modalWrap .dm-task-student-context{background:var(--surface-2)!important;border-color:var(--dm-border-strong)!important;color:var(--dm-ink)!important}
 html[data-dm-theme=dark] body #modalWrap .dm-task-student-context :is(strong,small){color:var(--dm-ink-2)!important}
}
@media screen and (max-width:700px){
 html[data-dm-theme=dark] body #app :is(.mobile-nav,.teacher-bottom-nav){background:#1b2533f5!important;border-color:var(--dm-border-strong)!important}
 html[data-dm-theme=dark] body #app :is(.mobile-nav,.teacher-bottom-nav) button{color:var(--dm-muted)!important}
 html[data-dm-theme=dark] body #app :is(.mobile-nav,.teacher-bottom-nav) button.active{background:var(--dm-brand-soft)!important;color:var(--dm-accent-text)!important}
}
@media screen{
 html[data-dm-theme=dark] body :is(#app #content,#modalWrap .modal) .dm-task-repeat{background:var(--dm-brand-soft)!important;color:var(--dm-accent-text)!important}
}
@media screen and (max-width:700px){
 html[data-dm-theme=dark] body #app :is(.mobile-nav,.teacher-bottom-nav){background:#1b2533fa!important;border-color:var(--dm-border-strong)!important}
 html[data-dm-theme=dark] body #app :is(.mobile-nav,.teacher-bottom-nav) button.active{background:transparent!important;color:var(--dm-accent-text)!important}
 html[data-dm-theme=dark] body #app :is(.mobile-nav,.teacher-bottom-nav) button.active>.dm-tab-icon{background:linear-gradient(135deg,#487ba8,#315778)!important;color:#fff!important}
}
@media screen{
 html[data-dm-theme=dark] body #modalWrap :is(.dm-task-editor,.dm-doc-modal) .field :is(input,select){background:var(--surface-2)!important;color:var(--dm-ink)!important;border-color:var(--dm-border-strong)!important}
 html[data-dm-theme=dark] body #modalWrap .dm-task-editor .modal-head>.icon-btn{background:#29384c!important;color:var(--dm-ink-2)!important}
 html[data-dm-theme=dark] body :is(.dm-doc-row,.dm-doc-alert,.dm-doc-home){background:var(--surface)!important;border-color:var(--dm-line)!important;color:var(--dm-ink)!important}
 html[data-dm-theme=dark] body :is(.dm-doc-upload,.dm-doc-empty){border-color:var(--dm-line)!important}
 html[data-dm-theme=dark] body .dm-doc-upload summary{color:var(--dm-accent-text)!important}
 html[data-dm-theme=dark] body .dm-doc-file-icon{background:var(--dm-brand-soft)!important;color:var(--dm-accent-text)!important}
 html[data-dm-theme=dark] body .dm-doc-state{background:var(--dm-brand-soft)!important;color:var(--dm-ink-2)!important}
 html[data-dm-theme=dark] body .dm-doc-state.valid{background:var(--dm-success-soft)!important;color:var(--dm-success-text)!important}
 html[data-dm-theme=dark] body .dm-doc-state.soon{background:var(--dm-warning-soft)!important;color:var(--dm-warning-text)!important}
 html[data-dm-theme=dark] body .dm-doc-state.expired{background:var(--dm-danger-soft)!important;color:var(--dm-danger-text)!important}
 html[data-dm-theme=dark] body .dm-pack-table :is(th,td){border-color:var(--dm-line)!important}
 @media(max-width:700px){html[data-dm-theme=dark] body #app .topbar .topbar-right{background:transparent!important;border:0!important}html[data-dm-theme=dark] body #app .topbar .dm-header-context .topbar-scope-chip{background:var(--surface-2)!important}html[data-dm-theme=dark] body #app #content .dm-secretary-hero{background:none!important}}
}
@media screen{
 html[data-dm-theme=dark] body .dm-doc-delete{background:var(--dm-danger-soft)!important;border-color:var(--dm-danger-border)!important;color:var(--dm-danger-text)!important}
 html[data-dm-theme=dark] body .dm-doc-pending{color:var(--dm-warning-text)!important}
}
@media screen and (max-width:700px){html[data-dm-theme=dark] body #app #content :is(.dm-secretary-hero,.admin-dashboard-hero){background:none!important}html[data-dm-theme=dark] body #app .students-table-wrap .dm-student-mobile-detail{color:var(--dm-muted)!important}}
@media screen{
 html[data-dm-theme=dark] body #modalWrap .staff-profile-kpis>div{background:var(--surface-2)!important;border:1px solid var(--dm-border-strong)!important;color:var(--dm-ink)!important;box-shadow:none!important}
 html[data-dm-theme=dark] body #modalWrap .staff-profile-kpis strong{color:var(--dm-ink)!important}
 html[data-dm-theme=dark] body #modalWrap .staff-profile-kpis :is(small,span){color:var(--dm-muted)!important}
 html[data-dm-theme=dark] body #modalWrap .staff-profile-avatar{background:var(--dm-brand-soft)!important;color:var(--dm-accent-text)!important;border-color:var(--dm-brand-border)!important}
 html[data-dm-theme=dark] body #modalWrap .staff-profile-kpis .staff-profile-email{overflow-wrap:anywhere!important}
 html[data-dm-theme=dark] body #modalWrap .dm-secretary-edit input{background:var(--surface-2)!important;color:var(--dm-ink)!important;border-color:var(--dm-border-strong)!important}
 html[data-dm-theme=dark] body #modalWrap .dm-secretary-edit input[readonly]{color:var(--dm-muted)!important;background:var(--surface-2)!important}
 @media(max-width:700px){html[data-dm-theme=dark] body #app #content :is(.dm-secretary-hero,.admin-dashboard-hero){background:var(--surface)!important;border-color:var(--dm-line)!important}html[data-dm-theme=dark] body #app #content .dm-mobile-welcome strong{color:var(--dm-ink)!important}html[data-dm-theme=dark] body #app #content .dm-mobile-welcome small{color:var(--dm-muted)!important}html[data-dm-theme=dark] body #app #content .dm-secretary-hero>.btn,html[data-dm-theme=dark] body #app #content .admin-dashboard-head-actions .btn{background:#283a51!important;border-color:var(--dm-border-strong)!important;color:var(--dm-ink-2)!important}}
}
@media screen{
 html[data-dm-theme=dark] body #app #content :is(.performance-row,.teacher-payroll-row){background:var(--surface-2)!important;border:1px solid var(--dm-border-strong)!important;color:var(--dm-ink)!important;box-shadow:none!important}
 html[data-dm-theme=dark] body #app #content :is(.performance-name strong,.teacher-payroll-row .grow strong,.teacher-payroll-values b,.metric-row b){color:var(--dm-ink)!important}
 html[data-dm-theme=dark] body #app #content :is(.performance-name small,.teacher-payroll-row .grow small,.teacher-payroll-values span,.metric-row span){color:var(--dm-muted)!important}
 html[data-dm-theme=dark] body #app #content .performance-rank{background:var(--dm-brand-soft)!important;color:var(--dm-ink-2)!important}
 html[data-dm-theme=dark] body #app #content .metric-track{background:#35445a!important}
 html[data-dm-theme=dark] body #app #content .performance-note{background:var(--surface-2)!important;color:var(--dm-muted)!important;border-color:var(--dm-border-strong)!important}
 html[data-dm-theme=dark] body #app #content .teacher-payroll-due b{color:var(--dm-danger-text)!important}
 html[data-dm-theme=dark] body #app #content .teacher-payroll-actions .btn:disabled{background:var(--dm-success-soft)!important;color:#b0c8bc!important;border-color:var(--dm-success-border)!important;opacity:.65!important}
 html[data-dm-theme=dark] body #app #content .admin-dashboard-details[open]>summary{border-bottom-color:var(--dm-border-strong)!important}
 html[data-dm-theme=dark] body #app #content .admin-dashboard-details>summary:after{color:var(--dm-ink-2)!important}
}
html[data-dm-theme=dark] body .dm-student-chips .btn.selected{background:#dce6f6!important;color:#152235!important;border-color:#dce6f6!important}
html[data-dm-theme=dark] body :is(.dm-doc-edit,.dm-doc-archive){border-color:var(--dm-line)!important;color:var(--dm-ink)!important}
html[data-dm-theme=dark] body .dm-student-workspace{background:var(--surface)!important;border-color:var(--dm-line)!important}
html[data-dm-theme=dark] body :is(.dm-student-filter-panel,.dm-student-workspace .student-table-footer){border-color:var(--dm-line)!important;color:var(--dm-ink-2)!important}
html[data-dm-theme=dark] body .dm-student-empty strong{color:var(--dm-ink)!important}
html[data-dm-theme=dark] body .dm-task-assignee{background:var(--dm-brand-soft)!important;color:var(--dm-ink-2)!important}
html[data-dm-theme=dark] body :is(.dm-chat-search-panel,.dm-chat-search-result){background:var(--surface)!important;color:var(--dm-ink)!important;border-color:var(--dm-line)!important}
html[data-dm-theme=dark] body .dm-chat-search-result mark{background:#6f6028;color:#fff3be}
html[data-dm-theme=dark] body :is(.dm-plan-school-status,.dm-plan-school-field,.dm-plan-blocked>.panel){background:var(--surface)!important;border-color:var(--dm-line)!important;color:var(--dm-ink)!important}

}
