:root {
  --bg: #f7f7f9;
  --surface: #ffffff;
  --surface2: #f4f4f6;
  --border: #e5e7eb;
  --border2: #d1d5db;
  --sidebar-bg: #061d51;
  --sidebar-hover: rgba(255, 255, 255, 0.08);
  --sidebar-active: rgba(255, 255, 255, 0.14);
  --sidebar-text: rgba(255, 255, 255, 0.6);
  --sidebar-text-active: #ffffff;
  --accent: #2563eb;
  --accent2: #1d4ed8;
  --accent-dim: rgba(37, 99, 235, 0.1);
  --accent-dim2: rgba(37, 99, 235, 0.06);
  --text: #111827;
  --text2: #6b7280;
  --text3: #9ca3af;
  --purple: #9133fe;
  --purple-dim: rgba(145, 51, 254, 0.1);
  --blue: #30a2d6;
  --blue-dim: rgba(48, 162, 214, 0.1);
  --green: #45e990;
  --green-dim: rgba(25, 243, 124, 0.1);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.1);
  --radius: 10px;
  --sidebar-w: 275px;
}

:root.dark {
  --bg: #0f1117;
  --surface: #1a1c25;
  --surface2: #252830;
  --border: #2e3140;
  --border2: #3a3e4f;
  --sidebar-bg: #0a0e1a;
  --text: #e5e7eb;
  --text2: #9ca3af;
  --text3: #6b7280;
  --accent-dim: rgba(37, 99, 235, 0.15);
  --accent-dim2: rgba(37, 99, 235, 0.08);
  --purple-dim: rgba(145, 51, 254, 0.15);
  --blue-dim: rgba(48, 162, 214, 0.15);
  --green-dim: rgba(25, 243, 124, 0.15);
  --red-dim: rgba(239, 68, 68, 0.15);
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}
a {
  text-decoration: none;
  color: inherit;
}
img {
  display: block;
  max-width: 100%;
}
button {
  font-family: inherit;
}

html,
body {
  height: 100%;
}

body {
  font-family:
      "Inter",
      -apple-system,
      BlinkMacSystemFont,
      "Segoe UI",
      Roboto,
      sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 500px;
}
thead th {
  padding: 10px 18px;
  text-align: left;
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
  white-space: nowrap;
  background: var(--surface2);
  position: sticky;
  top: 0;
}
tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
tbody tr:last-child {
  border-bottom: none;
}
tbody tr:hover {
  background: var(--surface2);
}
tbody td {
  padding: 12px 18px;
  color: var(--text2);
  vertical-align: middle;
  white-space: nowrap;
}
td.wrap {
  white-space: normal;
  min-width: 180px;
}
.sb-chat {
  z-index: 100!important;
}
.flex {
  display: flex;
}
.flex-col {
  display: flex;
  flex-direction: column;
}
.flex-center {
  display: flex;
  align-items: center;
}
.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.flex-wrap {
  flex-wrap: wrap;
}
.flex-1 {
  flex: 1;
}
.flex-shrink-0 {
  flex-shrink: 0;
}
.hidden {
  display: none;
}
.d-none {
  display: none;
}
.d-block {
  display: block;
}
.d-inline {
  display: inline;
}
.d-inline-block {
  display: inline-block;
}
.d-flex {
  display: flex;
}
.d-inline-flex {
  display: inline-flex;
}
.d-grid {
  display: grid;
}

.flex-row {
  flex-direction: row;
}
.flex-column {
  flex-direction: column;
}
.flex-row-reverse {
  flex-direction: row-reverse;
}
.flex-grow-0 {
  flex-grow: 0;
}
.flex-grow-1 {
  flex-grow: 1;
}
.flex-nowrap {
  flex-wrap: nowrap;
}

.items-start {
  align-items: flex-start;
}
.items-center {
  align-items: center;
}
.justify-center {
  justify-content: center;
}
.justify-start {
  justify-content: flex-start;
}
.justify-end {
  justify-content: flex-end;
}
.justify-between {
  justify-content: space-between;
}
.justify-around {
  justify-content: space-around;
}
.justify-evenly {
  justify-content: space-evenly;
}
.items-end {
  align-items: flex-end;
}
.items-baseline {
  align-items: baseline;
}
.items-stretch {
  align-items: stretch;
}
.self-start {
  align-self: flex-start;
}

.w-full {
  width: 100%;
}
.w-auto {
  width: auto;
}
.w-25 {
  width: 25%;
}
.w-50 {
  width: 50%;
}
.w-75 {
  width: 75%;
}
.h-full {
  height: 100%;
}
.h-auto {
  height: auto;
}
.h-fit {
  height: fit-content;
}
.min-w-0 {
  min-width: 0;
}
.mw-100 {
  max-width: 100%;
}
.mh-100 {
  max-height: 100%;
}

.gap-4 {
  gap: 4px;
}
.gap-6 {
  gap: 6px;
}
.gap-8 {
  gap: 8px;
}
.gap-10 {
  gap: 10px;
}
.gap-12 {
  gap: 12px;
}
.gap-14 {
  gap: 14px;
}
.gap-16 {
  gap: 16px;
}
.gap-20 {
  gap: 20px;
}
.gap-24 {
  gap: 24px;
}
.gap-32 {
  gap: 32px;
}

.m-0 {
  margin: 0;
}
.m-4 {
  margin: 4px;
}
.m-8 {
  margin: 8px;
}
.m-16 {
  margin: 16px;
}
.m-auto {
  margin: auto;
}
.mx-auto {
  margin-left: auto;
  margin-right: auto;
}
.mx-4 {
  margin-left: 4px;
  margin-right: 4px;
}
.mx-8 {
  margin-left: 8px;
  margin-right: 8px;
}
.mx-16 {
  margin-left: 16px;
  margin-right: 16px;
}
.my-0 {
  margin-top: 0;
  margin-bottom: 0;
}
.my-4 {
  margin-top: 4px;
  margin-bottom: 4px;
}
.my-8 {
  margin-top: 8px;
  margin-bottom: 8px;
}
.my-16 {
  margin-top: 16px;
  margin-bottom: 16px;
}
.mt-0 {
  margin-top: 0;
}
.mt-4 {
  margin-top: 4px;
}
.mb-2 {
  margin-bottom: 2px;
}
.mb-4 {
  margin-bottom: 4px;
}
.mt-6 {
  margin-top: 6px;
}
.mb-6 {
  margin-bottom: 6px;
}
.mt-8 {
  margin-top: 8px;
}
.mb-8 {
  margin-bottom: 8px;
}
.mt-10 {
  margin-top: 10px;
}
.mb-10 {
  margin-bottom: 10px;
}
.mt-12 {
  margin-top: 12px;
}
.mb-12 {
  margin-bottom: 12px;
}
.mt-14 {
  margin-top: 14px;
}
.mb-14 {
  margin-bottom: 14px;
}
.mt-16 {
  margin-top: 16px;
}
.mb-16 {
  margin-bottom: 16px;
}
.mt-20 {
  margin-top: 20px;
}
.mb-20 {
  margin-bottom: 20px;
}
.mb-24 {
  margin-bottom: 24px;
}
.mb-32 {
  margin-bottom: 32px;
}
.ml-0 {
  margin-left: 0;
}
.ml-4 {
  margin-left: 4px;
}
.ml-8 {
  margin-left: 8px;
}
.ml-12 {
  margin-left: 12px;
}
.ml-16 {
  margin-left: 16px;
}
.ml-auto {
  margin-left: auto;
}
.mr-0 {
  margin-right: 0;
}
.mr-4 {
  margin-right: 4px;
}
.mr-8 {
  margin-right: 8px;
}
.mr-12 {
  margin-right: 12px;
}
.mr-16 {
  margin-right: 16px;
}
.mr-auto {
  margin-right: auto;
}
.mt-24 {
  margin-top: 24px;
}
.mt-32 {
  margin-top: 32px;
}

