/* Semantic appearance layer; business layout and state live in existing modules. */
:root{color-scheme:dark;color:var(--yx-text);background:var(--yx-canvas)}
:root[data-theme="light"]{color-scheme:light}
body{background:var(--yx-canvas);color:var(--yx-text)}
/* Root registered colors animate once. Descendants consume that same frame. */
.theme-changing *,.theme-changing *::before,.theme-changing *::after{transition-property:none!important}
.theme-changing .theme-knob{transition:transform var(--yx-theme-duration) ease!important}
button{transition:box-shadow 140ms ease}
dialog{background:var(--yx-surface);color:var(--yx-text)}
.sidebar{background:var(--yx-sidebar);overflow-y:auto}
.topbar{background:var(--yx-topbar)}
.surface,.product-card,.stat,.auth-card{border-radius:10px;box-shadow:none}
.brand{display:grid;grid-template-columns:46px 1fr;gap:7px 10px;padding:0 5px 22px}
.brand-logo{width:46px;height:46px;border-radius:0;background:transparent}
.brand-title{color:var(--yx-brand-text);font-size:20px}
.brand-caption{font-size:11px;letter-spacing:2px;color:var(--yx-muted)}
.brand-english{grid-column:1/-1;display:flex;flex-direction:column;align-items:center;gap:1px;color:var(--yx-brand-text);font-size:9px;letter-spacing:1.8px;line-height:1.5;white-space:nowrap}
.brand-english span:last-child{font-size:8px;letter-spacing:3.7px}
.auth-brand .brand-english{margin-top:5px;align-items:flex-start;font-size:9px}
.auth-brand img{width:54px;height:54px}
.nav-btn{min-height:44px;position:relative;color:var(--yx-muted)}
.nav-btn.active{background:var(--yx-selected);color:var(--yx-primary)}
.nav-btn.active:after{content:"";position:absolute;left:0;top:9px;bottom:9px;width:3px;background:var(--yx-primary);border-radius:2px}
.nav-btn .count{background:var(--yx-selected);color:var(--yx-primary)}
.nav-group-toggle{width:calc(100% - 16px);min-height:44px;margin:7px 8px}
.sidebar-note{background:var(--yx-subtle-surface);padding:10px}
.sidebar-note b{color:var(--yx-text)}
.user-role{color:var(--yx-muted)}
.avatar,.user-circle{background:var(--yx-avatar);color:var(--yx-avatar-text)}
.btn,.icon-btn{min-height:44px;border-color:var(--yx-border)}
.btn.primary{background:var(--yx-primary);border-color:var(--yx-primary);color:var(--yx-on-primary);box-shadow:none}
.btn.primary:hover{background:var(--yx-primary-hover);border-color:var(--yx-primary-hover);color:var(--yx-on-primary)}
.btn.text{border-color:transparent}
.icon-btn{min-width:44px;height:44px}
input:not([type="checkbox"]):not([type="radio"]),select{min-height:44px}
.workspace{font-size:12px}
input,select,textarea{background:var(--yx-input-surface);color:var(--yx-text);border-color:var(--yx-border)}
input::placeholder,textarea::placeholder{color:var(--yx-subtle);opacity:1}
input[type="checkbox"],input[type="radio"]{accent-color:var(--yx-primary)}
input:disabled,select:disabled,textarea:disabled{background:var(--yx-disabled);color:var(--yx-muted);cursor:not-allowed}
.invalid-input{background:var(--yx-danger-bg)!important;border-color:var(--yx-danger)!important}
.input-error,.form-error{color:var(--yx-danger)}
.badge{background:var(--yx-raised);color:var(--yx-muted)}
.badge.blue{background:var(--yx-info-bg);color:var(--yx-primary)}
.badge.green{background:var(--yx-success-bg);color:var(--yx-success)}
.badge.amber{background:var(--yx-warning-bg);color:var(--yx-warning)}
.badge.red{background:var(--yx-danger-bg);color:var(--yx-danger)}
.notice{background:var(--yx-info-bg);color:var(--yx-muted);border-color:var(--yx-info-border)}
.notice.amber{background:var(--yx-warning-bg);color:var(--yx-warning);border-color:var(--yx-warning-border)}
.notice.red,.form-error{background:var(--yx-danger-bg);color:var(--yx-danger);border-color:var(--yx-error-border)}
.intro-strip b,.quote-cell strong,.stat-value,.product-price,.name{color:var(--yx-text)}
.stat-icon,.customer-icon,.product-icon{background:var(--yx-metric-cyan-bg);color:var(--yx-primary)}
th{background:var(--yx-raised);color:var(--yx-muted)}
td{color:var(--yx-text);border-bottom-color:var(--yx-table-border)}
tbody tr:hover{background:var(--yx-row-hover)}
.pager button{min-width:36px;height:36px}
.pager button.active{background:var(--yx-selected);border-color:var(--yx-primary);color:var(--yx-primary)}
.agent-filter.active{box-shadow:inset 0 0 0 1px var(--yx-primary);background:var(--yx-selected)}
.agent-filter b{color:var(--yx-text)}
.task.verified .task-mark{background:var(--yx-success-bg);color:var(--yx-success)}
.choice:has(input:checked){background:var(--yx-selected);border-color:var(--yx-primary)}
.software-tab.active,.business-step.active{background:var(--yx-selected);border-color:var(--yx-primary)}
.software-tab.active span,.business-step.active>span,.flow-step.current .step-dot{background:var(--yx-primary);color:var(--yx-on-primary)}
.intake-key-fields select{background:var(--yx-input-surface)}
.intake-key-fields label,.review-values dd,.agent-base-values dd{color:var(--yx-text)}
.modal-head,.form-actions,.case-dialog .form-actions,.intake-dialog .form-actions{background:var(--yx-surface)}
.modal-head{gap:12px}
.modal-head>.dialog-title{min-width:0;flex:1}
.dialog-tools{display:flex;align-items:center;gap:12px;flex-shrink:0}
.modal,.drawer{box-shadow:0 24px 80px var(--yx-dialog-shadow)}
.help-toggle{position:relative}
.help-toggle::after{content:"";position:absolute;inset:-10px}
.help-popover{border:1px solid var(--yx-border);background:var(--yx-raised);color:var(--yx-text)}
.toast{background:var(--yx-toast-bg);color:var(--yx-toast-text);border:1px solid var(--yx-toast-border)}
.toast.error{background:var(--yx-danger-bg);color:var(--yx-danger);border-color:var(--yx-error-border)}
.theme-switch{display:inline-flex;align-items:center;justify-content:center;gap:7px;height:44px;flex-shrink:0;padding:0 10px;border:1px solid var(--yx-border);border-radius:8px;background:var(--yx-surface);color:var(--yx-muted);font-family:inherit;font-size:12px;line-height:1.4;white-space:nowrap;cursor:pointer}
.theme-switch:hover{background:var(--yx-hover)}
.theme-track{display:block;width:32px;height:20px;padding:3px;border-radius:20px;background:var(--yx-switch-off)}
.theme-knob{display:block;width:14px;height:14px;border-radius:50%;background:var(--yx-text);transform:translateX(0);transition:transform var(--yx-theme-duration) ease}
[data-theme="light"] .theme-track{background:var(--yx-primary)}
[data-theme="light"] .theme-knob{transform:translateX(12px);background:var(--yx-on-primary)}
[data-theme="dark"] .theme-label-dark,[data-theme="light"] .theme-label-light{font-weight:700;color:var(--yx-text)}
.appearance-settings{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:20px 0;border-bottom:1px solid var(--yx-separator)}
.appearance-settings h3{font-size:16px;margin-bottom:5px}
.appearance-settings p{font-size:12px;color:var(--yx-muted)}
.appearance-settings .theme-storage-note{flex-basis:100%}
.theme-storage-status{position:fixed;bottom:14px;left:50%;transform:translateX(-50%);z-index:200;max-width:90vw;background:var(--yx-warning-bg);color:var(--yx-warning);border:1px solid var(--yx-warning-border);padding:10px 16px;border-radius:8px;font-size:12px}
.auth-appearance{position:absolute;right:28px;top:24px}
.document-appearance{display:flex;justify-content:flex-end;max-width:1100px;margin:18px auto;padding:0 30px}
.theme-switch:focus-visible,button:focus-visible,a:focus-visible{outline:2px solid var(--yx-primary);outline-offset:3px}
@media(max-width:1150px){.topbar{padding:0 22px;gap:14px}.top-actions{gap:8px}.main{padding-left:24px;padding-right:24px}}
@media(max-width:760px){.topbar{padding:10px 14px;display:grid;grid-template-columns:44px minmax(0,1fr);gap:8px}.breadcrumb>svg{display:none}.top-actions{display:grid;grid-template-columns:1fr auto;gap:8px}.top-actions .theme-switch{grid-column:2;grid-row:1}.top-actions .global-start{grid-column:1;grid-row:1;font-size:13px}.top-actions .current-user{grid-column:1;grid-row:2;max-width:none;font-size:12px}.top-actions .workspace{grid-column:2;grid-row:2;max-width:128px}.breadcrumb{align-self:start}.main{padding:20px 14px}.auth-page{padding-top:88px}.auth-appearance{right:20px;top:20px}.modal-head{flex-wrap:wrap;padding:14px 16px}.dialog-title h2{font-size:17px}.dialog-tools{gap:8px}.modal-head .theme-switch{gap:4px;padding:0 7px;font-size:11px}.dialog-title{flex-wrap:wrap}.dialog-title .btn{font-size:12px}.agent-base-values>div{flex-wrap:wrap}.intake-dialog .modal-head{padding:14px 16px}.page-heading{align-items:flex-start;flex-wrap:wrap;gap:14px}.toolbar{flex-wrap:wrap;padding:16px}.filters{flex-wrap:wrap}.form-actions{flex-wrap:wrap}.form-actions .left{margin-right:auto}.auth-brand{font-size:17px}.help-popover{max-width:calc(100vw - 72px)}}
@media(prefers-reduced-motion:reduce){:root{transition:none!important}.theme-knob,.theme-changing .theme-knob{transition:none!important}.toast{animation:none}.spinner{animation:none}}
@media print{:root{color-scheme:light}body{color:black;background:white}.document-appearance,.theme-switch{display:none}.card{background:white;color:black;border-color:#ccc}.card th,.card td{color:black}.meta,.foot{color:#444}}

.subtitle{color:var(--yx-muted)}
.sidebar .brand img{object-fit:contain;object-position:center}
/* v1.6: dense business forms, one appearance control in the personal profile */
.agent-form-section {padding-bottom:20px;border-bottom:1px solid var(--line)}
.agent-form-section>h3,.agent-form-section>.section-title {margin:0 0 16px}
.agent-policy-table {display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:16px}
.policy-table-caption {grid-column:1/-1;display:flex;justify-content:space-between;gap:12px}
.agent-product-policy {padding:16px;border:1px solid var(--line);border-radius:12px;margin:0;background:var(--yx-surface)}
.agent-product-policy .section-title {align-items:start;gap:8px;margin-bottom:12px}
.agent-product-policy .section-title .actions {gap:2px;flex-wrap:wrap;justify-content:flex-end}
.agent-product-policy .section-title .product-policy-mark {width:100%;text-align:right}
.agent-base-values {display:grid;grid-template-columns:1fr;gap:8px}
.agent-base-values>div {display:flex;gap:12px;justify-content:space-between;border-bottom:1px solid var(--line);padding:5px 0}
.agent-base-values dt {font-size:12px;max-width:60%}
.agent-base-values dd {font-size:13px;text-align:right;margin:0}
.agent-policy-editor .form-grid {gap:12px}
.agent-account-section {padding:14px;border:1px solid var(--line);border-radius:10px}
.agency-company {border:1px solid var(--line);border-radius:12px;margin:14px 0;overflow:hidden}
.agency-company>.section-title {padding:14px 18px;margin:0;background:var(--yx-subtle-surface)}
.agency-company td {padding:10px 16px}
.agency-company input[type=number] {max-width:140px}
.factory-reference {background:var(--yx-subtle-surface);border:1px solid var(--line);border-radius:10px;padding:12px;display:flex;flex-direction:column;gap:5px}
.factory-reference b {font-size:20px;color:var(--ink)}
.factory-reference small {color:var(--muted);font-size:12px}
.allocation-panel {border:1px solid var(--line);border-radius:12px;padding:16px;margin-top:16px}
.allocation-panel .section-title {margin-bottom:12px}
.allocation-row {display:grid;grid-template-columns:minmax(0,1fr) minmax(120px,.6fr);gap:16px;margin-top:12px}
.allocation-remaining {padding:12px;margin-top:14px;background:var(--yx-subtle-surface);border-radius:8px;font-size:13px;font-variant-numeric:tabular-nums}
.allocation-remaining.over-limit {color:var(--yx-danger)}
.intake-contract {border-top:1px solid var(--line);padding-top:18px;margin-top:18px}
.contract-attachments .list-row {padding:10px 0;gap:12px}
.contract-source {white-space:pre-wrap;overflow-wrap:anywhere;font:inherit;line-height:1.7;padding:14px;background:var(--yx-subtle-surface)}
.contract-fields table {table-layout:fixed}.contract-fields th:first-child {width:120px}.contract-fields th:last-child{width:90px}.contract-fields td {overflow-wrap:anywhere;white-space:normal}
@media(max-width:800px){.agent-policy-table{grid-template-columns:1fr}.policy-table-caption{flex-direction:column}.agency-company .section-title{align-items:start}.allocation-row{grid-template-columns:1fr}.contract-fields th:first-child{width:80px}.contract-fields th:last-child{width:60px}}
@media(max-width:600px){.top-actions .global-start{grid-column:1;grid-row:1}.top-actions .current-user{grid-column:2;grid-row:1}.top-actions select{grid-column:1/-1;grid-row:2}}

/* Keep personal settings and help visible while the directory can scroll. */
.sidebar{overflow:hidden}.sidebar>.brand,.sidebar>.nav-bottom{flex-shrink:0}.sidebar-nav{flex:1;min-height:0;overflow-y:auto;padding-bottom:8px}.sidebar .nav-bottom{margin-top:10px;padding-top:10px;border-top:1px solid var(--yx-separator)}.sidebar .sidebar-note{font-size:11px;padding:6px 8px;margin-top:4px}.sidebar .sidebar-note b{font-size:11px;margin-bottom:0}.sidebar .personal-entry{margin-top:7px}.sidebar .nav-sub{min-height:40px;padding-top:8px;padding-bottom:8px}.sidebar .nav-divider{margin-top:10px}.sidebar-nav .nav-label{margin-top:0}
