@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=EB+Garamond:wght@400;500;600;700&display=swap');

:root {
  --forest: #123c2d;
  --forest-deep: #0b2d22;
  --leaf: #2f7d4d;
  --leaf-soft: #dcebe1;
  --gold: #cba371;
  --ink: #17211d;
  --muted: #6b746f;
  --line: #dfe4e1;
  --paper: #fff;
  --canvas: #f4f6f4;
  --danger: #a23a34;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(16, 45, 34, .09);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: "DM Sans", system-ui, sans-serif; font-size: 15px; }
h1, h2, h3, h4, h5, h6 { font-family: "EB Garamond", Georgia, serif; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 246px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 34px 22px 22px; background: var(--forest-deep); color: #fff; z-index: 30; }
.sidebar-top { display: flex; align-items: flex-start; justify-content: space-between; }
.brand { width: 150px; display: block; }
.brand img { display: block; width: 100%; height: auto; }
.primary-nav { display: grid; gap: 5px; margin-top: 58px; }
.primary-nav a { display: flex; align-items: center; gap: 14px; min-height: 46px; padding: 0 14px; border-radius: 9px; color: rgba(255,255,255,.66); font-weight: 500; transition: .18s ease; }
.primary-nav a:hover, .primary-nav a.is-active { color: #fff; background: rgba(255,255,255,.09); }
.primary-nav a.is-active { box-shadow: inset 3px 0 var(--gold); }
.sidebar-account { margin-top: auto; padding-top: 21px; border-top: 1px solid rgba(255,255,255,.14); display: grid; grid-template-columns: 38px 1fr 22px; gap: 11px; align-items: center; }
.sidebar-account strong, .sidebar-account span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-account strong { font-size: 13px; }
.sidebar-account span { color: rgba(255,255,255,.55); font-size: 11px; margin-top: 3px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: var(--forest-deep); font-weight: 700; font-size: 12px; }
.avatar--small { width: 32px; height: 32px; }
.icon-button.sidebar-close { display: none; color: #fff; }
.sidebar-scrim { display: none; }

.main { min-width: 0; padding: 58px clamp(28px, 5vw, 76px) 72px; }
.mobile-header { display: none; }
.page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 28px; margin-bottom: 38px; }
.page-header h1 { margin: 0; font-weight: 500; font-size: clamp(34px, 4vw, 52px); letter-spacing: -.025em; line-height: 1.06; }
.page-header p { margin: 10px 0 0; color: var(--muted); font-size: 16px; }
.page-header--welcome { align-items: center; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 19px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px; transition: transform .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }
.button--primary { background: var(--forest); color: #fff; }
.button--primary:hover { background: var(--forest-deep); }
.button--secondary { background: #fff; color: var(--forest); border-color: #cbd4cf; }
.button--full { width: 100%; }
.icon-button { border: 0; background: transparent; padding: 6px; display: grid; place-items: center; cursor: pointer; color: inherit; }
.text-link { display: inline-flex; align-items: center; gap: 5px; color: var(--forest); font-weight: 600; font-size: 13px; }
.text-link .icon { width: 16px; }
.section-label { display: block; color: var(--muted); font-size: 11px; line-height: 1; letter-spacing: .13em; text-transform: uppercase; font-weight: 700; }

.active-order { background: var(--forest); color: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 42px; }
.active-order__head { padding: 28px 32px 19px; display: flex; align-items: center; justify-content: space-between; }
.active-order .section-label { color: rgba(255,255,255,.57); }
.active-order h2 { margin: 8px 0 0; font-size: 27px; }
.active-order .text-link { color: #fff; }
.active-order__body { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(230px, .7fr); gap: 28px; padding: 20px 32px 28px; }
.order-summary { display: flex; align-items: center; gap: 18px; min-width: 0; }
.order-summary strong, .order-summary span { display: block; }
.order-summary strong { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-summary span { margin-top: 7px; color: rgba(255,255,255,.62); font-size: 12px; }
.product-art { width: 76px; height: 66px; position: relative; flex: 0 0 auto; }
.product-art span { position: absolute; width: 45px; height: 28px; border-radius: 50%; background: #4b9b51; border: 5px solid #82bc64; box-shadow: inset 0 0 0 5px #2e703e; transform: rotate(-9deg); }
.product-art span:nth-child(1) { left: 0; top: 24px; }
.product-art span:nth-child(2) { left: 20px; top: 8px; }
.product-art span:nth-child(3) { left: 31px; top: 31px; }
.delivery-promise { border-left: 1px solid rgba(255,255,255,.16); padding-left: 28px; }
.delivery-promise span, .delivery-promise strong, .delivery-promise small { display: block; }
.delivery-promise span { color: rgba(255,255,255,.62); font-size: 12px; }
.delivery-promise strong { font-size: 18px; margin: 6px 0; }
.delivery-promise small { color: rgba(255,255,255,.62); }
.progress { display: grid; grid-template-columns: repeat(5, 1fr); padding: 22px 32px 27px; background: rgba(0,0,0,.12); }
.progress-step { position: relative; display: grid; justify-items: center; gap: 9px; color: rgba(255,255,255,.43); font-size: 11px; text-align: center; }
.progress-step::before { content: ""; position: absolute; height: 1px; background: rgba(255,255,255,.17); left: -50%; right: 50%; top: 12px; }
.progress-step:first-child::before { display: none; }
.progress-dot { position: relative; z-index: 1; width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: #315448; color: #a9bbb5; font-size: 10px; font-weight: 700; }
.progress-step.is-complete, .progress-step.is-current { color: #fff; }
.progress-step.is-complete .progress-dot { background: var(--gold); color: var(--forest-deep); }
.progress-step.is-current .progress-dot { background: #fff; color: var(--forest-deep); box-shadow: 0 0 0 5px rgba(255,255,255,.12); }
.progress-step.is-complete::before, .progress-step.is-current::before { background: var(--gold); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) 265px; gap: 36px; align-items: start; }
.content-section { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.content-section--full { padding: 30px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.section-heading h2 { margin: 7px 0 0; font-size: 22px; }
.account-rail { display: grid; gap: 16px; }
.account-rail > section, .detail-rail > section { padding: 25px; background: #e8eee9; border-radius: var(--radius); }
.account-rail h3, .detail-rail h3 { margin: 8px 0 18px; font-size: 19px; }
.account-rail dl { margin: 0; display: grid; gap: 11px; }
.account-rail dl div { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.account-rail dt { color: var(--muted); }
.account-rail dd { margin: 0; font-weight: 700; }
.support-block { display: flex; gap: 15px; background: var(--forest-deep) !important; color: #fff; }
.support-block .icon { color: var(--gold); width: 22px; }
.support-block span, .support-block strong, .support-block a { display: block; }
.support-block span { color: rgba(255,255,255,.58); font-size: 11px; }
.support-block strong { margin: 4px 0; }
.support-block a { color: var(--gold); font-size: 11px; }

.order-table { min-width: 0; }
.order-row { display: grid; grid-template-columns: 92px 70px minmax(115px, 1fr) 68px 100px 16px; gap: 8px; min-height: 64px; align-items: center; border-top: 1px solid var(--line); font-size: 12px; }
.order-row:not(.order-row--head):hover { background: #f7f9f7; }
.order-row--head { min-height: 32px; border: 0; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.order-row > .icon { width: 16px; color: #87928c; }
.order-items { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status { width: fit-content; font-size: 10px; font-weight: 700; color: var(--forest); }
.status::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: #64a779; vertical-align: 1px; }
.status--delivered::before { background: #76847d; }
.status--cancelled { color: var(--danger); }
.status--cancelled::before { background: var(--danger); }
.empty-filter { padding: 35px; text-align: center; color: var(--muted); }
.table-tools { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.search-field { flex: 1; }
.table-tools input, .table-tools select { width: 100%; height: 44px; border: 1px solid #ccd4cf; border-radius: 8px; background: #fff; padding: 0 13px; color: var(--ink); }
.table-tools select { width: 190px; }

.back-link { display: inline-block; color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.order-title h1 { margin-top: 8px; }
.order-actions { display: flex; gap: 10px; }
.detail-progress { display: grid; grid-template-columns: repeat(5, 1fr); margin: 0 0 30px; padding: 22px 26px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.detail-progress > div { display: flex; align-items: center; gap: 10px; color: #a0a9a4; font-size: 11px; position: relative; }
.detail-progress > div::before { content: ""; position: absolute; height: 1px; background: var(--line); left: -23%; right: 83%; top: 13px; }
.detail-progress > div:first-child::before { display: none; }
.detail-progress span { width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center; background: #edf0ee; font-size: 10px; z-index: 1; }
.detail-progress .is-complete, .detail-progress .is-current { color: var(--ink); }
.detail-progress .is-complete span { background: var(--forest); color: #fff; }
.detail-progress .is-current span { background: var(--gold); color: var(--forest-deep); }
.order-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.line-items { border-top: 1px solid var(--line); }
.line-item { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--line); }
.line-item strong, .line-item span { display: block; }
.line-item span { margin-top: 5px; color: var(--muted); font-size: 12px; }
.line-item > div:last-child { text-align: right; }
.mini-product { width: 48px; height: 48px; border-radius: 10px; background: repeating-linear-gradient(112deg, #397d43 0 6px, #4d9250 6px 12px); }
.totals { width: min(330px, 100%); margin: 24px 0 0 auto; display: grid; gap: 10px; font-size: 12px; }
.totals > div { display: flex; justify-content: space-between; gap: 18px; }
.totals__grand { padding-top: 13px; border-top: 1px solid var(--line); font-size: 16px; }
.detail-rail { display: grid; gap: 16px; }
.detail-rail p { margin: 0; color: #59665f; line-height: 1.75; font-size: 12px; }

.delivery-list > a { display: grid; grid-template-columns: 56px minmax(0, 1fr) 180px 20px; gap: 20px; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--line); }
.delivery-list > a:last-child { border-bottom: 0; }
.delivery-list strong, .delivery-list span { display: block; }
.delivery-list span { color: var(--muted); font-size: 12px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.delivery-date { width: 48px; height: 53px; display: grid; place-content: center; text-align: center; background: var(--leaf-soft); border-radius: 9px; color: var(--forest); }
.delivery-date strong { font-size: 18px; line-height: 1; }
.delivery-date span { margin-top: 3px; color: var(--forest); font-size: 9px; text-transform: uppercase; }
.address-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.address-card { padding: 28px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.address-card > div { display: flex; justify-content: space-between; align-items: center; }
.address-card h2 { font-size: 19px; margin: 18px 0 8px; }
.address-card p { color: var(--muted); line-height: 1.7; margin: 0 0 22px; }
.subtle-tag { padding: 5px 8px; background: var(--leaf-soft); color: var(--forest); border-radius: 5px; font-size: 10px; font-weight: 700; }
.account-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 24px; align-items: start; }
.account-details { margin: 25px 0 0; }
.account-details > div { display: grid; grid-template-columns: 150px 1fr; gap: 20px; padding: 16px 0; border-top: 1px solid var(--line); }
.account-details dt { color: var(--muted); }
.account-details dd { margin: 0; font-weight: 600; }
.account-summary { padding: 28px; color: #fff; background: var(--forest); border-radius: var(--radius); }
.account-summary > strong { display: block; font-family: "EB Garamond", Georgia, serif; font-size: 42px; font-weight: 500; margin-top: 24px; }
.account-summary > span { color: rgba(255,255,255,.58); font-size: 12px; }
.account-summary hr { border: 0; border-top: 1px solid rgba(255,255,255,.16); margin: 24px 0; }
.account-summary > div { display: flex; justify-content: space-between; margin-top: 13px; font-size: 12px; }
.account-summary .section-label { color: var(--gold); }
.help-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 24px; }
.help-primary { background: var(--forest); color: #fff; padding: 38px; border-radius: var(--radius); }
.help-primary .section-label { color: var(--gold); }
.help-primary h2 { font-size: 38px; font-weight: 500; margin: 22px 0 12px; }
.help-primary p { color: rgba(255,255,255,.7); line-height: 1.7; }
.help-primary > div { display: flex; gap: 10px; margin-top: 25px; }
.help-primary .button--primary { background: #fff; color: var(--forest); }
.faq { background: #fff; padding: 12px 28px; border: 1px solid var(--line); border-radius: var(--radius); }
.faq details { border-bottom: 1px solid var(--line); padding: 21px 0; }
.faq details:last-child { border: 0; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq p { color: var(--muted); line-height: 1.7; }

.alert { max-width: 800px; padding: 13px 16px; margin: 0 0 22px; border-radius: 8px; font-size: 13px; }
.alert--success { background: #dcebe1; color: var(--forest); }
.alert--error { background: #f4dedc; color: #7c2823; }
.modal { width: min(520px, calc(100% - 30px)); padding: 0; border: 0; border-radius: 16px; box-shadow: 0 28px 80px rgba(0,0,0,.25); }
.modal::backdrop { background: rgba(8, 28, 21, .62); }
.modal form { position: relative; padding: 34px; }
.modal-close { position: absolute; right: 19px; top: 18px; }
.modal h2 { margin: 10px 0 8px; font-size: 34px; font-weight: 500; }
.modal p { color: var(--muted); line-height: 1.6; }
.modal label span { display: block; margin: 22px 0 7px; font-size: 12px; font-weight: 700; }
.modal textarea { width: 100%; resize: vertical; border: 1px solid #cbd3cf; border-radius: 8px; padding: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

.login-page { min-height: 100vh; background: #fff; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, .9fr) minmax(480px, 1.1fr); }
.login-brand { position: relative; display: flex; flex-direction: column; padding: 62px clamp(42px, 7vw, 96px); color: #fff; background: var(--forest-deep); overflow: hidden; }
.login-brand::after { content: ""; position: absolute; width: 520px; height: 520px; border: 80px solid rgba(203,163,113,.07); border-radius: 50%; right: -290px; bottom: -220px; }
.brand--large { width: 210px; align-self: flex-start; }
.login-copy { position: relative; z-index: 1; margin: auto 0; max-width: 460px; }
.login-copy h1 { font-size: clamp(50px, 6vw, 77px); font-weight: 500; line-height: .98; letter-spacing: -.035em; margin: 0; }
.login-copy p { max-width: 390px; color: rgba(255,255,255,.66); line-height: 1.7; font-size: 16px; margin-top: 25px; }
.login-help { position: relative; z-index: 1; color: rgba(255,255,255,.55); font-size: 12px; }
.login-help a { color: #fff; font-weight: 700; }
.login-panel { display: grid; place-items: center; padding: 45px; }
.login-form { width: min(400px, 100%); display: grid; gap: 21px; }
.login-form h2 { margin: 0; font-size: 42px; font-weight: 500; letter-spacing: -.02em; }
.login-form > div > p { color: var(--muted); margin: 8px 0 0; }
.login-form label > span { display: block; font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.login-form input[type=email], .login-form input[type=password] { width: 100%; height: 48px; border: 1px solid #c9d1cc; border-radius: 8px; padding: 0 13px; outline: none; }
.login-form input:focus, .table-tools input:focus, .table-tools select:focus, .modal textarea:focus { border-color: var(--leaf); box-shadow: 0 0 0 3px rgba(47,125,77,.12); }
.form-row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.form-row a { color: var(--forest); font-weight: 700; }
.check { display: flex; align-items: center; gap: 8px; }
.check span { margin: 0 !important; font-weight: 400 !important; }
.demo-note { display: grid; gap: 3px; padding: 12px 14px; background: var(--canvas); border-radius: 8px; color: var(--muted); font-size: 11px; }
.demo-note strong { color: var(--ink); }
.password-hint { margin: -10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }

@media (max-width: 1080px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .account-rail { grid-template-columns: 1fr 1fr; }
  .order-row { grid-template-columns: 100px 75px minmax(120px, 1fr) 72px 105px 18px; gap: 10px; }
  .order-detail-grid { grid-template-columns: 1fr 260px; }
}

@media (max-width: 820px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; transform: translateX(-102%); width: min(290px, 88vw); transition: transform .2s ease; }
  .nav-open .sidebar { transform: translateX(0); }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 20; background: rgba(8,28,21,.55); }
  .nav-open .sidebar-scrim { display: block; }
  .icon-button.sidebar-close { display: grid; }
  .main { padding: 0 20px 50px; }
  .mobile-header { height: 70px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
  .mobile-logo { width: 106px; padding: 7px 11px; border-radius: 7px; background: var(--forest-deep); }
  .mobile-logo img { display: block; width: 100%; height: auto; }
  .page-header { align-items: flex-start; }
  .active-order__body { grid-template-columns: 1fr; }
  .delivery-promise { border-left: 0; border-top: 1px solid rgba(255,255,255,.16); padding: 18px 0 0; }
  .order-table { overflow-x: auto; }
  .order-row { min-width: 750px; }
  .order-detail-grid, .account-layout, .help-layout { grid-template-columns: 1fr; }
  .detail-rail { grid-template-columns: 1fr 1fr; }
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { min-height: 330px; padding: 36px; }
  .login-copy { margin: 55px 0; }
  .login-copy h1 { font-size: 52px; }
  .login-panel { padding: 55px 25px; }
}

@media (max-width: 600px) {
  .page-header, .page-header--welcome { display: grid; }
  .page-header h1 { font-size: 38px; }
  .active-order__head, .active-order__body { padding-left: 21px; padding-right: 21px; }
  .progress { padding: 19px 10px 23px; }
  .progress-step { font-size: 8px; }
  .order-summary { align-items: flex-start; }
  .order-summary strong { white-space: normal; line-height: 1.4; }
  .account-rail, .detail-rail, .address-grid { grid-template-columns: 1fr; }
  .content-section, .content-section--full { padding: 20px; }
  .order-table { overflow: hidden; }
  .order-row { min-width: 0; grid-template-columns: 80px minmax(0, 1fr) 92px 16px; gap: 7px; }
  .order-row > :nth-child(2), .order-row > :nth-child(4) { display: none; }
  .order-items { white-space: nowrap; }
  .order-actions { display: grid; width: 100%; }
  .detail-progress { overflow-x: auto; grid-template-columns: repeat(5, 130px); }
  .table-tools { display: grid; }
  .table-tools select { width: 100%; }
  .delivery-list > a { grid-template-columns: 48px minmax(0,1fr) 18px; }
  .delivery-list > a > div:nth-child(3) { display: none; }
  .line-item { grid-template-columns: 44px minmax(0, 1fr); }
  .line-item > div:last-child { grid-column: 2; display: flex; justify-content: space-between; text-align: left; }
  .account-details > div { grid-template-columns: 1fr; gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
