:root {
  color-scheme: light;
  --ink: #191a18;
  --muted: #777870;
  --paper: #f6f5f1;
  --white: #fffefa;
  --line: #e6e4dd;
  --sand: #d8bd98;
  --sand-dark: #b99a72;
  --green: #52634d;
  --red: #a44c3f;
  font-family: "DM Sans", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.brand { font-family: Manrope, sans-serif; font-size: 21px; font-weight: 800; letter-spacing: -.8px; }
.eyebrow { margin: 0 0 8px; color: var(--sand-dark); font-size: 10px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.muted { color: var(--muted); line-height: 1.65; }
.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 10px; padding: 11px 17px; border: 0; border-radius: 999px; font-size: 12px; font-weight: 700; transition: background .2s ease, transform .2s ease; }
.button:disabled { cursor: not-allowed; opacity: .5; }
.button-dark { background: var(--ink); color: white; }
.button-dark:hover:not(:disabled) { background: #353630; transform: translateY(-1px); }
.button-outline { border: 1px solid var(--line); background: transparent; color: var(--ink); }
.button-outline:hover { background: white; }
.button-danger { border: 1px solid #e7c9c4; background: #fff8f6; color: var(--red); }
.button-danger:hover:not(:disabled) { background: #f7e9e5; }

.login-shell { display: grid; min-height: 100vh; place-items: center; padding: 32px 20px; background: radial-gradient(ellipse at 75% 15%, #e9e2d6 0, transparent 34%), var(--paper); }
.login-shell > .brand { position: absolute; top: 28px; left: 5%; }
.login-card { width: min(100%, 430px); padding: 42px; border: 1px solid rgba(0,0,0,.05); border-radius: 22px; background: var(--white); box-shadow: 0 24px 70px rgba(24,25,22,.08); }
.login-card h1 { margin: 4px 0 8px; font: 800 34px/1.1 Manrope, sans-serif; letter-spacing: -.05em; }
.login-card > .muted { margin: 0 0 28px; font-size: 13px; }
.login-card form, .login-card label { display: grid; gap: 8px; }
.login-card form { gap: 17px; }
.login-card label { color: #55564f; font-size: 12px; font-weight: 600; }
.login-card input, .filter-row select, .fulfillment-form select, .fulfillment-form input, .product-form input, .product-form textarea { width: 100%; min-height: 43px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; outline: 0; background: #fff; color: var(--ink); }
.login-card input:focus, .filter-row select:focus, .fulfillment-form :focus, .product-form :focus { border-color: var(--sand-dark); box-shadow: 0 0 0 3px rgba(216,189,152,.2); }
.login-card form > .button { width: 100%; margin-top: 5px; }
.form-message { min-height: 18px; margin: -7px 0 0; color: var(--red); font-size: 12px; }
.back-link { display: inline-block; margin-top: 18px; color: var(--muted); font-size: 12px; }

.admin-shell { display: grid; min-height: 100vh; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; display: flex; height: 100vh; flex-direction: column; padding: 30px 19px 22px; border-right: 1px solid var(--line); background: #fbfaf6; }
.sidebar .brand { padding: 0 12px 37px; }
.sidebar-label { padding: 0 13px; color: #98988f; font-size: 9px; font-weight: 700; letter-spacing: .17em; text-transform: uppercase; }
.side-nav { display: grid; gap: 5px; }
.nav-item { display: flex; min-height: 44px; align-items: center; gap: 12px; padding: 0 13px; border: 0; border-radius: 9px; background: transparent; color: #696a63; text-align: left; font-size: 13px; }
.nav-item span { width: 17px; color: #8c8d84; font-size: 17px; text-align: center; }
.nav-item:hover, .nav-item.active { background: #eeece5; color: var(--ink); }
.nav-item.active { font-weight: 700; }
.nav-item.active span { color: var(--sand-dark); }
.sidebar-bottom { display: grid; gap: 9px; margin-top: auto; padding: 14px 12px 0; border-top: 1px solid var(--line); }
.sidebar-bottom a, .sidebar-bottom button { padding: 5px 0; border: 0; background: transparent; color: #777870; text-align: left; font-size: 12px; }
.sidebar-bottom a:hover, .sidebar-bottom button:hover { color: var(--ink); }
.main-panel { min-width: 0; padding: 34px clamp(20px, 4vw, 58px) 60px; }
.topbar { display: flex; min-height: 74px; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 36px; }
.topbar .eyebrow { margin-bottom: 5px; }
.topbar h1 { margin: 0; font: 700 26px/1.2 Manrope, sans-serif; letter-spacing: -.04em; }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.live-dot { display: inline-flex; align-items: center; gap: 8px; color: #6b7066; font-size: 11px; }
.live-dot::before { width: 7px; height: 7px; border-radius: 50%; background: #71856a; content: ""; }
.mobile-logout { display: none; border: 0; background: transparent; color: var(--muted); font-size: 12px; }
.notice { position: fixed; z-index: 20; right: 24px; bottom: 24px; max-width: min(420px, calc(100vw - 48px)); padding: 13px 17px; border-radius: 10px; background: var(--ink); color: white; box-shadow: 0 12px 34px rgba(0,0,0,.17); font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: .2s ease; }
.notice.show { opacity: 1; transform: translateY(0); }
.notice.error { background: #8d4036; }
.welcome-row, .section-toolbar, .card-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.welcome-row { margin-bottom: 26px; }
.welcome-row h2, .section-toolbar h2, .card-heading h2 { margin: 0; font: 700 28px/1.17 Manrope, sans-serif; letter-spacing: -.05em; }
.welcome-row .eyebrow, .section-toolbar .eyebrow, .card-heading .eyebrow { margin-bottom: 9px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.metric-card, .content-card { border: 1px solid rgba(0,0,0,.045); border-radius: 15px; background: var(--white); box-shadow: 0 7px 24px rgba(24,25,22,.035); }
.metric-card { display: grid; min-height: 144px; align-content: start; gap: 10px; padding: 20px; }
.metric-card span { color: #777870; font-size: 11px; font-weight: 600; }
.metric-card strong { font: 700 32px/1 Manrope, sans-serif; letter-spacing: -.04em; }
.metric-card small { color: #9a9b92; font-size: 10px; }
.content-card { padding: 22px; }
.card-heading { align-items: center; margin-bottom: 22px; }
.card-heading h2 { font-size: 20px; }
.text-button { padding: 7px 0; border: 0; background: transparent; color: #73746c; font-size: 11px; font-weight: 700; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 0 13px 12px; color: #93948b; font-size: 9px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; white-space: nowrap; }
td { padding: 13px; border-top: 1px solid #eeede8; color: #55564f; font-size: 11px; vertical-align: middle; }
td strong { color: var(--ink); font-size: 11px; }
.empty-state { padding: 30px 12px; color: #898a82; text-align: center; font-size: 12px; }
.status-pill { display: inline-flex; padding: 5px 8px; border-radius: 999px; background: #f1efe9; color: #66675f; font-size: 9px; font-weight: 700; text-transform: capitalize; white-space: nowrap; }
.status-pill.paid, .status-pill.delivered { background: #eaf0e7; color: #526b4c; }
.status-pill.pending, .status-pill.unfulfilled { background: #f7f0e2; color: #8a7049; }
.status-pill.failed { background: #f7e9e5; color: #994c40; }
.section-toolbar { align-items: center; margin-bottom: 22px; }
.product-actions { display: flex; align-items: center; gap: 9px; }
.filter-row { display: flex; gap: 10px; }
.filter-row label { display: grid; gap: 5px; color: #85867e; font-size: 9px; font-weight: 700; text-transform: uppercase; }
.filter-row select { min-width: 145px; min-height: 38px; padding: 8px 10px; font-size: 11px; text-transform: none; }
.orders-table { min-width: 850px; }
.orders-table th { padding-top: 4px; }
.order-reference { display: grid; gap: 5px; min-width: 155px; }
.order-reference span { color: #83847b; font-size: 10px; }
.copy-shipping-button { justify-self: start; padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; background: #fffefa; color: #62635c; font-size: 9px; font-weight: 700; white-space: nowrap; }
.copy-shipping-button:hover { border-color: var(--sand-dark); color: var(--ink); }
.order-details { margin-top: 8px; }
.order-details summary { color: #9a805d; cursor: pointer; font-size: 10px; }
.order-details-content { min-width: 210px; padding: 8px 0 0; color: #64655e; font-size: 10px; line-height: 1.6; overflow-wrap: anywhere; }
.order-details-content p { margin: 3px 0; }
.item-summary { max-width: 180px; line-height: 1.5; }
.fulfillment-controls { display: grid; justify-items: start; gap: 8px; min-width: 175px; }
.fulfillment-controls > p { margin: 0; font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.status-pill.shipped { background: #e8edf2; color: #4b6175; }
.fulfillment-form { display: grid; width: 100%; min-width: 155px; gap: 7px; }
.fulfillment-form select, .fulfillment-form input { min-height: 32px; padding: 6px 8px; font-size: 10px; }
.fulfillment-form .button { min-height: 30px; justify-self: start; padding: 6px 11px; font-size: 10px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 16px; color: #85867e; font-size: 10px; }
.pagination > div { display: flex; gap: 8px; }
.pagination .button { min-height: 32px; padding: 7px 12px; font-size: 10px; }
.product-list { display: grid; gap: 16px; }
.product-card { padding: 24px; }
.product-summary { display: grid; grid-template-columns: 90px minmax(0, 1fr) auto; align-items: center; gap: 18px; }
.product-thumbnail { display: grid; width: 90px; height: 72px; place-items: center; overflow: hidden; border-radius: 9px; background: #eeece5; }
.product-thumbnail img, .product-thumbnail video { display: block; width: 100%; height: 100%; object-fit: cover; }
.product-thumbnail .media-placeholder { padding: 4px; color: #85867e; font-size: 9px; text-align: center; }
.product-list-price { font: 700 18px/1.2 Manrope, sans-serif; }
.product-details { margin-top: 21px; padding-top: 21px; border-top: 1px solid var(--line); }
.product-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; margin-bottom: 21px; }
.product-heading h3 { margin: 0 0 7px; font: 700 20px/1.2 Manrope, sans-serif; letter-spacing: -.04em; }
.product-heading p { margin: 0; color: #878880; font-size: 11px; }
.product-heading .stock-tag { flex: 0 0 auto; padding: 7px 10px; border-radius: 999px; background: #eeece5; color: #696a63; font-size: 10px; }
.product-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.product-form label { display: grid; align-content: start; gap: 7px; color: #777870; font-size: 10px; font-weight: 700; }
.product-form label small { color: #999a92; font-size: 9px; font-weight: 400; }
.product-form input, .product-form textarea { min-height: 40px; font-size: 12px; }
.product-form textarea { min-height: 84px; resize: vertical; }
.product-form .full-width { grid-column: 1 / -1; }
.product-form .save-product { justify-self: start; }
.product-form-actions { display: flex; gap: 9px; }
.pricing-fields { display: grid; gap: 14px; padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: #faf9f5; }
.pricing-fields h4 { margin: 0 0 6px; font: 700 15px/1.3 Manrope, sans-serif; }
.pricing-help { margin: 0; color: #878880; font-size: 11px; line-height: 1.5; }
.pricing-input-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pricing-input-grid label { display: grid; align-content: start; gap: 7px; color: #777870; font-size: 10px; font-weight: 700; }
.pricing-input-grid input { width: 100%; min-height: 40px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; outline: 0; background: #fff; color: var(--ink); font-size: 12px; }
.pricing-summary { display: grid; gap: 5px; padding-top: 12px; border-top: 1px solid var(--line); }
.pricing-summary > span { color: #777870; font-size: 10px; font-weight: 700; }
.pricing-summary output { color: var(--ink); font: 700 22px/1.2 Manrope, sans-serif; }
.pricing-summary small { color: #999a92; font-size: 9px; line-height: 1.5; }
.product-form .price-preview { display: block; min-height: 40px; padding: 10px 0; color: var(--ink); font: 700 16px/1.2 Manrope, sans-serif; }
.media-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 260px); align-items: start; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #faf9f5; }
.media-upload { display: grid; align-content: start; gap: 8px; color: #777870; font-size: 10px; font-weight: 700; }
.media-upload input[type="file"] { min-height: 42px; padding: 7px; background: white; font-size: 11px; }
.media-upload small { color: #999a92; font-size: 9px; font-weight: 400; line-height: 1.5; }
.media-preview { display: grid; min-height: 120px; place-items: center; overflow: hidden; border: 1px dashed #d4d1c8; border-radius: 9px; background: #eeece5; }
.media-preview img, .media-preview video { display: block; width: 100%; max-height: 240px; object-fit: contain; }
.media-placeholder { color: #85867e; font-size: 10px; }
.add-product-panel { margin-bottom: 16px; }

@media (max-width: 1000px) {
  .admin-shell { grid-template-columns: 205px minmax(0,1fr); }
  .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .main-panel { padding-right: 25px; padding-left: 25px; }
}
@media (max-width: 680px) {
  .admin-shell { display: block; }
  .sidebar { position: relative; z-index: 3; width: 100%; height: auto; padding: 14px 17px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .brand { padding: 0 3px 12px; font-size: 20px; }
  .sidebar-label, .sidebar-bottom { display: none; }
  .side-nav { grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .nav-item { justify-content: center; gap: 6px; padding: 0 5px; font-size: 10px; }
  .nav-item span { width: auto; font-size: 14px; }
  .main-panel { padding: 23px 16px 40px; }
  .topbar { min-height: 48px; margin-bottom: 26px; }
  .topbar h1 { font-size: 22px; }
  .live-dot { display: none; }
  .mobile-logout { display: inline-block; }
  .welcome-row, .section-toolbar { align-items: start; flex-direction: column; }
  .welcome-row h2, .section-toolbar h2 { font-size: 25px; }
  .welcome-row .button, .section-toolbar > .button { align-self: stretch; }
  .product-actions { width: 100%; }
  .product-actions .button { flex: 1; padding-right: 10px; padding-left: 10px; }
  .metric-grid { gap: 9px; }
  .metric-card { min-height: 123px; padding: 14px; }
  .metric-card strong { font-size: 27px; }
  .metric-card span { font-size: 10px; }
  .metric-card small { font-size: 9px; line-height: 1.4; }
  .content-card { padding: 16px 12px; }
  .card-heading h2 { font-size: 18px; }
  .filter-row { width: 100%; }
  .filter-row label { flex: 1; min-width: 0; }
  .filter-row select { min-width: 0; }
  .product-card { padding: 17px; }
  .product-summary { grid-template-columns: 70px minmax(0, 1fr) auto; gap: 10px; }
  .product-thumbnail { width: 70px; height: 60px; }
  .product-list-price { font-size: 15px; }
  .product-form { grid-template-columns: 1fr; }
  .product-form .full-width { grid-column: auto; }
  .media-editor { grid-template-columns: 1fr; }
  .pricing-input-grid { grid-template-columns: 1fr; }
  .product-form-actions { grid-column: auto; }
  .product-heading h3 { font-size: 17px; }
  .login-card { padding: 30px 23px; }
  .login-shell > .brand { top: 22px; font-size: 19px; }
}
