:root {
    --bg: #f8f2ea;
    --surface: #fff9f2;
    --border: #e7d3c2;
    --brand-700: #1f5b54;
    --brand-500: #1f5b54;
    --text: #1f5b54;
    --muted: #5f817b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: radial-gradient(circle at top right, #ffe8d2, transparent 40%), var(--bg);
    font-family: "Sora", sans-serif;
    color: var(--text);
}

.page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 24px clamp(12px, 3.2vw, 42px) 52px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.topbar .top-leading {
    flex: 1 1 420px;
}

.topbar .site-copy {
    gap: 4px;
}

.control-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 12px 24px rgba(90, 46, 22, 0.12);
    padding: 14px;
    display: grid;
    gap: 10px;
    width: 100%;
}

.control-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.phone-input {
    flex: 1;
    min-width: 220px;
    border: 1px solid #d7bda8;
    border-radius: 12px;
    padding: 11px 12px;
    font: inherit;
    font-size: 14px;
}

.load-btn {
    border: none;
    border-radius: 12px;
    background: var(--brand-700);
    color: #fff;
    padding: 11px 15px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.page-status {
    min-height: 18px;
    font-size: 13px;
    color: #b42318;
}

.page-status.ok {
    color: #1d7a3d;
}

.orders-wrap {
    margin-top: 16px;
    display: grid;
    gap: 12px;
    width: 100%;
}

.order-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 14px;
    box-shadow: 0 10px 20px rgba(90, 46, 22, 0.08);
    display: grid;
    gap: 10px;
    width: 100%;
}

.order-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.order-id {
    font-size: 14px;
    font-weight: 700;
    color: var(--brand-700);
}

.order-meta {
    font-size: 12px;
    color: var(--muted);
}

.items-table {
    border: 1px solid #ebd9c9;
    border-radius: 12px;
    overflow: hidden;
}

.items-row {
    display: grid;
    grid-template-columns: 1.4fr 0.4fr 0.6fr;
    gap: 8px;
    padding: 8px 10px;
    font-size: 12px;
    border-top: 1px solid #f0e2d5;
}

.items-row:first-child {
    border-top: none;
}

.items-row.head {
    background: #fff3e7;
    color: var(--brand-700);
    font-weight: 700;
}

.order-feedback {
    display: grid;
    gap: 4px;
    border: 1px dashed #e2cbb8;
    border-radius: 12px;
    padding: 10px;
    background: #fffdf8;
}

.feedback-stars {
    color: var(--brand-700);
    letter-spacing: 1px;
    font-size: 13px;
    font-weight: 700;
}

.feedback-text {
    margin: 0;
    font-size: 12px;
    color: var(--text);
    white-space: pre-wrap;
}

.feedback-date {
    font-size: 11px;
    color: var(--muted);
}

.order-actions {
    display: flex;
    justify-content: flex-end;
}

.feedback-open-btn {
    border: none;
    border-radius: 10px;
    background: var(--brand-500);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 9px 11px;
    cursor: pointer;
    text-decoration: none;
}

.empty-block {
    border: 1px dashed #d8bea9;
    border-radius: 16px;
    background: #fff9f2;
    color: var(--muted);
    padding: 22px;
    text-align: center;
}

.feedback-modal {
    position: fixed;
    inset: 0;
    z-index: 1400;
    background: rgba(20, 14, 10, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.feedback-modal.hidden {
    display: none;
}

.feedback-modal-card {
    width: min(520px, 100%);
    border-radius: 16px;
    border: 1px solid #e2c9b4;
    background: #fff;
    box-shadow: 0 24px 34px rgba(12, 10, 8, 0.2);
    padding: 16px;
}

.feedback-modal-card h3 {
    margin: 0 0 8px;
    color: var(--brand-700);
}

.feedback-form {
    display: grid;
    gap: 10px;
}

.feedback-form label {
    display: grid;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
}

.feedback-form select,
.feedback-form textarea {
    border: 1px solid #d7bda8;
    border-radius: 10px;
    padding: 10px;
    font: inherit;
    color: var(--text);
}

.feedback-form textarea {
    resize: vertical;
    min-height: 90px;
}

.feedback-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.feedback-cancel-btn,
.feedback-submit-btn {
    border: none;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.feedback-cancel-btn {
    background: #f4e5d8;
    color: var(--brand-700);
}

.feedback-submit-btn {
    background: var(--brand-700);
    color: #fff;
}

.feedback-inline-status {
    min-height: 18px;
    font-size: 12px;
    color: #b42318;
}

.feedback-inline-status.ok {
    color: #1d7a3d;
}

@media (max-width: 640px) {
    .page {
        width: 100%;
        max-width: none;
        padding: 18px 12px 38px;
    }

    .control-row {
        flex-direction: column;
        align-items: stretch;
    }

    .load-btn {
        width: 100%;
    }

    .items-row {
        grid-template-columns: 1fr;
    }

    .order-actions {
        justify-content: stretch;
    }

    .feedback-open-btn {
        width: 100%;
        text-align: center;
    }
}

.profile-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.profile-summary-copy {
    display: grid;
    gap: 6px;
    flex: 1 1 320px;
}

.profile-summary-title {
    color: var(--brand-700);
    font-size: 15px;
    font-weight: 700;
}

.profile-summary-text {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.profile-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 15px;
    border-radius: 999px;
    background: var(--brand-700);
    border: none;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 10px 18px rgba(90, 46, 22, 0.12);
}

.profile-link-btn:hover {
    background: var(--brand-500);
}

@media (max-width: 640px) {
    .profile-summary {
        align-items: stretch;
    }

    .profile-link-btn {
        width: 100%;
    }
}
