:root {
  color-scheme: only light;
  --ink: #182019;
  --muted: #687269;
  --paper: #f5f7f2;
  --surface: #fff;
  --green: #5f7d5c;
  --green-dark: #365139;
  --line: rgba(24, 32, 25, .14);
  --danger: #9a3434;
  --shadow: 0 18px 55px rgba(24, 32, 25, .09);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Arial, Helvetica, sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; }
.admin-header { min-height: 74px; padding: 10px 4vw; position: sticky; z-index: 20; top: 0; display: flex; align-items: center; gap: 34px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(14px); }
.admin-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.admin-brand img { width: 48px; height: 48px; object-fit: contain; }
.admin-brand span { display: grid; gap: 2px; }
.admin-brand small { color: var(--muted); font-size: .66rem; font-weight: 600; }
.admin-header nav { display: flex; align-items: center; gap: 22px; font-size: .8rem; font-weight: 700; }
.admin-header nav a:hover { color: var(--green-dark); }
.admin-user { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: .76rem; }
.admin-user a { color: var(--green-dark); font-weight: 800; }
.admin-main { width: min(1240px, 92vw); min-height: calc(100vh - 140px); margin: 0 auto; padding: 48px 0 72px; }
.admin-footer { padding: 26px 4vw; border-top: 1px solid var(--line); color: var(--muted); text-align: center; font-size: .72rem; }
.page-heading { margin-bottom: 28px; display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.page-heading h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(2.25rem, 5vw, 3.65rem); font-weight: 400; letter-spacing: -.045em; }
.page-heading p { margin: 8px 0 0; color: var(--muted); font-size: .82rem; }
.kicker { margin: 0 0 9px !important; color: var(--green-dark) !important; font-size: .66rem !important; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.primary-button, .secondary-button, .whatsapp-button { min-height: 44px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 4px; cursor: pointer; font-size: .78rem; font-weight: 800; }
.primary-button { background: var(--ink); color: #fff; }
.secondary-button { border-color: var(--line); background: #fff; }
.whatsapp-button { width: 100%; margin-top: 20px; background: #27724a; color: #fff; }
.panel { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.panel-heading { padding: 22px 24px; display: flex; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.panel-heading h2, .form-section > h2, .customer-card > h2 { margin: 0; font-family: Georgia, serif; font-size: 1.45rem; font-weight: 400; }
.panel-heading p { margin: 6px 0 0; color: var(--muted); font-size: .75rem; }
.panel-heading a { align-self: center; color: var(--green-dark); font-size: .76rem; font-weight: 800; }
.stats-grid { margin-bottom: 28px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stats-grid a { min-height: 128px; padding: 22px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.stats-grid span { color: var(--muted); font-size: .74rem; font-weight: 700; }
.stats-grid strong { font-family: Georgia, serif; font-size: 2.7rem; font-weight: 400; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .78rem; }
th, td { padding: 15px 18px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); background: #fafbf9; font-size: .64rem; letter-spacing: .08em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
td a { color: var(--green-dark); }
.product-cell { min-width: 210px; display: flex; align-items: center; gap: 12px; }
.product-cell img { width: 50px; height: 58px; border-radius: 4px; object-fit: cover; }
.table-action { white-space: nowrap; font-weight: 800; }
.status { padding: 6px 9px; display: inline-block; border-radius: 99px; background: #eef1ec; font-size: .65rem; font-weight: 800; }
.status-new { background: #fbe8c7; color: #79510a; }
.status-contacted { background: #e4ebf9; color: #38527d; }
.status-confirmed, .status-paid, .status-completed { background: #dfeedd; color: #315f35; }
.status-cancelled { background: #f3dddd; color: #7f3333; }
.empty-state { padding: 65px 24px; color: var(--muted); text-align: center; }
.alert { margin-bottom: 22px; padding: 13px 16px; border-radius: 5px; font-size: .78rem; }
.alert.success { border: 1px solid #9fc39c; background: #eff8ed; color: #315f35; }
.alert.error { border: 1px solid #d9a7a7; background: #fff1f1; color: #882f2f; }
.login-card { width: min(430px, 100%); margin: 5vh auto; padding: 36px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.login-card > img { width: 190px; max-height: 90px; object-fit: contain; }
.login-card h1 { margin: 25px 0 8px; font-family: Georgia, serif; font-size: 2rem; font-weight: 400; }
.login-card > p { margin: 0 0 25px; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.admin-form { display: grid; gap: 17px; text-align: left; }
.admin-form label { display: grid; gap: 7px; }
.admin-form label > span { font-size: .7rem; font-weight: 800; }
.admin-form input, .admin-form select, .admin-form textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #cbd3c9; border-radius: 4px; background: white; color: var(--ink); }
.admin-form textarea { resize: vertical; line-height: 1.5; }
.admin-form small { color: var(--muted); font-size: .66rem; line-height: 1.45; }
.admin-form .primary-button { width: fit-content; }
.product-editor { gap: 22px; }
.form-section { padding-bottom: 24px; overflow: visible; }
.form-grid { padding: 24px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.span-2 { grid-column: 1 / -1; }
.check-label { display: flex !important; align-items: center; gap: 9px !important; }
.check-label input { width: 18px !important; min-height: 18px !important; margin: 0; }
.danger-check span { color: var(--danger); }
.image-admin-grid { padding: 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 14px; }
.image-admin-grid article { padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: #fafbf9; }
.image-admin-grid img { width: 100%; aspect-ratio: 1; margin-bottom: 10px; display: block; border-radius: 4px; object-fit: cover; }
.form-section > label { margin: 0 24px; }
.sticky-actions { padding: 14px; position: sticky; z-index: 10; bottom: 12px; display: flex; justify-content: flex-end; gap: 10px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.95); box-shadow: 0 12px 35px rgba(24,32,25,.13); backdrop-filter: blur(12px); }
.filter-tabs { margin: 0 0 18px; display: flex; gap: 8px; overflow-x: auto; }
.filter-tabs a { padding: 9px 13px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 99px; background: #fff; color: var(--muted); font-size: .7rem; font-weight: 800; }
.filter-tabs a.active { border-color: var(--ink); background: var(--ink); color: white; }
.order-layout { margin-bottom: 24px; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.order-items { padding: 0 24px; }
.order-items article { padding: 18px 0; display: flex; justify-content: space-between; gap: 25px; border-bottom: 1px solid var(--line); }
.order-items p { margin: 6px 0; color: var(--green-dark); font-size: .75rem; font-weight: 700; }
.order-items small { color: var(--muted); }
.order-total { padding: 22px 24px; display: flex; justify-content: space-between; gap: 24px; background: #f6f8f4; }
.order-side { display: grid; gap: 22px; }
.order-side .form-section, .customer-card { padding: 22px; }
.customer-card dl { margin: 18px 0 0; display: grid; gap: 5px; }
.customer-card dt { margin-top: 10px; color: var(--muted); font-size: .63rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.customer-card dd { margin: 0; font-size: .8rem; line-height: 1.5; overflow-wrap: anywhere; }
.message-card pre { margin: 0; padding: 24px; overflow-x: auto; white-space: pre-wrap; font: .77rem/1.65 Arial, sans-serif; }
.settings-form { max-width: 850px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(95,125,92,.35); outline-offset: 2px; }
@media (max-width: 900px) {
  .admin-header { align-items: flex-start; flex-wrap: wrap; gap: 8px 20px; }
  .admin-header nav { width: 100%; order: 3; padding: 8px 0 2px; overflow-x: auto; }
  .admin-user { margin-left: auto; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .order-layout { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .admin-main { width: min(94vw, 1240px); padding-top: 30px; }
  .admin-header nav { gap: 18px; }
  .admin-user span { display: none; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading h1 { font-size: 2.35rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stats-grid a { min-height: 105px; padding: 16px; }
  .stats-grid strong { font-size: 2.1rem; }
  .form-grid { grid-template-columns: 1fr; padding: 18px; }
  .span-2 { grid-column: auto; }
  .login-card { padding: 28px 22px; }
  .sticky-actions { bottom: 7px; }
}