.p-0 {
  padding: 0;
}
.p-4 {
  padding: 4px;
}
.p-6 {
  padding: 6px;
}
.p-8 {
  padding: 8px;
}
.p-10 {
  padding: 10px;
}
.p-12 {
  padding: 12px;
}
.p-16 {
  padding: 16px;
}
.p-20 {
  padding: 20px;
}
.p-24 {
  padding: 24px;
}
.p-32 {
  padding: 32px;
}
.px-0 {
  padding-left: 0;
  padding-right: 0;
}
.px-4 {
  padding-left: 4px;
  padding-right: 4px;
}
.px-8 {
  padding-left: 8px;
  padding-right: 8px;
}
.px-12 {
  padding-left: 12px;
  padding-right: 12px;
}
.px-16 {
  padding-left: 16px;
  padding-right: 16px;
}
.px-20 {
  padding-left: 20px;
  padding-right: 20px;
}
.px-24 {
  padding-left: 24px;
  padding-right: 24px;
}
.py-0 {
  padding-top: 0;
  padding-bottom: 0;
}
.py-4 {
  padding-top: 4px;
  padding-bottom: 4px;
}
.py-8 {
  padding-top: 8px;
  padding-bottom: 8px;
}
.py-12 {
  padding-top: 12px;
  padding-bottom: 12px;
}
.py-16 {
  padding-top: 16px;
  padding-bottom: 16px;
}
.py-20 {
  padding-top: 20px;
  padding-bottom: 20px;
}
.py-24 {
  padding-top: 24px;
  padding-bottom: 24px;
}
.pt-0 {
  padding-top: 0;
}
.pt-4 {
  padding-top: 4px;
}
.pt-8 {
  padding-top: 8px;
}
.pt-12 {
  padding-top: 12px;
}
.pt-16 {
  padding-top: 16px;
}
.pt-20 {
  padding-top: 20px;
}
.pb-0 {
  padding-bottom: 0;
}
.pb-2 {
  padding-bottom: 2px;
}
.pb-4 {
  padding-bottom: 4px;
}
.pb-8 {
  padding-bottom: 8px;
}
.pb-12 {
  padding-bottom: 12px;
}
.pb-16 {
  padding-bottom: 16px;
}
.pb-20 {
  padding-bottom: 20px;
}
.pl-0 {
  padding-left: 0;
}
.pl-4 {
  padding-left: 4px;
}
.pl-8 {
  padding-left: 8px;
}
.pl-12 {
  padding-left: 12px;
}
.pl-16 {
  padding-left: 16px;
}
.pr-0 {
  padding-right: 0;
}
.pr-4 {
  padding-right: 4px;
}
.pr-8 {
  padding-right: 8px;
}
.pr-12 {
  padding-right: 12px;
}
.pr-16 {
  padding-right: 16px;
}

.nowrap {
  white-space: nowrap;
}
.text-wrap {
  white-space: normal;
}
.text-break {
  word-wrap: break-word;
  word-break: break-word;
}
.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.text-left {
  text-align: left;
}
.text-right {
  text-align: right;
}
.text-center {
  text-align: center;
}
.text-uppercase {
  text-transform: uppercase;
}
.text-lowercase {
  text-transform: lowercase;
}
.text-capitalize {
  text-transform: capitalize;
}
.text-decoration-none {
  text-decoration: none;
}
.text-decoration-underline {
  text-decoration: underline;
}

.text-2xs {
  font-size: 10px;
}
.text-xs {
  font-size: 11px;
}
.text-xs-2 {
  font-size: 11.5px;
}
.text-sm {
  font-size: 12px;
}
.text-sm-2 {
  font-size: 12.5px;
}
.text-base {
  font-size: 13px;
}
.text-md {
  font-size: 14px;
}
.text-lg {
  font-size: 16px;
}

.text-400 {
  font-weight: 400;
}
.text-500 {
  font-weight: 500;
}
.text-600 {
  font-weight: 600;
}
.text-700 {
  font-weight: 700;
}
.fw-light {
  font-weight: 300;
}
.fw-normal {
  font-weight: 400;
}
.fw-medium {
  font-weight: 500;
}
.fw-semibold {
  font-weight: 600;
}
.fw-bold {
  font-weight: 700;
}
.fs-10px { font-size: 10px; }
.fs-12px { font-size: 12px; }
.fs-14px { font-size: 14px; }
.fs-16px { font-size: 16px; }
.fs-18px { font-size: 18px; }
.fs-20px { font-size: 20px; }
.fs-24px { font-size: 24px; }
.fs-28px { font-size: 28px; }
.fs-32px { font-size: 32px; }
.fs-38px { font-size: 38px; }
.fs-42px { font-size: 42px; }
.fst-italic {
  font-style: italic;
}
.fst-normal {
  font-style: normal;
}

.lh-1 {
  line-height: 1;
}
.lh-sm {
  line-height: 1.25;
}
.lh-base {
  line-height: 1.5;
}
.lh-relaxed {
  line-height: 1.7;
}

.color-text {
  color: var(--text);
}
.color-text2 {
  color: var(--text2);
}
.color-text3 {
  color: var(--text3);
}
.color-accent {
  color: var(--accent);
}
.color-purple {
  color: var(--purple);
}
.color-green {
  color: var(--green);
}
.color-blue {
  color: var(--blue);
}

.position-relative {
  position: relative;
}
.position-absolute {
  position: absolute;
}
.position-fixed {
  position: fixed;
}
.position-sticky {
  position: sticky;
}
.top-0 {
  top: 0;
}
.bottom-0 {
  bottom: 0;
}
.start-0 {
  left: 0;
}
.end-0 {
  right: 0;
}

.overflow-auto {
  overflow: auto;
}
.overflow-hidden {
  overflow: hidden;
}
.overflow-visible {
  overflow: visible;
}
.overflow-scroll {
  overflow: scroll;
}
.overflow-x-auto {
  overflow-x: auto;
}
.overflow-y-auto {
  overflow-y: auto;
}

.rounded {
  border-radius: var(--radius);
}
.rounded-sm {
  border-radius: 6px;
}
.rounded-lg {
  border-radius: 14px;
}
.rounded-full {
  border-radius: 9999px;
}
.rounded-0 {
  border-radius: 0;
}

.border {
  border: 1px solid var(--border);
}
.border-0 {
  border: 0;
}
.border-top {
  border-top: 1px solid var(--border);
}
.border-bottom {
  border-bottom: 1px solid var(--border);
}

.visible {
  visibility: visible;
}
.invisible {
  visibility: hidden;
}

.opacity-0 {
  opacity: 0;
}
.opacity-25 {
  opacity: 0.25;
}
.opacity-50 {
  opacity: 0.5;
}
.opacity-75 {
  opacity: 0.75;
}
.opacity-100 {
  opacity: 1;
}

.float-start {
  float: left;
}
.float-end {
  float: right;
}
.float-none {
  float: none;
}
.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

.user-select-none {
  user-select: none;
}
.user-select-all {
  user-select: all;
}
.pe-none {
  pointer-events: none;
}
.pe-auto {
  pointer-events: auto;
}

.cursor-pointer {
  cursor: pointer;
}
.opacity-60 {
  opacity: 0.6;
}

.breadcrumb-sep {
  color: var(--text3);
  margin: 0 6px;
}
.icon-accent {
  color: var(--accent);
  margin-right: 6px;
}
.table-empty td {
  text-align: center;
  color: var(--text3);
  padding: 40px;
}
.table-group-head td {
  padding: 8px 18px 7px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.btn-block {
  width: 100%;
  justify-content: center;
}
.preview-modal .modal {
  width: 720px;
  max-width: 95vw;
  height: 80vh;
  display: flex;
  flex-direction: column;
}
.preview-modal .modal iframe {
  flex: 1;
  border: none;
  border-radius: 0 0 12px 12px;
  background: #fff;
}
#app {
  display: flex;
  width: 100%;
  height: 100dvh;
  position: relative;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
.content > *:not(.site-footer) {
  flex-shrink: 0;
}
.content > .site-footer {
  flex-shrink: 0;
}
.content::-webkit-scrollbar {
  width: 5px;
}
.content::-webkit-scrollbar-track {
  background: transparent;
}
.content::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 3px;
}

.footer-spacer {
  flex: 1;
  min-height: 40px;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 20;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 19;
}
.sidebar-overlay.visible {
  display: block;
}

.logo {
  padding: 18px 20px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo img {
  height: 24px;
  width: auto;
  margin-bottom: 5px;
}

.team-selector {
  position: relative;
  margin-left: auto;
  margin-right: -10px;
}
.team-selector-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  border-radius: 8px;
  padding: 4px 8px 4px 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.team-selector-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}
.team-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.team-avatar.small {
  width: 22px;
  height: 22px;
  font-size: 10px;
}
.team-chevron {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.5);
  transition: transform 0.2s;
}
.team-selector.open .team-chevron {
  transform: rotate(180deg);
}
.team-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: var(--sidebar-bg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 4px;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.team-selector.open .team-dropdown {
  display: block;
}
.team-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
  text-decoration: none;
}
.team-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.team-dropdown-item.active {
  color: #fff;
}
.team-check {
  margin-left: auto;
  font-size: 10px;
  color: var(--accent);
}

.team-dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 4px 0;
}
.team-create-btn {
  text-decoration: none;
}
.team-create-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
}

.plan-badge-sidebar {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--accent);
  background: rgba(99, 102, 241, 0.15);
  padding: 3px 8px;
  border-radius: 5px;
  margin-bottom: 4px;
}
.logo-close {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.5);
  padding: 4px;
}
.logo-close i {
  font-size: 18px;
}

