@import url("https://fonts.googleapis.com/css2?family=Lexend:wght@400;500;600;700;800&display=swap");

:root {
  --muted: #526078;
  --muted-strong: #475569;
}

html {
  font-family: "Lexend", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body,
button,
input,
select,
textarea {
  font-family: "Lexend", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  object-fit: contain;
  border-radius: 9px;
  background: #fff;
  padding: 4px;
}

.sidebar .brand-logo-light {
  background: transparent;
  padding: 1px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
}

.sidebar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.shell {
  transition: grid-template-columns .22s ease;
}

.sidebar {
  z-index: 10;
  transition: padding .22s ease;
}

.sidebar-collapse {
  position: absolute;
  top: 72px;
  right: -15px;
  z-index: 12;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid #dbe2ea;
  border-radius: 999px;
  background: #fff;
  color: #172554;
  box-shadow: 0 5px 15px rgba(15, 23, 42, .18);
  cursor: pointer;
  transition: transform .22s ease, background-color .15s ease, color .15s ease;
}

.sidebar-collapse:hover {
  background: #eff6ff;
  color: #1d4ed8;
}

.sidebar-collapse:focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 2px;
}

.nav-title {
  color: #a8b5c9;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav a .icon {
  width: 17px;
  height: 17px;
  color: #94a3b8;
}

.nav a:hover .icon,
.nav a.active .icon {
  color: #bfdbfe;
}

.subtle,
.empty,
.checkout-footer,
.present-payment code {
  color: var(--muted);
}

th,
.eyebrow {
  color: var(--muted-strong);
}

.btn {
  gap: 8px;
}

.grid > * {
  min-width: 0;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr);
}

.branding-grid {
  margin-top: 18px;
}

.branding-grid h2,
.panel h2,
.plan-card h2 {
  margin-top: 0;
}

.channel-total {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.channel-total:last-child {
  border-bottom: 0;
}

.page-toolbar {
  justify-content: space-between;
}

.checkbox-field label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

.checkbox-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--brand);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mobile-menu-toggle,
.sidebar-close,
.sidebar-backdrop {
  display: none;
}

.topbar-primary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.workspace-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-loader {
  position: fixed;
  inset: 64px 0 0 240px;
  z-index: 15;
  display: grid;
  place-items: center;
  background: rgba(245, 247, 251, .82);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: left .22s ease, opacity .18s ease, visibility .18s ease;
}

.page-loader-anon {
  inset: 0;
}

.page-loading .page-loader {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.page-loader-inner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: var(--brand);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 35px rgba(15, 23, 42, .12);
  font-size: 14px;
  font-weight: 700;
}

.page-spinner {
  width: 22px;
  height: 22px;
  animation: page-spin .8s linear infinite;
}

.notice.is-loading {
  display: flex !important;
  align-items: center;
  gap: 10px;
}

.notice.is-loading::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border: 2px solid #93c5fd;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: page-spin .8s linear infinite;
}

@keyframes page-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .page-spinner { animation-duration: 1.6s; }
  .page-loader,
  .shell,
  .sidebar,
  .sidebar-collapse { transition: none; }
}

@media (min-width: 901px) {
  html.sidebar-collapsed .shell {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  html.sidebar-collapsed .sidebar {
    padding-inline: 10px;
  }

  html.sidebar-collapsed .sidebar-head,
  html.sidebar-collapsed .brand,
  html.sidebar-collapsed .nav a {
    justify-content: center;
  }

  html.sidebar-collapsed .brand {
    padding-inline: 0;
  }

  html.sidebar-collapsed .brand > span,
  html.sidebar-collapsed .nav-title,
  html.sidebar-collapsed .nav a > span {
    display: none;
  }

  html.sidebar-collapsed .nav a {
    gap: 0;
    min-height: 40px;
    padding-inline: 10px;
  }

  html.sidebar-collapsed .sidebar-collapse {
    transform: rotate(180deg);
  }

  html.sidebar-collapsed .page-loader {
    left: 76px;
  }
}

@media (max-width: 900px) {
  .sidebar-collapse {
    display: none;
  }

  .sidebar {
    display: block;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: min(320px, 86vw);
    height: 100vh;
    transform: translateX(-102%);
    transition: transform .22s ease;
    overflow-y: auto;
    box-shadow: 18px 0 45px rgba(15, 23, 42, .25);
  }

  .nav-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 35;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(15, 23, 42, .52);
  }

  .nav-open .sidebar-backdrop {
    display: block;
  }

  .sidebar-close,
  .mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
  }

  .sidebar-close {
    color: #e2e8f0;
    background: #1e293b;
    border-color: #334155;
  }

  .topbar {
    z-index: 20;
    padding: 0 16px;
  }

  .page-loader {
    left: 0;
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body.nav-open {
    overflow: hidden;
  }
}

@media (max-width: 760px) {
  .branding-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-toolbar {
    align-items: flex-start;
  }
}

@media (max-width: 520px) {
  .topbar {
    min-height: 64px;
    height: auto;
    gap: 8px;
  }

  .workspace-name {
    max-width: 125px;
    font-size: 14px;
  }

  .topbar-actions {
    flex-wrap: nowrap;
    gap: 6px;
  }

  .topbar-actions .btn {
    width: 40px;
    height: 40px;
    padding: 0;
  }

  .topbar-actions .btn-label {
    display: none;
  }

  .page-toolbar {
    display: grid;
    gap: 12px;
  }

  .page-toolbar > .toolbar {
    justify-content: flex-start;
  }
}
