:root {
    --orders-navy: #08253f;
    --orders-blue: #006f9f;
    --orders-blue-dark: #00577e;
    --orders-muted: #637b8d;
    --orders-line: #dce6ed;
    --orders-soft: #f4f8fa;
    --orders-sky: #eaf5fa;
    --orders-green: #138a5b;
    --orders-white: #fff;
    --orders-shadow: 0 10px 28px rgba(8, 37, 63, 0.06);
    --orders-radius: 16px;
    --orders-container: 1240px;
}

body.orders-page {
    overflow-x: hidden;
    background: #f8fafb;
    color: var(--orders-navy);
}

body.orders-filter-open { overflow: hidden; }

.orders-container {
    width: min(calc(100% - 32px), var(--orders-container));
    margin-inline: auto;
}

.orders-main { min-height: 70vh; }

.orders-hero {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid #e7eef3;
    background: #fff;
}

.orders-breadcrumb {
    display: flex;
    align-items: center;
    gap: 9px;
    padding-top: 26px;
    color: #7890a1;
    font-size: 0.78rem;
    font-weight: 600;
}

.orders-breadcrumb a {
    color: var(--orders-blue);
    text-decoration: none;
}

.orders-breadcrumb a:hover { color: var(--orders-blue-dark); }
.orders-breadcrumb i { font-size: 0.7rem; }

.orders-hero-grid {
    display: grid;
    min-height: 290px;
    grid-template-columns: minmax(420px, 0.95fr) minmax(430px, 1.05fr);
    align-items: center;
    gap: clamp(32px, 6vw, 90px);
}

.orders-hero-copy { padding: 30px 0 46px; }

.orders-eyebrow {
    margin: 0 0 9px;
    color: var(--orders-blue);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.orders-hero h1 {
    margin: 0;
    color: var(--orders-navy);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.7rem, 4.8vw, 4.65rem);
    font-weight: 500;
    letter-spacing: -0.045em;
    line-height: 1;
}

.orders-hero-copy > p:not(.orders-eyebrow) {
    max-width: 590px;
    margin: 19px 0 0;
    color: #4e687c;
    font-size: clamp(0.94rem, 1.2vw, 1.04rem);
    line-height: 1.72;
}

.orders-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 25px;
}

.orders-hero-actions .orders-button { padding-inline: 18px; }

.orders-hero-visual {
    align-self: stretch;
    min-width: 0;
}

