/* Afaq unified UI foundation, phase 2. Scoped to /system to avoid public-site regressions.
   Official palette extracted from assets/css/system.css: #208c87, #243d3b, #f5f8f7. */
.afaq-system-body{
  --afaq-ui-primary:#208c87;--afaq-ui-text:#243d3b;--afaq-ui-surface:#fff;
  --afaq-ui-page:#f5f8f7;--afaq-ui-border:#e2eae7;--afaq-ui-muted:#788784;
  --afaq-ui-space-1:4px;--afaq-ui-space-2:8px;--afaq-ui-space-3:12px;
  --afaq-ui-space-4:16px;--afaq-ui-space-6:24px;--afaq-ui-space-8:32px;
  --afaq-ui-radius-control:9px;--afaq-ui-radius-card:16px;
  --afaq-ui-shadow-card:0 5px 18px rgba(36,61,59,.045);
  --afaq-ui-content-max:1440px;--afaq-ui-form-max:900px;
  --afaq-ui-control-min:44px;--afaq-ui-focus:0 0 0 3px rgba(32,140,135,.23);
  color:var(--afaq-ui-text);background:var(--afaq-ui-page);
}
.afaq-system-body .afaq-layout{min-width:0;max-width:100%;}
.afaq-system-body .afaq-layout > .afaq-content{min-width:0;max-width:100%;width:100%;}
.afaq-system-body .afaq-content > :not(.afaq-sidebar){max-width:100%;}
.afaq-system-body .afaq-card,.afaq-system-body .afaq-stats article{
  border-color:var(--afaq-ui-border);border-radius:var(--afaq-ui-radius-card);
  box-shadow:var(--afaq-ui-shadow-card);min-width:0;
}
.afaq-system-body .afaq-top{gap:var(--afaq-ui-space-4);flex-wrap:wrap;min-width:0;}
.afaq-system-body .afaq-top h1{line-height:1.5;overflow-wrap:anywhere;}
/* Table containers and table sizing are owned by ui-tables.css. */
.afaq-system-body .afaq-table th,.afaq-system-body .afaq-table td{vertical-align:middle;}
.afaq-system-body .afaq-form,.afaq-system-body .afaq-inline-form{min-width:0;}
.afaq-system-body .afaq-form input:not([type=checkbox]):not([type=radio]),
.afaq-system-body .afaq-form select,.afaq-system-body .afaq-form textarea,
.afaq-system-body .afaq-inline-form input:not([type=checkbox]):not([type=radio]),
.afaq-system-body .afaq-inline-form select{min-width:0;max-width:100%;}
.afaq-system-body .afaq-btn{display:inline-flex;align-items:center;justify-content:center;gap:var(--afaq-ui-space-2);max-width:100%;white-space:normal;text-align:center;}
.afaq-system-body :is(a,button,input,select,textarea):focus-visible{outline:2px solid var(--afaq-ui-primary);outline-offset:2px;}
.afaq-system-body :is(.afaq-content,.afaq-card,.afaq-row) img{max-width:100%;height:auto;}
.afaq-system-body :is(.afaq-content,.afaq-card,.afaq-row){overflow-wrap:break-word;}
.afaq-system-body :is(input,textarea,select){font-family:inherit;}
.afaq-system-body [dir=ltr]{unicode-bidi:isolate;}
@media (max-width:767px){
  .afaq-system-body .afaq-content{padding-inline:12px;}
  .afaq-system-body .afaq-card{padding:16px;}
  .afaq-system-body .afaq-stats{grid-template-columns:minmax(0,1fr);}
  .afaq-system-body .afaq-top{align-items:flex-start;}
  .afaq-system-body .afaq-form input:not([type=checkbox]):not([type=radio]),
  .afaq-system-body .afaq-form select,.afaq-system-body .afaq-form textarea,
  .afaq-system-body .afaq-btn:not(.small){min-height:var(--afaq-ui-control-min);}
}
@media (min-width:768px) and (max-width:1024px){
  .afaq-system-body .afaq-content{padding-inline:16px;}
}
@media (prefers-reduced-motion:reduce){
  .afaq-system-body :is(.afaq-btn,.afaq-card){scroll-behavior:auto;}
}
@media print{
  .afaq-system-body .afaq-card,.afaq-system-body .afaq-stats article{box-shadow:none;}
}

