:root {
    --bg: #f6f2ea;
    --panel: #fffdf9;
    --text: #1f2933;
    --muted: #6b7280;
    --line: #d7c9b6;
    --accent: #9a3412;
    --accent-soft: #fed7aa;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: linear-gradient(180deg, #f6f2ea 0%, #efe4d3 100%);
    color: var(--text);
}

body.board-page-body {
    background: #f4f7f2;
}

body.admin-login-body {
    background: #f3f5f1;
}

body.admin-app-body {
    background: #f3f5f1;
}

.container {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
}

.backend-page-container {
    width: min(92vw, 1560px);
    margin: 0 auto;
}

.backend-wide-container {
    max-width: 1560px;
}

.backend-form-container {
    width: min(92vw, 1100px);
    max-width: 1100px;
}

.backend-auth-container {
    width: min(92vw, 520px);
    max-width: 520px;
}

.site-header {
    border-bottom: 1px solid var(--line);
    background: rgba(255, 253, 249, 0.92);
    backdrop-filter: blur(8px);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
}

.brand {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
    font-size: 1.25rem;
}

.nav {
    display: flex;
    gap: 16px;
}

.nav a {
    color: var(--text);
    text-decoration: none;
}

main.container {
    padding: 40px 0 56px;
}

body.board-page-body main.container {
    padding-top: 24px;
}

body.admin-login-body main.container {
    display: grid;
    min-height: 100vh;
    align-items: center;
    padding-top: 24px;
    padding-bottom: 24px;
}

body.admin-app-body main.container {
    padding-top: 28px;
    padding-bottom: 40px;
}

.hero h1,
section h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    margin-bottom: 12px;
}

.eyebrow {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin-top: 24px;
}

.card {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--panel);
    box-shadow: 0 10px 30px rgba(31, 41, 51, 0.06);
}

.data-table {
    width: 100%;
    margin-top: 20px;
    border-collapse: collapse;
    background: var(--panel);
    border-radius: 16px;
    overflow: hidden;
}

.data-table th,
.data-table td {
    padding: 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.order-list {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.board-tabs {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 4px 0 16px;
}

.board-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border: 1px solid #cbd9cc;
    border-radius: 999px;
    background: #ffffff;
    color: #405547;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.board-tab--active {
    border-color: #9fb8a5;
    background: #eaf4eb;
    color: #244131;
}

.board-page__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.board-page__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.board-action-button {
    border: 1px solid #b8ccb9;
    border-radius: 999px;
    background: #ffffff;
    color: #284233;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1;
    padding: 9px 14px;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.board-action-button:hover {
    background: #eef7ef;
    border-color: #98b59b;
}

.board-action-button--secondary {
    background: #f7faf7;
    color: #4b6151;
}

.order-card {
    padding: 14px 16px;
    border-radius: 18px;
    border-color: #cfe0d2;
    background: #edf7ef;
    box-shadow: 0 8px 20px rgba(79, 111, 88, 0.08);
    border-left-width: 16px;
    border-left-style: solid;
}

.order-card--tone-a {
    border-color: #AFCDB7;
    border-left-color: #3F7F4C;
    background: #DDEFE2;
    box-shadow: 0 8px 20px rgba(79, 111, 88, 0.1);
}

.order-card--tone-b {
    border-color: #D6C2A8;
    border-left-color: #4E545A;
    background: #EFE3D2;
    box-shadow: 0 8px 18px rgba(120, 112, 96, 0.09);
}

.order-card__top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 240px) minmax(0, 1fr);
    align-items: start;
    gap: 16px;
}

.order-card__identity {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.order-card__customer-main {
    margin: 0;
    align-self: center;
    justify-self: center;
    color: #385244;
    font-size: 0.98rem;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
}

.order-card__customer-main--empty {
    color: var(--muted);
    font-weight: 500;
}

.order-card__summary {
    display: grid;
    justify-items: end;
    align-content: start;
    gap: 4px;
    min-width: 0;
}

.order-card__shipping-secondary {
    margin: 0;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.35;
}

.order-card__time {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.35;
}

.order-card__status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border: 1px solid #c5d8c8;
    border-radius: 999px;
    background: #f7fcf8;
    color: #4d6b56;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
    white-space: nowrap;
}

.order-card__divider {
    height: 1px;
    background: #d7e6d9;
    margin: 10px 0 12px;
}

.order-card__body {
    display: grid;
    gap: 10px;
}

.order-card__section-title {
    margin: 0;
    color: #486452;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.line-item-list {
    display: grid;
    gap: 8px;
}

