.orders-page {
    padding-top: 3rem;
}

.orders-list {
    display: grid;
    gap: 1rem;
}

.order-card,
.order-panel {
    padding: 1.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.order-card__top,
.order-panel__top,
.revision-item__meta,
.chat-message__meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.order-card__code {
    margin: 0 0 0.35rem;
    color: var(--accent);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.order-card__title,
.order-panel h2 {
    margin: 0;
    font-weight: 800;
}

.order-card__title a {
    color: inherit;
}

.order-card__text,
.order-panel__description,
.revision-item__text,
.revision-item__author,
.chat-message__meta span,
.chat-message__meta time,
.chat-form__status,
.order-panel__hint {
    color: var(--muted);
}

.order-card__text,
.order-panel__description {
    margin: 1rem 0 1.2rem;
}

.order-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
    margin: 0;
}

.order-meta-grid div {
    padding: 1rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
}

.order-meta-grid dt {
    margin-bottom: 0.35rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.order-meta-grid dd {
    margin: 0;
    font-weight: 700;
}

.order-card__button {
    margin-top: 1.2rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 700;
}

.status-badge--new {
    color: #d6e6ff;
    background: rgba(101, 144, 211, 0.22);
}

.status-badge--progress {
    color: #ffe2ac;
    background: rgba(228, 170, 72, 0.22);
}

.status-badge--review {
    color: #f0d4ff;
    background: rgba(178, 114, 210, 0.2);
}

.status-badge--done {
    color: #d6ffd9;
    background: rgba(101, 188, 132, 0.2);
}

.status-badge--cancelled {
    color: #ffd1c7;
    background: rgba(214, 104, 88, 0.2);
}

.status-badge--default {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
}

.order-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.85fr);
    gap: 1rem;
}

.order-main,
.order-sidebar {
    display: grid;
    gap: 1rem;
}

.chat-list,
.revision-list {
    display: grid;
    gap: 0.9rem;
    margin-top: 1rem;
}

.chat-message,
.revision-item {
    padding: 1rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.06);
}

.chat-message.is-own {
    background: rgba(255, 122, 26, 0.14);
}

.chat-message__meta strong,
.revision-item__meta strong {
    font-size: 0.96rem;
}

.chat-message__text {
    margin: 0.8rem 0 0;
    white-space: pre-wrap;
}

.chat-empty {
    padding: 1rem;
    border-radius: var(--radius-md);
    color: var(--muted);
    background: rgba(255, 255, 255, 0.05);
}

.chat-form {
    margin-top: 1rem;
}

.chat-form__row {
    display: grid;
    gap: 0.9rem;
}

.chat-form__textarea {
    resize: vertical;
    min-height: 140px;
}

.chat-form__submit {
    width: max-content;
}

.chat-form__status {
    min-height: 1.2rem;
    margin: 0.75rem 0 0;
    font-size: 0.94rem;
    font-weight: 600;
}

.chat-form__status.is-success {
    color: #a9ff78;
}

.chat-form__status.is-error {
    color: #ffb08b;
}

.revision-item__author {
    margin: 0.55rem 0 0;
    font-size: 0.92rem;
}

.revision-item__text {
    margin: 0.65rem 0 0;
}

.revision-item__diff {
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--line);
}

.revision-item__diff p {
    margin: 0.35rem 0 0;
}

.revision-item__diff span {
    font-weight: 700;
}

.order-empty h2 {
    margin-top: 0;
}

@media (max-width: 1080px) {
    .order-layout,
    .order-meta-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 780px) {
    .order-card__top,
    .order-panel__top,
    .revision-item__meta,
    .chat-message__meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .chat-form__submit {
        width: 100%;
    }
}

.orders-page--rich {
    position: relative;
    overflow: hidden;
    padding: clamp(42px, 6vw, 82px) 0 clamp(72px, 8vw, 110px);
    color: #071033;
    background:
        radial-gradient(circle at 8% 16%, rgba(49, 86, 255, 0.12), transparent 30%),
        radial-gradient(circle at 92% 14%, rgba(255, 176, 58, 0.12), transparent 28%),
        linear-gradient(180deg, #ffffff 0%, #f7f9ff 54%, #ffffff 100%);
}

.orders-hero,
.orders-summary__card,
.orders-toolbar,
.order-card--rich,
.order-empty--rich,
.order-panel {
    border: 1px solid rgba(207, 214, 244, 0.86);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 24px 58px rgba(56, 67, 132, 0.12);
    backdrop-filter: blur(18px);
}

.orders-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 22px;
    padding: clamp(26px, 4vw, 42px);
    border-radius: 26px;
    overflow: hidden;
    position: relative;
}

.orders-hero::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 6px;
    background: linear-gradient(90deg, #3156ff, #18b6aa, #ffb03a);
}

.orders-hero > div {
    max-width: 800px;
}

.orders-hero__button {
    flex: 0 0 auto;
}

.orders-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.orders-summary__card {
    position: relative;
    overflow: hidden;
    min-height: 136px;
    padding: 20px;
    border-radius: 20px;
}

.orders-summary__card::after {
    content: "";
    position: absolute;
    right: -38px;
    top: -38px;
    width: 110px;
    height: 110px;
    border-radius: 999px;
    opacity: 0.16;
    background: currentColor;
}

.orders-summary__card span {
    color: #617093;
    font-size: 0.9rem;
    font-weight: 800;
}

.orders-summary__card strong {
    display: block;
    margin-top: 8px;
    color: #071033;
    font-size: clamp(1.75rem, 3vw, 2.35rem);
    font-weight: 900;
    line-height: 1;
}