/* v7.16.82.113 — wide cards with balanced two-column desktop editors. */
.afaq-system-body .afaq-card.afaq-compact-editor.afaq-narrow-card{
 width:100%;max-width:none;margin-inline:0!important;box-sizing:border-box
}
.afaq-system-body .afaq-compact-editor > form.afaq-form{
 display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 24px;
 align-items:start;width:100%;max-width:none;box-sizing:border-box
}
.afaq-system-body .afaq-compact-editor > form.afaq-form > label{
 display:block;min-width:0;width:100%;max-width:100%;margin:0
}
.afaq-system-body .afaq-compact-editor > form.afaq-form > label :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]),select,textarea){
 display:block;width:100%;min-width:0;max-width:100%;box-sizing:border-box;font:inherit
}
.afaq-system-body .afaq-compact-editor > form.afaq-form select:not([multiple]){
 min-height:44px;max-height:52px;padding:9px 12px;line-height:1.5
}
.afaq-system-body .afaq-compact-editor > form.afaq-form select[multiple]{
 min-height:145px;max-height:210px;overflow-y:auto;padding:8px 12px
}
.afaq-system-body .afaq-compact-editor > form.afaq-form textarea{
 min-height:105px;max-height:360px;resize:vertical
}
/* Long descriptions, media and schedule editors need their own full row. */
.afaq-system-body .afaq-compact-editor > form.afaq-form > label:has(textarea),
.afaq-system-body .afaq-compact-editor > form.afaq-form > label:has(.afaq-gallery-uploader),
.afaq-system-body .afaq-compact-editor > form.afaq-form > :not(label):not(input[type=hidden]){
 grid-column:1/-1;min-width:0
}
.afaq-system-body .afaq-compact-editor > form.afaq-form > label:has(textarea) textarea{max-width:920px}
.afaq-system-body .afaq-compact-editor > form.afaq-form > label:has(.afaq-gallery-uploader) .afaq-gallery-uploader{width:100%;max-width:100%;box-sizing:border-box}
.afaq-system-body .afaq-compact-editor > form.afaq-form > label:has(select[multiple]){grid-column:1/-1;max-width:640px}
.afaq-system-body .afaq-compact-editor > form.afaq-form > :is(button[type=submit],.afaq-composer-actions){justify-self:start;width:auto;max-width:100%}
/* Keep other narrow dashboard cards untouched. */
@media(max-width:760px){
 .afaq-system-body .afaq-compact-editor > form.afaq-form{grid-template-columns:minmax(0,1fr);gap:14px}
 .afaq-system-body .afaq-compact-editor > form.afaq-form > label:has(select[multiple]){max-width:100%}
 .afaq-system-body .afaq-compact-editor > form.afaq-form :is(input,select,textarea){font-size:16px}
}

/* v7.16.82.114 — consistent ordinary dashboard forms across staff, owner and parent.
   Preserve wizard steps, filter bars, inline actions and purpose-built grids. */
