:root {
  --wine-950: #351512;
  --wine-900: #4a201b;
  --wine-800: #603027;
  --wine-700: #793d32;
  --rose-500: #bd7768;
  --rose-100: #f5e4df;
  --sand-50: #fcfaf7;
  --sand-100: #f6efe8;
  --sand-200: #ebdfd4;
  --sand-400: #bca695;
  --ink-900: #2d2927;
  --ink-600: #706965;
  --ink-400: #9e9791;
  --sage-700: #556451;
  --sage-100: #e5ece2;
  --danger: #a94940;
  --white: #fffdfb;
  --line: rgba(74, 46, 38, .11);
  --shadow: 0 16px 44px rgba(67, 39, 31, .07);
  --serif: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink-900); background: #f4f1ed; font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { color: inherit; font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [contenteditable]:focus-visible { outline: 3px solid rgba(121, 61, 50, .2); outline-offset: 2px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; width: 248px; padding: 28px 20px 22px; display: flex; flex-direction: column; color: #f9efea; background: var(--wine-950); overflow-y: auto; }
.brand { padding: 0 10px 24px; display: flex; flex-direction: column; gap: 7px; color: inherit; border-bottom: 1px solid rgba(255, 255, 255, .1); text-decoration: none; }
.brand img { width: 145px; filter: brightness(0) invert(1); }
.brand span { color: rgba(255, 255, 255, .5); font-size: 10px; letter-spacing: .42em; }
.main-nav { padding-top: 12px; }
.main-nav > p { margin: 19px 12px 8px; color: rgba(255, 255, 255, .35); font-size: 10px; font-weight: 600; letter-spacing: .18em; }
.nav-item { width: 100%; min-height: 44px; padding: 0 11px; border: 0; border-radius: 11px; display: grid; grid-template-columns: 28px 1fr auto; gap: 7px; align-items: center; color: rgba(255, 255, 255, .67); background: transparent; text-align: left; transition: background .2s, color .2s, transform .2s; }
.nav-item:hover { color: white; background: rgba(255, 255, 255, .07); transform: translateX(2px); }
.nav-item.is-active { color: white; background: rgba(255, 255, 255, .13); box-shadow: inset 3px 0 #d9a28d; }
.nav-item i { width: 24px; height: 24px; border: 1px solid rgba(255, 255, 255, .15); border-radius: 7px; display: grid; place-items: center; font-family: var(--serif); font-size: 12px; font-style: normal; }
.nav-item span { font-size: 12px; }
.nav-item b { min-width: 23px; padding: 2px 6px; border-radius: 12px; background: rgba(255, 255, 255, .12); font-size: 9px; font-weight: 500; text-align: center; }
.role-card { margin: auto 3px 18px; padding: 17px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 14px; background: rgba(255, 255, 255, .06); }
.role-card span, .role-card small { display: block; color: rgba(255, 255, 255, .42); font-size: 9px; }
.role-card strong { display: block; margin: 8px 0 4px; color: white; font-size: 12px; font-weight: 500; }
.operator { padding: 14px 7px 0; border-top: 1px solid rgba(255, 255, 255, .1); display: grid; grid-template-columns: 34px 1fr auto; gap: 9px; align-items: center; }
.operator > span { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--wine-900); background: #e1bba9; font-family: var(--serif); }
.operator div { display: flex; flex-direction: column; gap: 2px; }
.operator strong { font-size: 11px; font-weight: 500; }
.operator small { color: rgba(255, 255, 255, .45); font-size: 8px; }
.operator button { padding: 4px; border: 0; color: rgba(255, 255, 255, .42); background: transparent; font-size: 9px; }

.workspace { min-width: 0; grid-column: 2; }
.topbar { position: sticky; z-index: 20; top: 0; height: 72px; padding: 0 34px; border-bottom: 1px solid rgba(74, 46, 38, .07); display: flex; justify-content: space-between; align-items: center; background: rgba(248, 245, 241, .94); backdrop-filter: blur(16px); }
.branch-switcher { padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .75); font-size: 10px; }
.branch-switcher > span { width: 7px; height: 7px; border-radius: 50%; background: #70806d; box-shadow: 0 0 0 4px rgba(112, 128, 109, .11); }
.branch-switcher i { color: var(--ink-400); font-style: normal; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.global-search, .search-field { min-width: 260px; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; display: flex; align-items: center; gap: 7px; color: var(--ink-400); background: white; }
.global-search input, .search-field input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 10px; }
.icon-button { position: relative; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.icon-button b { position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; border: 2px solid #f5f2ee; border-radius: 9px; display: grid; place-items: center; color: white; background: var(--wine-700); font-size: 7px; }
.mobile-menu { display: none; }

main { max-width: 1540px; margin: 0 auto; padding: 34px; }
.view { display: none; animation: view-in .28s ease both; }
.view.is-active { display: block; }
@keyframes view-in { from { opacity: 0; transform: translateY(7px); } }
.page-heading { min-height: 86px; margin-bottom: 24px; display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.page-heading h1 { margin: 5px 0 7px; color: var(--wine-900); font-family: var(--serif); font-size: clamp(28px, 3vw, 39px); font-weight: 400; line-height: 1; }
.page-heading > div > p:last-child { margin: 0; color: var(--ink-600); font-size: 11px; }
.heading-actions { display: flex; align-items: center; gap: 9px; }
.eyebrow { margin: 0; color: var(--rose-500); font-size: 9px; font-weight: 700; letter-spacing: .2em; }
.muted { color: var(--ink-600); }
.live-chip, .api-chip { padding: 8px 11px; border: 1px solid #e3d4cc; border-radius: 18px; display: flex; align-items: center; gap: 7px; color: var(--wine-700); background: #fffaf7; font-size: 8px; }
.live-chip i { width: 6px; height: 6px; border-radius: 50%; background: #6d826c; box-shadow: 0 0 0 4px rgba(109, 130, 108, .11); }
.button { min-height: 38px; padding: 0 14px; border: 1px solid transparent; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 10px; font-weight: 600; }
.button--primary { color: white; background: var(--wine-700); box-shadow: 0 8px 20px rgba(91, 42, 34, .14); }
.button--primary:hover { background: var(--wine-800); }
.button--secondary { color: var(--wine-700); border-color: #dbc6bc; background: #fffaf7; }
.button--danger { color: white; background: var(--danger); }
.button--wide { width: 100%; }
.text-button { padding: 5px; border: 0; color: var(--wine-700); background: transparent; font-size: 9px; }
.text-button:hover { text-decoration: underline; }

.panel { border: 1px solid rgba(255, 255, 255, .75); border-radius: 19px; background: rgba(255, 253, 251, .85); box-shadow: var(--shadow); }
.panel-header { min-height: 76px; padding: 19px 21px 15px; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.panel-header h2 { margin: 4px 0 0; color: var(--wine-900); font-family: var(--serif); font-size: 20px; font-weight: 400; }
.metric-grid { margin-bottom: 17px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.metric-card { min-height: 142px; padding: 19px; border: 1px solid rgba(255, 255, 255, .74); border-radius: 18px; color: var(--wine-900); background: #f0dfd3; box-shadow: var(--shadow); }
.metric-card:nth-child(1) { color: white; background: var(--wine-800); }
.metric-card:nth-child(3) { background: #dfe5dc; }
.metric-card:nth-child(4) { background: #f0ddda; }
.metric-card header { display: flex; justify-content: space-between; font-size: 9px; font-weight: 600; }
.metric-card header i { font-family: var(--serif); font-size: 18px; font-style: normal; opacity: .25; }
.metric-card strong { display: block; margin-top: 15px; font-family: var(--serif); font-size: 36px; font-weight: 400; line-height: 1; }
.metric-card strong small { margin-left: 5px; font-family: var(--sans); font-size: 9px; opacity: .65; }
.metric-card p { margin: 12px 0 0; font-size: 8px; opacity: .65; }
.dashboard-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, .8fr); gap: 17px; }
.trend-panel, .ranking-panel { overflow: hidden; }
.segmented { padding: 3px; border-radius: 9px; display: flex; gap: 2px; background: var(--sand-100); }
.segmented button { padding: 6px 9px; border: 0; border-radius: 7px; color: var(--ink-600); background: transparent; font-size: 8px; }
.segmented button.is-active { color: white; background: var(--wine-700); }
.trend-chart { height: 285px; padding: 25px 23px 18px; border-top: 1px solid var(--line); display: flex; gap: 12px; align-items: stretch; }
.chart-axis { width: 28px; padding-bottom: 23px; display: flex; flex-direction: column; justify-content: space-between; color: var(--ink-400); font-size: 7px; text-align: right; }
.chart-bars { min-width: 0; flex: 1; border-bottom: 1px solid var(--line); display: flex; align-items: flex-end; justify-content: space-around; gap: 6px; background: repeating-linear-gradient(to bottom, transparent 0 54px, rgba(74, 46, 38, .055) 55px); }
.chart-bar { min-width: 13px; max-width: 34px; height: var(--height); flex: 1; border-radius: 5px 5px 0 0; background: var(--wine-700); opacity: .84; transition: height .25s; }
.chart-bar:hover { opacity: 1; }
.chart-bar span { position: absolute; transform: translate(-2px, calc(100% + 7px)); color: var(--ink-400); font-size: 7px; white-space: nowrap; }
.ranking-panel > .panel-header > span { color: var(--ink-400); font-family: var(--serif); font-size: 11px; }
.ranking-list { padding: 0 19px 17px; }
.ranking-item { min-height: 50px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 27px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.ranking-item > span { color: var(--sand-400); font-family: var(--serif); font-size: 16px; }
.ranking-item div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ranking-item strong { overflow: hidden; color: var(--wine-900); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.ranking-item small { color: var(--ink-400); font-size: 7px; }
.ranking-item b { color: var(--wine-700); font-family: var(--serif); font-size: 14px; font-weight: 400; }
.queue-grid { margin-top: 17px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.queue-grid > button { min-height: 82px; padding: 14px 17px; border: 1px solid rgba(255, 255, 255, .75); border-radius: 16px; display: grid; grid-template-columns: 39px 1fr auto; gap: 11px; align-items: center; background: rgba(255, 253, 251, .82); box-shadow: var(--shadow); text-align: left; }
.queue-icon { width: 39px; height: 39px; border-radius: 12px; display: grid; place-items: center; color: var(--wine-700); background: var(--sand-100); font-family: var(--serif); }
.queue-grid button > span:nth-child(2) { display: flex; flex-direction: column; gap: 5px; }
.queue-grid small { color: var(--ink-400); font-size: 8px; }
.queue-grid strong { color: var(--wine-900); font-size: 11px; }
.queue-grid i { color: var(--wine-700); font-size: 8px; font-style: normal; }

.data-panel { overflow: hidden; }
.filters { min-height: 64px; padding: 13px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.filters select, .date-field { height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink-600); background: white; font-size: 9px; }
.date-field { display: flex; align-items: center; gap: 6px; }
.date-field input { border: 0; outline: 0; font-size: 9px; }
.filter-tabs { padding: 3px; border-radius: 10px; display: flex; gap: 2px; background: var(--sand-100); overflow-x: auto; }
.filter-tabs button { min-height: 30px; padding: 0 10px; border: 0; border-radius: 8px; color: var(--ink-600); background: transparent; font-size: 8px; white-space: nowrap; }
.filter-tabs button.is-active { color: white; background: var(--wine-700); }
.data-count { margin-left: auto; color: var(--ink-400); font-size: 9px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { padding: 11px 16px; color: var(--ink-400); background: rgba(246, 239, 232, .6); font-size: 8px; font-weight: 500; text-align: left; }
td { padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--ink-600); font-size: 9px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(250, 245, 240, .56); }
.entity-cell { min-width: 210px; display: flex; gap: 10px; align-items: center; }
.entity-cell > span { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 10px; display: grid; place-items: center; color: var(--wine-700); background: var(--sand-100); font-family: var(--serif); }
.entity-cell > img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; background: var(--sand-100); }
.entity-cell div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.entity-cell strong { max-width: 310px; overflow: hidden; color: var(--ink-900); font-size: 10px; text-overflow: ellipsis; }
.entity-cell small, td small { color: var(--ink-400); font-size: 8px; }
.tags { display: flex; gap: 4px; flex-wrap: wrap; }
.tag { padding: 4px 7px; border-radius: 8px; color: var(--wine-700); background: var(--sand-100); font-size: 7px; }
.status { display: inline-flex; padding: 5px 8px; border-radius: 12px; font-size: 8px; }
.status--active { color: #476348; background: var(--sage-100); }
.status--waiting { color: #8a5843; background: #f5e4da; }
.status--muted { color: #77716d; background: #edebe8; }
.status--danger { color: #93453f; background: #f6dfdc; }
.row-actions { display: flex; gap: 5px; }
.row-action { min-height: 29px; padding: 0 8px; border: 1px solid #dfccc3; border-radius: 8px; color: var(--wine-700); background: #fffaf7; font-size: 8px; }
.row-action--plain { border-color: transparent; background: transparent; }
.empty-row { height: 210px; color: var(--ink-400); text-align: center; }
.empty-row strong, .empty-row small { display: block; }
.empty-row strong { margin-bottom: 7px; color: var(--ink-600); font-family: var(--serif); font-size: 15px; font-weight: 400; }
.empty-chart { width: 100%; display: grid; place-items: center; }
.summary-grid { margin-bottom: 16px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.summary-grid article { min-height: 118px; padding: 20px; border: 1px solid rgba(255, 255, 255, .74); border-radius: 17px; display: flex; flex-direction: column; background: var(--white); box-shadow: var(--shadow); }
.summary-grid span { color: var(--ink-600); font-size: 9px; }
.summary-grid strong { margin-top: 10px; color: var(--wine-900); font-family: var(--serif); font-size: 31px; font-weight: 400; }
.summary-grid small { margin-top: 4px; color: var(--ink-400); font-size: 8px; }

.store-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.store-card { overflow: hidden; border: 1px solid rgba(255, 255, 255, .74); border-radius: 20px; display: grid; grid-template-columns: 42% 1fr; background: var(--white); box-shadow: var(--shadow); }
.store-cover { min-height: 280px; background: #d7c3b9; }
.store-copy { padding: 26px; }
.store-copy header { display: flex; justify-content: space-between; align-items: center; }
.store-copy h2 { margin: 15px 0 8px; color: var(--wine-900); font-family: var(--serif); font-size: 20px; font-weight: 400; }
.store-copy > p { min-height: 45px; margin: 0; color: var(--ink-600); font-size: 9px; line-height: 1.7; }
.store-meta { margin: 15px 0; display: grid; gap: 5px; color: var(--ink-600); font-size: 8px; }
.campaign-block { margin-bottom: 16px; }
.banner-list article { min-height: 85px; padding: 12px 20px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 80px 40px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; }
.banner-thumb { width: 80px; height: 54px; border-radius: 9px; background: var(--sand-100); }
.banner-index { color: var(--sand-400); font-family: var(--serif); font-size: 18px; }
.banner-list article > div { display: flex; flex-direction: column; gap: 4px; }
.banner-list strong { color: var(--wine-900); font-size: 10px; }
.banner-list small { color: var(--ink-400); font-size: 8px; }
.product-grid { padding: 17px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; }
.product-card { min-height: 150px; padding: 13px; border: 1px solid var(--line); border-radius: 15px; display: grid; grid-template-columns: 115px 1fr; gap: 14px; background: white; }
.product-art { min-height: 122px; border-radius: 11px; display: grid; place-items: center; color: var(--wine-700); background: var(--sand-100); font-family: var(--serif); font-size: 18px; letter-spacing: .15em; }
.product-art img { width: 100%; height: 100%; min-height: 122px; border-radius: inherit; object-fit: cover; }
.product-card > div:last-child { display: flex; flex-direction: column; align-items: flex-start; }
.product-card h3 { margin: 12px 0 5px; color: var(--wine-900); font-family: var(--serif); font-size: 16px; font-weight: 400; }
.product-card p { margin: 0; color: var(--ink-400); font-size: 8px; }
.product-card footer { width: 100%; margin-top: auto; display: flex; justify-content: space-between; align-items: center; }
.product-card footer strong { color: var(--wine-700); font-family: var(--serif); font-size: 17px; font-weight: 400; }

#view-operators table { min-width: 920px; }
.operator-identity strong { display: flex; align-items: center; gap: 7px; }
.operator-identity strong em { padding: 3px 6px; border-radius: 10px; color: var(--wine-700); background: var(--rose-100); font-size: 7px; font-style: normal; font-weight: 500; }
.row-action:disabled { cursor: not-allowed; opacity: .42; }
.operator-fields { display: grid; gap: 1px; }
.form-note { margin-top: 3px; padding: 13px 15px; border: 1px solid #eadbd2; border-radius: 12px; background: linear-gradient(145deg, #fcf6f1, #fffdfa); }
.form-note span { color: var(--wine-700); font-size: 9px; font-weight: 600; letter-spacing: .08em; }
.form-note p { margin: 5px 0 0; color: var(--ink-600); font-size: 9px; line-height: 1.65; }

.drawer-backdrop { position: fixed; z-index: 70; inset: 0; visibility: hidden; background: rgba(45, 31, 27, .26); opacity: 0; transition: .25s; }
.drawer-backdrop.is-visible { visibility: visible; opacity: 1; }
.detail-drawer { position: fixed; z-index: 80; top: 0; right: 0; bottom: 0; width: min(600px, 92vw); display: grid; grid-template-rows: auto 1fr auto; background: var(--white); box-shadow: -20px 0 60px rgba(52, 29, 23, .17); transform: translateX(103%); transition: transform .3s ease; }
.detail-drawer.is-open { transform: translateX(0); }
.detail-drawer > header { min-height: 84px; padding: 22px 24px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.detail-drawer h2 { margin: 5px 0 0; color: var(--wine-900); font-family: var(--serif); font-size: 25px; font-weight: 400; }
.detail-drawer > header button, .dialog-close { width: 32px; height: 32px; border: 0; border-radius: 50%; color: var(--ink-600); background: var(--sand-100); font-size: 18px; }
.drawer-body { min-height: 0; padding: 24px; overflow-y: auto; }
.drawer-footer { min-height: 72px; padding: 14px 24px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; align-items: center; gap: 8px; background: #fcfaf7; }
.detail-hero { margin-bottom: 22px; padding: 23px; border-radius: 17px; color: white; background: var(--wine-800); }
.detail-hero > span { color: #ddb3a2; font-size: 8px; letter-spacing: .12em; }
.detail-hero h3 { margin: 10px 0 7px; font-family: var(--serif); font-size: 24px; font-weight: 400; }
.detail-hero p { margin: 0; color: rgba(255, 255, 255, .62); font-size: 9px; line-height: 1.7; }
.detail-section { margin-bottom: 23px; }
.detail-section > h3 { margin: 0 0 11px; color: var(--wine-900); font-size: 11px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.detail-field { min-height: 62px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; display: flex; flex-direction: column; gap: 5px; background: #fff; }
.detail-field small { color: var(--ink-400); font-size: 7px; }
.detail-field strong { color: var(--ink-900); font-size: 9px; font-weight: 500; line-height: 1.5; }
.post-content { padding: 18px; border-radius: 14px; color: var(--ink-900); background: var(--sand-50); font-size: 11px; line-height: 1.9; white-space: pre-wrap; }
.post-images { margin-top: 12px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.post-images img { width: 100%; aspect-ratio: 1; border-radius: 12px; object-fit: cover; background: var(--sand-100); }
.record-list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.record-list article { min-height: 57px; padding: 11px 13px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 7px; align-items: center; }
.record-list article:last-child { border-bottom: 0; }
.record-list strong { color: var(--ink-900); font-size: 9px; }
.record-list p { margin: 4px 0 0; color: var(--ink-400); font-size: 8px; }
.record-list time { color: var(--ink-400); font-size: 7px; }
.empty-inline { padding: 20px; color: var(--ink-400); font-size: 9px; text-align: center; }
.standalone-empty { grid-column: 1 / -1; padding: 52px; text-align: center; }
.standalone-empty strong { color: var(--wine-900); font-family: var(--serif); font-size: 20px; font-weight: 400; }
.standalone-empty p { color: var(--ink-400); font-size: 10px; }
.context-card { margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--sand-50); }
.context-card small { color: var(--ink-400); font-size: 8px; }
.context-card p { margin: 6px 0 0; color: var(--ink-600); font-size: 9px; line-height: 1.7; }

.view-state { position: relative; z-index: 8; margin-bottom: 18px; }
.state-card { min-height: 72px; padding: 14px 17px; border: 1px solid var(--line); border-radius: 15px; display: flex; align-items: center; gap: 13px; background: rgba(255, 253, 251, .96); box-shadow: var(--shadow); }
.state-card > span { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: white; background: var(--danger); font-family: var(--serif); font-size: 18px; }
.state-card > div { min-width: 0; flex: 1; }
.state-card strong { color: var(--wine-900); font-size: 10px; }
.state-card p { margin: 5px 0 0; color: var(--ink-600); font-size: 9px; }
.state-card--loading > i { width: 28px; height: 28px; border: 2px solid var(--sand-200); border-top-color: var(--wine-700); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.image-frame { position: relative; overflow: hidden; display: inline-grid; place-items: center; background: #ded9d4; }
.image-frame > img { width: 100%; height: 100%; display: block; object-fit: cover; }
.image-fallback { position: absolute; inset: 0; display: none; place-items: center; align-content: center; gap: 4px; color: #857a74; background: linear-gradient(145deg, #e7e2de, #d4ceca); text-align: center; }
.image-fallback.is-visible { display: grid; }
.image-fallback b { font-family: var(--serif); font-size: 10px; font-weight: 400; letter-spacing: .12em; }
.image-fallback small { font-size: 6px; letter-spacing: .18em; }
.store-cover-image { width: 100%; height: 100%; min-height: 280px; }
.product-image { width: 100%; height: 100%; min-height: 122px; border-radius: 11px; }
.post-image { width: 100%; aspect-ratio: 1; border-radius: 12px; }
.post-images .image-frame { width: 100%; }
.rich-preview img, .rich-image { max-width: 100%; height: auto; border-radius: 12px; }
.rich-preview figure { margin: 16px 0; }
.rich-preview figcaption { color: var(--ink-400); font-size: 8px; text-align: center; }

.dialog { width: min(680px, calc(100vw - 28px)); max-height: calc(100vh - 28px); padding: 0; border: 0; border-radius: 20px; color: var(--ink-900); background: var(--white); box-shadow: 0 30px 100px rgba(53, 21, 17, .24); overflow: hidden; }
.dialog::backdrop { background: rgba(45, 31, 27, .38); backdrop-filter: blur(5px); }
.dialog form > header { padding: 25px 28px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; }
.dialog h2 { margin: 5px 0; color: var(--wine-900); font-family: var(--serif); font-size: 25px; font-weight: 400; }
.dialog header p:last-child { margin: 0; color: var(--ink-600); font-size: 9px; }
.dialog form > footer { min-height: 68px; padding: 13px 28px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 15px; background: #fcfaf7; }
.dialog form > footer > span { color: var(--ink-400); font-size: 8px; }
.dialog form > footer > div { display: flex; gap: 8px; }
.editor-dialog { width: min(1120px, calc(100vw - 28px)); }
.editor-dialog form { max-height: calc(100vh - 28px); display: grid; grid-template-rows: auto 1fr auto; }
.editor-layout { min-height: 0; display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .75fr); overflow: hidden; }
.editor-main, .editor-side { min-height: 0; padding: 23px 28px; overflow-y: auto; }
.editor-side { border-left: 1px solid var(--line); background: #fcfaf7; }
.dialog label { margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; color: var(--ink-600); font-size: 9px; }
.dialog input, .dialog select, .dialog textarea { width: 100%; min-height: 42px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; background: white; font-size: 10px; }
.dialog textarea { min-height: 78px; padding: 10px 11px; resize: vertical; line-height: 1.6; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.content-contract { margin: 18px 0; padding: 16px 0 17px 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); position: relative; }
.content-contract::before { content: ''; position: absolute; top: 16px; bottom: 17px; left: 0; width: 2px; background: var(--rose-500); }
.content-contract__heading { margin-bottom: 14px; display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; }
.content-contract__heading span { color: var(--rose-500); font-size: 7px; font-weight: 700; letter-spacing: .16em; }
.content-contract__heading h3 { margin: 4px 0 0; color: var(--wine-900); font-family: var(--serif); font-size: 18px; font-weight: 400; }
.content-contract__heading p { max-width: 300px; margin: 0; color: var(--ink-400); font-size: 8px; line-height: 1.6; text-align: right; }
.content-contract label:last-child { margin-bottom: 0; }
.content-contract label > small { color: var(--ink-400); font-size: 8px; line-height: 1.6; }
.content-contract__grid { grid-template-columns: minmax(120px, .45fr) minmax(0, 1.55fr); }
.lesson-json-editor { min-height: 250px !important; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 9px !important; line-height: 1.65 !important; tab-size: 2; }
.lesson-json-editor:invalid { border-color: var(--danger); box-shadow: 0 0 0 2px rgba(161, 55, 45, .08); }
.editor-section-label { margin: 18px 0 8px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.editor-section-label span { color: var(--ink-600); font-size: 9px; }
.editor-section-label small { color: var(--ink-400); font-size: 8px; }
fieldset { margin: 0 0 14px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
legend { padding: 0 5px; color: var(--ink-600); font-size: 8px; }
.check-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.check-grid label { margin: 0; flex-direction: row; align-items: center; gap: 6px; font-size: 8px; }
.check-grid input { width: 14px; min-height: 14px; height: 14px; }
.rich-editor { overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: white; }
.rich-toolbar { min-height: 42px; padding: 5px 7px; border-bottom: 1px solid var(--line); display: flex; gap: 4px; align-items: center; background: #faf7f3; }
.rich-toolbar button { min-width: 32px; height: 30px; padding: 0 8px; border: 1px solid transparent; border-radius: 7px; color: var(--ink-600); background: transparent; font-size: 8px; }
.rich-toolbar button:hover { border-color: var(--line); background: white; }
#richEditor { min-height: 360px; padding: 20px; outline: 0; font-size: 11px; line-height: 1.9; }
#richEditor:empty::before { content: attr(data-placeholder); color: var(--ink-400); }
#richEditor h2 { color: var(--wine-900); font-family: var(--serif); font-size: 20px; font-weight: 400; }
#richEditor blockquote { margin: 16px 0; padding: 8px 14px; border-left: 3px solid var(--rose-500); color: var(--ink-600); background: var(--sand-50); }
#richEditor figure { margin: 16px 0; }
#richEditor .rich-image, #richEditor img { width: min(100%, 620px); height: auto; min-height: 160px; }
#richEditor figcaption { margin-top: 6px; color: var(--ink-400); font-size: 8px; text-align: center; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; border: 0 !important; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.upload-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.upload-field .button { min-height: 42px; }
.upload-actions { display: flex; align-items: center; gap: 10px; }
.upload-group { margin-bottom: 14px; }
.upload-group > label { margin-bottom: 8px; }
.upload-actions small { color: var(--ink-400); font-size: 8px; }
.file-button { position: relative; margin: 0 !important; flex-direction: row !important; color: var(--wine-700) !important; font-size: 9px !important; }
.upload-preview { display: flex; gap: 7px; overflow-x: auto; }
.upload-preview-image { width: 62px; height: 48px; flex: 0 0 auto; border-radius: 8px; }
.certificate-editor { margin: 20px 0; padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: var(--sand-50); }
.certificate-editor-heading { margin-bottom: 13px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.certificate-editor-heading > div > span, .certificate-item > header span, .certificate-asset > div > span { color: var(--rose-500); font-size: 7px; font-weight: 700; letter-spacing: .14em; }
.certificate-editor-heading h3 { margin: 4px 0; color: var(--wine-900); font-family: var(--serif); font-size: 18px; font-weight: 400; }
.certificate-editor-heading p { margin: 0; color: var(--ink-400); font-size: 8px; line-height: 1.6; }
.certificate-list { display: grid; gap: 11px; }
.certificate-item { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.certificate-item > header { margin-bottom: 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.certificate-item > header > div { display: grid; gap: 3px; }
.certificate-item > header strong { color: var(--wine-900); font-family: var(--serif); font-size: 14px; font-weight: 400; }
.certificate-assets { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.certificate-asset { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 9px; align-content: start; }
.certificate-asset--original { border-style: dashed; background: #fcfaf7; }
.certificate-asset > div:first-child { display: grid; gap: 4px; }
.certificate-asset > div:first-child small { color: var(--ink-400); font-size: 8px; line-height: 1.55; }
.certificate-preview { min-height: 108px; border-radius: 9px; overflow: hidden; background: #eee9e4; }
.certificate-preview-image { width: 100%; height: 108px; }
.certificate-preview-empty { min-height: 108px; padding: 12px; display: grid; place-items: center; align-content: center; gap: 4px; color: var(--ink-400); text-align: center; }
.certificate-preview-empty b { color: var(--ink-600); font-size: 9px; font-weight: 600; }
.certificate-preview-empty small, .certificate-asset-status { color: var(--ink-400); font-size: 8px; line-height: 1.5; }
.certificate-original-actions { display: flex !important; align-items: center; gap: 8px !important; }
.certificate-original-actions .row-action { white-space: nowrap; }
.certificate-empty { padding: 18px 12px; border: 1px dashed var(--line); border-radius: 10px; color: var(--ink-400); font-size: 9px; text-align: center; }
.switch-label { justify-content: flex-end; }
.config-readonly { margin-bottom: 14px; }
.switch-label span, .config-fields label > span { display: flex; align-items: center; gap: 7px; }
.switch-label input, .config-fields label > span input { width: 16px; min-height: 16px; }
.category-manager { padding: 22px 28px; }
.category-list { max-height: 320px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 12px; overflow-y: auto; }
.category-list article { min-height: 52px; padding: 8px 10px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 110px minmax(0, 1fr) auto auto; gap: 7px; align-items: center; }
.category-list article:last-child { border-bottom: 0; }
.category-list span { color: var(--ink-400); font-family: ui-monospace, monospace; font-size: 8px; }
.category-list input { min-height: 34px; }
.category-create { display: grid; grid-template-columns: 1fr 1fr auto; gap: 7px; }
.category-create input { min-height: 40px; }
.segmented--large button { min-height: 32px; padding-inline: 13px; }
.compact-dialog form > label, .config-fields { padding: 22px 28px; }
.compact-dialog label small { align-self: flex-end; color: var(--ink-400); font-size: 8px; }
.config-fields { max-height: 55vh; overflow-y: auto; }
.config-fields > label { padding: 0; }
.confirm-dialog { width: min(420px, calc(100vw - 28px)); padding: 28px; }
.confirm-dialog h2 { margin: 8px 0; }
.confirm-dialog > form > p:not(.eyebrow) { margin: 0 0 25px; color: var(--ink-600); font-size: 10px; line-height: 1.7; }
.confirm-dialog form > footer { min-height: auto; padding: 0; border: 0; justify-content: flex-end; background: transparent; }

.toast { position: fixed; z-index: 120; left: 50%; bottom: 25px; padding: 11px 16px; border-radius: 11px; color: white; background: rgba(53, 21, 17, .94); box-shadow: 0 12px 35px rgba(53, 21, 17, .22); font-size: 10px; opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: .25s; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.nav-backdrop { position: fixed; z-index: 49; inset: 0; visibility: hidden; background: rgba(45, 31, 27, .34); opacity: 0; transition: .25s; }
.nav-backdrop.is-visible { visibility: visible; opacity: 1; }

.login-screen { position: fixed; z-index: 200; inset: 0; display: grid; grid-template-columns: 1.15fr .85fr; background: #f8f3ee; transition: opacity .3s, visibility .3s; }
.login-screen.is-hidden { visibility: hidden; opacity: 0; pointer-events: none; }
.login-story { padding: 8vw; display: flex; flex-direction: column; justify-content: center; color: white; background: var(--wine-950); }
.login-story img { width: 260px; filter: brightness(0) invert(1); }
.login-story p { margin: 55px 0 0; color: #ddb09e; font-size: 10px; letter-spacing: .28em; }
.login-story h1 { margin: 17px 0; font-family: var(--serif); font-size: clamp(44px, 6vw, 76px); font-weight: 400; line-height: 1.2; }
.login-story span { color: rgba(255, 255, 255, .52); font-size: 11px; }
.login-card { width: min(390px, calc(100% - 50px)); margin: auto; padding: 42px; border: 1px solid var(--line); border-radius: 23px; background: rgba(255, 255, 255, .86); box-shadow: 0 25px 70px rgba(64, 36, 28, .1); }
.login-card h2 { margin: 7px 0; color: var(--wine-900); font-family: var(--serif); font-size: 29px; font-weight: 400; }
.login-card > p.muted { margin: 0 0 25px; font-size: 9px; }
.login-card label { margin: 15px 0; display: flex; flex-direction: column; gap: 6px; color: var(--ink-600); font-size: 9px; }
.login-card input { height: 45px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.login-card small { margin-top: 16px; display: block; color: var(--ink-400); font-size: 8px; text-align: center; }

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 84px minmax(0, 1fr); }
  .sidebar { width: 84px; padding: 24px 12px; }
  .brand { padding: 0 3px 19px; align-items: center; }
  .brand img { width: 58px; object-fit: cover; object-position: left; }
  .brand span, .main-nav > p, .nav-item span, .nav-item b, .role-card, .operator div, .operator button { display: none; }
  .nav-item { padding: 0; grid-template-columns: 1fr; justify-items: center; }
  .nav-item i { width: 30px; height: 30px; }
  .operator { grid-template-columns: 1fr; justify-items: center; }
  .workspace { grid-column: 2; }
  .dashboard-layout { grid-template-columns: 1fr; }
  .ranking-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 15px; }
  .store-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .queue-grid { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: 1fr; }
  .editor-layout { grid-template-columns: 1fr; overflow-y: auto; }
  .editor-main, .editor-side { overflow: visible; }
  .editor-side { border-top: 1px solid var(--line); border-left: 0; }
  .content-contract__heading { align-items: flex-start; flex-direction: column; gap: 6px; }
  .content-contract__heading p { max-width: none; text-align: left; }
  .login-screen { grid-template-columns: 1fr; }
  .login-story { display: none; }
}

@media (max-width: 760px) {
  body { padding-bottom: 0; }
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 60; inset: 0 auto 0 0; width: min(285px, 84vw); height: 100vh; padding: 25px 18px 20px; overflow-y: auto; transform: translateX(-102%); transition: transform .28s ease; }
  .sidebar.is-open { transform: translateX(0); }
  .brand { display: flex; align-items: flex-start; }
  .brand img { width: 145px; object-fit: initial; }
  .brand span, .main-nav > p, .nav-item span, .nav-item b, .role-card, .operator div, .operator button { display: initial; }
  .main-nav { height: auto; padding-top: 12px; display: block; overflow: visible; }
  .main-nav > p { display: block; }
  .nav-item { min-width: 0; min-height: 46px; padding: 0 11px; border-radius: 11px; display: grid; grid-template-columns: 28px 1fr auto; gap: 7px; justify-items: stretch; text-align: left; }
  .nav-item i { width: 24px; height: 24px; border: 1px solid rgba(255, 255, 255, .15); font-size: 12px; }
  .nav-item span { font-size: 12px; }
  .nav-item.is-active { box-shadow: inset 3px 0 #d9a28d; }
  .role-card { display: block; margin-top: 24px; }
  .operator { display: grid; grid-template-columns: 34px 1fr auto; justify-items: stretch; }
  .workspace { width: 100%; }
  .topbar { height: 62px; padding: 0 14px; }
  .mobile-menu { min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; display: block; color: var(--wine-700); background: white; font-size: 8px; }
  .branch-switcher { font-size: 8px; }
  .global-search, .icon-button { display: none; }
  .topbar-actions .button { min-height: 34px; padding: 0 10px; font-size: 8px; }
  main { padding: 22px 13px; }
  .page-heading { min-height: 72px; margin-bottom: 16px; }
  .page-heading h1 { font-size: 28px; }
  .page-heading > div > p:last-child { font-size: 9px; }
  .live-chip { display: none; }
  .metric-grid { gap: 8px; }
  .metric-card { min-height: 118px; padding: 15px; }
  .metric-card strong { font-size: 29px; }
  .trend-chart { height: 230px; padding-inline: 12px; gap: 7px; }
  .chart-bars { gap: 3px; }
  .chart-bar { min-width: 7px; }
  .ranking-list { grid-template-columns: 1fr; }
  .filters { align-items: stretch; }
  .search-field { min-width: 100%; }
  .filter-tabs { max-width: 100%; }
  .summary-grid { grid-template-columns: repeat(3, 1fr); gap: 7px; }
  .summary-grid article { min-height: 100px; padding: 14px 11px; }
  .summary-grid strong { font-size: 25px; }
  .store-card { grid-template-columns: 1fr; }
  .store-cover { min-height: 190px; }
  .banner-list article { grid-template-columns: 58px 26px minmax(140px, 1fr) auto; }
  .banner-thumb { width: 58px; height: 42px; }
  .banner-list article > .status { display: none; }
  .detail-drawer { width: 100%; }
  .drawer-body { padding: 18px; }
  .dialog form > header, .editor-main, .editor-side { padding-inline: 18px; }
  .dialog form > footer { padding-inline: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .certificate-editor { padding: 13px; }
  .certificate-editor-heading { align-items: stretch; flex-direction: column; }
  .certificate-editor-heading .button { align-self: flex-start; }
  .certificate-assets { grid-template-columns: 1fr; }
  .heading-actions { align-items: stretch; flex-wrap: wrap; justify-content: flex-end; }
  .category-list article { grid-template-columns: 82px minmax(120px, 1fr) auto auto; }
  .category-manager { padding-inline: 18px; overflow-x: auto; }
  .category-create { min-width: 430px; }
  .state-card { align-items: flex-start; }
  .state-card .button { flex: 0 0 auto; }
  .dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: 15px; }
  .editor-dialog form { max-height: calc(100dvh - 16px); }
  .config-fields { max-height: 62dvh; }
  .drawer-footer { overflow-x: auto; justify-content: flex-start; }
  .drawer-footer .button { flex: 0 0 auto; }
}

@media (max-width: 480px) {
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { min-width: 0; }
  .metric-card header { font-size: 8px; }
  .metric-card strong { font-size: 25px; }
  .summary-grid { overflow-x: auto; grid-template-columns: repeat(3, minmax(105px, 1fr)); }
  .product-card { grid-template-columns: 94px 1fr; }
  .detail-grid, .check-grid { grid-template-columns: 1fr; }
  .page-heading { align-items: flex-start; }
  .page-heading > .heading-actions { max-width: 145px; }
  .page-heading > .heading-actions .button { min-height: 34px; padding-inline: 9px; font-size: 8px; }
  .state-card { flex-wrap: wrap; }
  .state-card .button { width: 100%; }
}

/* 2026 reference-led visual system: warm editorial operations console */
:root {
  --wine-950: #3d1716;
  --wine-900: #55201f;
  --wine-800: #772a2b;
  --wine-700: #982f31;
  --rose-500: #b45b54;
  --rose-100: #f7e7e3;
  --sand-50: #fffdf9;
  --sand-100: #f8f3ed;
  --sand-200: #eadfd5;
  --sand-400: #b99e8c;
  --ink-900: #2d2421;
  --ink-600: #6e625d;
  --ink-400: #9e928b;
  --sage-700: #4f755b;
  --sage-100: #edf3ea;
  --danger: #a53836;
  --white: #fffefa;
  --line: rgba(95, 64, 52, .12);
  --line-strong: rgba(111, 67, 53, .18);
  --shadow: 0 10px 30px rgba(84, 45, 32, .065), 0 2px 6px rgba(84, 45, 32, .025);
  --shadow-raised: 0 18px 55px rgba(84, 45, 32, .11), 0 3px 12px rgba(84, 45, 32, .04);
  --serif: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

body {
  min-width: 320px;
  overflow-x: clip;
  color: var(--ink-900);
  background:
    linear-gradient(135deg, rgba(156, 105, 79, .025) 0 1px, transparent 1px 42px),
    linear-gradient(45deg, rgba(156, 105, 79, .018) 0 1px, transparent 1px 58px),
    radial-gradient(circle at 18% 4%, rgba(207, 172, 146, .13), transparent 26%),
    radial-gradient(circle at 92% 88%, rgba(220, 190, 168, .12), transparent 31%),
    #faf8f5;
  background-size: 42px 42px, 58px 58px, auto, auto, auto;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  content: "";
  opacity: .45;
  pointer-events: none;
  background: repeating-linear-gradient(118deg, transparent 0 92px, rgba(135, 84, 65, .025) 93px, transparent 94px 186px);
}

button, input, select, textarea { letter-spacing: .01em; }
button { transition: color .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
button:not(:disabled):active { transform: translateY(1px); }

.app-shell { min-height: 100vh; grid-template-columns: 262px minmax(0, 1fr); }
.workspace { grid-column: 2; padding-top: 90px; }

.sidebar {
  inset: 8px auto 10px 16px;
  width: 228px;
  height: calc(100vh - 18px);
  padding: 27px 18px 20px;
  color: var(--ink-900);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 30px;
  background: rgba(255, 254, 251, .94);
  box-shadow: 0 12px 46px rgba(80, 46, 34, .105);
  backdrop-filter: blur(20px);
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }
.brand {
  padding: 7px 10px 20px;
  align-items: center;
  gap: 8px;
  color: var(--wine-900);
  border-bottom: 0;
}
.brand img { width: 160px; filter: none; }
.brand span { color: var(--wine-700); font-family: var(--serif); font-size: 14px; letter-spacing: .1em; }
.brand i { width: 100%; height: 20px; margin-top: 1px; position: relative; display: block; }
.brand i::before, .brand i::after { position: absolute; top: 10px; width: 38%; height: 1px; content: ""; background: linear-gradient(90deg, transparent, #d9beb0); }
.brand i::before { left: 0; }
.brand i::after { right: 0; transform: rotate(180deg); }
.brand i { background: radial-gradient(closest-side, #b98264 0 2px, transparent 3px); }

.main-nav { padding-top: 4px; }
.main-nav > p { margin: 19px 11px 8px; color: #8f817a; font-size: 12px; font-weight: 500; letter-spacing: .02em; }
.nav-item {
  position: relative;
  min-height: 48px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 13px;
  grid-template-columns: 31px 1fr auto;
  gap: 9px;
  color: #514743;
  overflow: hidden;
  isolation: isolate;
}
.nav-item::before { position: absolute; z-index: -1; inset: 0; border-radius: inherit; content: ""; opacity: 0; background: radial-gradient(circle at 14% 50%, rgba(183, 92, 74, .13), transparent 36%); transition: opacity .22s ease; }
.nav-item:hover { color: var(--wine-800); border-color: rgba(174, 91, 75, .07); background: #fbf4ef; transform: translateX(2px); }
.nav-item:hover::before, .nav-item.is-active::before { opacity: 1; }
.nav-item.is-active {
  color: var(--wine-900);
  border-color: rgba(171, 86, 70, .13);
  background: linear-gradient(105deg, rgba(248, 230, 226, .98), rgba(252, 240, 233, .92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .78), inset 0 -1px 0 rgba(168, 83, 69, .035), 0 7px 18px rgba(128, 58, 46, .09);
}
.nav-item.is-active::after { position: absolute; left: 0; top: 50%; width: 3px; height: 23px; border-radius: 0 4px 4px 0; content: ""; background: linear-gradient(#bb6b5b, #8f302f); box-shadow: 0 0 10px rgba(149, 53, 49, .24); transform: translateY(-50%); }
.nav-item i {
  width: 30px;
  height: 30px;
  border-color: #e4d7cf;
  border-radius: 9px;
  color: var(--wine-800);
  background: rgba(255,255,255,.72);
  box-shadow: 0 2px 7px rgba(95, 53, 39, .025);
}
.nav-item i svg, .ui-icon, .queue-icon svg, .role-icon svg, .operator button svg, .branch-switcher svg, .icon-button svg, .dashboard-date svg, .dashboard-actions .button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-item.is-active i { border-color: #e4bfb4; color: #7f2a2b; background: linear-gradient(145deg, #fffdfb, #fbece8); box-shadow: 0 4px 11px rgba(111, 50, 42, .1), inset 0 1px 0 white; }
.nav-item span { font-size: 13px; font-weight: 500; }
.nav-item b { min-width: 24px; padding: 3px 7px; color: var(--wine-800); background: #f9e6e2; font-size: 10px; }

.role-card {
  margin: auto 0 12px;
  padding: 15px;
  border-color: #ede2da;
  border-radius: 14px;
  background: linear-gradient(140deg, #fffefa, #faf5ef);
  box-shadow: 0 5px 18px rgba(83, 48, 35, .045);
}
.role-card { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: center; }
.role-icon { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #98623e; background: #fbf0e3; }
.role-icon svg { width: 19px; height: 19px; }
.role-card > div { min-width: 0; }
.role-card span, .role-card small { color: var(--ink-400); font-size: 10px; }
.role-card .role-icon { display: grid; color: #98623e; }
.role-card strong { margin: 4px 0 3px; color: var(--wine-900); font-size: 13px; font-weight: 600; }
.operator { padding: 13px 7px 0; border-top-color: var(--line); grid-template-columns: 36px 1fr auto; color: var(--ink-900); }
.operator > span { width: 36px; height: 36px; color: white; background: linear-gradient(145deg, #bc8170, #7f342f); box-shadow: 0 4px 11px rgba(93, 43, 36, .18); }
.operator strong { color: var(--wine-900); font-size: 12px; }
.operator small, .operator button { color: var(--ink-400); font-size: 9px; }
.operator button { display: inline-flex; align-items: center; gap: 5px; }
.operator button svg { width: 16px; height: 16px; }
.operator button:hover { color: var(--wine-700); }

.topbar {
  position: fixed;
  z-index: 20;
  inset: 0 0 auto 0;
  height: 90px;
  padding: 0 30px 0 274px;
  border-bottom-color: rgba(95, 64, 52, .09);
  background: rgba(255, 254, 251, .72);
  backdrop-filter: blur(22px) saturate(120%);
}
.topbar-leading, .topbar-actions { display: flex; align-items: center; gap: 14px; }
.desktop-menu, .mobile-menu { width: 45px; height: 45px; padding: 12px; border: 0; border-radius: 12px; background: transparent; }
.desktop-menu { display: grid; align-content: center; gap: 5px; }
.desktop-menu:hover { background: #f8f1eb; }
.desktop-menu span, .mobile-menu span { width: 22px; height: 2px; display: block; border-radius: 2px; background: #302725; }
.branch-switcher {
  min-height: 48px;
  padding: 0 15px;
  border-color: var(--line);
  border-radius: 13px;
  gap: 10px;
  background: rgba(255,255,255,.74);
  box-shadow: 0 3px 10px rgba(74, 45, 35, .025);
  font-size: 13px;
}
.branch-switcher > span { width: 22px; height: 22px; border-radius: 0; display: grid; place-items: center; color: #514743; background: transparent; box-shadow: none; font-size: 18px; }
.branch-switcher svg { width: 19px; height: 19px; }
.branch-switcher b { font-weight: 500; }
.branch-switcher i { margin-left: 6px; }
.branch-picker { position: relative; }
.branch-switcher[aria-expanded="true"] { border-color: rgba(143, 53, 54, .32); background: #fff; box-shadow: 0 0 0 3px rgba(143, 53, 54, .08); }
.branch-switcher[aria-expanded="true"] i { transform: rotate(180deg); }
.branch-switcher i { transition: transform .18s ease; }
.branch-menu {
  position: absolute;
  z-index: 45;
  top: calc(100% + 10px);
  left: 0;
  width: max(220px, 100%);
  max-height: min(340px, calc(100vh - 124px));
  padding: 7px;
  border: 1px solid rgba(105, 72, 59, .13);
  border-radius: 14px;
  background: rgba(255, 254, 251, .98);
  box-shadow: 0 18px 42px rgba(70, 41, 32, .14), inset 0 1px rgba(255,255,255,.9);
  overflow-y: auto;
  backdrop-filter: blur(18px);
}
.branch-menu button {
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 18px;
  gap: 8px;
  align-items: center;
  color: #574b46;
  background: transparent;
  text-align: left;
}
.branch-menu button:hover,
.branch-menu button:focus-visible { color: var(--wine-800); background: #faf1eb; }
.branch-menu button.is-active { color: var(--wine-900); background: linear-gradient(105deg, #f9e7e2, #fcf2ec); }
.branch-menu button > span:first-child { width: 28px; height: 28px; border: 1px solid #eadbd2; border-radius: 8px; display: grid; place-items: center; color: var(--wine-700); background: rgba(255,255,255,.74); }
.branch-menu button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.branch-menu button strong { overflow: hidden; font-size: 11px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.branch-menu button > i { color: var(--wine-700); font-size: 12px; font-style: normal; text-align: center; opacity: 0; }
.branch-menu button.is-active > i { opacity: 1; }
.global-search {
  position: absolute;
  left: calc(50% + 131px);
  width: min(500px, 34vw);
  height: 48px;
  transform: translateX(-50%);
  border-color: rgba(116, 77, 62, .12);
  border-radius: 14px;
  gap: 11px;
  background: rgba(255,255,255,.62);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.5), 0 3px 12px rgba(68, 42, 33, .02);
}
.global-search span { color: #6f645f; font-size: 25px; font-weight: 300; line-height: 1; transform: rotate(-15deg); }
.global-search input { font-size: 12px; }
.icon-button { width: 43px; height: 43px; border: 0; border-radius: 12px; background: transparent; font-size: 23px; }
.icon-button > span { display: grid; place-items: center; }
.icon-button svg { width: 23px; height: 23px; }
.icon-button:hover { background: #f8f1eb; }
.icon-button b { top: -1px; right: -1px; min-width: 20px; height: 20px; border-color: #fffdfa; background: var(--wine-700); font-size: 10px; }
.topbar-create { display: none; }
.topbar-operator { display: flex; align-items: center; gap: 10px; color: var(--ink-900); }
.topbar-operator > span { width: 41px; height: 41px; border: 3px solid rgba(255,255,255,.8); border-radius: 50%; display: grid; place-items: center; color: white; background: linear-gradient(145deg, #d8a998, #7f342f); box-shadow: 0 4px 12px rgba(82, 45, 35, .14); font-family: var(--serif); }
.topbar-operator strong { max-width: 100px; overflow: hidden; font-size: 13px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.topbar-operator i { color: var(--ink-600); font-size: 11px; font-style: normal; }

main { max-width: 1680px; padding: 30px 32px 42px 22px; }
.view { animation-duration: .35s; }
@keyframes view-in { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
.page-heading { min-height: 103px; margin-bottom: 18px; align-items: flex-start; }
.page-heading h1 { margin: 7px 0 8px; color: #3e1817; font-size: clamp(34px, 3vw, 43px); line-height: 1.08; letter-spacing: .045em; }
.page-heading > div > p:last-child { color: #766c67; font-size: 12px; }
.eyebrow { color: #a85c54; font-size: 11px; font-weight: 500; letter-spacing: .08em; }
.page-heading .eyebrow { padding-top: 2px; }
.heading-actions { padding-top: 4px; gap: 12px; }
.dashboard-actions { flex-wrap: wrap; justify-content: flex-end; }
.dashboard-date { height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; display: flex; align-items: center; gap: 9px; color: #544b47; background: rgba(255,255,255,.78); box-shadow: var(--shadow); }
.dashboard-date span { color: var(--wine-800); font-size: 15px; }
.dashboard-date svg { width: 18px; height: 18px; }
.dashboard-date input { width: 124px; border: 0; outline: 0; background: transparent; font-size: 12px; }
.live-chip, .api-chip { padding: 7px 10px; border-color: #eadbd3; color: var(--wine-700); background: #fffaf6; font-size: 10px; }
.dashboard-actions .live-chip { order: 3; flex-basis: 100%; margin-left: auto; justify-content: flex-end; border: 0; background: transparent; }

.button { min-height: 42px; padding: 0 17px; border-radius: 10px; font-size: 12px; font-weight: 500; }
.button--primary { border-color: #8f2d2e; background: linear-gradient(135deg, #a23b3c, #842729); box-shadow: 0 8px 18px rgba(132, 39, 41, .17); }
.button--primary:hover { background: linear-gradient(135deg, #ad4142, #782224); box-shadow: 0 10px 22px rgba(132, 39, 41, .21); transform: translateY(-1px); }
.dashboard-actions .button svg { width: 17px; height: 17px; }
.button--secondary { border-color: #dfcec4; background: rgba(255,253,249,.88); }
.button--secondary:hover { border-color: #cfaea1; background: #fff; }
.text-button { font-size: 11px; }

.panel {
  border-color: rgba(111, 75, 60, .095);
  border-radius: 18px;
  background: rgba(255, 254, 251, .82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.panel-header { min-height: 71px; padding: 16px 22px 13px; }
.panel-header h2 { margin-top: 3px; font-size: 20px; letter-spacing: .03em; }

.metric-grid { margin-bottom: 18px; gap: 18px; }
.metric-card, .metric-card:nth-child(1), .metric-card:nth-child(3), .metric-card:nth-child(4) {
  position: relative;
  min-height: 174px;
  padding: 25px 24px;
  overflow: hidden;
  color: var(--wine-900);
  border: 1px solid rgba(111, 75, 60, .09);
  border-radius: 18px;
  background: rgba(255, 254, 251, .84);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.metric-card::after { position: absolute; inset: auto -28px -38px auto; width: 110px; height: 110px; border-radius: 50%; content: ""; background: radial-gradient(circle, rgba(180, 89, 78, .06), transparent 68%); }
.metric-card header { align-items: flex-start; color: #473b36; font-size: 13px; font-weight: 500; }
.metric-card header i { width: 52px; height: 52px; margin-top: -2px; border: 1px solid #efe1d9; border-radius: 50%; display: grid; place-items: center; color: #8d3d2c; background: linear-gradient(145deg, #fffdfa, #fbf3ec); box-shadow: 0 6px 16px rgba(115, 66, 45, .055); font-size: 27px; opacity: 1; }
.metric-card header i .ui-icon { width: 27px; height: 27px; }
.metric-card:nth-child(2) header i { color: #9b5227; background: #fdf8f0; }
.metric-card:nth-child(3) header i { color: #546b4e; background: #f0f5ed; }
.metric-card:nth-child(4) header i { color: #912d2f; background: #faeeee; }
.metric-card strong { margin-top: -7px; color: #371817; font-size: 40px; letter-spacing: .02em; }
.metric-card strong small { color: #514743; font-size: 12px; opacity: 1; }
.metric-card p { margin-top: 15px; color: #645954; font-size: 11px; opacity: 1; }
.metric-card p > span { display: none; }
.metric-card p b { margin: 0 3px 0 6px; color: #a23536; font-size: 9px; }
.metric-card p .metric-up--green, .metric-card p .metric-down { color: #3c7752; }

.dashboard-layout { grid-template-columns: minmax(0, 1.75fr) minmax(340px, .8fr); gap: 18px; }
.trend-chart { height: 320px; padding: 27px 25px 22px; }
.chart-axis { width: 38px; color: #8c837d; font-size: 10px; }
.chart-bars { gap: 10px; background: repeating-linear-gradient(to bottom, transparent 0 58px, rgba(74,46,38,.06) 59px); }
.chart-bar { min-width: 9px; max-width: 22px; border-radius: 2px 2px 0 0; background: linear-gradient(to bottom, #b44849, #dca3a0); opacity: .92; }
.chart-bar span { font-size: 9px; }
.segmented, .filter-tabs { background: #f5efea; }
.segmented button { padding: 7px 11px; border-radius: 7px; font-size: 10px; }
.segmented button.is-active, .filter-tabs button.is-active { background: linear-gradient(135deg, #a33a3b, #842829); box-shadow: 0 4px 9px rgba(132,40,41,.12); }
.ranking-list { padding: 0 22px 15px; }
.ranking-item { min-height: 53px; grid-template-columns: 38px minmax(0,1fr) auto; }
.ranking-item > span { color: #a33a3b; font-size: 16px; }
.ranking-item strong { font-size: 11px; }
.ranking-item small { font-size: 9px; }
.ranking-item b { color: #8e292b; font-size: 15px; }
.queue-grid { margin-top: 18px; gap: 18px; }
.queue-grid > button { min-height: 104px; padding: 18px 23px; border-color: rgba(111,75,60,.09); border-radius: 17px; grid-template-columns: 55px 1fr auto; background: rgba(255,254,251,.83); box-shadow: var(--shadow); }
.queue-grid > button:hover { border-color: rgba(156,61,54,.18); background: #fffefa; box-shadow: var(--shadow-raised); transform: translateY(-2px); }
.queue-icon { width: 55px; height: 55px; border: 1px solid #f0dcd4; border-radius: 17px; background: #faecea; font-size: 22px; }
.queue-icon svg { width: 27px; height: 27px; }
.queue-grid > button:nth-child(2) .queue-icon { color: #9a5a2d; background: #faf0e4; }
.queue-grid > button:nth-child(3) .queue-icon { color: #8d3031; background: #f9e9e8; }
.queue-grid small { color: #554b46; font-size: 11px; }
.queue-grid strong { font-family: var(--serif); font-size: 21px; font-weight: 400; }
.queue-grid i { font-size: 10px; }

.summary-grid { gap: 16px; }
.summary-grid article { min-height: 126px; padding: 22px; border-color: rgba(111,75,60,.09); background: rgba(255,254,251,.84); }
.summary-grid article:nth-child(1) { background: linear-gradient(135deg, rgba(255,254,251,.92), rgba(250,235,229,.82)); }
.summary-grid span { font-size: 12px; }
.summary-grid strong { font-size: 35px; }
.summary-grid small { font-size: 10px; }

.filters { min-height: 76px; padding: 16px 18px; gap: 11px; }
.filters select, .date-field { height: 42px; padding-inline: 12px; border-color: var(--line); border-radius: 10px; background: rgba(255,255,255,.88); font-size: 11px; }
.date-field input { font-size: 11px; }
.search-field { min-width: 245px; height: 42px; border-color: var(--line); border-radius: 10px; background: rgba(255,255,255,.88); }
.search-field input { font-size: 11px; }
.filter-tabs { padding: 4px; border-radius: 10px; }
.filter-tabs button { min-height: 32px; padding: 0 11px; font-size: 10px; }
.data-count { font-size: 11px; }
th { padding: 13px 17px; color: #837771; background: rgba(248,243,237,.72); font-size: 10px; font-weight: 500; letter-spacing: .03em; }
td { padding: 15px 17px; color: #655a55; font-size: 11px; }
tbody tr { transition: background .16s ease; }
tbody tr:hover { background: rgba(251,244,239,.72); }
.entity-cell { min-width: 220px; gap: 12px; }
.entity-cell > span { width: 38px; height: 38px; border: 1px solid #eee0d7; border-radius: 10px; background: #fbf4ee; font-size: 15px; }
.entity-cell > img { width: 43px; height: 43px; }
.entity-cell strong { font-size: 12px; }
.entity-cell small, td small { font-size: 9px; }
.tag { padding: 5px 8px; border-radius: 7px; color: #813634; background: #f8eee8; font-size: 9px; }
.status { padding: 5px 9px; font-size: 9px; }
.row-actions { gap: 6px; }
.row-action { min-height: 31px; padding: 0 9px; border-color: #e1cec4; border-radius: 8px; background: #fffaf6; font-size: 9px; }
.row-action:hover { border-color: #cda99b; background: #fff; }

.store-grid { gap: 18px; }
.store-card { border-color: rgba(111,75,60,.1); border-radius: 18px; background: rgba(255,254,251,.84); }
.store-copy { padding: 27px; }
.store-copy h2 { font-size: 23px; }
.store-copy > p { color: #6f645f; font-size: 11px; }
.store-meta { font-size: 10px; line-height: 1.65; }
.banner-list article { min-height: 96px; grid-template-columns: 92px 42px minmax(0,1fr) auto auto; }
.banner-thumb { width: 92px; height: 60px; border-radius: 10px; }
.banner-list strong { font-size: 12px; }
.banner-list small { font-size: 9px; }
.product-grid { padding: 20px; gap: 16px; }
.product-card { min-height: 174px; padding: 14px; grid-template-columns: 132px 1fr; gap: 17px; border-color: var(--line); border-radius: 15px; background: rgba(255,255,255,.76); }
.product-card:hover { border-color: rgba(153,66,55,.18); box-shadow: 0 10px 25px rgba(85,49,35,.055); transform: translateY(-1px); }
.product-art, .product-art img, .product-image { min-height: 144px; }
.product-card h3 { font-size: 19px; }
.product-card p { font-size: 10px; }
.product-card footer strong { font-size: 19px; }

.detail-drawer { width: min(640px, 92vw); background: #fffdfa; box-shadow: -24px 0 70px rgba(52,29,23,.16); }
.detail-drawer > header { min-height: 91px; padding: 23px 27px 18px; }
.detail-drawer h2, .dialog h2 { font-size: 28px; }
.drawer-body { padding: 27px; }
.drawer-footer { min-height: 78px; padding: 15px 27px; background: #fbf7f2; }
.detail-hero { border: 1px solid rgba(139,47,45,.12); color: var(--ink-900); background: linear-gradient(135deg, #f9e9e4, #fffaf4); }
.detail-hero > span { color: #9e4d47; }
.detail-hero h3 { color: var(--wine-900); }
.detail-hero p { color: var(--ink-600); }
.dialog { border: 1px solid rgba(255,255,255,.8); border-radius: 20px; background: #fffdfa; box-shadow: 0 30px 100px rgba(53,21,17,.2); }
.dialog::backdrop { background: rgba(47,32,27,.32); backdrop-filter: blur(7px); }
.dialog form > header { padding: 26px 30px 20px; }
.dialog header p:last-child { font-size: 10px; }
.dialog form > footer { min-height: 74px; background: #fbf7f2; }
.dialog label { color: #655a55; font-size: 11px; }
.dialog input, .dialog select, .dialog textarea { min-height: 44px; border-color: var(--line-strong); border-radius: 10px; font-size: 11px; }
.rich-editor { border-color: var(--line-strong); }
.rich-toolbar { min-height: 46px; background: #f9f4ee; }
.rich-toolbar button { font-size: 10px; }
#richEditor { font-size: 12px; }

.login-screen {
  grid-template-columns: minmax(480px, 1.1fr) minmax(420px, .9fr);
  background:
    radial-gradient(circle at 82% 20%, rgba(210,174,148,.18), transparent 30%),
    linear-gradient(125deg, #f9f4ed, #fffdfa);
}
.login-story {
  position: relative;
  margin: 18px;
  padding: clamp(60px, 8vw, 125px);
  border-radius: 30px;
  color: var(--wine-900);
  background:
    linear-gradient(135deg, rgba(255,255,255,.55), rgba(255,248,242,.28)),
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.72), transparent 30%),
    #e9d9cf;
  box-shadow: var(--shadow-raised);
}
.login-story::after { position: absolute; inset: 18px auto 18px 18px; width: calc(55% - 18px); border-radius: 30px; content: ""; pointer-events: none; background: repeating-linear-gradient(118deg, transparent 0 76px, rgba(108,59,45,.035) 77px, transparent 78px 154px); }
.login-story > * { position: relative; z-index: 1; }
.login-story img { width: 285px; filter: none; }
.login-story p { color: #a45e52; font-size: 11px; }
.login-story h1 { color: #4a1e1c; }
.login-story span { color: #76645c; font-size: 12px; }
.login-card { padding: 44px; border-color: rgba(120,78,61,.1); border-radius: 22px; background: rgba(255,254,251,.82); box-shadow: var(--shadow-raised); backdrop-filter: blur(16px); }
.login-card h2 { font-size: 31px; }
.login-card > p.muted, .login-card label { font-size: 11px; }
.login-card input { height: 48px; border-color: var(--line-strong); border-radius: 11px; }
.login-card small { font-size: 9px; }

@media (max-width: 1320px) {
  .global-search { width: min(390px, 30vw); }
  .topbar-operator strong { display: none; }
  .metric-grid { gap: 12px; }
  .metric-card { padding: 21px 19px; }
  .metric-card strong { font-size: 34px; }
}

@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 100px minmax(0, 1fr); }
  .workspace { grid-column: 2; padding-top: 90px; }
  .sidebar { width: 76px; padding: 24px 11px 18px; border-radius: 24px; }
  .topbar { padding-left: 112px; }
  .brand { padding-inline: 1px; }
  .brand img { width: 50px; height: 42px; object-fit: cover; object-position: left; }
  .brand span, .brand i, .main-nav > p, .nav-item span, .nav-item b, .role-card, .operator div, .operator button { display: none; }
  .nav-item { padding: 0; grid-template-columns: 1fr; justify-items: center; }
  .nav-item i { width: 34px; height: 34px; }
  .operator { grid-template-columns: 1fr; justify-items: center; }
  .global-search { left: calc(50% + 50px); width: 34vw; }
  .dashboard-layout { grid-template-columns: 1fr; }
  .ranking-list { grid-template-columns: repeat(2, 1fr); column-gap: 18px; }
  .store-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .topbar-operator { display: none; }
  .global-search { left: auto; right: 85px; width: 32vw; transform: none; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .queue-grid { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: 1fr; }
  .login-screen { grid-template-columns: 1fr; }
  .login-story { display: none; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .workspace { width: 100%; padding-top: 68px; }
  .sidebar { inset: 8px auto 8px 8px; width: min(300px, calc(100vw - 28px)); height: calc(100dvh - 16px); padding: 25px 18px 20px; border-radius: 24px; transform: translateX(calc(-100% - 12px)); }
  .sidebar.is-open { transform: translateX(0); }
  .brand { padding-inline: 10px; align-items: center; }
  .brand img { width: 160px; height: auto; object-fit: initial; }
  .brand span, .brand i, .main-nav > p, .nav-item span, .nav-item b, .role-card, .operator div, .operator button { display: initial; }
  .role-card { display: grid; }
  .nav-item { min-height: 47px; padding: 0 11px; grid-template-columns: 31px 1fr auto; justify-items: stretch; }
  .operator { grid-template-columns: 36px 1fr auto; justify-items: stretch; }
  .operator button { display: inline-flex; }
  .topbar { height: 68px; padding: 0 13px; }
  .desktop-menu { display: none; }
  .mobile-menu { display: grid; align-content: center; gap: 4px; width: 41px; height: 41px; padding: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.72); }
  .mobile-menu span { width: 19px; }
  .branch-switcher { min-height: 41px; padding-inline: 11px; font-size: 10px; }
  .branch-switcher > span { font-size: 15px; }
  .branch-menu { position: fixed; top: 61px; left: 62px; width: min(250px, calc(100vw - 76px)); max-height: min(330px, calc(100dvh - 78px)); }
  .global-search, .icon-button, .topbar-operator { display: none; }
  .topbar-create { display: inline-flex; min-height: 39px; padding-inline: 12px; font-size: 10px; }
  main { padding: 22px 13px 32px; }
  .page-heading { min-height: 74px; margin-bottom: 16px; }
  .page-heading h1 { font-size: 30px; }
  .page-heading > div > p:last-child { font-size: 10px; }
  .dashboard-heading { flex-wrap: wrap; }
  .dashboard-actions { width: 100%; padding-top: 2px; justify-content: flex-start; }
  .dashboard-actions .live-chip { display: none; }
  .dashboard-date { height: 40px; }
  .dashboard-date input { width: 112px; font-size: 10px; }
  .metric-grid { margin-top: 12px; gap: 9px; }
  .metric-card { min-height: 144px; padding: 17px; border-radius: 15px; }
  .metric-card header { font-size: 10px; }
  .metric-card header i { width: 39px; height: 39px; font-size: 20px; }
  .metric-card strong { margin-top: 3px; font-size: 29px; }
  .metric-card p { font-size: 9px; }
  .trend-chart { height: 250px; padding-inline: 13px; }
  .ranking-list { grid-template-columns: 1fr; }
  .queue-grid { gap: 9px; }
  .queue-grid > button { min-height: 88px; padding: 14px 16px; grid-template-columns: 46px 1fr auto; }
  .queue-icon { width: 46px; height: 46px; }
  .filters { align-items: stretch; }
  .search-field { min-width: 100%; }
  .summary-grid { gap: 8px; }
  .summary-grid article { min-height: 105px; padding: 15px 12px; }
  .summary-grid strong { font-size: 27px; }
  .store-card { grid-template-columns: 1fr; }
  .product-card { grid-template-columns: 104px 1fr; }
  .product-art, .product-art img, .product-image { min-height: 126px; }
  .dialog { border-radius: 16px; }
}

@media (max-width: 480px) {
  .page-heading { gap: 12px; }
  .heading-actions { max-width: 155px; }
  .dashboard-actions { max-width: none; }
  .metric-card { min-width: 0; }
  .metric-card strong { font-size: 25px; }
  .metric-card p { white-space: nowrap; }
  .summary-grid { grid-template-columns: repeat(3, minmax(112px, 1fr)); }
  .product-card { grid-template-columns: 92px 1fr; }
}

/* Unified identity and form system */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.operator-card {
  margin-top: auto;
  padding: 11px 10px;
  border: 1px solid rgba(126, 80, 63, .12);
  border-radius: 15px;
  grid-template-columns: 38px minmax(0, 1fr) 30px;
  gap: 10px;
  background: linear-gradient(145deg, rgba(255,255,255,.9), rgba(247,239,231,.82));
  box-shadow: 0 10px 28px rgba(92, 55, 43, .08);
}

.operator-card > span {
  width: 38px;
  height: 38px;
}

.operator-card__identity {
  min-width: 0;
  gap: 4px !important;
}

.operator-card__identity strong,
.operator-card__identity small span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operator-card__identity small {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.operator-card__identity small span:last-child {
  min-width: 0;
}

.operator-card__identity em {
  color: #c7aaa0;
  font-style: normal;
}

.operator-card button {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  justify-content: center;
}

.operator-card button span { display: none; }
.operator-card button:hover { border-color: var(--line); background: rgba(255,255,255,.86); }

:root {
  --form-height: 46px;
  --form-radius: 11px;
  --form-border: #ddd0c7;
  --form-border-hover: #c8aaa0;
  --form-surface: #fffefa;
  --form-muted: #f8f3ed;
  --form-focus: rgba(143, 53, 54, .14);
}

.dialog label,
.login-card label,
.upload-group > label {
  margin-bottom: 16px;
  gap: 8px;
  color: #544b47;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .015em;
}

.dialog input:not([type="checkbox"]):not([type="file"]),
.dialog select,
.dialog textarea,
.login-card input,
.filters select,
.filters input,
.date-field,
.search-field {
  min-height: var(--form-height);
  border: 1px solid var(--form-border);
  border-radius: var(--form-radius);
  color: var(--ink-900);
  background-color: var(--form-surface);
  box-shadow: 0 1px 0 rgba(84, 50, 38, .02);
  font-size: 11px;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.dialog input:not([type="checkbox"]):not([type="file"]),
.dialog select,
.login-card input {
  height: var(--form-height);
  padding: 0 13px;
}

.dialog textarea {
  min-height: 96px;
  padding: 12px 13px;
  line-height: 1.7;
}

.dialog input::placeholder,
.dialog textarea::placeholder,
.login-card input::placeholder,
.filters input::placeholder { color: #a89c96; }

.dialog input:not([type="checkbox"]):not([type="file"]):hover,
.dialog select:hover,
.dialog textarea:hover,
.login-card input:hover,
.filters select:hover,
.filters input:hover,
.date-field:hover,
.search-field:hover { border-color: var(--form-border-hover); }

.dialog input:not([type="checkbox"]):not([type="file"]):focus,
.dialog select:focus,
.dialog textarea:focus,
.login-card input:focus,
.filters select:focus,
.filters input:focus,
.date-field:focus,
.search-field:focus-within {
  border-color: var(--wine-700);
  outline: 0;
  background-color: #fff;
  box-shadow: 0 0 0 3px var(--form-focus);
}

.dialog input:disabled,
.dialog select:disabled,
.dialog textarea:disabled,
.login-card input:disabled {
  color: var(--ink-400);
  background: #f2efeb;
  cursor: not-allowed;
}

.dialog select,
.filters select {
  padding-right: 34px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #856f67 50%), linear-gradient(135deg, #856f67 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 12px) 50%;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}

.form-grid {
  gap: 0 16px;
}

.dialog fieldset {
  margin: 2px 0 16px;
  padding: 14px;
  border: 1px solid var(--form-border);
  border-radius: 12px;
  background: rgba(249, 245, 240, .55);
}

.dialog fieldset legend {
  padding: 0 7px;
  color: #75645d;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
}

.check-grid {
  gap: 9px 12px;
}

.check-grid label,
.switch-label,
.config-fields label > span {
  min-height: 30px;
  margin: 0;
  gap: 8px;
  color: var(--ink-600);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
}

.dialog input[type="checkbox"] {
  width: 17px;
  min-width: 17px;
  height: 17px;
  min-height: 17px;
  margin: 0;
  border: 1px solid #cbbcb3;
  border-radius: 5px;
  appearance: none;
  background: #fff;
  display: inline-grid;
  place-content: center;
  transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}

.dialog input[type="checkbox"]::before {
  width: 8px;
  height: 4px;
  border: solid white;
  border-width: 0 0 2px 2px;
  content: "";
  transform: translateY(-1px) rotate(-45deg) scale(0);
  transition: transform .12s ease;
}

.dialog input[type="checkbox"]:checked {
  border-color: var(--wine-700);
  background: linear-gradient(145deg, #aa5753, #7d302e);
}

.dialog input[type="checkbox"]:checked::before { transform: translateY(-1px) rotate(-45deg) scale(1); }
.dialog input[type="checkbox"]:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--form-focus); }

.upload-field {
  gap: 8px;
}

.upload-field .button,
.upload-actions .button {
  min-height: var(--form-height);
  border-radius: var(--form-radius);
}

.upload-group,
.certificate-editor,
.config-fields,
.category-manager {
  border-color: var(--form-border);
}

.rich-editor {
  border-color: var(--form-border);
  border-radius: 12px;
  background: var(--form-surface);
  transition: border-color .18s ease, box-shadow .18s ease;
}

.rich-editor:focus-within {
  border-color: var(--wine-700);
  box-shadow: 0 0 0 3px var(--form-focus);
}

.rich-toolbar {
  min-height: var(--form-height);
  padding: 6px 8px;
  border-bottom-color: var(--form-border);
  gap: 5px;
  background: var(--form-muted);
}

.rich-toolbar button {
  min-width: 34px;
  height: 32px;
  border-radius: 8px;
  font-size: 10px;
}

.rich-toolbar button:hover,
.rich-toolbar button:focus-visible {
  border-color: var(--form-border-hover);
  outline: 0;
  background: white;
}

#richEditor {
  min-height: 260px;
  padding: 17px;
  color: var(--ink-900);
  line-height: 1.75;
  outline: 0;
}

.certificate-editor {
  border-radius: 14px;
  background: var(--form-muted);
}

.certificate-item,
.certificate-asset {
  border-color: var(--form-border);
  border-radius: 11px;
}

.config-fields {
  display: grid;
  gap: 0;
}

.compact-dialog form > label,
.config-fields,
.category-manager {
  padding: 24px 28px;
}

.filters {
  gap: 10px;
  background: rgba(250,247,243,.48);
}

.filters select,
.date-field,
.search-field {
  height: 42px;
  min-height: 42px;
  background-color: rgba(255,255,255,.92);
}

.dialog form > footer {
  border-top-color: var(--form-border);
  background: #faf6f1;
}

@media (max-width: 1120px) {
  .operator-card { grid-template-columns: 1fr; justify-items: center; padding: 10px 7px; }
  .operator-card__identity, .operator-card button { display: none; }
}

@media (max-width: 760px) {
  .operator-card { grid-template-columns: 38px minmax(0, 1fr) 30px; justify-items: stretch; }
  .operator-card__identity { display: flex; }
  .operator-card button { display: inline-flex; }
  .form-grid { grid-template-columns: 1fr; }
  .compact-dialog form > label, .config-fields, .category-manager { padding-inline: 18px; }
}

/* Refined date controls */
.date-field {
  position: relative;
  width: 168px;
  height: 50px;
  min-height: 50px;
  padding: 5px 34px 5px 6px;
  border: 1px solid #dfd2c9;
  border-radius: 13px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  color: var(--ink-900);
  background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(252,248,243,.92));
  box-shadow: 0 6px 18px rgba(90, 55, 43, .055), inset 0 1px 0 rgba(255,255,255,.9);
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background-color .18s ease;
}

.date-field::after {
  position: absolute;
  right: 14px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid #927c72;
  border-bottom: 1.5px solid #927c72;
  content: "";
  pointer-events: none;
  transform: translateY(-65%) rotate(45deg);
  transition: border-color .18s ease, transform .18s ease;
}

.date-field:hover {
  border-color: #cbaea3;
  background: #fff;
  box-shadow: 0 9px 22px rgba(90, 55, 43, .08), inset 0 1px 0 #fff;
  transform: translateY(-1px);
}

.date-field:focus-within {
  border-color: var(--wine-700);
  outline: 0;
  background: #fff;
  box-shadow: 0 0 0 3px var(--form-focus), 0 9px 22px rgba(90, 55, 43, .08);
}

.date-field:focus-within::after {
  border-color: var(--wine-700);
  transform: translateY(-35%) rotate(225deg);
}

.date-field__icon {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(157, 92, 79, .12);
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--wine-700);
  background: linear-gradient(145deg, #fbefea, #f4e3dc);
}

.date-field__icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.date-field__content {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 1px;
}

.date-field__content small {
  color: #9a8880;
  font-size: 8px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .06em;
}

.filters .date-field input[type="date"],
.date-field input[type="date"] {
  position: relative;
  width: 100%;
  height: 20px;
  min-height: 20px;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  color: #493c37;
  background: transparent;
  box-shadow: none;
  font-family: inherit;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  line-height: 20px;
  letter-spacing: .015em;
  cursor: pointer;
  appearance: none;
}

.date-field input[type="date"]:focus,
.filters .date-field input[type="date"]:focus {
  border: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
}

.date-field input[type="date"]::-webkit-datetime-edit {
  padding: 0;
}

.date-field input[type="date"]::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
}

.date-field input[type="date"]::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.date-field--dashboard {
  width: 184px;
  height: 50px;
  min-height: 50px;
  box-shadow: var(--shadow);
}

.date-field--dashboard .date-field__icon {
  color: #8d3536;
  background: linear-gradient(145deg, #fbede8, #f2ded7);
}

input[type="date"] { color-scheme: light; }

/* Compact operational lists */
.list-panel {
  border-color: #e7ddd7;
  border-radius: 12px;
  background: #fffdfa;
  box-shadow: 0 2px 10px rgba(71, 47, 39, .045);
  backdrop-filter: none;
}

.list-toolbar {
  min-height: 62px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(250, 247, 243, .72);
}

.list-toolbar h1 {
  margin: 0;
  color: #3f3531;
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
}

.list-toolbar .heading-actions { padding-top: 0; }
.list-toolbar .button { min-height: 36px; }
.list-panel .filters { min-height: 66px; padding: 11px 18px; }

/* Search is a single control: the input itself must never inherit filter borders. */
.search-field,
.global-search {
  box-sizing: border-box;
  gap: 10px;
}

.search-field {
  flex: 0 1 280px;
  padding: 0 13px;
}

.search-field__icon,
.global-search .search-field__icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: grid;
  place-items: center;
  color: #8f7b73;
  font-size: 0;
  line-height: 0;
  transform: none;
  transition: color .18s ease;
}

.search-field__icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.filters .search-field input[type="search"],
.global-search input[type="search"] {
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  color: #493c37;
  background: transparent;
  box-shadow: none;
  font: inherit;
  font-size: 11px;
  line-height: 1.4;
  appearance: none;
}

.filters .search-field input[type="search"]:hover,
.filters .search-field input[type="search"]:focus,
.global-search input[type="search"]:hover,
.global-search input[type="search"]:focus {
  border: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
}

.search-field:focus-within .search-field__icon,
.global-search:focus-within .search-field__icon { color: var(--wine-700); }

.filters .search-field input[type="search"]::-webkit-search-decoration,
.filters .search-field input[type="search"]::-webkit-search-cancel-button,
.global-search input[type="search"]::-webkit-search-decoration,
.global-search input[type="search"]::-webkit-search-cancel-button { appearance: none; }

#view-stores .page-heading,
#view-campaigns .page-heading {
  min-height: 62px;
  margin-bottom: 14px;
  align-items: center;
}

#view-stores .page-heading .eyebrow,
#view-campaigns .page-heading .eyebrow,
#view-stores .page-heading > div > p:last-child,
#view-campaigns .page-heading > div > p:last-child { display: none; }

#view-stores .page-heading h1,
#view-campaigns .page-heading h1 {
  margin: 0;
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
}

@media (max-width: 760px) {
  .list-toolbar { min-height: 56px; padding: 9px 12px; }
  .list-toolbar h1 { font-size: 16px; }
  .list-toolbar .heading-actions { max-width: none; gap: 7px; }
  .list-toolbar .button { min-height: 34px; padding-inline: 10px; font-size: 9px; }
  .list-panel .filters { padding: 10px 12px; }

  .date-field,
  .date-field--dashboard {
    width: 160px;
    height: 46px;
    min-height: 46px;
    grid-template-columns: 32px minmax(0, 1fr);
    padding-left: 5px;
    border-radius: 12px;
  }

  .date-field__icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
  }

  .date-field__content small { font-size: 7px; }
  .date-field input[type="date"] { font-size: 10px; }
}
