/* P31: consistent accessible contrast across all Droocy roles and standalone pages. */
:root{--droocy-ink:#172033;--droocy-heading:#101828;--droocy-secondary:#475467;--droocy-line:#cbd5e1;--droocy-field:#fff}
/* Set page-level default; keep themed headers, heroes and colored buttons untouched. */
body{color:var(--droocy-ink)}
:is(main,.main,.content,.page-content,.dashboard,.wrap) :is(.card,.panel,.box,.tile,.widget,.stat,.stat-card,.summary-card,.filter-card,.filter-box,.form-card,.table-card,.course-card,.lesson-card,.book-card,.modal-content,.dropdown-menu,.alert-light,.bg-white,.bg-light,[style*="background:#fff"],[style*="background: #fff"],[style*="background: white"],[style*="background:#ffffff"]){color:var(--droocy-ink)}
:is(main,.main,.content,.page-content,.dashboard,.wrap) :is(.card,.panel,.box,.tile,.widget,.stat,.stat-card,.summary-card,.filter-card,.filter-box,.form-card,.table-card,.course-card,.lesson-card,.book-card,.modal-content,.bg-white,.bg-light) :is(h1,h2,h3,h4,h5,h6,legend,th){color:var(--droocy-heading)}
:is(main,.main,.content,.page-content,.dashboard,.wrap) :is(.card,.panel,.box,.tile,.widget,.stat,.stat-card,.summary-card,.filter-card,.filter-box,.form-card,.table-card,.course-card,.lesson-card,.book-card,.modal-content,.bg-white,.bg-light) :is(.muted,.text-muted,.hint,.help-text,.helper-text,.subtitle,.description,small){color:var(--droocy-secondary);opacity:1}
/* Label spacing: no overlapping fields or floating text from legacy CSS. */
:is(main,.main,.content,.page-content,.dashboard,.wrap) label:not(.btn):not(.badge):not(.form-check-label){color:var(--droocy-ink);font-weight:650}
:is(main,.main,.content,.page-content,.dashboard,.wrap) :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=submit]):not([type=button]):not([type=reset]),select,textarea){color:#172033!important;-webkit-text-fill-color:#172033!important;background-color:#fff!important;border-color:#b9c4d3!important;opacity:1!important;color-scheme:light}
:is(main,.main,.content,.page-content,.dashboard,.wrap) :is(input,textarea)::placeholder{color:#596579!important;-webkit-text-fill-color:#596579!important;opacity:1!important}
:is(main,.main,.content,.page-content,.dashboard,.wrap) select option{color:#172033!important;background:#fff!important}
:is(main,.main,.content,.page-content,.dashboard,.wrap) :is(input,select,textarea):disabled{color:#475467!important;-webkit-text-fill-color:#475467!important;background-color:#edf0f5!important}
:is(main,.main,.content,.page-content,.dashboard,.wrap) :is(input,select,textarea):focus-visible{outline:2px solid #6547d8;outline-offset:1px}
/* Readable data tables without altering dark-themed headers or action buttons. */
:is(main,.main,.content,.page-content,.dashboard,.wrap) table{border-color:var(--droocy-line)}
:is(main,.main,.content,.page-content,.dashboard,.wrap) table :is(td,th){border-color:#dce2ea}
:is(main,.main,.content,.page-content,.dashboard,.wrap) table tbody td{color:var(--droocy-ink)}
/* Deliberately dark / colored surfaces keep light foreground. */
:is(.live-admin-hero,.hero-dark,.dark-hero,.bg-dark,.bg-primary,.bg-purple,.gradient-hero,.banner-dark,[data-theme="dark"]){color:#fff!important}
:is(.live-admin-hero,.hero-dark,.dark-hero,.bg-dark,.bg-primary,.bg-purple,.gradient-hero,.banner-dark,[data-theme="dark"]) :is(h1,h2,h3,h4,h5,h6,p,small,legend){color:#fff!important}
/* White statistic tiles nested inside dark hero must override hero foreground. */
.live-admin-hero .live-stat,.live-admin-hero .live-stat :is(b,span,small,p){color:#172033!important;-webkit-text-fill-color:#172033!important}
/* Avoid forcing white on form controls in colored hero areas. */
:is(.live-admin-hero,.hero-dark,.dark-hero,.bg-dark,.bg-primary,.bg-purple,.gradient-hero,.banner-dark) :is(input,select,textarea){color:#172033!important;-webkit-text-fill-color:#172033!important}

/* P32: readable light-surface content and centered data cells. Preserve colored actions and dark heroes. */
:where(main,.main,.content,.page-content,.dashboard,.wrap) :is(table, .table, .data-table) :is(th,td){text-align:center!important;vertical-align:middle!important;overflow-wrap:anywhere}
:where(main,.main,.content,.page-content,.dashboard,.wrap) :is(.card,.panel,.box,.tile,.widget,.filter-card,.form-card,.table-card,.modal-content,.dropdown-menu,.bg-white,.bg-light) :is(p,span,div,small,label,strong):not(.btn):not(.badge):not([class*="icon"]):not([class*="price"]){-webkit-text-fill-color:initial}
:where(main,.main,.content,.page-content,.dashboard,.wrap) :is(.card,.panel,.box,.tile,.widget,.filter-card,.form-card,.table-card,.modal-content,.dropdown-menu,.bg-white,.bg-light) :is(p,small,label):not(.btn):not(.badge){color:#344054}
:where(main,.main,.content,.page-content,.dashboard,.wrap) :is(.card,.panel,.box,.tile,.widget,.filter-card,.form-card,.table-card,.modal-content,.dropdown-menu,.bg-white,.bg-light) :is(h1,h2,h3,h4,h5,h6,legend){color:#172033}
:where(main,.main,.content,.page-content,.dashboard,.wrap) :is(.card,.panel,.box,.tile,.widget,.filter-card,.form-card,.table-card,.modal-content,.dropdown-menu,.bg-white,.bg-light) :is(a.btn,button.btn,.button-primary,.btn-primary){color:#fff}
