/* TEDY ERP M18.1 luxury consistency & mobile scroll containment.
   PRESENTATION ONLY. Do not suppress permission, validation, totals, statuses or audit info. */
html[data-m18-ui]{--m181-forest:#001b12;--m181-surface:#08291e;--m181-surface2:#0b3626;--m181-gold:#eacb85;--m181-border:rgba(214,171,92,.56);--m181-ink:#f3f7f0;--m181-muted:#b9d0c2;color-scheme:dark;max-width:100%;overflow-x:clip!important}
html[data-m18-ui] body{width:100%;max-width:100%;overflow-x:clip!important}
html[data-m18-ui] #app,html[data-m18-ui] #app .app-shell,html[data-m18-ui] #app .main-wrap,html[data-m18-ui] #app #main{box-sizing:border-box!important;min-width:0!important;width:100%;max-width:100%!important;overflow-x:clip!important}
/* The OLD dashboard was generated by control-v29.js as section.ctrl-hero.card,
   not by the section.card.hero rule previously deployed. Hide only the legacy
   marketing panel on the OWNER dashboard, preserving KPIs, reports and actions. */
html[data-m18-ui] #app #main.m18-owner-dashboard :is(.ctrl-hero,.card.hero,.r38-dashboard-hero,.r38-ctrl-owner-dashboard-hero),
html[data-m18-ui] #app #main.m18-owner-dashboard [data-m181-legacy-hero]{display:none!important}
html[data-m18-ui] #app #main.m18-owner-dashboard>.m18-welcome{max-width:100%;width:100%;margin-inline:auto}
html[data-m18-ui] #app #main.m18-owner-dashboard .m18-photo{border:2px solid var(--m181-gold);box-shadow:0 14px 36px #0008,0 0 0 1px #a9834350}
html[data-m18-ui] #app #main.m18-owner-dashboard .m18-brand-title{font-size:clamp(17px,4.85vw,29px)!important;line-height:1.33!important}
html[data-m18-ui] #app #main.m18-owner-dashboard .m18-photo img{object-fit:contain!important}
html[data-m18-ui] #app #main.m18-owner-dashboard :is(.ctrl-kpi-grid,.grid,.ctrl-quick-grid,.ctrl-dashboard-section){max-width:100%;min-width:0}
html[data-m18-ui] #app #main :is(.ctrl-kpi-grid,.ctrl-quick-grid,.grid){min-width:0;max-width:100%;box-sizing:border-box}
html[data-m18-ui] #app #main :is(.ctrl-kpi-grid,.ctrl-quick-grid,.grid)>*{min-width:0;box-sizing:border-box;max-width:100%}
/* Stable compact header at every role; branch and language controls must shrink. */
@media (max-width:900px){
 html[data-m18-ui] #app .topbar{width:100%;max-width:100%;box-sizing:border-box;padding:7px 8px!important;gap:5px!important;flex-wrap:nowrap!important;overflow:visible;min-height:54px!important}
 html[data-m18-ui] #app .topbar .menu-toggle{width:40px!important;min-width:40px;flex:none;padding:0!important}
 html[data-m18-ui] #app .topbar>.branch-context-m6{max-width:none!important;flex:1 1 0!important;min-width:0!important;width:auto!important}
 html[data-m18-ui] #app .topbar .m18-language-slot{max-width:95px!important;min-width:64px!important;flex:0 1 95px!important;width:auto!important}
 html[data-m18-ui] #app .topbar .topbar-actions{flex:0 0 auto!important;min-width:0!important;margin:0!important}
 html[data-m18-ui] #app .topbar .avatar{min-width:39px!important;width:39px!important;height:39px!important}
 html[data-m18-ui] #app .topbar :is(select,.tedy-m16-branch-label){box-sizing:border-box!important;max-width:100%!important;min-width:0!important}
 html[data-m18-ui] #app #sidebar{overscroll-behavior:contain!important;touch-action:pan-y!important;-webkit-overflow-scrolling:touch!important;overscroll-behavior-x:none!important}
 html[data-m18-ui].m18-menu-open #app .main-wrap{touch-action:none!important}
 html[data-m18-ui].m18-menu-open #app #sidebar{touch-action:pan-y!important;overscroll-behavior-y:contain!important}
}
@media(max-width:380px){html[data-m18-ui] #app .topbar{padding:5px 5px!important;gap:4px!important}html[data-m18-ui] #app .topbar .menu-toggle{width:36px!important;min-width:36px!important}html[data-m18-ui] #app .topbar .avatar{width:36px!important;min-width:36px!important;height:36px!important}html[data-m18-ui] #app .topbar .m18-language-slot{min-width:60px!important;flex-basis:77px!important}}
/* All roles share one coherent dark emerald/gold palette, without changing data, forms or access. */
html[data-m18-ui] #app #main :is(.card,.ctrl-card,.ctrl-panel,.ctrl-kpi,.kpi,.product-card,.panel,.notice),
html[data-m18-ui] #modalRoot :is(.card,.modal,.modal-body,.panel),
html[data-m18-ui] #app #sidebar :is(.nav-group,.sidebar-footer){border-color:var(--m181-border)!important;box-shadow:0 6px 19px rgba(0,0,0,.22);background-color:var(--m181-surface)!important;color:var(--m181-ink)!important}
html[data-m18-ui] #app #main :is(.card,.ctrl-card,.ctrl-panel,.kpi,.ctrl-kpi){border-radius:15px!important;background-image:linear-gradient(155deg,#0a3526,#041e16)!important}
html[data-m18-ui] #app #main :is(.ctrl-kpi,.kpi) :is(b,.kpi-value,.ctrl-value){color:var(--m181-gold)!important}
html[data-m18-ui] #app #main :is(.ctrl-kpi,.kpi) :is(small,.kpi-note){color:var(--m181-muted)!important}
html[data-m18-ui] #app #main :is(.page-head h1,.card h2,.card h3,.ctrl-card h2,.ctrl-card h3){color:#efd393;line-height:1.35}
html[data-m18-ui] #app #main :is(.card,.ctrl-card,.panel,.form-grid,.toolbar,.actions,.ctrl-kpi){overflow-wrap:anywhere}
html[data-m18-ui] #app #main :is(input:not([type=checkbox]):not([type=radio]),select,textarea,.search-input),
html[data-m18-ui] #modalRoot :is(input:not([type=checkbox]):not([type=radio]),select,textarea),
html[data-m18-ui] .tedy-m17-overlay :is(input,select,textarea){max-width:100%!important;box-sizing:border-box!important;min-width:0!important;background-color:#062a1e!important;color:#f3f8f0!important;border:1px solid #a78b59!important;border-radius:10px!important}
html[data-m18-ui] #app #main :is(input,textarea)::placeholder,html[data-m18-ui] #modalRoot :is(input,textarea)::placeholder{color:#b4cbbd!important;opacity:.82}
html[data-m18-ui] #app #main :is(.btn,button:not(.m18-scroll-tip)),html[data-m18-ui] #modalRoot :is(.btn,button){border-radius:11px;max-width:100%;box-sizing:border-box}
html[data-m18-ui] #app #main :is(.btn,.ctrl-action,.btn.gold):not(.primary):not(.danger){border-color:#d0aa6382!important;background-color:#123b2a;color:#f4e4bf}
html[data-m18-ui] #app #main :is(.btn.primary,button.primary){background:linear-gradient(130deg,#008a59,#076b48)!important;border-color:#56b48b!important;color:#fff!important}
/* Retain distinct red/destructive and orange/caution semantics. */
html[data-m18-ui] #app #main :is(.danger,.btn.danger),html[data-m18-ui] #modalRoot :is(.danger,.btn.danger){color:#ffe8e8!important}
html[data-m18-ui] #app #main :is(.table-wrap,.tf-r526-tablewrap,.r414-table-wide),html[data-m18-ui] #modalRoot :is(.table-wrap,.tf-r526-tablewrap,.r414-table-wide){min-width:0!important;max-width:100%!important;overscroll-behavior-x:contain!important}
html[data-m18-ui] #app #main :is(table,td,th),html[data-m18-ui] #modalRoot :is(table,td,th){border-color:#b58b5044!important}
html[data-m18-ui] #app #main :is(th,.table-wrap thead),html[data-m18-ui] #modalRoot :is(th,.table-wrap thead){background-color:#123a29!important;color:#f3da9d!important}
html[data-m18-ui] #app #main :is(td,th,.code),html[data-m18-ui] #modalRoot :is(td,th,.code){overflow-wrap:anywhere}
html[data-m18-ui] #modalRoot :is(.modal,.modal-body,.modal-head,.modal-foot){background-color:#06261c!important;color:var(--m181-ink)!important;border-color:#b08e555d!important}
html[data-m18-ui] #modalRoot .modal-head{color:#f2ce86!important}
html[data-m18-ui] #app #sidebar .brand img{object-fit:contain;max-width:58px;max-height:58px;filter:drop-shadow(0 2px 4px #e1b45e22)}
/* Other user dashboards retain their work data, but promotional legacy banner is
   styled with the SAME palette. Only owner's duplicated legacy block is hidden. */
html[data-m18-ui] #app #main:not(.m18-owner-dashboard) .ctrl-hero{border:1px solid var(--m181-border)!important;border-radius:18px!important;background:linear-gradient(145deg,#002317,#0a3d2b)!important;box-shadow:0 12px 30px #0005;overflow:hidden}
html[data-m18-ui] #app #main:not(.m18-owner-dashboard) .ctrl-hero :is(h1,h2){font-size:clamp(20px,5vw,30px)!important;color:var(--m181-gold)!important}
html[data-m18-ui] #app #main:not(.m18-owner-dashboard) .ctrl-hero :is(.ctrl-eyebrow,.ctrl-hero-copy p){font-size:12px!important;line-height:1.5!important}
/* Never treat system errors, statuses, required hints and warnings as "unnecessary text". */
@media(prefers-reduced-motion:reduce){html[data-m18-ui] *{scroll-behavior:auto!important;animation-duration:.001ms!important;transition-duration:.001ms!important}}

/* Smaller first impression on all non-owner dashboards; operational cards remain immediately below. */
html[data-m18-ui] #app #main.m181-staff-dashboard :is(.ctrl-hero,.card.hero){display:none!important}
html[data-m18-ui] #app #main .m181-staff-brand{width:100%;max-width:100%;box-sizing:border-box;display:flex;align-items:center;gap:13px;margin:0 0 15px;padding:12px 13px;border-radius:15px;border:1px solid var(--m181-border);background:linear-gradient(120deg,#003b26,#001d15);box-shadow:0 6px 21px #0005}
html[data-m18-ui] #app #main .m181-staff-brand img{display:block;width:54px;height:54px;object-fit:contain;flex:none}
html[data-m18-ui] #app #main .m181-staff-brand h2{min-width:0;margin:0;font-size:clamp(14px,3.9vw,19px);line-height:1.4;letter-spacing:0;color:#f0d18b;font-weight:800}
html[data-m18-ui] #app #main .m181-staff-brand h2 span{display:block}
@media(max-width:380px){html[data-m18-ui] #app #main .m181-staff-brand{gap:8px;padding:9px}html[data-m18-ui] #app #main .m181-staff-brand img{width:43px;height:43px}}
/* Startup uses the same brand mark and palette before the app JS boot completes. */
#splash.splash{box-sizing:border-box;min-height:100dvh;width:100%;max-width:100%;padding:24px;background:radial-gradient(ellipse at 50% 40%,#12452c99,#001b12 70%);color:#f0d18b;text-align:center}
#splash.splash img{display:block;margin:0 auto 12px;width:min(98px,23vw);height:auto;object-fit:contain;filter:drop-shadow(0 3px 10px #bf924459)}
#splash.splash h1{font-size:clamp(19px,5vw,29px);line-height:1.55;font-weight:800;color:#f0d18b;margin:10px auto;max-width:580px}
#splash.splash p{color:#dae5d4;font-size:13px}
