:root {
  color-scheme: light;
  --forest: #173d32;
  --forest-deep: #102d26;
  --leaf: #647c5b;
  --gold: #c5a46a;
  --paper: #fffefa;
  --ink: #20372f;
  --muted: #6f7770;
  --line: #dcded5;
  --sans: "Be Vietnam Pro", "Segoe UI", Arial, sans-serif;
  --serif: "Playfair Display", Georgia, serif;
}

* { box-sizing: border-box; }
body { min-height: 100vh; margin: 0; background: #f7f4ee; color: var(--ink); font-family: var(--sans); font-size: 14px; line-height: 1.6; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
.admin-header { height: 78px; padding: 0 max(24px, calc((100% - 1120px) / 2)); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(23, 61, 50, .12); background: rgba(255, 255, 255, .96); }
.admin-brand { width: 142px; height: 68px; display: block; overflow: hidden; }
.admin-brand img { width: 100%; height: 100%; object-fit: contain; }
.back-link { color: var(--forest); font-size: 13px; text-decoration: none; }
.back-link:hover { color: #987746; }
.admin-main { width: min(1080px, calc(100% - 40px)); margin: 56px auto 80px; }
.panel { padding: 28px; border: 1px solid var(--line); background: #fff; box-shadow: 0 12px 32px rgba(16, 45, 38, .05); }
.login-panel { width: min(460px, 100%); margin: 8vh auto 0; }
.eyebrow { margin: 0 0 8px; color: var(--leaf); font-size: 10px; font-weight: 700; letter-spacing: 1.1px; text-transform: uppercase; }
h1, h2 { margin: 0; color: var(--forest); font-family: var(--serif); font-weight: 600; line-height: 1.2; }
h1 { font-size: clamp(30px, 4vw, 40px); }
h2 { font-size: 25px; }
.panel-intro { margin: 12px 0 24px; color: var(--muted); }
.account-help { margin-bottom: 18px; padding: 15px; border-left: 2px solid var(--gold); background: #f7f4ee; font-size: 12px; }
.account-help strong { color: var(--forest); }
.account-help p { margin: 6px 0 8px; color: var(--muted); }
.account-help a { color: var(--forest); font-weight: 600; text-underline-offset: 3px; }
.setup-message { margin: 0 0 18px; padding: 12px 14px; border: 1px solid #d7a39c; background: #fff8f6; color: #8a2c22; font-size: 12px; }
.setup-message[hidden] { display: none; }
.stack-form, .order-form { display: grid; gap: 17px; }
label { display: grid; gap: 7px; color: var(--forest-deep); font-size: 12px; font-weight: 600; }
input, select, textarea { width: 100%; min-height: 43px; padding: 10px 12px; border: 1px solid #cfd5cc; border-radius: 2px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 400; }
textarea { min-height: 76px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--leaf); outline: 2px solid rgba(100, 124, 91, .17); }
.button { min-height: 42px; padding: 9px 16px; border: 1px solid var(--forest); border-radius: 2px; cursor: pointer; font-size: 12px; font-weight: 600; transition: background .2s ease, color .2s ease; }
.button-primary { background: var(--forest); color: #fff; }
.button-primary:hover { background: var(--forest-deep); }
.button-secondary { background: transparent; color: var(--forest); }
.button-secondary:hover { background: #f1f4ef; }
.button:disabled { cursor: wait; opacity: .65; }
.dashboard[hidden], [hidden] { display: none !important; }
.dashboard-heading, .orders-heading, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.dashboard-heading { margin-bottom: 24px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.summary-card { min-height: 100px; padding: 18px 20px; display: grid; align-content: space-between; border: 1px solid var(--line); background: #fff; }
.summary-card span { color: var(--muted); font-size: 12px; }
.summary-card strong { color: var(--forest); font-family: var(--serif); font-size: 27px; line-height: 1; }
.order-entry { margin-bottom: 22px; }
.section-heading { margin-bottom: 22px; }
.order-form { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field-wide { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; }
.orders-heading { margin-bottom: 20px; }
.search-field { width: min(360px, 100%); margin-bottom: 18px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 13px 11px; border-bottom: 1px solid #e8eae4; vertical-align: top; }
th { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; white-space: nowrap; }
td { font-size: 12px; }
td strong { display: block; color: var(--forest); font-size: 12px; }
td small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.customer-address, .order-note { max-width: 240px; white-space: pre-wrap; }
.status-select { min-width: 130px; min-height: 35px; padding: 6px 8px; }
.empty-state { padding: 26px 0 8px; color: var(--muted); text-align: center; }
.notice { position: fixed; right: 20px; bottom: 20px; z-index: 5; max-width: min(440px, calc(100% - 40px)); margin: 0; padding: 12px 16px; border: 1px solid var(--line); background: #fff; box-shadow: 0 8px 28px rgba(16, 45, 38, .15); color: var(--forest); font-size: 12px; }
.notice:empty { display: none; }
.notice[data-kind="error"] { border-color: #d7a39c; color: #8a2c22; }
.notice[data-kind="success"] { border-color: #9db79b; }

@media (max-width: 720px) {
  .admin-header { height: 68px; padding: 0 20px; }
  .admin-brand { width: 120px; height: 60px; }
  .admin-main { width: min(100% - 28px, 560px); margin-top: 30px; }
  .panel { padding: 20px; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .summary-card { min-height: 86px; padding: 13px; }
  .dashboard-heading, .orders-heading { align-items: flex-start; }
  .orders-panel { padding: 18px 14px; }
  th, td { padding: 11px 9px; }
}

@media (max-width: 460px) {
  .order-form { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .search-field { width: 100%; }
}
