/* Reference-inspired interface. Screen-only: printed documents retain their design. */
@media screen {
    :root {
        --ink: #262624;
        --muted: #73736d;
        --line: #e1dfd8;
        --bg: #f3f2ed;
        --green: var(--accent-ink); /* Compatibility with existing UI components. */
        --accent: #ff6428;
        --accent-ink: #a43c18;
        --accent-border: #dfb798;
        --surface: #faf9f6;
        --flow-customer: #b94417;
        --flow-item: #96502d;
        --accent-soft: #fff0e7;
    }
    body { background: var(--bg); color: var(--ink); }
    .topbar { background: #faf9f6; border-bottom-color: var(--line); padding: 20px 3%; }
    .brand { font-size: 29px; letter-spacing: -1.5px; }
    .brand-mark { background: #282826; color: var(--accent); border-radius: 4px; box-shadow: none; }
    .brand-label { color: var(--muted); }
    .button { border-radius: 5px; min-height: 44px; }
    .primary { background: #282826; color: #fff; box-shadow: 4px 4px 0 var(--accent); }
    .primary:hover:not(:disabled) { background: #41413c; box-shadow: 2px 2px 0 var(--accent); }
    .primary:disabled { box-shadow: none; }
    .secondary { border-color: var(--line); color: #4b4b45; background: #fff; }
    .secondary:hover:not(:disabled) { border-color: #c3bdb1; background: #f5f3ed; }
    .button span#invoice-count,.button span#quote-count { background: #f0eee7; color: #54534d; border-radius: 3px; }
    :where(button,a,input,textarea,select,[tabindex]):focus-visible { outline: 3px solid #b94417; outline-offset: 3px; }
    .eyebrow { color: #74736b; letter-spacing: 1.8px; }
    .page-heading .eyebrow::before,.dashboard-heading .eyebrow::before { content: ''; display: inline-block; width: 23px; height: 2px; margin: 0 12px 3px 0; background: var(--accent); }
    .workspace-nav { margin-bottom: 24px; border-bottom-color: #d9d6cc; }
    .workspace-views { background: #e7e5dd; border-radius: 6px; }
    .workspace-nav button { color: #6d6c65; border-radius: 4px; }
    .workspace-nav button.active,.workspace-nav button.active:hover { background: #282826; color: #fff; box-shadow: none; }
    .workspace-nav button:hover { color: #a73b13; background: var(--accent-soft); }
    .workspace-shortcuts button { border: 1px solid #d9d6cc; background: #faf9f6; }
    .page-heading { position: relative; isolation: isolate; padding: 32px 36px; min-height: 172px; background: #e9e7df; border-left: 4px solid var(--accent); overflow: hidden; border-radius: 4px; }
    .page-heading::after { content: '';  position: absolute; right: 40px; bottom: -54px; font-size: 250px; font-weight: 800; letter-spacing: -22px; line-height: 1; color: #dcd9cf; z-index: -1; pointer-events: none; }
    .page-heading h1 { font-size: clamp(28px,3.1vw,46px); letter-spacing: -1.8px; max-width: 900px; }
    .page-heading p { color: #65645e; }
    .overview-create { flex-shrink: 0; }
    .workflow-guide { gap: 0; border-block: 1px solid var(--line); background: #faf9f6; }
    .workflow-guide button { border: 0; border-right: 1px solid var(--line); border-radius: 0; background: transparent; padding: 18px 22px; }
    .workflow-guide button:last-child { border-right: 0; }
    .workflow-guide button:hover { background: #fff5ed; }
    .workflow-number { background: transparent; color: #ac401a; border-radius: 0; font-size: 22px; font-weight: 500; }
    .workflow-guide .complete .workflow-number { background: #282826; color: var(--accent); border-radius: 4px; }
    .panel { border-radius: 8px; border-color: var(--line); box-shadow: 0 5px 22px #36302306; }
    .panel-heading { background: #faf9f6; border-bottom-color: var(--line); }
    .panel-heading h2 { letter-spacing: -.4px; font-weight: 700; }
    .step { background: var(--accent-soft); color: #a93b13; border-radius: 3px; }
    .builder { border-color: #ccc6b9; box-shadow: 0 8px 30px #3630230a; }
    .builder>.panel-heading { background: #282826; color: #fff; }
    .builder>.panel-heading .step { background: #40403b; color: #ff956e; }
    .builder>.panel-heading .badge { color: #ffb291; background: #46403a; border-radius: 3px; }
    .document-title h3 { font-size: 26px; letter-spacing: -.9px; }
    .document-type-switch { background: #f0eee8; border-color: var(--line); border-radius: 6px; }
    .document-type-switch .button { color: #6d6c65; }
    .document-type-switch .button.active { background: #fff; color: #a93b13; box-shadow: inset 0 -2px var(--accent),0 2px 5px #3630230a; }
    .search { background: #f5f4ef; border-radius: 5px; }
    .search:focus-within { border-color: #b94417; box-shadow: 0 0 0 3px #ff642d14; }
    input:focus,textarea:focus,select:focus { border-color: #b94417; }
    .initials { background: #eeebe3; color: #6b5d4e; border-radius: 5px; }
    .customer-card,.catalog-card { border-radius: 6px; }
    .customer-card:hover,.catalog-card:hover { border-color: #c9c1b3; background: #fffdfa; }
    .customer-card.selected { border-color: #deab8f; background: #fff7ef; box-shadow: inset 3px 0 var(--accent); }
    .customer-actions [data-customer-invoices],.customer-actions [data-customer-quotes] { color: #59544b; border-color: var(--line); }
    .customer-actions [data-customer-invoices]:hover,.customer-actions [data-customer-quotes]:hover { background: var(--accent-soft); border-color: #deab8f; }
    .text-button { color: #6e675c; }
    .text-button:hover:not(:disabled) { color: #a73b13; }
    .icon-button:hover:not(:disabled) { background: #fff0e7; color: #a73b13; }
    #add-customer,#add-item,.catalog-card .card-actions [data-add-item] { background: #282826; color: #fff; border-radius: 4px; }
    #add-customer:hover,#add-item:hover,.catalog-card .card-actions [data-add-item]:hover { background: #a73b13; }
    .drop-zone { background: #faf9f5; border-color: #d8d0c3; border-radius: 6px; }
    .drop-zone strong { color: #5e594e; }
    .drop-icon { color: #b94417; }
    .drop-zone:hover,.drop-zone.drag-over { background: #fff2e8; border-color: #b94417; }
    .customer-drop.has-customer { background: #fff7ef; border-color: #dfbba1; }
    .builder-footer { background: #f2f0e9; border-top-color: var(--line); padding-block: 22px; }
    .organization { background: #f7f6f1; border-color: var(--line); border-radius: 5px; }
    .folder-node.active,.organization-record.active,.organization-record:hover { color: #a43c18; background: #fff0e5; border-color: #e6bfa6; }
    .folder-node.drag-over { background: #ffe2cf; border-color: #b94417; }
    .folder-node small,.record-grip { color: #777268; }
    .catalog-tip { background: #f1eee5; }
    .catalog-tip>span { color: #b94417; }
    .catalog-tip strong { color: #4d493f; }
    .catalog-tip p { color: #757065; }
    .mini-preview { background: #e9e6dd; }
    .dashboard { border: 0; padding: 26px 0; background: transparent; border-radius: 0; }
    .dashboard-heading h2 { font-size: 25px; letter-spacing: -.8px; }
    .metric-card { position: relative; border-radius: 6px; border-color: var(--line); padding: 24px 18px; box-shadow: 0 4px 12px #36302304; }
    .metric-card::before { content: ''; position: absolute; top: 0; left: 18px; width: 24px; height: 3px; background: #d6d1c5; }
    .metric-card h3 { color: #6d685f; }
    .metric-card p { color: #7c766c; }
    .metric-balance { background: #282826; border-color: #282826; }
    .metric-balance::before { background: var(--accent); }
    .metric-balance h3,.metric-balance p { color: #cbc7ba; }
    .metric-balance>strong { color: #ff956e; }
    .metric-overdue.has-overdue { background: #fff1e9; border-color: #ebc4b0; }
    .metric-overdue.has-overdue::before { background: var(--accent); }
    .quote-dashboard { border-top: 1px solid #d9d6cc; }
    dialog { border-radius: 8px; box-shadow: 0 30px 100px #28282638; }
    dialog::backdrop { background: #28282680; backdrop-filter: blur(4px); }
    .tabs button.active,.status-button.active { background: #fff0e5; border-color: #dfb798; color: #a43c18; }
    .tabs button:hover:not(:disabled),.status-button:hover:not(:disabled) { background: #f2eee6; }
    .status-paid,.status-accepted { color: #276447; background: #eaf3ec; }
    .status-dot,.preview-dot { background: #39825b; }
    .position,.position-section { border-radius: 5px; }
    .position.position-section { background: var(--accent-soft); border-color: var(--accent-border); }
    .total-row.grand { color: #a43c18; }
    .page-footer,.legal-footer { color: #7b766c; }
    .legal-footer a,.legal-footer .text-button,.cookie-notice a { color: #a43c18; }
    .cookie-notice { border-color: #d8d0c3; border-radius: 7px; }
    .legal-content { border-top: 3px solid var(--accent); }

    /* Shared brand colors also cover specialized screens and nested controls.
       Bright orange is decorative; its darker companion keeps small text readable. */
    input,select,textarea { accent-color: var(--accent-ink); }
    button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible { outline-color: var(--accent-ink); }
    .avatar,.catalog-card .initials,.calendar-customer-avatar { background: var(--accent-soft); color: var(--accent-ink); }
    .icon-button,.customer-utilities .text-button,.catalog-card .organize-record { color: #6e675c; }
    .danger-button,.customer-utilities .danger-button,.catalog-card .danger-button { color: #9b5145; }
    .catalog-card small b { color: #595349; }
    .customer-actions,.customer-utilities,.catalog-card .card-actions,.related-document { border-color: var(--line); }
    .workspace-nav button.active { box-shadow: inset 0 -3px var(--accent); }
    .workflow-guide button:not(:last-child)::after { content: none; }
    #workflow-positions .workflow-number,.catalog-panel .step { background: var(--accent-soft); color: var(--accent-ink); }
    #workflow-positions.complete .workflow-number { background: #282826; color: var(--accent); }
    .flow-target .drop-zone,.item-flow .drop-zone { background: #fffaf6; border-color: var(--accent-border); }
    .flow-target .drop-zone:hover,.flow-target .drop-zone.drag-over { background: var(--accent-soft); border-color: var(--accent-ink); box-shadow: 0 0 0 3px #ff642814; }
    .flow-target .customer-drop.has-customer { background: var(--accent-soft); border-color: var(--accent-border); }
    [data-flow-drag=customer] .customer-flow .drop-zone,[data-flow-drag=item] .item-flow .drop-zone { outline-color: #ff64284d; }
    .customers-panel .panel-foot,.catalog-tip,.profile-preview,.notes-label textarea { background: var(--surface); border-color: var(--line); }
    .organization .folder-node:hover,.organization .organization-record:hover { background: var(--accent-soft); color: var(--accent-ink); }
    .organization .folder-node.active,.organization .organization-record.active { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent-ink); }
    .organization .folder-node.drag-over { background: #ffe2cf; border-color: var(--accent-ink); }
    .organization .unassigned-field.is-empty { background: var(--surface); }
    .organization>p,.organization .folder-hint,.organization-records .empty,.organization .folder-node small { color: #6e675c; }
    .catalog-icon-option:hover,.catalog-icon-option[aria-pressed="true"] { background: var(--accent-soft); }
    .catalog-icon-option[aria-pressed="true"] { border-color: var(--accent-ink); }
    .field-required,.form-requirements,.setup-guide { background: var(--accent-soft); border-color: var(--accent-border); }
    .field-required,.field-alternative { color: var(--accent-ink); }
    .form-requirements,.setup-guide-copy>p:not(.eyebrow),.setup-guide .text-button { color: #655044; }
    .field-optional { color: var(--muted); }
    .reminder-summary,.reminder-card,.reminder-create { border-color: var(--line); }

    /* Document overview: orange marks the current step; green still means paid. */
    #history-dialog,#history-list .history-workflow-explanation { background: var(--surface); }
    #history-dialog .search:focus-within { border-color: var(--accent-ink); box-shadow: 0 0 0 3px #ff642814; }
    #history-list .history-row,#history-list .history-workflow-branch,#history-list .history-step-document,#history-list .empty { border-color: var(--line); }
    #history-list .status-button { background: #f3f1ec; }
    #history-list .status-button.active { color: var(--accent-ink); background: var(--accent-soft); border-color: var(--accent-border); }
    #history-list .history-step-number { background: #eee9df; color: #655e53; }
    #history-list .history-step-document,#history-list .history-correction-label { color: var(--accent-ink); }
    #history-list .history-corrections,#history-list .is-current .history-step-document { background: #fff7ef; border-color: var(--accent-border); }
    #history-list .history-step-document.is-pending { background: var(--surface); color: var(--muted); }
    #history-list .history-workflow-step::before,#history-list .history-workflow-step::after { border-color: #a39889; }
    #history-list .history-cancellation-connector { color: #a39889; }

    /* Calendar navigation belongs to the brand; event categories retain their colors. */
    .calendar-customer.selected { background: var(--accent-soft); border-color: var(--accent-border); }
    #calendar-range,.calendar-modes button,.calendar-navigation button,.calendar-day-number { color: #655e53; }
    .calendar-modes { background: #ece8df; }
    .calendar-modes button.active,.today .calendar-day-number { background: var(--accent-ink); color: #fff; box-shadow: none; }
    .calendar-navigation button { background: var(--surface); border-color: var(--line); }
    .calendar-day-heading,.calendar-time-head,.calendar-month-heading { color: var(--muted); border-color: var(--line); }
    .calendar-day-heading.today { color: var(--accent-ink); background: var(--accent-soft); box-shadow: inset 0 -2px var(--accent); }
    .calendar-hours,.calendar-month-day.outside { background: var(--surface); color: var(--muted); }
    .calendar-day-column,.calendar-month-day,.calendar-slot:nth-child(even) { border-color: var(--line); }
    .calendar-slot { border-color: #f0ede6; }
    .calendar-slot:hover,.calendar-month-day.today { background: var(--accent-soft); }
    .calendar-drop-target { background: #ffe2cf!important; box-shadow: inset 0 0 0 2px var(--accent-ink); }
    .calendar-orange { --event-color: var(--accent); --event-bg: #ffe2cf; }

    /* Same visual language for the public entrance. */
    .auth-page { background: #f3f2ed; color: #262624; }
    .auth-page .topbar { background: #faf9f6; border-bottom-color: var(--line); }
    .auth-header-link { background: #282826; padding: 13px 18px; color: #fff; border-radius: 3px; }
    .auth-header-link:hover { background: #41413c; }
    .auth-main.auth-landing { max-width: 1440px; padding-top: 60px; }
    .auth-hero-grid { gap: clamp(32px,5vw,80px); align-items: center; }
    .auth-page .eyebrow { color: #777167; }
    .auth-eyebrow-line { background: var(--accent); }
    .auth-landing .auth-intro h1 { font-size: clamp(38px,4vw,60px); letter-spacing: -2.4px; line-height: 1.08; }
    .auth-intro h1>span { color: var(--accent); }
    .auth-landing .intro-lead { color: #79736a; }
    .auth-photo { border-radius: 4px; margin-top: 30px; aspect-ratio: 1.65; }
    .auth-photo::after { background: linear-gradient(transparent,#262624b3); }
    .auth-photo-mark { border: 0; border-radius: 3px; background: #282826; color: var(--accent); }
    .auth-photo figcaption { left: 20px; bottom: 20px; }
    .auth-landing .intro-benefits { color: #6f685e; }
    .intro-benefits>span>span { color: #b94417; }
    .auth-landing .auth-panel { padding: 38px; border: 1px solid #ded9cf; border-top: 3px solid var(--accent); border-radius: 6px; box-shadow: 0 20px 55px #3630230a; }
    .auth-form-mark { width: 44px; height: 44px; background: #282826; color: var(--accent); border-radius: 3px; }
    .auth-panel h2 { font-size: 32px; letter-spacing: -1.3px; }
    .auth-landing .auth-panel>p,.auth-landing .auth-panel .auth-hint { color: #79736a; }
    .auth-landing .auth-panel label { color: #595349; }
    .auth-panel input { background: #faf9f5; border-color: #ded9cf; border-radius: 4px; color: #262624; }
    .auth-panel input::placeholder { color: #858076; }
    .auth-panel input:focus-visible { outline-color: #b94417; }
    .auth-landing .auth-panel .primary { background: #282826; border-radius: 3px; min-height: 50px; }
    .auth-landing .auth-panel .primary:hover { background: #41413c; }
    .auth-landing .auth-panel .auth-shared-note { background: #f4f1e9; color: #79736a; border-radius: 4px; }
    .auth-shared-note strong { color: #595349; }
    .auth-landing .auth-panel .auth-switch { border-top-color: var(--line); }
    .auth-switch a { color: #a43c18; }
    .auth-how-it-works { border-top-color: #d9d6cc; margin-top: 56px; }
    .auth-steps-heading h2 { font-size: 30px; letter-spacing: -1px; }
    .auth-steps-heading>p,.auth-landing .intro-steps p { color: #79736a; }
    .auth-landing .intro-steps li { border-top: 1px solid #d9d6cc; padding-top: 24px; }
    .auth-landing .intro-steps li>span { background: transparent; color: #b94417; border-radius: 0; font-size: 15px; padding: 0 6px 0 0; }
    @media(max-width:1050px) {
        .auth-hero-grid { gap: 30px; }
        .auth-landing .auth-panel { padding: 28px; }
        .page-heading { padding: 28px; }
        .page-heading h1 { max-width: 650px; }
    }
    @media(max-width:760px) {
        .topbar { padding: 16px; }
        .page-heading { padding: 24px 20px; flex-wrap: wrap; min-height: 155px; }
        .page-heading h1 { font-size: 31px; letter-spacing: -1.2px; }
        .page-heading::after { font-size: 190px; right: 24px; bottom: -42px; }
        .workflow-guide button { padding: 14px 10px; }
        .workflow-number { font-size: 19px; }
        .auth-main.auth-landing { padding-top: 32px; }
        .auth-landing .auth-intro h1 { font-size: clamp(36px,8vw,50px); letter-spacing: -1.6px; }
        .auth-landing .auth-panel { padding: 26px; }
        .auth-panel h2 { font-size: 28px; }
        .auth-steps-heading h2 { font-size: 26px; }
        .auth-how-it-works { margin-top: 36px; }
        .auth-header-link { font-size: 11px; padding: 12px; }
        .dashboard-heading h2 { font-size: 22px; }
    }
    @media(prefers-reduced-motion:reduce) { *,*::before,*::after { transition: none!important; animation: none!important; } }
}