.topbar {
  height: 68px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  background: var(--surface);
  flex-shrink: 0;
}
.topbar-title {
  font-size: 15px;
  font-weight: 600;
  flex: 1;
  color: var(--text);
  min-width: 0;
}
.topbar-title span {
  color: var(--text3);
  font-weight: 400;
  font-size: 13px;
}
.topbar-usage {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
  padding-right: 20px;
  margin-right: 10px;
  border-right: 1px solid #e5e7eb;
}
.topbar-usage-text {
  font-size: 12px;
  color: var(--text3);
  font-weight: 500;
  white-space: nowrap;
}
.topbar-usage-track {
  width: 100px;
  height: 5px;
  background: var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.topbar-usage-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 10px;
  transition: width 0.3s;
}

.language-selector {
  position: relative;
}
.language-selector-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: none;
  color: var(--text2);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.language-selector-btn:hover {
  background: var(--surface2);
  color: var(--text);
}
.language-selector-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 150px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  z-index: 100;
  padding: 4px;
}
.language-selector.open .language-selector-dropdown {
  display: block;
}
.language-option {
  display: block;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text2);
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.1s;
}
.language-option:hover {
  background: var(--hover);
  color: var(--text);
}
.language-option.active {
  color: var(--accent);
  font-weight: 600;
}

.topbar-icon {
  display: none;
}
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text2);
  padding: 6px;
  margin: -6px;
  border-radius: 8px;
}
.hamburger:hover {
  opacity: 0.25M;
}
.hamburger i {
  font-size: 18px;
  display: block;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}
.theme-toggle:hover {
  background: var(--surface2);
  color: var(--text);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text3);
}
.footer-left {
  white-space: nowrap;
}
.footer-links {
  display: flex;
  list-style: none;
  gap: 16px;
}
.footer-links a {
  color: var(--text3);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-links a:hover {
  color: var(--text2);
}


#toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 600;
  display: none;
  background: #1f2937;
  color: #fff;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 13px;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}
.nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--sidebar-text);
  transition: all 0.15s;
  font-size: 13px;
  user-select: none;
  text-decoration: none;
}
.nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-active);
}
.nav-item.active {
  background: var(--sidebar-active);
  color: var(--sidebar-text-active);
}
.nav-item.disabled {
  opacity: 0.35;
  position: relative;
}
.nav-item.disabled::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  cursor: not-allowed;
}
.nav-item i {
  font-size: 14px;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}
.nav-divider {
  height: 1px;
  background: var(--sidebar-hover);
  margin: 10px;
}
.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 12px 10px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.usage-widget {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 9px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.usage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.usage-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.usage-count {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 500;
}
.usage-bar-track {
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
}
.usage-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 10px;
  width: 20%;
}
.usage-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 6px;
}

.btn-upgrade {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: linear-gradient(45deg, #3576ff, #1ccc6e);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
  width: 100%;
}
.btn-upgrade:hover {
  opacity: 0.88;
  color: #fff;
  text-decoration: none;
}
.btn-upgrade i {
  font-size: 12px;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}
.user-info {
  flex: 1;
  min-width: 0;
}
.user-name {
  font-size: 12px;
  color: #fff;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-email {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-plan {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 7px;
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.logout-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
  text-decoration: none;
}
.logout-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}
.logout-btn i {
  font-size: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn i {
  font-size: 12px;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent2);
}
.btn-primary:active {
  background: var(--accent2);
  opacity: 0.9;
}
.btn-ghost {
  background: var(--surface);
  color: var(--text2);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border2);
}
.btn-danger {
  background: var(--purple-dim);
  color: var(--purple);
  border: 1px solid rgba(145, 51, 254, 0.2);
}
.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}
.btn-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text3);
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
}
.btn-icon:hover {
  color: var(--text);
  border-color: var(--border2);
}
.btn-icon-sm {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text3);
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
}
.btn-icon-sm:hover {
  color: var(--text);
  border-color: var(--border2);
}
.btn-outline {
  background: none;
  border: 1px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 8px;
  transition: all 0.15s;
}
.btn-outline:hover {
  background: var(--surface2);
  color: var(--text);
}
.btn-outline:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.4;
}
.alert i {
  flex-shrink: 0;
  font-size: 20px;
}
.alert-notice {
  background: #f7f7f9;
  color: #4a4a4f;
}
.alert-success {
  background: #edf7ed;
  color: #1e6e1e;
}
.alert-error {
  background: #fdeded;
  color: #8e1e1e;
}
.alert-warning {
  background: #fff8e6;
  color: #7a5d00;
}
.alert-warning a {
  color: inherit;
  text-decoration: underline;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text3);
  flex-shrink: 0;
  cursor: help;
}
.status-dot.connected {
  background: var(--green);
  box-shadow: 0 0 0 2px rgba(25, 243, 124, 0.18);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.badge-active {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(25, 243, 124, 0.2);
}
.badge-active::before {
  background: var(--green);
}
.badge-inactive {
  background: var(--surface2);
  color: var(--text3);
  border: 1px solid var(--border);
}
.badge-inactive::before {
  background: var(--text3);
}
.badge-delivered {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(25, 243, 124, 0.2);
}
.badge-delivered::before {
  background: var(--green);
}
.badge-failed {
  background: var(--purple-dim);
  color: var(--purple);
  border: 1px solid rgba(145, 51, 254, 0.2);
}
.badge-failed::before {
  background: var(--purple);
}
.badge-pending {
  background: var(--blue-dim);
  color: var(--blue);
  border: 1px solid rgba(48, 162, 214, 0.2);
}
.badge-pending::before {
  background: var(--blue);
}
.badge-denied, .badge-blocked {
  background: var(--blue-dim);
  color: var(--blue);
  border: 1px solid rgba(48, 162, 214, 0.2);
}
.badge-denied::before, .badge-blocked::before {
  background: var(--blue);
}
.badge-rejected {
  background: var(--blue-dim);
  color: var(--blue);
  border: 1px solid rgba(48, 162, 214, 0.2);
}
.badge-rejected::before {
  background: var(--blue);
}
.badge-snoozed {
  background: #fef3cd;
  color: #856404;
  border: 1px solid rgba(133, 100, 4, 0.2);
}
.badge-snoozed::before {
  background: #856404;
}

.toggle {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
}
.toggle input {
  display: none;
}
.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--border2);
  border-radius: 20px;
  transition: background 0.2s;
}
.toggle input:checked + .toggle-track {
  background: var(--accent);
}
.toggle-thumb {
  position: absolute;
  left: 2px;
  top: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface);
  transition: transform 0.2s;
  pointer-events: none;
  z-index: 1;
}
.toggle input:checked ~ .toggle-thumb {
  transform: translateX(16px);
}

.content-alert {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  flex: 1 1 auto;
  min-height: 0;
  max-width: 672px;
  margin: 0 auto;
  width: 100%;
}
.content-alert-illustration {
  display: block;
  max-width: 256px;
  margin-bottom: 35px;
}
.content-alert-icon {
  font-size: 48px;
  color: var(--text3);
  margin-bottom: 16px;
}
.content-alert-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
}
.content-alert-desc {
  color: var(--text3);
  margin: 0 0 20px;
  line-height: 1.5;
}

.card-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.card-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
  display: flex;
  align-items: start;
  gap: 6px;
}
.chart-range-select {
  margin-left: auto;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  outline: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open {
  display: flex;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
  animation: modalIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  max-height: 92dvh;
  overflow-y: auto;
}
.modal.modal-lg {
  max-width: 750px;
}
.modal.modal-sm {
  max-width: 340px;
}
.modal-head {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-head-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.modal-head-icon i {
  font-size: 14px;
  color: var(--accent);
}
.modal-head-icon-confirm {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: 10px;
}
.modal-head-icon-confirm i {
  font-size: 42px;
  color: var(--accent);
}
.modal-title {
  font-weight: 600;
  font-size: 15px;
  flex: 1;
}
.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}
.modal-close:hover {
  background: var(--surface2);
  color: var(--text);
}
.modal-close i {
  font-size: 13px;
}
.modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
}
.modal-tab {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text3);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-family: inherit;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.modal-tab:hover:not(:disabled) {
  color: var(--text2);
}
.modal-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.modal-tab:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.modal-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal-footer {
  background: #f9f9f9;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.modal-footer-right {
  display: flex;
  gap: 8px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.form-label {
  font-size: 12px;
  color: var(--text2);
  font-weight: 500;
}
.form-input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 13px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition:
      border-color 0.15s,
      box-shadow 0.15s;
  width: 100%;
  -webkit-appearance: none;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.form-input::placeholder {
  color: var(--text3);
}
.form-input-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.settings-grid {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 16px;
  align-items: start;
}
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 520px;
}
.settings-actions {
  padding-top: 4px;
}
.log-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.log-entry {
  padding: 8px 14px;
  font-size: 12px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
.log-entry:last-child {
  border-bottom: none;
}
.log-entry-content {
  color: var(--text-primary);
  line-height: 1.4;
}
.log-entry-time {
  font-size: 11px;
  margin-top: 2px;
}

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.table-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.table-header-title {
  font-weight: 600;
  font-size: 14px;
  flex: 1;
  min-width: 120px;
}
.table-scroll {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}
.table-scroll::-webkit-scrollbar {
  height: 4px;
}
.table-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.table-scroll::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 2px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 6px 11px;
  width: 200px;
  min-width: 140px;
}
.search-box input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  width: 100%;
}
.search-box input::placeholder {
  color: var(--text3);
}
.search-box i {
  font-size: 12px;
  color: var(--text3);
  flex-shrink: 0;
}

