html:has(.admin-body) { background: #f5f5f7; }
.admin-body .brand { letter-spacing: -.045em; }
.admin-body .button, .admin-body .filter { border-radius: 9999px; }
.admin-body .button-primary:hover:not(:disabled) { background: #0077ed; border-color: #0077ed; }
.admin-body .button-outline { border-color: #dedee4; }
.admin-body .button-outline:hover { border-color: #a9bce4; }
.admin-body .icon-button { border-radius: 50%; }
.admin-body .search { border-color: #dddee4; border-radius: 9999px; }
.admin-loading { display: grid; place-items: center; min-height: 60vh; color: var(--muted); }
.muted { color: var(--muted); }

.login-view { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 22px; background: radial-gradient(ellipse at top right, #e3eeff 0%, var(--page) 58%); }
.login-card { width: min(445px,100%); padding: clamp(23px,6vw,40px); background: #fff; border: 1px solid #0000000f; border-radius: 24px; }
.login-card .brand { margin-bottom: 25px; }
.login-card h1, .admin-heading h1 { font-size: clamp(2.03rem,4.6vw,3.4rem); line-height: 1.06; font-weight: 700; letter-spacing: -.035em; }
.login-card h1 { margin: 5px 0 9px; font-size: clamp(2rem,5vw,2.65rem); }
#login-form { margin-top: 22px; display: grid; gap: 13px; }
#login-form label, .editor-fields label { display: grid; gap: 5px; min-width: 0; font-weight: 650; font-size: .89rem; }
#login-form input, .editor-fields input:not([type=checkbox]), .editor-fields select { width: 100%; min-height: 44px; padding: 7px 12px; color: var(--ink); background: #fff; border: 1px solid #dedee4; border-radius: 11px; }
#login-form button { margin-top: 4px; }
.store-link { color: var(--blue-dark); font-size: .89rem; font-weight: 650; white-space: nowrap; }
.store-link:hover { text-decoration: underline; }
.login-card .store-link { display: inline-block; margin-top: 17px; }

.dashboard { min-height: 100vh; }
.admin-header { min-height: 74px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 15px; }
.admin-nav { display: flex; gap: 5px; align-items: center; }
.admin-nav-item { display: inline-flex; gap: 6px; align-items: center; min-height: 42px; padding: 6px 12px; border: 0; border-radius: 9999px; color: #414149; background: transparent; font-weight: 650; font-size: .91rem; white-space: nowrap; }
.admin-nav-item svg { width: 17px; height: 17px; }
.admin-nav-item:hover { background: #f5f5f7; color: var(--ink); }
.admin-nav-item[aria-current=page] { color: var(--blue-dark); background: var(--blue-soft); }
.admin-user-tools { display: flex; align-items: center; justify-content: end; gap: 10px; }
.admin-user { display: flex; align-items: center; gap: 6px; padding: 3px 9px 3px 3px; border: 1px solid var(--line); border-radius: 9999px; font-weight: 650; font-size: .85rem; }
.avatar { display: grid; width: 28px; height: 28px; place-items: center; color: var(--blue-dark); background: var(--blue-soft); border-radius: 50%; font-size: .81rem; }
.admin-user-tools .icon-button { width: 36px; height: 36px; }
.admin-user-tools .icon-button svg { width: 18px; height: 18px; }

.admin-content { padding-block: 34px 48px; }
.admin-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 23px; }
.admin-heading h1 { margin-bottom: 6px; }
.admin-heading-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.admin-heading-actions #new-product { padding-inline: 19px; }
.admin-message { margin-bottom: 14px; padding: 10px 13px; border: 1px solid #bee7d0; color: #166547; background: #e8f8ef; border-radius: 10px; font-size: .9rem; }
.admin-message.message-error { border-color: #f0c5d0; background: #fff0f3; color: #9c2141; }

.metrics { display: grid; grid-template-columns: 1.22fr repeat(3,minmax(0,1fr)); gap: 13px; margin-bottom: 17px; }
.metric, .admin-panel { background: #fff; border: 1px solid rgb(0 0 0 / .07); border-radius: var(--radius); }
.metric { display: grid; min-width: 0; align-content: start; gap: 5px; padding: 15px 17px; text-align: left; color: var(--ink); transition: border-color .16s, background .16s; }
.metric:hover { border-color: #b8c6d9; background: #fcfdff; }
.metric-heading { display: flex; align-items: center; gap: 8px; min-height: 32px; color: #3f3f47; font-size: .91rem; font-weight: 690; }
.metric-icon, .sale-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 10px; color: var(--blue-dark); background: var(--blue-soft); }
.metric-icon svg, .sale-icon svg { width: 18px; height: 18px; }
.metric strong { display: block; font-size: clamp(1.38rem,3.4vw,2.21rem); letter-spacing: -.036em; line-height: 1.14; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric small { color: var(--muted); font-size: .8rem; }
.metric-revenue { color: #fff; background: linear-gradient(117deg, #101c32, #142c50); border-color: #12264a; }
.metric-revenue:hover { background: #1a3256; border-color: #273f64; }
.metric-revenue .metric-heading, .metric-revenue small { color: #d3def1; }
.metric-revenue .metric-icon { background: #2c4167; color: #e9f1ff; }
.metric-low .metric-icon { color: #895007; background: #fff1d9; }
.metric-empty .metric-icon { color: #9a2d48; background: #fdebf0; }

.summary-panels { display: grid; grid-template-columns: minmax(0,1.11fr) minmax(0,1fr); gap: 15px; align-items: start; }
.admin-panel { min-width: 0; overflow: hidden; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 73px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { font-size: 1.19rem; font-weight: 700; letter-spacing: -.02em; }
.panel-heading p { color: var(--muted); font-size: .87rem; }
.panel-heading .button { min-height: 36px; flex: none; padding-block: 7px; font-size: .83rem; }
.summary-list { margin: 0; padding: 0; list-style: none; }
.summary-list li + li { border-top: 1px solid #ededf1; }
.sale-row, .restock-row { min-width: 0; min-height: 62px; display: grid; gap: 9px; align-items: center; padding: 8px 15px; }
.sale-row { width: 100%; grid-template-columns: auto minmax(0,1fr) auto; border: 0; color: var(--ink); background: #fff; text-align: left; }
.sale-row:hover, .restock-row:hover { background: #fafcff; }
.sale-row:focus-visible { outline-offset: -3px; }
.sale-amount { text-align: right; }
.restock-row { grid-template-columns: auto minmax(0,1fr) auto auto; }
.summary-row-copy strong, .summary-row-copy small, .sale-amount strong, .sale-amount small { display: block; }
.summary-row-copy strong, .sale-amount strong { font-size: .92rem; font-weight: 700; }
.summary-row-copy small, .sale-amount small { color: var(--muted); font-size: .77rem; overflow-wrap: anywhere; }
.restock-edit { width: 35px; height: 35px; color: var(--blue-dark); }
.restock-edit svg { width: 17px; height: 17px; }
.table-empty { min-height: 205px; }
.table-empty .button { min-height: 37px; font-size: .84rem; }

.admin-filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.admin-filters .filter { min-height: 35px; border-color: #e3e3e8; }
.admin-filters .filter[aria-pressed=true] { border-color: var(--blue); }
.table-search { width: min(285px,48%); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .895rem; }
td, th { padding: 11px 14px; }
thead { background: #f5f5f7; color: #54545e; font-size: .79rem; }
tbody tr + tr { border-top: 1px solid #ededf1; }
tbody tr:hover { background: #fafcff; }
.table-product { min-width: 183px; display: flex; align-items: center; gap: 9px; }
.table-product small { display: block; color: var(--muted); font-size: .8rem; font-weight: 450; }
.table-picture { width: 42px; height: 42px; flex: none; display: grid; place-items: center; padding: 3px; background: #f5f5f7; border-radius: 9px; }
.table-picture img { max-height: 36px; object-fit: contain; mix-blend-mode: multiply; }
.table-picture .placeholder-phone svg { height: 22px; width: 22px; }
.sku { min-width: 104px; font-size: .77rem; color: var(--muted); overflow-wrap: anywhere; }
.admin-tag { display: inline-flex; min-width: 26px; justify-content: center; white-space: nowrap; padding: 4px 8px; border-radius: 9999px; color: #4b4b55; background: #eeeef2; font-size: .75rem; font-weight: 700; }
.tag-live { color: #176447; background: #e4f6ed; }
.tag-low { color: #795112; background: #fff1d7; }
.tag-empty { color: #9a2d48; background: #ffeaf0; }
.table-button { min-height: 34px; padding: 5px 9px; border: 1px solid #dedee4; white-space: nowrap; font-size: .8rem; }
.table-button:hover { color: var(--blue-dark); background: #edf3ff; }
.table-button svg { width: 14px; height: 14px; }
.inventory-toolbar-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.inventory-view-switch { display: inline-flex; padding: 3px; border: 1px solid #dedee4; border-radius: 10px; background: #f5f5f7; }
.inventory-view-switch button { min-height: 29px; padding: 4px 10px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: .8rem; font-weight: 650; white-space: nowrap; }
.inventory-view-switch button[aria-pressed="true"] { color: var(--ink); background: #fff; box-shadow: 0 1px 3px #00000015; }
.inventory-sync-note { display: flex; align-items: center; gap: 8px; padding: 10px 15px; border-bottom: 1px solid #e5ece9; color: #3f6656; background: #f5faf7; font-size: .82rem; }
.inventory-sync-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #23a66f; box-shadow: 0 0 0 3px #23a66f20; }
.inventory-sheet-scroll { max-height: min(66vh, 700px); overflow: auto; }
.inventory-sheet { min-width: 1020px; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: .82rem; }
.inventory-sheet th, .inventory-sheet td { padding: 5px 7px; border-right: 1px solid #e8e8ed; border-bottom: 1px solid #e8e8ed; }
.inventory-sheet thead { position: sticky; top: 0; z-index: 2; }
.inventory-sheet thead th { padding-block: 9px; border-top: 1px solid #e8e8ed; background: #f0f1f5; color: #54545e; white-space: nowrap; }
.inventory-sheet tbody tr:nth-child(even) { background: #fafafd; }
.inventory-sheet tbody tr:hover { background: #f1f6ff; }
.inventory-sheet .sheet-row-number { position: sticky; left: 0; z-index: 1; width: 43px; color: #797985; background: #f5f5f7; text-align: right; font-variant-numeric: tabular-nums; }
.inventory-sheet thead .sheet-row-number { z-index: 3; }
.inventory-sheet tbody tr:nth-child(even) .sheet-row-number { background: #f3f3f7; }
.inventory-sheet .sheet-name { width: 190px; }
.inventory-sheet .sheet-sku { width: 175px; }
.inventory-sheet .sheet-small { width: 112px; }
.inventory-sheet .sheet-color { width: 142px; }
.inventory-sheet .sheet-grade { width: 142px; }
.inventory-sheet .sheet-price, .inventory-sheet .sheet-stock { width: 94px; }
.inventory-sheet .sheet-publish { width: 112px; }
.inventory-sheet .sheet-actions { position: sticky; right: 0; width: 118px; background: #fff; text-align: center; }
.inventory-sheet thead .sheet-actions { z-index: 3; background: #f0f1f5; }
.inventory-sheet input, .inventory-sheet select { width: 100%; min-width: 0; min-height: 32px; padding: 4px 6px; border: 1px solid transparent; border-radius: 5px; color: var(--ink); background: transparent; font: inherit; }
.inventory-sheet input:hover, .inventory-sheet select:hover { border-color: #d9d9e1; background: #fff; }
.inventory-sheet input:focus, .inventory-sheet select:focus { border-color: var(--blue); outline: 2px solid #0071e320; background: #fff; }
.inventory-sheet .sheet-number { text-align: right; font-variant-numeric: tabular-nums; }
.inventory-sheet .sheet-save { min-width: 62px; min-height: 30px; padding: 4px 6px; border: 1px solid #d8dfec; border-radius: 7px; color: var(--blue-dark); background: #fff; font-size: .76rem; font-weight: 650; }
.inventory-sheet .sheet-save:disabled { color: #9b9ba5; border-color: #e8e8ed; background: #f7f7f9; }
.inventory-sheet .sheet-actions .inventory-actions { justify-content: center; gap: 4px; }
.inventory-sheet .sheet-actions .danger-icon { width: 30px; height: 30px; flex: none; }

.editor { width: min(626px,calc(100% - 24px)); max-height: calc(100% - 24px); border-radius: 22px; }
#product-form { display: flex; max-height: calc(100dvh - 26px); flex-direction: column; }
.editor-head { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 19px; border-bottom: 1px solid var(--line); }
.editor-head h2 { font-size: 1.53rem; font-weight: 700; letter-spacing: -.029em; }
.editor-body { min-height: 0; overflow: auto; padding: 12px 19px; }
.editor-section { min-width: 0; padding: 0; margin: 0; border: 0; }
.editor-section + .editor-section { margin-top: 15px; }
.editor-section legend { margin-bottom: 5px; padding: 0; color: var(--ink); font-size: .98rem; font-weight: 700; }
.editor-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px 11px; }
.editor-wide { grid-column: 1 / -1; }
.editor-fields label.check { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.check input { accent-color: var(--blue); width: 17px; height: 17px; }
.editor-body .error { margin: 9px 0 0; }
.editor-footer { display: flex; flex: none; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px 19px; border-top: 1px solid var(--line); }
.order-body { padding: 15px 19px 20px; }
.order-body .receipt { margin: 0 0 13px; }
.order-body h3 { font-size: 1rem; }
.order-items { margin: 7px 0 0; padding: 0; list-style: none; }
.order-items li { display: flex; justify-content: space-between; gap: 10px; padding-block: 7px; border-bottom: 1px solid var(--line); font-size: .89rem; }
.order-items small { display: block; color: var(--muted); }

@media (max-width: 880px) {
  .admin-header { grid-template-columns: 1fr auto; gap: 7px; padding-block: 9px; }
  .admin-nav { grid-column: 1 / -1; grid-row: 2; }
  .admin-user-tools { grid-column: 2; grid-row: 1; }
  .summary-panels { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 720px) {
  .admin-content { padding-block: 21px 35px; }
  .admin-heading { display: grid; align-items: start; margin-bottom: 15px; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .metric { padding: 10px; }
  .metric-heading { gap: 5px; font-size: .83rem; }
  .metric-icon { width: 28px; height: 28px; border-radius: 8px; }
  .metric-icon svg { width: 15px; height: 15px; }
  .metric small { font-size: .74rem; }
  .panel-heading, .admin-filters { padding-inline: 11px; }
}
@media (max-width: 430px) {
  .admin-user-tools { gap: 5px; }
  .admin-user-tools .store-link { display: none; }
  .admin-nav-item { min-height: 39px; padding-inline: 9px; font-size: .85rem; }
  .admin-nav-item svg { width: 15px; height: 15px; }
  .sale-row, .restock-row { padding-inline: 10px; gap: 6px; }
  .table-picture { width: 37px; height: 37px; }
  .table-picture img { max-height: 31px; }
  .table-search { width: min(205px,52%); }
  .editor-body, .editor-head, .editor-footer { padding-inline: 13px; }
}
