:root {
  color-scheme: dark;
  --background: #101010;
  --foreground: #f5f5f5;
  --card: #1b1b1b;
  --card-foreground: #f5f5f5;
  --primary: #e7e7e7;
  --primary-foreground: #111111;
  --secondary: #242424;
  --muted: #252525;
  --muted-foreground: #9b9b9b;
  --accent: #292929;
  --destructive: #ff6b6b;
  --border: #303030;
  --input: #3a3a3a;
  --ring: #777777;
  --sidebar: #191919;
  --sidebar-accent: #292929;
  --positive: #21d09a;
  --positive-soft: #162b25;
  --warning: #f1b75a;
  --warning-soft: #302719;
  --danger-soft: #321e1e;
  --radius: 12px;
}
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html, body { min-height: 100%; }
body {
  min-height: 100vh;
  background: var(--background);
  color: var(--foreground);
  font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { color: inherit; }
svg { display: block; }
.hidden { display: none !important; }
.icon { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { border: 2px solid var(--background); border-radius: 6px; background: #4a4a4a; }

/* Authentication */
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #0d0d0d;
}
.login-card {
  width: min(100%, 400px);
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 24px 80px rgba(0,0,0,.4);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--foreground); font-size: 15px; font-weight: 600; }
.brand-icon { width: 20px; height: 20px; }
.login-copy { margin: 34px 0 24px; }
.login-copy h1 { font-size: 24px; font-weight: 600; letter-spacing: -.025em; }
.login-copy p { margin-top: 6px; color: var(--muted-foreground); line-height: 1.45; }

/* Controls */
.field { display: grid; gap: 7px; }
.field + .field { margin-top: 16px; }
.field-spaced, .form-row-spaced { margin-top: 16px; }
label { font-size: 13px; font-weight: 500; }
input, select {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--input);
  border-radius: 8px;
  outline: none;
  background: transparent;
  color: var(--foreground);
  box-shadow: 0 1px 2px rgba(0,0,0,.025);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: #6f6f6f; }
input:focus, select:focus { border-color: var(--ring); box-shadow: 0 0 0 3px rgba(255,255,255,.08); }
.button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: transparent;
  color: var(--foreground);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, opacity .15s, box-shadow .15s;
}
.button:disabled { cursor: not-allowed; opacity: .45; }
.button-primary { border-color: var(--primary); background: var(--primary); color: var(--primary-foreground); box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.button-primary:hover:not(:disabled) { opacity: .9; }
.button-outline { border-color: #3b3b3b; background: #171717; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.button-outline:hover:not(:disabled), .button-ghost:hover:not(:disabled) { background: var(--accent); }
.button-ghost { color: var(--muted-foreground); }
.button-danger { border-color: #653434; background: var(--danger-soft); color: var(--destructive); }
.button-warning { border-color: #63502c; background: var(--warning-soft); color: var(--warning); }
.button-block { width: 100%; margin-top: 22px; }
.icon-button, .header-trigger {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: transparent;
  cursor: pointer;
}
.icon-button:hover, .header-trigger:hover { background: var(--accent); }
.message { min-height: 19px; margin-top: 12px; color: var(--muted-foreground); font-size: 12px; }
.message.success { color: var(--positive); }
.message.error { color: var(--destructive); }

/* Pixel-matched application frame */
.app-shell { min-height: 100vh; display: flex; gap: 0; padding: 4px; background: #0b0b0b; }
.sidebar {
  width: 288px;
  min-height: calc(100vh - 8px);
  flex: 0 0 288px;
  display: flex;
  flex-direction: column;
  padding: 8px;
  border: 1px solid #272727;
  border-radius: 12px 0 0 12px;
  background: var(--sidebar);
  transition: margin-left .2s ease;
}
.sidebar-header { padding: 8px 8px 6px; }
.sidebar-brand { width: 100%; padding: 6px 8px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; }
.sidebar-brand:hover { background: var(--sidebar-accent); }
.sidebar-group { padding: 8px; }
.quick-actions { display: flex; align-items: center; gap: 8px; }
.quick-create { height: 34px; flex: 1; justify-content: flex-start; font-weight: 600; }
.sidebar-menu { margin-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-item {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--foreground);
  cursor: pointer;
  text-align: left;
}
.sidebar-item:hover, .sidebar-item.active { background: var(--sidebar-accent); }
.sidebar-item.active { color: #ffffff; font-weight: 600; }
.sidebar-item .item-action { margin-left: auto; color: var(--muted-foreground); opacity: 0; }
.sidebar-item:hover .item-action { opacity: .7; }
.sidebar-label { padding: 8px 8px 4px; color: var(--muted-foreground); font-size: 12px; }
.sidebar-spacer { flex: 1; }
.sidebar-footer {
  height: 56px;
  padding: 4px 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: default;
}
.sidebar-footer:hover { background: var(--sidebar-accent); }
.avatar { width: 32px; height: 32px; flex: 0 0 auto; border: 1px solid #3d3d3d; border-radius: 8px; display: grid; place-items: center; background: #242424; color: #e5e5e5; font-size: 11px; font-weight: 600; }
.user-meta { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.user-meta strong, .user-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta strong { font-size: 13px; font-weight: 500; }
.user-meta span { color: var(--muted-foreground); font-size: 11px; }
.sidebar-footer > .icon { color: var(--muted-foreground); }
.sidebar-backdrop { display: none; }

.main-shell { min-width: 0; min-height: calc(100vh - 8px); flex: 1; display: flex; flex-direction: column; overflow: hidden; border: 1px solid #272727; border-left: 0; border-radius: 0 12px 12px 0; background: var(--background); }
.site-header {
  height: 56px;
  flex: 0 0 56px;
  padding: 0 24px 0 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--background);
}
.header-trigger { width: 28px; height: 28px; margin-left: -4px; border-color: transparent; }
.header-separator { width: 1px; height: 16px; margin: 0 8px; background: var(--border); }
.site-header h1 { font-size: 14px; font-weight: 500; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.service-state, .stripe-state { height: 28px; padding: 0 9px; border: 1px solid var(--border); border-radius: 8px; display: inline-flex; align-items: center; gap: 6px; color: var(--muted-foreground); font-size: 11px; }
.service-state i { width: 6px; height: 6px; border-radius: 50%; background: var(--positive); }
.stripe-state .icon { width: 13px; height: 13px; }
.stripe-state.is-live { color: var(--positive); border-color: color-mix(in srgb, var(--positive) 35%, var(--border)); }
.stripe-state.is-warning { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 35%, var(--border)); }
.stripe-state.is-error { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.email-verification-status { height: 28px; padding: 0 9px; border: 1px solid var(--border); border-radius: 8px; display: inline-flex; align-items: center; font-size: 11px; }
.email-verification-status.success { color: var(--positive); border-color: color-mix(in srgb, var(--positive) 35%, var(--border)); }
.email-verification-status.warning { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 35%, var(--border)); }
.content { min-width: 0; flex: 1; overflow-x: hidden; }
.page-stack { display: flex; flex-direction: column; gap: 24px; padding: 24px 0 10px; }

/* Dashboard cards */
.metric-grid { padding: 0 24px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.metric-card {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: linear-gradient(160deg, #191919 0%, #202020 100%);
  box-shadow: 0 1px 2px rgba(0,0,0,.35);
}
.metric-head { min-width: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; color: var(--muted-foreground); }
.metric-head > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trend-badge { height: 22px; padding: 0 8px; flex: 0 0 auto; border: 1px solid var(--border); border-radius: 8px; display: inline-flex; align-items: center; gap: 4px; color: var(--foreground); font-size: 12px; font-weight: 500; }
.trend-badge .icon { width: 12px; height: 12px; }
.metric-card > strong { font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.025em; line-height: 1.1; }
.metric-foot { display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.metric-foot b { font-weight: 500; }
.metric-foot span { color: var(--muted-foreground); }
.operations-grid { margin-top: -8px; }
.operation-card { padding: 18px 20px; gap: 9px; background: var(--card); }
.operation-card > strong { font-size: 24px; }
.operation-card .trend-badge { display: none; }
.dashboard-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); box-shadow: 0 1px 2px rgba(0,0,0,.35); }
.chart-card { margin: 0 24px; overflow: hidden; }
.card-header { min-height: 72px; padding: 20px 24px 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.card-header h2 { font-size: 15px; font-weight: 600; }
.card-header p { margin-top: 4px; color: var(--muted-foreground); font-size: 13px; }
.range-toggle { height: 32px; border: 1px solid var(--border); border-radius: 8px; display: inline-flex; overflow: hidden; }
.range-toggle button { padding: 0 14px; border: 0; border-left: 1px solid var(--border); background: transparent; font-size: 13px; cursor: pointer; }
.range-toggle button:first-child { border-left: 0; }
.range-toggle button[data-active="true"] { background: var(--accent); }
.chart-body { height: 282px; padding: 16px 12px 12px; position: relative; }
.chart-body svg { width: 100%; height: 250px; overflow: visible; }
.chart-empty { height: 250px; display: grid; place-items: center; color: var(--muted-foreground); font-size: 13px; }
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-area-org { fill: url(#orgGradient); }
.chart-area-trial { fill: url(#trialGradient); }
.chart-line-org { fill: none; stroke: #f0f0f0; stroke-width: 1.35; }
.chart-line-trial { fill: none; stroke: #8d8d8d; stroke-width: 1.25; }
.chart-axis-label { fill: var(--muted-foreground); font: 11px "Geist", sans-serif; }
.chart-legend { position: absolute; top: 16px; left: 24px; display: flex; gap: 14px; color: var(--muted-foreground); font-size: 11px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend i { width: 8px; height: 8px; border-radius: 2px; background: #f0f0f0; }
.chart-legend span:last-child i { background: #8d8d8d; }

/* Dashboard data strip */
.data-section { display: flex; flex-direction: column; gap: 16px; }
.data-toolbar { padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.tabs { padding: 3px; display: inline-flex; gap: 2px; border-radius: 8px; background: var(--muted); }
.tab { height: 28px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--muted-foreground); font-size: 13px; font-weight: 500; cursor: pointer; }
.tab[data-active="true"] { background: #383838; color: #ffffff; box-shadow: inset 0 0 0 1px #4b4b4b, 0 1px 2px rgba(0,0,0,.3); }
.dashboard-tabs { max-width: 100%; overflow-x: auto; }
.dashboard-tabs .tab { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.dashboard-tabs .tab span { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; display: inline-grid; place-items: center; background: #454545; color: #d7d7d7; font-size: 10px; }
.button.is-active { background: #303030; box-shadow: inset 0 0 0 1px #4b4b4b; }
.overview-lists { margin: 0 24px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.overview-table { min-height: 104px; }
.quick-item { min-height: 52px; padding: 7px 10px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.quick-item:first-child { border-top: 0; }
.quick-item:hover { background: #202020; }
.quick-item strong, .quick-item span { display: block; }
.quick-item strong { font-weight: 500; }
.quick-item span { margin-top: 2px; color: var(--muted-foreground); font-size: 12px; }
.quick-item-value { min-width: 145px; text-align: right; }
.quick-item-value .badge { margin-left: auto; }
.quick-item-value b { margin-top: 4px; color: var(--foreground); font-size: 12px; font-weight: 600; }
.money-positive { color: var(--positive) !important; }
.compact-tables .quick-item { min-height: 42px; padding-top: 5px; padding-bottom: 5px; }
.data-footer { min-height: 36px; padding: 0 24px 4px; display: flex; align-items: center; justify-content: space-between; color: var(--muted-foreground); font-size: 12px; }
.pagination { display: flex; align-items: center; gap: 10px; color: var(--foreground); }
.pagination b { font-size: 11px; font-weight: 500; }
.pagination button { width: 28px; height: 28px; border: 1px solid var(--border); border-radius: 7px; background: #171717; color: var(--foreground); }
.pagination button:disabled { color: #5f5f5f; }
.empty-state { min-height: 190px; padding: 28px; display: grid; place-items: center; align-content: center; gap: 8px; text-align: center; color: var(--muted-foreground); }
.empty-state .icon { width: 28px; height: 28px; margin-bottom: 6px; color: #7c7c7c; }
.empty-state strong { color: var(--foreground); font-size: 14px; font-weight: 600; }
.empty-state span { max-width: 430px; line-height: 1.55; font-size: 12px; }

/* Management pages */
.page-toolbar { min-height: 56px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.page-toolbar h1 { font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.page-toolbar p { margin-top: 4px; color: var(--muted-foreground); font-size: 13px; }
.management-grid { padding: 0 24px; display: grid; grid-template-columns: minmax(320px, .72fr) minmax(0, 1.28fr); gap: 16px; align-items: start; }
.form-card, .table-card { min-width: 0; }
.form-card .card-header, .table-card .card-header { padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.card-content { padding: 20px 24px 24px; }
.form-actions { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lookup-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.access-option { margin-top: 16px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; display: flex; align-items: flex-start; gap: 9px; cursor: pointer; }
.access-option input { width: auto; margin-top: 3px; accent-color: #f2f2f2; }
.access-option span, .access-option b, .access-option small { display: block; }
.access-option b { color: var(--foreground); font-size: 12px; }
.access-option small { margin-top: 3px; color: var(--muted-foreground); font-size: 11px; line-height: 1.4; }
.account-card { margin-top: 16px; padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: #202020; }
.account-card > strong, .account-card > span { display: block; }
.account-card > strong { font-weight: 600; }
.account-card > span { margin-top: 2px; color: var(--muted-foreground); font-size: 12px; }
.notice { margin-top: 12px; padding: 10px 11px; border: 1px solid var(--border); border-radius: 7px; color: var(--muted-foreground); font-size: 12px; }
.notice.success { border-color: #265d4c; background: var(--positive-soft); color: var(--positive); }
.notice.error { border-color: #653434; background: var(--danger-soft); color: var(--destructive); }
.term-grid { margin-bottom: 18px; border: 1px solid var(--border); border-radius: 8px; display: grid; grid-template-columns: repeat(3, 1fr); overflow: hidden; }
.term-grid > div { padding: 11px; border-left: 1px solid var(--border); }
.term-grid > div:first-child { border-left: 0; }
.term-grid b, .term-grid span { display: block; }
.term-grid b { font-size: 12px; font-weight: 600; }
.term-grid span { margin-top: 2px; color: var(--muted-foreground); font-size: 10px; }
.table-scroll { overflow: auto; }
table { width: 100%; min-width: 720px; border-collapse: collapse; }
thead { background: var(--muted); }
th { height: 40px; padding: 8px 10px; color: var(--muted-foreground); font-size: 12px; font-weight: 500; text-align: left; white-space: nowrap; }
td { height: 52px; padding: 6px 10px; border-top: 1px solid var(--border); color: var(--muted-foreground); vertical-align: middle; }
tbody tr:hover { background: #202020; }
.primary-cell { color: var(--foreground); font-weight: 500; }
.secondary-line { margin-top: 2px; color: var(--muted-foreground); font-size: 11px; font-weight: 400; }
.row-actions { display: flex; justify-content: flex-end; gap: 5px; }
.row-actions .button, td .button { min-height: 28px; padding: 0 8px; font-size: 11px; }
.empty { padding: 28px 12px; color: var(--muted-foreground); text-align: center; }
.error-cell { color: var(--destructive); }
.badge { min-height: 22px; padding: 0 7px; border: 1px solid var(--border); border-radius: 8px; display: inline-flex; align-items: center; color: var(--muted-foreground); font-size: 11px; font-weight: 500; text-transform: capitalize; }
.badge.active, .badge.converted { color: var(--positive); }
.badge.paused { color: var(--warning); }
.badge.ended { color: var(--muted-foreground); }

.issue-label {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 1px 7px;
  margin: 2px 4px 2px 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  text-transform: lowercase;
}

.issue-label-maintenance {
  border-color: rgba(245, 158, 11, .45);
  background: rgba(245, 158, 11, .12);
  color: #f4b740;
}

.issue-label-bug,
.issue-label-error-report,
.issue-label-app-error {
  border-color: rgba(239, 68, 68, .45);
  background: rgba(239, 68, 68, .12);
  color: #ff8585;
}

.issue-label-incident {
  border-color: rgba(249, 115, 22, .45);
  background: rgba(249, 115, 22, .12);
  color: #ff9a5c;
}

.issue-label-desktop {
  border-color: rgba(96, 165, 250, .45);
  background: rgba(96, 165, 250, .12);
  color: #8fc5ff;
}
.detail-box { margin: 14px 18px 18px; padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: #202020; color: var(--muted-foreground); font-size: 12px; line-height: 1.7; }
.detail-box b { color: var(--foreground); }
.feedback-reward-grid {
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.feedback-invite-card { margin: 0 24px; overflow: hidden; }
.feedback-invite-card .card-content { max-width: 720px; }
.feedback-invite-form { display: grid; grid-template-columns: minmax(260px, 1fr) auto; align-items: end; gap: 12px; }
.feedback-invite-form .form-actions { margin-top: 0; }
.reward-card { min-height: 180px; padding: 24px; display: flex; flex-direction: column; align-items: flex-start; }
.reward-kicker { color: var(--muted-foreground); font-size: 10px; font-weight: 600; letter-spacing: .08em; }
.reward-card > strong { margin-top: 10px; color: var(--foreground); font-size: 20px; font-weight: 600; }
.reward-card > p { max-width: 560px; margin-top: 8px; color: var(--muted-foreground); font-size: 13px; line-height: 1.55; }
.reward-card > div { width: 100%; margin-top: auto; padding-top: 18px; border-top: 1px solid var(--border); color: var(--muted-foreground); font-size: 12px; }
.reward-card > div b { color: var(--foreground); font-size: 18px; }
.feedback-history { margin: 0 24px; overflow: hidden; }
.feedback-comment { max-width: 420px; white-space: normal; line-height: 1.45; }
.badge.completed { color: var(--positive); }
.badge.sent, .badge.processing { color: var(--warning); }
.badge.failed { color: var(--destructive); }

.confirm-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  width: min(520px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card, #171717);
  color: var(--foreground);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .45);
}
.confirm-dialog::backdrop { background: rgba(0, 0, 0, .62); backdrop-filter: blur(3px); }
.confirm-dialog-form { padding: 24px; }
.confirm-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.confirm-dialog-kicker { color: var(--muted-foreground); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.confirm-dialog h2 { margin: 6px 0 0; font-size: 21px; }
.confirm-dialog-message { margin: 18px 0; color: var(--muted-foreground); line-height: 1.55; }
.confirm-dialog-label { display: block; margin-bottom: 8px; color: var(--foreground); font-size: 13px; font-weight: 600; }
.confirm-dialog-label code { color: var(--warning); font-size: 12px; }
.confirm-dialog-input { width: 100%; box-sizing: border-box; padding: 12px 13px; border: 1px solid var(--border); border-radius: 8px; background: var(--background, #101010); color: var(--foreground); font: inherit; outline: none; }
.confirm-dialog-input:focus { border-color: var(--primary, #6d7cff); box-shadow: 0 0 0 3px rgba(109, 124, 255, .2); }
.confirm-dialog-error { margin: 8px 0 0; color: var(--destructive); font-size: 12px; }
.confirm-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.confirm-dialog-actions .button:disabled { cursor: not-allowed; opacity: .45; }
#mfaRecaptchaContainer {
  min-height: 78px;
  margin: 14px 0;
  display: flex;
  justify-content: center;
}
body:has(#mfaDialog[open])::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, .62);
  backdrop-filter: blur(3px);
}
#mfaDialog[open] {
  z-index: 1001;
}
#mfaSignInRecaptchaContainer {
  position: fixed;
  top: -10000px;
  left: -10000px;
  width: 304px;
  height: 78px;
  overflow: hidden;
}

.app-shell.sidebar-collapsed .sidebar { margin-left: -288px; }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .management-grid { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; box-shadow: 12px 0 30px rgba(0,0,0,.09); transform: translateX(-100%); transition: transform .2s ease; }
  .app-shell.sidebar-open .sidebar { transform: translateX(0); }
  .app-shell.sidebar-collapsed .sidebar { margin-left: 0; }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 29; background: rgba(0,0,0,.2); }
  .app-shell.sidebar-open .sidebar-backdrop { display: block; }
  .service-state { display: none; }
  .feedback-reward-grid { grid-template-columns: 1fr; }
  .range-toggle button { padding: 0 10px; }
}
@media (max-width: 620px) {
  .auth-shell { padding: 14px; }
  .login-card { padding: 24px; }
  .site-header { padding-right: 12px; }
  .metric-grid { padding: 0 14px; grid-template-columns: 1fr; }
  .chart-card, .overview-lists, .feedback-invite-card { margin-right: 14px; margin-left: 14px; }
  .data-toolbar, .data-footer, .page-toolbar, .management-grid, .feedback-reward-grid { padding-right: 14px; padding-left: 14px; }
  .feedback-history { margin-right: 14px; margin-left: 14px; }
  .feedback-invite-form { grid-template-columns: 1fr; }
  .data-toolbar, .page-toolbar { align-items: flex-start; flex-direction: column; }
  .data-toolbar .button { width: 100%; }
  .range-toggle { display: none; }
  .card-header { padding-right: 18px; padding-left: 18px; }
  .card-content { padding: 18px; }
  .form-row, .term-grid { grid-template-columns: 1fr; }
  .term-grid > div { border-top: 1px solid var(--border); border-left: 0; }
  .term-grid > div:first-child { border-top: 0; }
}
