.admin-body { min-height: 100dvh; background: #eef1ec; }
.admin-header {
  position: sticky; z-index: 10; top: 0;
  display: grid; grid-template-columns: 10rem 1fr auto auto auto; align-items: center; gap: 1.2rem;
  min-height: 5rem; padding: 0.55rem clamp(1rem, 4vw, 4rem);
  color: white; background: var(--jade-950); border-bottom: 1px solid rgba(217, 173, 87, 0.2);
}
.admin-header .brand img { max-height: 3.9rem; }
.admin-header-copy { display: grid; line-height: 1.2; }
.admin-header-copy span { color: var(--gold-500); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.public-link { font-weight: 700; text-decoration: none; }
.secondary-button { min-height: 2.7rem; padding: 0.55rem 0.9rem; border: 1px solid rgba(255,255,255,0.35); border-radius: 0.55rem; color: white; background: transparent; font-weight: 750; }
.admin-main { width: min(100% - 2rem, 90rem); margin: 0 auto; padding: clamp(2rem, 5vw, 4rem) 0 5rem; }
.login-card { width: min(100%, 29rem); margin: 5vh auto; padding: clamp(1.5rem, 4vw, 2.5rem); border: 1px solid var(--line); border-radius: 1.2rem; background: var(--paper); box-shadow: var(--shadow); }
.login-card h1 { color: var(--jade-900); font-size: 3rem; }
.login-card > p:not(.eyebrow) { color: var(--muted); }
.login-card form { display: grid; gap: 1rem; margin-top: 1.6rem; }
.dashboard-intro { display: grid; grid-template-columns: 1fr 11rem 11rem; align-items: end; gap: 1rem; margin-bottom: 1.5rem; }
.dashboard-intro h1 { color: var(--jade-900); font-size: clamp(2.6rem, 5vw, 4.4rem); font-weight: 500; }
.stat-card { min-height: 7rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 0.9rem; background: var(--paper); }
.stat-card span { display: block; color: var(--muted); font-size: 0.82rem; font-weight: 700; }
.stat-card strong { display: block; color: var(--jade-900); font-family: Georgia, serif; font-size: 2.5rem; }
.admin-tabs { display: flex; gap: 0.5rem; margin: 2rem 0 1rem; padding: 0.35rem; border-radius: 0.75rem; background: #dfe4dd; }
.admin-tabs button { flex: 1; min-height: 2.8rem; border: 0; border-radius: 0.55rem; color: var(--muted); background: transparent; font-weight: 800; }
.admin-tabs button[aria-selected="true"] { color: var(--jade-900); background: white; box-shadow: 0 3px 14px rgba(7,31,26,0.08); }
.admin-section { padding: clamp(1.2rem, 3vw, 2rem); border: 1px solid var(--line); border-radius: 1rem; background: var(--paper); }
.admin-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; }
.admin-section-heading h2 { color: var(--jade-900); font-size: 2.4rem; }
.status-filter { display: flex; gap: 0.35rem; padding: 0.3rem; border-radius: 0.65rem; background: #e9e9e2; }
.status-filter button { border: 0; border-radius: 0.45rem; padding: 0.55rem 0.75rem; color: var(--muted); background: transparent; font-weight: 750; }
.status-filter button[aria-pressed="true"] { color: white; background: var(--jade-800); }
.orders-list, .products-list { display: grid; gap: 0.8rem; }
.order-card { padding: 1.15rem; border: 1px solid var(--line); border-radius: 0.85rem; background: white; }
.order-head { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 1rem; }
.order-code { color: var(--jade-900); font-size: 1.05rem; }
.order-time { color: var(--muted); font-size: 0.85rem; }
.status-badge { padding: 0.32rem 0.6rem; border-radius: 999px; color: #733; background: #f8dddd; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; }
.status-badge.fulfilled { color: #18593e; background: #dcefe4; }
.order-body { display: grid; grid-template-columns: 1fr 1.2fr; gap: 1.2rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.customer-details { display: grid; align-content: start; gap: 0.2rem; color: var(--muted); }
.customer-details strong { color: var(--ink); }
.customer-details a { color: var(--jade-800); }
.order-lines { margin: 0; padding: 0; list-style: none; }
.order-lines li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.25rem 0; }
.order-actions { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 1rem; }
.order-total { color: var(--jade-900); font-family: Georgia, serif; font-size: 1.3rem; font-weight: 700; }
.small-action { border: 0; border-radius: 0.55rem; padding: 0.6rem 0.8rem; color: white; background: var(--jade-800); font-weight: 800; }
.small-action.restore { color: var(--jade-900); background: var(--jade-100); }
.product-row { display: grid; grid-template-columns: 4.7rem minmax(0,1fr) 9rem 7rem auto; align-items: center; gap: 1rem; padding: 0.75rem; border: 1px solid var(--line); border-radius: 0.75rem; background: white; }
.product-row.inactive { opacity: 0.58; }
.product-row-image { width: 4.7rem; height: 4.1rem; object-fit: cover; border-radius: 0.55rem; background: var(--jade-100); }
.product-copy strong, .product-copy span { display: block; }
.product-copy strong { color: var(--jade-900); }
.product-copy span { color: var(--muted); font-size: 0.86rem; }
.product-row .price { font-size: 1.1rem; }
.row-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.row-actions button { border: 1px solid var(--line); border-radius: 0.48rem; padding: 0.5rem 0.65rem; background: white; font-weight: 750; }
.row-actions .danger { color: var(--red-700); }
.row-actions .danger.permanent { border-color: #e1b7b1; background: #fff3f1; }
.product-dialog form { padding: clamp(1.3rem, 4vw, 2rem); }
.image-field > span { color: var(--muted); font-size: 0.8rem; font-weight: 500; }
.product-image-preview { display: flex; align-items: center; gap: 1rem; padding: 0.75rem; border: 1px solid var(--line); border-radius: 0.7rem; background: white; }
.product-image-preview[hidden] { display: none; }
.product-image-preview img { width: 7rem; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 0.55rem; }
.product-image-preview strong, .product-image-preview span { display: block; }
.product-image-preview span { color: var(--muted); font-size: 0.8rem; }
.switch-label { grid-column: 1 / -1; display: flex; align-items: center; gap: 0.6rem; }
.switch-label input { width: 1.15rem; height: 1.15rem; }
.password-section { max-width: 48rem; }
.password-help { max-width: 38rem; margin: -0.5rem 0 1.5rem; color: var(--muted); }
.password-form { display: grid; gap: 1rem; max-width: 34rem; }
.password-form .primary-action { justify-self: start; }
.form-success { min-height: 1.5rem; margin: 0; color: #18613f; font-weight: 750; }
@media (max-width: 760px) {
  .admin-header { grid-template-columns: 8rem 1fr auto auto; }
  .admin-header-copy, .public-link { display: none; }
  .dashboard-intro { grid-template-columns: repeat(2, 1fr); }
  .dashboard-intro > div:first-child { grid-column: 1 / -1; }
  .order-head { grid-template-columns: 1fr auto; }
  .order-time { grid-column: 1 / -1; }
  .order-body { grid-template-columns: 1fr; }
  .product-row { grid-template-columns: 4.4rem 1fr auto; }
  .product-row-image { width: 4.4rem; height: 3.8rem; }
  .product-row > span:not(.price) { display: none; }
  .row-actions { grid-column: 2 / -1; }
}
@media (max-width: 520px) {
  .admin-main { width: min(100% - 1rem, 90rem); padding-top: 1rem; }
  .dashboard-intro { gap: 0.5rem; }
  .stat-card { min-height: 6rem; }
  .admin-section-heading { align-items: stretch; flex-direction: column; }
  .status-filter { overflow-x: auto; }
}
