@font-face {
  font-family: Inter;
  src: url('../marketing/fonts/inter.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --surface: #ffffff;
  --canvas: #f5f7fa;
  --ink: #18253b;
  --muted: #647187;
  --border: #e1e6ee;
  --navy: #122139;
  --nav-text: #b7c3d5;
  --accent: #b52338;
  --sidebar-width: 252px;
  font-family: Inter, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-size: 14px;
  line-height: 1.55;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: #285a9f; text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, .button { touch-action: manipulation; }
[hidden] { display: none !important; }
.bi { line-height: 1; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  background: var(--navy);
  color: var(--nav-text);
  z-index: 40;
}
.sidebar-brand {
  height: 84px;
  min-height: 84px;
  padding: 26px 26px;
  background: var(--surface);
  display: flex;
  align-items: center;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.sidebar-brand > a { display: block; width: 198px; }
.sidebar-content { padding: 26px 16px; overflow-y: auto; flex: 1; }
.workspace-label { display: flex; gap: 11px; align-items: center; margin: 0 8px 30px; }
.workspace-label strong { display: block; font-size: 13px; color: #f7f9fc; font-weight: 600; }
.workspace-label div > span { display: block; font-size: 11px; margin-top: 2px; color: #aebcd0; }
.workspace-mark { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #405069; border-radius: 8px; font-size: 17px; }
nav { display: flex; flex-direction: column; gap: 6px; }
.nav-heading { text-transform: uppercase; letter-spacing: 1.5px; font-size: 10px; font-weight: 650; color: #a0afc4; padding: 0 12px; margin: 0 0 7px; }
.nav-heading:not(:first-child) { margin-top: 28px; }
nav a { min-height: 46px; display: flex; align-items: center; gap: 12px; padding: 11px 13px; color: var(--nav-text); border-radius: 6px; border: 1px solid transparent; transition: background 160ms, color 160ms; }
nav a .bi { font-size: 17px; }
nav a:hover { background: #20324d; color: white; text-decoration: none; }
nav a[aria-current] { color: white; background: #293c58; border-color: #40536d; font-weight: 600; box-shadow: inset 3px 0 0 #e35767; }
.sidebar-account { border-top: 1px solid #304057; padding: 22px 20px 10px; display: flex; gap: 10px; align-items: center; }
.avatar { flex: 0 0 34px; width: 34px; height: 34px; background: #344760; color: #fff; border-radius: 50%; display: grid; place-items: center; font-weight: 600; }
.account-copy { min-width: 0; }
.account-copy strong { display: block; font-weight: 550; font-size: 12px; color: #fff; }
.account-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: #bac6d7; margin-top: 2px; }
.signout-form { padding: 0 16px 20px; }
.signout-form button { display: flex; gap: 11px; align-items: center; width: 100%; color: #c8d3e2; background: transparent; border-color: transparent; text-align: left; font-size: 12px; }
.signout-form button:hover { color: #fff; background: #20324d; }
.owner-app .owner-workspace { margin-left: var(--sidebar-width); }
.owner-workspace { min-height: 100dvh; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 84px; padding: 0 34px; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.topbar-location { display: flex; align-items: center; gap: 14px; min-width: 0; font-size: 12px; }
.topbar-location > span, .breadcrumb-separator { color: var(--muted); }
.topbar-location strong { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breadcrumb-separator { font-size: 9px; }
.topbar-account { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.topbar-account .bi { font-size: 20px; }
.menu-toggle, .sidebar-close { display: none !important; }
main { width: 100%; max-width: 1600px; margin: 0 auto; padding: 34px; flex: 1; min-width: 0; }
h1 { font-size: 27px; letter-spacing: -.8px; line-height: 1.25; margin: 0; font-weight: 650; overflow-wrap: anywhere; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 18px; }
h3 { font-size: 14px; font-weight: 600; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 0 0 28px; }
.page-description { color: var(--muted); margin: 7px 0 0; font-size: 13px; }
.page-actions { flex-shrink: 0; }
.page-actions:empty { display: none; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 30px; }
.metrics > section { border: 1px solid var(--border); border-radius: 8px; background: #fff; padding: 21px; min-width: 0; }
.metric-label { display: flex; justify-content: space-between; gap: 10px; align-items: center; color: var(--muted); font-size: 12px; font-weight: 500; }
.metric-label .bi { color: #77869e; font-size: 17px; }
.metrics strong { display: block; font-size: 32px; letter-spacing: -1px; line-height: 1.2; font-weight: 600; margin-top: 19px; font-variant-numeric: tabular-nums; }
.metric > a, .metric-note { display: block; margin-top: 16px; font-size: 11px; color: var(--muted); }
.metric > a { color: #285a9f; }
.metric > a .bi { margin-left: 5px; }
.metrics section > span { color: var(--muted); font-size: 12px; }
.metrics section > span.metric-note { font-size: 11px; }
.panel, .data-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 24px; }
.panel { padding: 25px; }
.panel-heading { padding: 23px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.panel-heading h2 { margin: 0; }
.panel-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: 7px; background: #fff; }
.data-panel .table-wrap { border-left: 0; border-right: 0; border-radius: 0; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
th { font-size: 11px; font-weight: 600; color: var(--muted); background: #f9fafc; }
td, th { padding: 16px 20px; border-bottom: 1px solid #eaf0f5; }
td { font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafcfe; }
td:first-child { white-space: normal; min-width: 150px; }
.company-link { font-weight: 550; color: var(--ink); }
.amount { font-variant-numeric: tabular-nums; font-weight: 550; }
.badge { display: inline-flex; align-items: center; min-height: 25px; padding: 3px 9px; background: #f0f3f8; border: 1px solid #e0e6ef; color: #485872; border-radius: 5px; font-size: 10px; font-weight: 550; white-space: nowrap; }
.badge[data-state=redeemed], .badge[data-state=active] { background: #edf7f2; border-color: #d1e8dc; color: #236342; }
.badge[data-state=pending], .badge[data-state=test] { background: #fff7e8; border-color: #f1e2bc; color: #805c16; }
.coupon-code { font-variant-numeric: tabular-nums; font-family: ui-monospace, monospace; font-size: 11px; }
.panel-footer { padding: 16px 24px; display: flex; justify-content: space-between; gap: 15px; color: var(--muted); font-size: 11px; }
.panel-footer a .bi { margin-left: 6px; }
.empty-state { padding: 42px 20px; text-align: center; white-space: normal; }
.empty-state > .bi { display: inline-grid; place-items: center; width: 46px; height: 46px; border: 1px solid var(--border); color: #7b899d; background: #f7f9fc; border-radius: 10px; font-size: 22px; }
.empty-state h3 { margin: 16px 0 5px; }
.empty-state p { margin: 0 0 17px; color: var(--muted); }
.overview-links { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.overview-link { display: flex; align-items: center; gap: 15px; border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 23px; color: var(--ink); transition: border-color 160ms, background 160ms; }
.overview-link:hover { background: #fafcfe; border-color: #b7c6d9; text-decoration: none; }
.overview-link > .bi { margin-left: auto; color: var(--muted); }
.overview-link h2 { margin: 0 0 5px; font-size: 13px; }
.overview-link p { color: var(--muted); margin: 0; font-size: 11px; }
.link-icon { display: grid; place-items: center; flex: 0 0 42px; height: 42px; background: #f1f4f9; color: #506580; border-radius: 7px; font-size: 20px; }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 42px; padding: 10px 15px; border: 1px solid #19334f; background: #19334f; color: white; border-radius: 5px; cursor: pointer; font-size: 12px; font-weight: 550; line-height: 1.4; transition: background 160ms, border-color 160ms; }
button:hover, .button:hover { background: #2b4c70; border-color: #2b4c70; text-decoration: none; }
button:active, .button:active { background: #10253d; }
.quiet { color: #344960; background: #fff; border-color: #d4dce6; }
.quiet:hover { color: var(--ink); background: #f0f4f9; border-color: #becadb; }
.icon-button { background: transparent; border-color: transparent; color: var(--ink); width: 44px; height: 44px; padding: 0; font-size: 22px; }
.icon-button:hover { background: #eff3f8; border-color: transparent; }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 22px; }
.toolbar label { font-size: 12px; font-weight: 550; }
.toolbar span, .muted { color: var(--muted); }
.toolbar input { width: 290px; max-width: 100%; }
.page-actions .toolbar { margin: 0; }
input, select, textarea { padding: 10px 12px; min-height: 42px; border: 1px solid #ccd5e1; border-radius: 5px; background: #fff; color: var(--ink); font-size: 13px; max-width: 100%; }
input[type=checkbox] { width: 17px; min-height: 17px; accent-color: #294d75; }
input:disabled, select:disabled { background: #f1f3f7; color: var(--muted); }
textarea { width: 100%; }
.edit-form { max-width: 760px; padding: 28px; }
.edit-form p { margin: 0 0 22px; }
.edit-form label, .auth label { display: block; font-weight: 550; font-size: 12px; margin-bottom: 7px; }
.edit-form input:not([type=checkbox]), .edit-form select, .auth input { width: 100%; }
.helptext { display: block; color: var(--muted); font-size: 11px; margin-top: 7px; }
.errorlist { color: #a12336; padding-left: 20px; }
.notice { padding: 14px 18px; background: #fff6e4; border: 1px solid #ecd49a; border-radius: 5px; }
.pagination { display: flex; gap: 15px; align-items: center; margin-top: 22px; font-size: 12px; }
dl { display: grid; grid-template-columns: 185px 1fr; gap: 13px 20px; margin: 0; font-size: 13px; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.log-output { background: #132238; color: #dde6f3; border: 1px solid #2b3c55; padding: 23px; border-radius: 7px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; line-height: 1.7; max-height: 70vh; overflow: auto; }
.workspace-footer { display: flex; justify-content: space-between; gap: 20px; margin: 0 34px; padding: 20px 0; border-top: 1px solid var(--border); color: #657187; font-size: 10px; }
.workspace-footer span:first-child { font-weight: 600; }
:focus-visible { outline: 3px solid #5687ce; outline-offset: 3px; }
.skip { position: fixed; top: -70px; left: 16px; padding: 12px; background: white; z-index: 100; }
.skip:focus { top: 12px; }
ol { padding-left: 20px; }
li { margin-bottom: 12px; }
.sidebar-backdrop { position: fixed; inset: 0; z-index: 30; border: 0; border-radius: 0; background: #10213b80; }
.sidebar-backdrop:hover { background: #10213b80; }

.owner-auth { background: #f3f6fa; }
.owner-auth .owner-workspace { max-width: 480px; margin: auto; padding: 70px 20px 20px; }
.auth-brand { text-align: center; padding: 0 0 30px; }
.auth-brand > a { display: block; width: 228px; margin: 0 auto 15px; }
.auth-brand > span { font-size: 12px; color: var(--muted); }
.owner-auth main { padding: 0; flex: 0; }
.owner-auth .page-heading { margin: 0; border: 1px solid var(--border); border-bottom: 0; background: white; padding: 28px 30px 0; border-radius: 9px 9px 0 0; }
.owner-auth h1 { font-size: 22px; }
.owner-auth .auth { padding: 12px 30px 30px; border-radius: 0 0 9px 9px; border-top: 0; }
.auth > p { color: var(--muted); margin: 0 0 24px; font-size: 13px; }
.auth form p { margin-bottom: 19px; }
.auth button { width: 100%; margin-top: 5px; }
.owner-auth .workspace-footer { margin: 0; }

@media (max-width: 1200px) {
  :root { --sidebar-width: 232px; }
  main { padding: 28px; }
  .topbar { padding: 0 28px; }
  .sidebar-brand { padding: 24px; }
  .metrics { gap: 12px; }
  .metrics > section { padding: 18px; }
  .metric-label { align-items: flex-start; }
}

@media (max-width: 1023px) {
  .owner-app .owner-workspace { margin-left: 0; }
  .sidebar { position: relative; width: 100%; }
  .sidebar-content { padding: 18px; }
  .workspace-label, .sidebar-account, .signout-form { display: none; }
  nav { display: flex; flex-direction: row; flex-wrap: wrap; }
  .nav-heading { display: none; }
  .js .sidebar { position: fixed; width: 270px; transform: translateX(-100%); visibility: hidden; transition: transform 200ms ease, visibility 200ms; }
  .js .sidebar-content { padding: 26px 16px; }
  .js .sidebar .workspace-label, .js .sidebar .sidebar-account { display: flex; }
  .js .sidebar .signout-form, .js .sidebar .nav-heading { display: block; }
  .js .sidebar nav { flex-direction: column; }
  .js .menu-toggle, .js .sidebar-close { display: inline-flex !important; flex-shrink: 0; }
  .sidebar-close { margin-left: auto; }
  .sidebar-brand { padding: 20px; gap: 5px; }
  .sidebar-brand > a { width: 178px; }
  .sidebar-open { overflow: hidden; }
  .sidebar-open .sidebar { transform: translateX(0); visibility: visible; }
  .topbar { height: 72px; padding: 0 22px; }
  .metrics { gap: 15px; }
  .metrics > section { padding: 21px; }
  .metric-label { font-size: 12px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  main { padding: 24px 18px; }
  .topbar { padding: 0 10px; }
  .topbar-location { gap: 9px; }
  .topbar-location > span, .breadcrumb-separator, .topbar-account { display: none; }
  h1 { font-size: 25px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 16px; margin-bottom: 23px; }
  .page-actions { width: 100%; }
  .metrics { gap: 12px; margin-bottom: 22px; }
  .metrics > section { padding: 16px; }
  .metric-label { font-size: 11px; gap: 6px; min-height: 34px; }
  .metric-label .bi { font-size: 15px; }
  .metrics strong { font-size: 30px; margin-top: 12px; }
  .metric-note { line-height: 1.5; }
  .overview-links { grid-template-columns: 1fr; gap: 12px; }
  .overview-link { padding: 18px; }
  .panel-heading { padding: 19px 17px; align-items: flex-start; }
  .panel-heading p { max-width: 200px; line-height: 1.6; }
  .panel-heading h2 { font-size: 14px; }
  .panel-footer { padding: 15px 17px; flex-wrap: wrap; }
  td, th { padding: 13px 16px; }
  button, .button, input, select { min-height: 44px; }
  input, select, textarea { font-size: 16px; }
  .toolbar { gap: 10px; }
  .toolbar label { width: 100%; }
  .toolbar input { flex: 1; width: 170px; }
  .panel, .edit-form { padding: 20px; }
  dl { grid-template-columns: 1fr; gap: 4px; }
  dd { margin-bottom: 12px; }
  .workspace-footer { margin: 0 18px; }
  .owner-auth .owner-workspace { padding-top: 45px; }
  .owner-auth .page-heading { padding: 26px 24px 0; }
  .owner-auth .auth { padding: 12px 24px 26px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
