:root {
  font-family: Tahoma, "Segoe UI", sans-serif;
  color: #f7f8ff;
  background: #080d1b;
  font-size: 15px;
  line-height: 1.5;
  color-scheme: dark;
  --bg: #080d1b;
  --surface: #121b32;
  --surface-2: #192642;
  --line: #304363;
  --muted: #a9bbd6;
  --purple: #ad9bff;
  --blue: #7ac5ff;
  --gold: #ffd573;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at 75% -20%, #1b2762 0, transparent 38%), var(--bg); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
img { max-width: 100%; }
.eyebrow { margin: 0 0 8px; color: #b5a8ff; font-size: .73rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.muted, .helper { color: var(--muted); }
.helper { margin: 12px 0; }
.error { color: #ffc5ce; min-height: 1.4em; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 26px; }
.login-shell { width: min(100%, 940px); display: grid; grid-template-columns: minmax(340px, 440px) 1fr; border: 1px solid #35466d; border-radius: 28px; overflow: hidden; background: #111a31; box-shadow: 0 30px 90px #020713bb; }
.login-card { position: relative; padding: clamp(28px, 4vw, 50px); display: flex; flex-direction: column; justify-content: center; }
.login-card .login-mobile-mascot { display: none; }
.login-logo { width: 72px; height: 72px; object-fit: cover; border-radius: 18px; margin-bottom: 25px; box-shadow: 0 9px 30px #0005; }
.login-card h1 { font-size: clamp(1.85rem, 3vw, 2.3rem); line-height: 1.2; margin: 0 0 7px; }
.login-intro { color: var(--muted); margin: 0 0 25px; }
.login-card label { margin: 0 0 17px; }
.login-password { margin-bottom: 17px; }
.login-card .login-password label { margin: 0 0 6px; }
.password-input { position: relative; }
.password-input input { padding-right: 58px; }
.password-toggle { position: absolute; inset-block: 0; right: 2px; display: grid; place-items: center; width: 48px; border: 0; border-radius: 9px; background: transparent; color: #b8c9e7; }
.password-toggle:hover { background: #26395b; color: #fff; }
.password-toggle:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.password-toggle svg { width: 23px; height: 23px; }
.login-submit { width: 100%; justify-content: space-between; margin-top: 7px; }
.login-card small { color: #8fa4c3; margin-top: 10px; }
.login-art { position: relative; min-height: 570px; display: flex; align-items: flex-end; overflow: hidden; padding: 38px; background: linear-gradient(0deg, #071126f2 0%, #07112666 45%, #07112644), url('/brand/hero.webp') center/cover; }
.login-art::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, #101a31 0%, transparent 35%); }
.login-art .login-mascot { right: -8px; bottom: 38px; width: min(72%, 320px); }
.login-mascot .welcome-mascot-coin { left: -9%; top: 23%; }
.login-art-copy { position: relative; z-index: 2; display: grid; gap: 8px; max-width: 260px; text-shadow: 0 2px 12px #000; }
.login-art-copy strong { font-size: 2.15rem; line-height: 1.2; }
.login-art-copy > span:last-child { color: #d0dcf8; }

/* App shell */
.topbar { position: sticky; top: 0; z-index: 10; min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 28px; background: #0d1529f5; border-bottom: 1px solid #253957; backdrop-filter: blur(15px); }
.topbar-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.header-logo { width: 48px; height: 48px; border-radius: 13px; flex: none; }
.topbar-title strong, .topbar-title small { display: block; white-space: nowrap; }
.topbar-title strong { font-size: 1.1rem; }
.topbar-title strong span { color: var(--purple); }
.topbar-title small { color: #8ca1c1; font-size: .78rem; }
.topbar-actions { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.layout { display: grid; grid-template-columns: 238px minmax(0, 1fr); min-height: calc(100vh - 76px); }
.sidebar { position: sticky; top: 76px; align-self: start; min-height: calc(100vh - 76px); display: flex; flex-direction: column; gap: 5px; padding: 25px 12px; background: #0e172cf2; border-right: 1px solid #253957; }
.nav-label { color: #7992bc; font-size: .72rem; font-weight: 800; letter-spacing: .14em; margin: 0 13px 12px; }
.sidebar button { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; border-radius: 12px; padding: 12px 14px; color: #b7c5df; background: transparent; text-align: left; font-weight: 700; }
.sidebar button span { width: 24px; text-align: center; font-size: 1.15rem; color: #91aaf0; }
.sidebar button.active, .sidebar button:hover { background: #253763; color: white; }
.sidebar button.active span { color: var(--gold); }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 12px 4px; color: #849bc1; font-size: .8rem; }
.sidebar-foot img { width: 82px; height: 82px; object-fit: contain; }
.content { padding: clamp(20px, 3vw, 36px); max-width: 1520px; width: 100%; margin: 0 auto; }
.tab-panel { animation: appear .18s ease-out; }
@keyframes appear { from { opacity: .5; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Shared components */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 9px 15px; border: 1px solid #486087; border-radius: 11px; background: #213458; color: #f2f5ff; font-weight: 800; white-space: nowrap; }
.button.primary { color: #09132d; border-color: #c2b6ff; background: linear-gradient(135deg, #d5caff, #9ec2ff); box-shadow: 0 5px 18px #7c76f628; }
.button.secondary { background: #253e6a; border-color: #3d6093; }
.button.ghost { background: #17233e; border-color: #314463; }
.button.glass { background: #0e1b38ab; border-color: #c5d6ff8a; }
.button.text-button { background: transparent; border: 0; color: #b8c9e7; }
.button:hover, .shortcut:hover, .text-link:hover { filter: brightness(1.13); }
.button:focus-visible, .sidebar button:focus-visible, .shortcut:focus-visible, .text-link:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
label { display: flex; flex-direction: column; gap: 6px; color: #dce6fa; font-weight: 700; }
input, select, textarea { width: 100%; min-width: 0; border: 1px solid #4a5e81; border-radius: 10px; padding: 10px 12px; background: #0d1930; color: white; }
input::placeholder, textarea::placeholder { color: #8799b7; }
textarea { resize: vertical; }
.checkbox { flex-direction: row; align-items: center; gap: 9px; }
.checkbox input { width: auto; accent-color: #a796ff; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.page-heading h1 { margin: 0; font-size: clamp(1.65rem, 2.5vw, 2.15rem); line-height: 1.2; }
.page-heading p:last-child { margin: 7px 0 0; color: var(--muted); }
.panel, .report-card { background: linear-gradient(155deg, #15213d, #101a2f); border: 1px solid var(--line); border-radius: 19px; padding: 22px; margin-bottom: 18px; box-shadow: 0 12px 28px #03081633; }
.panel h2 { margin: 0 0 16px; font-size: 1.15rem; }
.panel-heading, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.panel-heading h2, .section-heading h2 { margin: 0; }
.panel-heading { margin-bottom: 16px; }
.section-heading { margin: 24px 0 14px; }
.section-heading .eyebrow { margin-bottom: 1px; }
.section-heading h2 { font-size: 1.35rem; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.text-link { border: 0; background: transparent; color: #b8c5ff; font-weight: 800; white-space: nowrap; }
.form-stack { display: grid; gap: 17px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.full { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; }
.sale-groups { display: grid; gap: 18px; }
.sale-group { border: 1px solid #34476b; border-radius: 15px; padding: 18px; background: #192743; }
.sale-group h2 { margin: 0 0 15px; font-size: 1.08rem; color: #d6ddff; }
.toolbar { display: flex; align-items: end; gap: 14px; flex-wrap: wrap; margin: 0 0 18px; }
.toolbar label { min-width: 200px; }
.notice { border: 1px solid #3b907b; border-radius: 12px; background: #174a42; color: #d8fff0; padding: 12px 16px; margin-bottom: 18px; }
.notice.error { border-color: #ac5362; background: #512632; color: #ffe2e7; }
.notice.warning { border-color: #84693a; background: #4a3922; color: #ffedc2; }
.badge { display: inline-flex; align-items: center; border-radius: 100px; padding: 4px 10px; background: #274976; color: #dceaff; font-size: .79rem; font-weight: 800; white-space: nowrap; }
.badge.waiting { background: #735928; color: #ffeabb; }
.badge.in_progress { background: #20577c; color: #cef2ff; }
.badge.completed { background: #205f49; color: #cdffe2; }
.badge.refunded { background: #743b49; color: #ffe1e8; }

/* Dashboard */
.welcome-banner { position: relative; isolation: isolate; display: flex; min-height: 235px; align-items: center; overflow: hidden; padding: 30px 36px; border: 1px solid #354f86; border-radius: 23px; background: linear-gradient(90deg, #101d40 0%, #10214dc9 48%, #0c1d4888), url('/brand/hero.webp') center/cover; box-shadow: 0 18px 35px #02071455; }
.welcome-copy { position: relative; z-index: 2; max-width: 600px; }
.welcome-copy h1 { margin: 0 0 7px; font-size: clamp(1.8rem, 3vw, 2.4rem); }
.welcome-copy > p:not(.eyebrow) { margin: 0 0 21px; color: #d5e0f7; }
.welcome-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.welcome-mascot { position: absolute; z-index: 1; right: 5%; bottom: -36px; width: clamp(180px, 20vw, 235px); aspect-ratio: 320 / 369; pointer-events: none; }
.welcome-mascot-body { position: absolute; inset: 0; transform-origin: 48% 92%; animation: admin-mascot-bob 3.2s ease-in-out infinite; }
.welcome-mascot-frame { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 18px 18px #0009); }
.welcome-mascot-blink { opacity: 0; animation: admin-mascot-blink 5.8s linear infinite; }
.welcome-mascot-coin { position: absolute; z-index: 2; left: -12%; top: 20%; width: 17%; aspect-ratio: 1; border: 3px solid #fff1a8; border-radius: 17%; background: linear-gradient(135deg, #fff2a1 4%, #ffc434 32%, #f18e0f 72%, #ffd958 100%); box-shadow: inset 0 0 0 3px #d4810c, 0 3px 0 #8d4e08, 0 0 18px #ffdc7199; animation: admin-mascot-toss 3.2s ease-in-out infinite; }
.welcome-mascot-coin::before { content: ""; position: absolute; inset: 29%; border: 2px solid #b5690d; background: #51300c; box-shadow: inset 0 1px 2px #160d04; }
.welcome-mascot-sparkle { position: absolute; z-index: 2; width: 8px; height: 8px; background: #fff8c2; box-shadow: 0 0 10px 3px #ffd95f; clip-path: polygon(50% 0, 61% 40%, 100% 50%, 61% 60%, 50% 100%, 39% 60%, 0 50%, 39% 40%); animation: admin-mascot-sparkle 3.2s ease-in-out infinite; }
.sparkle-one { left: 0; top: 12%; }
.sparkle-two { left: 31%; top: 0; animation-delay: -1.3s; }
@keyframes admin-mascot-bob { 0%, 100% { transform: translateY(0) rotate(-1.8deg); } 50% { transform: translateY(-8px) rotate(1.8deg); } }
@keyframes admin-mascot-blink { 0%, 87%, 89%, 92%, 94%, 100% { opacity: 0; } 88%, 90%, 93% { opacity: 1; } }
@keyframes admin-mascot-toss { 0%, 12%, 88%, 100% { transform: translate(12px, 38px) rotate(-12deg) scale(.94); } 44%, 55% { transform: translate(-10px, -22px) rotate(155deg) scale(1.08); } 70% { transform: translate(3px, 10px) rotate(235deg) scale(.98); } }
@keyframes admin-mascot-sparkle { 0%, 100% { opacity: .2; transform: scale(.6); } 45% { opacity: 1; transform: scale(1.4); } }
@media (prefers-reduced-motion: reduce) { .welcome-mascot-body, .welcome-mascot-blink, .welcome-mascot-coin, .welcome-mascot-sparkle { animation: none; } .welcome-mascot-blink { opacity: 0; } .welcome-mascot-coin { transform: translate(0, 4px) rotate(-12deg); } }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { min-height: 112px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; border: 1px solid #344a70; border-radius: 16px; padding: 17px 19px; background: #172541; color: white; text-align: left; }
.stat small { color: #b4c3de; font-weight: 700; }
.stat strong { font-size: 1.95rem; line-height: 1.2; margin-top: 6px; }
.stat[data-stat-tab]:hover { border-color: #9f9cff; background: #22345d; }
.queue-shortcut { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #345276; border-radius: 12px; padding: 11px; margin: 8px 0; background: #1a2b49; color: white; text-align: left; }
.queue-shortcut small { color: var(--muted); }
.shortcut-panel { display: flex; flex-direction: column; }
.shortcut { display: flex; align-items: center; gap: 13px; width: 100%; padding: 12px; border: 1px solid #344668; border-radius: 13px; margin: 5px 0; background: #1a2a49; color: white; text-align: left; }
.shortcut > span:nth-child(2) { display: grid; flex: 1; }
.shortcut small { color: var(--muted); }
.shortcut-icon { width: 41px; height: 41px; display: grid; place-items: center; border-radius: 11px; background: #344b85; color: var(--gold); font-size: 1.3rem; }

/* Products */
.product-toolbar { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #14203a; }
.product-toolbar .search-label { flex: 1 1 320px; }
.result-count { margin: 0 0 12px; color: #abc4ea; font-size: .87rem; font-weight: 700; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 12px 0; }
.pagination:empty { display: none; }
.pagination-pages { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 5px; }
.pagination button { min-width: 40px; min-height: 40px; border: 1px solid #435b7e; border-radius: 10px; padding: 7px 12px; background: #1c2e4c; color: #e6efff; font-weight: 800; cursor: pointer; }
.pagination button:hover:not(:disabled) { border-color: #a9b9ff; background: #2d4170; }
.pagination button.current { border-color: #edcb77; background: #e3bd67; color: #14213a; }
.pagination button:disabled { opacity: .45; cursor: default; }
.pagination-ellipsis { padding: 0 5px; color: #9fafcb; }
.table-wrap { padding: 0; overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 12px 17px; border-bottom: 1px solid #2d405f; }
th { color: #a9bedd; font-size: .8rem; font-weight: 800; background: #17233d; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #1a2a49; }
td { vertical-align: middle; }
td:last-child { text-align: right; }
.product-cell { display: flex; align-items: center; gap: 12px; min-width: 240px; }
.thumb-button { flex: none; border: 0; padding: 0; border-radius: 12px; background: transparent; }
.thumb-button:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.product-thumb { flex: none; width: 56px; height: 56px; object-fit: cover; border: 1px solid #496083; border-radius: 12px; background: #0c1730; }
.product-name { font-weight: 800; line-height: 1.3; }
.product-cell small { color: #91a5c5; }
.price-value { font-weight: 800; white-space: nowrap; }
.product-editor { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 20px; }
.product-editor-image { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.product-editor-image small { color: var(--muted); font-size: .73rem; }
.image-preview { aspect-ratio: 1; display: grid; place-items: center; border: 1px dashed #59719b; border-radius: 16px; overflow: hidden; background: #0d1930; color: #9cacca; text-align: center; }
.image-preview img { width: 100%; height: 100%; object-fit: cover; }
.upload-button { position: relative; cursor: pointer; font-size: .82rem; text-align: center; }
.upload-button input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.advanced-fields { border: 1px solid #344967; border-radius: 12px; padding: 12px 15px; }
.advanced-fields summary { color: #bdcafa; cursor: pointer; font-weight: 700; }
.advanced-fields .form-grid { margin-top: 15px; }

/* Queue, reports and settings */
.queue-list { display: grid; gap: 12px; }
.queue-card { display: grid; grid-template-columns: 1fr auto; gap: 12px; border: 1px solid var(--line); border-radius: 16px; padding: 18px; background: #14213c; }
.queue-card h2 { margin: 0; font-size: 1.1rem; }
.queue-card p { margin: 5px 0; color: var(--muted); }
.queue-card a { color: #aed4ff; text-decoration: underline; }
.queue-card .details { grid-column: 1 / -1; border-top: 1px solid #304262; padding-top: 10px; }
.queue-card .details p { margin: 3px 0; }
.report-card h2 { margin: 0 0 15px; }
.report-numbers { display: flex; flex-wrap: wrap; gap: 10px; }
.report-numbers div { min-width: 140px; border-radius: 11px; padding: 10px 13px; background: #203353; }
.report-numbers small { display: block; color: #acbfdd; }
.report-numbers strong { font-size: 1.06rem; }
.ranking { padding-left: 22px; line-height: 1.9; }
.report-overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.report-summary-card { min-width: 0; display: grid; align-content: center; gap: 7px; min-height: 130px; padding: 17px 19px; border: 1px solid #405684; border-radius: 17px; background: radial-gradient(circle at 100% 0, #5367c633, transparent 60%), linear-gradient(150deg, #1c2c50, #131f38); box-shadow: 0 12px 25px #03081625; }
.report-summary-card.attention { border-color: #786142; background: radial-gradient(circle at 100% 0, #e3aa4933, transparent 60%), linear-gradient(150deg, #30283a, #191e33); }
.report-summary-card > span { color: #c3d3f2; font-size: .82rem; font-weight: 800; }
.report-summary-card strong { font-size: clamp(1.4rem, 2.1vw, 2rem); line-height: 1.15; letter-spacing: -.035em; }
.report-summary-card small { color: #a9bddc; line-height: 1.5; }
.report-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.report-chart-card, .report-top-card { min-width: 0; padding: 20px; border: 1px solid #344b75; border-radius: 19px; background: radial-gradient(circle at 100% 0, #334a8a40, transparent 52%), linear-gradient(160deg, #192844, #111b31); box-shadow: 0 12px 28px #03081633; }
.report-chart-card:first-child { grid-column: 1 / -1; }
.report-chart-heading, .report-top-heading { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.report-chart-heading > div { display: grid; gap: 5px; }
.report-chart-kicker { color: #a9b6ff; font-size: .78rem; font-weight: 800; letter-spacing: .04em; }
.report-chart-heading strong { color: #f7fbff; font-size: clamp(1.45rem, 2vw, 1.9rem); line-height: 1.15; }
.report-chart-range { color: #a6b7d5; font-size: .76rem; text-align: right; }
.report-chart { display: block; width: 100%; height: auto; margin-top: 15px; overflow: visible; }
.chart-grid-line { stroke: #33496b; stroke-dasharray: 4 6; stroke-width: 1; }
.chart-zero-line { stroke: #7997c3; stroke-width: 1.3; }
.chart-axis-text { fill: #a7b9d8; font-size: 10px; font-family: Tahoma, "Segoe UI", sans-serif; }
.chart-bar { fill: url(#chart-day); transition: opacity .18s ease; }
.report-chart-card:nth-child(2) .chart-bar { fill: url(#chart-month); }
.report-chart-card:nth-child(3) .chart-bar { fill: url(#chart-year); }
.chart-bar.negative { fill: #ff919c; }
.chart-bar:hover { opacity: .7; }
.report-chart-note { margin: 10px 0 0; color: #95aacc; font-size: .76rem; }
.report-chart-empty { display: grid; place-items: center; min-height: 150px; margin: 15px 0 0; border: 1px dashed #435576; border-radius: 12px; color: #aabbd7; text-align: center; }
.report-top-products { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.report-top-heading h3 { margin: 2px 0 0; font-size: 1.2rem; }
.report-top-list { display: grid; gap: 15px; padding: 0; margin: 20px 0; list-style: none; }
.report-top-list li { display: flex; align-items: center; gap: 12px; min-width: 0; }
.report-rank { display: grid; place-items: center; flex: none; width: 29px; height: 29px; border-radius: 9px; background: #30466e; color: #d5e1ff; font-weight: 900; }
.report-top-list li:first-child .report-rank { color: #221b11; background: linear-gradient(135deg, #fff0aa, #f8c969); }
.report-top-item { flex: 1; min-width: 0; }
.report-top-line { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 7px; font-size: .82rem; }
.report-top-line strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-top-line span { flex: none; color: #b4c6e2; }
.report-top-track { height: 7px; overflow: hidden; border-radius: 50px; background: #2a3b5c; }
.report-top-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8d9aff, #81d9f1); }
.report-empty { min-height: 155px; display: grid; place-items: center; margin: 10px 0; color: #b4c5df; text-align: center; }
.report-period-control { min-width: 160px; }
.report-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.report-detail-grid > section { min-width: 0; }
.report-detail-grid > section > h3 { margin: 0 0 12px; font-size: 1rem; color: #cbd9f3; }
.report-detail-grid .report-card { padding: 17px; }
.report-detail-grid .report-card h2 { color: #ddd4ff; font-size: 1.06rem; }
.report-detail-grid .report-numbers div { min-width: 0; flex: 1 1 135px; }
.report-detail-grid .ranking { max-height: 225px; overflow-y: auto; }
.audit-list { max-height: 320px; overflow: auto; }
.audit-row { border-bottom: 1px solid #30415e; padding: 9px 0; }
.audit-row small { color: #9daecb; margin-right: 10px; }
code { word-break: break-all; }

/* Dialogs */
.dialog { width: min(94vw, 720px); max-height: 92vh; overflow: auto; border: 1px solid #536a94; border-radius: 21px; padding: 25px; background: #14203a; color: white; box-shadow: 0 30px 75px #000a; }
.dialog.wide { width: min(95vw, 900px); }
.dialog::backdrop { background: #010614cf; }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 15px; border-bottom: 1px solid #34476a; padding-bottom: 14px; }
.dialog-heading h2 { margin: 0; }
.icon-button { border: 0; background: transparent; color: white; font-size: 1.8rem; line-height: 1; }
.subheading { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.subheading h3 { margin: 0; }
.order-items { display: grid; gap: 10px; }
.order-item { display: grid; grid-template-columns: 2fr 1fr 80px 105px 100px auto; align-items: end; gap: 8px; border-radius: 12px; padding: 12px; background: #213151; }
.order-item label { font-size: .79rem; }
.order-item button { height: 43px; }
.total-box { margin: 0; border-radius: 12px; padding: 13px; background: #2c4168; font-weight: 800; text-align: right; }
.payment-panel { display: grid; gap: 12px; padding: 18px; border: 1px solid #527094; border-radius: 14px; background: #1b2d47; }
.payment-panel[hidden] { display: none; }
.payment-panel h3, .payment-panel p { margin: 0; }
.heading-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.heading-actions .button { min-height: 44px; }
#cart-import-dialog textarea { min-height: 220px; width: 100%; }
#import-summary:not([hidden]) { margin: 0; padding: 12px 14px; border: 1px solid #527094; border-radius: 10px; background: #1b2d47; }
.badge.payment-verified { background: #145a46; color: #d6ffeb; }
.badge.payment-reported { background: #674d20; color: #ffe6b3; }
.badge.payment-awaiting, .badge.payment-unknown { background: #42495d; color: #e4eaf7; }
.install-panel p { max-width: 720px; }

@media (max-width: 1050px) {
  .report-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-detail-grid { grid-template-columns: 1fr; }
  .topbar { position: relative; }
  .layout { display: block; }
  .sidebar { position: sticky; top: 0; z-index: 8; min-height: 0; flex-direction: row; overflow-x: auto; padding: 8px 14px; border-right: 0; border-bottom: 1px solid #263957; }
  .sidebar button { width: auto; white-space: nowrap; }
  .nav-label, .sidebar-foot { display: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-item { grid-template-columns: 2fr 1fr 80px; }
}
@media (max-width: 820px) {
  .sidebar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; overflow: visible; padding: 7px 12px; }
  .sidebar button { min-width: 0; justify-content: center; white-space: normal; text-align: center; }
}
@media (max-width: 720px) {
  .report-charts, .report-top-products { grid-template-columns: 1fr; }
  .report-chart-card:first-child { grid-column: auto; }
  .topbar { padding: 11px 16px; flex-wrap: wrap; }
  .topbar-actions { width: 100%; }
  .topbar-actions .button { flex: 1; font-size: .8rem; padding: 8px; }
  .sidebar { top: 0; }
  .content { padding: 18px; }
  .welcome-banner { min-height: 215px; padding: 24px; }
  .welcome-copy { max-width: 72%; }
  .welcome-mascot { right: -20px; bottom: -25px; width: 200px; opacity: .85; }
  .two-col, .form-grid { grid-template-columns: 1fr; }
  .full { grid-column: 1; }
  .page-heading { align-items: start; flex-direction: column; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; }
  .product-editor { grid-template-columns: 130px minmax(0, 1fr); gap: 14px; }
  .order-item { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-item > :first-child { grid-column: 1 / -1; }
  .order-item button { grid-column: 1 / -1; }
}
@media (max-width: 540px) {
  .report-overview { gap: 9px; }
  .report-summary-card { min-height: 112px; padding: 13px; }
  .report-summary-card strong { font-size: 1.3rem; }
  .report-summary-card small { font-size: .71rem; }
  .report-chart-card, .report-top-card { padding: 16px 13px; }
  .report-chart-range { max-width: 95px; }
  .report-top-line { display: grid; gap: 1px; }
  .report-top-line span { font-size: .76rem; }
  .topbar { padding: calc(10px + env(safe-area-inset-top)) 14px 10px; }
  .header-logo { width: 43px; height: 43px; }
  .topbar-title strong { font-size: 1rem; }
  .topbar-actions { gap: 6px; }
  .topbar-actions .button { min-height: 42px; font-size: .73rem; }
  .sidebar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; overflow: visible; padding: 7px 10px; }
  .sidebar button { justify-content: center; gap: 4px; min-height: 48px; padding: 6px 4px; white-space: normal; text-align: center; font-size: .72rem; line-height: 1.15; }
  .sidebar button span { width: auto; flex: none; font-size: 1rem; }
  .content { padding: 18px 14px calc(25px + env(safe-area-inset-bottom)); }
  .login-wrap { padding: 14px; }
  .login-shell { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-card { min-height: 520px; padding: 28px; }
  .login-card .login-mobile-mascot { display: block; top: 12px; right: 13px; bottom: auto; width: 96px; opacity: .9; }
  .login-card .login-mobile-mascot .welcome-mascot-coin { left: -13%; top: 22%; }
  .welcome-copy { max-width: 100%; }
  .welcome-mascot { opacity: .22; right: -30px; }
  .stats { gap: 9px; }
  .stat { min-height: 92px; padding: 13px; }
  .stat strong { font-size: 1.55rem; }
  .toolbar label { min-width: 0; width: 100%; }
  .product-toolbar { align-items: stretch; }
  .product-toolbar .checkbox { width: auto; }
  .pagination { justify-content: center; }
  .pagination-pages { order: -1; width: 100%; }
  table, tbody { display: block; }
  thead { display: none; }
  tbody tr { display: grid; grid-template-columns: 1fr auto; gap: 5px; padding: 13px; border-bottom: 1px solid #2d405f; }
  tbody td { border: 0; padding: 3px; }
  tbody td:first-child { grid-column: 1 / -1; }
  tbody td:nth-child(2) { color: var(--muted); font-size: .82rem; }
  tbody td:nth-child(3) { text-align: right; }
  tbody td:nth-child(4) { align-self: center; }
  tbody td:last-child { text-align: right; }
  .product-editor { grid-template-columns: 1fr; }
  .product-editor-image { display: grid; grid-template-columns: 105px 1fr; align-items: center; }
  .product-editor-image .image-preview { grid-row: span 2; }
  .dialog { width: calc(100% - 16px); max-height: calc(100dvh - 16px - env(safe-area-inset-top)); padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
  .dialog.wide { width: calc(100% - 16px); }
  .dialog .form-actions { position: sticky; bottom: calc(-18px - env(safe-area-inset-bottom)); z-index: 2; margin: 0 -16px calc(-18px - env(safe-area-inset-bottom)); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: #14203af2; border-top: 1px solid #34476a; }
  .dialog .form-actions .button { flex: 1; }
  .order-item > :nth-child(2) { grid-column: 1 / -1; }
  .queue-card { grid-template-columns: 1fr; }
  .queue-card .details { grid-column: 1; }
  .subheading { align-items: start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { .tab-panel { animation: none; } }