.th-sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text3);
  text-decoration: none;
  font-weight: 600;
  font-size: 11px;
  white-space: nowrap;
  transition: color 0.15s;
}
.th-sort i {
  font-size: 9px;
  opacity: 0.3;
  transition: opacity 0.15s;
}
.th-sort:hover {
  color: var(--text);
}
.th-sort:hover i {
  opacity: 0.6;
}
.th-sort.active {
  color: var(--accent);
}
.th-sort.active i {
  opacity: 1;
}

.day-sep td {
  padding: 8px 18px 7px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border);
  pointer-events: none;
  white-space: nowrap;
}
.day-sep:first-child td {
  border-top: none;
}
tbody tr.day-sep:hover {
  background: var(--surface2);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 16px 0;
}
.pagination-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.15s;
}
.pagination-btn:hover {
  background: var(--surface2);
  color: var(--text);
}
.pagination-num {
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
  border-radius: 6px;
  transition: all 0.15s;
}
.pagination-num:hover {
  background: var(--surface2);
  color: var(--text);
}
.pagination-num.active {
  background: var(--accent);
  color: #fff;
}
.pagination-dots {
  color: var(--text3);
  font-size: 12px;
  padding: 0 2px;
}
.pagination-btn i {
  font-size: 10px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: none;
  color: var(--text3);
  cursor: pointer;
  transition: all 0.15s;
  margin-left: 4px;
}
.action-btn i {
  font-size: 13px;
}
.action-btn:hover {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--border2);
}
.action-btn.danger:hover {
  background: var(--purple-dim);
  color: var(--purple);
  border-color: rgba(145, 51, 254, 0.3);
}

.clickable-row {
  cursor: pointer;
}
.clickable-row:hover td {
  background: var(--accent-dim2);
}
.msg-row td {
  padding: 13px 18px;
}
.msg-subject {
  color: var(--text);
  font-weight: 500;
  margin-bottom: 3px;
  white-space: nowrap;
}
.msg-from {
  font-size: 11.5px;
  color: var(--text3);
}
.msg-alias-tag {
  display: inline-block;
  background: var(--blue-dim);
  color: var(--blue);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 5px;
  padding: 2px 8px;
  font-size: 11px;
}
.msg-properties {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}
.msg-property {
  display: inline-block;
  background: var(--border);
  color: var(--text3);
  border-radius: 4px;
  padding: 2px 5px;
  font-size: 10px;
  font-weight: 500;
}
.msg-filtered {
  position: absolute;
  background: var(--accent);
  top: 15px;
  right: -2.5px;
  border-radius: 100px;
  color: white;
  width: 18px;
  height: 18px;
  font-size: 10px;
  padding: 4px;
  text-align: center;
}
.sender-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--surface2);
}
.sender-avatar-xl {
  width: 32px;
  height: 32px;
}

.alias-address {
  color: var(--text);
  font-weight: 500;
}
.sparkline {
  width: 80px;
  height: 20px;
  flex-shrink: 0;
}
.sparkline polyline {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.alias-suffix {
  display: flex;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition:
      border-color 0.15s,
      box-shadow 0.15s;
}
.alias-suffix:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.alias-suffix input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  padding: 10px 13px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  min-width: 0;
}
.alias-suffix input::placeholder {
  color: var(--text3);
}
.alias-suffix-label {
  display: flex;
  align-items: center;
  padding: 0 13px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  color: var(--text3);
  font-size: 12.5px;
  white-space: nowrap;
  flex-shrink: 0;
}
.alias-suffix-select {
  background: var(--surface);
  border: none;
  border-left: 1px solid var(--border);
  color: var(--text2);
  font-size: 12.5px;
  font-family: inherit;
  padding: 0 13px;
  outline: none;
  cursor: pointer;
  flex-shrink: 0;
}

.copy-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text2);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
  border-radius: 4px;
  transition: all 0.15s;
}
.copy-tag:hover {
  color: var(--accent);
}
.copy-tag i {
  font-size: 10px;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.18s ease;
  height: 100%;
  overflow: hidden;
  flex-direction: column;
}
.tab-panel.active {
  display: flex;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stat-label {
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.stat-value.green {
  color: var(--green);
}
.stat-value.blue {
  color: var(--blue);
}
.stat-value.purple {
  color: var(--purple);
}
.stat-pct {
  font-size: 13px;
  font-weight: 500;
  opacity: 0.6;
}
.stat-sub {
  font-size: 11px;
  color: var(--text3);
  margin-top: 6px;
}

.placeholder-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  gap: 14px;
  color: var(--text3);
  text-align: center;
  padding: 20px;
}
.placeholder-icon {
  width: 58px;
  height: 58px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.placeholder-icon i {
  font-size: 24px;
  color: var(--text3);
}
.placeholder-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text2);
}
.placeholder-sub {
  font-size: 12.5px;
  max-width: 320px;
  line-height: 1.7;
}
.placeholder-tag {
  display: inline-block;
  background: var(--surface2);
  border: 1px dashed var(--border2);
  color: var(--text3);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 11px;
  margin-top: 4px;
}

.api-docs {
  margin-top: 24px;
}
.api-auth-details {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
}
.api-auth-details code {
  color: var(--text);
}
.api-section {
  margin-bottom: 20px;
}
.api-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}
.api-endpoint {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
}
.api-endpoint-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
}
.api-endpoint-head:hover {
  background: var(--surface2);
}
.api-chevron {
  margin-left: auto;
  font-size: 11px;
  color: var(--text3);
  transition: transform 0.2s;
}
.api-endpoint.open .api-chevron {
  transform: rotate(180deg);
}
.api-endpoint-body {
  display: none;
  padding: 15px;
  border-top: 1px solid var(--border);
}
.api-endpoint.open .api-endpoint-body {
  display: block;
}
.api-method {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}
.api-method-get {
  background: var(--green-dim);
  color: var(--green);
}
.api-method-post {
  background: var(--blue-dim);
  color: var(--blue);
}
.api-method-patch {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}
.api-method-delete {
  background: var(--purple-dim);
  color: var(--purple);
}
.api-path {
  font-size: 13px;
  color: var(--text);
  background: none;
  padding: 0;
}
.api-desc {
  font-size: 12.5px;
  color: var(--text3);
}
.api-params, .api-response, .api-request {
  margin-top: 14px;
}
.api-examples {
  display: flex;
  gap: 14px;
  margin-top: 14px;
}
.api-examples > .api-request,
.api-examples > .api-response {
  flex: 1;
  min-width: 0;
  margin-top: 0;
}
.api-param-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.api-param-table {
  width: 100%;
  font-size: 13px;
  border-collapse: collapse;
}
.api-param-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.api-param-table td:first-child {
  white-space: nowrap;
  width: 160px;
  color: var(--text);
}
.api-param-table td:last-child {
  color: var(--text2);
}
.api-param-table tr:last-child td {
  border-bottom: none;
}
.api-required {
  font-size: 10px;
  color: var(--purple);
  font-weight: 600;
}
.api-code {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 10px;
  line-height: 1.5;
  color: var(--text);
  overflow-x: auto;
  margin: 0;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

.provider-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.provider-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  transition: all 0.15s;
}
.provider-btn:hover {
  border-color: var(--accent);
  background: var(--accent-dim2);
}
.provider-btn img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

.type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.type-btn:hover {
  border-color: var(--accent);
  background: var(--accent-dim2);
}
.type-btn img {
  width: 96px;
  height: 96px;
}