.orders-hero-visual img {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 315px;
    object-fit: cover;
    object-position: 58% 64%;
    mask-image: linear-gradient(to right, transparent 0, #000 20%, #000 100%);
}

.orders-search-wrap {
    position: relative;
    z-index: 2;
    margin-top: -1px;
    background: #fff;
}

.orders-search-panel {
    display: grid;
    grid-template-columns: minmax(230px, 1.6fr) minmax(180px, 1.05fr) minmax(170px, 1fr) minmax(160px, 0.95fr) auto;
    gap: 10px;
    padding: 18px;
    border: 1px solid var(--orders-line);
    border-radius: 0 0 var(--orders-radius) var(--orders-radius);
    background: var(--orders-white);
    box-shadow: var(--orders-shadow);
}

.orders-field {
    position: relative;
    min-width: 0;
}

.orders-field > i {
    position: absolute;
    top: 50%;
    left: 14px;
    color: var(--orders-blue);
    font-size: 0.94rem;
    transform: translateY(-50%);
    pointer-events: none;
}

.orders-field input,
.orders-field select {
    width: 100%;
    height: 48px;
    border: 1px solid #cedbe4;
    border-radius: 10px;
    background-color: #fff;
    color: var(--orders-navy);
    font: inherit;
    font-size: 0.82rem;
    outline: 0;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.orders-field input { padding: 0 14px 0 42px; }

.orders-field select {
    appearance: none;
    padding: 0 38px 0 14px;
    background-image: linear-gradient(45deg, transparent 50%, #688194 50%), linear-gradient(135deg, #688194 50%, transparent 50%);
    background-position: calc(100% - 17px) 21px, calc(100% - 12px) 21px;
    background-repeat: no-repeat;
    background-size: 5px 5px, 5px 5px;
}

.orders-field input:focus,
.orders-field select:focus,
.orders-filter-location input:focus,
.orders-sort-form select:focus {
    border-color: var(--orders-blue);
    box-shadow: 0 0 0 3px rgba(0, 111, 159, 0.13);
}

.orders-field input::placeholder { color: #8295a3; }

.orders-button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.orders-button:hover { transform: translateY(-1px); }

.orders-button-primary {
    background: var(--orders-blue);
    color: #fff;
}

.orders-button-primary:hover {
    background: var(--orders-blue-dark);
    color: #fff;
}

.orders-button-secondary {
    border-color: #b9cad6;
    background: #fff;
    color: var(--orders-navy);
}

.orders-button-secondary:hover {
    border-color: var(--orders-blue);
    color: var(--orders-blue);
}

.orders-search-button {
    min-width: 116px;
    height: 48px;
}

.orders-validation {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0 0;
    color: #b42318;
    font-size: 0.78rem;
}

.orders-directory { padding: 30px 0 68px; }

.orders-results-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.orders-result-count {
    margin: 0;
    color: var(--orders-navy);
    font-size: 0.9rem;
    font-weight: 600;
}

.orders-result-count strong { font-size: 1.02rem; }

.orders-result-note {
    margin: 5px 0 0;
    color: #6d8292;
    font-size: 0.72rem;
}

.orders-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.orders-sort-form {
    display: flex;
    align-items: center;
    gap: 9px;
}

.orders-sort-form label {
    color: #718797;
    font-size: 0.76rem;
    white-space: nowrap;
}

.orders-sort-form select {
    height: 42px;
    min-width: 174px;
    padding: 0 34px 0 12px;
    border: 1px solid #cedbe4;
    border-radius: 9px;
    background: #fff;
    color: var(--orders-navy);
    font: inherit;
    font-size: 0.78rem;
    outline: 0;
}

.orders-filter-open {
    display: none;
    height: 42px;
    padding: 0 15px;
}

.orders-layout {
    display: grid;
    grid-template-columns: 258px minmax(0, 1fr);
    align-items: start;
    gap: 24px;
}

.orders-filter-overlay { display: none; }

.orders-filter-panel {
    position: sticky;
    top: 102px;
    overflow: hidden;
    border: 1px solid var(--orders-line);
    border-radius: var(--orders-radius);
    background: #fff;
    box-shadow: 0 7px 22px rgba(8, 37, 63, 0.035);
}

.orders-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 19px 20px;
    border-bottom: 1px solid #e7eef3;
}

.orders-filter-header h2 {
    margin: 0;
    color: var(--orders-navy);
    font-size: 0.94rem;
    font-weight: 700;
}

.orders-clear-link {
    color: var(--orders-blue);
    font-size: 0.72rem;
    font-weight: 700;
    text-decoration: none;
}

.orders-filter-close {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--orders-line);
    border-radius: 9px;
    background: #fff;
    color: var(--orders-navy);
}

.orders-filter-body { padding: 20px; }

.orders-filter-section + .orders-filter-section {
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid #edf2f5;
}

.orders-filter-section h3 {
    margin: 0 0 12px;
    color: var(--orders-navy);
    font-size: 0.78rem;
    font-weight: 700;
}

.orders-filter-location input {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #cedbe4;
    border-radius: 9px;
    color: var(--orders-navy);
    font: inherit;
    font-size: 0.76rem;
    outline: 0;
}

.orders-category-options {
    display: grid;
    gap: 10px;
    max-height: 390px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
}

.orders-category-option {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr) auto;
    align-items: start;
    gap: 9px;
    color: #405b6f;
    font-size: 0.75rem;
    line-height: 1.4;
    cursor: pointer;
}

.orders-category-option input {
    width: 16px;
    height: 16px;
    margin: 1px 0 0;
    accent-color: var(--orders-blue);
}

.orders-category-option small {
    min-width: 23px;
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--orders-soft);
    color: #748b9b;
    font-size: 0.62rem;
    text-align: center;
}

