:root {
    color-scheme: light;
    --paper: #faf7f5;
    --surface: #fff;
    --ink: #261c24;
    --muted: #655862;
    --line: #e9dfe4;
    --accent: #9b2454;
    --accent-dark: #77183e;
    --plum: #3b2436;
    --rose: #f7e6ed;
    --radius: 18px;
    font-family: "Segoe UI", system-ui, sans-serif;
    font-size: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); line-height: 1.5; }
a { color: var(--accent-dark); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p, dl { margin: 0; }
h1 { font-size: clamp(2rem, 5vw, 3.05rem); line-height: 1.08; letter-spacing: -.045em; overflow-wrap: anywhere; }
h2 { font-size: 1.18rem; line-height: 1.25; }
h3 { margin-top: 1.25rem; font-size: .96rem; }
small { font-size: .82rem; }
:focus-visible { outline: 3px solid #9b2454; outline-offset: 3px; }
.skip { position: absolute; top: 0; left: .75rem; z-index: 2; padding: .65rem; background: white; transform: translateY(-120%); }
.skip:focus { transform: translateY(0); }
.muted { color: var(--muted); }
.subtitle { margin-top: .6rem; overflow-wrap: anywhere; }
.eyebrow { color: var(--accent-dark); font-size: .73rem; text-transform: uppercase; font-weight: 750; letter-spacing: .14em; margin-bottom: .55rem; }

.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-inner, .shell { width: min(1280px, calc(100% - 3rem)); margin-inline: auto; }
.top-inner { min-height: 77px; display: flex; align-items: center; gap: 1.8rem; }
.brand { display: flex; align-items: center; gap: .75rem; color: var(--ink); font-weight: 750; text-decoration: none; line-height: 1.2; white-space: nowrap; }
.brand small { display: block; margin-top: .2rem; letter-spacing: .13em; color: var(--muted); font-size: .62rem; }
.flower { display: grid; width: 42px; height: 42px; border-radius: 14px; place-items: center; background: var(--rose); color: var(--accent-dark); font: 1.5rem/1 Georgia, serif; }
.top nav { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.top nav a { text-decoration: none; color: var(--muted); white-space: nowrap; padding: .55rem .75rem; border-radius: 9px; font-size: .89rem; font-weight: 650; }
.top nav a:hover, .top nav a[aria-current] { color: var(--accent-dark); background: var(--rose); }
.top-logout { margin-inline-start: auto; }
.shell { padding-block: 2.75rem 4rem; }
.page-head { display: flex; gap: 1.15rem; flex-wrap: wrap; align-items: end; justify-content: space-between; margin-bottom: 1.5rem; }
.back { display: inline-block; margin-bottom: 1.3rem; font-weight: 650; font-size: .9rem; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 5px 18px #41203708; }
.filter-card, .form-card, .section-card { padding: clamp(1rem, 3vw, 1.6rem); }
.filter-card { margin-bottom: 1.2rem; }
.filter-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); align-items: end; gap: .85rem 1rem; }
.filter-form .search-field { grid-column: span 2; }
.button {
    display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .55rem .95rem;
    border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--ink);
    font-size: .91rem; font-weight: 700; text-decoration: none; text-align: center;
}
.button:hover { background: #f5edf1; }
.button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button.primary:hover { background: var(--accent-dark); }
.button.dark { background: var(--plum); border-color: var(--plum); color: #fff; }
.button.dark:hover { background: #54334d; }
.button.subtle { border-color: transparent; background: transparent; }
.button.subtle:hover { background: #f5edf1; }
.button.danger { color: #8c2631; border-color: #eccbd2; }
.button.danger-fill { color: #fff; background: #8c2631; border-color: #8c2631; }
.button.danger-fill:hover { background: #691c26; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .65rem; }
.action-stack { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1rem; }

label { display: flex; flex-direction: column; gap: .38rem; min-width: 0; font-size: .85rem; font-weight: 700; }
input, select, textarea {
    width: 100%; min-width: 0; min-height: 44px; background: #fff; color: var(--ink); border: 1px solid #d9ccd4;
    border-radius: 9px; padding: .58rem .68rem; font-size: 1rem; font-weight: 400;
}
input::placeholder { color: #756975; opacity: 1; }
textarea { resize: vertical; }
.form-card { max-width: 770px; }
.form-card > p, .form-card > h2 { margin-bottom: 1.15rem; }
.form-grid, .form-stack { display: grid; gap: 1rem; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-two { grid-column: 1 / -1; }
.optional { color: var(--muted); font-size: .75rem; font-weight: 500; }
.narrow { max-width: 570px; }
.alert { border-radius: 10px; margin-bottom: 1rem; border: 1px solid #eac4cf; color: #81213b; background: #fceaf0; padding: .7rem .85rem; }
.alert.success { border-color: #bfdccc; color: #205936; background: #e8f5ed; }

.table-head { padding: 1rem 1.3rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .8rem; }
.table-head p { font-size: .86rem; margin-top: .15rem; }
.table-scroll { overflow-x: auto; border-radius: inherit; }
table { width: 100%; border-collapse: collapse; font-size: .91rem; text-align: left; }
th, td { padding: .86rem 1rem; vertical-align: top; }
th { font-size: .77rem; color: var(--muted); background: #faf6f8; white-space: nowrap; }
td { border-top: 1px solid var(--line); overflow-wrap: anywhere; }
tr:hover td { background: #fdf9fb; }
td small { display: block; color: var(--muted); margin-top: .2rem; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-link { font-weight: 750; text-underline-offset: .18em; white-space: nowrap; }
.chips { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; }
.chip { display: inline-block; margin: 0 .2rem .2rem 0; padding: .2rem .6rem; border-radius: 99px; font-size: .77rem; font-weight: 720; white-space: nowrap; background: #f0e9ee; color: #513e4b; }
.chip.requested { color: #6b480c; background: #fff0ce; }
.chip.received { color: #2f4b76; background: #e8eefb; }
.chip.delivered, .chip.paid { color: #245a3d; background: #e3f3e9; }
.chip.pending { color: #695114; background: #f8efd6; }
.chip.cancelled { color: #822b3b; background: #f8e0e7; }
.empty { border-top: 1px solid var(--line); padding: 2rem 1.25rem; color: var(--muted); text-align: center; }
.pager { display: flex; align-items: center; justify-content: end; flex-wrap: wrap; gap: .65rem; padding: .9rem 1.25rem; font-size: .86rem; }

.detail-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1.15rem; margin-bottom: 1.15rem; align-items: start; }
.detail-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .8rem; }
.details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; margin-top: 1.2rem; }
dt { color: var(--muted); font-size: .84rem; }
dd { margin: .15rem 0 0; font-weight: 665; overflow-wrap: anywhere; }
.section-card > p { margin-top: .7rem; }
.notes { white-space: pre-wrap; overflow-wrap: anywhere; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); gap: .9rem; margin-bottom: 1.2rem; }
.metric { padding: 1rem 1.2rem; }
.metric dd { font-size: clamp(1.5rem, 3vw, 2.15rem); letter-spacing: -.035em; }
.progress-list { display: grid; gap: 1rem; margin-top: 1.2rem; }
.progress-row > div { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
progress { width: 100%; height: .6rem; border: 0; border-radius: 99px; accent-color: var(--accent); overflow: hidden; }
progress::-webkit-progress-bar { background: #f5edf1; }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }

.guest { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(ellipse at top left, #f5dbe5, transparent 60%), var(--paper); }
.guest-shell { width: min(900px, calc(100% - 2rem)); margin: 2rem 0; }
.guest-shell .narrow { padding: 1.5rem; margin-inline: auto; }
.guest-shell .narrow h1 { margin-bottom: 1rem; }
.login-layout { display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; border-radius: 25px; box-shadow: 0 20px 60px #4a29432b; }
.login-brand {
    color: white; min-height: 490px; display: grid; align-content: center; justify-items: start; padding: clamp(1.4rem, 5vw, 4rem);
    background: radial-gradient(ellipse at 100% 0%, #cb4d71 0%, transparent 51%), linear-gradient(135deg, #391e34, #722144);
}
.login-brand .flower { background: #ffffff25; color: #fff; width: 58px; height: 58px; font-size: 2rem; margin-bottom: 1.45rem; }
.login-brand .eyebrow { color: #fce2ee; }
.wordmark { font: 400 clamp(3rem, 7vw, 5rem)/.94 Georgia, serif; letter-spacing: -.055em; }
.login-card { padding: clamp(1.4rem, 4.5vw, 3rem); align-content: center; border-radius: 0; }
.login-card h1 { font-size: clamp(1.85rem, 4vw, 2.7rem); }
.login-card > .muted { margin: .65rem 0 1.35rem; }
.login-card button { margin-top: .35rem; }

@media (max-width: 840px) {
    .top-inner { flex-wrap: wrap; gap: .5rem 1rem; padding-block: .75rem; }
    .top nav { order: 3; flex-basis: 100%; }
    .top nav a { padding-inline: .55rem; }
    .shell { padding-top: 1.8rem; }
}
@media (max-width: 680px) {
    .top-inner, .shell { width: calc(100% - 1.5rem); }
    .detail-layout, .login-layout { grid-template-columns: 1fr; }
    .login-brand { min-height: 0; padding: 1.35rem; }
    .login-brand .flower { display: none; }
    .wordmark { font-size: 2.35rem; }
    .wordmark br { display: none; }
    .wordmark br::after { content: " "; }
    .filter-form .search-field { grid-column: 1 / -1; }
    .order-table, .order-table tbody { display: block; }
    .order-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .order-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); padding: .7rem .9rem; }
    .order-table td { display: block; padding: .26rem .15rem; border: 0; text-align: left; }
    .order-table td::before { content: attr(data-label); display: block; color: var(--muted); font-size: .73rem; font-weight: 650; }
}
@media (max-width: 410px) {
    .form-grid { grid-template-columns: 1fr; }
    .filter-form { grid-template-columns: 1fr; }
    .table-head { padding-inline: 1rem; }
}
