:root {
  color-scheme: dark;
  --bg: #111315;
  --panel: #191c1f;
  --panel-2: #202428;
  --line: #30353a;
  --text: #f3f4f5;
  --muted: #90979e;
  --accent: #f5a45b;
  --accent-soft: rgba(245, 164, 91, .12);
  --danger: #ef6b66;
  --success: #66b986;
  --sidebar: 252px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); letter-spacing: 0; }
body.modal-open { overflow: hidden; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .modal:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: 3px; }
.login { width: min(420px, calc(100% - 32px)); min-height: 100vh; margin: auto; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.login-mark, .brand-mark { display: grid; place-items: center; background: var(--accent); color: #151515; font-weight: 900; }
.login-mark { width: 66px; height: 66px; border-radius: 8px; font-size: 28px; box-shadow: 0 16px 50px rgba(245,164,91,.16); }
.login h1 { font-size: 32px; margin: 14px 0 4px; }
.login-copy { line-height: 1.55; margin: 0 0 24px; max-width: 350px; }
.primary, .secondary, .danger-button { border: 0; border-radius: 7px; min-height: 46px; padding: 0 18px; font-weight: 750; }
.primary { background: var(--accent); color: #171717; }
.secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
.danger-button { background: rgba(239,107,102,.12); color: #ff8d88; border: 1px solid rgba(239,107,102,.28); }
.wide { width: 100%; }
.login > .wide + .wide { margin-top: 8px; }
.code-panel { margin-top: 18px; width: 100%; padding: 24px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.code-panel span { font-size: 11px; color: var(--muted); font-weight: 800; letter-spacing: 2px; }
.code-panel strong { display: block; font-size: 43px; letter-spacing: 9px; color: var(--accent); margin: 12px 0 8px; font-variant-numeric: tabular-nums; }
.code-panel p { color: var(--muted); margin: 0; font-size: 14px; }
.password-stage { margin-top: 20px; display: grid; gap: 10px; text-align: left; }
.password-stage label { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: 2px; }
.password-stage input { width: 100%; height: 54px; border: 1px solid var(--line); border-radius: 7px; background: #111416; color: var(--accent); text-align: center; font-size: 24px; font-weight: 850; letter-spacing: 5px; text-transform: uppercase; outline: none; }
.password-stage input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.error { color: var(--danger); }
.login-id { width: 100%; display: grid; gap: 7px; margin: 18px 0 10px; color: var(--muted); text-align: left; font-size: 10px; font-weight: 800; letter-spacing: 1.6px; }.login-id input { height: 48px; border: 1px solid var(--line); border-radius: 7px; background: #111416; color: var(--text); padding: 0 13px; font-size: 15px; outline: none; }.login-id input:focus { border-color: var(--accent); }
.login-id.login-password { margin-top: 0; }
.password-choice { display: grid; gap: 8px; }
.generated-password { display: block; margin: 12px 0 18px; padding: 16px; border: 1px solid var(--accent); border-radius: 7px; background: #111416; color: var(--accent); text-align: center; font-size: 18px; letter-spacing: 1px; overflow-wrap: anywhere; user-select: all; }
.legacy-login { width: 100%; margin-top: 14px; color: var(--muted); text-align: left; }.legacy-login summary { cursor: pointer; font-size: 12px; }.legacy-login .login-id { margin-top: 12px; }
.recovery-codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 18px 0; }.recovery-codes code { padding: 10px; border: 1px solid var(--line); border-radius: 5px; text-align: center; color: var(--accent); background: #121516; }
.totp-secret { display: block; margin: 16px 0; padding: 14px; border: 1px dashed var(--accent); border-radius: 6px; color: var(--accent); text-align: center; letter-spacing: 2px; overflow-wrap: anywhere; }
.invite-link { display: block; margin: 16px 0; padding: 14px; border: 1px solid var(--line); border-radius: 6px; color: var(--accent); background: #111416; overflow-wrap: anywhere; user-select: all; }
.app { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) 1fr; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); padding: 22px 16px; background: #151719; border-right: 1px solid #24282b; display: flex; flex-direction: column; z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 24px; }
.brand-button { width: 100%; border: 0; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.brand-button:hover { color: var(--accent); }
.brand-mark { width: 38px; height: 38px; border-radius: 7px; }
.brand b { display: block; font-size: 16px; }
.brand small { color: var(--muted); font-size: 9px; letter-spacing: 1.6px; }
nav { display: grid; gap: 4px; }
.nav-item { width: 100%; min-height: 44px; display: flex; align-items: center; gap: 13px; border: 0; border-radius: 6px; padding: 0 13px; background: transparent; color: #aab0b5; text-align: left; }
.nav-item span { width: 22px; text-align: center; font-size: 19px; }
.nav-item span img { display: block; width: 21px; height: 21px; object-fit: contain; filter: invert(72%); }
.nav-item:hover { color: var(--text); background: #1c1f22; }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.nav-item:hover span img { filter: invert(100%); }
.nav-item.active span img { filter: invert(69%) sepia(75%) saturate(1029%) hue-rotate(326deg) brightness(104%) contrast(101%); }
.sidebar-foot { margin-top: auto; padding: 15px 9px 0; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 9px; }
.sidebar-foot div { min-width: 0; flex: 1; }
.sidebar-foot b, .sidebar-foot small { display: block; }
.sidebar-foot b { font-size: 13px; }.sidebar-foot small { color: var(--muted); font-size: 10px; }
.sidebar-foot button { border: 0; background: transparent; color: var(--muted); font-size: 21px; }
.owner-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 12px rgba(102,185,134,.55); }
main { grid-column: 2; min-width: 0; }
.topbar { height: 72px; border-bottom: 1px solid #25292c; background: rgba(17,19,21,.94); display: flex; align-items: center; gap: 16px; padding: 0 30px; position: sticky; top: 0; z-index: 10; }
.search { flex: 1; max-width: 640px; position: relative; }
.search span { position: absolute; left: 14px; top: 10px; color: var(--muted); font-size: 20px; }
.search input { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 7px; background: #171a1c; color: var(--text); padding: 0 15px 0 42px; outline: none; }
.search input:focus { border-color: #6e573f; box-shadow: 0 0 0 3px var(--accent-soft); }
.system-state { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.system-state i { width: 7px; height: 7px; background: var(--success); border-radius: 50%; }
.content { max-width: 1450px; padding: 34px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.page-head h1 { margin: 0; font-size: 27px; }.page-head p { margin: 7px 0 0; color: var(--muted); }
.page-actions { display: flex; gap: 8px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 24px; }
.metric, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 7px; }
.metric { padding: 19px; min-height: 126px; }
.metric small { color: var(--muted); font-weight: 650; }
.metric strong { display: block; font-size: 29px; margin: 17px 0 8px; }
.metric span { color: var(--success); font-size: 12px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 14px; }
.chart-panel { margin-bottom: 24px; }
.chart-wrap { padding: 14px 18px 18px; }
.chart-wrap { position: relative; }
.chart-wrap svg { display: block; width: 100%; height: 250px; overflow: visible; }
.chart-axis { stroke: var(--line); stroke-width: 1; stroke-dasharray: 4 7; }
.chart-area { pointer-events: none; }
.chart-line { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; filter: drop-shadow(0 4px 9px rgba(246,166,87,.16)); }
.chart-panel.chart-animate .chart-line { stroke-dasharray: 1; stroke-dashoffset: 1; }
.chart-panel.chart-animate .chart-area { opacity: 0; transform: translateY(7px); transform-origin: center bottom; }
.chart-panel.chart-visible .chart-line { animation: chart-draw .9s cubic-bezier(.22,.72,.22,1) forwards; }
.chart-panel.chart-visible .chart-area { animation: chart-area-in .7s .18s ease-out forwards; }
.chart-panel.chart-visible .chart-axis, .chart-panel.chart-visible .chart-labels { animation: chart-fade-in .45s ease-out both; }
.chart-hit { fill: transparent; stroke: transparent; cursor: crosshair; vector-effect: non-scaling-stroke; }
.chart-hit:hover,.chart-hit:focus { fill: var(--accent); stroke: var(--panel); stroke-width: 3; outline: none; }
@keyframes chart-draw { to { stroke-dashoffset: 0; } }
@keyframes chart-area-in { to { opacity: 1; transform: translateY(0); } }
@keyframes chart-fade-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .chart-panel.chart-animate .chart-line { stroke-dashoffset: 0; }.chart-panel.chart-animate .chart-area { opacity: 1; transform: none; }.chart-panel.chart-visible * { animation: none !important; } }
.chart-metrics,.period-switch { display: flex; flex-wrap: wrap; gap: 7px; }
.chart-metrics { padding: 14px 18px 0; }
.chart-metric { min-height: 32px; padding: 0 11px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font-size: 11px; }
.chart-metric.active,.period-switch .active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.chart-tooltip { position: absolute; z-index: 3; min-width: 150px; transform: translate(-50%,-100%); padding: 10px 12px; border: 1px solid #765b43; border-radius: 6px; background: #111416; box-shadow: 0 12px 30px rgba(0,0,0,.38); pointer-events: none; }
.chart-tooltip b,.chart-tooltip span { display: block; }.chart-tooltip span { margin-top: 4px; color: var(--accent); font-size: 12px; }
.chart-line.accent,.chart-legend i.accent { stroke: var(--accent); background: var(--accent); }
.chart-line.success,.chart-legend i.success { stroke: var(--success); background: var(--success); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 11px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 14px; height: 3px; border-radius: 2px; }
.chart-labels { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 10px; }
.panel { overflow: hidden; }
.panel-head { min-height: 62px; padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-head h2 { margin: 0; font-size: 16px; }.panel-head small { color: var(--muted); }
.security-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.geoip-credit { padding: 9px 16px; color: var(--muted); font-size: 10px; text-align: right; }.geoip-credit a { color: var(--muted); }
.attention-list, .activity-list { padding: 5px 18px; }
.attention, .activity { display: flex; align-items: center; gap: 13px; min-height: 76px; border-bottom: 1px solid #2a2e32; }
.attention-button { width: 100%; border-top: 0; border-left: 0; border-right: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.attention-button:hover { background: rgba(245,164,91,.06); }
.attention-arrow { color: var(--accent); font-size: 20px; }
.attention:last-child, .activity:last-child { border: 0; }
.attention-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 6px; color: var(--accent); background: var(--accent-soft); }
.attention div, .activity div { min-width: 0; flex: 1; }.attention b, .activity b { display: block; font-size: 14px; }.attention small, .activity small { color: var(--muted); }
.count { font-weight: 800; font-variant-numeric: tabular-nums; }
.table-panel { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 800px; }
th { text-align: left; color: var(--muted); font-size: 11px; letter-spacing: 1.2px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
td { padding: 14px 16px; border-bottom: 1px solid #282c2f; font-size: 13px; }
tbody tr { cursor: pointer; } tbody tr:hover { background: #1e2225; }
.user-cell { display: flex; align-items: center; gap: 10px; }.avatar { width: 34px; height: 34px; border-radius: 50%; background: #2a2e31; display: grid; place-items: center; font-weight: 800; }
.user-cell b, .user-cell small { display: block; }.user-cell small { color: var(--muted); margin-top: 2px; }
.badge { display: inline-flex; align-items: center; min-height: 25px; padding: 0 9px; border-radius: 20px; background: #272c2f; color: #bbc0c4; font-size: 11px; font-weight: 800; }
.badge.active, .badge.approved, .badge.success, .badge.paid, .badge.succeeded { color: var(--success); background: rgba(102,185,134,.1); }
.badge.trial, .badge.pending { color: var(--accent); background: var(--accent-soft); }
.badge.expired, .badge.rejected, .badge.failed, .badge.canceled { color: var(--danger); background: rgba(239,107,102,.1); }
.filters { display: flex; gap: 8px; }
select, .field { height: 40px; border: 1px solid var(--line); background: #171a1c; color: var(--text); border-radius: 6px; padding: 0 12px; outline: none; }
.empty, .loading { min-height: 220px; display: grid; place-items: center; color: var(--muted); text-align: center; }
.detail-drawer { position: fixed; z-index: 41; right: 0; top: 0; bottom: 0; width: min(560px, 100%); background: #16191b; border-left: 1px solid var(--line); transform: translateX(101%); transition: transform .22s ease; overflow-y: auto; }
.detail-drawer.open { transform: translateX(0); }
.drawer-backdrop, .modal-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.58); }
.drawer-head { position: sticky; top: 0; z-index: 2; background: rgba(22,25,27,.96); padding: 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; }
.drawer-head .avatar { width: 48px; height: 48px; }.drawer-head div { flex: 1; }.drawer-head h2 { margin: 0; font-size: 20px; }.drawer-head p { margin: 4px 0 0; color: var(--muted); }
.icon-button { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-2); color: var(--text); font-size: 20px; }
.drawer-content { padding: 22px; display: grid; gap: 14px; }
.info-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }.info { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 13px; }.info small { display: block; color: var(--muted); margin-bottom: 6px; }.info b { font-size: 14px; }
.section-title { margin: 12px 0 0; font-size: 12px; color: var(--muted); letter-spacing: 2px; }
.action-center { margin-top: 4px; border: 1px solid var(--line); background: #181b1e; border-radius: 7px; overflow: hidden; }
.action-center-head { padding: 17px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border-bottom: 1px solid var(--line); }
.action-center-head h3 { margin: 0; font-size: 17px; }.action-center-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.secure-mark, .modal-kicker { color: var(--accent); font-size: 9px; font-weight: 850; letter-spacing: 1.8px; }
.action-group { padding: 14px 17px; border-bottom: 1px solid #292d30; }.action-group:last-child { border: 0; }.action-group > b { display: block; color: var(--muted); font-size: 11px; margin-bottom: 9px; text-transform: uppercase; letter-spacing: 1.4px; }
.command-list { display: flex; flex-wrap: wrap; gap: 7px; }.command-list button { min-height: 34px; padding: 0 11px; border: 1px solid #363b3f; border-radius: 5px; background: #222629; color: var(--text); font-size: 12px; font-weight: 700; }.command-list button:hover { border-color: #785b41; color: var(--accent); }.command-list .danger-command { color: #ff8d88; border-color: rgba(239,107,102,.3); }
.operation-warning { margin-top: 12px; padding: 11px 12px; border-left: 2px solid var(--accent); background: var(--accent-soft); color: #d4d7d9; font-size: 12px; line-height: 1.45; }
.compare { display: grid; grid-template-columns: 1fr auto 1fr; gap: 9px; align-items: center; margin: 18px 0; }.compare > i { color: var(--accent); font-style: normal; font-size: 20px; }.compare > section { border: 1px solid var(--line); border-radius: 6px; padding: 12px; }.compare > section > span { color: var(--muted); font-size: 9px; letter-spacing: 1.5px; font-weight: 800; }
.snapshot { display: grid; gap: 9px; margin-top: 12px; }.snapshot div { min-width: 0; }.snapshot small, .snapshot b { display: block; }.snapshot small { color: var(--muted); font-size: 10px; margin-bottom: 2px; }.snapshot b { font-size: 12px; overflow-wrap: anywhere; }
.section-caption { margin: 28px 0 10px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-caption h2 { margin: 0; font-size: 17px; }
.section-caption small { color: var(--muted); }
.notification-metrics { margin-bottom: 6px; }
.template-panel td:first-child b, .template-panel td:first-child small { display: block; }
.template-panel td:first-child small { color: var(--muted); margin-top: 4px; }
.template-changed { color: var(--accent); font-weight: 750; }
.compact { min-height: 34px; padding: 0 12px; font-size: 12px; }
.timeline-item { padding: 12px 0; border-bottom: 1px solid var(--line); }.timeline-item b, .timeline-item span { display: block; }.timeline-item span { color: var(--muted); margin-top: 4px; font-size: 12px; }
.verified { color: var(--success); font-weight: 800; }
.provider-reference { display: grid; gap: 7px; padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.provider-reference small { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: 1.4px; }
.provider-reference code { color: var(--text); overflow-wrap: anywhere; font-size: 12px; }
.publish-state { display: flex; gap: 10px; margin-bottom: 18px; }.publish-state > div { min-width: 180px; padding: 13px 15px; border-left: 2px solid var(--accent); background: var(--panel); }.publish-state small, .publish-state b { display: block; }.publish-state small { color: var(--muted); font-size: 9px; letter-spacing: 1.4px; }.publish-state b { margin-top: 5px; }
.product-list { display: grid; gap: 14px; }.product-card { padding: 20px; }.product-title { display: flex; align-items: center; justify-content: space-between; gap: 18px; }.product-title > div { display: grid; gap: 7px; flex: 1; }.product-title input { border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); font-size: 22px; font-weight: 800; padding: 5px 0; outline: none; }.product-switches { display: grid; gap: 8px; flex: 0 0 auto !important; }.switch-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }.product-marketing { display: grid; grid-template-columns: minmax(0,1fr) 180px; gap: 12px; margin-top: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: #16191b; }.product-marketing > label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; }.product-marketing input, .product-marketing select { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 6px; background: #121517; color: var(--text); padding: 0 10px; }.product-description { display: grid; gap: 6px; margin-top: 16px; color: var(--muted); font-size: 11px; }.product-marketing .product-description { margin-top: 0; }.product-description textarea { width: 100%; min-height: 76px; resize: vertical; border: 1px solid var(--line); border-radius: 6px; background: #15181a; color: var(--text); padding: 10px; }.inline-field { display: flex; align-items: center; gap: 10px; margin-top: 14px; color: var(--muted); font-size: 12px; }.inline-field input { width: 100px; }.period-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 16px; }.period-editor { padding: 14px; border: 1px solid var(--line); border-radius: 6px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }.period-editor-head { grid-column: 1/-1; display: flex; align-items: center; justify-content: space-between; gap: 10px; }.product-discount { padding: 4px 8px; border-radius: 999px; background: #24282b; color: var(--muted); font-size: 10px; font-weight: 800; }.product-discount.is-active { background: var(--accent-soft); color: var(--accent); }.period-editor label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; }.period-editor input, .inline-field input { height: 38px; border: 1px solid var(--line); border-radius: 5px; background: #121517; color: var(--text); padding: 0 9px; }.preview-tariff.is-featured { border-color: rgba(245,164,91,.55); }.preview-tariff > b { display: block; margin: 8px 0; }.preview-locations { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }.preview-locations small { width: 100%; color: var(--muted); }.preview-locations span { padding: 5px 8px; border: 1px solid var(--line); border-radius: 5px; background: #15181a; font-size: 11px; }.preview-tariff ul { margin: 10px 0; padding-left: 18px; color: var(--muted); }.preview-price { display: flex; align-items: center; gap: 8px; margin: 12px 0; }.preview-price s { color: var(--muted); }.preview-price em { color: var(--accent); font-style: normal; font-weight: 800; }.preview-price strong { margin-left: auto; color: var(--accent); }.product-actions { position: sticky; bottom: 14px; display: flex; justify-content: flex-end; gap: 8px; padding: 12px; background: rgba(17,19,21,.94); border: 1px solid var(--line); border-radius: 7px; }
.modal-backdrop { z-index: 50; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); }
.modal { width: min(520px, 100%); max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); margin: auto 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-gutter: stable; background: #1a1d20; border: 1px solid var(--line); border-radius: 8px; padding: 22px; box-shadow: 0 24px 80px rgba(0,0,0,.4); }
.modal h2 { margin: 0 0 7px; }.modal p { color: var(--muted); margin: 0 0 18px; }.form-grid { display: grid; gap: 11px; }.form-grid label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }.form-grid input, .form-grid textarea, .form-grid select { width: 100%; background: #131618; border: 1px solid var(--line); border-radius: 6px; color: var(--text); padding: 11px; outline: none; }.form-grid textarea { min-height: 110px; resize: vertical; }.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.toast { position: fixed; z-index: 80; right: 22px; bottom: 22px; background: #252a2e; border: 1px solid #3a4146; color: var(--text); padding: 13px 17px; border-radius: 7px; box-shadow: 0 12px 35px rgba(0,0,0,.35); }
.mobile-only { display: none; }
@media (max-width: 1050px) { .metrics { grid-template-columns: repeat(2,1fr); }.dashboard-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }.sidebar { transform: translateX(-101%); transition: transform .2s ease; width: min(300px, 88vw); }.sidebar.open { transform: translateX(0); }.app main { grid-column: 1; }.mobile-only { display: grid; place-items: center; }.topbar { padding: 0 14px; }.system-state { display: none; }.content { padding: 23px 14px 42px; }.page-head { align-items: flex-start; flex-direction: column; }.metrics { grid-template-columns: 1fr 1fr; }.metric { min-height: 110px; padding: 15px; }.metric strong { font-size: 23px; }.page-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }.page-actions .period-switch { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }.page-actions button { min-height: 44px; }.info-grid { grid-template-columns: 1fr 1fr; }.section-caption { align-items: flex-start; flex-direction: column; }
  .modal-backdrop { padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
  .modal { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); padding: 18px 16px; border-radius: 7px; }
  .modal-actions > button { flex: 1 1 auto; min-height: 44px; }
}
@media (max-width: 760px) { .period-grid, .product-marketing { grid-template-columns: 1fr; }.publish-state { flex-direction: column; }.publish-state > div { min-width: 0; }.product-title { align-items: flex-start; flex-direction: column; } }
@media (max-width: 440px) { .metrics { grid-template-columns: 1fr; }.info-grid { grid-template-columns: 1fr; }.login h1 { font-size: 27px; }.code-panel strong { font-size: 34px; letter-spacing: 7px; } }
@media (max-width: 440px) { .compare { grid-template-columns: 1fr; }.compare > i { transform: rotate(90deg); text-align: center; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }

.segment-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 10px; }
.segment { min-height: 118px; padding: 17px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--text); text-align: left; }
.segment:hover { border-color: #785b41; }
.segment small,.segment strong,.segment span { display: block; }
.segment small { color: var(--muted); min-height: 32px; }
.segment strong { font-size: 28px; margin: 10px 0 6px; }
.segment span { color: var(--accent); font-size: 11px; font-weight: 750; }
.automation-list { display: grid; gap: 12px; }
.automation-card { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 20px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.automation-card h2 { margin: 6px 0 9px; font-size: 19px; }
.automation-card p { margin: 0 0 12px; color: var(--muted); line-height: 1.45; }
.automation-card small,.automation-card span { color: var(--muted); font-size: 11px; }
.automation-actions { display: flex; gap: 8px; flex-shrink: 0; }
.automation-history { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }.automation-history summary { color: var(--accent); cursor: pointer; font-size: 11px; }.automation-history > div { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }.automation-history > div small { grid-column: 1/-1; }
.settings-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; align-items: start; }
.role-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin-bottom: 18px; }
.control-profile { display: flex; align-items: center; gap: 16px; padding: 20px; margin-bottom: 18px; }
.control-profile .avatar { width: 52px; height: 52px; }.control-profile > div { flex: 1; }.control-profile h2 { margin: 5px 0; }.control-profile p { color: var(--muted); margin: 0; }
.control-section { margin-top: 18px; }
.funnel { display: grid; grid-template-columns: repeat(4,1fr); gap: 1px; margin: 14px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--line); }
.funnel > div { position: relative; padding: 17px 20px; background: var(--panel); }.funnel small,.funnel strong { display: block; }.funnel small { color: var(--muted); }.funnel strong { margin-top: 8px; font-size: 25px; }.funnel i { position: absolute; right: -8px; top: 36%; z-index: 2; color: var(--accent); font-style: normal; }
.compact-metrics { grid-template-columns: repeat(5,minmax(0,1fr)); }.compact-metrics .metric { min-height: 96px; }.compact-metrics .metric strong { margin-bottom: 0; }
.loyalty-panel { margin: 18px 0; }.loyalty-levels { display: grid; grid-template-columns: repeat(4,1fr); }.loyalty-levels article { padding: 17px; border-right: 1px solid var(--line); }.loyalty-levels article:last-child { border: 0; }.loyalty-levels b,.loyalty-levels small { display: block; }.loyalty-levels b { margin: 7px 0; }.loyalty-levels small,.loyalty-rewards { color: var(--muted); }.loyalty-rewards { display: flex; flex-wrap: wrap; gap: 12px 24px; padding: 15px 18px; border-top: 1px solid var(--line); font-size: 11px; }
.role-card { min-height: 180px; padding: 18px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.role-card.current { border-color: #785b41; box-shadow: inset 0 2px var(--accent); }
.role-card h2 { margin: 8px 0 16px; font-size: 18px; }
.role-card ul { display: grid; gap: 8px; padding-left: 17px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.settings-panel { padding-bottom: 18px; }
.setting-row { min-height: 74px; margin: 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); }
.setting-row b,.setting-row small { display: block; }
.setting-row small { color: var(--muted); margin-top: 4px; }
.setting-row input { width: 20px; height: 20px; accent-color: var(--accent); }
.reason-field,.settings-fields { margin: 16px 18px; }
.reason-field,.settings-fields label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; }
.reason-field input,.settings-fields input,.settings-fields textarea { width: 100%; border: 1px solid var(--line); border-radius: 6px; background: #131618; color: var(--text); padding: 11px; }
.settings-fields { display: grid; gap: 12px; }
.settings-fields textarea { min-height: 110px; resize: vertical; }
.settings-panel > .primary { margin: 0 18px; }
@media (max-width: 1050px) { .segment-grid { grid-template-columns: repeat(3,1fr); }.settings-grid { grid-template-columns: 1fr; }.role-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 1050px) { .compact-metrics { grid-template-columns: repeat(3,1fr); } }
@media (max-width: 760px) { .segment-grid { grid-template-columns: repeat(2,1fr); }.automation-card { align-items: flex-start; flex-direction: column; }.automation-actions { width: 100%; }.automation-actions button { flex: 1; } }
.promo-list { display: grid; gap: 10px; }
.promo-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.promo-card h2 { margin: 6px 0; font-size: 18px; }.promo-card p { margin: 0 0 7px; color: var(--text); }.promo-card small { color: var(--muted); }
.promo-code { color: var(--accent); font-size: 11px; font-weight: 850; letter-spacing: 1.6px; }
.promo-actions { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.form-grid .wide { grid-column: 1 / -1; }.form-grid fieldset { border: 1px solid var(--line); border-radius: 6px; padding: 12px; }.form-grid legend { color: var(--muted); padding: 0 5px; }
.wide-info { grid-column: span 2; }
.tracking-link { display:flex; align-items:center; gap:12px; margin:18px 0; padding:14px; border:1px solid var(--line); background:rgba(255,255,255,.025); }
.tracking-link code { flex:1; overflow-wrap:anywhere; color:var(--accent); }
.vertical-funnel { grid-template-columns: 1fr; gap: 0; overflow: visible; background: transparent; border: 0; }
.vertical-funnel > div { min-width: 0; min-height: 42px; padding: 8px 13px; border: 1px solid var(--line); border-bottom: 0; display: grid; grid-template-columns: 1fr 26px 1fr; align-items: center; }
.vertical-funnel > div:first-child { border-radius: 7px 7px 0 0; }
.vertical-funnel > div:last-child { border-bottom: 1px solid var(--line); border-radius: 0 0 7px 7px; }
.vertical-funnel strong { grid-column: 3; margin: 0; font-size: 18px; text-align: right; }
.vertical-funnel i { position: static; grid-column: 2; grid-row: 1; transform: none; text-align: center; }
.form-grid .check-row { display: flex; grid-auto-flow: column; justify-content: flex-start; align-items: center; }.form-grid .check-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.form-feedback { margin: 10px 0; padding: 10px 12px; border: 1px solid rgba(239,107,102,.35); border-radius: 6px; color: #ff9c97; background: rgba(239,107,102,.08); }
.banner-preview { overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: #111315; }
.banner-preview img,.confirm-banner { display: block; width: 100%; height: auto; }
.confirm-banner { margin: 12px 0 18px; border: 1px solid var(--line); border-radius: 7px; }
@media (max-width: 760px) { .promo-card { align-items: flex-start; flex-direction: column; }.promo-actions { width: 100%; flex-wrap: wrap; } }
@media (max-width: 560px) { .role-grid { grid-template-columns: 1fr; }.chart-wrap svg { height: 190px; } }
@media (max-width: 760px) { .funnel { grid-template-columns: repeat(2,1fr); }.compact-metrics { grid-template-columns: repeat(2,1fr); }.period-switch { width: 100%; }.chart-metrics { overflow-x: auto; flex-wrap: nowrap; }.chart-metric { white-space: nowrap; } }
@media (max-width: 760px) { .loyalty-levels { grid-template-columns: repeat(2,1fr); }.loyalty-levels article:nth-child(2) { border-right: 0; } }

/* Partner analytics use the existing white/blue theme tokens. */
.partner-section {padding:24px; margin:20px 0; border-radius:24px;}
.partner-section h2 {margin:0 0 20px;}
.partner-metrics {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:20px 0;}
.partner-metrics .info {min-width:0;}
.partner-metrics b {overflow-wrap:anywhere;}
.partner-table-scroll {overflow-x:auto;}
.partner-table-scroll table {min-width:760px;}
.partner-link {overflow-wrap:anywhere;}
.partner-name {font:inherit;font-weight:700;text-align:left;border:0;background:transparent;color:inherit;padding:0;cursor:pointer;}
.partner-name:hover {text-decoration:underline;}
.section-head {display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:16px;}
.section-head h2 {margin:0;}
@media(max-width:750px) {.partner-metrics {grid-template-columns:repeat(2,minmax(0,1fr));}.partner-section {padding:16px;}}

.partner-table-scroll td small {display:block;color:var(--muted);line-height:1.45;margin-top:5px;}
.partner-table-scroll td {vertical-align:top;}
.partner-name {display:block;}

/* R91: the same recoverable bin in advertising and every promo view. */
.admin-trash { margin-top:24px; padding:0; overflow:hidden; }
.admin-trash > summary { display:flex; align-items:center; gap:12px; min-height:68px; padding:16px 22px; cursor:pointer; list-style:none; color:var(--text); font-size:18px; font-weight:750; touch-action:manipulation; }
.admin-trash > summary::-webkit-details-marker { display:none; }
.admin-trash > summary svg { width:23px; height:23px; color:var(--muted); flex:none; }
.admin-trash > summary small { color:var(--muted); font-size:12px; font-weight:500; }
.admin-trash > summary i { margin-left:auto; font-style:normal; transition:transform .18s ease; }
.admin-trash[open] > summary { border-bottom:1px solid var(--line); }
.admin-trash[open] > summary i { transform:rotate(180deg); }
.admin-trash > summary:focus-visible { outline:2px solid var(--accent); outline-offset:-5px; }
.trash-body { padding:16px 22px; }
.trash-scroll { overflow-x:auto; }
.trash-body table { width:100%; }
.trash-body td:last-child { text-align:right; white-space:nowrap; }
.trash-body .empty { padding:18px 0; }
.danger-button.compact { min-height:34px; padding:0 12px; font-size:12px; white-space:nowrap; touch-action:manipulation; }
@media(max-width:640px) {
 .admin-trash > summary { padding:14px 16px; font-size:17px; }
 .trash-body { padding:12px 16px; }
}

/* Keep controls visible in the narrow desktop panel and on mobile. */
.trash-body table { min-width:0; }
.trash-body td { vertical-align:top; }
.trash-body td small { display:block; color:var(--muted); margin-top:5px; line-height:1.45; }
.trash-body td:first-child { overflow-wrap:anywhere; }
.promo-card { flex-wrap:wrap; }
.promo-card > div:first-child { flex:1 1 220px; min-width:0; }
.promo-actions { flex-wrap:wrap; max-width:100%; flex-shrink:1; }
