/* Approved visual system. Existing template choices and all application actions remain intact. */
:root {
    --ys-page:#f5f6fb; --ys-surface:#ffffff; --ys-surface-alt:#f0f2f8;
    --ys-ink:#202437; --ys-muted:#626c82; --ys-line:#dce1ed;
    --ys-soft:#f0edf7; --ys-soft-ink:#613394;
    --ys-good:#e4f2eb; --ys-good-ink:#246147;
    --ys-wait:#fbefd9; --ys-wait-ink:#785016;
    --ys-bad:#fae8ed; --ys-bad-ink:#95354f;
    --ys-focus:#7138d7; --ys-shadow:0 8px 28px #25305209;
    --ys-button-gradient:linear-gradient(115deg,#b1289c,#7431c4 52%,#245cc4);
    color-scheme:light;
}
:root[data-ys-scheme="night"] {
    --ys-page:#101523; --ys-surface:#181e2e; --ys-surface-alt:#20283b;
    --ys-ink:#f1f4fc; --ys-muted:#b3bdd2; --ys-line:#343e54;
    --ys-soft:#2c2540; --ys-soft-ink:#dec9ff;
    --ys-good:#173e34; --ys-good-ink:#9de7c7;
    --ys-wait:#44351e; --ys-wait-ink:#f4d495;
    --ys-bad:#452735; --ys-bad-ink:#ffb6c9;
    --ys-focus:#bea0ff; --ys-shadow:0 8px 28px #00000018;
    color-scheme:dark;
}
html[data-ys-scheme] {scroll-padding-top:96px}
html[data-ys-scheme] body {accent-color:#8244d5}
html[data-ys-scheme] body.panel-body {
    --bg:var(--ys-page); --surface:var(--ys-surface); --text:var(--ys-ink);
    --muted:var(--ys-muted); --border:var(--ys-line);
    background:var(--ys-page); color:var(--ys-ink); font-size:14px; line-height:1.55;
}
html[data-ys-scheme] :where(button,input,select,textarea) {font:inherit}
html[data-ys-scheme] :where(button,a,input,select,textarea,summary,[tabindex]):focus-visible {
    outline:3px solid var(--ys-focus); outline-offset:3px;
}
/* Scheme changes repaint text and surfaces together; hover motion stays lightweight. */
html[data-ys-scheme] :where(button,a,input,select,textarea,.card,.template-card,.settings-tabs *) {transition-property:transform,box-shadow,opacity}
html[data-ys-scheme] [hidden] {display:none!important}
html[data-ys-scheme] .content {padding:26px 28px 84px; max-width:1560px; margin-inline:auto; width:100%; box-sizing:border-box}
html[data-ys-scheme] .content-glow {opacity:.4; pointer-events:none}
html[data-ys-scheme=night] .content-glow {opacity:.1}
html[data-ys-scheme] .panel-body {color-scheme:inherit}
html[data-ys-scheme] .topbar {min-height:74px; height:auto; padding:14px 26px; gap:16px; background:var(--ys-surface); border-color:var(--ys-line); color:var(--ys-ink)}
html[data-ys-scheme] .page-identity {min-width:0}
html[data-ys-scheme] .page-identity small {font-size:11px; color:var(--ys-muted); letter-spacing:.05em}
html[data-ys-scheme] .page-identity strong {font-size:18px; color:var(--ys-ink)}
html[data-ys-scheme] .top-actions {gap:10px; flex-shrink:0}
html[data-ys-scheme] .sidebar {scrollbar-width:thin; scrollbar-color:#626585 #151a30}
html[data-ys-scheme] .sidebar .brand {gap:10px; padding:8px 6px 22px}
html[data-ys-scheme] .sidebar .brand>img {width:30px; height:38px; object-fit:contain; flex:0 0 30px}
html[data-ys-scheme] .sidebar .brand strong {font-size:17px; line-height:1.2}
html[data-ys-scheme] .sidebar .brand small {font-size:8px; line-height:1.6}
html[data-ys-scheme] .sidebar .nav-label {font-size:9px; letter-spacing:.13em}
html[data-ys-scheme] .panel-body:not(.sidebar-compact) .sidebar .nav>a {font-size:13px; min-height:44px; padding-block:11px; margin-block:3px}
html[data-ys-scheme] .sidebar-footer {padding-top:14px}
html[data-ys-scheme] .sidebar-footer small {font-size:10px}
html[data-ys-scheme] .card {border:1px solid var(--ys-line); background:var(--ys-surface); color:var(--ys-ink); border-radius:18px; box-shadow:var(--ys-shadow); padding:22px}
html[data-ys-scheme] .card.table-wrap {padding:0; overflow:auto}
html[data-ys-scheme] .card.table-wrap>.section-head {padding:20px 22px 0}
html[data-ys-scheme] .content :where(h1) {font-size:30px; line-height:1.2; letter-spacing:-.035em}
html[data-ys-scheme] .content :where(h2) {font-size:20px; line-height:1.3; letter-spacing:-.025em}
html[data-ys-scheme] .content :where(h3) {font-size:16px; line-height:1.4}
html[data-ys-scheme] .content .muted {color:var(--ys-muted)}
html[data-ys-scheme] .content :where(.overline,.eyebrow) {font-size:10px; letter-spacing:.1em; color:var(--ys-muted)}
html[data-ys-scheme] .content :where(label) {font-size:12px; line-height:1.5; color:var(--ys-ink)}
html[data-ys-scheme] :where(.input,input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=color]),select,textarea) {
    color:var(--ys-ink); background-color:var(--ys-surface); border-color:var(--ys-line); border-radius:11px;
}
html[data-ys-scheme] :where(.input,select,textarea) {font-size:14px; min-height:44px; padding:10px 13px}
html[data-ys-scheme] :where(input,textarea)::placeholder {color:var(--ys-muted); opacity:1}
html[data-ys-scheme] :where(input,select,textarea):disabled {color:var(--ys-muted); background:var(--ys-surface-alt); opacity:1; cursor:not-allowed}
html[data-ys-scheme] input[type=checkbox],html[data-ys-scheme] input[type=radio] {width:17px; height:17px; flex-shrink:0}
html[data-ys-scheme] .btn {min-height:40px; padding:10px 15px; border-radius:11px; font-size:12px; font-weight:750; line-height:1.4; border-color:var(--ys-line); background:var(--ys-surface); color:var(--ys-ink); box-shadow:none}
html[data-ys-scheme] :where(.btn-primary,.site-button,.ys-action.primary,.ys-pill) {background:var(--ys-button-gradient)!important; color:#fff!important; border-color:transparent!important; box-shadow:0 8px 20px #813ac41a}
html[data-ys-scheme] .btn-danger {background:var(--ys-bad); border-color:transparent; color:var(--ys-bad-ink)}
html[data-ys-scheme] :where(.btn,.ys-action,.ys-pill,.site-button):disabled {opacity:.65; cursor:not-allowed}
html[data-ys-scheme] .table {width:100%; border-collapse:collapse; color:var(--ys-ink)}
html[data-ys-scheme] .table th {font-size:10px; font-weight:750; letter-spacing:.06em; padding:13px 16px; background:var(--ys-surface-alt); color:var(--ys-muted); border-color:var(--ys-line)}
html[data-ys-scheme] .table td {font-size:13px; padding:14px 16px; border-color:var(--ys-line); line-height:1.5; color:var(--ys-ink)}
html[data-ys-scheme] .table td :where(small) {font-size:11px; color:var(--ys-muted)}
html[data-ys-scheme] .table tbody tr:hover {background:var(--ys-surface-alt)}
html[data-ys-scheme] .table-wrap {max-width:100%; scrollbar-width:thin}
html[data-ys-scheme] :where(.status-pill,.badge,.order-progress-label) {font-size:11px; line-height:1.5}
html[data-ys-scheme] .status-pill {background:var(--ys-soft); color:var(--ys-soft-ink)}
html[data-ys-scheme] :where(.status-completed,.status-success,.status-active,.alert-success) {background:var(--ys-good)!important; color:var(--ys-good-ink)!important; border-color:var(--ys-good)!important}
html[data-ys-scheme] :where(.status-pending,.status-processing,.status-in_progress,.status-partial,.alert-warning) {background:var(--ys-wait)!important; color:var(--ys-wait-ink)!important; border-color:var(--ys-wait)!important}
html[data-ys-scheme] :where(.status-canceled,.status-cancelled,.status-refunded,.status-failed,.alert-error) {background:var(--ys-bad)!important; color:var(--ys-bad-ink)!important; border-color:var(--ys-bad)!important}
html[data-ys-scheme] .alert {font-size:13px; line-height:1.6; border-radius:12px}
html[data-ys-scheme] .user-menu>summary {gap:10px; color:var(--ys-ink)}
html[data-ys-scheme] .user-menu summary strong {font-size:12px; color:var(--ys-ink)}
html[data-ys-scheme] .user-menu summary small {font-size:10px; color:var(--ys-muted)}
html[data-ys-scheme] :where(.user-menu-popover,.notification-popover,.pwa-sheet>div) {background:var(--ys-surface); color:var(--ys-ink); border-color:var(--ys-line); box-shadow:0 20px 60px #0003}
html[data-ys-scheme] :where(.user-menu-popover,.notification-popover) :where(strong,a,button) {color:var(--ys-ink)}
html[data-ys-scheme] :where(.user-menu-popover,.notification-popover) :where(small,em,p) {color:var(--ys-muted); font-size:11px}
html[data-ys-scheme] .notification-popover-item {background:var(--ys-surface); border-color:var(--ys-line)}
html[data-ys-scheme] .notification-popover-item:hover {background:var(--ys-surface-alt)}
html[data-ys-scheme] .notification-popover-item.is-read {opacity:1}
html[data-ys-scheme] .notification-popover-item.is-read strong {font-weight:500}
html[data-ys-scheme] .notification-bell {color:var(--ys-ink); background:var(--ys-surface-alt); border-color:var(--ys-line); transform:none}
html[data-ys-scheme] .ys-appearance-switch {width:42px; height:42px; min-width:42px; padding:0; display:inline-grid; place-items:center; border:1px solid var(--ys-line); border-radius:12px; background:var(--ys-surface); color:var(--ys-ink); cursor:pointer; vertical-align:middle}
.ys-appearance-switch svg {grid-area:1/1; pointer-events:none}
.ys-appearance-switch .ys-moon {display:none}
[data-ys-scheme=night] .ys-appearance-switch .ys-sun {display:none}
[data-ys-scheme=night] .ys-appearance-switch .ys-moon {display:block}
.ys-system-appearance {position:fixed; top:20px; right:20px; z-index:30}
@media(prefers-reduced-motion:reduce) {
    html[data-ys-scheme],html[data-ys-scheme] *,html[data-ys-scheme] *::before,html[data-ys-scheme] *::after {animation:none!important; transition:none!important; scroll-behavior:auto!important}
    html[data-ys-scheme] [data-tilt] {transform:none!important}
    html[data-ys-scheme] .ys-cursor-glow {display:none}
}
@media(min-width:1101px) {
    html[data-ys-scheme] .panel-body:not(.template-atelier):not(.template-pulse):not(.sidebar-compact) .shell {grid-template-columns:240px minmax(0,1fr)}
}
@media(max-width:1100px) {
    html[data-ys-scheme] .content {padding:22px 20px 82px}
    html[data-ys-scheme] .topbar {padding-inline:20px}
}
@media(max-width:800px) {
    html[data-ys-scheme] .panel-body:not(.nav-open) .sidebar {visibility:hidden}
    html[data-ys-scheme] .panel-body.nav-open .sidebar {visibility:visible}
    html[data-ys-scheme] .mobile-trigger {color:var(--ys-ink); background:var(--ys-surface); border-color:var(--ys-line); margin-right:0; flex-shrink:0}
}
@media(max-width:700px) {
    html[data-ys-scheme] .content {padding:18px 14px 84px}
    html[data-ys-scheme] .topbar {min-height:66px; padding:10px 14px; gap:8px}
    html[data-ys-scheme] .top-actions {gap:7px}
    html[data-ys-scheme] .page-identity strong {font-size:15px}
    html[data-ys-scheme] .user-menu summary>span:nth-child(2),html[data-ys-scheme] .user-menu summary>i {display:none}
    html[data-ys-scheme] .card {padding:18px; border-radius:15px}
    html[data-ys-scheme] .content :where(h1) {font-size:26px}
    html[data-ys-scheme] .content :where(h2) {font-size:19px}
    html[data-ys-scheme] .table-wrap:has(.ys-responsive-table) {overflow:visible}
    html[data-ys-scheme] .ys-responsive-table {display:block; width:100%; min-width:0!important; max-width:100%}
    html[data-ys-scheme] .ys-responsive-table thead {position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap}
    html[data-ys-scheme] .ys-table-header-controls thead {position:static; display:block; width:auto; height:auto; overflow:visible; clip-path:none; white-space:normal}
    html[data-ys-scheme] .ys-table-header-controls thead tr {display:block}
    html[data-ys-scheme] .ys-table-header-controls thead th {position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); padding:0}
    html[data-ys-scheme] .ys-table-header-controls thead th:has(input,button,select,a) {position:static; display:flex; width:auto; height:auto; overflow:visible; clip-path:none; align-items:center; gap:12px; min-height:48px; padding:12px 16px}
    html[data-ys-scheme] .ys-table-header-controls th[data-ys-select-label]::after {content:attr(data-ys-select-label); font-size:12px; color:var(--ys-ink); letter-spacing:0; text-transform:none}
    html[data-ys-scheme] .ys-responsive-table tbody {display:block}
    html[data-ys-scheme] .ys-responsive-table tbody tr {display:grid; grid-template-columns:minmax(0,1fr); padding:14px 16px; border-bottom:1px solid var(--ys-line)}
    html[data-ys-scheme] .ys-responsive-table tbody tr:last-child {border-bottom:0}
    html[data-ys-scheme] .ys-responsive-table td {display:grid; grid-template-columns:minmax(85px,.65fr) minmax(0,1.35fr); align-items:start; column-gap:14px; min-width:0; max-width:none!important; padding:8px 0; border:0; white-space:normal!important; overflow-wrap:anywhere; font-size:13px}
    html[data-ys-scheme] .ys-responsive-table td::before {content:attr(data-ys-label); color:var(--ys-muted); font-size:11px; line-height:1.7; font-weight:650}
    html[data-ys-scheme] .ys-responsive-table td>* {grid-column:2; min-width:0}
    html[data-ys-scheme] .ys-responsive-table td :where(input,select) {max-width:100%}
    html[data-ys-scheme] .ys-responsive-table .ys-table-message td {display:block; text-align:center}
    html[data-ys-scheme] .ys-responsive-table .ys-table-message td::before {content:none}
    html[data-ys-scheme] .notification-popover {right:-100px; width:min(360px,calc(100vw - 28px))}
    html[data-ys-scheme] .ys-appearance-switch {width:38px; min-width:38px; height:38px; border-radius:11px}
    .ys-system-appearance {top:12px; right:12px}
}
@media(max-width:380px) {
    html[data-ys-scheme] .top-actions {gap:5px}
    html[data-ys-scheme] .page-identity strong {font-size:13px}
    html[data-ys-scheme] .ys-responsive-table td {grid-template-columns:82px minmax(0,1fr); column-gap:9px}
}