.orders-summary__card p {
    margin: 10px 0 0;
    color: #617093;
    font-size: 0.9rem;
    line-height: 1.42;
}

.orders-summary__card--blue { color: #3156ff; }
.orders-summary__card--teal { color: #18b6aa; }
.orders-summary__card--violet { color: #7048ff; }
.orders-summary__card--orange { color: #ff9a2f; }

.orders-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: 18px;
}

.orders-toolbar strong,
.orders-toolbar span {
    display: block;
}

.orders-toolbar strong {
    font-size: 1.05rem;
    font-weight: 900;
}

.orders-toolbar span {
    color: #617093;
    font-size: 0.92rem;
}

.orders-toolbar__chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.orders-toolbar__chips span {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    border-radius: 999px;
    color: #3156ff;
    font-weight: 800;
    background: rgba(49, 86, 255, 0.08);
}

.orders-list--rich {
    gap: 18px;
    margin-top: 18px;
}

.order-card--rich {
    position: relative;
    overflow: hidden;
    padding: clamp(22px, 3vw, 30px);
    border-radius: 22px;
}

.order-card--rich::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    background: linear-gradient(90deg, #3156ff, #18b6aa, #ffb03a);
}

.order-card__code {
    color: #3156ff;
    letter-spacing: 0;
}

.order-card__title {
    color: #071033;
}

.order-card__title a:hover {
    color: #3156ff;
}

.order-card__text,
.order-panel__description,
.revision-item__text,
.revision-item__author,
.chat-message__meta span,
.chat-message__meta time,
.chat-form__status,
.order-panel__hint {
    color: #617093;
}

.order-progress,
.order-progress span {
    height: 12px;
    border-radius: 999px;
}

.order-progress {
    overflow: hidden;
    margin: 18px 0;
    background: #e8edff;
}

.order-progress span {
    display: block;
    width: var(--value);
    background: linear-gradient(90deg, #3156ff, #18b6aa);
}

.order-meta-grid--rich {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.order-meta-grid--rich div,
.order-meta-grid div {
    border: 1px solid rgba(207, 214, 244, 0.72);
    background: rgba(248, 250, 255, 0.78);
}

.order-meta-grid dt {
    color: #617093;
    font-weight: 800;
}

.order-meta-grid dd {
    color: #071033;
    font-weight: 900;
}

.order-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 18px;
}

.order-card__footer > span {
    color: #617093;
    font-size: 0.92rem;
    font-weight: 700;
}

.order-card__button {
    margin-top: 0;
    flex: 0 0 auto;
}

.status-badge {
    border: 1px solid transparent;
    font-weight: 900;
}

.status-badge--new {
    color: #3156ff;
    background: rgba(49, 86, 255, 0.1);
    border-color: rgba(49, 86, 255, 0.18);
}

.status-badge--progress {
    color: #b56a00;
    background: rgba(255, 176, 58, 0.16);
    border-color: rgba(255, 176, 58, 0.26);
}

.status-badge--review {
    color: #7048ff;
    background: rgba(112, 72, 255, 0.12);
    border-color: rgba(112, 72, 255, 0.2);
}

.status-badge--done {
    color: #0b746c;
    background: rgba(24, 182, 170, 0.12);
    border-color: rgba(24, 182, 170, 0.22);
}

.status-badge--cancelled {
    color: #bd3b3b;
    background: rgba(220, 72, 72, 0.1);
    border-color: rgba(220, 72, 72, 0.18);
}

.status-badge--default {
    color: #071033;
    background: rgba(7, 16, 51, 0.06);
    border-color: rgba(7, 16, 51, 0.12);
}

.order-empty--rich {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 22px;
    align-items: center;
    margin-top: 18px;
    padding: clamp(26px, 4vw, 42px);
    border-radius: 24px;
}

.order-empty__icon {
    width: 86px;
    height: 86px;
    display: grid;
    place-items: center;
    border-radius: 24px;
    color: #ffffff;
    background: linear-gradient(135deg, #3156ff, #18b6aa);
    box-shadow: 0 18px 34px rgba(49, 86, 255, 0.22);
}

.order-empty__icon svg {
    width: 42px;
    height: 42px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.order-empty--rich h2 {
    margin: 0;
    color: #071033;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 900;
}

.order-empty--rich p:not(.section__eyebrow) {
    max-width: 760px;
    margin: 12px 0 0;
    color: #617093;
}

.order-empty__steps {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.order-empty__steps span {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    padding: 0 13px;
    border-radius: 999px;
    color: #3156ff;
    font-weight: 900;
    background: rgba(49, 86, 255, 0.08);
}

.order-panel {
    color: #071033;
}

.chat-message,
.revision-item,
.chat-empty {
    border: 1px solid rgba(207, 214, 244, 0.72);
    background: rgba(248, 250, 255, 0.78);
}

.chat-message.is-own {
    background: rgba(49, 86, 255, 0.08);
}

.chat-form__status.is-success {
    color: #0b746c;
}

.chat-form__status.is-error {
    color: #bd3b3b;
}

@media (max-width: 1080px) {
    .orders-summary,
    .order-meta-grid--rich {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 780px) {
    .orders-hero,
    .orders-toolbar,
    .order-card__footer {
        align-items: stretch;
        flex-direction: column;
    }

    .orders-toolbar__chips {
        justify-content: flex-start;
    }

    .orders-summary,
    .order-meta-grid--rich,
    .order-empty--rich {
        grid-template-columns: 1fr;
    }

    .order-empty__icon {
        width: 70px;
        height: 70px;
    }
}
