:root {
  --night: #100c2a;
  --night-2: #1a143f;
  --violet: #7257ee;
  --violet-dark: #5d43d7;
  --violet-soft: #eeeafd;
  --mint: #19a87b;
  --mint-soft: #e7f8f1;
  --blue: #3186df;
  --blue-soft: #eaf4ff;
  --orange: #e77b35;
  --orange-soft: #fff2e8;
  --red: #d84c59;
  --red-soft: #ffedef;
  --ink: #211d35;
  --muted: #706b80;
  --muted-light: #a19cab;
  --page: #f6f5fa;
  --surface: #fff;
  --surface-2: #faf9fc;
  --line: #e7e4ed;
  --line-strong: #d7d2e0;
  --shadow-sm: 0 1px 2px rgba(22, 15, 46, .04), 0 5px 18px rgba(22, 15, 46, .04);
  --shadow-md: 0 16px 45px rgba(23, 16, 50, .11);
  --radius-sm: 9px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --header-height: 72px;
  --sidebar-width: 248px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: "Manrope", sans-serif; letter-spacing: -.035em; }
h1 { font-size: clamp(1.75rem, 3vw, 2.25rem); line-height: 1.15; }
h2 { font-size: 1.16rem; }

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

.app-header {
  height: var(--header-height);
  position: fixed;
  z-index: 50;
  inset: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(16, 12, 42, .98);
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.09);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: calc(var(--sidebar-width) - 24px); }
.brand-icon { width: 31px; height: 31px; object-fit: contain; }
.brand-wordmark { width: 78px; height: 28px; object-fit: contain; filter: brightness(0) invert(1); }
.brand > span {
  margin-left: 5px; padding-left: 15px; border-left: 1px solid rgba(255,255,255,.22);
  font-size: .72rem; color: rgba(255,255,255,.64); font-weight: 600; letter-spacing: .02em;
}
.header-actions { display: flex; align-items: center; gap: 12px; }
.system-status {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  border-radius: 999px; color: rgba(255,255,255,.72); background: rgba(255,255,255,.06);
  font-size: .72rem;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #42d5a2; box-shadow: 0 0 0 4px rgba(66,213,162,.1); }
.icon-button {
  width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center;
  justify-content: center; background: transparent; color: var(--muted); transition: .18s ease;
}
.icon-button:hover { background: var(--surface-2); color: var(--ink); }
.app-header .icon-button { color: rgba(255,255,255,.68); }
.app-header .icon-button:hover { background: rgba(255,255,255,.09); color: #fff; }
.icon-button svg { width: 19px; height: 19px; }
.icon-button.dark { background: rgba(255,255,255,.08); color: #fff; }
.notification-wrap { position: relative; }
.notification-dot, .nav-alert {
  position: absolute; width: 7px; height: 7px; background: #ff695f; border-radius: 50%;
  border: 2px solid var(--night); top: 8px; right: 8px;
}
.popover {
  position: absolute; right: 0; top: calc(100% + 12px); width: 340px; z-index: 60;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-md); box-shadow: var(--shadow-md); overflow: hidden;
}
.popover-head { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-bottom: 1px solid var(--line); }
.text-button {
  display: inline-flex; align-items: center; gap: 6px; color: var(--violet); background: transparent;
  padding: 4px; font-size: .8rem; font-weight: 700;
}
.text-button:hover { color: var(--violet-dark); }
.text-button svg { width: 15px; }
.notification-item { display: flex; gap: 12px; padding: 15px 16px; background: #fff; }
.notification-item.unread { background: #f8f6ff; }
.notification-icon {
  width: 33px; height: 33px; display: grid; place-items: center; flex: 0 0 auto;
  color: var(--violet); background: var(--violet-soft); border-radius: 9px;
}
.notification-item strong { font-size: .82rem; }
.notification-item p { margin-top: 3px; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.popover-empty { padding: 24px; text-align: center; color: var(--muted); }
.user-summary { display: flex; align-items: center; gap: 10px; padding-left: 14px; border-left: 1px solid rgba(255,255,255,.12); }
.avatar {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px;
  color: #fff; background: linear-gradient(135deg, #8068f3, #5439c7); font-size: .72rem; font-weight: 800;
}
.avatar-small { width: 34px; height: 34px; border-radius: 9px; }
.user-copy { display: flex; flex-direction: column; max-width: 190px; }
.user-copy strong { font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-copy small { color: rgba(255,255,255,.51); font-size: .67rem; }
.mobile-menu-button { display: none; }

.app-shell { display: flex; min-height: 100vh; padding-top: var(--header-height); }
.sidebar {
  position: fixed; inset: var(--header-height) auto 0 0; width: var(--sidebar-width);
  display: flex; flex-direction: column; padding: 26px 16px 18px; background: var(--surface);
  border-right: 1px solid var(--line); z-index: 40;
}
.nav-label, .eyebrow {
  color: var(--muted-light); font-size: .67rem; font-weight: 800; letter-spacing: .12em;
}
.nav-label { padding: 0 13px; margin: 0 0 9px; }
.nav-item {
  min-height: 44px; display: flex; align-items: center; gap: 12px; padding: 0 12px;
  color: #676274; border-radius: 10px; margin-bottom: 3px; font-size: .82rem; font-weight: 600;
  transition: .17s ease;
}
.nav-item:hover { color: var(--ink); background: var(--surface-2); }
.nav-item.active { color: var(--violet-dark); background: var(--violet-soft); font-weight: 700; }
.nav-item svg { width: 18px; height: 18px; }
.nav-count {
  min-width: 21px; height: 21px; display: grid; place-items: center; margin-left: auto;
  border-radius: 7px; background: #efedf3; color: var(--muted); font-size: .66rem;
}
.nav-item.active .nav-count { color: var(--violet-dark); background: rgba(114,87,238,.12); }
.nav-alert { position: static; margin-left: auto; border: 0; }
.help-card {
  position: relative; margin-top: auto; overflow: hidden; padding: 18px;
  color: #fff; background: linear-gradient(145deg, #251b55, #5f43d7); border-radius: 16px;
}
.help-card::after { content: ""; position: absolute; right: -35px; top: -35px; width: 105px; height: 105px; border-radius: 50%; border: 22px solid rgba(255,255,255,.05); }
.help-icon { width: 33px; height: 33px; display: grid; place-items: center; border-radius: 9px; color: #d9d1ff; background: rgba(255,255,255,.1); margin-bottom: 15px; }
.help-card strong { display: block; font-family: "Manrope"; font-size: .86rem; }
.help-card p { color: rgba(255,255,255,.66); font-size: .74rem; line-height: 1.5; margin: 6px 0 14px; }
.help-card .button { position: relative; z-index: 1; width: 100%; }
.sidebar-account { display: none; }
.sidebar-backdrop { display: none; }

.main-content { width: calc(100% - var(--sidebar-width)); margin-left: var(--sidebar-width); padding: 38px clamp(24px, 4vw, 58px) 60px; }
.view { display: none; max-width: 1420px; margin: 0 auto; animation: fadeIn .24s ease; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.welcome-row, .page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 28px; }
.welcome-row h1, .page-heading h1 { margin: 7px 0 7px; }
.welcome-row p, .page-heading p { color: var(--muted); line-height: 1.55; }
.page-actions, .toolbar-actions, .module-actions { display: flex; align-items: center; gap: 9px; }
.button {
  min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 16px; border-radius: 10px; font-size: .8rem; font-weight: 700; transition: .18s ease;
}
.button svg { width: 17px; height: 17px; }
.button-primary { color: #fff; background: var(--violet); box-shadow: 0 5px 14px rgba(114,87,238,.18); }
.button-primary:hover { background: var(--violet-dark); transform: translateY(-1px); }
.button-secondary { color: var(--ink); background: #fff; border: 1px solid var(--line-strong); }
.button-secondary:hover { border-color: #b9b0d2; background: #fcfbff; }
.button-light { color: var(--night); background: #fff; }
.button-light:hover { background: #f3efff; }
.button-ghost { color: var(--violet); background: var(--violet-soft); }
.button-danger { color: var(--red); background: var(--red-soft); border: 1px solid #fad0d4; }
.button-small { min-height: 35px; padding: 0 12px; font-size: .74rem; }

.attention-card {
  display: flex; align-items: center; gap: 14px; padding: 13px 16px; margin-bottom: 20px;
  background: #f0edff; border: 1px solid #dfd8ff; border-radius: var(--radius-md);
}
.attention-card.overdue { background: var(--red-soft); border-color: #f7cdd1; }
.attention-card > div { flex: 1; }
.attention-card strong { font-size: .82rem; }
.attention-card p { display: inline; margin-left: 8px; color: var(--muted); font-size: .78rem; }
.attention-icon { width: 35px; height: 35px; display: grid; place-items: center; flex: 0 0 auto; color: var(--violet); background: #fff; border-radius: 10px; }
.attention-card.overdue .attention-icon { color: var(--red); }

.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card, .panel, .module-card, .billing-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
}
.metric-card { padding: 19px; }
.metric-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: .75rem; font-weight: 600; }
.metric-icon, .billing-icon {
  width: 36px; height: 36px; display: grid; place-items: center; color: var(--violet); background: var(--violet-soft); border-radius: 10px;
}
.metric-icon.mint, .billing-icon.mint { color: var(--mint); background: var(--mint-soft); }
.metric-icon.blue, .billing-icon.blue { color: var(--blue); background: var(--blue-soft); }
.metric-icon.orange { color: var(--orange); background: var(--orange-soft); }
.metric-card > strong { display: block; margin: 13px 0 5px; font: 800 1.55rem "Manrope"; letter-spacing: -.04em; }
.metric-card > p { color: var(--muted-light); font-size: .7rem; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(280px, .75fr); gap: 18px; }
.panel { padding: 21px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-heading h2 { margin-top: 5px; }
.panel-heading p { margin-top: 5px; color: var(--muted); font-size: .76rem; }
.product-shortcuts { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.product-shortcut {
  min-height: 72px; display: grid; align-items: center; grid-template-columns: auto minmax(0,1fr) auto auto; gap: 11px;
  padding: 12px; border: 1px solid var(--line); border-radius: 12px; transition: .18s ease;
}
.product-shortcut:hover { border-color: #cfc8df; transform: translateY(-1px); }
.module-icon {
  width: 41px; height: 41px; display: grid; place-items: center; flex: 0 0 auto;
  color: var(--module-accent, var(--violet)); background: color-mix(in srgb, var(--module-accent, var(--violet)) 11%, white);
  border-radius: 11px;
}
.module-icon.large { width: 49px; height: 49px; border-radius: 13px; }
.product-shortcut strong { display: block; font-size: .8rem; }
.product-shortcut p { color: var(--muted); font-size: .68rem; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shortcut-action { width: 31px; height: 31px; background: var(--surface-2); }
.badge {
  width: fit-content; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 5px 8px; border-radius: 99px; font-size: .63rem; font-weight: 700;
}
.badge > span { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-success { color: #16815f; background: var(--mint-soft); }
.badge-warning { color: #b76627; background: var(--orange-soft); }
.badge-danger { color: #bd3441; background: var(--red-soft); }
.badge-neutral { color: #777181; background: #f0eef3; }
.invoice-summary { display: flex; flex-direction: column; }
.invoice-value { display: block; font: 800 1.8rem "Manrope"; letter-spacing: -.05em; }
.invoice-description { margin: 8px 0 20px; color: var(--muted); font-size: .72rem; line-height: 1.5; }
.invoice-actions { display: flex; gap: 8px; margin-top: auto; }
.invoice-actions .button:first-child { flex: 1; }
.invoice-summary .empty-illustration { width: 48px; height: 48px; display: grid; place-items: center; color: var(--mint); background: var(--mint-soft); border-radius: 14px; margin-bottom: 18px; }
.invoice-summary > h2 { margin-bottom: 6px; }
.invoice-summary > p { color: var(--muted); line-height: 1.5; margin-bottom: 18px; }
.discovery-banner {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; margin-top: 18px; padding: 22px 25px;
  color: #fff; background: radial-gradient(circle at 82% -50%, rgba(159,133,255,.5), transparent 45%), linear-gradient(120deg, #19113e, #4630a5);
  border-radius: var(--radius-lg); overflow: hidden;
}
.discovery-icon { width: 48px; height: 48px; display: grid; place-items: center; color: #d9d0ff; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.12); border-radius: 14px; }
.discovery-banner .eyebrow { color: #bcb0f2; }
.discovery-banner h2 { margin: 5px 0; color: #fff; }
.discovery-banner p { color: rgba(255,255,255,.62); font-size: .76rem; line-height: 1.45; max-width: 700px; }

.segmented-control { display: flex; padding: 4px; background: #ebe9f0; border-radius: 11px; }
.segmented-control button { min-height: 33px; padding: 0 13px; color: var(--muted); background: transparent; border-radius: 8px; font-size: .72rem; font-weight: 700; }
.segmented-control button.active { color: var(--ink); background: #fff; box-shadow: 0 2px 8px rgba(24,17,48,.08); }
.modules-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.module-card { position: relative; display: flex; flex-direction: column; padding: 21px; overflow: hidden; }
.module-card.contracted::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--violet); }
.module-card-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 17px; }
.module-category { color: var(--muted-light); font-size: .62rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.module-card h2 { margin: 6px 0 9px; font-size: 1.15rem; }
.module-description { min-height: 58px; color: var(--muted); font-size: .74rem; line-height: 1.52; }
.feature-list { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 8px; }
.feature-list li { display: flex; align-items: flex-start; gap: 8px; color: #5f596c; font-size: .7rem; line-height: 1.4; }
.feature-list li svg { flex: 0 0 auto; margin-top: 1px; color: var(--mint); }
.license-box, .manage-license {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
}
.license-box > div:first-child { display: flex; align-items: baseline; gap: 7px; }
.license-box span { color: var(--muted); font-size: .68rem; }
.license-box strong { font-size: .9rem; }
.quantity-control { display: flex; gap: 5px; }
.quantity-control button { width: 27px; height: 27px; color: var(--violet); background: #fff; border: 1px solid var(--line-strong); border-radius: 7px; font-size: 1rem; }
.quantity-control button:hover { border-color: var(--violet); }
.module-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 17px; margin-top: auto; }
.module-price strong { display: block; font: 800 1.03rem "Manrope"; }
.module-price span { color: var(--muted); font-size: .65rem; }
.empty-state.wide { grid-column: 1/-1; }

.billing-overview { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 15px; margin-bottom: 18px; }
.billing-card { display: flex; align-items: center; gap: 15px; padding: 19px; }
.billing-card.featured { background: var(--night); border-color: var(--night); color: #fff; }
.billing-card.featured .billing-icon { color: #d7ceff; background: rgba(255,255,255,.09); }
.billing-card > div > span { color: var(--muted); font-size: .7rem; }
.billing-card.featured > div > span, .billing-card.featured p { color: rgba(255,255,255,.56); }
.billing-card strong { display: block; margin: 4px 0; font: 800 1.16rem "Manrope"; }
.billing-card p { color: var(--muted-light); font-size: .68rem; }
.table-panel { padding: 0; overflow: hidden; }
.billing-toolbar { align-items: center; margin: 0; padding: 19px 21px; }
.search-field {
  height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 11px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px;
}
.search-field svg { width: 16px; color: var(--muted-light); }
.search-field input { width: 150px; padding: 0; border: 0; outline: 0; background: transparent; font-size: .75rem; }
.select-field, .field input, .field select, .field textarea {
  color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; outline: none;
}
.select-field { height: 38px; padding: 0 11px; font-size: .75rem; }
.select-field:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(114,87,238,.09); }
.table-scroll { overflow-x: auto; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; }
th { color: var(--muted-light); background: var(--surface-2); text-align: left; font-size: .63rem; letter-spacing: .05em; text-transform: uppercase; }
th, td { padding: 13px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { color: #5c5668; font-size: .75rem; }
td > strong { color: var(--ink); }
td small { display: block; max-width: 260px; color: var(--muted-light); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; }
tr:last-child td { border-bottom: 0; }
.module-chips { display: flex; gap: 5px; }
.module-chips span { padding: 4px 7px; color: #686274; background: #f0eef4; border-radius: 6px; font-size: .62rem; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }

.support-layout { display: grid; grid-template-columns: minmax(285px,.72fr) minmax(0,1.55fr); gap: 16px; min-height: 570px; }
.tickets-panel, .thread-panel { padding: 0; overflow: hidden; }
.tickets-panel .panel-heading { padding: 20px 20px 14px; margin: 0; }
.ticket-item {
  width: 100%; display: block; padding: 16px 18px; text-align: left; background: #fff;
  border-top: 1px solid var(--line); transition: .15s ease;
}
.ticket-item:hover { background: var(--surface-2); }
.ticket-item.active { background: #f5f2ff; box-shadow: inset 3px 0 0 var(--violet); }
.ticket-item > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ticket-code { color: var(--muted-light); font-size: .62rem; font-weight: 700; }
.ticket-item > strong { display: -webkit-box; margin: 8px 0 6px; overflow: hidden; color: var(--ink); font-size: .76rem; line-height: 1.4; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ticket-item > small { color: var(--muted-light); font-size: .64rem; }
.thread-panel { display: flex; flex-direction: column; min-height: 570px; }
.thread-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px; border-bottom: 1px solid var(--line); }
.thread-head span { color: var(--muted-light); font-size: .66rem; }
.thread-head h2 { margin-top: 5px; font-size: 1rem; line-height: 1.4; }
.messages { flex: 1; min-height: 350px; max-height: 430px; overflow-y: auto; padding: 22px; background: var(--surface-2); }
.message { max-width: 76%; margin-bottom: 13px; padding: 13px 15px; background: #fff; border: 1px solid var(--line); border-radius: 5px 14px 14px; box-shadow: 0 2px 8px rgba(20,14,43,.04); }
.message.client { margin-left: auto; color: #fff; background: var(--violet); border-color: var(--violet); border-radius: 14px 5px 14px 14px; }
.message-author { display: flex; justify-content: space-between; gap: 16px; font-size: .67rem; }
.message-author span { color: var(--muted-light); }
.message.client .message-author span { color: rgba(255,255,255,.62); }
.message p { margin-top: 7px; font-size: .75rem; line-height: 1.55; white-space: pre-wrap; }
.reply-form { display: flex; align-items: flex-end; gap: 10px; padding: 14px; border-top: 1px solid var(--line); }
.reply-form textarea { flex: 1; resize: none; min-height: 42px; padding: 11px; border: 1px solid var(--line); outline: none; border-radius: 10px; }
.reply-form textarea:focus { border-color: var(--violet); }
.thread-closed { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 17px; color: var(--muted); background: var(--surface-2); border-top: 1px solid var(--line); font-size: .72rem; }

.settings-layout { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(300px,.7fr); gap: 17px; align-items: start; }
.settings-panel { padding: 24px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1/-1; }
.field span { font-size: .72rem; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; padding: 11px 12px; }
.field input[readonly] { color: var(--muted); cursor: not-allowed; }
.field textarea { resize: vertical; line-height: 1.5; }
.form-footer { display: flex; justify-content: flex-end; padding-top: 19px; margin-top: 20px; border-top: 1px solid var(--line); }
.integration-card {
  position: sticky; top: calc(var(--header-height) + 25px); padding: 25px; overflow: hidden;
  color: #fff; background: radial-gradient(circle at 110% -10%, rgba(132,105,243,.55), transparent 45%), linear-gradient(145deg, #181038, #312173);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
}
.integration-icon { width: 45px; height: 45px; display: grid; place-items: center; color: #d9d0ff; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.12); border-radius: 13px; margin-bottom: 25px; }
.integration-card .eyebrow { color: #aa9bea; }
.integration-card h2 { margin: 6px 0 8px; color: #fff; }
.integration-card > p { color: rgba(255,255,255,.64); font-size: .73rem; line-height: 1.5; }
.token-box { display: flex; align-items: center; gap: 8px; margin: 18px 0; padding: 8px 8px 8px 12px; background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.11); border-radius: 10px; }
.token-box code { flex: 1; min-width: 0; overflow: hidden; color: #9de1ca; font-size: .68rem; white-space: nowrap; text-overflow: ellipsis; }
.integration-actions { display: flex; }
.security-note { display: flex; align-items: flex-start; gap: 7px; margin-top: 18px !important; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.1); }
.security-note svg { width: 16px; flex: 0 0 auto; color: #7ad6b6; }

.empty-state { padding: 45px 20px; text-align: center; color: var(--muted); }
.empty-state > svg, .empty-inline > span { color: var(--violet); }
.empty-state h3 { color: var(--ink); margin: 12px 0 5px; font-size: .9rem; }
.empty-state p { font-size: .74rem; }
.empty-state.compact { padding: 35px 18px; border-top: 1px solid var(--line); }
.thread-empty { margin: auto; max-width: 390px; }
.thread-empty .button { margin-top: 18px; }
.empty-inline { grid-column: 1/-1; display: flex; align-items: center; gap: 14px; padding: 24px; border: 1px dashed var(--line-strong); border-radius: 12px; }
.empty-inline > div { flex: 1; }
.empty-inline p { margin-top: 4px; white-space: normal; }

.modal-overlay {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px;
  background: rgba(12,8,30,.68); backdrop-filter: blur(7px); opacity: 0; visibility: hidden; transition: .2s ease;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  width: min(580px,100%); max-height: calc(100vh - 40px); overflow-y: auto; padding: 25px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 28px 80px rgba(8,5,24,.28);
  transform: translateY(12px) scale(.98); transition: .2s ease;
}
.modal-overlay.open .modal { transform: none; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 21px; }
.modal-head h2 { margin-top: 5px; font-size: 1.25rem; }
.modal-product { display: flex; align-items: center; gap: 14px; }
.modal-product strong { font-size: .92rem; }
.modal-product p { margin-top: 4px; color: var(--muted); font-size: .72rem; line-height: 1.45; }
.modal-features { padding: 15px; background: var(--surface-2); border-radius: 11px; }
.price-summary { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.price-summary > span { color: var(--muted); font-size: .75rem; }
.price-summary > strong { font: 800 1.22rem "Manrope"; }
.price-summary small { color: var(--muted); font: 400 .65rem "DM Sans"; }
.modal-note { display: flex; align-items: flex-start; gap: 8px; margin: 14px 0; color: var(--muted); font-size: .68rem; line-height: 1.45; }
.modal-note svg { flex: 0 0 auto; color: var(--violet); }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.manage-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-bottom: 15px; }
.manage-summary > div { padding: 13px; background: var(--surface-2); border-radius: 10px; }
.manage-summary span, .manage-license span { display: block; color: var(--muted); font-size: .65rem; }
.manage-summary strong, .manage-license strong { display: block; margin-top: 5px; font-size: .78rem; }
.manage-license p { margin-top: 4px; color: var(--muted-light); font-size: .63rem; }
.quantity-control.large button { width: 35px; height: 35px; }
.danger-zone { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 15px; margin-top: 18px; background: #fffafa; border: 1px solid #f4dadd; border-radius: 11px; }
.danger-zone strong { font-size: .75rem; }
.danger-zone p { margin-top: 4px; color: var(--muted); font-size: .65rem; }
.payment-summary { padding: 17px; text-align: center; background: var(--night); color: #fff; border-radius: 13px; }
.payment-summary span, .payment-summary p { color: rgba(255,255,255,.6); font-size: .7rem; }
.payment-summary strong { display: block; margin: 4px 0; font: 800 1.75rem "Manrope"; }
.pix-area { display: grid; grid-template-columns: auto 1fr; gap: 17px; align-items: center; margin: 19px 0; }
.fake-qr { width: 150px; height: 150px; display: grid; place-items: center; color: var(--night); background: #fff; border: 8px solid var(--surface-2); border-radius: 11px; }
.pix-area strong { font-size: .82rem; }
.pix-area p { margin: 5px 0 10px; color: var(--muted); font-size: .7rem; line-height: 1.4; }
.copy-field { display: flex; align-items: center; padding: 6px 6px 6px 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; }
.copy-field code { flex: 1; min-width: 0; overflow: hidden; font-size: .62rem; white-space: nowrap; text-overflow: ellipsis; }

.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 120; display: grid; gap: 9px; }
.toast { min-width: 270px; display: flex; align-items: center; gap: 10px; padding: 13px 15px; color: #fff; background: var(--night); border: 1px solid rgba(255,255,255,.1); border-radius: 11px; box-shadow: var(--shadow-md); animation: toastIn .25s ease; font-size: .75rem; }
.toast svg { color: #63d3ad; }
.toast-info svg { color: #a99aff; }
.toast.leaving { opacity: 0; transform: translateY(8px); transition: .3s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

.admin-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.admin-metric {
  display: flex; align-items: center; gap: 13px; padding: 17px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
}
.admin-metric > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: var(--violet); background: var(--violet-soft); }
.admin-metric strong { display: block; font: 800 1.25rem "Manrope"; }
.admin-metric small { color: var(--muted); font-size: .68rem; }
.admin-workspace { padding: 0; overflow: hidden; }
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 19px; }
.admin-table-wrap { min-height: 360px; overflow-x: auto; border-top: 1px solid var(--line); }
.admin-table { min-width: 850px; }
.admin-table td { white-space: normal; }
.admin-entity { display: flex; align-items: center; gap: 10px; min-width: 210px; }
.admin-entity-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; color: var(--violet); background: var(--violet-soft); border-radius: 9px; }
.admin-entity strong { display: block; color: var(--ink); }
.admin-entity small { display: block; color: var(--muted-light); margin-top: 2px; }
.admin-loading { min-height: 360px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); }
.admin-loading svg { animation: adminSpin 1s linear infinite; }
@keyframes adminSpin { to { transform: rotate(360deg); } }
.admin-error { max-width: 520px; margin: 70px auto; text-align: center; }
.admin-error span { width: 50px; height: 50px; display: grid; place-items: center; margin: 0 auto 15px; color: var(--red); background: var(--red-soft); border-radius: 14px; }
.admin-error p { margin: 7px 0 17px; color: var(--muted); }
.admin-product-pill { display: inline-flex; padding: 5px 8px; border-radius: 7px; color: var(--violet-dark); background: var(--violet-soft); font-size: .65rem; font-weight: 800; text-transform: uppercase; }
.admin-features { max-width: 260px; color: var(--muted); font-size: .68rem; line-height: 1.45; }
.admin-actions { display: flex; justify-content: flex-end; }
.admin-actions .icon-button { border: 1px solid var(--line); }
.field-help { color: var(--muted); font-size: .65rem; line-height: 1.4; }

@media (max-width: 1180px) {
  .metrics-grid { grid-template-columns: repeat(2,1fr); }
  .modules-grid { grid-template-columns: repeat(2,1fr); }
  .product-shortcuts { grid-template-columns: 1fr; }
  .admin-metrics { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 960px) {
  .mobile-menu-button { display: inline-flex; }
  .brand { min-width: 0; }
  .sidebar { transform: translateX(-105%); box-shadow: var(--shadow-md); transition: .22s ease; }
  .sidebar.open { transform: none; }
  .sidebar-backdrop { position: fixed; display: block; inset: var(--header-height) 0 0; z-index: 35; background: rgba(15,10,38,.45); opacity: 0; visibility: hidden; transition: .2s ease; }
  .sidebar-backdrop.open { opacity: 1; visibility: visible; }
  .sidebar-account { display: flex; align-items: center; gap: 10px; padding: 17px 10px 0; margin-top: 16px; border-top: 1px solid var(--line); }
  .sidebar-account span:last-child { display: flex; flex-direction: column; min-width: 0; }
  .sidebar-account strong { overflow: hidden; font-size: .75rem; white-space: nowrap; text-overflow: ellipsis; }
  .sidebar-account small { color: var(--muted); font-size: .65rem; }
  .main-content { width: 100%; margin-left: 0; }
  .settings-layout { grid-template-columns: 1fr; }
  .integration-card { position: static; }
}
@media (max-width: 760px) {
  :root { --header-height: 62px; }
  .app-header { padding: 0 12px; gap: 4px; }
  .brand-wordmark { width: 68px; }
  .brand > span, .system-status, .user-copy { display: none; }
  .user-summary { padding-left: 5px; gap: 4px; border-left: 0; }
  .avatar { width: 33px; height: 33px; border-radius: 9px; }
  .header-actions { gap: 3px; }
  .main-content { padding: 24px 14px 45px; }
  .welcome-row, .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 22px; }
  .page-actions { width: 100%; }
  .page-actions .button { flex: 1; }
  .attention-card { align-items: flex-start; flex-wrap: wrap; }
  .attention-card p { display: block; margin: 3px 0 0; }
  .attention-card .button { margin-left: 49px; }
  .metrics-grid { gap: 10px; }
  .metric-card { padding: 15px; }
  .metric-card > strong { font-size: 1.3rem; }
  .content-grid, .support-layout { grid-template-columns: 1fr; }
  .support-layout { min-height: 0; }
  .thread-panel { min-height: 520px; }
  .product-shortcut { grid-template-columns: auto minmax(0,1fr) auto; }
  .product-shortcut .badge { display: none; }
  .discovery-banner { grid-template-columns: auto 1fr; }
  .discovery-banner .button { grid-column: 1/-1; }
  .modules-grid, .billing-overview { grid-template-columns: 1fr; }
  .segmented-control { width: 100%; overflow-x: auto; }
  .segmented-control button { flex: 1; }
  .billing-toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-actions { width: 100%; }
  .search-field { flex: 1; }
  .search-field input { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .popover { position: fixed; left: 12px; right: 12px; top: var(--header-height); width: auto; }
  .message { max-width: 88%; }
  .admin-toolbar { align-items: stretch; flex-direction: column; }
  .admin-toolbar .search-field { width: 100%; }
}
@media (max-width: 480px) {
  .metrics-grid { grid-template-columns: 1fr; }
  .metric-card { display: grid; grid-template-columns: 1fr auto; }
  .metric-top { display: contents; }
  .metric-top > span:first-child { grid-column: 1; }
  .metric-icon { grid-column: 2; grid-row: 1/4; align-self: center; }
  .metric-card > strong { grid-column: 1; margin: 8px 0 3px; }
  .metric-card > p { grid-column: 1; }
  .module-card-foot { align-items: flex-start; flex-direction: column; }
  .module-actions, .module-card-foot > .button { width: 100%; }
  .module-actions .button { flex: 1; }
  .manage-summary { grid-template-columns: 1fr; }
  .danger-zone { align-items: flex-start; flex-direction: column; }
  .pix-area { grid-template-columns: 1fr; }
  .fake-qr { margin: 0 auto; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .button { width: 100%; }
  .toast-region { left: 12px; right: 12px; bottom: 12px; }
  .toast { min-width: 0; }
  .admin-metrics { grid-template-columns: 1fr; }
}

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