.dfx-staff-app {
    --dfx-blue: #0f4f8f;
    --dfx-ink: #172033;
    --dfx-line: #d8e2ef;
    --dfx-soft: #f5f8fc;
    color: var(--dfx-ink);
    font-family: Arial, Helvetica, sans-serif;
    background: #f7fbff;
    margin: 0 auto;
    max-width: 1680px;
    min-height: 100vh;
    padding: 0 18px 28px;
}

/* v6.5.1: normal public Home and Shop pages untouched; this app shell applies only to DuctFix-created portal pages. */
body.dfx-platform-app-shell {
    background: #f7fbff !important;
}

body.dfx-platform-app-shell .site-header,
body.dfx-platform-app-shell #masthead,
body.dfx-platform-app-shell .storefront-primary-navigation,
body.dfx-platform-app-shell .site-search,
body.dfx-platform-app-shell .site-header-cart,
body.dfx-platform-app-shell .woocommerce-breadcrumb,
body.dfx-platform-app-shell .storefront-breadcrumb,
body.dfx-platform-app-shell .widget_product_search,
body.dfx-platform-app-shell .widget_shopping_cart,
body.dfx-platform-app-shell .widget_product_categories,
body.dfx-platform-app-shell .widget_products,
body.dfx-platform-app-shell .widget_top_rated_products,
body.dfx-platform-app-shell .widget_recently_viewed_products,
body.dfx-platform-app-shell .widget_recent_reviews,
body.dfx-platform-app-shell .widget_layered_nav,
body.dfx-platform-app-shell .onsale,
body.dfx-platform-app-shell .site-footer,
body.dfx-platform-app-shell #colophon,
body.dfx-platform-app-shell footer.site-footer {
    display: none !important;
}

body.dfx-platform-app-shell .content-area,
body.dfx-platform-app-shell .site-main,
body.dfx-platform-app-shell .entry-content,
body.dfx-platform-app-shell .hentry,
body.dfx-platform-app-shell .entry {
    margin: 0 !important;
    max-width: none !important;
    padding: 0 !important;
    width: 100% !important;
}

body.dfx-platform-app-shell .entry-title,
body.dfx-platform-app-shell .page-title {
    display: none !important;
}

.dfx-staff-header {
    align-items: center;
    background: #ffffff;
    border-bottom: 1px solid var(--dfx-line);
    display: flex;
    gap: 20px;
    justify-content: space-between;
    box-shadow: 0 1px 8px rgba(15, 79, 143, 0.08);
    margin: 0 -18px 14px;
    padding: 12px 18px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.dfx-staff-brand {
    color: var(--dfx-blue);
    font-size: 13px;
    letter-spacing: 0;
    text-transform: uppercase;
}

.dfx-staff-header h1 {
    font-size: 22px;
    line-height: 1.2;
    margin: 2px 0 0;
}

.dfx-staff-userline {
    color: #526070;
    font-size: 13px;
    margin: 4px 0 0;
}

.dfx-staff-header nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dfx-staff-header nav a,
.dfx-staff-button {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--dfx-line);
    border-radius: 6px;
    color: var(--dfx-blue);
    cursor: pointer;
    display: inline-flex;
    font-size: 14px;
    font-weight: 700;
    gap: 6px;
    min-height: 34px;
    padding: 7px 10px;
    text-decoration: none;
}

.dfx-staff-header nav a.is-active,
.dfx-staff-button-primary {
    background: var(--dfx-blue);
    border-color: var(--dfx-blue);
    color: #ffffff;
}

.dfx-staff-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    margin-bottom: 18px;
}

.dfx-staff-card,
.dfx-staff-panel {
    background: #ffffff;
    border: 1px solid var(--dfx-line);
    border-radius: 6px;
    padding: 12px;
}

.dfx-staff-card {
    color: inherit;
    display: flex;
    flex-direction: column;
    min-height: 118px;
    text-decoration: none;
}

