:root {
  color-scheme: light;
  --forest: #10251b;
  --forest-soft: #1b5e20;
  --green: #4caf50;
  --gold: #c8a75d;
  --ink: #17221a;
  --muted: #68736b;
  --line: #dfe5de;
  --paper: #f3f5f1;
  --white: #fff;
  font-family: "Aptos", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--forest-soft); }
[hidden] { display: none !important; }

.skip-link { position: fixed; z-index: 10; top: 8px; left: 8px; padding: 10px 15px; color: var(--white); background: var(--forest); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.admin-header { display: flex; height: 76px; align-items: center; justify-content: space-between; padding-inline: max(24px, calc((100vw - 1120px) / 2)); border-bottom: 1px solid var(--line); background: var(--white); }
.admin-brand { display: inline-flex; align-items: center; gap: 11px; color: var(--forest); font-size: 14px; font-weight: 800; letter-spacing: .16em; text-decoration: none; }
.admin-brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; letter-spacing: .15em; }
.brand-symbol { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid var(--green); color: var(--forest-soft); font-family: Georgia, serif; font-size: 22px; }
.back-link { color: var(--muted); font-size: 12px; text-decoration: none; }
.back-link span { margin-left: 5px; color: var(--gold); }
.admin-main { width: min(1120px, calc(100% - 48px)); min-height: calc(100vh - 140px); margin: 0 auto; padding-block: 48px 72px; }
.eyebrow { margin: 0 0 10px; color: var(--forest-soft); font-size: 10px; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 13px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(34px, 5vw, 47px); font-weight: 400; letter-spacing: -.04em; }
h2 { margin-bottom: 0; font-family: Georgia, "Times New Roman", serif; font-size: 29px; font-weight: 400; }
h3 { margin-bottom: 8px; }
.intro-copy { max-width: 580px; margin-bottom: 25px; color: var(--muted); font-size: 13px; line-height: 1.75; }
.login-card, .setup-card, .access-card { width: min(100%, 490px); margin: 45px auto; padding: clamp(26px, 5vw, 44px); border: 1px solid var(--line); background: var(--white); box-shadow: 0 12px 36px rgba(16,37,27,.06); }
.setup-card p:not(.eyebrow), .access-card > p:not(.eyebrow) { color: var(--muted); font-size: 13px; line-height: 1.75; }
.setup-card code, .import-card code { padding: 2px 5px; color: var(--forest-soft); background: #eef3eb; font-size: .92em; }
.login-card form { display: grid; gap: 9px; }
label { display: block; margin-top: 9px; font-size: 11px; font-weight: 700; }
input:not([type="file"]), textarea { width: 100%; min-height: 43px; padding: 10px 12px; border: 1px solid #d4dcd3; border-radius: 0; color: var(--ink); background: var(--white); outline: none; }
textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
input:focus, textarea:focus { border-color: var(--forest-soft); box-shadow: 0 0 0 3px rgba(76,175,80,.13); }
.button { display: inline-flex; min-height: 43px; align-items: center; justify-content: center; padding: 0 16px; border: 1px solid transparent; cursor: pointer; font-size: 11px; font-weight: 700; transition: background .2s ease, border-color .2s ease, transform .2s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .65; transform: none; }
.button-primary { color: var(--white); background: var(--forest); }
.button-primary:hover { background: #244d35; }
.button-secondary { border-color: var(--line); color: var(--ink); background: var(--white); }
.button-secondary:hover { border-color: #97a398; background: #f8faf7; }
.login-card .button { margin-top: 14px; }
.form-status { min-height: 18px; margin: 12px 0 0; color: var(--forest-soft); font-size: 12px; line-height: 1.6; }
.form-status.is-error { color: #a3332e; }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 18px; }
.auth-tab { flex: 1; min-height: 40px; border: 1px solid var(--line); background: var(--white); color: var(--ink); cursor: pointer; font-size: 11px; font-weight: 700; }
.auth-tab.is-active { color: var(--white); background: var(--forest); border-color: var(--forest); }
.field-help-inline { color: var(--muted); font-weight: 400; }
.access-card .button { margin: 8px 8px 0 0; }
.password-field { position: relative; }
.password-field input { padding-right: 70px; }
.password-toggle { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 700; }
.login-back { display: inline-block; margin-top: 10px; color: var(--muted); font-size: 11px; text-decoration: none; }

.dashboard-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; margin-bottom: 28px; }
.dashboard-heading .intro-copy { margin-bottom: 0; }
.dashboard-heading > .button { margin-top: 19px; }
.dashboard-status { margin: -7px 0 17px; }
.admin-section { margin-top: 20px; padding: clamp(21px, 4vw, 34px); border: 1px solid var(--line); background: var(--white); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 22px; }
.section-actions { display: flex; align-items: center; gap: 10px; }
.section-heading .eyebrow { margin-bottom: 6px; }
.whatsapp-form { display: flex; align-items: flex-end; gap: 14px; }
.whatsapp-form > div { flex: 1; max-width: 480px; }
.whatsapp-form label, .image-editor label { margin-top: 0; }
.field-help { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.section-heading-products { margin-bottom: 18px; }
.section-heading-products h2 span { margin-left: 6px; color: #89928a; font-family: inherit; font-size: 12px; }
.product-table-wrap { overflow-x: auto; border: 1px solid var(--line); }
.product-table { width: 100%; border-collapse: collapse; text-align: left; }
.product-table th { padding: 12px 14px; color: #667067; background: #f6f8f5; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.product-table td { padding: 12px 14px; border-top: 1px solid var(--line); font-size: 12px; }
.product-table td:nth-child(2) { color: var(--muted); font-family: Georgia, serif; font-style: italic; }
.product-thumbnail { width: 44px; height: 38px; object-fit: cover; background: #eef2eb; }
.no-image { color: #89928a; font-size: 10px; }
.table-edit { min-height: 32px; padding: 0 10px; border: 1px solid var(--line); color: var(--forest-soft); background: var(--white); cursor: pointer; font-size: 10px; font-weight: 700; }
.table-edit:hover { border-color: var(--forest-soft); }
.import-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; padding: 18px; border: 1px solid #c7d7c2; background: #f3f7f0; }
.import-card h3 { margin-bottom: 5px; font-size: 13px; }
.import-card p { margin-bottom: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.product-editor { margin-top: 22px; padding: clamp(18px, 4vw, 28px); border: 1px solid #cdd9ca; background: #fbfcfa; }
.editor-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.editor-heading .eyebrow { margin-bottom: 4px; }
.editor-heading h3 { margin: 0; font-family: Georgia, serif; font-size: 22px; font-weight: 400; }
.icon-button { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid var(--line); background: var(--white); cursor: pointer; font-size: 24px; }
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.editor-field label { margin-block: 8px 5px; }
.editor-field.full-width { grid-column: 1 / -1; }
.image-editor { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.image-editor input[type="file"] { display: block; max-width: 100%; margin-top: 10px; font-size: 12px; color: var(--muted); }
.image-editor input[type="file"]::file-selector-button { margin-right: 16px; padding: 16px 34px; border: 0; border-radius: 999px; color: var(--white); background: var(--forest); cursor: pointer; font-size: 15px; font-weight: 700; letter-spacing: .02em; box-shadow: 0 6px 16px rgba(16,37,27,.18); transition: background .2s ease, transform .2s ease; }
.image-editor input[type="file"]::file-selector-button:hover { background: #244d35; transform: translateY(-2px); }
.image-editor img { width: 100px; height: 90px; object-fit: cover; background: #edf0eb; }
.editor-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 23px; }
.security-note { margin: 20px 0 0; color: #7c867d; font-size: 10px; line-height: 1.6; }
.admin-footer { display: flex; min-height: 64px; align-items: center; justify-content: space-between; padding-inline: max(24px, calc((100vw - 1120px) / 2)); border-top: 1px solid var(--line); color: var(--muted); background: var(--white); font-size: 10px; }
.admin-footer a { text-decoration: none; }

@media (max-width: 680px) {
  .admin-header { height: 67px; padding-inline: 18px; }
  .admin-brand { gap: 8px; font-size: 12px; letter-spacing: .12em; }
  .brand-symbol { width: 33px; height: 33px; font-size: 19px; }
  .admin-brand small { font-size: 7px; }
  .back-link { font-size: 10px; }
  .admin-main { width: calc(100% - 32px); padding-block: 30px 48px; }
  .login-card, .setup-card, .access-card { margin-block: 25px; }
  .dashboard-heading { align-items: flex-start; }
  .dashboard-heading > .button { min-height: 38px; padding-inline: 10px; font-size: 10px; }
  .whatsapp-form, .import-card { align-items: stretch; flex-direction: column; }
  .whatsapp-form > div { max-width: none; }
  .whatsapp-form .button, .import-card .button { align-self: flex-start; }
  .section-actions { align-items: stretch; flex-direction: column; }
  .product-table { min-width: 550px; }
  .editor-grid { grid-template-columns: 1fr; }
  .editor-field.full-width { grid-column: auto; }
  .admin-footer { padding-inline: 16px; }
}