.line-item {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(111, 140, 118, 0.12);
    border-radius: 14px;
    background: rgba(255, 252, 248, 0.28);
}

.line-item__media {
    display: flex;
    align-items: center;
    justify-content: center;
}

.line-item__image {
    width: 100%;
    max-width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #ffffff;
}

.line-item__placeholder {
    width: 100%;
    max-width: 72px;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    background: #fffdf9;
    text-align: center;
    padding: 6px;
    font-size: 0.75rem;
}

.line-item__placeholder--fallback {
    display: none;
}

.line-item__body h3 {
    margin-top: 0;
    margin-bottom: 5px;
    line-height: 1.25;
    font-size: 1rem;
    font-weight: 700;
}

.line-item__sku-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0 0 4px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(231, 243, 234, 0.58);
    color: #577363;
    font-size: 0.82rem;
    line-height: 1.2;
    width: fit-content;
}

.line-item__price {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.3;
}

.line-item__qty {
    align-self: center;
    justify-self: end;
    color: #375143;
    font-size: 0.94rem;
    font-weight: 700;
    white-space: nowrap;
}

.order-card h2 {
    margin-top: 0;
    margin-bottom: 0;
    line-height: 1.1;
    font-size: 1.24rem;
    color: #1e3526;
}

.order-card__footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 2px;
}

.order-card__total {
    display: grid;
    justify-items: end;
    gap: 2px;
}

.order-card__total-label {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.3;
}

.order-card__total-value {
    color: #1e3526;
    font-size: 1.18rem;
    line-height: 1.1;
    font-weight: 700;
}

.sku-value {
    font-weight: 700;
}

.empty-state {
    margin-top: 20px;
}

.board-report-card {
    display: grid;
    gap: 14px;
}

.board-report-card__header {
    display: grid;
    gap: 4px;
}

.board-report-card__header h2 {
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.15;
}

.board-report-card__header p {
    margin: 0;
    color: var(--muted);
    line-height: 1.4;
}

.board-report-card__meta {
    font-size: 0.9rem;
}

.board-report-note {
    margin: 0;
    padding: 10px 12px;
    border: 1px dashed #cfdacd;
    border-radius: 12px;
    background: #f8fbf7;
    color: #596a60;
    line-height: 1.5;
}

.board-report-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.board-report-summary__card {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border: 1px solid #d6e1d7;
    border-radius: 14px;
    background: #f7fbf7;
}

.board-report-summary__label {
    color: #5a6b61;
    font-size: 0.84rem;
    line-height: 1.35;
}

.board-report-summary__value {
    color: #1f3b2a;
    font-size: 1.4rem;
    line-height: 1.1;
    font-weight: 700;
}

.board-report-table-wrap {
    overflow-x: auto;
}

.board-report-table {
    width: 100%;
    border-collapse: collapse;
    background: #fffdf9;
}

.board-report-table th,
.board-report-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #d7e1d8;
    text-align: left;
    line-height: 1.4;
    vertical-align: top;
}

.board-report-table th {
    color: #395045;
    font-size: 0.85rem;
    font-weight: 700;
    background: #f6faf6;
}

.board-report-empty {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.admin-shell {
    display: grid;
    gap: 18px;
    width: 100%;
}

.admin-login-page {
    display: grid;
    place-items: center;
}

.admin-login-card {
    width: min(460px, 100%);
    display: grid;
    gap: 18px;
    padding: 24px 24px 22px;
    border: 1px solid #d8dfd6;
    border-radius: 20px;
    background: #fffdf9;
    box-shadow: 0 12px 28px rgba(31, 41, 51, 0.06);
}

.admin-login-card__header {
    display: grid;
    gap: 6px;
}

.admin-login-card__header h1 {
    margin: 0;
    font-size: clamp(1.9rem, 4vw, 2.3rem);
    line-height: 1.05;
}

.admin-shell--narrow {
    width: min(520px, 100%);
    margin: 0 auto;
}

.admin-shell--form {
    width: 100%;
}

.admin-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.admin-page-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-eyebrow {
    margin: 0 0 8px;
    color: #557363;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.admin-page-subtitle {
    margin: 4px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.admin-panel {
    padding: 18px 20px;
    border: 1px solid #d8dfd6;
    border-radius: 18px;
    background: #fffdf9;
    box-shadow: 0 8px 22px rgba(31, 41, 51, 0.05);
    width: 100%;
    overflow-x: auto;
}

.admin-form {
    display: grid;
    gap: 16px;
}

.admin-field {
    display: grid;
    gap: 6px;
}

.admin-field span {
    font-size: 0.92rem;
    font-weight: 600;
    color: #33413a;
}

.admin-field-hint {
    color: #66766e;
    font-size: 0.83rem;
    line-height: 1.45;
}

.admin-field input,
.admin-field textarea,
.admin-field select {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #cfd8ce;
    border-radius: 12px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
}

.admin-field textarea {
    resize: vertical;
    min-height: 112px;
}

.admin-filter-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
    align-items: end;
}

.admin-filter-bar__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #33413a;
    font-weight: 600;
}