.sample-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 330px;
  overflow-y: auto;
}
.sample-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text);
  text-align: left;
  width: 100%;
}
.sample-row:hover {
  background: var(--surface2);
}
.sample-row-icon {
  font-size: 13px;
  color: var(--text3);
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}
.sample-row-title {
  flex: 1;
  min-width: 0;
}
.sample-row-chevron {
  font-size: 10px;
  color: var(--text3);
  transition: transform 0.2s;
}
.sample-collapse.open .sample-row-chevron {
  transform: rotate(180deg);
}
.sample-collapse.open {
  background: var(--bg);
  border-radius: 8px;
}
.sample-body {
  display: none;
  padding: 6px 12px 12px 40px;
}
.sample-collapse.open .sample-body {
  display: block;
}
.sample-rule-group {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
}
.sample-group-connector {
  font-size: 10px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 5px 10px;
  text-align: center;
}
.sample-rule {
  font-size: 12px;
  color: var(--text2);
  padding: 3px 0;
}
.sample-rule-comp {
  font-weight: 600;
  background: #eaeaeb;
  padding: 2px 5px;
  border-radius: 5px;
}
.sample-rule-prefix {
  font-size: 10px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  margin-right: 5px;
}
.spam-slider {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(to right, #16a34a, #65a30d, #ca8a04, #ea780e, #dc2626);
  border-radius: 2px;
  outline: none;
}
.spam-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb, 99,102,241), 0.15);
  transition: box-shadow 0.15s;
}
.spam-slider::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 5px rgba(var(--accent-rgb, 99,102,241), 0.2);
}
.spam-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb, 99,102,241), 0.15);
}
.spam-slider::-moz-range-track {
  height: 4px;
  background: transparent;
  border: none;
}
.spam-score {
  font-size: 11px;
  font-weight: 600;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
}

.cb-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text2);
  user-select: none;
  line-height: 1.4;
}
.cb-wrap input[type="checkbox"] {
  display: none;
}
.cb-box {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border: 1.5px solid var(--border2);
  border-radius: 4px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.cb-wrap input:checked + .cb-box {
  background: var(--accent);
  border-color: var(--accent);
}
.cb-box i {
  font-size: 9px;
  color: #fff;
  opacity: 0;
  transition: opacity 0.1s;
}
.cb-wrap input:checked + .cb-box i {
  opacity: 1;
}
.cb-wrap:hover .cb-box {
  border-color: var(--accent);
}

.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text2);
  user-select: none;
}
.toggle-wrap input[type="checkbox"] {
  display: none;
}
.toggle-wrap .toggle-track {
  width: 36px;
  height: 20px;
  background: var(--border);
  border-radius: 10px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle-wrap .toggle-thumb {
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
}
.toggle-wrap input:checked + .toggle-track {
  background: var(--accent);
}
.toggle-wrap input:checked + .toggle-track .toggle-thumb {
  transform: translateX(16px);
}

.imap-test-result {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
}
.imap-test-success {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
}
.imap-test-error {
  color: var(--purple);
  background: var(--purple-dim);
}

.info-collapse {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.info-collapse summary {
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.info-collapse summary::-webkit-details-marker {
  display: none;
}
.info-collapse summary::after {
  content: "\f078";
  font-family: "Font Awesome 7 Free";
  font-weight: 900;
  font-size: 10px;
  color: var(--text3);
  transition: transform 0.2s;
}
.info-collapse[open] summary::after {
  transform: rotate(180deg);
}
.info-collapse ul {
  padding: 0 14px 12px 30px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.relay-threshold-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 150px;
}
.relay-threshold-inline .spam-slider {
  flex: 1;
  min-width: 60px;
  max-width: 100px;
}
.relay-spam-val {
  min-width: 22px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.relay-quick-add-body {
  padding: 12px 14px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.relay-quick-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: end;
  column-gap: 10px;
  row-gap: 10px;
}
.relay-quick-inline .relay-quick-msg {
  grid-column: 1 / -1;
}
.relay-quick-inline-actions {
  min-width: 140px;
  padding-top: 22px;
}
@media (max-width: 900px) {
  .relay-quick-inline {
    grid-template-columns: 1fr;
  }
  .relay-quick-inline-actions {
    min-width: 0;
    padding-top: 0;
  }
}

.logic-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.logic-option {
  display: flex;
  align-items: center;
  cursor: pointer;
}
.logic-option input {
  display: none;
}
.logic-pill {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  transition: all 0.15s;
  background: var(--surface2);
}
.logic-option input:checked + .logic-pill {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(37, 99, 235, 0.3);
}
.rule-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.rule-row:first-child {
  border-top: 1px solid var(--border);
}
.rule-connector {
  font-size: 10px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  min-width: 55px;
  text-align: center;
  flex-shrink: 0;
}
.rule-select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 10px;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text);
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
  -webkit-appearance: none;
  padding-right: 28px;
}
.rule-select:focus {
  border-color: var(--accent);
}
.select-wrapper {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}
.select-wrapper i {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: #9ca3af;
  pointer-events: none;
}
.rule-input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 10px;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text);
  outline: none;
  min-width: 0;
  transition: border-color 0.15s;
}
.rule-input:focus {
  border-color: var(--accent);
}
.rule-delete {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}
.rule-delete:hover {
  background: var(--purple-dim);
  color: var(--purple);
  border-color: rgba(145, 51, 254, 0.3);
}
.rule-delete i {
  font-size: 11px;
}

.group-card {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 14px;
  background: var(--surface);
  transition: border-color 0.15s;
}
.group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.group-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.group-logic-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.group-logic-label {
  font-size: 11px;
  color: var(--text3);
  font-weight: 500;
}
.group-logic-pill {
  padding: 2px 10px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  transition: all 0.15s;
  background: var(--surface2);
}
.group-logic-option {
  display: flex;
  cursor: pointer;
}
.group-logic-option input {
  display: none;
}
.group-logic-option input:checked + .group-logic-pill {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(37, 99, 235, 0.3);
}
.group-delete {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: none;
  border: 1px solid transparent;
  color: var(--text3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}
.group-delete:hover {
  background: var(--purple-dim);
  color: var(--purple);
  border-color: rgba(145, 51, 254, 0.3);
}
.group-delete i {
  font-size: 11px;
}
.group-connector-row {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
}
.group-connector {
  font-size: 10px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--surface2);
  padding: 3px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.group-card.test-match {
  border-color: #c1f3c6;
  background: #f6fdf6;
}
.group-card.test-no-match {
  border-color: #fbcccc;
  background: #fff8f8;
}
:root.dark .group-card.test-match {
  border-color: #1a4a2e;
  background: #0f1f16;
}
:root.dark .group-card.test-no-match {
  border-color: #4a1a1a;
  background: #1f0f0f;
}
.rule-indicator {
  font-size: 18px;
  flex-shrink: 0;
  color: var(--border2);
}
.rule-row.test-match > .rule-indicator {
  color: var(--green);
}
.rule-row.test-no-match > .rule-indicator {
  color: var(--red);
}
#test-result {
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
}
#test-result i {
  margin-right: 4px;
}
#test-result.test-result-match {
  background: var(--green-dim);
  color: var(--green);
}
#test-result.test-result-no-match {
  background: var(--red-dim);
  color: var(--red);
}

.action-option {
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s;
}
.action-option-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}
.action-radio {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.action-radio-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
}
.action-option-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}
.action-option-icon {
  font-size: 16px;
  color: var(--text3);
}
.action-option-body {
  padding: 0 14px 14px 40px;
  display: flex;
  flex-direction: column;
}

.billing-toggle {
  display: flex;
  gap: 4px;
  background: var(--surface2);
  border-radius: 10px;
  padding: 4px;
  width: fit-content;
  margin-bottom: 20px;
}
.billing-btn {
  background: none;
  border: none;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.billing-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.billing-save {
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

.snoozer-days {
  display: flex;
  gap: 4px;
}
.snoozer-day {
  cursor: pointer;
  user-select: none;
}
.snoozer-day input {
  display: none;
}
.snoozer-day span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface2);
  font-size: 11px;
  font-weight: 500;
  color: var(--text3);
  transition: all 0.15s;
}
.snoozer-day input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.gatekeeper-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 20px;
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(16, 185, 129, 0.2);
  font-size: 12px;
  font-weight: 500;
}

.sb-chat-btn {
  background: linear-gradient(45deg, #3576ff, #15f27c);
}
.auth-split {
  display: flex;
  min-height: 100vh;
}
.auth-left {
  flex: 0 0 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--surface);
  overflow-y: auto;
}
.auth-left-inner {
  width: 100%;
  max-width: 380px;
}
.auth-right {
  flex: 1;
  background: #061d51 url(/assets/images/authentication/background.png) repeat-x center bottom;
  background-size: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.auth-didyouknow {
  position: relative;
  z-index: 1;
  padding: 28px 32px;
  max-width: 380px;
  text-align: center;
}
.auth-dyk-image {
  height: 200px;
  margin: 0 auto;
}
.auth-dyk-label {
  font-size: 26px;
  font-weight: 600;
  color: white;
  letter-spacing: 0.5px;
  margin: 50px 0 15px;
}
.auth-dyk-text {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
}
.auth-logo {
  padding: 0 0 32px;
  display: flex;
  align-items: center;
}
.auth-logo img {
  height: 26px;
  width: auto;
}
.auth-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.auth-sub {
  font-size: 13.5px;
  color: var(--text2);
  margin-bottom: 24px;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 4px;
  width: 100%;
}
.auth-btn:hover {
  background: var(--accent2);
}
.auth-btn:active {
  background: var(--accent2);
  opacity: 0.9;
}
.auth-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.auth-switch {
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  color: var(--text2);
}
.auth-switch a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}
.auth-error {
  background: var(--purple-dim);
  color: var(--purple);
  border: 1px solid rgba(145, 51, 254, 0.2);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}