.orders-filter-footer {
    display: grid;
    gap: 10px;
    padding: 0 20px 20px;
}

.orders-filter-footer .orders-button { width: 100%; }

.orders-results { min-width: 0; }

.orders-card-list {
    display: grid;
    gap: 14px;
}

.order-request-card {
    overflow: hidden;
    border: 1px solid var(--orders-line);
    border-radius: var(--orders-radius);
    background: #fff;
    box-shadow: 0 6px 22px rgba(8, 37, 63, 0.035);
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.order-request-card:hover {
    border-color: #bdd1dd;
    box-shadow: var(--orders-shadow);
    transform: translateY(-1px);
}

.order-request-card.is-matched { border-left: 3px solid var(--orders-green); }

.order-card-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    border-bottom: 1px solid #edf2f5;
    background: #fbfdfe;
}

.order-card-labels,
.order-card-statuses {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.order-category-badge,
.order-subcategory-badge,
.order-owner-badge,
.order-match-badge,
.order-view-only-badge,
.order-open-badge {
    display: inline-flex;
    min-height: 27px;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 0.64rem;
    font-weight: 700;
    line-height: 1.2;
}

.order-category-badge {
    background: var(--orders-sky);
    color: var(--orders-blue);
}

.order-subcategory-badge {
    background: #f1f4f6;
    color: #647b8c;
}

.order-owner-badge {
    background: #f3edff;
    color: #6840a3;
}

.order-match-badge {
    background: #e8f7f0;
    color: #08744a;
}

.order-view-only-badge {
    background: #f2f4f6;
    color: #718392;
}

.order-open-badge {
    background: #edf8f3;
    color: #147a53;
}

.order-open-badge > span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #27a66f;
}

.order-card-body {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(330px, 0.75fr);
    gap: 28px;
    padding: 22px 22px 18px;
}

.order-card-copy { min-width: 0; }

.order-card-id {
    margin: 0 0 5px;
    color: #8194a2;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.order-card-copy h2 {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.35;
}

.order-card-copy h2 a {
    color: var(--orders-navy);
    text-decoration: none;
}

.order-card-copy h2 a:hover { color: var(--orders-blue); }

.order-card-description {
    display: -webkit-box;
    overflow: hidden;
    margin: 10px 0 0;
    color: #526b7e;
    font-size: 0.78rem;
    line-height: 1.65;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.order-card-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
}

.order-card-facts > div {
    min-width: 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--orders-soft);
}

.order-card-facts dt {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    color: #718798;
    font-size: 0.62rem;
    font-weight: 600;
}

.order-card-facts dt i { color: var(--orders-blue); }

.order-card-facts dd {
    overflow: hidden;
    margin: 5px 0 0;
    color: var(--orders-navy);
    font-size: 0.72rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 20px 18px;
}

.order-card-footer > p {
    margin: 0;
    color: #7b8f9e;
    font-size: 0.68rem;
}

.order-card-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 9px;
}

.order-card-actions .orders-button {
    min-width: 122px;
    padding: 0 15px;
}

.orders-empty {
    padding: 70px 24px;
    border: 1px solid var(--orders-line);
    border-radius: var(--orders-radius);
    background: #fff;
    text-align: center;
}

.orders-empty-icon {
    display: inline-flex;
    width: 60px;
    height: 60px;
    align-items: center;
    justify-content: center;
    border-radius: 17px;
    background: var(--orders-sky);
    color: var(--orders-blue);
    font-size: 1.4rem;
}