.admin-form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-subsection {
    display: grid;
    gap: 14px;
    padding: 18px 18px 16px;
    border: 1px solid #dbe3da;
    border-radius: 16px;
    background: #f8fbf8;
}

.admin-subsection__header {
    display: grid;
    gap: 6px;
}

.admin-subsection__header h2 {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.2;
    color: #2b4234;
}

.admin-subsection__header h3 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.2;
    color: #2f4838;
}

.admin-subsection--nested {
    background: #ffffff;
}

.admin-report-fields {
    display: grid;
    gap: 14px;
}

.admin-report-time-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.admin-report-mode-note {
    padding: 12px 14px;
    border: 1px dashed #cfd8ce;
    border-radius: 12px;
    background: #ffffff;
    color: #51635a;
}

.admin-report-mode-note p {
    margin: 0;
    line-height: 1.45;
}

.admin-report-mode-note p + p {
    margin-top: 6px;
}

.admin-subsection__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-primary-button,
.admin-inline-link,
.admin-secondary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 600;
}

.admin-primary-button {
    padding: 10px 16px;
    border: 1px solid #b8ccb9;
    border-radius: 999px;
    background: #eaf4eb;
    color: #234131;
}

.admin-secondary-link {
    color: #53635b;
}

.admin-inline-link {
    color: #2a5d42;
}

.admin-alert {
    padding: 12px 14px;
    border: 1px solid #d5e3d6;
    border-radius: 14px;
    background: #f4fbf5;
}

.admin-alert--error {
    border-color: #e5c6c6;
    background: #fff4f4;
    color: #8b3838;
}

.admin-alert--error div {
    margin-top: 6px;
}

.admin-alert--success {
    border-color: #cee2d1;
    background: #f2faf3;
    color: #2c5b39;
}

.admin-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.admin-status-pill--active {
    background: #e7f3ea;
    color: #2f6543;
}

.admin-status-pill--inactive {
    background: #efe9de;
    color: #7a6750;
}

.admin-sort-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-sort-bar__label {
    color: #53635b;
    font-size: 0.92rem;
    font-weight: 600;
}

.admin-sort-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border: 1px solid #d4ddd3;
    border-radius: 999px;
    background: #ffffff;
    color: #526259;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
}

.admin-sort-link--active {
    border-color: #b8ccb9;
    background: #eaf4eb;
    color: #234131;
}

.admin-actions-cell {
    min-width: 280px;
}

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

.admin-inline-form {
    margin: 0;
}

.admin-mini-button,
.admin-mini-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border: 1px solid #d4ddd3;
    border-radius: 999px;
    background: #ffffff;
    color: #43564c;
    text-decoration: none;
    font-size: 0.83rem;
    font-weight: 600;
    line-height: 1;
}

.admin-mini-button {
    cursor: pointer;
}

.admin-mini-button--ghost {
    border-color: #c8d0d8;
    color: #475569;
    background: #f7f9fc;
}

.admin-mini-button--danger {
    border-color: #e5c6c6;
    color: #8b3838;
    background: #fff7f7;
}

.admin-copy-feedback {
    min-width: 40px;
    color: #2c5b39;
    font-size: 0.82rem;
    font-weight: 600;
}

.admin-derived-value {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border: 1px dashed #cfd8ce;
    border-radius: 12px;
    background: #f8fbf8;
    color: #4a5d53;
    line-height: 1.4;
}

.admin-derived-arrow {
    color: #819287;
    font-weight: 700;
}

@media (max-width: 700px) {
    .site-header .container {
        flex-direction: column;
        justify-content: center;
        gap: 12px;
        padding: 14px 0;
    }

    .order-card__top {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .board-page__heading,
    .board-page__actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .board-tabs {
        align-items: flex-start;
    }

    .admin-page-header,
    .admin-page-actions,
    .admin-form-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-sort-bar {
        align-items: flex-start;
    }

    .admin-login-card {
        padding: 20px 18px 18px;
    }

    .order-card__summary {
        align-items: flex-start;
        justify-items: start;
    }

    .order-card__customer-main {
        text-align: left;
        justify-self: start;
    }

    .line-item {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .line-item__qty {
        grid-column: 2;
        justify-self: start;
    }
}