.auth-success {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}

.mailbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 12px;
}
.mailbox-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s;
}
.mailbox-card:hover {
  border-color: var(--border2);
}
.mailbox-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.mailbox-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mailbox-icon img {
  height: 100%;
  width: 100%;
}
.mailbox-info {
  flex: 1;
  min-width: 0;
}
.mailbox-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.mailbox-addr {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mailbox-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.mailbox-meta-item {
  font-size: 11px;
  color: var(--text3);
}
.mailbox-meta-item strong {
  color: var(--text2);
}
.mailbox-actions {
  display: flex;
  gap: 6px;
}
.mailbox-add {
  border-style: dashed;
  border-color: var(--border2);
  cursor: pointer;
  min-height: 120px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text3);
  transition: all 0.15s;
}
.mailbox-add:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim2);
}
.mailbox-add i {
  font-size: 20px;
}
.mailbox-add-label {
  font-size: 13px;
  font-weight: 500;
}

.filter-editor-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
  align-items: start;
}

.shield-alias-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.shield-alias-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
}
.shield-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.shield-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
}
.shield-header-text {
  flex: 1;
  min-width: 0;
}
.shield-header .toggle {
  margin-top: 4px;
}
.shield-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.shield-icon i {
  font-size: 16px;
}
.shield-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.shield-sub {
  font-size: 12.5px;
  color: var(--text2);
  margin-top: 2px;
  line-height: 1.5;
}
.shield-body {
  padding: 16px 20px 20px;
}
.shield-empty {
  padding: 16px 0 8px;
}
.shield-empty p {
  font-size: 12.5px;
  color: var(--text3);
  text-align: center;
}
.shield-add-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.shield-rule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--text2);
  line-height: 1.5;
}
.shield-rule-text {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.shield-rule .rule-delete {
  flex-shrink: 0;
}

.content-information {
  margin-top: 16px;
}
.info-row {
  display: flex;
  gap: 16px;
  align-items: center;
}
.info-row-illustration {
  height: 128px;
  flex-shrink: 0;
}
.domain-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}
.domain-icon-default {
  background: var(--accent-dim);
  color: var(--accent);
}
.domain-icon-custom {
  background: var(--green-dim);
  color: var(--green);
}
.domain-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.domain-summary-main {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
}
.domain-summary-checks {
  display: flex;
  gap: 20px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface2);
}
.domain-check {
  display: flex;
  align-items: center;
  gap: 8px;
}
.domain-check-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}
.domain-check-icon.check-pass {
  background: var(--green-dim);
  color: var(--green);
}
.domain-check-icon.check-fail {
  background: var(--purple-dim);
  color: var(--purple);
}
.domain-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.domain-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.domain-step-num {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.domain-step-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}
.domain-step-desc {
  font-size: 12px;
  color: var(--text2);
  margin-top: 1px;
}
.domain-verify-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.dns-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
}
.dns-verified {
  color: var(--green);
}
.dns-pending {
  color: var(--blue);
}
.dns-failed {
  color: var(--purple);
}
.dns-record-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.dns-record-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.dns-record-type {
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}
.dns-record-type-txt {
  background: var(--green);
}
.dns-record-body {
  padding: 10px 12px;
}
.dns-record-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text2);
  padding: 3px 0;
}
.dns-record-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  width: 55px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.dns-record-row code {
  font-family: "SF Mono", Monaco, Consolas, monospace;
  font-size: 12px;
  color: var(--text);
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  word-break: break-all;
}

.dash-grid {
  display: grid;
  grid-template-columns: 60fr 40fr;
  gap: 16px;
}
.dash-grid > * {
  min-width: 0;
}
.dash-grid-alias {
  grid-template-columns: 75fr 25fr;
}
.dash-grid-single {
  grid-template-columns: 1fr;
}
.alias-overview {
  display: grid;
  grid-template-columns: 75fr 25fr;
  gap: 16px;
}
.alias-overview.alias-overview-single {
  grid-template-columns: 1fr;
}
.alias-overview > * {
  min-width: 0;
}
.alias-overview-card {
  display: flex;
  flex-direction: column;
}
.alias-overview-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
}
.alias-mailbox-icon img {
  width: 40px;
  height: 40px;
  margin-bottom: 6px;
}
.gauge-inline {
  background: var(--bg);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.gauge-wrap {
  width: 80px;
  flex-shrink: 0;
}
.gauge-svg {
  width: 100%;
  height: auto;
  display: block;
}
.alias-mailbox-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.blacklist-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.blacklist-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s;
}
.blacklist-card:hover {
  border-color: var(--accent);
}
.blacklist-card-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 4px;
}
.blacklist-card-info {
  flex: 1;
  min-width: 0;
}
.blacklist-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.blacklist-card-zone {
  font-size: 10px;
  color: var(--text3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.blacklist-card .toggle-wrap {
  flex-shrink: 0;
  margin-left: auto;
}
.alias-stats-split {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 24px;
  align-items: center;
}
.alias-stats-split > .dash-chart-wrap {
  min-width: 0;
  min-height: 0;
  max-height: 200px;
  flex: none;
}
.alias-stats-right {
  border-left: 1px solid var(--border);
  padding-left: 24px;
}
.alias-stats-total {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}
.alias-stats-total span {
  font-size: 13px;
  font-weight: 400;
  color: var(--text3);
}
.dash-grid-bottom {
  display: grid;
  grid-template-columns: 60fr 40fr;
  gap: 16px;
}
.dash-grid-bottom > * {
  min-width: 0;
}
.dash-chart-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.dash-chart-wrap {
  flex: 1;
  min-height: 260px;
  position: relative;
}
.dash-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.dash-side-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.dash-category-list {
  display: flex;
  flex-direction: column;
}
.dash-category-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}
.dash-category-row:last-child {
  border-bottom: none;
}
.dash-category-name {
  flex: 1;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-category-pct {
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  flex-shrink: 0;
}
.protection-ring-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 0 8px;
}
.protection-ring {
  position: relative;
  width: 130px;
  height: 130px;
}
.protection-ring svg {
  transform: rotate(-90deg);
  width: 130px;
  height: 130px;
}
.protection-ring .ring-bg {
  fill: none;
  stroke: var(--surface2);
  stroke-width: 10;
}
.protection-ring .ring-fill {
  fill: none;
  stroke: var(--green);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}
.protection-ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.protection-ring-pct {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.protection-ring-sub {
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}
.dash-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dash-breakdown-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.dash-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dash-breakdown-label {
  flex: 1;
  color: var(--text2);
}
.dash-breakdown-pct {
  font-size: 11px;
  color: var(--text3);
  width: 32px;
  text-align: right;
  flex-shrink: 0;
}
.dash-breakdown-value {
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
  min-width: 32px;
  text-align: right;
}
.dash-breakdown-total {
  font-size: 12px;
  color: var(--text3);
  text-align: center;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}
.dash-bar-stack {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--surface2);
}
.dash-bar-seg {
  height: 100%;
}
.dash-top-list {
  display: flex;
  flex-direction: column;
}
.dash-top-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.dash-top-item:last-child {
  border-bottom: none;
}
.dash-top-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--surface2);
}
.dash-top-info {
  flex: 1;
  min-width: 0;
}
.dash-top-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-top-email {
  font-size: 11px;
  color: var(--text3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-top-category {
  font-size: 11px;
  color: var(--text3);
  white-space: nowrap;
  flex-shrink: 0;
}
.dash-top-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  flex-shrink: 0;
}
.dash-recent {
  display: flex;
  flex-direction: column;
}
.dash-recent-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.dash-recent-row:last-child {
  border-bottom: none;
}
.dash-recent-from {
  width: 180px;
  flex-shrink: 0;
  min-width: 0;
  overflow: hidden;
}
.dash-recent-subject {
  flex: 1;
  font-size: 13px;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-recent-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.contact-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.cb-unset {
  background: var(--surface2);
  color: var(--text3);
  border: 1px solid var(--border);
}
.cb-whitelisted {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.cb-prioritized {
  background: var(--blue-dim);
  color: var(--blue);
  border: 1px solid rgba(59, 130, 246, 0.2);
}
.cb-muted {
  background: var(--blue-dim);
  color: var(--blue);
  border: 1px solid rgba(48, 162, 214, 0.2);
}
.cb-blocked {
  background: var(--purple-dim);
  color: var(--purple);
  border: 1px solid rgba(145, 51, 254, 0.2);
}
.state-info-row {
  padding: 15px 20px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
}
.state-info-row:last-child {
  border-bottom: none;
}
.state-info-row .contact-badge {
  flex-shrink: 0;
  width: 90px;
  justify-content: center;
  margin-top: 2px;
}
.state-info-row span:last-child {
  line-height: 1.5;
}
.info-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  margin-top: 16px;
  border-radius: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text3);
}
.info-box i {
  margin-top: 2px;
  flex-shrink: 0;
  color: var(--accent);
}
.drag-handle {
  cursor: grab;
  color: var(--text3);
  margin-right: 8px;
  user-select: none;
  opacity: 0.5;
}
.drag-handle:active {
  cursor: grabbing;
}
tr.drag-active {
  opacity: 0.9;
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  border-radius: 4px;
}
tr.drag-placeholder td {
  background: var(--surface2);
  border: 2px dashed var(--border2);
}
.contact-state-dropdown {
  position: fixed;
  z-index: 400;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  min-width: 160px;
  overflow: hidden;
}
.contact-state-dropdown-inner {
  padding: 6px;
}
.contact-state-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}
.contact-menu-item {
  display: flex;
  align-items: center;
  padding: 5px 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s;
}
.contact-menu-item:hover {
  background: var(--surface2);
}

