:root{color-scheme:light;--ui-bg:#F7F8FA;--ui-card:#FFFFFF;--ui-text:#17191E;--ui-muted:#596171;--ui-border:#DDE1E7;--ui-accent:#B45320;--ui-accent-hover:#923F17;--ui-soft:#F0F2F5;--ui-head:#FFFFFF;--ui-nav:#FFFFFF;--ui-input:#FFFFFF;--ui-shadow:0 4px 18px #1118270B;--caramel:#B45320!important;--brown:#B45320!important;--cream:#F7F8FA!important;--dark:#17191E!important}
html[data-appearance="dark"]{color-scheme:dark;--ui-bg:#101216;--ui-card:#1C2027;--ui-text:#F8FAFC;--ui-muted:#BCC5D2;--ui-border:#343B46;--ui-accent:#ED8745;--ui-accent-hover:#FA9B60;--ui-soft:#262C35;--ui-head:#15181E;--ui-nav:#15181E;--ui-input:#242A33;--ui-shadow:0 4px 18px #0004;--caramel:#ED8745!important;--brown:#C2632F!important;--cream:#101216!important;--dark:#F8FAFC!important}
html,body{background:var(--ui-bg)!important;color:var(--ui-text)!important}header{background:var(--ui-head)!important;color:var(--ui-text)!important;border-bottom:1px solid var(--ui-border);padding:10px 16px!important;min-height:65px}header strong{font-size:23px!important}header small{color:var(--ui-accent)!important}header .badge{color:var(--ui-muted)!important;border-color:var(--ui-border)!important}.card,.tile,.dh-modal,.dh-modal-content{background:var(--ui-card)!important;color:var(--ui-text)!important;border-color:var(--ui-border)!important;box-shadow:var(--ui-shadow)!important}.tile{min-height:83px!important}.tile b,.setting-link span:first-child{color:var(--ui-accent)!important}.muted,.note,.dh-mini{color:var(--ui-muted)!important}button.primary,.primary{background:var(--ui-accent)!important;color:#fff!important;font-weight:650}button.secondary{background:var(--ui-soft)!important;color:var(--ui-text)!important;border:1px solid var(--ui-border)!important}button.danger{background:#DC2626!important;color:#fff!important;border-color:#DC2626!important}input,select,textarea{background:var(--ui-input)!important;color:var(--ui-text)!important;border-color:var(--ui-border)!important}input::placeholder,textarea::placeholder{color:var(--ui-muted)}nav{background:var(--ui-nav)!important;border-top-color:var(--ui-border)!important}nav button{color:var(--ui-muted)!important}nav button.active{color:var(--ui-accent)!important}.pill{background:var(--ui-soft)!important;color:var(--ui-text)!important}.cal button,.calOrder{background:var(--ui-card)!important;color:var(--ui-text)!important;border-color:var(--ui-border)!important}.cal .today{background:var(--ui-soft)!important}.cal .event{border-bottom:4px solid var(--ui-accent)!important}.orderDetail,.layer,.dh-section{background:var(--ui-soft)!important;color:var(--ui-text)!important;border-color:var(--ui-border)!important}td,th,.stockItem{border-color:var(--ui-border)!important}th{color:var(--ui-muted)!important}.dh-status{display:inline-block;padding:5px 11px;border-radius:999px;font-weight:750;font-size:12px;line-height:1.35;color:#fff!important;background:#64748B}.dh-status-pendente{background:#EAB308!important;color:#171717!important}.dh-status-confirmado,.dh-status-producao{background:#2563EB!important;color:#fff!important}.dh-status-pronto,.dh-status-entregue{background:#16A34A!important;color:#fff!important}.dh-status-cancelado{background:#DC2626!important;color:#fff!important}html[data-appearance="dark"] .dh-status-pendente{background:#FACC15!important;color:#111!important}html[data-appearance="dark"] .dh-status-confirmado,html[data-appearance="dark"] .dh-status-producao{background:#3B82F6!important}html[data-appearance="dark"] .dh-status-pronto,html[data-appearance="dark"] .dh-status-entregue{background:#22C55E!important;color:#102014!important}html[data-appearance="dark"] .dh-status-cancelado{background:#EF4444!important}.appearance-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.appearance-options button{border:1px solid var(--ui-border);background:var(--ui-soft);color:var(--ui-text);padding:12px 4px;border-radius:12px;font-size:13px}.appearance-options button[aria-pressed="true"]{border:2px solid var(--ui-accent);color:var(--ui-accent);font-weight:750}button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid var(--ui-accent);outline-offset:2px}
/* Contrast repair v1.1: original application uses --dark as a text color. */
html[data-appearance="dark"]{--dark:#F8FAFC!important;--cream:#101216!important}
html[data-appearance="dark"] .tile,html[data-appearance="dark"] .card,html[data-appearance="dark"] .dh-modal,html[data-appearance="dark"] .dh-modal-content{background:#1C2027!important;color:#F8FAFC!important;border-color:#343B46!important}
html[data-appearance="dark"] .tile,html[data-appearance="dark"] .tile *,html[data-appearance="dark"] .card h2,html[data-appearance="dark"] .card h3,html[data-appearance="dark"] .card label,html[data-appearance="dark"] .card strong{color:#F8FAFC!important}
html[data-appearance="dark"] .tile b,html[data-appearance="dark"] .tile b *,html[data-appearance="dark"] .card .dh-status{color:inherit}
html[data-appearance="dark"] .tile b{color:#ED8745!important}
html[data-appearance="dark"] .muted,html[data-appearance="dark"] .note,html[data-appearance="dark"] .card .muted,html[data-appearance="dark"] .card .note{color:#BCC5D2!important}
html[data-appearance="dark"] .cal button{background:#262C35!important;color:#F8FAFC!important;border:1px solid #404957!important}
html[data-appearance="dark"] .cal .today{background:#6A3D24!important;color:#FFFFFF!important}
html[data-appearance="dark"] .cal .event{border-bottom:4px solid #ED8745!important}
html[data-appearance="dark"] .calOrder{background:#262C35!important;color:#F8FAFC!important;border-color:#404957!important}
html[data-appearance="dark"] header{background:#15181E!important;color:#FFFFFF!important}
html[data-appearance="dark"] header strong{color:#FFFFFF!important}
html[data-appearance="dark"] header small{color:#ED8745!important}
html[data-appearance="dark"] .orderDetail,html[data-appearance="dark"] .layer,html[data-appearance="dark"] .dh-section{background:#262C35!important;color:#F8FAFC!important}
html[data-appearance="dark"] .layer.selected{background:#34313A!important}
html[data-appearance="dark"] nav{background:#15181E!important}
html[data-appearance="dark"] nav button{color:#D3D8E1!important}
html[data-appearance="dark"] nav button.active{color:#ED8745!important}
html[data-appearance="dark"] button.primary{background:#C7652A!important;color:#FFFFFF!important}
html[data-appearance="dark"] button.secondary{background:#343B46!important;color:#F8FAFC!important}
html[data-appearance="dark"] input,html[data-appearance="dark"] textarea,html[data-appearance="dark"] select{background:#242A33!important;color:#F8FAFC!important;border-color:#4A5360!important}
html[data-appearance="dark"] .pill:not(.dh-status){background:#343B46!important;color:#F8FAFC!important}
html[data-appearance="dark"] .dh-status-pendente{background:#FACC15!important;color:#111827!important}
html[data-appearance="dark"] .dh-status-confirmado,html[data-appearance="dark"] .dh-status-producao{background:#3B82F6!important;color:#FFFFFF!important}
html[data-appearance="dark"] .dh-status-pronto,html[data-appearance="dark"] .dh-status-entregue{background:#22C55E!important;color:#102014!important}
html[data-appearance="dark"] .dh-status-cancelado{background:#EF4444!important;color:#FFFFFF!important}
html[data-appearance="light"] .tile{color:#17191E!important}
html[data-appearance="light"] .cal button{background:#FFFFFF!important;color:#17191E!important}
html[data-appearance="light"] .cal .today{background:#FBE4D3!important}