@media(min-width:761px){
 .afaq-system-body .afaq-card > form.afaq-form:not(.afaq-inline-form):not(.afaq-wizard):not(.afaq-wizard-form):not(.afaq-filter-form):not(.afaq-search-form):has(> label):not(.afaq-special-layout){
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:24px;row-gap:16px;align-items:start;width:100%;max-width:none;
 }
 .afaq-system-body .afaq-card > form.afaq-form:not(.afaq-inline-form):not(.afaq-wizard):not(.afaq-wizard-form):not(.afaq-filter-form):not(.afaq-search-form):has(> label):not(.afaq-special-layout) > :is(.afaq-form-grid,.afaq-form-actions,.afaq-permissions,.afaq-gallery-uploader,fieldset,h2,h3,h4,p,hr,section,article,table,.afaq-note,.afaq-composer-actions){grid-column:1/-1;min-width:0}
 .afaq-system-body .afaq-card > form.afaq-form:not(.afaq-inline-form):not(.afaq-wizard):not(.afaq-wizard-form):not(.afaq-filter-form):not(.afaq-search-form):has(> label):not(.afaq-special-layout) > label:has(textarea),
 .afaq-system-body .afaq-card > form.afaq-form:not(.afaq-inline-form):not(.afaq-wizard):not(.afaq-wizard-form):not(.afaq-filter-form):not(.afaq-search-form):has(> label):not(.afaq-special-layout) > label:has(select[multiple]){grid-column:1/-1}
 .afaq-system-body .afaq-card > form.afaq-form:not(.afaq-inline-form):not(.afaq-wizard):not(.afaq-wizard-form):not(.afaq-filter-form):not(.afaq-search-form):has(> label):not(.afaq-special-layout) > :is(button[type=submit],button:not([type]),input[type=submit]){justify-self:start;width:auto;max-width:100%}
}
.afaq-system-body .afaq-card > form.afaq-form > label{min-width:0;max-width:100%}
.afaq-system-body .afaq-card > form.afaq-form > label :is(input:not([type=checkbox]):not([type=radio]),select,textarea){min-width:0;max-width:100%;box-sizing:border-box}
.afaq-system-body .afaq-card > form.afaq-form select:not([multiple]){min-height:42px;max-height:54px}
.afaq-system-body .afaq-card > form.afaq-form select[multiple]{max-height:220px;overflow-y:auto}
.afaq-system-body .afaq-card > form.afaq-form textarea{min-height:96px;resize:vertical}
@media(max-width:760px){
 .afaq-system-body .afaq-card > form.afaq-form:not(.afaq-inline-form):not(.afaq-wizard):not(.afaq-wizard-form):not(.afaq-filter-form):not(.afaq-search-form):has(> label):not(.afaq-special-layout){grid-template-columns:minmax(0,1fr)}
}

/* v7.16.82.115 — ReUI-inspired dashboard primitives, WordPress-native.
   Deliberately scoped to operational dashboards; no React runtime or global reset. */
.afaq-system-body{
 --afaq-reui-border:#dce6e4;--afaq-reui-ring:#168579;
 --afaq-reui-soft:#f7faf9;--afaq-reui-radius:12px;
}
.afaq-system-body .afaq-card{border-color:var(--afaq-reui-border);border-radius:16px;min-width:0}
.afaq-system-body .afaq-card :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]),select,textarea),
.afaq-system-body .afaq-inline-form :is(input:not([type=checkbox]):not([type=radio]),select,textarea){
 box-sizing:border-box;max-width:100%;min-width:0;border:1px solid #cddbd7;border-radius:10px;
 background-color:#fff;transition:border-color .16s ease,box-shadow .16s ease;
}
.afaq-system-body .afaq-card :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]),select,textarea):focus-visible,
.afaq-system-body .afaq-inline-form :is(input,select,textarea):focus-visible{
 outline:2px solid var(--afaq-reui-ring);outline-offset:1px;border-color:var(--afaq-reui-ring);
}
.afaq-system-body .afaq-card select:not([multiple]){min-height:42px;height:auto;max-height:54px}
.afaq-system-body .afaq-card textarea{line-height:1.8;resize:vertical}
.afaq-system-body .afaq-card :is(.afaq-btn,button.afaq-btn){border-radius:10px;min-height:40px;max-width:100%;transition:filter .16s ease,box-shadow .16s ease}
.afaq-system-body .afaq-card :is(.afaq-btn,button.afaq-btn):hover{filter:brightness(.96)}
.afaq-system-body .afaq-card :is(.afaq-btn,button.afaq-btn):focus-visible{outline:2px solid var(--afaq-reui-ring);outline-offset:3px}
.afaq-system-body .afaq-card > form.afaq-form > label{min-width:0;overflow-wrap:anywhere}
.afaq-system-body .afaq-card .afaq-form-grid{gap:14px;min-width:0}
@media(max-width:760px){
 .afaq-system-body .afaq-card .afaq-form-grid{grid-template-columns:minmax(0,1fr)}
 .afaq-system-body .afaq-card :is(input,select,textarea){font-size:16px}
}
@media(prefers-reduced-motion:reduce){
 .afaq-system-body .afaq-card :is(input,select,textarea,.afaq-btn){transition:none!important}
}