.contact-profile {
  display: grid;
  grid-template-columns: 250px 1fr 1fr 2fr;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}
.contact-profile > div {
  padding: 20px;
}
.contact-profile > div + div {
  border-left: 1px solid var(--border);
}
.contact-profile-heading {
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  font-weight: 500;
}
.contact-profile-avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.contact-avatar-img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 10px;
}
.contact-avatar-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
  line-height: 1.3;
}
.contact-avatar-count {
  font-size: 11px;
  color: var(--text3);
  margin-top: 4px;
}
.contact-names-scroll {
  max-height: 165px;
  overflow-y: auto;
}
.contact-name-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
}
.contact-name-entry + .contact-name-entry {
  border-top: 1px solid var(--border);
}
.contact-name-text {
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 8px;
}
.contact-name-count {
  font-size: 11px;
  color: var(--text3);
  background: var(--surface2);
  padding: 1px 7px;
  border-radius: 10px;
  flex-shrink: 0;
}
.contact-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 5px 0;
  font-size: 13px;
}
.contact-detail-row + .contact-detail-row {
  border-top: 1px solid var(--border);
}
.contact-detail-label {
  color: var(--text3);
  flex-shrink: 0;
  margin-right: 10px;
}
.contact-detail-value {
  color: var(--text);
  text-align: right;
  min-width: 0;
}
.contact-category-switch {
  cursor: pointer;
  border-radius: 4px;
  padding: 1px 4px;
  margin: -1px -4px;
  transition: background 0.15s;
}
.contact-category-switch:hover {
  background: var(--surface2);
}
.category-list {
  padding: 6px 0;
}
.category-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.1s;
}
.category-list-item:hover {
  background: var(--surface2);
}
.category-list-item.active {
  color: var(--accent);
}
.category-list-item .fa-check {
  font-size: 11px;
  color: var(--accent);
}
.contact-profile-chart {
  display: flex;
  flex-direction: column;
  padding-bottom: 0 !important;
}
.contact-chart-wrap {
  flex: 1;
  min-height: 80px;
  position: relative;
}

.contact-content-row {
  display: flex;
  gap: 16px;
}
.contact-content-messages {
  flex: 3;
  min-width: 0;
}
.contact-content-subscriptions {
  flex: 1;
  min-width: 220px;
}
.subscription-list {
  padding: 0;
}
.subscription-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.subscription-item:last-child {
  border-bottom: none;
}
.subscription-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text3);
  flex-shrink: 0;
  margin-top: 5px;
}
.subscription-dot.active {
  background: var(--green);
}
.subscription-info {
  flex: 1;
  min-width: 0;
}
.subscription-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.subscription-id {
  font-size: 11px;
  font-family: monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.subscription-meta {
  font-size: 11px;
  margin-top: 1px;
}
.subscription-unsubscribed .subscription-name {
  text-decoration: line-through;
  opacity: 0.5;
}
.subscription-item .btn-sm {
  flex-shrink: 0;
  margin-top: 1px;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.plan-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  transition: border-color 0.15s;
}
.plan-card:hover {
  border-color: var(--border2);
}
.plan-featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.plan-badge {
  position: absolute;
  top: -10px;
  right: 16px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  letter-spacing: 0.02em;
}
.plan-details {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.plan-details img {
  width: 58px;
  height: 58px;
}
.plan-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.plan-price {
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.plan-amount {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
}
.plan-period {
  font-size: 13px;
  color: var(--text3);
}
.plan-specs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.plan-spec {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text2);
}
.plan-spec i {
  width: 14px;
  text-align: center;
  color: var(--accent);
  font-size: 12px;
}
.plan-btn {
  width: 100%;
  justify-content: center;
}

.cloud-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 4px;
  padding: 12px;
}
.cloud-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 10px 10px;
  border-radius: 8px;
  transition: background 0.15s;
  position: relative;
}
.cloud-grid-item:hover {
  background: var(--surface2);
}
.cloud-grid-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  flex-shrink: 0;
}
.cloud-grid-icon img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.cloud-grid-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}
.cloud-grid-meta {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
}
.cloud-grid-actions {
  display: flex;
  gap: 2px;
  margin-top: 6px;
  opacity: 0;
  transition: opacity 0.15s;
}
.cloud-grid-item:hover .cloud-grid-actions {
  opacity: 1;
}
.cloud-grid-empty {
  grid-column: 1 / -1;
  padding: 40px 18px;
  text-align: center;
  color: var(--text3);
  font-size: 13px;
}

/* Team page */
.team-layout {
  display: grid;
  grid-template-columns: 75fr 25fr;
  gap: 16px;
  align-items: start;
}

.team-role-badge {
  display: inline-block;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 4px;
}
.team-role-badge.owner {
  background: var(--accent-dim);
  color: var(--accent);
}
.team-role-badge.admin {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}
.team-role-badge.member {
  background: var(--green-dim);
  color: #34d399;
}
.team-role-badge.pending {
  background: rgba(156, 163, 175, 0.12);
  color: var(--text3);
}

.team-members-table {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}
.team-member-row {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}
.team-member-row:last-child {
  border-bottom: none;
}
.team-member-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.team-member-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}
.team-member-avatar-pending {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text3);
  font-size: 13px;
}
.team-member-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.team-member-email {
  font-size: 11.5px;
  color: var(--text3);
  margin-top: 1px;
}
.team-member-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.team-member-hint {
  font-size: 11px;
  color: var(--text3);
  white-space: nowrap;
}
.team-member-pending {
  opacity: 0.65;
}
.perm-modal-user {
  margin-bottom: 14px;
}
.perm-modal-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.perm-modal-email {
  font-size: 12px;
  color: var(--text3);
  margin-top: 2px;
}
.perm-modal-grid {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.perm-modal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.perm-modal-row:last-child {
  border-bottom: none;
}
.perm-modal-scope {
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.perm-modal-scope i {
  width: 16px;
  text-align: center;
  color: var(--text3);
  font-size: 12px;
}
.perm-seg {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.perm-seg-btn {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--text3);
  cursor: pointer;
  transition: background .15s, color .15s;
  border-right: 1px solid var(--border);
}
.perm-seg-btn:last-child {
  border-right: none;
}
.perm-seg-btn:hover {
  background: var(--surface2);
}
.perm-seg-btn.active[data-value="off"] {
  background: var(--surface2);
  color: var(--text);
}
.perm-seg-btn.active[data-value="read"] {
  background: var(--blue);
  color: #fff;
}
.perm-seg-btn.active[data-value="write"] {
  background: var(--green);
  color: #fff;
}
.perm-seg-btn.active[data-value="on"] {
  background: var(--blue);
  color: #fff;
}
.perm-modal-note {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--surface2);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--text3);
  display: flex;
  align-items: center;
  gap: 8px;
}
.perm-modal-note i {
  font-size: 11px;
}
.team-invite-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.btn-danger-text {
  color: #ef4444;
  border-color: transparent;
}
.btn-danger-text:hover {
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
}


@media (max-width: 1100px) {
  .filter-editor-grid {
      grid-template-columns: 1fr 300px;
  }
}