.orders-empty h2 {
    margin: 18px 0 8px;
    font-size: 1.25rem;
}

.orders-empty p {
    max-width: 520px;
    margin: 0 auto;
    color: var(--orders-muted);
    font-size: 0.84rem;
    line-height: 1.65;
}

.orders-empty-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 22px;
}

.orders-empty-actions .orders-button { padding: 0 18px; }

.orders-pagination { margin-top: 28px; }

.orders-pagination .pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    margin: 0;
}

.orders-pagination .page-item .page-link {
    display: inline-flex;
    min-width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--orders-line);
    border-radius: 8px;
    background: #fff;
    color: var(--orders-navy);
    font-size: 0.74rem;
    box-shadow: none;
}

.orders-pagination .page-item.active .page-link {
    border-color: var(--orders-blue);
    background: var(--orders-blue);
    color: #fff;
}

.orders-pagination .page-item.disabled .page-link {
    background: #f4f7f9;
    color: #9aacb8;
}

.orders-process {
    padding: 64px 0 70px;
    border-top: 1px solid #e7eef3;
    background: #fff;
}

.orders-process-heading {
    max-width: 620px;
    margin-bottom: 24px;
}

.orders-process-heading h2 {
    margin: 0;
    color: var(--orders-navy);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.9rem, 3vw, 2.75rem);
    font-weight: 500;
    letter-spacing: -0.035em;
}

.orders-process-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.orders-process-card {
    position: relative;
    min-height: 202px;
    padding: 24px;
    border: 1px solid var(--orders-line);
    border-radius: var(--orders-radius);
    background: #f8fbfc;
}

.orders-process-card > span {
    position: absolute;
    top: 18px;
    right: 18px;
    color: #d7e3ea;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2.5rem;
    line-height: 1;
}

.orders-process-card > i {
    display: inline-flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--orders-sky);
    color: var(--orders-blue);
    font-size: 1.05rem;
}

.orders-process-card h3 {
    margin: 18px 0 7px;
    font-size: 0.9rem;
    font-weight: 700;
}

.orders-process-card p {
    margin: 0;
    color: #647c8e;
    font-size: 0.75rem;
    line-height: 1.65;
}

.orders-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    clip-path: inset(50%) !important;
}

.orders-page a:focus-visible,
.orders-page button:focus-visible,
.orders-page input:focus-visible,
.orders-page select:focus-visible {
    outline: 3px solid rgba(42, 139, 187, 0.32);
    outline-offset: 3px;
}

@media (max-width: 1180px) {
    .orders-search-panel {
        grid-template-columns: minmax(220px, 1.5fr) minmax(170px, 1fr) minmax(160px, 1fr) minmax(160px, 1fr);
    }

    .orders-search-button { grid-column: 1 / -1; }
    .order-card-body { grid-template-columns: minmax(0, 1fr); gap: 18px; }
}

@media (max-width: 1024px) {
    .orders-hero-grid { grid-template-columns: minmax(360px, 1fr) 0.9fr; }
    .orders-layout { grid-template-columns: 230px minmax(0, 1fr); gap: 18px; }
    .orders-filter-body { padding: 18px; }
    .orders-filter-header { padding-inline: 18px; }
}