.dfx-staff-count {
    color: var(--dfx-blue);
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 8px;
}

.dfx-staff-form-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    margin-top: 12px;
}

.dfx-staff-form-grid-wide {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.dfx-staff-form-grid label,
.dfx-staff-line-table label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dfx-staff-app input,
.dfx-staff-app select,
.dfx-staff-app textarea {
    border: 1px solid var(--dfx-line);
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 13px;
    min-height: 30px;
    padding: 5px 7px;
    width: 100%;
}

.dfx-staff-app input:focus,
.dfx-staff-app select:focus,
.dfx-staff-app textarea:focus {
    border-color: var(--dfx-blue);
    box-shadow: 0 0 0 2px rgba(15, 79, 143, 0.14);
    outline: none;
}

.dfx-staff-actionbar,
.dfx-staff-totals,
.dfx-staff-toolbar,
.dfx-staff-validation-panel {
    align-items: center;
    background: var(--dfx-soft);
    border: 1px solid var(--dfx-line);
    border-radius: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    margin: 0 0 10px;
    padding: 8px;
}

.dfx-staff-actionbar {
    position: sticky;
    top: 66px;
    z-index: 18;
}

.dfx-staff-totals {
    bottom: 0;
    position: sticky;
    z-index: 18;
}

.dfx-staff-validation-panel {
    align-items: flex-start;
    background: #ffffff;
    justify-content: flex-start;
}

.dfx-staff-validation-panel.has-warnings {
    border-color: #f2b94b;
}

.dfx-staff-validation-panel ul {
    margin: 0;
}

.dfx-staff-table-scroll {
    overflow-x: auto;
}

.dfx-staff-table {
    border-collapse: collapse;
    margin: 10px 0;
    min-width: 1180px;
    width: 100%;
}

.dfx-staff-table th,
.dfx-staff-table td {
    border-bottom: 1px solid var(--dfx-line);
    padding: 6px;
    text-align: left;
    vertical-align: top;
}

.dfx-staff-table th {
    background: var(--dfx-soft);
    font-size: 13px;
}

.dfx-staff-line-table td:nth-child(1) {
    min-width: 76px;
}

.dfx-staff-line-table td:nth-child(2) {
    min-width: 340px;
}

.dfx-staff-line-table td:nth-child(3) {
    min-width: 230px;
}

.dfx-staff-line-table td:nth-child(4) {
    min-width: 136px;
}

.dfx-staff-dims {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(4, minmax(54px, 1fr));
}

.dfx-staff-dims .is-hidden-field {
    display: none;
}

.dfx-material-rule-note,
.dfx-item-options,
.dfx-line-preview-panel {
    grid-column: 1 / -1;
}

.dfx-material-rule-note {
    color: #526070;
    font-size: 12px;
}

.dfx-item-options summary,
.dfx-line-preview-panel summary {
    color: var(--dfx-blue);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.dfx-item-options label {
    display: grid;
    gap: 4px;
    grid-template-columns: 120px minmax(80px, 1fr);
    margin-top: 4px;
}

.dfx-line-preview-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 6px 0;
}

.dfx-line-preview-slot {
    background: #f8fafc;
    border: 1px dashed var(--dfx-line);
    border-radius: 6px;
    min-height: 180px;
    overflow: hidden;
    padding: 8px;
}

.dfx-line-preview-slot canvas {
    display: block;
    max-width: 100%;
}

.dfx-item-search {
    position: relative;
}

.dfx-item-search-results {
    background: #ffffff;
    border: 1px solid var(--dfx-line);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(23, 32, 51, 0.12);
    left: 0;
    max-height: 260px;
    overflow: auto;
    position: absolute;
    right: 0;
    top: 34px;
    z-index: 30;
}

.dfx-item-search-results[hidden] {
    display: none;
}

.dfx-item-search-result {
    background: #ffffff;
    border: 0;
    border-bottom: 1px solid var(--dfx-line);
    cursor: pointer;
    display: grid;
    gap: 2px;
    padding: 8px;
    text-align: left;
    width: 100%;
}

.dfx-item-search-result:hover,
.dfx-item-search-result:focus {
    background: #eaf3ff;
    outline: none;
}

.dfx-item-classification {
    margin-top: 4px;
}

.dfx-connector-warning {
    color: #9a3412;
    display: block;
    font-size: 12px;
    margin-top: 4px;
}

.dfx-connector-suggestion {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 5px;
    color: #9a3412;
    cursor: pointer;
    font-size: 12px;
    margin-top: 4px;
    padding: 4px 6px;
}

.dfx-connector-suggestion[hidden] {
    display: none;
}

.dfx-staff-line-notes summary {
    color: var(--dfx-blue);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.dfx-input-xs {
    max-width: 82px;
}

.dfx-input-sm {
    max-width: 120px;
}

.dfx-staff-line-actions {
    min-width: 132px;
}

.dfx-staff-line-actions button {
    background: #ffffff;
    border: 1px solid var(--dfx-line);
    border-radius: 5px;
    cursor: pointer;
    display: inline-block;
    font-size: 12px;
    margin: 2px;
    padding: 4px 6px;
}

.dfx-staff-badge,
.dfx-staff-chip {
    background: #eaf3ff;
    border-radius: 999px;
    color: var(--dfx-blue);
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 7px;
}

.dfx-staff-badge-muted {
    background: #eef2f7;
    color: #526070;
}

.dfx-staff-pricing-badge {
    margin-top: 4px;
}

.dfx-staff-line-tools {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.dfx-staff-inline-toggle {
    align-items: center;
    display: inline-flex;
    gap: 5px;
    white-space: nowrap;
}

.dfx-staff-inline-toggle input {
    min-height: auto;
    width: auto;
}

.dfx-staff-muted-action {
    color: #526070;
    display: block;
    font-size: 12px;
    margin-top: 4px;
}

.dfx-staff-section-heading {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.dfx-staff-section-heading h2 {
    font-size: 18px;
    margin: 0;
}

.dfx-staff-customer-search {
    background: var(--dfx-soft);
    border-radius: 6px;
    padding: 10px;
}

.dfx-staff-search-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.dfx-staff-customer-card {
    background: #ffffff;
    border: 1px solid var(--dfx-line);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 9px;
    text-align: left;
}

.dfx-staff-notice {
    border-left: 4px solid var(--dfx-blue);
    margin: 0 0 12px;
    padding: 10px 12px;
}

.dfx-staff-notice-error {
    border-left-color: #b42318;
}

.dfx-staff-pricing-action {
    align-items: center;
    border-top: 1px solid var(--dfx-line);
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(180px, 1fr) 190px 120px 180px minmax(180px, 1fr) auto;
    padding: 10px 0;
}

.dfx-staff-summary-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-top: 12px;
}

.dfx-staff-print-actions {
    position: static;
}

.dfx-staff-save-state {
    background: #edf7ed;
    color: #216e39;
}

@media print {
    body.dfx-platform-app-shell .dfx-staff-header,
    body.dfx-platform-app-shell .dfx-staff-actionbar,
    body.dfx-platform-app-shell .dfx-staff-toolbar,
    body.dfx-platform-app-shell .dfx-staff-pricing-action {
        display: none !important;
    }

    .dfx-staff-app {
        background: #ffffff;
        max-width: none;
        padding: 0;
    }
}

.dfx-staff-access-denied {
    max-width: 880px;
}

.dfx-staff-help {
    color: #526070;
    font-size: 13px;
}

@media (max-width: 860px) {
    .dfx-staff-header,
    .dfx-staff-actionbar,
    .dfx-staff-totals {
        align-items: stretch;
        flex-direction: column;
        position: static;
    }

    .dfx-staff-pricing-action {
        grid-template-columns: 1fr;
    }
}
