:root {
  --sidebar-width: 260px;
  --sidebar-bg: #ffffff;
  --sidebar-text: #1f2937;
  --accent: #0256ff;
  --accent-contrast: #ffffff;
  --accent-tint: #e9f0ff;
  --accent-outline: rgba(2, 86, 255, 0.35);
  --hover-bg: #f3f4f6;
  --pressed-bg: #eceff3;
  --content-bg: #f7f9fc;
  --content-text: #111827;
  --border-color: #e5e7eb;
  --radius: 4px;
  --transition-fast: 140ms ease-out;
  --transition-medium: 220ms cubic-bezier(0.22, 1, 0.36, 1);

  --chart-size: 240px;
  --logs-cols: 1fr 1fr 1fr 1fr 1fr;
  --users-cols: repeat(5, 1fr);
  --actions-cols: repeat(5, 1fr);
  --filters-cols: minmax(140px, 1fr) minmax(240px, 2fr) max-content max-content;
  --blue: #0047f3;
  --white: #ffffff;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { background-color: var(--white); }
code, pre, kbd, samp { font-family: inherit; }
body {
  margin: 0;
  color: var(--content-text);
  background: var(--content-bg);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
}
body.auth-bg {
  background-color: var(--white);
  min-height: 100vh;
  overflow: hidden;
  overscroll-behavior: none;
}
.loading-screen {
  position: fixed;
  inset: 0;
  background: #fff;
  display: grid;
  place-items: center;
  z-index: 9999;
  transition: opacity 320ms ease, visibility 320ms ease;
}
.loading-orb {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(255,255,255,0.96), rgba(255,255,255,0.75));
}
.loading-orb::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid #e3ebff;
  border-top-color: var(--accent);
  animation: loadingSpin 900ms linear infinite;
}
.loading-logo {
  width: 44px;
  opacity: 0.95;
  position: relative;
}
body.loader-active {
  position: fixed;
  width: 100%;
  top: var(--loader-scroll-lock, 0px);
  left: 0;
  right: 0;
  overflow: hidden;
  padding-right: var(--loader-scroll-pad, 0px);
}
.app-loaded .loading-screen {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
@keyframes loadingSpin {
  to { transform: rotate(360deg); }
}
.content { position: relative; z-index: 0; }
.auth-container { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-container .modal-card,
.auth-container .chart-card {
  width: 420px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.12);
  padding: 16px;
}
.auth-container .chart-card { width: 480px; }
.auth-container .chart-title { text-align: left; margin-bottom: 12px; }
@media (max-width: 640px) {
  .auth-container .modal-card,
  .auth-container .chart-card { width: 94vw; max-width: 480px; }
}
@media (max-width: 640px) {
  body.auth-bg .content.no-shell { padding: 0; min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; }
  body.auth-bg .auth-container { padding: 20px; min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; }
  body.auth-bg .auth-container .modal-card { width: 100%; max-width: 420px; margin: 0 auto; }
  body.auth-bg .auth-container .modal-title { text-align: left; }
  body.auth-bg .auth-container .modal-actions { display: flex; flex-direction: column; gap: 10px; }
  body.auth-bg .auth-container .form-help { text-align: left; }
}
@supports (padding: env(safe-area-inset-top)) {
  body.auth-bg .auth-container {
    padding-top: calc(20px + env(safe-area-inset-top));
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    padding-left: calc(20px + env(safe-area-inset-left));
    padding-right: calc(20px + env(safe-area-inset-right));
  }
}
.auth-wizard { display: grid; gap: 10px; height: 620px; max-height: 85vh; grid-template-rows: auto auto auto 1fr auto; }
.wizard-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 4px 0 8px; }
.step-chip { display: grid; place-items: center; height: 36px; border: 1px solid var(--border-color); border-radius: var(--radius); background: #fff; font-size: 12px; color: #6b7280; }
.step-chip.active { border-color: var(--accent); color: var(--accent); background: var(--accent-tint); }
.wizard-body { display: block; overflow: auto; padding-bottom: 8px; }
.wizard-step { display: block; }
.wizard-step[hidden] { display: none !important; }
.wizard-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.wizard-actions #wizFinish { grid-column: span 2; }
.pw-meter { width: 100%; height: 8px; border: 1px solid var(--border-color); border-radius: 999px; background: #fff; margin-top: 6px; overflow: hidden; }
.pw-meter .pw-fill { height: 100%; width: 0%; background: #ef4444; transition: width .2s ease, background-color .2s ease; }
.auth-secret-row { display: grid; grid-template-columns: 1fr max-content; gap: 8px; }
.auth-wizard .filters-form.compact { row-gap: 8px; grid-template-columns: 1.2fr 1fr; }
@media (max-width: 720px) { .auth-wizard .filters-form.compact { grid-template-columns: 1fr; } }
.auth-wizard .filter-field { gap: 8px; }
.auth-wizard .filter-field.optional { opacity: 0.6; }
.auth-wizard .wizard-note { margin-top: 12px; border: 1px dashed var(--border-color); border-radius: var(--radius); padding: 10px; }
.auth-wizard .wizard-note .note-title { font-size: 13px; font-weight: 600; color: var(--content-text); }
.auth-wizard .wizard-note .note-desc { font-size: 12px; color: #6b7280; margin-top: 4px; }
.auth-wizard .auth-qr { display: grid; place-items: center; margin-top: 8px; grid-column: 2; align-self: start; }
.auth-wizard .auth-qr img { width: 100%; max-width: 240px; aspect-ratio: 1 / 1; height: auto; border: 1px solid var(--border-color); border-radius: 8px; background: #fff; }
.auth-wizard .plans-table { display: grid; gap: 10px; --plans-cols: 1.3fr 1fr 1fr 1fr 1fr 1fr; }
.auth-wizard .plans-header { display: grid; grid-template-columns: var(--plans-cols); gap: 10px; align-items: center; padding: 8px 12px; border: 1px solid var(--border-color); border-radius: var(--radius); background: #fff; font-size: 13px; color: var(--content-text); }
.auth-wizard .plans-list { display: grid; gap: 10px; list-style: none; padding: 0; margin: 0; }
.auth-wizard .plan-row { display: grid; grid-template-columns: var(--plans-cols); align-items: center; gap: 10px; padding: 10px 12px; background: #fff; border: 1px solid var(--border-color); border-radius: var(--radius); filter: drop-shadow(0 2px 0 rgba(17, 24, 39, 0.05)); }
.auth-wizard .plan-row:hover { background: var(--hover-bg); }
.auth-wizard .plan-cell { font-size: 13px; color: var(--content-text); line-height: 20px; }
.auth-wizard .plan-name { font-size: 13px; font-weight: 600; color: var(--content-text); }
.auth-wizard .plan-price { font-size: 13px; color: var(--accent); font-weight: 600; }
.auth-wizard .plan-row.selected { border-color: var(--accent); background: var(--accent-tint); }
.auth-wizard .plans-header span:last-child { text-align: left; }
.auth-wizard .plan-row .plan-cell:last-child { justify-self: start; }
.auth-wizard .plan-row .filter-check { justify-content: flex-start; }
.auth-container .modal-title { text-align: left; }
.auth-container .modal-title.login-title { font-size: 20px; }
.auth-container .modal-subtitle { text-align: left; }
.auth-container .form-help { text-align: left; }
.auth-container .form-help a { color: #111; text-decoration: none; }
.auth-container .form-help a:hover,
.auth-container .form-help a:focus,
.auth-container .form-help a:active,
.auth-container .form-help a:visited { color: #111; text-decoration: none; }
.auth-container .modal-list { margin-top: 8px; }
.auth-container .modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auth-container .qa-btn { height: 40px; }
.auth-container .qa-btn .qa-label { font-size: 13px; }
.auth-container .modal-list .qa-btn { justify-content: center; }
.auth-container .modal-list .qa-btn.qa-ghost { color: #111; border-color: #111; }
.auth-container .filter-field input[type="text"],
.auth-container .filter-field input[type="email"],
.auth-container .filter-field input[type="password"],
.auth-container .filter-field textarea,
.auth-container .filter-field select { height: 44px; }

button, input, select, textarea { font-family: inherit; }

a { -webkit-tap-highlight-color: transparent; }

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  padding: 16px 8px 8px;
  overflow-y: auto;
  overflow-x: hidden;
  will-change: width, padding;
  contain: layout paint;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  height: 48px;
  margin-bottom: 16px;
  font-weight: 600;
  background: var(--hover-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  cursor: pointer;
}
.brand-name {
  color: var(--accent);
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--transition-medium), flex-basis var(--transition-medium), margin var(--transition-medium);
  max-width: 140px;
  position: relative;
  flex: 0 1 140px;
  will-change: opacity, flex-basis;
}

.brand-logo {
  display: inline-block;
  width: 24px;
  height: 24px;
  object-fit: contain;
  transform: scale(0.92);
  transform-origin: center;
  will-change: transform;
  transition: transform var(--transition-medium);
}
.brand:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.menu { list-style: none; padding: 0; margin: 12px 0 0 0; }
.sidebar nav { flex: 1; }
.menu li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  height: 48px;
  margin: 6px 0;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: var(--radius);
  transition: background-color var(--transition-fast), border-left-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
}
.menu li a .label {
  font-weight: 500;
  letter-spacing: 0.1px;
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--transition-medium), flex-basis var(--transition-medium);
  max-width: 160px;
  position: relative;
  flex: 0 1 160px;
  will-change: opacity, flex-basis;
}

.brand-name::after,
.menu li a .label::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 24px;
  pointer-events: none;
  background: linear-gradient(to left, var(--sidebar-bg) 0%, rgba(255, 255, 255, 0) 100%);
  opacity: 0;
  transition: opacity var(--transition-medium);
}

body.sidebar-collapsed .brand-name::after,
body.sidebar-collapsed .menu li a .label::after {
  opacity: 1;
}

.menu li a:hover {
  background: var(--hover-bg);
}

.menu li a:active { 
  background: var(--pressed-bg);
  box-shadow: inset 0 0 0 1px var(--border-color);
}
.menu li a.active {
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: none;
}
.menu li a.active .label { font-weight: 600; }
.icon { width: 24px; text-align: center; color: var(--sidebar-text); }
.menu li a .icon { flex: 0 0 24px; }
.material-symbols-rounded {
  font-variation-settings:
    'FILL' 1,
    'wght' 500,
    'GRAD' 0,
    'opsz' 24;
  font-size: 22px;
  line-height: 1;
  color: currentColor;
}

.menu li a.active .material-symbols-rounded {
  font-variation-settings:
    'FILL' 1,
    'wght' 600,
    'GRAD' 0,
    'opsz' 24;
  color: currentColor;
}

.menu li a.active .icon { color: var(--accent-contrast); }
.menu li a.active .label { color: var(--accent-contrast); }

.menu li a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.collapse-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 20px;
  cursor: pointer;
  transition: color var(--transition-fast);
}
.collapse-btn:hover { color: #003ecb; }

@media (prefers-reduced-motion: reduce) {
  .menu li a,
  .collapse-btn { transition: none; }
}

.menu li a.active:active { background: #0146d5; }

.content {
  margin-left: var(--sidebar-width);
  padding: 16px;
  will-change: margin-left;
  position: relative;
  z-index: 1;
}
.content.no-shell { margin-left: 0; display: grid; place-items: center; min-height: 100vh; }

.page-header { margin: 0 0 16px 0; }
.page-title-wrap { display: flex; align-items: flex-start; gap: 12px; }
.page-title { margin: 0; font-size: 22px; font-weight: 600; color: var(--content-text); }
.page-subtitle { margin: 2px 0 0; font-size: 13px; color: #6b7280; }
.page-title-icon { font-size: 24px; line-height: 1; color: var(--accent); }

.page-actions { margin-left: auto; position: relative; display: flex; gap: 12px; align-items: center; }
.qa-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 12px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
  font-family: inherit;
  border-radius: var(--radius);
  cursor: pointer;
  filter: drop-shadow(0 3px 0 rgba(17, 24, 39, 0.08));
  text-decoration: none;
}
.qa-btn .qa-label { font-weight: 500; letter-spacing: 0.1px; }
.qa-btn .material-symbols-rounded { font-size: 18px; color: var(--accent-contrast); }
.qa-btn .qa-caret { color: var(--accent-contrast); transition: transform 0.15s ease; }
.qa-btn[aria-expanded="true"] .qa-caret { transform: rotate(180deg); }
.qa-btn:hover { background: #0146d5; }
.qa-btn:active { background: #0140bf; }
.qa-btn:focus-visible { outline: 2px solid var(--accent-outline); outline-offset: 2px; }
.qa-btn.qa-sm { height: 40px; }

@media (max-width: 768px) {
  .page-title-wrap { flex-direction: column; align-items: stretch; gap: 10px; }

  .page-actions .qa-menu {
    position: absolute;
    left: -16px;
    right: -16px;
    top: calc(100% + 1px);
    bottom: auto;
    width: auto;
    min-width: 0;
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 8px 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    transform-origin: top center;
    transform: translateY(-10px);
    opacity: 0;
  }
  .page-actions .qa-menu.open {
    transform: translateY(0);
    opacity: 1;
  }
  .page-actions .qa-menu .qa-item {
    padding: 12px 14px;
    font-size: 14px;
    border-radius: var(--radius);
  }
}

.menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--border-color);
  background: #fff;
  color: var(--content-text);
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  filter: drop-shadow(0 3px 0 rgba(17, 24, 39, 0.06));
  width: 48px;
  justify-content: center;
}
.menu-btn:hover { background: var(--hover-bg); }
.menu-btn:active { background: var(--pressed-bg); }
.menu-btn:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(2,86,255,0.18); }
.menu-btn .material-symbols-rounded { font-size: 18px; color: inherit; }
.menu-btn .qa-label { display: none; }

.qa-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--content-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  padding: 6px;
  z-index: 2000;
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  visibility: hidden;
  pointer-events: none;
  transform-origin: top right;
  transition: opacity var(--transition-fast), transform var(--transition-medium);
}
.qa-menu.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
  pointer-events: auto;
}
.qa-item {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: none;
  background: transparent;
  color: var(--content-text);
  font-family: inherit;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}
.qa-item:hover { background: var(--hover-bg); }

body.sidebar-collapsed .sidebar { width: 64px; }
html.sidebar-collapsed .sidebar { width: 64px; }
body.sidebar-collapsed { overflow-x: hidden; }
html.sidebar-collapsed { overflow-x: hidden; }

body.sidebar-collapsed .brand-name,
body.sidebar-collapsed .menu li a .label {
  max-width: 0;
  opacity: 0;
  margin-left: 0;
  flex-basis: 0;
}
html.sidebar-collapsed .brand-name,
html.sidebar-collapsed .menu li a .label {
  max-width: 0;
  opacity: 0;
  margin-left: 0;
  flex-basis: 0;
}
body.sidebar-collapsed .content { margin-left: 64px; }
html.sidebar-collapsed .content { margin-left: 64px; }
body.sidebar-collapsed .content { overflow-x: hidden; }
html.sidebar-collapsed .content { overflow-x: hidden; }

.sidebar-profile {
  margin-top: auto;
  padding: 16px 0 8px;
  position: sticky;
  bottom: 0;
  background: var(--sidebar-bg);
  z-index: 2;
}
.sidebar-profile .menu li a { background: var(--hover-bg); margin-bottom: 0; }
body.sidebar-collapsed .sidebar-profile .menu li a { margin-bottom: 0; }
html.sidebar-collapsed .sidebar-profile .menu li a { margin-bottom: 0; }
.sidebar-profile .qa-btn { width: 100%; background: transparent; border: none; color: var(--sidebar-text); filter: none; font-size: 16px; }
.sidebar-profile .qa-btn:hover { background: var(--hover-bg); }
.sidebar-profile .qa-btn:active { background: var(--pressed-bg); }
.sidebar-profile .qa-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sidebar-profile .qa-btn .material-symbols-rounded { font-size: 22px; color: var(--sidebar-text); }
.sidebar-profile .qa-btn .qa-label { font-size: 16px; }
.qa-menu.dropup { top: auto; bottom: calc(100% + 8px); right: 0; transform-origin: bottom right; transform: translateY(-6px) scale(0.98); }
.sidebar-profile .qa-menu { left: 0; right: 0; width: 100%; min-width: 0; }
.sidebar-profile .qa-menu.dropup { transform-origin: bottom center; }
body.sidebar-collapsed .sidebar-profile .qa-label { display: none; }
body.sidebar-collapsed .sidebar-profile .qa-caret { display: none; }
body.sidebar-collapsed .sidebar-profile .qa-btn { justify-content: center; gap: 0; }
html.sidebar-collapsed .sidebar-profile .qa-label { display: none; }
html.sidebar-collapsed .sidebar-profile .qa-caret { display: none; }
html.sidebar-collapsed .sidebar-profile .qa-btn { justify-content: center; gap: 0; }

.profile-card { background: var(--accent-tint); border: 1px solid var(--border-color); border-radius: var(--radius); padding: 12px; }
.profile-name { font-size: 14px; font-weight: 600; color: var(--content-text); }
.profile-sub { font-size: 12px; color: #6b7280; margin-top: 2px; }
.qa-separator { height: 1px; background: var(--border-color); margin: 8px 0; }

  @media (max-width: 1024px) {
    .sidebar {
      position: fixed;
      inset: 0;
      width: 100vw;
      height: 100vh;
      max-width: none;
      transform: translate3d(-100%, 0, 0);
      opacity: 0;
      transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1), opacity 260ms ease-out;
      will-change: transform, opacity;
      backface-visibility: hidden;
      contain: layout paint;
      z-index: 1000;
      overflow-y: auto;
      background: var(--sidebar-bg, #f9fafb);
      pointer-events: none;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}
    .sidebar-profile { padding-bottom: calc(8px + env(safe-area-inset-bottom)); bottom: calc(16px + env(safe-area-inset-bottom)); }
    body.sidebar-open .sidebar {
      transform: translate3d(0, 0, 0);
      opacity: 1;
      pointer-events: auto;
    }

    body.sidebar-closing .sidebar {
      pointer-events: none;
    }
    body.sidebar-closing .sidebar .menu li a {
      opacity: 0;
      transform: translate3d(-6px, 0, 0);
      transition: opacity 220ms ease, transform 220ms ease;
    }
    body.sidebar-closing .sidebar .menu li:nth-child(1) a { transition-delay: 190ms; }
    body.sidebar-closing .sidebar .menu li:nth-child(2) a { transition-delay: 160ms; }
    body.sidebar-closing .sidebar .menu li:nth-child(3) a { transition-delay: 130ms; }
    body.sidebar-closing .sidebar .menu li:nth-child(4) a { transition-delay: 100ms; }
    body.sidebar-closing .sidebar .menu li:nth-child(5) a { transition-delay: 70ms; }
    body.sidebar-closing .sidebar .menu li:nth-child(6) a { transition-delay: 40ms; }

    body.sidebar-open { overflow: hidden; }

    .content { margin-left: 0 !important; }
    body.sidebar-collapsed .content,
    html.sidebar-collapsed .content { margin-left: 0 !important; }

    body.sidebar-collapsed .sidebar,
    html.sidebar-collapsed .sidebar {
      width: 100vw !important;
      padding-left: 16px;
      padding-right: 16px;
    }
    body.sidebar-collapsed .brand-name,
    body.sidebar-collapsed .menu li a .label,
    html.sidebar-collapsed .brand-name,
    html.sidebar-collapsed .menu li a .label {
      max-width: none !important;
      opacity: 1 !important;
      flex-basis: auto !important;
    }

    .overlay { display: none; }
    body.sidebar-open .overlay { display: none; }

    .mobile-only { display: inline-flex; }

    .sidebar .menu li a {
      opacity: 0;
      transform: translateX(-6px);
      transition: opacity 220ms ease, transform 220ms ease;
    }
    body.sidebar-open .sidebar .menu li a {
      opacity: 1;
      transform: translateX(0);
    }
    body.sidebar-open .sidebar .menu li:nth-child(1) a { transition-delay: 40ms; }
    body.sidebar-open .sidebar .menu li:nth-child(2) a { transition-delay: 70ms; }
    body.sidebar-open .sidebar .menu li:nth-child(3) a { transition-delay: 100ms; }
    body.sidebar-open .sidebar .menu li:nth-child(4) a { transition-delay: 130ms; }
    body.sidebar-open .sidebar .menu li:nth-child(5) a { transition-delay: 160ms; }
    body.sidebar-open .sidebar .menu li:nth-child(6) a { transition-delay: 190ms; }
  }

@media (min-width: 1025px) {
  .mobile-only { display: none; }
}

h1 { margin: 0 0 8px; font-size: 24px; color: var(--content-text); }
p { margin: 0; opacity: 0.85; color: var(--content-text); }

.sidebar {
  transition:
    width 220ms cubic-bezier(0.22, 1, 0.36, 1) 40ms,
    padding 220ms cubic-bezier(0.22, 1, 0.36, 1) 40ms,
    transform 320ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 260ms ease-out;
}

.brand { justify-content: flex-start; }

.collapse-btn {
  position: static;
  margin-left: auto;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--accent);
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}
.collapse-btn:hover { background: var(--hover-bg); border-color: #d1d5db; }

.content { transition: margin-left 220ms cubic-bezier(0.22, 1, 0.36, 1) 40ms; }

body.sidebar-collapsed .menu li a {
  justify-content: flex-start;
  gap: 12px;
  padding-left: 12px;
  padding-right: 0;
}
html.sidebar-collapsed .menu li a {
  justify-content: flex-start;
  gap: 12px;
  padding-left: 12px;
  padding-right: 0;
}
body.sidebar-collapsed .icon { width: 24px; }

body.sidebar-collapsed .brand {
  justify-content: flex-start;
  gap: 12px;
  padding-left: 12px;
  padding-right: 12px;
}
html.sidebar-collapsed .brand {
  justify-content: flex-start;
  gap: 12px;
  padding-left: 12px;
  padding-right: 12px;
}
body.sidebar-collapsed .brand-logo {
  position: static;
  transform: translateX(-2px) scale(0.92); 
  width: 24px;
  height: 24px;
}
html.sidebar-collapsed .brand-logo {
  position: static;
  transform: translateX(-2px) scale(0.92);
  width: 24px;
  height: 24px;
}

.brand-separator {
  height: 1px;
  background: var(--border-color);
  margin: 8px 0 12px 0;
}

body.sidebar-collapsed .menu li a {
  width: 100%;
  height: 48px;
  margin: 6px 0;
  padding-left: 12px;
  padding-right: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}
html.sidebar-collapsed .menu li a {
  width: 100%;
  height: 48px;
  margin: 6px 0;
  padding-left: 12px;
  padding-right: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}
body.sidebar-collapsed .menu li a .icon {
  position: static;
  transform: none;
}
html.sidebar-collapsed .menu li a .icon {
  position: static;
  transform: none;
}

body.sidebar-collapsed .sidebar {
  padding-left: 8px;
  padding-right: 8px;
}
html.sidebar-collapsed .sidebar {
  padding-left: 8px;
  padding-right: 8px;
}

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .content { transition: none; }
}

.brand-name {
  transition: opacity var(--transition-medium), flex-basis var(--transition-medium);
}
.menu li a .label {
  transition: opacity var(--transition-medium), flex-basis var(--transition-medium);
}
.menu li a {
  transition: background-color var(--transition-fast), border-left-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
}
body.sidebar-collapsed .brand-name,
body.sidebar-collapsed .menu li a .label {
  transform: none;
}
html.sidebar-collapsed .brand-name,
html.sidebar-collapsed .menu li a .label {
  transform: none;
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
  box-shadow: none;
  filter: drop-shadow(0 3px 0 rgba(17, 24, 39, 0.055));
}
.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.stat-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--content-text);
  opacity: 0.8;
}
.icon-chip {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.08);
}
.stat-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--content-text);
  margin: 6px 0 4px;
}
.stat-trend { font-size: 13px; }
.stat-trend.positive { color: #16a34a; }
.stat-trend.neutral { color: #6b7280; }
.stat-trend.negative { color: #b91c1c; }

.stat-card::after,
.chart-card::after {
  content: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 6px;
  pointer-events: none;
  background: rgba(17, 24, 39, 0.12);
  border-radius: 0 0 var(--radius) var(--radius);
}

.charts-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.8fr) auto;
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}

.chart-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
  box-shadow: none;

  filter: drop-shadow(0 3px 0 rgba(17, 24, 39, 0.07));
  display: block;
}
.chart-card + .chart-card { margin-top: 16px; }
.charts-grid .chart-card + .chart-card { margin-top: 0; }
.chart-title {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--content-text);
  opacity: 0.85;
}
.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.chart-head .chart-title {
  margin: 0;
}
.chart-range {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #6b7280;
}
.chart-range select {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: #fff;
  color: var(--content-text);
  font-size: 12px;
}
.chart-range select:focus {
  outline: none;
  border-color: var(--accent);
}
.chart-desc { margin: 0 0 12px; font-size: 13px; color: #6b7280; }
.chart-body { position: relative; width: 100%; height: var(--chart-size); }
.chart-body canvas { width: 100% !important; height: 100% !important; }

.chart-body .chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  font-size: inherit;
  font-weight: 400;
  pointer-events: none;
}
.chart-empty[hidden] { display: none !important; }

