:root {
  --ink: #15322c;
  --ink-2: #254940;
  --green: #1f6b55;
  --green-2: #2f8369;
  --lime: #d9f29b;
  --cream: #f7f5ed;
  --paper: #fffef9;
  --line: #dedfd5;
  --muted: #718078;
  --orange: #e96642;
  --shadow: 0 18px 50px rgba(27, 56, 47, .09);
  --radius: 18px;
  --sidebar: 244px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--cream); font-family: "DM Sans", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, .brand { font-family: "Manrope", system-ui, sans-serif; }
h1 { margin-bottom: 8px; font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.045em; line-height: 1.08; }
h2 { letter-spacing: -.025em; }
.muted, .page-header p { color: var(--muted); }

.sidebar { position: fixed; z-index: 40; inset: 0 auto 0 0; width: var(--sidebar); padding: 30px 20px 22px; display: flex; flex-direction: column; justify-content: space-between; background: var(--ink); color: #fff; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: white; font-weight: 800; line-height: 1.05; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 13px 13px 4px 13px; background: var(--lime); color: var(--ink); font-size: 14px; transform: rotate(-3deg); }
.main-nav { display: grid; gap: 6px; margin-top: 48px; }
.main-nav a { position: relative; display: flex; align-items: center; gap: 13px; padding: 11px 12px; border-radius: 10px; color: #c2d1cc; font-size: 14px; font-weight: 600; transition: .2s ease; }
.main-nav a > span { width: 20px; text-align: center; font-size: 18px; }
.main-nav a:hover, .main-nav a.active { background: rgba(255,255,255,.1); color: #fff; }
.main-nav a.active::before { content: ""; position: absolute; left: -20px; width: 4px; height: 24px; border-radius: 0 4px 4px 0; background: var(--lime); }
.nav-label { margin: 0 12px 5px; color: #789288; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.nav-label--secondary { margin-top: 23px; }
.nav-count { display: grid; place-items: center; margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 10px; background: var(--lime); color: var(--ink); font-size: 11px; }
.sidebar-user { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); }
.user-avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--green-2); color: white; font-weight: 700; }
.user-meta { min-width: 0; display: grid; }
.user-meta strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.user-meta small { color: #8ba39a; font-size: 10px; }
.logout-button { border: 0; background: none; color: #8ba39a; cursor: pointer; font-size: 20px; }
.logout-button:hover { color: white; }
.main-content { min-height: 100vh; margin-left: var(--sidebar); padding: 48px clamp(28px, 5vw, 78px) 70px; }
.mobile-header, .sidebar-overlay { display: none; }

.page-header { margin-bottom: 30px; }
.page-header--split { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; }
.page-header p { margin-bottom: 0; }
.eyebrow { display: block; margin-bottom: 10px; color: var(--green-2); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow--light { color: var(--lime); }
.back-link { display: inline-flex; margin-bottom: 15px; color: var(--muted); font-size: 13px; font-weight: 600; }
.back-link:hover, .text-link:hover { color: var(--green); }

.button { min-height: 42px; padding: 10px 17px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid transparent; border-radius: 10px; font-weight: 700; font-size: 13px; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }
.button--primary { background: var(--green); color: white; box-shadow: 0 8px 20px rgba(31,107,85,.16); }
.button--primary:hover { background: var(--ink-2); }
.button--dark { background: var(--ink); color: white; }
.button--secondary { border-color: var(--line); background: var(--paper); color: var(--ink); }
.button--ghost { background: transparent; color: var(--muted); }
.button--large { min-height: 50px; padding: 13px 22px; }
.button--full { width: 100%; }
.button--icon { width: 42px; padding: 0; font-size: 20px; }
.button-count { display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 50%; background: var(--lime); color: var(--ink); font-size: 11px; }

.filter-bar { margin-bottom: 22px; padding: 12px; display: flex; gap: 10px; background: rgba(255,255,255,.65); border: 1px solid var(--line); border-radius: 14px; }
.search-input { position: relative; display: flex; align-items: center; flex: 1; }
.search-input span { position: absolute; left: 14px; color: var(--muted); font-size: 20px; }
.search-input input { width: 100%; min-height: 42px; padding: 10px 14px 10px 42px; border: 0; border-radius: 9px; outline: none; background: white; }
.filter-bar select { min-width: 190px; padding: 0 35px 0 13px; border: 0; border-radius: 9px; background: white; color: var(--ink); outline: none; }

.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.product-card { position: relative; min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.product-category { position: absolute; top: 16px; left: 16px; z-index: 2; padding: 5px 9px; border-radius: 20px; background: rgba(255,255,255,.85); color: var(--green); font-size: 10px; font-weight: 700; }
.product-icon { display: grid; place-items: center; height: 145px; margin: -20px -20px 18px; background: linear-gradient(135deg, #e7eedc, #f0e6c9); }
.product-card:nth-child(3n+2) .product-icon { background: linear-gradient(135deg, #f5e1d3, #eee4c7); }
.product-card:nth-child(3n+3) .product-icon { background: linear-gradient(135deg, #dcece4, #e9edcf); }
.product-icon span { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 44% 56% 48% 52%; background: var(--green); color: var(--lime); font: 800 28px "Manrope"; transform: rotate(-7deg); box-shadow: 10px 14px 0 rgba(31,107,85,.12); }
.product-info small, .product-info p { color: var(--muted); font-size: 11px; }
.product-info h2 { margin: 4px 0 7px; font-size: 18px; }
.product-info p { margin-bottom: 17px; }
.product-info p strong { color: var(--ink); }
.product-buy { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.price { display: grid; }
.price strong { font: 800 18px "Manrope"; }
.price small { color: var(--muted); font-size: 10px; }
.add-form { display: flex; gap: 6px; }
.quantity-input { width: 58px; height: 42px; padding: 8px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--ink); text-align: center; }

.panel, .table-card, .summary-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: 0 6px 24px rgba(27,56,47,.04); }
.panel { padding: 25px; }
.panel-heading { margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.panel-heading h2 { margin-bottom: 0; font-size: 20px; }
.panel-heading .eyebrow + h2 { margin-top: -5px; }
.panel-heading > span { color: var(--muted); font-size: 12px; }
.table-card { overflow: hidden; }
.data-table .table-row { display: grid; align-items: center; gap: 20px; min-height: 70px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.data-table .table-row:last-child { border-bottom: 0; }
.data-table a.table-row:hover { background: #f8f8f2; }
.table-row > div { min-width: 0; font-size: 13px; }
.table-row strong, .table-row small, .table-row span { display: block; }
.table-row small { margin-top: 3px; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.table-head { min-height: 42px !important; background: #f0f1e9; color: var(--muted); font-size: 10px !important; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.table-head > div { font-size: 10px; }
.data-table--cart .table-row { grid-template-columns: minmax(210px, 2fr) 1fr 1fr .7fr 1fr; }
.data-table--orders .table-row { grid-template-columns: .65fr 1.3fr 1.1fr 1fr 30px; }
.data-table--admin-orders .table-row { grid-template-columns: .55fr 1.65fr 1fr 1.1fr .8fr; }
.data-table--products .table-row { grid-template-columns: 1.6fr 1fr 1fr .8fr .9fr 28px; }
.data-table--customers .table-row { grid-template-columns: 1.5fr 1.4fr .7fr .65fr .9fr 28px; }
.data-table--report .table-row { grid-template-columns: 2fr 1fr 1fr 1fr; }
.row-arrow { color: var(--green); font-size: 19px !important; }
.cart-footer { display: flex; align-items: center; justify-content: space-between; padding: 20px; background: #f8f8f2; }
.cart-total { display: flex; align-items: center; gap: 25px; }
.cart-total span { color: var(--muted); }
.cart-total strong { font: 800 23px "Manrope"; }
.action-row { margin-top: 22px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.text-link { color: var(--green); font-size: 13px; font-weight: 700; }

.status { display: inline-flex !important; width: fit-content; padding: 6px 10px; border-radius: 20px; background: #e7eee9; color: var(--green); font-size: 10px; font-weight: 700; white-space: nowrap; }
.status--new { background: #fff0cc; color: #7b5a05; }
.status--confirmed { background: #dcebf8; color: #276087; }
.status--in_progress { background: #ece3fa; color: #674397; }
.status--ready { background: #dbf1dd; color: #2f7337; }
.status--completed { background: #e2e8e5; color: #53635c; }
.status--cancelled { background: #f7dfda; color: #9c3e2a; }
.status--large { padding: 9px 14px; font-size: 12px; }
.availability { display: flex !important; align-items: center; flex-direction: row !important; gap: 7px; color: var(--muted); font-size: 11px; }
.availability i { width: 7px; height: 7px; border-radius: 50%; background: #aab2ae; }
.availability--active i { background: #46a067; }

.stats-grid { margin-bottom: 22px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat-card { min-width: 0; min-height: 126px; padding: 19px; display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); }
.stat-card:hover { box-shadow: var(--shadow); }
.stat-card--accent { background: var(--ink); border-color: var(--ink); color: white; }
.stat-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: #e6eee7; color: var(--green); font-size: 20px; }
.stat-card--accent .stat-icon { background: var(--lime); color: var(--ink); }
.stat-card div { display: grid; }
.stat-card small { color: var(--muted); font-size: 10px; }
.stat-card--accent small { color: #9db1aa; }
.stat-card strong { margin-top: 3px; font: 800 26px "Manrope"; }

.form-panel { max-width: 850px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.field { display: grid; gap: 7px; }
.field--wide { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: 700; }
.field > small { color: var(--muted); font-size: 10px; }
.field--checkbox { display: flex; align-items: end; }
.field--checkbox label { min-height: 44px; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.checkbox { width: 20px; height: 20px; accent-color: var(--green); }
.form-control { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; outline: none; background: white; color: var(--ink); }
.form-control:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(47,131,105,.1); }
textarea.form-control { min-height: 95px; resize: vertical; }
.field-error { color: #a53827 !important; }
.form-error-summary { margin-bottom: 18px; padding: 12px 14px; border-radius: 9px; background: #f7dfda; color: #8a3424; font-size: 12px; }
.form-actions { margin-top: 26px; padding-top: 20px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); }
.form-stack { display: grid; gap: 18px; }

.checkout-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(310px, .8fr); gap: 22px; align-items: start; }
.delivery-address { padding: 15px; display: grid; gap: 4px; border-radius: 10px; background: #eff2e9; }
.delivery-address small { color: var(--muted); }
.summary-card { padding: 24px; position: sticky; top: 25px; }
.summary-card h2 { font-size: 19px; }
.summary-lines { display: grid; gap: 12px; padding: 17px 0; border-block: 1px solid var(--line); }
.summary-lines > div { display: flex; justify-content: space-between; gap: 20px; font-size: 12px; }
.summary-lines small { color: var(--muted); }
.summary-total { margin: 20px 0; display: flex; align-items: center; justify-content: space-between; }
.summary-total span { color: var(--muted); }
.summary-total strong { font: 800 23px "Manrope"; }
.summary-note { margin: 14px 0 0; color: var(--muted); font-size: 10px; text-align: center; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .7fr); gap: 22px; align-items: start; }
.detail-grid--admin { grid-template-columns: minmax(0, 1.65fr) minmax(300px, .65fr); }
.order-lines { display: grid; }
.order-line { padding: 15px 0; display: grid; grid-template-columns: 1fr auto 100px; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); font-size: 12px; }
.order-line div { display: grid; }
.order-line small { margin-top: 3px; color: var(--muted); }
.order-line > strong { text-align: right; }
.panel-total { padding-top: 20px; display: flex; align-items: center; justify-content: flex-end; gap: 32px; }
.panel-total span { color: var(--muted); }
.panel-total strong { font: 800 23px "Manrope"; }
.detail-aside dl { margin: 0; display: grid; gap: 18px; }
.detail-aside dl div { display: grid; gap: 4px; }
.detail-aside dt { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.detail-aside dd { margin: 0; font-size: 13px; line-height: 1.6; }
.customer-info { margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); }
.customer-info h3 { font-size: 16px; }
.customer-info > div { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.customer-info p { display: grid; gap: 4px; margin: 0; }
.customer-info small { color: var(--muted); font-size: 10px; }
.customer-info strong { font-size: 12px; line-height: 1.5; }

.report-filters { align-items: end; }
.field--inline { min-width: 180px; }
.report-summary { margin-bottom: 22px; padding: 22px; display: grid; grid-template-columns: 1fr 1fr 2fr; align-items: center; gap: 20px; border-radius: var(--radius); background: var(--ink); color: white; }
.report-summary > div:not(.report-actions) { display: grid; }
.report-summary small { color: #98ada6; }
.report-summary strong { margin-top: 4px; font: 800 25px "Manrope"; }
.report-actions { display: flex; justify-content: flex-end; gap: 9px; }

.empty-state { min-height: 340px; padding: 40px; display: grid; place-items: center; align-content: center; text-align: center; border: 1px dashed #c7cdc7; border-radius: var(--radius); background: rgba(255,255,255,.45); }
.empty-state > span { margin-bottom: 14px; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: #e5ece5; color: var(--green); font-size: 26px; }
.empty-state h2 { margin-bottom: 6px; font-size: 19px; }
.empty-state p { color: var(--muted); }
.empty-state .button { margin-top: 5px; }
.empty-state--compact { min-height: 200px; border: 0; background: transparent; }

.messages { position: fixed; z-index: 100; top: 20px; right: 24px; display: grid; gap: 8px; }
.message { min-width: 270px; padding: 13px 15px; display: flex; justify-content: space-between; gap: 15px; border-radius: 10px; background: var(--ink); color: white; box-shadow: var(--shadow); font-size: 12px; }
.message--success { background: var(--green); }
.message--error { background: #983f2e; }
.message button { padding: 0; border: 0; background: none; color: inherit; cursor: pointer; }

.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.05fr) minmax(420px, .95fr); }
.login-visual { position: relative; padding: 45px clamp(42px, 7vw, 100px); display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; background: var(--ink); color: white; }
.login-visual::before { content: ""; position: absolute; width: 420px; height: 420px; right: -180px; top: 20%; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; box-shadow: 0 0 0 80px rgba(255,255,255,.025), 0 0 0 160px rgba(255,255,255,.015); }
.login-brand { display: flex; align-items: center; gap: 12px; font: 800 18px "Manrope"; }
.login-copy { position: relative; z-index: 2; max-width: 570px; }
.login-copy h1 { font-size: clamp(3rem, 6vw, 5.7rem); color: white; }
.login-copy p { max-width: 440px; color: #a8bcb5; font-size: 16px; line-height: 1.7; }
.produce-art { position: relative; z-index: 2; height: 110px; }
.produce { position: absolute; display: grid; place-items: center; font-size: 70px; text-shadow: 10px 16px 28px rgba(0,0,0,.18); }
.produce--tomato { left: 4%; color: var(--orange); }
.produce--leaf { left: 32%; top: -25px; color: #6eb284; transform: rotate(21deg); }
.produce--lemon { left: 56%; top: 10px; color: #f1c64d; }
.produce--herb { left: 77%; top: -30px; color: var(--lime); transform: rotate(-14deg); }
.login-panel { padding: 50px clamp(35px, 8vw, 120px); display: grid; place-items: center; background: var(--paper); }
.login-form-wrap { width: 100%; max-width: 420px; }
.login-form-wrap h2 { margin-bottom: 8px; font-size: 36px; }
.login-form-wrap > p { font-size: 13px; }
.login-form { margin-top: 32px; }
.password-field { position: relative; }
.password-field input { padding-right: 42px; }
.password-field button { position: absolute; right: 6px; top: 5px; width: 34px; height: 34px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.login-help { margin-top: 25px !important; color: var(--muted); text-align: center; }

@media (max-width: 1100px) {
  .product-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .report-summary { grid-template-columns: 1fr 1fr; }
  .report-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .data-table--products .table-row { grid-template-columns: 1.5fr .8fr 1fr .8fr 28px; }
  .data-table--products .table-row > div:nth-child(2) { display: none; }
  .login-page { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px) {
  :root { --sidebar: 272px; }
  .mobile-header { position: sticky; z-index: 35; top: 0; height: 66px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; background: var(--ink); }
  .brand--mobile { font-size: 14px; }
  .brand--mobile .brand-mark { width: 34px; height: 34px; font-size: 11px; }
  .menu-button { width: 42px; height: 42px; padding: 10px; display: grid; align-content: center; gap: 5px; border: 0; border-radius: 9px; background: rgba(255,255,255,.08); }
  .menu-button span { display: block; height: 2px; border-radius: 2px; background: white; }
  .sidebar { transform: translateX(-101%); transition: transform .25s ease; }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-overlay { position: fixed; z-index: 39; inset: 0; display: block; background: rgba(9,30,24,.48); opacity: 0; pointer-events: none; transition: opacity .25s ease; }
  .sidebar-overlay.is-open { opacity: 1; pointer-events: auto; }
  .main-content { margin-left: 0; padding: 32px 22px 55px; }
  .page-header--split { align-items: flex-start; }
  .checkout-layout, .detail-grid, .detail-grid--admin { grid-template-columns: 1fr; }
  .summary-card { position: static; }
  .login-page { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { min-height: 100vh; padding: 36px 24px; }
  .data-table .table-head { display: none; }
  .data-table .table-row { padding: 17px; grid-template-columns: 1fr 1fr; gap: 14px; }
  .table-row > div::before { content: attr(data-label); display: block; margin-bottom: 3px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
  .table-row .row-arrow { display: none; }
  .data-table--admin-orders .table-row > div:nth-child(3) { display: none; }
  .data-table--customers .table-row > div:nth-child(3), .data-table--customers .table-row > div:nth-child(4) { display: none; }
}

@media (max-width: 560px) {
  .main-content { padding: 27px 15px 45px; }
  h1 { font-size: 2rem; }
  .page-header--split { flex-direction: column; }
  .page-header--split > .button { width: 100%; }
  .filter-bar { flex-wrap: wrap; }
  .filter-bar .search-input { min-width: 100%; }
  .filter-bar select, .filter-bar > .button { flex: 1; min-width: 0; }
  .product-grid, .stats-grid, .form-grid { grid-template-columns: 1fr; }
  .field--wide { grid-column: auto; }
  .product-icon { height: 130px; }
  .stat-card { min-height: 105px; }
  .data-table .table-row { grid-template-columns: 1fr; }
  .data-table--cart .table-row { grid-template-columns: 1fr 1fr; }
  .data-table--cart .table-row > div:first-child { grid-column: 1 / -1; }
  .cart-footer, .action-row { align-items: stretch; flex-direction: column; }
  .cart-total { justify-content: space-between; }
  .action-row .button { width: 100%; }
  .order-line { grid-template-columns: 1fr auto; gap: 9px; }
  .order-line > span { grid-column: 1; }
  .order-line > strong { grid-column: 2; grid-row: 1 / span 2; }
  .customer-info > div { grid-template-columns: 1fr; }
  .report-summary { grid-template-columns: 1fr; }
  .report-actions { grid-column: auto; flex-direction: column; }
  .report-filters .field { flex: 1; min-width: 130px; }
  .report-filters .button { min-width: 100%; }
  .messages { left: 15px; right: 15px; }
  .message { min-width: 0; }
  .panel { padding: 19px; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .button { width: 100%; }
}

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