@media (max-width: 900px) {
  .filter-editor-grid {
      grid-template-columns: 1fr;
  }
  .info-row {
      flex-direction: column;
      text-align: center;
  }
  .settings-grid {
      grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .stats-row {
      grid-template-columns: repeat(3, 1fr);
  }
  .dash-recent-from {
      width: 140px;
  }
}

.d-mobile-only {
  display: none !important;
}

@media (max-width: 768px) {
  .content-alert {
      justify-content: flex-start;
  }
  .d-mobile-only {
      display: block !important;
  }
  .d-desktop-only {
      display: none !important;
  }
  body {
      font-size: 14px;
  }

  .sidebar {
      position: fixed;
      top: 0;
      left: 0;
      bottom: 0;
      transform: translateX(-100%);
      z-index: 300;
      width: 280px;
  }
  .sidebar.open {
      transform: translateX(0);
  }
  .logo-close {
      display: flex;
      align-items: center;
      justify-content: center;
  }
  .team-selector {
      margin-right: 0;
  }
  .team-layout {
      grid-template-columns: 1fr;
  }
  .plan-badge-sidebar {
      display: none;
  }

  .topbar-icon {
      display: block;
      width: 28px;
      height: 28px;
  }
  .hamburger {
      display: flex;
  }
  .content {
      padding: 16px 14px;
  }

  .stats-row {
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      margin-bottom: 16px;
  }
  .stat-card {
      padding: 14px 14px;
  }
  .stat-value {
      font-size: 22px;
  }
  .contact-profile {
      grid-template-columns: 1fr;
  }
  .contact-profile > div + div {
      border-left: none;
      border-top: 1px solid var(--border);
  }
  .contact-chart-wrap {
      min-height: 100px;
  }

  .modal-overlay {
      align-items: flex-end;
      padding: 0;
  }
  .modal {
      border-radius: 20px 20px 0 0;
      max-width: 100%;
  }

  .topbar-title span {
      display: none;
  }
  .topbar {
      padding: 0 14px;
      background: #061d51;
      border-bottom-color: transparent;
  }
  .topbar-title {
      color: #fff;
  }
  .hamburger {
      color: #fff;
  }
  .language-selector-btn,
  .theme-toggle {
      border: none;
      color: #fff;
      padding-right: 0;
  }
  .language-selector-btn:hover,
  .theme-toggle:hover,
  .hamburger:hover {
      background: none;
      color: #fff;
  }

  .table-wrap {
      border-radius: 10px;
  }
  .table-scroll {
      -webkit-overflow-scrolling: touch;
  }

  .contact-content-row {
      flex-direction: column;
  }
  .contact-content-subscriptions {
      min-width: 0;
  }

  .mailbox-grid {
      grid-template-columns: 1fr;
  }

  .table-header {
      padding: 12px 14px;
  }
  .search-box {
      width: 100%;
  }

  .auth-split {
      flex-direction: column;
  }
  .auth-left {
      flex: none;
      padding: 32px 20px;
      min-height: auto;
  }
  .auth-right {
      display: none;
  }
  .auth-logo {
      padding: 0 0 24px;
  }
  .form-row {
      grid-template-columns: 1fr;
  }

  .dash-grid,
  .dash-grid-bottom {
      grid-template-columns: 1fr;
  }
  .dash-side-split,
  .alias-stats-split {
      grid-template-columns: 1fr;
  }
  .alias-overview {
      grid-template-columns: 1fr;
  }
  .alias-stats-right {
      border-left: none;
      padding-left: 0;
      border-top: 1px solid var(--border);
      padding-top: 16px;
  }
  .dash-chart-wrap {
      height: 200px;
  }
  .dash-recent-from {
      width: 120px;
      flex-shrink: 0;
  }
  .dash-recent-subject {
      display: none;
  }

  #toast {
      font-size: 12.5px;
  }
  .cloud-grid {
      grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
      gap: 2px;
      padding: 8px;
  }
  .cloud-grid-actions {
      opacity: 1;
  }
  .btn span {
      display: none;
  }
  .btn {
      padding: 8px 10px;
  }
}

@media (max-width: 420px) {
  .stats-row {
      grid-template-columns: 1fr 1fr;
  }
  .stat-label {
      font-size: 10px;
  }
  .stat-value {
      font-size: 20px;
  }
}
@keyframes fadeIn {
  from {
      opacity: 0;
      transform: translateY(4px);
  }
  to {
      opacity: 1;
      transform: translateY(0);
  }
}
@keyframes modalIn {
  from {
      opacity: 0;
      transform: scale(0.96) translateY(10px);
  }
  to {
      opacity: 1;
      transform: scale(1) translateY(0);
  }
}

/* Address Book */
.ab-letters {
  display: flex;
  gap: 2px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  flex-shrink: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.ab-scroll {
  max-height: 350px;
  max-height: min(350px, 40dvh);
  overflow-y: auto;
  flex: 1 1 auto;
}
.ab-letter {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text3);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.ab-letter:hover {
  background: var(--surface2);
  color: var(--text);
}
.ab-letter.active {
  background: var(--accent);
  color: #fff;
}
.ab-list {
  display: flex;
  flex-direction: column;
}
.ab-contact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  transition: background 0.12s;
  width: 100%;
}
.ab-contact:last-child {
  border-bottom: none;
}
.ab-contact:hover {
  background: var(--surface2);
}
.ab-contact-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text3);
  flex-shrink: 0;
}
.ab-contact-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ab-email {
  color: var(--text3);
  font-size: 12px;
  margin-left: 4px;
}
.ab-status {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text3);
  font-size: 13px;
}
.ab-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border-top: 1px solid var(--border);
}
.ab-footer .btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.ab-page-info {
  font-size: 12px;
  color: var(--text3);
}
.ab-picker-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text2);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  flex: 1;
  min-width: 0;
}
.ab-picker-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}
.ab-picker-btn i {
  font-size: 11px;
  color: var(--text3);
}
.ab-picker-btn .ab-picker-label {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tooltip {
  position: fixed;
  z-index: 99999;
  padding: 5px 10px;
  background: var(--text);
  color: var(--bg);
  font-size: 12px;
  line-height: 1.4;
  border-radius: 6px;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .15s;
}
.tooltip.visible {
  opacity: 1;
}

/* ── Relay ── */
.relay-flow-diagram {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
}
.relay-flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 20px;
  background: var(--bg-2);
  border-radius: 10px;
  border: 1px solid var(--border);
  min-width: 100px;
}
.relay-flow-step-accent {
  background: var(--accent-dim);
  border-color: var(--accent);
}
.relay-flow-step-accent .relay-flow-icon {
  color: var(--accent);
}
.relay-flow-icon {
  font-size: 18px;
  color: var(--text-2);
}
.relay-flow-label {
  font-size: 12px;
  color: var(--text-2);
  font-weight: 500;
  white-space: nowrap;
}
.relay-flow-arrow {
  color: var(--text-3);
  font-size: 14px;
  flex-shrink: 0;
}
@media (max-width: 640px) {
  .relay-flow-diagram {
    flex-wrap: wrap;
    justify-content: center;
  }
  .relay-flow-step {
    min-width: 80px;
    padding: 10px 14px;
  }
}
.relay-domain-blocked {
  padding: 20px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.relay-domain-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  padding: 0;
}
.relay-domain-left,
.relay-domain-right {
  min-width: 0;
}
.relay-domain-left {
  display: flex;
  flex-direction: column;
}
.relay-domain-actions {
  margin-top: auto;
}
.relay-domain-right {
  padding: 12px 16px 16px;
  border-left: 1px solid var(--border);
}
.relay-domain-right .blacklist-card {
  padding: 8px 10px;
}
.relay-domain-right .blacklist-card-icon {
  width: 28px;
  height: 28px;
}
.relay-domain-right .blacklist-card-name {
  font-size: 12px;
}
.relay-domain-right .blacklist-card-zone {
  font-size: 9px;
}
.relay-domain-blocked-addresses {
  flex: 1;
}
.relay-domain-blocked-info {
  flex: 1;
  max-width: 400px;
}
@media (max-width: 980px) {
  .relay-domain-split {
    grid-template-columns: 1fr;
  }
  .relay-domain-right {
    border-left: 0;
    border-top: 1px solid var(--border);
  }
}
.relay-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.5;
}
.relay-notice i {
  color: #f59e0b;
  margin-top: 2px;
  flex-shrink: 0;
}

.modal-steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  padding: 16px 20px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-width: 80px;
}
.modal-step-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text3);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}
.modal-step-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text3);
  text-align: center;
}
.modal-step.active .modal-step-circle {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}
.modal-step.active .modal-step-label {
  color: var(--accent);
}
.modal-step.done .modal-step-circle {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.modal-step.done .modal-step-label {
  color: var(--text2);
}
.modal-step-divider {
  flex: 1 1 auto;
  height: 1px;
  background: var(--border);
  margin: 14px 4px 0;
  min-width: 24px;
  max-width: 60px;
}
.modal-step-divider.done {
  background: var(--accent);
}