@media (max-width: 900px) {
    .orders-hero-grid { grid-template-columns: 1fr 1fr; }
    .orders-search-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .orders-search-button { grid-column: auto; }
    .orders-layout { display: block; }
    .orders-filter-open { display: inline-flex; }

    .orders-filter-overlay {
        position: fixed;
        z-index: 1050;
        inset: 0;
        display: block;
        visibility: hidden;
        background: rgba(4, 24, 41, 0.46);
        opacity: 0;
        transition: opacity 170ms ease, visibility 170ms ease;
    }

    .orders-filter-overlay.is-open { visibility: visible; opacity: 1; }

    .orders-filter-panel {
        position: fixed;
        z-index: 1060;
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        max-height: min(88vh, 720px);
        overflow-y: auto;
        border-width: 1px 0 0;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -18px 44px rgba(8, 37, 63, 0.18);
        transform: translateY(105%);
        transition: transform 190ms ease;
    }

    .orders-filter-panel.is-open { transform: translateY(0); }
    .orders-filter-panel .orders-filter-header { position: sticky; z-index: 1; top: 0; background: #fff; }
    .orders-filter-close { display: inline-flex; }
    .orders-filter-footer { position: sticky; bottom: 0; padding-top: 14px; border-top: 1px solid var(--orders-line); background: #fff; }
    .orders-category-options { max-height: none; }
}

@media (max-width: 767px) {
    .orders-container { width: min(calc(100% - 24px), var(--orders-container)); }
    .orders-breadcrumb { padding-top: 18px; }
    .orders-breadcrumb i,
    .orders-breadcrumb span { display: none; }
    .orders-breadcrumb a::before { content: "← "; }

    .orders-hero-grid {
        min-height: 0;
        grid-template-columns: 1fr;
    }

    .orders-hero-copy { padding: 24px 0 32px; }
    .orders-hero h1 { font-size: clamp(2.35rem, 12vw, 3.45rem); }
    .orders-hero-copy > p:not(.orders-eyebrow) { margin-top: 14px; font-size: 0.9rem; }
    .orders-hero-visual { display: none; }
    .orders-hero-actions { margin-top: 20px; }

    .orders-search-panel {
        grid-template-columns: 1fr;
        padding: 14px;
        border-radius: 0 0 14px 14px;
    }

    .orders-search-button { width: 100%; }
    .orders-directory { padding: 24px 0 52px; }
    .orders-results-toolbar { align-items: flex-start; }
    .orders-toolbar-actions { align-items: stretch; }
    .orders-sort-form { align-items: stretch; }
    .orders-sort-form label { display: none; }
    .orders-sort-form select { min-width: 145px; }

    .order-card-topline {
        align-items: flex-start;
        padding: 13px 15px;
    }

    .order-card-statuses { justify-content: flex-end; }
    .order-view-only-badge { display: none; }
    .order-card-body { padding: 18px 16px 14px; }
    .order-card-facts { gap: 9px; }
    .order-card-footer { padding: 12px 16px 17px; }
    .orders-process { padding: 50px 0 56px; }
    .orders-process-grid { grid-template-columns: 1fr; }
    .orders-process-card { min-height: 0; }
}

@media (max-width: 560px) {
    .orders-results-toolbar { display: grid; }
    .orders-toolbar-actions { justify-content: space-between; }
    .orders-filter-open,
    .orders-sort-form { flex: 1 1 0; }
    .orders-sort-form select { width: 100%; min-width: 0; }
    .order-card-topline { display: grid; }
    .order-card-statuses { justify-content: flex-start; }
    .order-card-facts { grid-template-columns: 1fr 1fr; }
    .order-card-footer { align-items: flex-start; flex-direction: column; }
    .order-card-actions { width: 100%; justify-content: stretch; }
    .order-card-actions .orders-button { flex: 1 1 0; }
}

@media (max-width: 430px) {
    .orders-container { width: min(calc(100% - 20px), var(--orders-container)); }
    .orders-eyebrow { font-size: 0.66rem; }
    .orders-hero-actions { display: grid; }
    .orders-hero-actions .orders-button { width: 100%; }
    .order-card-facts { grid-template-columns: 1fr; }
    .order-card-facts dd { white-space: normal; }
    .order-card-actions { display: grid; grid-template-columns: 1fr; }
    .orders-empty { padding: 52px 16px; }
    .orders-empty-actions { display: grid; }
}

@media (prefers-reduced-motion: reduce) {
    .orders-page *,
    .orders-page *::before,
    .orders-page *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
