/* Shared visual contract for page, primary-card, report and modal headers. */
:is(.app-section-header,.section-header,.dashboard-card-header,.app-report-header,.transactions-report-header,.customer-modal-header,.recipient-modal-header,.store-selection-heading,.store-entry-heading,.financial-summary-modal>header,.transactions-filter-modal>header,.transaction-delete-modal>header,.purchase-modal>header,.product-form-modal>header,.notification-history-modal>header,.recipient-filter-modal>header){position:relative;isolation:isolate;overflow:hidden;direction:rtl;color:#fff;background:linear-gradient(125deg,#087f91 0%,#1275a2 48%,#3158a7 100%);border-color:rgba(255,255,255,.18);box-shadow:0 10px 28px rgba(9,49,91,.16)}
:is(.section-header,.dashboard-card-header,.app-report-header,.transactions-report-header,.customer-modal-header,.recipient-modal-header,.store-selection-heading,.store-entry-heading,.financial-summary-modal>header,.transactions-filter-modal>header,.transaction-delete-modal>header,.purchase-modal>header,.product-form-modal>header,.notification-history-modal>header,.recipient-filter-modal>header)::before,
:is(.section-header,.dashboard-card-header,.app-report-header,.transactions-report-header,.customer-modal-header,.recipient-modal-header,.store-selection-heading,.store-entry-heading,.financial-summary-modal>header,.transactions-filter-modal>header,.transaction-delete-modal>header,.purchase-modal>header,.product-form-modal>header,.notification-history-modal>header,.recipient-filter-modal>header)::after{content:"";position:absolute;z-index:0;border-radius:50%;pointer-events:none;will-change:transform}
:is(.section-header,.dashboard-card-header,.app-report-header,.transactions-report-header,.customer-modal-header,.recipient-modal-header,.store-selection-heading,.store-entry-heading,.financial-summary-modal>header,.transactions-filter-modal>header,.transaction-delete-modal>header,.purchase-modal>header,.product-form-modal>header,.notification-history-modal>header,.recipient-filter-modal>header)::before{width:190px;height:190px;top:-105px;left:-55px;background:rgba(255,255,255,.13);animation:app-header-circle-large 9.7s cubic-bezier(.45,.05,.28,.96) infinite}
:is(.section-header,.dashboard-card-header,.app-report-header,.transactions-report-header,.customer-modal-header,.recipient-modal-header,.store-selection-heading,.store-entry-heading,.financial-summary-modal>header,.transactions-filter-modal>header,.transaction-delete-modal>header,.purchase-modal>header,.product-form-modal>header,.notification-history-modal>header,.recipient-filter-modal>header)::after{width:90px;height:90px;right:38%;bottom:-68px;background:rgba(255,255,255,.08);animation:app-header-circle-small 13.3s cubic-bezier(.37,.08,.2,.98) -3.8s infinite}
:is(.app-section-header,.section-header,.dashboard-card-header,.app-report-header,.transactions-report-header,.customer-modal-header,.recipient-modal-header,.store-selection-heading,.store-entry-heading,.financial-summary-modal>header,.transactions-filter-modal>header,.transaction-delete-modal>header,.purchase-modal>header,.product-form-modal>header,.notification-history-modal>header,.recipient-filter-modal>header)>*{position:relative;z-index:2}
:is(.section-header,.app-report-header,.transactions-report-header,.customer-modal-header,.recipient-modal-header,.financial-summary-modal>header,.transactions-filter-modal>header,.transaction-delete-modal>header,.purchase-modal>header,.product-form-modal>header,.notification-history-modal>header,.recipient-filter-modal>header){display:flex;align-items:center;justify-content:space-between;gap:1rem;min-height:56px;padding:.6rem 1.25rem}
:is(.section-header,.dashboard-card-header,.app-report-header,.transactions-report-header,.customer-modal-header,.recipient-modal-header,.store-selection-heading,.store-entry-heading,.financial-summary-modal>header,.transactions-filter-modal>header,.transaction-delete-modal>header,.purchase-modal>header,.product-form-modal>header,.notification-history-modal>header,.recipient-filter-modal>header) :is(h1,h2,h3,h4,h5,strong){color:#fff}
:is(.section-header,.dashboard-card-header,.app-report-header,.transactions-report-header,.customer-modal-header,.recipient-modal-header,.store-selection-heading,.store-entry-heading,.financial-summary-modal>header,.transactions-filter-modal>header,.transaction-delete-modal>header,.purchase-modal>header,.product-form-modal>header,.notification-history-modal>header,.recipient-filter-modal>header) :is(small,p,.section-kicker){color:rgba(255,255,255,.72)}
:is(.section-header,.app-report-header,.transactions-report-header,.customer-modal-header,.recipient-modal-header,.financial-summary-modal>header,.transactions-filter-modal>header,.transaction-delete-modal>header,.purchase-modal>header,.product-form-modal>header,.notification-history-modal>header,.recipient-filter-modal>header) :is(.secondary-button,.small-button,.report-filter-button,.recipient-filter-button,.modal-close-button){color:#fff;border-color:rgba(255,255,255,.3);background:rgba(255,255,255,.14);box-shadow:none;backdrop-filter:blur(8px)}
.dashboard-card-header{min-height:56px;padding:.6rem 1.15rem;border-radius:inherit;border-end-start-radius:0;border-end-end-radius:0}.dashboard-header-icon{border-color:rgba(255,255,255,.28);color:#fff;background:rgba(255,255,255,.16);box-shadow:0 8px 22px rgba(9,49,91,.2)}
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) :is(.app-section-header,.section-header,.dashboard-card-header,.app-report-header,.transactions-report-header,.customer-modal-header,.recipient-modal-header,.store-selection-heading,.store-entry-heading,.financial-summary-modal>header,.transactions-filter-modal>header,.transaction-delete-modal>header,.purchase-modal>header,.product-form-modal>header,.notification-history-modal>header,.recipient-filter-modal>header){color:#f5f8fc;background:linear-gradient(125deg,#172b43 0%,#142338 53%,#173934 145%);border-color:rgba(138,177,210,.15);box-shadow:none}
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) :is(.section-header,.dashboard-card-header,.app-report-header,.transactions-report-header,.customer-modal-header,.recipient-modal-header,.store-selection-heading,.store-entry-heading,.financial-summary-modal>header,.transactions-filter-modal>header,.transaction-delete-modal>header,.purchase-modal>header,.product-form-modal>header,.notification-history-modal>header,.recipient-filter-modal>header)::before{background:rgba(110,231,197,.09)}
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) :is(.section-header,.dashboard-card-header,.app-report-header,.transactions-report-header,.customer-modal-header,.recipient-modal-header,.store-selection-heading,.store-entry-heading,.financial-summary-modal>header,.transactions-filter-modal>header,.transaction-delete-modal>header,.purchase-modal>header,.product-form-modal>header,.notification-history-modal>header,.recipient-filter-modal>header)::after{background:rgba(126,169,214,.07)}
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .dashboard-header-icon{color:#7cf1d1;background:rgba(90,222,187,.12);border-color:rgba(124,241,209,.14)}
@keyframes app-header-circle-large{0%{transform:translate3d(-5px,-2px,0) scale(.98)}17%{transform:translate3d(14px,7px,0) scale(1.07)}38%{transform:translate3d(5px,18px,0) scale(1.02)}57%{transform:translate3d(-13px,11px,0) scale(1.09)}76%{transform:translate3d(-18px,-7px,0) scale(1.03)}91%{transform:translate3d(7px,-13px,0) scale(1.06)}100%{transform:translate3d(-5px,-2px,0) scale(.98)}}@keyframes app-header-circle-small{0%{transform:translate3d(3px,2px,0) scale(1)}14%{transform:translate3d(-15px,-10px,0) scale(1.1)}33%{transform:translate3d(-5px,-22px,0) scale(1.04)}51%{transform:translate3d(17px,-13px,0) scale(.96)}69%{transform:translate3d(22px,6px,0) scale(1.08)}86%{transform:translate3d(-8px,14px,0) scale(1.02)}100%{transform:translate3d(3px,2px,0) scale(1)}}
.app-section-header::before{animation:app-header-circle-large 9.7s cubic-bezier(.45,.05,.28,.96) infinite}.app-section-header::after{animation:app-header-circle-small 13.3s cubic-bezier(.37,.08,.2,.98) -3.8s infinite}
@media(max-width:480px){.section-header{align-items:stretch;flex-direction:column}.section-header>button{width:100%}:is(.app-report-header,.transactions-report-header,.customer-modal-header,.recipient-modal-header,.financial-summary-modal>header,.transactions-filter-modal>header,.transaction-delete-modal>header,.purchase-modal>header,.product-form-modal>header,.notification-history-modal>header,.recipient-filter-modal>header){align-items:center;flex-direction:row}:is(.section-header,.dashboard-card-header,.app-report-header,.transactions-report-header,.customer-modal-header,.recipient-modal-header,.store-selection-heading,.store-entry-heading) :is(h1,h2,h3){white-space:normal}}
@media(prefers-reduced-motion:reduce){:is(.app-section-header,.section-header,.dashboard-card-header,.app-report-header,.transactions-report-header,.customer-modal-header,.recipient-modal-header,.store-selection-heading,.store-entry-heading,.financial-summary-modal>header,.transactions-filter-modal>header,.transaction-delete-modal>header,.purchase-modal>header,.product-form-modal>header,.notification-history-modal>header,.recipient-filter-modal>header)::before,:is(.app-section-header,.section-header,.dashboard-card-header,.app-report-header,.transactions-report-header,.customer-modal-header,.recipient-modal-header,.store-selection-heading,.store-entry-heading,.financial-summary-modal>header,.transactions-filter-modal>header,.transaction-delete-modal>header,.purchase-modal>header,.product-form-modal>header,.notification-history-modal>header,.recipient-filter-modal>header)::after{animation:none}}

.app-modal-footer{display:flex;flex:0 0 auto;justify-content:flex-end;gap:10px;width:100%;padding:14px 22px;border-top:1px solid var(--md-border,#e2e8f0);background:var(--md-surface-2,#f8fafc)}.app-modal-footer button{width:auto;min-width:112px;max-width:100%;min-height:44px;height:auto;padding-block:8px;line-height:1.45;white-space:normal;overflow-wrap:anywhere;text-align:center}@media(max-width:600px){.app-modal-footer{padding-inline:16px}.app-modal-footer button{flex:1;min-width:0}}

:is(.app-report-modal,.transactions-report-modal,.financial-summary-modal,.transactions-filter-modal,.transaction-delete-modal,.message-history-modal,.recipient-modal,.recipient-filter-modal,.contact-modal,.purchase-modal,.product-picker-modal,.product-form-modal,.customer-modal,.category-editor,.store-entry-dialog){display:flex;flex-direction:column;max-height:calc(100dvh - 40px);overflow:hidden;padding:0;border:1px solid var(--md-border,#e2e8f0);border-radius:22px;background:var(--md-surface,#fff);box-shadow:0 30px 90px rgba(15,23,42,.42)}
:is(.app-report-content,.transactions-report-content,.message-history-content,.recipient-results,.contact-modal-body,.product-multi-menu,.product-form-grid,.customer-modal-body,.category-editor-body,.transaction-filter-grid,.supplier-form,.store-entry-create){flex:1 1 auto;min-height:0;overflow-y:auto}
:is(.product-form-modal,.category-editor,.customer-modal,.product-picker-modal,.purchase-modal,.contact-modal,.transactions-filter-modal,.transaction-delete-modal,.store-entry-dialog)>footer{display:flex;flex:0 0 auto;justify-content:flex-end;gap:10px;width:100%;margin:0;padding:14px 22px;border-top:1px solid var(--md-border,#e2e8f0);background:var(--md-surface-2,#f8fafc)}
:is(.product-form-modal,.category-editor,.customer-modal,.product-picker-modal,.purchase-modal,.contact-modal,.transactions-filter-modal,.transaction-delete-modal,.store-entry-dialog)>footer button{width:auto;min-width:112px;max-width:100%;min-height:44px;height:auto;padding-block:8px;line-height:1.45;white-space:normal;overflow-wrap:anywhere;text-align:center}
@media(max-width:600px){:is(.app-report-modal,.transactions-report-modal,.financial-summary-modal,.transactions-filter-modal,.transaction-delete-modal,.message-history-modal,.recipient-modal,.recipient-filter-modal,.contact-modal,.purchase-modal,.product-picker-modal,.product-form-modal,.customer-modal,.category-editor,.store-entry-dialog){width:100%;max-height:92dvh;border-radius:24px 24px 0 0}:is(.product-form-modal,.category-editor,.customer-modal,.product-picker-modal,.purchase-modal,.contact-modal,.transactions-filter-modal,.transaction-delete-modal,.store-entry-dialog)>footer{padding-inline:16px}:is(.product-form-modal,.category-editor,.customer-modal,.product-picker-modal,.purchase-modal,.contact-modal,.transactions-filter-modal,.transaction-delete-modal,.store-entry-dialog)>footer button{flex:1;min-width:0}}

/* AppSectionHeader owns its palette; keep the shared contract from flattening its variants. */
.app-section-header[class*="app-section-header--"]{background:linear-gradient(125deg,var(--header-from,#087f91),var(--header-mid,#1275a2) 52%,var(--header-to,#3158a7));border-color:rgba(255,255,255,.18)}
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .app-section-header[class*="app-section-header--"]{background:linear-gradient(125deg,color-mix(in srgb,var(--header-from,#087f91) 60%,#111827),color-mix(in srgb,var(--header-mid,#1275a2) 52%,#0f172a) 52%,color-mix(in srgb,var(--header-to,#3158a7) 58%,#111827))}
.app-section-header__actions :is(.secondary-button,.small-button){color:#fff;border-color:rgba(255,255,255,.3);background:rgba(255,255,255,.14);box-shadow:none;backdrop-filter:blur(8px)}
.dashboard-card-header.header-sky{background:linear-gradient(125deg,#0369a1,#0284c7 55%,#2563eb)}.dashboard-card-header.header-teal{background:linear-gradient(125deg,#0f766e,#0d9488 55%,#047857)}.dashboard-card-header.header-amber{background:linear-gradient(125deg,#b45309,#d97706 55%,#c2410c)}.dashboard-card-header.header-violet{background:linear-gradient(125deg,#6d28d9,#7c3aed 55%,#9333ea)}.dashboard-card-header.header-indigo{background:linear-gradient(125deg,#3730a3,#4f46e5 55%,#2563eb)}.dashboard-card-header.header-blue{background:linear-gradient(125deg,#1d4ed8,#2563eb 55%,#0369a1)}.dashboard-card-header.header-rose{background:linear-gradient(125deg,#be123c,#e11d48 55%,#be185d)}
.dashboard-header-icon{position:relative;animation:app-header-icon-float 4.2s ease-in-out infinite}.dashboard-header-icon::after{content:"";position:absolute;inset:-4px;border:1px solid rgba(255,255,255,.2);border-radius:inherit;animation:app-header-icon-ring 4.2s ease-out infinite}
@keyframes app-header-icon-float{0%,100%{transform:translateY(0) rotate(0)}50%{transform:translateY(-3px) rotate(-5deg)}}@keyframes app-header-icon-ring{0%,48%{opacity:0;transform:scale(.88)}62%{opacity:.55}95%,100%{opacity:0;transform:scale(1.18)}}
@media(prefers-reduced-motion:reduce){.dashboard-header-icon,.dashboard-header-icon::after{animation:none}}
.header-sky .dashboard-header-icon{color:#67e8f9;background:#164e63;animation-duration:3.6s;animation-delay:-.4s}.header-teal .dashboard-header-icon{color:#6ee7b7;background:#064e3b;animation-duration:4.3s;animation-delay:-2.1s}.header-amber .dashboard-header-icon{color:#fde68a;background:#78350f;animation-duration:3.9s;animation-delay:-1.2s}.header-violet .dashboard-header-icon{color:#e9d5ff;background:#4c1d95;animation-duration:4.8s;animation-delay:-3.3s}.header-indigo .dashboard-header-icon{color:#c7d2fe;background:#312e81;animation-duration:3.4s;animation-delay:-1.8s}.header-blue .dashboard-header-icon{color:#bfdbfe;background:#1e3a8a;animation-duration:4.5s;animation-delay:-2.7s}.header-rose .dashboard-header-icon{color:#fecdd3;background:#881337;animation-duration:3.75s;animation-delay:-.9s}
:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .header-sky .dashboard-header-icon{color:#67e8f9;background:#164e63}:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .header-teal .dashboard-header-icon{color:#6ee7b7;background:#064e3b}:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .header-amber .dashboard-header-icon{color:#fde68a;background:#78350f}:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .header-violet .dashboard-header-icon{color:#e9d5ff;background:#4c1d95}:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .header-indigo .dashboard-header-icon{color:#c7d2fe;background:#312e81}:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .header-blue .dashboard-header-icon{color:#bfdbfe;background:#1e3a8a}:is(html[data-theme="dark"],html[data-theme-mode="dark"]) .header-rose .dashboard-header-icon{color:#fecdd3;background:#881337}
.dashboard-card-header{background-size:175% 175%;animation:dashboard-header-drift 17s ease-in-out infinite}.dashboard-card-header:nth-of-type(2n){animation-duration:21s;animation-delay:-6s}.dashboard-card-header:nth-of-type(3n){animation-duration:14s;animation-delay:-9s}@keyframes dashboard-header-drift{0%,100%{background-position:0 50%}38%{background-position:85% 18%}71%{background-position:100% 82%}}
@media(prefers-reduced-motion:reduce){.dashboard-card-header{animation:none}}

:is(.store-selection-heading,.store-entry-heading){min-height:56px;padding-block:.6rem;}
