:root {
  --ink: #22211f;
  --muted: #6d6963;
  --paper: #fbf8f2;
  --surface: #ffffff;
  --line: #e5ded3;
  --accent: #c9482c;
  --accent-dark: #96331f;
  --accent-dark: color-mix(in srgb, var(--accent) 76%, black);
  --accent-soft: #f8e3db;
  --accent-soft: color-mix(in srgb, var(--accent) 15%, white);
  --green: #247052;
  --green-soft: #dff2e9;
  --amber: #925d0b;
  --amber-soft: #fff0cf;
  --shadow: 0 18px 48px rgba(50, 40, 30, 0.09);
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; display: flex; flex-direction: column; background: var(--paper); }
main { flex: 1; }
a { color: inherit; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.narrow { width: min(760px, calc(100% - 40px)); }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link:focus { position: fixed; z-index: 100; top: 12px; left: 12px; padding: 10px 14px; background: var(--surface); border-radius: 10px; box-shadow: var(--shadow); }

.site-header { position: relative; z-index: 10; border-bottom: 1px solid rgba(229, 222, 211, .8); background: rgba(251, 248, 242, .94); backdrop-filter: blur(14px); }
.header-inner { min-height: 70px; display: flex; align-items: center; justify-content: flex-end; gap: 24px; }
.site-nav { display: flex; align-items: center; gap: 20px; font-size: .92rem; font-weight: 650; }
.site-nav a, .nav-button { text-decoration: none; color: var(--muted); }
.site-nav a:hover, .nav-button:hover { color: var(--ink); }
.site-nav form { margin: 0; }
.nav-button { appearance: none; padding: 0; border: 0; background: none; cursor: pointer; }

.hero-page .site-header { position: absolute; top: 16px; left: 0; width: 100%; border: 0; background: transparent; backdrop-filter: none; }
.hero-page .header-inner { min-height: 60px; padding: 0; color: white; background: transparent; border: 0; box-shadow: none; backdrop-filter: none; }
.hero-page .site-nav a, .hero-page .nav-button { color: rgba(255,255,255,.88); }
.hero-page .site-nav a:hover, .hero-page .nav-button:hover { color: white; }
.hero-page .hero { padding-top: 150px; }

.hero { --hero-color: #9f3826; padding: 82px 0 118px; text-align: center; color: white; background-color: var(--hero-color); background-image: linear-gradient(145deg, rgba(255,255,255,.12), rgba(0,0,0,.28)); background-position: center; background-size: cover; }
.hero.hero-with-image { background-image: linear-gradient(rgba(34,20,15,.46), rgba(34,20,15,.58)), var(--hero-image); }
.hero-logo { width: auto; max-width: min(300px, 75vw); height: auto; max-height: 96px; display: block; margin: 0 auto 28px; object-fit: contain; }
.hero h1, .dashboard-head h1, .detail-head h1, .confirmation-card h1, .login-card h1 { margin: 0; font-size: clamp(2.25rem, 7vw, 4.3rem); line-height: 1.02; letter-spacing: -.055em; }
.eyebrow { margin: 0 0 12px; font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.lead { max-width: 590px; margin: 18px auto 0; color: inherit; opacity: .82; font-size: clamp(1.05rem, 3vw, 1.25rem); line-height: 1.55; }

.order-section { margin-top: -62px; padding-bottom: 80px; }
.order-form { padding: clamp(24px, 6vw, 50px); background: var(--surface); border: 1px solid rgba(229, 222, 211, .8); border-radius: 26px; box-shadow: var(--shadow); }
.payment-info { margin: 0 0 34px; padding: 18px 20px; color: var(--ink); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 28%, white); border-radius: 14px; line-height: 1.6; }
.payment-info h2 { margin: 0 0 7px; font-size: 1rem; }
.payment-info div { color: color-mix(in srgb, var(--accent-dark) 72%, var(--ink)); }
.payment-info-confirmation { margin: 24px 0; text-align: left; }
.form-section { min-width: 0; margin: 0; padding: 0; border: 0; }
.form-section + .form-section { margin-top: 42px; padding-top: 38px; border-top: 1px solid var(--line); }
.form-section legend { margin-bottom: 22px; padding: 0; font-size: 1.08rem; font-weight: 800; }
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.product-card { position: relative; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; transition: border-color .18s, transform .18s, box-shadow .18s; }
.product-card:hover { transform: translateY(-2px); border-color: #cabfb1; box-shadow: 0 10px 28px rgba(50, 40, 30, .08); }
.product-image-wrap { grid-column: 1 / -1; height: 190px; margin: -20px -20px 2px; overflow: hidden; background: var(--paper); }
.product-image { width: 100%; height: 100%; display: block; object-fit: cover; }
.product-copy { min-width: 0; display: grid; gap: 6px; }
.product-copy strong { font-size: 1.05rem; }
.product-copy > span:not(.price) { color: var(--muted); font-size: .86rem; line-height: 1.4; }
.product-copy .price { color: var(--accent-dark); font-weight: 750; }
.quantity-wrap { display: grid; justify-items: center; gap: 5px; color: var(--muted); font-size: .72rem; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.quantity-wrap input { width: 68px; height: 50px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); text-align: center; font-size: 1.2rem; font-weight: 800; }
.quantity-wrap input:focus { outline: 3px solid color-mix(in srgb, var(--accent) 16%, transparent); border-color: var(--accent); }
.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.details-grid legend { grid-column: 1 / -1; }
.field-group { display: grid; gap: 8px; }
.field-group.full-width { grid-column: 1 / -1; }
.field-group label { font-size: .88rem; font-weight: 750; }
.field-group label span { color: var(--muted); font-weight: 500; }
.field-group input, .field-group textarea, .toolbar input { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.field-group input, .toolbar input { height: 50px; padding: 0 14px; }
.field-group textarea { resize: vertical; min-height: 92px; padding: 13px 14px; }
.field-group input:focus, .field-group textarea:focus, .toolbar input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent); }
.field-error { grid-column: 1 / -1; color: #a62d21; font-size: .82rem; }
.form-alert { margin-bottom: 22px; padding: 14px 16px; color: #7f271d; background: #ffe5df; border: 1px solid #f1b7aa; border-radius: 12px; }
.form-alert ul { margin: 0; padding-left: 20px; }

.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; border: 1px solid transparent; border-radius: 12px; cursor: pointer; text-decoration: none; font-weight: 750; transition: transform .15s, background .15s, border-color .15s; }
.button:hover { transform: translateY(-1px); }
.button:focus-visible, .icon-button:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 28%, transparent); outline-offset: 2px; }
.button-primary { color: white; background: var(--accent); }
.button-primary:hover { background: var(--accent-dark); }
.button-secondary { color: var(--ink); background: var(--surface); border-color: var(--line); }
.button-secondary:hover { border-color: #beb3a5; }
.button-danger { color: #fff; background: #a62d21; }
.button-danger:hover { background: #7f2119; }
.button-danger-outline { color: #a62d21; background: #fff; border-color: #e5a9a2; }
.button-large { width: 100%; min-height: 56px; margin-top: 34px; font-size: 1.02rem; }
.button:disabled { cursor: not-allowed; opacity: .5; transform: none; }

.confirmation-wrap, .login-wrap { padding: 70px 0 90px; }
.confirmation-card, .login-card { padding: clamp(28px, 7vw, 56px); background: var(--surface); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow); }
.confirmation-card { text-align: center; }
.success-mark { width: 60px; height: 60px; display: grid; place-items: center; margin: 0 auto 24px; color: white; background: var(--green); border-radius: 50%; font-size: 1.8rem; font-weight: 900; }
.confirmation-card .eyebrow, .login-card .eyebrow { color: var(--accent); }
.confirmation-card .lead { color: var(--muted); }
.summary-list { margin: 30px 0; border-top: 1px solid var(--line); }
.summary-list > div { display: flex; justify-content: space-between; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.summary-list dt, .summary-list dd { margin: 0; }
.summary-list dt { color: var(--muted); }
.summary-list dd { text-align: right; font-weight: 750; }
.summary-list .summary-total { font-size: 1.08rem; }
.summary-list .summary-total dt, .summary-list .summary-total dd { color: var(--ink); font-weight: 850; }
.login-wrap { width: min(500px, calc(100% - 40px)); }
.login-card h1 { font-size: 2.6rem; }
.login-card > p:not(.eyebrow) { margin: 14px 0 28px; color: var(--muted); line-height: 1.55; }
.login-form { display: grid; gap: 18px; }
.login-form .button { margin-top: 6px; }

.messages { padding-top: 14px; }
.message { padding: 13px 16px; color: #164e3a; background: var(--green-soft); border: 1px solid #addac8; border-radius: 12px; }
.dashboard-head { padding: 48px 0 30px; color: white; background: linear-gradient(135deg, #332c28, #191817); }
.dashboard-head h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.title-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 34px; }
.stat-card { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; color: rgba(255,255,255,.7); background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); border-radius: 14px; text-decoration: none; }
.stat-card strong { color: white; font-size: 1.6rem; }
.stat-card.active { color: white; background: var(--accent); border-color: var(--accent); }
.dashboard-body { padding: 30px 0 80px; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.search-field { flex: 1; }
.clear-link { margin-left: 4px; color: var(--muted); font-size: .9rem; }
.order-list { display: grid; gap: 10px; }
.order-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 18px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; transition: border-color .15s, box-shadow .15s; }
.order-row:hover { border-color: #c8bdaf; box-shadow: 0 8px 24px rgba(50, 40, 30, .06); }
.order-row.is-complete { background: #fafafa; }
.order-main { min-width: 0; display: grid; grid-template-columns: 86px minmax(150px, 1fr) minmax(150px, 1fr); align-items: center; gap: 16px; text-decoration: none; }
.order-id { color: var(--muted); font-size: .8rem; font-weight: 800; }
.order-customer, .order-items { min-width: 0; display: grid; gap: 4px; }
.order-customer strong { overflow: hidden; text-overflow: ellipsis; }
.order-customer span, .order-items { color: var(--muted); font-size: .82rem; }
.order-statuses { display: flex; flex-wrap: wrap; gap: 6px; }
.status-pill { display: inline-flex; align-items: center; padding: 6px 9px; border-radius: 999px; font-size: .74rem; font-weight: 800; white-space: nowrap; }
.status-good { color: var(--green); background: var(--green-soft); }
.status-warn { color: var(--amber); background: var(--amber-soft); }
.status-neutral { color: #5b5b5b; background: #ecebe8; }
.quick-actions { display: flex; gap: 6px; }
.quick-actions form { margin: 0; }
.icon-button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; padding: 0 11px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; text-decoration: none; font-size: .78rem; font-weight: 750; white-space: nowrap; }
.icon-button.primary { color: white; background: var(--accent); border-color: var(--accent); }
.icon-button.danger { color: #a62d21; border-color: #e5a9a2; }
.empty-state { padding: 20px; color: var(--muted); background: var(--paper); border: 1px dashed #cfc4b7; border-radius: 14px; text-align: center; }
.empty-state.large { padding: 70px 20px; }
.empty-state h2 { margin: 0 0 8px; color: var(--ink); }
.empty-state p { margin: 0; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 20px; padding-top: 26px; color: var(--muted); font-size: .9rem; }
.pagination a { color: var(--accent-dark); font-weight: 750; }

.detail-wrap { padding: 44px 0 80px; }
.back-link { display: inline-block; margin-bottom: 24px; color: var(--muted); font-size: .9rem; }
.detail-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.detail-head h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); }
.phone-link { display: inline-block; margin-top: 10px; color: var(--muted); }
.address-block { margin: 10px 0 0; color: var(--muted); line-height: 1.5; }
.detail-badges { display: flex; gap: 8px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .75fr); gap: 18px; }
.detail-card { padding: clamp(22px, 4vw, 34px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.detail-card h2 { margin: 0 0 18px; font-size: 1rem; }
.order-note { margin: 24px 0; padding: 16px; background: var(--paper); border-radius: 12px; }
.order-note p { margin: 8px 0 0; color: var(--muted); line-height: 1.55; }
.detail-actions { display: flex; gap: 10px; }
.danger-zone { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.delete-warning { margin: 24px 0; padding: 16px; color: #7f2119; background: #fff0ed; border: 1px solid #eab1a9; border-radius: 12px; line-height: 1.55; }
.confirmation-actions { display: flex; gap: 10px; margin-top: 24px; }
.confirmation-actions form { margin: 0; }
.staff-layout { display: grid; grid-template-columns: minmax(280px, .7fr) minmax(0, 1.3fr); gap: 18px; }
.staff-card { padding: clamp(22px, 4vw, 34px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.staff-card h2 { margin: 0 0 20px; }
.staff-form { display: grid; gap: 18px; }
.staff-list { display: grid; gap: 10px; }
.staff-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.staff-row:first-child { padding-top: 0; }
.staff-row:last-child { padding-bottom: 0; border-bottom: 0; }
.staff-identity { min-width: 0; display: grid; gap: 4px; }
.staff-identity span { overflow: hidden; color: var(--muted); text-overflow: ellipsis; }
.invite-link-wrap { display: grid; gap: 10px; margin: 24px 0; }
.invite-link-wrap input { width: 100%; height: 50px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.timeline { margin: 0; padding: 0; list-style: none; }
.timeline li { position: relative; display: grid; gap: 4px; margin-left: 6px; padding: 0 0 22px 22px; border-left: 1px solid var(--line); }
.timeline li::before { content: ""; position: absolute; width: 9px; height: 9px; top: 4px; left: -5px; background: var(--accent); border-radius: 50%; }
.timeline li:last-child { padding-bottom: 0; }
.timeline strong { font-size: .88rem; }
.timeline span { color: var(--muted); font-size: .78rem; }
.error-page { padding: 100px 0; text-align: center; }
.error-page h1 { margin: 0; font-size: 3rem; letter-spacing: -.04em; }
.error-page p { margin: 14px 0 28px; color: var(--muted); }

.site-footer { padding: 28px 0; color: var(--muted); border-top: 1px solid var(--line); text-align: center; font-size: .82rem; }

@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .order-row { grid-template-columns: minmax(0, 1fr) auto; }
  .order-main { grid-column: 1 / -1; }
  .order-statuses { align-self: center; }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 650px) {
  .shell, .narrow, .login-wrap { width: min(100% - 24px, 1180px); }
  .header-inner { min-height: 62px; }
  .hero-page .site-header { top: 10px; }
  .hero-page .header-inner { min-height: 56px; padding: 0; }
  .hero-page .hero { padding-top: 122px; }
  .hero-logo { max-width: min(230px, 72vw); max-height: 76px; margin-bottom: 22px; }
  .site-nav { gap: 12px; font-size: .84rem; }
  .hero { padding: 62px 0 96px; }
  .order-section { margin-top: -48px; }
  .order-form { border-radius: 20px; }
  .product-grid, .details-grid { grid-template-columns: 1fr; }
  .field-group.full-width, .details-grid legend { grid-column: auto; }
  .product-card { padding: 16px; }
  .confirmation-wrap, .login-wrap { padding: 36px 0 60px; }
  .title-row, .detail-head { align-items: flex-start; flex-direction: column; }
  .title-actions, .title-actions .button { width: 100%; }
  .stats-grid { gap: 8px; }
  .stat-card { padding: 13px; }
  .stat-card strong { font-size: 1.35rem; }
  .toolbar { align-items: stretch; flex-wrap: wrap; }
  .search-field { flex: 1 0 100%; }
  .order-row { grid-template-columns: 1fr; gap: 12px; }
  .order-main { grid-template-columns: 1fr; gap: 5px; }
  .order-items { margin-top: 6px; }
  .quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); }
  .quick-actions form, .icon-button { width: 100%; }
  .staff-layout { grid-template-columns: 1fr; }
  .detail-actions { flex-direction: column; }
  .detail-actions form, .detail-actions .button { width: 100%; }
  .confirmation-actions { align-items: stretch; flex-direction: column; }
  .confirmation-actions form, .confirmation-actions .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