.activity-card { margin-top: 16px; }
.logs-body { padding-top: 4px; }
.logs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: var(--logs-cols);
  gap: 0;
}
.logs-header {
  display: grid;
  grid-template-columns: var(--logs-cols);
  gap: 0;
  font-size: 12px;
  color: #6b7280;
  border-bottom: 1px solid var(--border-color);
}
.logs-header > * {
  padding: 8px 12px;
  border-right: 1px solid var(--border-color);
}
.logs-header > *:last-child { border-right: none; }
.logs-header .head-time { text-align: right; }

.logs-list .log-row {
  display: contents;
}
.logs-list .log-row > * {
  min-width: 0;
  padding: 10px 12px;
  border-right: 1px solid var(--border-color);
  border-top: 1px solid var(--border-color);
}
.logs-list .log-row > *:last-child { border-right: none; }
.logs-list .log-row:first-child > * { border-top: none; }
.log-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.log-msg { color: var(--content-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-id {
  font-size: 13px;
  color: var(--content-text);
  background: transparent;
  border: none;
  border-radius: 0;
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.log-ip {
  font-family: inherit;
  font-size: 13px;
  color: var(--content-text);
  background: transparent;
  border: none;
  border-radius: 0;
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.log-action { font-size: 13px; color: var(--content-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-badge {
  font-size: 13px;
  color: var(--content-text);
  background: transparent;
  border: none;
  border-radius: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.log-time { font-size: 12px; color: #6b7280; text-align: right; justify-self: stretch; display: block; width: 100%; }

@media (max-width: 768px) {
  .logs-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .logs-body .logs-header { min-width: 720px; }
  .logs-body .logs-list { min-width: 720px; }
  .logs-body .logs-list .log-row { min-width: 720px; }
}

.login-history { --logs-cols: 1.2fr 1.2fr 1.6fr 0.8fr; }
.login-history .log-time { text-align: left; justify-self: start; }
.login-history .logs-header > * { border-left: 1px solid var(--border-color); border-right: none; }
.login-history .logs-header > *:first-child { border-left: none; }
.login-history .log-row > * { border-left: 1px solid var(--border-color); border-right: none; }
.login-history .log-row > *:first-child { border-left: none; }

.pager-wrap { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; }
.pager-info { font-size: 12px; color: #6b7280; }
.pager-actions { display: flex; gap: 8px; }
.pager-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-color);
  background: #fff;
  color: var(--content-text);
  border-radius: var(--radius);
  text-decoration: none;
}
.pager-btn .material-symbols-rounded { font-size: 18px; color: var(--content-text); }
.pager-btn:hover { background: var(--hover-bg); }
.pager-btn:active { background: var(--pressed-bg); }
.pager-btn:focus-visible { outline: 2px solid var(--accent-outline); outline-offset: 2px; }
.pager-btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.chart-square { justify-self: stretch; }
.chart-square .chart-body {
  width: min(360px, 100%);
  height: auto;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
}

.known-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.known-section { display: grid; gap: 10px; }
.known-title { font-size: 12px; color: #6b7280; font-weight: 600; }
.known-rows { display: grid; grid-auto-rows: minmax(44px, auto); gap: 10px; }
.known-row { display: grid; grid-template-columns: 1.6fr max-content max-content; align-items: center; gap: 12px; padding: 10px 12px; background: #fff; border: 1px solid var(--border-color); border-radius: var(--radius); filter: drop-shadow(0 2px 0 rgba(17, 24, 39, 0.05)); }
.known-row:hover { background: var(--hover-bg); }
.known-id { font-size: 12px; color: var(--content-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.known-type { font-size: 11px; color: #6b7280; border: 1px solid var(--border-color); border-radius: 999px; padding: 2px 8px; }
.known-first, .known-last { font-size: 11px; color: #6b7280; }
@media (max-width: 1200px) { .known-row { grid-template-columns: 1fr max-content max-content; } }
@media (max-width: 900px) { .known-grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .known-row { grid-template-columns: 1fr; } .known-first, .known-last { justify-self: start; } }
@media (max-width: 600px) { .known-row { grid-template-columns: 1fr; } }
.known-card { margin-top: 16px; }

.policy-box { background: #fff; border: 1px solid var(--border-color); border-radius: var(--radius); padding: 12px; font-size: 13px; color: var(--content-text); white-space: pre-wrap; }
.policy-edit-text { background: #fff; border: 1px solid var(--border-color); border-radius: var(--radius); padding-inline: 12px; padding-block: 12px; font-size: 13px; color: var(--content-text); width: 100%; resize: none; min-height: 240px; height: calc(100vh - 280px); line-height: 1.45; box-sizing: border-box; }
.policy-edit-text:focus { outline: none; border-color: var(--accent); }
@media (max-width: 640px) {
  .policy-edit-text { height: calc(100vh - 340px); height: calc(100dvh - 340px); }
}
.editor-toolbar { display: flex; gap: 8px; margin-bottom: 8px; }
.policy-edit-area { background: #fff; border: 1px solid var(--border-color); border-radius: var(--radius); padding: 12px; min-height: 280px; font-size: 13px; color: var(--content-text); }
.policy-edit-area:focus { outline: none; border-color: var(--accent); }

.modal-overlay { position: fixed; inset: 0; background: rgba(17, 24, 39, 0.35); display: grid; place-items: center; z-index: 3000; }
.modal-overlay[hidden] { display: none; }
.modal-card { background: #fff; border: 1px solid var(--border-color); border-radius: var(--radius); width: min(520px, 92vw); padding: 16px; box-shadow: 0 2px 8px rgba(17, 24, 39, 0.06), 0 12px 24px rgba(17, 24, 39, 0.08); }
.modal-title { margin: 0 0 8px; font-size: 16px; font-weight: 600; color: var(--content-text); }
.modal-subtitle { margin: 0 0 12px; font-size: 13px; color: #6b7280; }
.modal-list { display: grid; gap: 8px; max-height: 240px; overflow: auto; padding-right: 4px; }
.modal-option { display: flex; align-items: center; gap: 8px; }
.modal-option { justify-content: space-between; }
.modal-option .modal-value { font-weight: 600; font-size: 13px; color: var(--content-text); min-width: 0; overflow-wrap: anywhere; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.modal-actions.left { justify-content: flex-start; }
.modal-option.empty { opacity: 0.6; }
.modal-section { border: 1px solid var(--border-color); border-radius: var(--radius); padding: 12px; background: #fff; }
.modal-section-title { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--content-text); }
.modal-rows { display: grid; gap: 12px; }
.modal-rows.compact { gap: 8px; }
.credentials-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.modal-code { font-family: inherit; background: #fff; border: 1px solid var(--border-color); border-radius: var(--radius); padding: 10px; font-size: 12px; color: #374151; max-height: 180px; overflow: auto; }
.modal-code-inline { white-space: nowrap; overflow-x: hidden; text-overflow: ellipsis; width: 100%; }

@media (max-width: 600px) {
  .modal-card {
    max-height: 92vh;
    display: flex;
    flex-direction: column;
  }
  .modal-list {
    max-height: none;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
  }
  .modal-code {
    max-height: 40vh;
  }
}

@media (max-width: 640px) {
  .modal-card.mobile-overlay-compact {
    width: min(520px, 94vw);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    padding: 10px 12px;
    position: relative;
  }
  .modal-card.mobile-overlay-compact .modal-title { font-size: 18px; margin: 0 0 4px; }
  .modal-card.mobile-overlay-compact .modal-subtitle { font-size: 12px; margin: 0 0 6px; }
  .modal-card.mobile-overlay-compact .modal-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding-right: 0;
  }
  .modal-card.mobile-overlay-compact .filter-field { gap: 2px; }
  .modal-card.mobile-overlay-compact .filter-label { font-size: 11px; }
  .modal-card.mobile-overlay-compact .modal-section { padding: 10px; }
  .modal-card.mobile-overlay-compact .modal-rows { gap: 8px; }
  .modal-card.mobile-overlay-compact .qa-btn { height: 44px; }
  .modal-card.mobile-overlay-compact .filter-field input[type="text"],
  .modal-card.mobile-overlay-compact .filter-field input[type="email"],
  .modal-card.mobile-overlay-compact .filter-field input[type="password"],
  .modal-card.mobile-overlay-compact .filter-field select { height: 42px; font-size: 16px; }
  .modal-card.mobile-overlay-compact .modal-section.credentials { max-height: 200px; overflow: auto; -webkit-overflow-scrolling: touch; }

  #editAppModal .modal-actions,
  #editActionModal .modal-actions { display: grid; grid-template-columns: 1fr 1fr; grid-auto-flow: column; gap: 8px; margin-top: 10px; align-items: stretch; }
  #editAppModal .modal-actions .qa-btn,
  #editActionModal .modal-actions .qa-btn { width: 100%; min-width: 0; }
  #editAppSave, #editActionSave { order: 2; }
  #resetAppCredsBtn, #resetActionIdBtn { order: 1; }
  #editAppClose, #editActionClose { display: none; }
  .modal-card.mobile-overlay-compact .modal-close-btn { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; aspect-ratio: 1; padding: 0; display: inline-grid; place-items: center; border: 1px solid var(--border-color); border-radius: var(--radius); background: #fff; }
  .modal-card.mobile-overlay-compact .modal-close-btn .material-symbols-rounded { font-size: 18px; line-height: 1; }
}

@media (max-width: 640px) {
  input, textarea, select { font-size: 16px; }
}

.modal-kv { display: grid; gap: 4px; }
.modal-kv .filter-label { font-size: 12px; color: #6b7280; }
.modal-kv .modal-value { font-size: 13px; color: var(--content-text); font-weight: 500; overflow-wrap: anywhere; }

.modal-divider { height: 1px; background: var(--border-color); margin: 12px 0; }
.qa-btn.qa-ghost { background: #fff; color: var(--accent); border-color: var(--accent); }
.qa-btn.qa-ghost:hover { background: var(--hover-bg); }
.qa-btn.qa-ghost:active { background: var(--pressed-bg); }
.qa-btn.qa-ghost .material-symbols-rounded { color: var(--accent); }
.qa-btn.qa-ghost:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(2,86,255,0.18); }

.modal-card .filter-field input[type="text"],
.modal-card .filter-field input[type="email"],
.modal-card .filter-field input[type="password"],
.modal-card .filter-field textarea {
  height: auto;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: #fff;
  color: var(--content-text);
  box-shadow: none;
  font-size: 13px;
}
.modal-card .filter-field input[type="text"],
.modal-card .filter-field input[type="email"],
.modal-card .filter-field input[type="password"] { height: 40px; padding: 0 12px; }
.modal-card .filter-field select { height: 40px; padding: 0 12px; border: 1px solid var(--border-color); border-radius: var(--radius); background: #fff; color: var(--content-text); box-shadow: none; font-size: 13px; }
.modal-card .filter-field textarea { min-height: 88px; resize: none; }
.modal-card .filter-field input[type="text"],
.modal-card .filter-field input[type="email"],
.modal-card .filter-field input[type="password"],
.modal-card .filter-field textarea { transition: border-color .15s ease, box-shadow .15s ease; }
.modal-card .filter-field select { transition: border-color .15s ease, box-shadow .15s ease; }
.modal-card .filter-field input[type="text"]:hover,
.modal-card .filter-field input[type="email"]:hover,
.modal-card .filter-field input[type="password"]:hover,
.modal-card .filter-field textarea:hover { border-color: #cbd5e1; }
.modal-card .filter-field select:hover { border-color: #cbd5e1; }
.modal-card .filter-field input::placeholder,
.modal-card .filter-field textarea::placeholder { color: #9ca3af; }
.modal-card .filter-field input[type="text"]:focus,
.modal-card .filter-field input[type="email"]:focus,
.modal-card .filter-field input[type="password"]:focus,
.modal-card .filter-field textarea:focus { outline: none; border-color: var(--accent); }
.modal-card .filter-field select:focus { outline: none; border-color: var(--accent); }
.modal-card .filter-field input.input-error { border-color: #ef4444; color: #b91c1c; }
.modal-card .filter-field input.input-error:focus { border-color: #ef4444; }
.modal-card .filter-field input.input-error::placeholder { color: #ef4444; }
.modal-card .filter-field .filter-label.error { color: #b91c1c; }

.filters-form input.input-error { border-color: #ef4444; color: #b91c1c; }
.filters-form input.input-error:focus { border-color: #ef4444; }
.filters-form .filter-label.error { color: #b91c1c; }
.form-help { font-size: 12px; color: #6b7280; margin-top: 8px; }
.form-help.error { color: #b91c1c; }
.form-help.success { color: #15803d; font-weight: 600; }
.form-help.info { color: #2563eb; }
.form-help.danger { color: #b91c1c; font-weight: 600; font-size: 13px; }
.resend-form { margin: 0; }
.text-link { border: none; background: none; color: var(--accent); font-weight: 600; font-size: 13px; cursor: pointer; padding: 0; }
.text-link:hover,
.text-link:focus { text-decoration: underline; outline: none; }
.text-link[disabled] { opacity: 0.5; cursor: not-allowed; }

.plans-grid { display: grid; grid-template-columns: repeat(3, minmax(240px, 1fr)); gap: 16px; }
@media (max-width: 1200px) { .plans-grid { grid-template-columns: repeat(2, minmax(240px, 1fr)); } }
@media (max-width: 900px) { .plans-grid { grid-template-columns: 1fr; } }
.plans-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.upcoming-billing { display: inline-flex; align-items: center; gap: 8px; color: var(--content-text); }
.ub-label { font-size: 12px; color: #6b7280; font-weight: 600; }
.plan-card { background: #fff; border: 1px solid var(--border-color); border-radius: var(--radius); padding: 16px; filter: drop-shadow(0 2px 0 rgba(17, 24, 39, 0.06)); display: flex; flex-direction: column; gap: 10px; }
.plan-card { position: relative; }
.plan-badge { position: absolute; top: 12px; right: 12px; padding: 2px 8px; border: 1px solid var(--border-color); border-radius: 12px; font-size: 12px; font-weight: 600; }
.plan-badge.selected { color: #10b981; border-color: #d1fae5; background: #ecfdf5; }
.plan-badge.upgrade { color: var(--accent); border-color: var(--accent); background: #fff; }
.qa-btn[disabled] { opacity: 0.6; cursor: not-allowed; }
.amount-badge { display: inline-flex; align-items: center; padding: 2px 8px; border: 1px solid var(--border-color); border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--content-text); background: #fff; margin-left: 8px; }
.plan-name { font-size: 15px; font-weight: 600; color: var(--content-text); }
.plan-price { font-size: 20px; font-weight: 600; color: var(--accent); }
.plan-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.plan-list li { font-size: 13px; color: var(--content-text); }
.plan-actions { display: flex; justify-content: flex-end; margin-top: auto; }
.plan-warning { border: 1px solid #fecaca; border-radius: var(--radius); background: #fff; padding: 10px; }
.plan-warning-title { font-size: 13px; font-weight: 600; color: #b91c1c; margin-bottom: 6px; }
.plan-warning-list { margin: 0; padding-left: 18px; }
.plan-warning-list li { font-size: 13px; color: var(--content-text); }
.plan-action-wrap { position: relative; display: inline-block; }
.plan-tooltip { position: absolute; bottom: calc(100% + 8px); right: 0; background: #fff; border: 1px solid var(--border-color); border-radius: var(--radius); padding: 12px; box-shadow: 0 2px 8px rgba(17, 24, 39, 0.06); z-index: 10; display: none; min-width: 260px; }
.plan-tooltip::after { content: ""; position: absolute; right: 16px; bottom: -6px; width: 10px; height: 10px; background: #fff; border-left: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); transform: rotate(45deg); }
.plan-action-wrap:hover .plan-tooltip { display: block; }
.plan-tooltip-title { font-size: 13px; font-weight: 600; color: #b91c1c; margin-bottom: 8px; }
.plan-limits { display: grid; gap: 8px; }
.plan-limit-row { display: flex; align-items: center; justify-content: space-between; }
.plan-limit-key { font-size: 12px; color: #6b7280; font-weight: 600; }
.plan-limit-values { display: inline-flex; align-items: center; gap: 6px; }
.plan-limit-current { font-size: 13px; color: #b91c1c; font-weight: 600; }
.plan-limit-divider { font-size: 13px; color: #9ca3af; }
.plan-limit-max { font-size: 13px; color: var(--content-text); }
.danger { border-color: #fecaca; background: #fff; }
.danger .modal-section-title { color: #b91c1c; }
.danger .chart-desc { color: #b91c1c; }

.sessions-list { display: grid; gap: 10px; }
.session-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--border-color); border-radius: var(--radius); background: #fff; }
.session-row:hover { background: var(--hover-bg); }
.session-meta { font-size: 13px; color: var(--content-text); font-weight: 400; white-space: normal; word-break: break-word; }

@media (max-width: 768px) {
  .session-row { grid-template-columns: 1fr; }
  .session-row .qa-btn { width: 100%; justify-content: center; }
  .session-meta { font-size: 13px; }
}

@media (max-width: 768px) {
  .login-history .logs-body { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  .login-history.has-data .logs-header,
  .login-history.has-data .logs-list,
  .login-history.has-data .logs-list .log-row { min-width: 640px; }
}

.modal-rows > * { min-width: 0; }

@media (max-width: 900px) {
  .charts-grid { grid-template-columns: 1fr; }
  .chart-square .chart-body { width: 100%; height: auto; aspect-ratio: 1 / 1; }
  :root { --chart-size: 220px; }
}

.filters-form {
  display: grid;
  grid-template-columns: var(--filters-cols);
  column-gap: 12px;
  row-gap: 8px;
  align-items: end;
}

.filters-form.account-form { grid-template-columns: 2fr 2fr 2fr 1fr 1fr; gap: 12px; }
.filters-form.account-form .filter-field:nth-of-type(6) { grid-column: 1 / span 2; }
.filters-form.account-form .filter-field:nth-of-type(7) { grid-column: 3 / -1; }
.filters-form.account-form .filter-reset { grid-column: 1 / -1; display: flex; justify-content: flex-end; }

@media (max-width: 1024px) {
  .filters-form.account-form { grid-template-columns: 1fr 1fr; }
  .filters-form.account-form .filter-field:nth-of-type(6),
  .filters-form.account-form .filter-field:nth-of-type(7),
  .filters-form.account-form .filter-reset { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .filters-form.account-form { grid-template-columns: 1fr; }
}
.filters-form.compact { grid-template-columns: 1fr; }
.filter-field { display: grid; gap: 6px; }
.filter-label { font-size: 12px; color: #6b7280; }
.filters-form select,
.filters-form input[type="search"],
.filters-form input[type="date"],
.filters-form input[type="text"],
.filters-form input[type="email"],
.filters-form input[type="password"],
.filters-form textarea {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: #fff;
  color: var(--content-text);
  box-shadow: none;
}
.filters-form input[type="search"] { width: 100%; }
.filters-form input::placeholder,
.filters-form textarea::placeholder { color: #9ca3af; }
.filters-form input[type="search"]:focus,
.filters-form input[type="date"]:focus,
.filters-form input[type="text"]:focus,
.filters-form input[type="email"]:focus,
.filters-form input[type="password"]:focus,
.filters-form textarea:focus,
.filters-form select:focus { outline: none; border-color: var(--accent); }
.filters-actions { display: flex; justify-content: flex-end; align-items: end; }
.filter-reset { display: flex; justify-content: flex-end; align-items: end; grid-column: -1; }
#actionsFilters .filter-field:nth-of-type(2) { grid-column: 2 / -2; }
#applicationsFilters .filter-field { grid-column: 1 / -2; }
#policiesFilters .filter-field { grid-column: 1 / -2; }
.filter-check { display: inline-flex; align-items: center; gap: 6px; height: 40px; }
#createPolicyAppsList { display: flex; flex-wrap: wrap; gap: 12px; }

.filter-check input {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  border: 1.5px solid var(--border-color);
  border-radius: 4px;
  background: #fff;
  box-shadow: none;
  transition: border-color .15s ease, background-color .15s ease;
}
.filter-check input:hover { border-color: #cbd5e1; }
.filter-check input:checked {
  background-color: var(--accent);
  border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8l2.5 2.5L12 5' stroke='white' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px 12px;
}
.filter-check .filter-text { font: inherit; font-size: 13px; line-height: 1; color: var(--content-text); }
.filter-check input:focus-visible { outline: 2px solid var(--accent-outline); outline-offset: 2px; }
.filter-check input[disabled] { background: #f8fafc; border-color: #e5e7eb; cursor: not-allowed; }
@media (max-width: 1200px) {
  .filters-form { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}
@media (max-width: 640px) {
  .filters-form { grid-template-columns: 1fr; column-gap: 8px; row-gap: 8px; align-items: start; }
  .filters-form .filter-field { grid-column: 1 / -1; }
  .filters-form .filter-reset { grid-column: 1 / -1; justify-content: flex-end; }
  .filters-form select,
  .filters-form input[type="search"],
  .filters-form input[type="date"],
  .filters-form input[type="text"],
  .filters-form input[type="email"],
  .filters-form input[type="password"],
  .filters-form textarea { height: 44px; }
  .filter-check { height: 44px; }
}
.users-body { padding-top: 4px; }
.users-list { list-style: none; margin: 0; padding: 0; }
.users-header {
  display: grid;
  grid-template-columns: var(--users-cols);
  gap: 0;
  font-size: 12px;
  color: #6b7280;
  border-bottom: 1px solid var(--border-color);
}
.users-header > * {
  padding: 8px 12px;
  border-right: 1px solid var(--border-color);
}
.users-header > *:last-child { border-right: none; }
.users-header .head-time { text-align: left; }
.users-list .user-row {
  display: grid;
  grid-template-columns: var(--users-cols);
  align-items: center;
  gap: 0;
  padding: 0;
  border-top: 1px solid var(--border-color);
}
.users-list .user-row > * {
  min-width: 0;
  padding: 10px 12px;
  border-right: 1px solid var(--border-color);
}
.users-list .user-row > *:last-child { border-right: none; }
.users-list .user-row:first-child { border-top: none; }
.users-list .user-row:nth-child(odd) { background: #fbfdff; }
.users-list .user-row:hover { background: var(--accent-tint); }
.users-body { overflow-x: visible; }
@media (max-width: 768px) {
  .users-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .users-body .users-header { min-width: 720px; }
  .users-body .users-list { min-width: 720px; }
  .users-body .users-list .user-row { min-width: 720px; }
}
.user-id, .user-name, .user-app, .user-flag, .user-first, .user-interactions { font-size: 13px; color: var(--content-text); }
.user-id, .user-name {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-time { font-size: 12px; color: #6b7280; text-align: left; justify-self: start; }
.filters-advanced[hidden] { display: none; }
.filters-advanced { grid-column: 1 / -1; display: grid; grid-template-columns: inherit; column-gap: inherit; row-gap: inherit; }

.row-actions { display: inline-flex; gap: 8px; justify-content: flex-start; justify-self: start; }
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  width: 28px;
  min-width: 28px;
  padding: 0;
  border: 1px solid var(--border-color);
  background: #fff;
  color: var(--content-text);
  border-radius: 6px;
  cursor: pointer;
}
.action-btn .material-symbols-rounded {
  font-size: 18px;
  color: var(--accent);
  font-variation-settings:
    'FILL' 1,
    'wght' 600,
    'GRAD' 0,
    'opsz' 24;
}
.action-export { width: 28px; min-width: 28px; padding: 0; }
.action-export .material-symbols-rounded { font-size: 18px; color: var(--accent); }
.action-btn .fa-solid { font-size: 18px; color: var(--accent); line-height: 1; }
.action-edit .fa-solid { font-size: 15px; }
.action-btn:hover { background: var(--hover-bg); }
.action-btn:active { background: var(--pressed-bg); }
.action-btn:focus-visible { outline: 2px solid var(--accent-outline); outline-offset: 2px; }
.action-flagged .material-symbols-rounded { color: #b91c1c; }
.action-remove .material-symbols-rounded { color: #b91c1c; }
.actions-body { padding-top: 4px; }
.actions-list { list-style: none; margin: 0; padding: 0; }
.actions-header { display: grid; grid-template-columns: var(--actions-cols); gap: 0; font-size: 12px; color: #6b7280; border-bottom: 1px solid var(--border-color); }
.actions-header > * { padding: 8px 12px; border-right: 1px solid var(--border-color); }
.actions-header > *:last-child { border-right: none; }
.actions-list .action-row { display: grid; grid-template-columns: var(--actions-cols); align-items: center; gap: 0; padding: 0; border-top: 1px solid var(--border-color); }
.actions-list .action-row > * { min-width: 0; padding: 10px 12px; border-right: 1px solid var(--border-color); }
.actions-list .action-row > *:last-child { border-right: none; }
.actions-list .action-row:first-child { border-top: none; }
.actions-list .action-row:nth-child(odd) { background: #fbfdff; }
.actions-list .action-row:hover { background: var(--accent-tint); }
.actions-body { overflow-x: visible; }
@media (max-width: 768px) {
  .actions-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .actions-body .actions-header { min-width: 720px; }
  .actions-body .actions-list { min-width: 720px; }
  .actions-body .actions-list .action-row { min-width: 720px; }
}
.action-name, .action-app, .action-created, .action-count { font-size: 13px; color: var(--content-text); }
.action-change { font-size: 12px; }
.change-pos { color: #10b981; }
.change-neg { color: #ef4444; }
.change-zero { color: #6b7280; }
.policy-edit-form { display: block; }
.policy-edit-form .filter-field { display: block; }
.policy-edit-form .filter-field textarea { width: 100%; }
.bh-action-wrap { position: relative; display: inline-block; }
.bh-tooltip { position: absolute; bottom: calc(100% + 8px); right: 0; background: #fff; border: 1px solid var(--border-color); border-radius: var(--radius); padding: 10px; box-shadow: 0 2px 8px rgba(17, 24, 39, 0.06); z-index: 10; display: none; min-width: 220px; }
.bh-action-wrap:hover .bh-tooltip { display: block; }
.bh-title { font-size: 13px; font-weight: 600; color: #6b7280; margin-bottom: 4px; }
.bh-desc { font-size: 13px; color: var(--content-text); }
.policy-edit-form textarea.policy-edit-text {
  height: calc(100vh - 280px);
  min-height: 240px;
  padding: 12px;
  box-sizing: border-box;
  line-height: 1.45;
}
@media (max-width: 640px) {
  .policy-edit-form textarea.policy-edit-text { height: calc(100vh - 340px); height: calc(100dvh - 340px); }
}
.export-option { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-start; height: 40px; }
.export-option.empty { opacity: 0.6; }
.export-option .export-text { font-size: 13px; color: var(--content-text); }
#exportAppList { max-height: calc(5 * 40px + 4 * 8px); overflow-y: auto; }
.choose-plan .modal-card { max-width: 620px; }
.plan-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 8px; }
.plan-option { display: grid; grid-template-columns: 20px 1fr; align-items: start; gap: 12px; padding: 12px; background: #fff; border: 1px solid var(--border-color); border-radius: var(--radius); filter: drop-shadow(0 2px 0 rgba(17, 24, 39, 0.05)); cursor: pointer; }
.plan-option:hover { background: var(--hover-bg); }
.plan-option:active { background: var(--pressed-bg); }
.plan-option .plan-radio { align-self: center; width: 18px; height: 18px; cursor: pointer; }
.plan-body { display: grid; gap: 10px; }
.plan-head { display: flex; justify-content: space-between; align-items: baseline; }
.plan-name { font-size: 14px; font-weight: 600; color: var(--content-text); }
.plan-price { font-size: 13px; color: var(--accent); font-weight: 600; }
.plan-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.metric { display: grid; gap: 2px; }
.metric-label { font-size: 12px; color: #6b7280; }
.metric-value { font-size: 13px; color: var(--content-text); font-weight: 600; }
.plan-option:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); }

.doc-container {
  display: grid;
  gap: 12px;
}
@media (max-width: 768px) {
  .doc-container { grid-template-columns: 1fr; }
}

.chart-card.doc-block {
  padding: 12px;
  min-width: 0;
}
@media (max-width: 768px) {
  .chart-card.doc-block { padding: 10px; }
}

.doc-code {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 12px;
  font-size: 13px;
  line-height: 1.2;
  white-space: pre;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
  height: auto !important;
  display: grid;
  align-content: start;
  justify-content: start;
  gap: 0;
}
.doc-code[hidden], .doc-table-wrap[hidden], .doc-container [hidden] { display: none !important; }
.doc-code pre {
  background: transparent;
  border: none;
  padding: 0 !important;
  margin: 0 !important;
  white-space: inherit;
  font-size: inherit;
  line-height: inherit;
  overflow-x: inherit;
  display: block;
}
.doc-code code { margin: 0 !important; padding: 0 !important; display: block; line-height: inherit; }
.doc-code * { line-height: inherit; }
.doc-code .tok-key { color: var(--accent); font-weight: 600; }
.doc-code .tok-string { color: #059669; }
.doc-code .tok-number { color: #7c3aed; }
.doc-code .tok-bool { color: #b91c1c; font-weight: 600; }
.doc-code .tok-null { color: #6b7280; font-style: italic; }

#cgCodeWrap .tok-call { color: var(--accent); font-weight: 600; }
#cgCodeWrap .tok-brace { color: var(--accent); }
#cgCodeWrap .tok-key { color: var(--accent); font-weight: 600; }
#cgCodeWrap .tok-url { color: var(--accent); font-weight: 600; }
#cgCodeWrap .tok-string { color: #059669; }
#cgCodeWrap .tok-number, #cgCodeWrap .tok-bool, #cgCodeWrap .tok-null { color: inherit; font-weight: 400; font-style: normal; }
@media (max-width: 768px) {
  .doc-code { max-height: 40vh; padding: 10px; }
}

.doc-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
.doc-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
  table-layout: fixed;
}
.doc-table th,
.doc-table td {
  font-size: 13px;
  padding: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-code:focus-visible,
.doc-table-wrap:focus-visible {
  outline: 2px solid var(--accent-outline);
  outline-offset: 2px;
}

@media (max-width: 768px) {
  html, body, .content { overflow-x: hidden; }
  .doc-table th, .doc-table td { padding: 8px; }
}
@media (max-width: 640px) {
  .page-actions {
    position: fixed;
    top: env(safe-area-inset-top);
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    background: #fff;
  }
  .page-header { padding-top: calc(env(safe-area-inset-top) + 68px); }
  .page-actions .menu-btn { width: 48px; }
  .page-actions .qa-btn { flex: 0 0 auto; margin-left: auto; }
  .page-actions .qa-btn .qa-label { font-size: 14px; }
}

.chart-body-auto { height: auto !important; }
.logs-cols-wide { --logs-cols: 1.4fr 1.4fr 1.2fr 1.2fr 0.8fr; }
.plan-limits-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.limit-row-grid { display: grid; grid-template-columns: max-content 1fr max-content; align-items: center; gap: 12px; }
.limit-bar-track {
  box-sizing: border-box;
  display: block;
  width: 100%;
  height: 10px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  overflow: hidden;
}
.limit-bar-track .limit-fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.25s ease;
}
.text-right { justify-self: flex-end; text-align: right; }
.modal-actions-spaced { margin-top: 12px; }
.actions-body-wide { --actions-cols: 1.2fr 1.2fr 1fr 1.2fr; padding-top: 0; }
.filter-field-stack { margin-top: 8px; }
.text-danger { color: #b00020; }
.text-danger-soft { color: var(--danger); }
.is-hidden { display: none; }
.rows-centered { justify-content: center; }
.qr-center { text-align: center; padding: 6px 0; }
