.topbar { position: sticky; z-index: 30; top: 0; height: 72px; padding: 0 max(32px, calc((100vw - 1540px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 28px; background: #11151e; color: #fff; box-shadow: 0 8px 26px rgba(7,10,16,.16); }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; font-weight: 800; white-space: nowrap; }
.brand small { display: block; margin-top: 3px; color: #9ba5b7; font-size: 8px; letter-spacing: .18em; }
.brand-mark { width: 38px; height: 38px; padding: 5px; display: grid; place-items: center; border-radius: 9px; background: #fff; overflow: hidden; }
.brand-mark img { width: 27px; height: 27px; object-fit: contain; }
.primary-nav { display: flex; align-items: center; gap: 10px; }
.primary-nav a { padding: 10px 18px; border: 1px solid rgba(255,255,255,.16); border-radius: 9px; color: #c8ced9; text-decoration: none; font-size: 14px; font-weight: 800; }
.primary-nav a:hover { color: #fff; border-color: rgba(255,255,255,.35); }
.primary-nav a.active { border-color: var(--gold); background: var(--gold); color: var(--dark); }

.page-shell { width: min(1540px, calc(100% - 64px)); margin: 0 auto; padding: 30px 0 70px; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 24px; }
.page-heading h1 { margin: 7px 0 5px; font-size: 36px; line-height: 1.1; letter-spacing: -.035em; }
.page-heading > div > p:last-child { margin: 0; color: var(--muted); font-size: 14px; }
.eyebrow { margin: 0; color: #9a6a00; font-size: 11px; font-weight: 800; letter-spacing: .16em; }
.freshness { display: flex; align-items: center; gap: 10px; min-width: 360px; padding: 12px 14px; }
.freshness > span { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; background: #2eae84; box-shadow: 0 0 0 6px rgba(46,174,132,.12); }
.freshness strong, .freshness small { display: block; }
.freshness strong { font-size: 13px; }
.freshness small { margin-top: 3px; color: var(--muted); font-size: 11px; }

.source-switch, .filters, .view-tabs, .panel, .metric-card { border: 1px solid var(--line); background: var(--surface); }
.source-switch { display: flex; gap: 0; width: max-content; margin-bottom: 14px; padding: 0; overflow: hidden; border-radius: 9px; }
.source-switch button { height: 40px; padding: 0 22px; border: 0; border-right: 1px solid #e3e6ea; background: #fff; color: #606773; font-size: 12px; font-weight: 750; cursor: pointer; }
.source-switch button:last-child { border-right: 0; }
.source-switch button.active { background: var(--dark); color: #fff; }
.source-switch small { margin-left: 4px; font-size: 10px; font-weight: 500; }

.filters { display: grid; grid-template-columns: auto minmax(230px, .8fr) minmax(320px, 1.5fr) auto; align-items: end; gap: 13px; padding: 17px; border-radius: 15px; box-shadow: 0 7px 24px rgba(29,35,47,.04); }
.filters label { color: #555e6e; font-size: 11px; font-weight: 700; }
.filters select, .filters input { width: 100%; height: 40px; margin-top: 6px; padding: 0 11px; border: 1px solid #dce0e6; border-radius: 8px; background: #fafbfc; color: #313743; font-size: 13px; outline: none; }
.filters select:focus, .filters input:focus { background: #fff; border-color: #c69a28; box-shadow: 0 0 0 3px rgba(223,184,74,.15); }
.date-filter { position: relative; }
.control-label { display: block; margin-bottom: 6px; color: #555e6e; font-size: 11px; font-weight: 700; }
.period-switch { display: flex; overflow: hidden; border: 1px solid #dfe2e7; border-radius: 9px; }
.period-switch button { height: 40px; padding: 0 13px; border: 0; border-right: 1px solid #e3e6ea; background: #fff; color: #606773; font-size: 12px; font-weight: 750; cursor: pointer; white-space: nowrap; }
.period-switch button:last-child { border-right: 0; }
.period-switch button.active { background: var(--gold); color: #171a21; }
.date-range-popover { position: fixed; z-index: 45; width: 690px; padding: 0; overflow: hidden; border: 1px solid #dfe2e7; border-radius: 14px; background: #fff; box-shadow: 0 20px 52px rgba(25,31,42,.22); }
.date-range-popover[hidden] { display: none; }
.calendar-grid { display: grid; grid-template-columns: 1fr 1fr; }
.calendar-panel { padding: 17px 17px 15px; }
.calendar-panel + .calendar-panel { border-left: 1px solid #e8ebef; }
.calendar-role { display: block; margin-bottom: 10px; color: #555d69; font-size: 11px; font-weight: 850; }
.calendar-header { display: grid; grid-template-columns: 30px 30px 1fr 30px 30px; align-items: center; gap: 3px; margin-bottom: 10px; }
.calendar-header strong { text-align: center; color: #2e3440; font-size: 13px; }
.calendar-nav { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: #8c94a1; font-size: 15px; line-height: 1; cursor: pointer; }
.calendar-nav:hover, .calendar-nav:focus-visible { background: #f0f3f8; color: #303744; outline: none; }
.calendar-weekdays, .calendar-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.calendar-weekdays { margin-bottom: 4px; }
.calendar-weekdays span { display: grid; place-items: center; height: 24px; color: #89919e; font-size: 10px; font-weight: 800; }
.calendar-day { position: relative; height: 32px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: #515966; font-size: 11px; font-variant-numeric: tabular-nums; cursor: pointer; }
.calendar-day:hover:not(:disabled), .calendar-day:focus-visible { background: #fff3cf; color: #674d0e; outline: none; }
.calendar-day.outside { color: #c4c9d1; }
.calendar-day.in-range { border-radius: 5px; background: #f4edcf; }
.calendar-day.is-start, .calendar-day.is-end { background: var(--gold); color: #171a21; font-weight: 900; box-shadow: 0 3px 8px rgba(184,139,26,.2); }
.calendar-day.is-start.is-end { border-radius: 50%; }
.calendar-day:disabled { cursor: not-allowed; background: transparent; color: #c6cbd3; opacity: .48; box-shadow: none; }
.date-range-footer { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px; padding: 13px 17px; border-top: 1px solid #e8ebef; background: #fafbfc; }
.selected-date-range { display: block; color: #626a76; font-size: 11px; font-weight: 750; font-variant-numeric: tabular-nums; }
.date-range-popover p { min-height: 14px; margin: 3px 0 0; color: #d94848; font-size: 10px; }
.date-range-actions { display: flex; justify-content: flex-end; gap: 8px; }
.date-range-actions button { height: 34px; padding: 0 16px; border: 1px solid #d9dde4; border-radius: 7px; background: #fff; color: #555c68; font-weight: 750; cursor: pointer; }
.date-range-actions .confirm { border-color: var(--gold); background: var(--gold); color: #171a21; }
.reset-button { height: 42px; padding: 0 18px; border: 1px solid #d6dbe3; border-radius: 10px; background: #fff; color: #5d6675; font-weight: 700; cursor: pointer; }

.view-tabs { display: flex; gap: 0; width: max-content; margin: 14px 0; padding: 0; overflow: hidden; border-radius: 9px; }
.view-tabs button { height: 40px; padding: 0 20px; border: 0; border-right: 1px solid #e3e6ea; background: #fff; color: #606773; font-size: 12px; font-weight: 750; cursor: pointer; }
.view-tabs button:last-child { border-right: 0; }
.view-tabs button.active { background: var(--gold); color: #171a21; box-shadow: none; }

.metric-grid { display: grid; grid-template-columns: 1.1fr repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.panel { border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.panel-heading { min-height: 0; padding: 22px 22px 16px; display: flex; align-items: start; justify-content: space-between; gap: 24px; }
.panel-heading h2 { margin: 5px 0 3px; font-size: 21px; }
.panel-heading p:not(.eyebrow), .panel-heading small { margin: 0; color: var(--muted); font-size: 12px; }
.panel-heading > strong { padding-top: 6px; white-space: nowrap; font-size: 14px; }
.table-wrap { width: 100%; overflow-x: auto; }
body.product-detail-active .filters { display: none; }
.local-badge { position: fixed; z-index: 40; right: 16px; bottom: 14px; padding: 7px 12px; border-radius: 999px; background: #f2c746; color: #3d2d00; box-shadow: 0 8px 22px rgba(24,29,39,.16); font-size: 11px; font-weight: 800; }
