:root {
  --navy: #10213f;
  --navy-2: #17315d;
  --teal: #0db38e;
  --teal-dark: #07856b;
  --teal-soft: #e5f8f2;
  --ink: #19253b;
  --muted: #718096;
  --line: #e8edf4;
  --surface: #fff;
  --page: #f6f8fb;
  --soft: #f1f5f9;
  --danger: #db4d61;
  --warning: #d99013;
  --shadow: 0 10px 28px rgba(28, 48, 85, 0.08);
  --radius: 14px;
}
* {
  box-sizing: border-box;
}
html {
  background: var(--page);
}
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font:
    14px/1.45 "DM Sans",
    system-ui,
    sans-serif;
}
[hidden] {
  display: none !important;
}
.environment-ribbon {
  position: fixed;
  z-index: 100;
  top: 0;
  right: 0;
  left: 0;
  height: 28px;
  background: #fff4d9;
  color: #8a5700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.dot {
  width: 7px;
  height: 7px;
  background: #f1a71a;
  border-radius: 50%;
}
.auth-shell {
  min-height: 100vh;
  padding-top: 28px;
  display: grid;
  grid-template-columns: minmax(360px, 1.12fr) minmax(420px, 0.88fr);
}
.auth-visual {
  position: relative;
  overflow: hidden;
  padding: 64px clamp(44px, 8vw, 130px);
  background: linear-gradient(140deg, #10203e, #173564);
  color: #fff;
  display: flex;
  flex-direction: column;
}
.auth-visual:after {
  content: "";
  position: absolute;
  inset: auto -5% -38% 26%;
  height: 75%;
  border-radius: 48% 0 0 0;
  background: linear-gradient(
    135deg,
    rgba(20, 190, 151, 0.75),
    rgba(26, 159, 193, 0.06)
  );
  transform: rotate(-12deg);
}
.auth-orb {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}
.orb-one {
  height: 510px;
  width: 510px;
  top: -130px;
  right: -120px;
}
.orb-two {
  height: 300px;
  width: 300px;
  bottom: 0;
  left: -155px;
}
.auth-brand,
.brand,
.mobile-brand {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
  align-items: center;
  color: inherit;
  font:
    700 18px/1 "Manrope",
    sans-serif;
  text-decoration: none;
}
.auth-brand b,
.brand b,
.mobile-brand b {
  color: #45dec0;
}
.logo-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #15c5a0, #14a4b9);
  box-shadow: 0 6px 18px rgba(5, 195, 158, 0.32);
  color: white;
  font:
    800 19px/1 "Manrope",
    sans-serif;
}
.auth-copy {
  position: relative;
  z-index: 1;
  margin-top: auto;
  max-width: 510px;
  padding-bottom: 65px;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--teal-dark);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.auth-visual .eyebrow {
  color: #76e8d2;
}
.auth-copy h1 {
  margin: 0 0 14px;
  font:
    700 clamp(35px, 4vw, 58px) / 1.08 "Manrope",
    sans-serif;
  letter-spacing: -0.04em;
}
.auth-copy p:not(.eyebrow) {
  margin: 0;
  color: #d5e2f4;
  font-size: 17px;
}
.auth-panel {
  display: grid;
  place-items: center;
  padding: 56px;
  background: #fff;
}
.auth-form-wrap {
  width: min(390px, 100%);
}
.auth-form-wrap h2 {
  margin: 0 0 8px;
  font:
    700 29px/1.2 "Manrope",
    sans-serif;
  letter-spacing: -0.03em;
}
.muted {
  color: var(--muted);
}
.auth-form-wrap form {
  margin-top: 28px;
}
label {
  display: grid;
  gap: 7px;
  margin: 17px 0;
  color: #35425a;
  font-weight: 700;
  font-size: 13px;
}
input,
textarea,
select {
  width: 100%;
  border: 1px solid #dce4ee;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font:
    500 14px "DM Sans",
    sans-serif;
  outline: 0;
  padding: 12px 13px;
  transition: 0.2s;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13, 179, 142, 0.12);
}
textarea {
  min-height: 98px;
  resize: vertical;
}
.btn {
  border: 0;
  border-radius: 9px;
  padding: 11px 15px;
  min-height: 42px;
  font:
    700 13px "DM Sans",
    sans-serif;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  transition:
    transform 0.15s,
    background 0.15s;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn-primary {
  background: var(--teal);
  color: white;
  box-shadow: 0 5px 12px rgba(13, 179, 142, 0.22);
}
.btn-primary:hover {
  background: var(--teal-dark);
}
.btn-secondary {
  background: #edf8f5;
  color: #087b62;
}
.btn-outline {
  border: 1px solid #d9e2ed;
  background: #fff;
  color: #45546c;
}
.btn-danger {
  background: #fff0f1;
  color: #c83d50;
}
.btn-full {
  width: 100%;
}
.form-message {
  min-height: 20px;
  margin: 12px 0 0;
  font-size: 12px;
}
#templatePreview {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid #e5dcf8;
  border-radius: 12px;
  background: #fbf9ff;
  color: #59657a;
}
#templatePreview strong,
#templatePreview span {
  display: block;
}
#templatePreview strong {
  color: #392565;
}
#templatePreview ul {
  margin: 2px 0 0;
  padding-left: 18px;
  line-height: 1.55;
}
.error {
  color: #c83d50;
}
.auth-foot {
  margin-top: 34px;
  text-align: center;
  color: #94a0b4;
  font-size: 12px;
}
.mobile-brand {
  display: none;
  color: var(--navy);
  margin-bottom: 44px;
}
#app {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
  padding-top: 28px;
}
.sidebar {
  position: fixed;
  z-index: 20;
  top: 28px;
  bottom: 0;
  width: 250px;
  background: var(--navy);
  color: #c9d5e9;
  padding: 22px 13px 17px;
  display: flex;
  flex-direction: column;
  transition:
    width 0.22s,
    transform 0.22s;
}
.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5px 25px;
}
.brand {
  color: #fff;
  font-size: 16px;
}
.sidebar .logo-mark {
  width: 31px;
  height: 31px;
  font-size: 17px;
}
.icon-btn {
  height: 36px;
  width: 36px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #60708b;
  font-size: 19px;
  cursor: pointer;
  position: relative;
}
.icon-btn:hover {
  background: #eef3f8;
  color: var(--navy);
}
.sidebar .collapse {
  color: #9eb0cd;
}
.sidebar .collapse:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}
.main-nav {
  display: grid;
  gap: 3px;
}
.nav-group {
  margin: 19px 10px 6px;
  color: #7e92b3;
  font-size: 10px;
  letter-spacing: 0.11em;
  font-weight: 800;
}
.nav-item,
.nav-action {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #b8c7df;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 11px;
  font:
    600 13px "DM Sans",
    sans-serif;
  text-align: left;
  cursor: pointer;
}
.nav-item:hover,
.nav-action:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}
.nav-item.active {
  background: linear-gradient(
    90deg,
    rgba(27, 191, 157, 0.22),
    rgba(27, 191, 157, 0.08)
  );
  color: #fff;
  box-shadow: inset 3px 0 #27d5b4;
}
.nav-icon {
  width: 17px;
  text-align: center;
  font-size: 16px;
  color: #8fa6ca;
}
.nav-item.active .nav-icon {
  color: #53d9c1;
}
.sidebar-bottom {
  margin-top: auto;
}
.help-card {
  display: flex;
  gap: 9px;
  padding: 12px;
  margin: 0 1px 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  font-size: 11px;
}
.help-card small {
  display: block;
  color: #91a3c0;
}
.help-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #1e6e72;
  color: #8ff3dd;
  font-weight: 800;
}
.workspace {
  grid-column: 2;
  min-width: 0;
}
.topbar {
  height: 82px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  position: sticky;
  z-index: 15;
  top: 28px;
}
.topbar-left,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.breadcrumb {
  margin: 0 0 1px;
  color: #5c687b;
  font-size: 11px;
}
.topbar h1 {
  margin: 0;
  color: var(--ink);
  font:
    700 22px/1.1 "Manrope",
    sans-serif;
  letter-spacing: -0.025em;
}
.search-control {
  height: 36px;
  min-width: 172px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #e1e7ef;
  border-radius: 8px;
  background: #fff;
  color: #596678;
  padding: 0 9px;
  font:
    500 12px "DM Sans",
    sans-serif;
  cursor: pointer;
}
.search-control span:first-child {
  font-size: 19px;
  color: #62728b;
}
.search-control kbd {
  margin-left: auto;
  padding: 1px 4px;
  border-radius: 4px;
  background: #f0f3f7;
  color: #526074;
  font-size: 10px;
}
.notification {
  font-size: 16px;
}
.notification i {
  position: absolute;
  right: 8px;
  top: 7px;
  width: 5px;
  height: 5px;
  background: #ec6474;
  border-radius: 50%;
  border: 1px solid #fff;
}
.profile {
  border-left: 1px solid var(--line);
  padding-left: 13px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ecb25d, #d97357);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
}
.profile-copy {
  display: grid;
  font-size: 11px;
  line-height: 1.3;
}
.profile-copy small {
  color: #8a96a9;
}
.chevron {
  color: #78879c;
}
.page-view {
  padding: 26px 34px 50px;
  max-width: 1600px;
  margin: 0 auto;
}
.global-notice {
  margin: 15px 34px -5px;
  padding: 10px 13px;
  border-radius: 8px;
  background: #fff5dc;
  color: #8b5b05;
  font-size: 12px;
  font-weight: 700;
}
.mobile-only {
  display: none;
}
.loading-page {
  height: 260px;
  display: grid;
  place-content: center;
  gap: 10px;
  color: var(--muted);
  text-align: center;
}
.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid #d9f1eb;
  border-top-color: var(--teal);
  border-radius: 50%;
  margin: auto;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 20px;
}
.page-header h2 {
  margin: 0;
  color: var(--ink);
  font:
    700 20px "Manrope",
    sans-serif;
  letter-spacing: -0.03em;
}
.page-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.header-actions,
.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.status-pill,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 100px;
  padding: 5px 9px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.status-pill.paused,
.tag.warn {
  background: #fff4da;
  color: #a96300;
}
.status-pill.safe,
.tag.good {
  background: #e6f8f1;
  color: #087a61;
}
.tag.gray {
  background: #eef2f7;
  color: #68778d;
}
.tag.danger {
  background: #ffedef;
  color: #bf4353;
}
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.metric-card,
.panel,
.info-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 2px 7px rgba(32, 59, 96, 0.025);
}
.metric-card {
  padding: 17px;
}
.metric-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #78869a;
  font-size: 12px;
  font-weight: 700;
}
.metric-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-size: 16px;
}
.metric-card h3 {
  margin: 16px 0 3px;
  font:
    800 26px/1 "Manrope",
    sans-serif;
  letter-spacing: -0.04em;
}
.metric-card small {
  color: #647085;
  font-size: 11px;
}
.metric-delta {
  color: #0b966f;
  font-weight: 800;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.85fr);
  gap: 14px;
  margin-top: 15px;
}
.panel {
  padding: 18px;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
}
.panel h3 {
  margin: 0;
  font:
    700 15px "Manrope",
    sans-serif;
}
.link-button {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--teal-dark);
  font:
    700 12px "DM Sans",
    sans-serif;
  cursor: pointer;
}
.chart-wrap {
  height: 210px;
  position: relative;
}
.chart-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.chart-labels {
  display: flex;
  justify-content: space-between;
  color: #94a0af;
  font-size: 10px;
  padding: 0 7px;
}
.funnel {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}
.funnel-row {
  display: grid;
  grid-template-columns: 94px 1fr 29px;
  gap: 8px;
  align-items: center;
  font-size: 11px;
}
.funnel-row span:first-child {
  color: #65738a;
}
.funnel-track {
  height: 8px;
  border-radius: 10px;
  background: #eef3f6;
  overflow: hidden;
}
.funnel-fill {
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(90deg, #18c4a1, #54d8c1);
}
.funnel-row b {
  text-align: right;
  color: #405069;
}
.activity-list {
  display: grid;
  gap: 0;
}
.activity-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #eff2f6;
}
.activity-item:last-child {
  border-bottom: 0;
}
.activity-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--teal);
}
.activity-item p {
  margin: 0;
  color: #435068;
  font-size: 12px;
}
.activity-item small {
  display: block;
  margin-top: 2px;
  color: #98a4b4;
  font-size: 10px;
}
.operational-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 15px;
  padding: 13px 15px;
  border: 1px solid #dcece8;
  border-radius: 10px;
  background: #f4fcf9;
}
.operational-strip strong {
  font-size: 12px;
}
.operational-strip p {
  margin: 2px 0 0;
  color: #6b7a8e;
  font-size: 11px;
}
.table-shell {
  overflow: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}
.data-table th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: #8390a2;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.data-table td {
  padding: 12px;
  border-bottom: 1px solid #edf1f5;
  color: #44526a;
  font-size: 12px;
  vertical-align: middle;
}
.data-table tbody tr {
  transition: background 0.15s;
}
.data-table tbody tr:hover {
  background: #f8fbfc;
}
.table-person {
  display: flex;
  align-items: center;
  gap: 9px;
}
.person-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e6eefb;
  color: #395a8c;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
}
.person-name {
  display: grid;
  gap: 1px;
}
.person-name b {
  font-size: 12px;
  color: #344159;
}
.person-name small {
  color: #8e99a9;
  font-size: 10px;
}
.row-actions {
  display: flex;
  gap: 5px;
}
.mini-btn {
  border: 1px solid #e0e6ee;
  background: #fff;
  border-radius: 6px;
  padding: 5px 8px;
  color: #54647c;
  font:
    700 10px "DM Sans",
    sans-serif;
  cursor: pointer;
}
.mini-btn:hover {
  border-color: #a9b9cc;
  color: var(--teal-dark);
}
.empty-state {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 200px;
  padding: 30px;
  color: #8794a7;
}
.empty-state .empty-icon {
  font-size: 32px;
  margin-bottom: 6px;
}
.empty-state h3 {
  margin: 3px 0;
  color: #40506a;
  font:
    700 16px "Manrope",
    sans-serif;
}
.empty-state p {
  margin: 0;
  font-size: 12px;
}
.filter-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}
.filter-input {
  max-width: 250px;
  padding: 9px 11px;
  font-size: 12px;
}
.filter-chip {
  border: 1px solid #e0e7ef;
  background: #fff;
  color: #6e7c91;
  border-radius: 100px;
  padding: 6px 10px;
  font:
    700 11px "DM Sans",
    sans-serif;
  cursor: pointer;
}
.filter-chip.active {
  border-color: #9ee0d2;
  background: #e9f9f5;
  color: #087b62;
}
.inbox-layout {
  position: relative;
  height: calc(100vh - 165px);
  min-height: 560px;
  display: grid;
  grid-template-columns: 300px minmax(340px, 1fr) 245px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.inbox-list {
  border-right: 1px solid var(--line);
  overflow: auto;
}
.inbox-list-head {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
  padding: 15px;
  border-bottom: 1px solid var(--line);
}
.inbox-list-head h3 {
  margin: 0 0 10px;
  font:
    700 15px "Manrope",
    sans-serif;
}
.inbox-item {
  width: 100%;
  display: flex;
  gap: 9px;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid #eef2f5;
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.inbox-item:hover,
.inbox-item.active {
  background: #f0fbf8;
}
.inbox-item.active {
  box-shadow: inset 3px 0 var(--teal);
}
.inbox-preview {
  min-width: 0;
  flex: 1;
}
.inbox-preview-head {
  display: flex;
  justify-content: space-between;
  gap: 5px;
}
.inbox-preview b {
  font-size: 12px;
  color: #38465c;
}
.inbox-preview time {
  font-size: 10px;
  color: #96a2b1;
}
.inbox-preview p {
  margin: 3px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #8693a5;
  font-size: 11px;
}
.inbox-chat {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.chat-head {
  padding: 14px 17px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chat-title {
  min-width: 0;
  display: flex;
  gap: 9px;
  align-items: center;
}
.chat-title h3 {
  overflow-wrap: anywhere;
  margin: 0;
  font:
    700 14px "Manrope",
    sans-serif;
}
.chat-title small {
  display: block;
  color: #8693a4;
  font-size: 10px;
}
.chat-actions {
  display: flex;
  gap: 4px;
}
.message-stream {
  flex: 1;
  overflow: auto;
  background: #f8fafc;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.message-bubble {
  max-width: 78%;
  padding: 9px 11px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e8edf3;
  box-shadow: 0 1px 2px rgba(20, 40, 70, 0.03);
  color: #46546a;
  font-size: 12px;
}
.message-bubble.out {
  margin-left: auto;
  background: #e8faf5;
  border-color: #cceee4;
}
.message-meta {
  display: flex;
  gap: 5px;
  margin-bottom: 3px;
  color: #8b98a8;
  font-size: 9px;
}
.message-bubble p {
  margin: 0;
  white-space: pre-wrap;
}
.chat-compose {
  border-top: 1px solid var(--line);
  padding: 11px;
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.chat-compose textarea {
  min-height: 40px;
  max-height: 100px;
  padding: 10px;
  font-size: 12px;
}
.chat-side {
  border-left: 1px solid var(--line);
  padding: 15px;
  overflow: auto;
}
.chat-side h4 {
  margin: 0 0 11px;
  font:
    700 13px "Manrope",
    sans-serif;
}
.side-section {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.side-section:last-child {
  border: 0;
}
.side-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 7px 0;
  color: #5d6979;
  font-size: 11px;
}
.side-row b {
  color: #405068;
}
.state-control {
  display: grid;
  gap: 7px;
}
.state-control .btn {
  width: 100%;
  font-size: 11px;
}
.empty-chat {
  display: grid;
  place-items: center;
  flex: 1;
  color: #8996a6;
  font-size: 12px;
}
.demo-watermark {
  color: #9eaaaf;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.kanban {
  display: grid;
  grid-template-columns: repeat(9, minmax(225px, 1fr));
  gap: 12px;
  overflow: auto;
  padding-bottom: 10px;
}
.kanban-column {
  min-height: 490px;
  border-radius: 12px;
  background: #f0f4f8;
  border: 1px solid #e4eaf0;
  padding: 10px;
}
.kanban-column.drag-over {
  background: #e5f8f2;
  border-color: #88ddca;
}
.kanban-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 2px 11px;
}
.kanban-head h3 {
  margin: 0;
  color: #405069;
  font:
    700 12px "Manrope",
    sans-serif;
}
.count-badge {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #dfe7f0;
  color: #61718a;
  font-size: 10px;
  font-weight: 800;
}
.lead-card {
  background: #fff;
  border: 1px solid #e2e8ef;
  border-radius: 9px;
  padding: 10px;
  margin-bottom: 8px;
  box-shadow: 0 2px 4px rgba(25, 48, 81, 0.03);
  cursor: grab;
}
.lead-card:active {
  cursor: grabbing;
}
.lead-card:hover {
  border-color: #afc5d2;
}
.lead-card h4 {
  margin: 0 0 4px;
  color: #3c4b61;
  font-size: 12px;
}
.lead-card p {
  margin: 0 0 8px;
  color: #8996a7;
  font-size: 10px;
}
.lead-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.score {
  font-size: 10px;
  color: #537083;
  font-weight: 800;
}
.score.hot {
  color: #d36445;
}
.progress-dots {
  display: flex;
  gap: 3px;
}
.progress-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #c7d2df;
}
.progress-dots i.on {
  background: var(--teal);
}
.contacts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.contact-card {
  padding: 15px;
}
.contact-card-top {
  display: flex;
  gap: 9px;
  align-items: center;
}
.contact-card h3 {
  margin: 0;
  color: #405069;
  font:
    700 14px "Manrope",
    sans-serif;
}
.contact-card p {
  margin: 2px 0 0;
  color: #8795a6;
  font-size: 11px;
}
.contact-stats {
  display: flex;
  gap: 17px;
  margin: 14px 0;
}
.contact-stats div {
  display: grid;
  gap: 1px;
}
.contact-stats b {
  color: #43526b;
  font-size: 13px;
}
.contact-stats small {
  color: #96a1af;
  font-size: 10px;
}
.contact-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid #edf1f5;
}
.setting-row:last-child {
  border: 0;
}
.setting-row b {
  font-size: 12px;
}
.setting-row small {
  display: block;
  color: #8b98aa;
  font-size: 10px;
}
.switch {
  width: 36px;
  height: 20px;
  border-radius: 100px;
  background: #dbe2ea;
  padding: 2px;
}
.switch i {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px #a8b1bd;
}
.switch.on {
  background: var(--teal);
}
.switch.on i {
  margin-left: 16px;
}
.knowledge-grid,
.commercial-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.knowledge-card {
  padding: 15px;
}
.knowledge-card h3,
.commercial-card h3 {
  margin: 8px 0 6px;
  font:
    700 14px "Manrope",
    sans-serif;
}
.knowledge-card p {
  margin: 0;
  color: #7d899b;
  font-size: 11px;
}
.commercial-card {
  padding: 15px;
}
.commercial-card .product-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #eff7ff;
  display: grid;
  place-items: center;
  font-size: 17px;
}
.commercial-card p {
  margin: 0;
  color: #8b97a7;
  font-size: 11px;
}
.report-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 14px;
}
.report-bars {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 180px;
  padding: 15px 6px 0;
}
.report-bar {
  flex: 1;
  display: grid;
  align-items: end;
  gap: 7px;
  text-align: center;
  color: #93a0af;
  font-size: 10px;
}
.report-bar i {
  display: block;
  min-height: 7px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(#51d7bf, #13ad8d);
}
.alert-list {
  display: grid;
  gap: 8px;
}
.alert-card {
  display: flex;
  gap: 9px;
  padding: 10px;
  border: 1px solid #f0e6c9;
  border-radius: 8px;
  background: #fffbf0;
  font-size: 11px;
}
.alert-card b {
  color: #8a5c09;
}
.alert-card p {
  margin: 2px 0 0;
  color: #87734e;
}
.modal-root {
  position: fixed;
  z-index: 200;
  inset: 0;
  background: rgba(14, 27, 51, 0.45);
  padding: 20px;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  place-items: center;
}
.modal {
  width: min(440px, 100%);
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: 22px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(12, 23, 45, 0.2);
}
.modal h3 {
  margin: 0 0 8px;
  font:
    700 18px "Manrope",
    sans-serif;
}
.modal p {
  margin: 0;
  color: #738096;
  font-size: 12px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 19px;
}
.toast {
  position: fixed;
  z-index: 250;
  right: 20px;
  bottom: 20px;
  max-width: 320px;
  padding: 12px 15px;
  border-radius: 9px;
  background: #1e3458;
  color: white;
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: 0.22s;
}
.toast strong,
.toast small {
  display: block;
}
.toast small {
  margin-top: 3px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  opacity: 0.88;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
@media (max-width: 1200px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .contacts-grid,
  .knowledge-grid,
  .commercial-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .inbox-layout {
    grid-template-columns: 270px minmax(310px, 1fr);
  }
  .chat-side {
    display: none;
  }
}
@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }
  .auth-visual {
    display: none;
  }
  .auth-panel {
    min-height: 100vh;
  }
  .mobile-brand {
    display: flex;
  }
  .sidebar {
    transform: translateX(-100%);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.16);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  #app {
    display: block;
  }
  .workspace {
    width: 100%;
  }
  .topbar {
    padding: 0 16px;
    top: 28px;
  }
  .page-view {
    padding: 20px 16px;
  }
  .global-notice {
    margin: 12px 16px -5px;
  }
  .mobile-only {
    display: block;
  }
  .search-control {
    min-width: 36px;
    width: 36px;
    padding: 0;
    justify-content: center;
  }
  .search-label,
  .search-control kbd,
  .profile-copy,
  .chevron {
    display: none;
  }
  .profile {
    padding-left: 4px;
    border: 0;
  }
  .dashboard-grid,
  .report-grid {
    grid-template-columns: 1fr;
  }
  .inbox-layout {
    height: calc(100vh - 150px);
    grid-template-columns: 250px minmax(300px, 1fr);
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .page-header {
    align-items: flex-start;
    flex-direction: column;
  }
}
@media (max-width: 620px) {
  .environment-ribbon {
    font-size: 9px;
  }
  .auth-panel {
    padding: 30px 22px;
  }
  .topbar {
    height: 68px;
  }
  .topbar h1 {
    font-size: 19px;
  }
  .topbar-actions {
    gap: 3px;
  }
  .metrics-grid {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }
  .metric-card {
    padding: 13px;
  }
  .metric-card h3 {
    font-size: 22px;
  }
  .dashboard-grid {
    margin-top: 10px;
  }
  .panel {
    padding: 14px;
  }
  .inbox-layout {
    display: block;
    height: calc(100vh - 137px);
    min-height: 490px;
  }
  .inbox-list {
    height: 100%;
  }
  .inbox-chat {
    display: none;
    height: 100%;
  }
  .inbox-layout.chat-open .inbox-list {
    display: none;
  }
  .inbox-layout.chat-open .inbox-chat {
    display: flex;
  }
  .chat-back {
    display: inline-flex !important;
  }
  .inbox-layout.chat-open .chat-side {
    display: none;
  }
  .kanban {
    grid-template-columns: repeat(9, 210px);
  }
  .contacts-grid,
  .knowledge-grid,
  .commercial-grid {
    grid-template-columns: 1fr;
  }
  .filter-bar {
    overflow: auto;
    white-space: nowrap;
  }
  .page-header h2 {
    font-size: 18px;
  }
  .topbar-left {
    gap: 4px;
  }
  .profile {
    display: none;
  }
  .help-card {
    display: none;
  }
  .sidebar {
    width: 245px;
  }
  .btn {
    min-height: 40px;
  }
  .data-table th:nth-child(n + 4),
  .data-table td:nth-child(n + 4) {
    display: none;
  }
}
.auth-link {
  display: block;
  margin: 14px auto 0;
}
.profile {
  background: transparent;
  border: 0;
  cursor: pointer;
  color: inherit;
  text-align: left;
}
.quick-panel {
  position: fixed;
  z-index: 180;
  top: 102px;
  right: 24px;
  width: min(390px, calc(100vw - 32px));
  max-height: calc(100vh - 125px);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: 0 18px 50px rgba(16, 33, 63, 0.18);
  padding: 15px;
}
.quick-panel h3 {
  margin: 0;
  font:
    700 15px "Manrope",
    sans-serif;
}
.quick-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.quick-results {
  display: grid;
  gap: 5px;
}
.quick-result {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  color: #415068;
  cursor: pointer;
}
.quick-result:hover {
  border-color: #b9e6dc;
  background: #eefaf7;
}
.quick-result strong,
.quick-result small {
  display: block;
}
.quick-result small {
  color: #8a97a8;
  margin-top: 2px;
}
.notification-item {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.notification-item.unread {
  background: #f0fbf8;
}
.notification-item:last-child {
  border-bottom: 0;
}
.notification-item p {
  margin: 2px 0;
  color: #77859a;
  font-size: 11px;
}
.notification-item time {
  font-size: 9px;
  color: #9aa5b3;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}
.form-grid .full {
  grid-column: 1/-1;
}
.modal.wide {
  width: min(760px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.detail-section {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px;
}
.detail-section h4 {
  margin: 0 0 9px;
  font:
    700 13px "Manrope",
    sans-serif;
}
.detail-list {
  display: grid;
  gap: 7px;
}
.detail-item {
  padding: 8px;
  border-radius: 7px;
  background: #f7f9fc;
  font-size: 11px;
}
.modal-message {
  min-height: 18px;
  margin: 8px 0 0;
  font-size: 11px;
}
.status-copy {
  font-size: 11px;
  color: #75839a;
}
.data-label {
  display: inline-flex;
  margin-left: 8px;
  padding: 4px 8px;
  border-radius: 100px;
  background: #fff3cd;
  color: #8a5b00;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.chart-empty {
  height: 210px;
  display: grid;
  place-items: center;
  color: #8996a8;
  font-size: 12px;
}
.mobile-move {
  display: none;
}
.install-hint {
  padding: 10px;
  border-radius: 8px;
  background: #eefaf7;
  color: #087b62;
  font-size: 11px;
}
@media (max-width: 900px) {
  .quick-panel {
    top: 92px;
    right: 12px;
  }
  .mobile-move {
    display: inline-flex;
  }
  .detail-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid .full {
    grid-column: auto;
  }
}
@media (max-width: 620px) {
  .modal.wide {
    padding: 16px;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
}
.inbox-tabs,
.triage-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 12px;
  scrollbar-width: thin;
}
.scope-notice {
  margin: 0 0 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
}
.audio-message {
  display: grid;
  gap: 8px;
  min-width: min(340px, 100%);
}
.audio-message-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}
.audio-message audio {
  width: 100%;
  max-width: 360px;
  height: 38px;
}
.audio-message details {
  border-top: 1px solid rgba(100, 116, 139, 0.22);
  padding-top: 8px;
}
.audio-message summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
}
.audio-message details p {
  white-space: pre-wrap;
  margin: 8px 0;
}
.audio-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.btn-small {
  padding: 6px 9px;
  font-size: 11px;
}
.client-admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: -4px 0 18px;
}
.client-admin-badge {
  display: inline-flex;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.client-statuses {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.client-tabs {
  display: flex;
  gap: 8px;
  overflow: auto;
  margin: 0 0 16px;
  padding-bottom: 4px;
}
.client-tab {
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #716a80;
  padding: 9px 13px;
  font: 700 12px inherit;
  cursor: pointer;
}
.client-tab:hover,
.client-tab.active {
  border-color: #cdb9f4;
  background: var(--primary-soft);
  color: var(--primary);
}
.client-form-panel {
  padding: 22px;
}
.client-profile-form {
  display: grid;
  gap: 14px;
}
.client-profile-form label {
  display: grid;
  gap: 7px;
  color: #4b4359;
  font-size: 12px;
  font-weight: 700;
}
.client-profile-form textarea {
  resize: vertical;
  min-height: 92px;
  font: inherit;
}
.client-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}
.client-context-head {
  margin-bottom: 16px;
}
.client-context-head h3 {
  margin: 0 0 5px;
}
.client-context-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.client-summary-grid .metric-card {
  min-height: 132px;
}
.client-date {
  font-size: 17px !important;
  line-height: 1.35;
}
.client-coming-soon {
  padding: 28px;
  color: var(--muted);
}
@media (max-width: 620px) {
  .client-form-panel {
    padding: 16px;
  }
  .client-form-actions .btn {
    width: 100%;
  }
  .client-statuses {
    gap: 6px;
  }
  .client-tab {
    padding: 8px 11px;
  }
  .client-date {
    font-size: 15px !important;
  }
}

/* ALTIZ visual system — visual-only hotfix */
:root {
  --primary: #6f42c1;
  --primary-hover: #5b32a4;
  --primary-soft: #f0eaff;
  --lavender: #f8f5ff;
  --page: #fcfbff;
  --surface: #fff;
  --surface-secondary: #f7f3ff;
  --ink: #1d2033;
  --muted: #66687b;
  --line: #ebe7f2;
  --success: #16734f;
  --warning: #915b10;
  --danger: #c94b61;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(49, 35, 88, 0.06);
}
body {
  background: var(--page);
  color: var(--ink);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
}
.environment-ribbon {
  background: #f8f4ff;
  color: #68409f;
  border-bottom: 1px solid #e9dfff;
}
.environment-ribbon .dot {
  background: var(--primary);
}
.auth-shell {
  background: #fff;
}
.auth-visual.altiz-login {
  background: var(--lavender);
  color: var(--ink);
  padding: 72px clamp(48px, 8vw, 130px);
}
.auth-visual.altiz-login:after {
  content: "";
  inset: auto -6% -25% 35%;
  height: 58%;
  background: #eadfff;
  opacity: 0.6;
  transform: rotate(-14deg);
  border-radius: 48% 0 0 0;
}
.auth-visual .eyebrow {
  color: var(--primary);
}
.auth-copy h1 {
  color: #202137;
  max-width: 680px;
  font-weight: 750;
}
.auth-copy p:not(.eyebrow) {
  color: #68677a;
  max-width: 560px;
}
.altiz-logo {
  display: block;
  width: min(184px, 68vw);
  height: auto;
  object-fit: contain;
}
.auth-panel {
  background: #fff;
}
.auth-form-wrap {
  width: min(410px, 100%);
}
.auth-form-wrap h2 {
  color: #202137;
}
.eyebrow {
  color: var(--primary);
}
input,
textarea,
select {
  border-color: #e1dcec;
  border-radius: 12px;
  padding: 13px 14px;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(111, 66, 193, 0.12);
}
.btn {
  border-radius: 12px;
}
.btn-primary {
  background: var(--primary);
  box-shadow: 0 8px 18px rgba(111, 66, 193, 0.2);
}
.btn-primary:hover {
  background: var(--primary-hover);
}
.btn-outline {
  border-color: #ddd5eb;
  color: #51476a;
}
.auth-foot {
  color: #8d879b;
}
.altiz-logo-sidebar {
  width: 112px;
  max-width: 100%;
  height: auto;
}
.sidebar {
  background: #fff;
  color: #575168;
  border-right: 1px solid var(--line);
  box-shadow: none;
}
.brand {
  color: #352b49;
}
.sidebar .brand {
  color: #352b49;
}
.sidebar .logo-mark {
  background: var(--primary-soft);
  color: var(--primary);
  box-shadow: none;
}
.sidebar .collapse {
  color: #847b99;
}
.sidebar .collapse:hover {
  background: var(--primary-soft);
  color: var(--primary);
}
.nav-group {
  color: #615b6e;
}
.nav-item,
.nav-action {
  color: #645e72;
}
.nav-item:hover,
.nav-action:hover {
  background: #f7f3ff;
  color: #3f315d;
}
.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary);
  box-shadow: inset 3px 0 var(--primary);
}
.nav-icon,
.nav-item.active .nav-icon {
  color: var(--primary);
}
.help-card {
  background: #faf8ff;
  border-color: #ece5f6;
}
.help-card small {
  color: #655f70;
}
.help-icon {
  background: var(--primary-soft);
  color: var(--primary);
}
.topbar {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}
.topbar h1,
.page-header h2,
.panel h3 {
  color: var(--ink);
}
.page-view {
  max-width: 1680px;
  padding: 34px 42px 60px;
}
.metric-card,
.panel,
.info-card {
  border-color: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.metric-card {
  padding: 21px;
}
.metric-head {
  color: #686175;
}
.metric-icon {
  background: var(--primary-soft);
  color: var(--primary);
}
.metric-card h3 {
  color: #29213b;
}
.tag.good {
  background: #eaf7f0;
  color: var(--success);
}
.tag.warn {
  background: #fff6e5;
  color: var(--warning);
}
.tag.gray {
  background: #f4f1f8;
  color: #625b6c;
}
.table-shell,
.data-table {
  border-radius: 14px;
}
.data-table tbody tr:hover {
  background: #faf8ff;
}
.data-table th {
  color: #6d6679;
}
.data-table td {
  color: #4f485f;
}
.inbox-item:hover,
.inbox-item.active {
  background: #faf8ff;
}
.inbox-item.active {
  box-shadow: inset 3px 0 var(--primary);
}
.message-stream {
  background: #fbfaff;
}
.message-bubble.out {
  background: #f2edff;
  border-color: #e2d6ff;
}
.funnel-fill,
.report-bar i {
  background: var(--primary);
}
.link-button {
  color: var(--primary);
}
.toast {
  background: #33284b;
}
.modal-root {
  background: rgba(35, 25, 54, 0.28);
}
@media (max-width: 900px) {
  .auth-visual.altiz-login {
    display: none;
  }
  .mobile-brand {
    display: flex;
    margin-bottom: 36px;
  }
  .page-view {
    padding: 24px 18px 48px;
  }
  .sidebar {
    box-shadow: 12px 0 36px rgba(43, 30, 75, 0.12);
  }
}
.auth-visual.altiz-login .auth-brand {
  width: min(560px, 100%);
  margin: 34px auto 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 15px;
}
.auth-visual.altiz-login .altiz-logo {
  width: min(230px, 72vw);
}
.auth-visual.altiz-login .brand-signature {
  margin: 0;
  color: var(--primary);
  font:
    800 12px/1.3 "DM Sans",
    sans-serif;
  letter-spacing: 0.14em;
}
.auth-visual.altiz-login .auth-copy {
  width: min(560px, 100%);
  margin: 54px auto auto;
  padding-bottom: 0;
  max-width: 560px;
}
.auth-visual.altiz-login .auth-copy h1 {
  max-width: 560px;
  font-size: clamp(34px, 3.45vw, 52px);
}
.auth-visual.altiz-login .auth-copy p:not(.eyebrow) {
  max-width: 510px;
  font-size: 17px;
}

/* SaaS client workspace refinements */
.topbar .profile-copy {
  min-width: 0;
}
.topbar .profile-copy strong {
  font-size: 12px;
  letter-spacing: -0.01em;
}
.client-admin-header {
  margin: -2px 0 20px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(120deg, #fff 0%, #fbf9ff 100%);
  box-shadow: var(--shadow);
}
.client-admin-badge {
  background: var(--primary-soft);
  color: var(--primary);
  letter-spacing: 0.1em;
}
.client-statuses {
  margin-top: 9px;
}
.client-tabs {
  gap: 7px;
  margin-bottom: 20px;
  padding: 3px 2px 8px;
  border-bottom: 1px solid var(--line);
}
.client-tab {
  border-color: transparent;
  background: transparent;
  border-radius: 10px;
  padding: 10px 13px;
  color: #6d657b;
}
.client-tab:hover,
.client-tab.active {
  border-color: transparent;
  background: var(--primary-soft);
  color: var(--primary);
  box-shadow: none;
}
.client-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.client-summary-grid .metric-card {
  position: relative;
  overflow: hidden;
  min-height: 140px;
  background: linear-gradient(145deg, #fff, #fdfcff);
}
.client-summary-grid .metric-card:after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -28px;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--primary-soft);
  opacity: 0.55;
}
.client-summary-grid .metric-card > * {
  position: relative;
  z-index: 1;
}
.client-summary-grid .metric-card h3 {
  font-size: 23px;
  overflow-wrap: anywhere;
}
.client-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.client-section-head h3 {
  margin: 0 0 5px;
}
.client-section-head p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.client-form-panel {
  padding: 26px;
}
.client-profile-form label {
  margin: 0;
  color: #514a61;
}
.client-profile-form input,
.client-profile-form textarea {
  background: #fffdfd;
}
.context-workspace {
  padding: 24px;
}
.context-status-note {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 17px;
  padding: 11px 13px;
  border: 1px solid #e4dbf7;
  border-radius: 12px;
  background: #fbf9ff;
  color: #6e657d;
  font-size: 12px;
}
.table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.client-finance-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
}
.client-finance-panel h3 {
  margin: 0 0 5px;
}
.client-finance-panel p {
  margin: 0;
  font-size: 13px;
}
.data-table td {
  line-height: 1.4;
}
.data-table td small {
  color: var(--muted);
}
.panel-head {
  gap: 16px;
}
.panel-head > div {
  min-width: 0;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(111, 66, 193, 0.52);
  outline-offset: 3px;
}
@media (max-width: 1200px) {
  .client-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .data-table {
    min-width: 840px;
  }
  .client-tabs {
    scrollbar-width: thin;
  }
}
@media (max-width: 620px) {
  .topbar .profile {
    display: flex;
  }
  .topbar .profile-copy {
    display: none;
  }
  .client-admin-header {
    padding: 14px;
    margin-bottom: 14px;
  }
  .client-tabs {
    margin: 0 -2px 15px;
    padding: 2px 2px 8px;
  }
  .client-tab {
    padding: 9px 11px;
    font-size: 11px;
  }
  .client-summary-grid {
    grid-template-columns: 1fr 1fr;
  }
  .client-summary-grid .metric-card {
    min-height: 126px;
  }
  .client-summary-grid .metric-card h3 {
    font-size: clamp(17px, 4.3vw, 19px);
  }
  .client-section-head,
  .client-finance-panel {
    align-items: flex-start;
    flex-direction: column;
  }
  .client-finance-panel .btn {
    width: 100%;
  }
  .context-workspace {
    padding: 16px;
  }
  .context-status-note {
    align-items: flex-start;
  }
  .data-table {
    min-width: 720px;
  }
  .client-date {
    font-size: 14px !important;
  }
}

.finance-tabs,
.finance-controls {
  display: flex;
  gap: 8px;
  align-items: end;
  flex-wrap: wrap;
  margin: 0 0 16px;
}
.finance-controls label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.finance-controls input {
  min-height: 38px;
}
.finance-notice {
  margin-top: 16px;
}
.finance-notice p {
  font-size: 12px;
  color: var(--muted);
}
.finance-config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}
.finance-config-grid h3 {
  margin-top: 0;
}
.finance-table th,
.finance-table td {
  white-space: nowrap;
  padding-left: 7px;
  padding-right: 7px;
}
.finance-table .table-actions {
  display: grid;
  min-width: 126px;
}
.finance-table .table-actions .btn {
  min-height: 30px;
  padding: 6px 8px;
  font-size: 10px;
}
.finance-metric h3 {
  overflow-wrap: anywhere;
}
.finance-skeleton span,
.finance-skeleton strong,
.finance-skeleton small {
  display: block;
  border-radius: 999px;
  background: linear-gradient(90deg, #eee9f8 25%, #faf8fd 50%, #eee9f8 75%);
  background-size: 200% 100%;
  animation: finance-skeleton-pulse 1.2s ease-in-out infinite;
}
.finance-skeleton span { width: 52%; height: 0.75rem; }
.finance-skeleton strong { width: 72%; height: 1.65rem; margin: 1rem 0; }
.finance-skeleton small { width: 88%; height: 0.65rem; }
@keyframes finance-skeleton-pulse {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}
@media (max-width: 900px) {
  .finance-config-grid {
    grid-template-columns: 1fr;
  }
  .finance-table {
    min-width: 1040px;
  }
  .finance-table th,
  .finance-table td {
    display: table-cell !important;
  }
  .finance-table .table-actions {
    min-width: 138px;
  }
}

/* Productization Sprint — management screens */
.help-card {
  width: 100%;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.help-card > span:last-child {
  display: grid;
  gap: 1px;
  text-align: left;
}
.help-card:hover {
  background: #f6f1ff;
}
.executive-grid .metric-card {
  min-height: 138px;
}
.agent-hub-tabs {
  margin-top: 18px;
}
.agent-library-grid,
.integration-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.agent-library-card {
  display: flex;
  min-height: 270px;
  flex-direction: column;
  align-items: flex-start;
}
.agent-library-card h3 {
  margin: 13px 0 8px;
}
.agent-library-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.agent-card-list {
  display: grid;
  gap: 4px;
  margin: 16px 0;
  color: #665e75;
  font-size: 11px;
}
.agent-card-list b {
  margin-top: 4px;
  color: #4c435e;
}
.agent-library-card .table-actions {
  margin-top: auto;
  padding-top: 14px;
}
.agent-wizard .panel-head p {
  margin: 3px 0 0;
}
.wizard-progress {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 5px;
  margin: 16px 0 20px;
}
.wizard-progress i {
  height: 5px;
  border-radius: 999px;
  background: #e9e4f1;
}
.wizard-progress i.done {
  background: var(--primary);
}
.wizard-summary {
  padding: 16px;
  border: 1px solid #e7ddf8;
  border-radius: 12px;
  background: #fbf9ff;
}
.wizard-summary p {
  margin: 7px 0 0;
  line-height: 1.6;
}
.context-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}
.context-section {
  min-height: 116px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.context-section h4,
.rule-editor h4 {
  margin: 0 0 7px;
  font:
    700 12px "Manrope",
    sans-serif;
  color: #463b58;
}
.context-section p {
  margin: 0;
  color: #766e82;
  font-size: 12px;
  white-space: pre-wrap;
}
.rule-editor {
  margin: 0 0 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fcfbff;
}
.rule-editor label {
  margin: 10px 0;
}
.integration-card {
  display: flex;
  min-height: 225px;
  flex-direction: column;
  align-items: flex-start;
}
.integration-card h3 {
  margin: 13px 0 7px;
}
.integration-card p {
  min-height: 37px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
}
.integration-card .btn {
  margin-top: auto;
}
.integration-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
  font-size: 16px;
}
.finance-metric h3 {
  font-size: 22px;
}
@media (max-width: 620px) {
  /* A financial value or pending-state label must remain readable as a unit. */
  .metrics-grid > .finance-metric {
    grid-column: 1 / -1;
  }
}
.finance-notice {
  margin-top: 14px;
}
.modal-wide.agent-wizard {
  width: min(700px, 100%);
}
@media (max-width: 1100px) {
  .agent-library-grid,
  .integration-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .context-sections {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 620px) {
  .agent-library-grid,
  .integration-grid {
    grid-template-columns: 1fr;
  }
  .agent-library-card {
    min-height: 0;
  }
  .wizard-progress {
    gap: 3px;
  }
  .integration-card {
    min-height: 190px;
  }
  .context-section {
    min-height: 0;
  }
}

/* Agent Studio — visual configuration workspace */
.agent-client-intro,
.studio-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 18px;
}
.agent-client-intro h3,
.studio-header h1 {
  margin: 0 0 6px;
}
.agent-client-intro p,
.studio-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.agent-client-metrics {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.agent-client-metrics span {
  padding: 8px 10px;
  border: 1px solid #e5def1;
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  color: #675f76;
}
.agent-client-metrics b {
  color: var(--primary);
}
.studio-agent-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.studio-agent-card {
  padding: 22px;
  background: linear-gradient(145deg, #fff 0%, #fcfaff 100%);
}
.studio-agent-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.studio-agent-card h3 {
  margin: 6px 0 5px;
}
.studio-agent-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.studio-agent-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 18px 0;
}
.studio-agent-facts span {
  padding: 6px 8px;
  border-radius: 8px;
  background: #f7f3fc;
  color: #675f76;
  font-size: 11px;
}
.studio-library {
  padding-top: 4px;
}
.studio-library .panel-head {
  margin-bottom: 12px;
}
.studio-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  color: #61596d;
  font-size: 12px;
}
.studio-breadcrumb .link-button {
  font-size: 12px;
}
.studio-header {
  padding: 26px;
  border: 1px solid #e9e2f2;
  border-radius: 18px;
  background:
    radial-gradient(circle at 95% 0, #eee5ff 0, transparent 32%),
    linear-gradient(130deg, #fff 0%, #fbf9ff 100%);
}
.studio-header h1 {
  font-size: clamp(27px, 3vw, 38px);
  letter-spacing: -0.045em;
}
.studio-header p {
  max-width: 680px;
  font-size: 14px;
  line-height: 1.55;
}
.studio-header-tags {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 15px;
}
.studio-tabs {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  margin: 20px 0;
  padding: 3px 0 9px;
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}
.studio-tab {
  flex: 0 0 auto;
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #71697f;
  font:
    700 12px "Manrope",
    sans-serif;
  cursor: pointer;
}
.studio-tab:hover,
.studio-tab.active {
  background: var(--primary-soft);
  color: var(--primary);
}
.studio-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 276px;
  align-items: start;
  gap: 18px;
}
.studio-main {
  display: grid;
  gap: 15px;
  min-width: 0;
}
.studio-section {
  padding: 23px;
}
.studio-section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 16px;
}
.studio-section-head h3 {
  margin: 0 0 5px;
  font-size: 16px;
}
.studio-section-head p {
  max-width: 640px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.studio-toggle-list {
  display: grid;
  border: 1px solid #ede7f3;
  border-radius: 14px;
  overflow: hidden;
}
.studio-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 16px;
  border-bottom: 1px solid #eee9f4;
  cursor: pointer;
  background: #fff;
}
.studio-toggle:last-child {
  border-bottom: 0;
}
.studio-toggle:hover {
  background: #fdfbff;
}
.studio-toggle.is-disabled {
  cursor: not-allowed;
  background: #fcfbfd;
}
.studio-toggle-copy {
  display: grid;
  gap: 4px;
}
.studio-toggle-copy b {
  font-size: 13px;
  color: #41394e;
}
.studio-toggle-copy small {
  max-width: 570px;
  color: #786f84;
  font-size: 11px;
  line-height: 1.5;
}
.studio-toggle-control {
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}
.studio-setting-state {
  padding: 4px 7px;
  border-radius: 999px;
  background: #f1eef5;
  color: #756e80;
  font-size: 10px;
  font-weight: 700;
}
.studio-setting-state.on {
  background: #e7f7ee;
  color: #187549;
}
.studio-setting-state.off {
  background: #fff3e0;
  color: #99600f;
}
.studio-setting-state.pending {
  background: #eee8ff;
  color: #5c3fa3;
}
.studio-toggle input[role="switch"],
.studio-schedule-controls input[role="switch"] {
  appearance: none;
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 24px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: #d8d1df;
  cursor: pointer;
  transition: 0.2s;
}
.studio-toggle input[role="switch"]:after,
.studio-schedule-controls input[role="switch"]:after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px #0002;
  transition: 0.2s;
}
.studio-toggle input[role="switch"]:checked,
.studio-schedule-controls input[role="switch"]:checked {
  background: var(--primary);
}
.studio-toggle input[role="switch"]:checked:after,
.studio-schedule-controls input[role="switch"]:checked:after {
  transform: translateX(18px);
}
.studio-toggle input[role="switch"]:disabled,
.studio-schedule-controls input[role="switch"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.studio-sidebar {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 11px;
}
.studio-side-card {
  padding: 18px;
  border: 1px solid #e9e1f0;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(46, 28, 74, 0.04);
}
.studio-side-card .eyebrow {
  margin-bottom: 12px;
}
.studio-side-card .side-row {
  padding: 9px 0;
  border-bottom: 1px solid #f0ecf4;
  font-size: 11px;
}
.studio-side-card .side-row:last-child {
  border-bottom: 0;
}
.studio-side-card .side-row b {
  max-width: 140px;
  text-align: right;
  color: #453c53;
  font-size: 11px;
  overflow-wrap: anywhere;
}
.studio-side-actions {
  display: grid;
  gap: 8px;
}
.studio-side-actions .btn {
  width: 100%;
  justify-content: center;
}
.studio-safety-note {
  margin: 0;
  padding: 11px 13px;
  border: 1px solid #e8defa;
  border-radius: 11px;
  background: #faf8ff;
  color: #716680;
  font-size: 11px;
  line-height: 1.5;
}
.studio-inline-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #ebe4f2;
  border-radius: 12px;
  background: #fcfbff;
}
.studio-inline-action b {
  font-size: 13px;
}
.studio-inline-action p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}
.studio-form-grid label {
  color: #51485f;
  font-size: 12px;
}
.studio-form-grid textarea {
  min-height: 96px;
}
.studio-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}
.studio-fieldset legend {
  margin: 0 0 8px;
  color: #51485f;
  font-size: 12px;
  font-weight: 700;
}
.studio-choice-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.studio-choice-grid .check-row {
  padding: 8px 10px;
  border: 1px solid #e7e0ed;
  border-radius: 9px;
  background: #fff;
  font-size: 12px;
}
.studio-form-grid output {
  float: right;
  color: var(--primary);
  font-weight: 800;
}
.studio-adapt-language {
  align-self: end;
  padding: 12px;
  border: 1px solid #e6dff0;
  border-radius: 10px;
  background: #fcfbff;
}
.studio-schedule-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
  margin: 0 0 14px;
}
.studio-schedule-controls > label:not(.studio-toggle) {
  display: grid;
  gap: 5px;
  color: #584e66;
  font-size: 12px;
}
.studio-schedule-controls .studio-toggle {
  padding: 13px;
  border: 1px solid #ebe4f2;
  border-radius: 12px;
}
.studio-timezone {
  display: flex;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  background: #f7f3fc;
  color: #6c6377;
  font-size: 12px;
}
.studio-days {
  display: grid;
  gap: 7px;
}
.studio-schedule-day {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid #ebe5f1;
  border-radius: 10px;
  background: #fff;
}
.studio-schedule-day .check-row {
  font-size: 12px;
}
.studio-schedule-day input[type="time"] {
  min-width: 0;
  padding: 8px 9px;
}
.studio-schedule-day span {
  color: var(--muted);
  font-size: 11px;
}
.studio-flow-list {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}
.studio-flow-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid #e9e3f0;
  border-radius: 11px;
  background: #fff;
}
.studio-flow-index {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
}
.studio-flow-row select {
  min-width: 0;
}
.studio-flow-row .check-row {
  font-size: 11px;
}
.flow-row-actions {
  display: flex;
  gap: 3px;
}
.studio-flow-empty {
  padding: 15px;
  border: 1px dashed #d9d0e2;
  border-radius: 11px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.studio-knowledge-list {
  display: grid;
  gap: 8px;
}
.studio-knowledge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 15px;
  border: 1px solid #eae4f1;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}
.studio-knowledge-row span {
  display: grid;
  gap: 4px;
}
.studio-knowledge-row b {
  font-size: 13px;
  color: #433b51;
}
.studio-knowledge-row small {
  color: #786f84;
  font-size: 11px;
}
.studio-check-list {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}
.studio-check-list .check-row {
  padding: 11px;
  border: 1px solid #e7e0ee;
  border-radius: 10px;
  background: #fff;
}
@media (max-width: 1120px) {
  .studio-workspace {
    grid-template-columns: 1fr;
  }
  .studio-sidebar {
    position: static;
    grid-template-columns: 1fr 1fr;
  }
  .studio-side-actions {
    align-content: start;
  }
  .studio-safety-note {
    grid-column: 1/-1;
  }
  .studio-agent-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 680px) {
  .agent-client-intro,
  .studio-header,
  .studio-inline-action {
    align-items: stretch;
    flex-direction: column;
  }
  .agent-client-metrics {
    width: 100%;
  }
  .studio-header {
    padding: 19px;
  }
  .studio-header .btn {
    width: 100%;
  }
  .studio-tabs {
    margin: 15px -2px;
    padding-left: 2px;
  }
  .studio-tab {
    padding: 10px 12px;
  }
  .studio-workspace {
    gap: 12px;
  }
  .studio-section {
    padding: 16px;
  }
  .studio-section-head {
    margin-bottom: 13px;
  }
  .studio-toggle {
    align-items: flex-start;
    padding: 14px;
    gap: 10px;
  }
  .studio-toggle-control {
    flex-direction: column-reverse;
    align-items: flex-end;
  }
  .studio-sidebar {
    grid-template-columns: 1fr;
  }
  .studio-schedule-controls {
    grid-template-columns: 1fr;
  }
  .studio-schedule-day {
    grid-template-columns: 1fr 1fr auto 1fr;
  }
  .studio-schedule-day .check-row {
    grid-column: 1/-1;
  }
  .studio-flow-row {
    grid-template-columns: 26px minmax(0, 1fr) auto;
  }
  .studio-flow-row .check-row {
    grid-column: 2/3;
  }
  .flow-row-actions {
    grid-column: 3;
    grid-row: 1/3;
  }
  .studio-knowledge-row {
    align-items: flex-start;
  }
  .studio-knowledge-row input {
    margin-top: 4px;
  }
  .studio-agent-card {
    padding: 17px;
  }
  .studio-agent-card-head {
    flex-direction: column;
  }
  .studio-agent-card .table-actions .btn {
    flex: 1;
  }
  .studio-main {
    min-width: 0;
  }
}

/* Agent Studio hardening: CSP-safe state, responsive cards and accessible controls. */
.report-bar-fill {
  height: var(--percentage);
}
.funnel-fill {
  width: var(--percentage);
}
.activity-dot.is-success {
  background: #0db38e;
}
.activity-dot.is-warning {
  background: #e2a11a;
}
.pct-0 { --percentage: 0%; }
.pct-5 { --percentage: 5%; }
.pct-10 { --percentage: 10%; }
.pct-15 { --percentage: 15%; }
.pct-20 { --percentage: 20%; }
.pct-25 { --percentage: 25%; }
.pct-30 { --percentage: 30%; }
.pct-35 { --percentage: 35%; }
.pct-40 { --percentage: 40%; }
.pct-45 { --percentage: 45%; }
.pct-50 { --percentage: 50%; }
.pct-55 { --percentage: 55%; }
.pct-60 { --percentage: 60%; }
.pct-65 { --percentage: 65%; }
.pct-70 { --percentage: 70%; }
.pct-75 { --percentage: 75%; }
.pct-80 { --percentage: 80%; }
.pct-85 { --percentage: 85%; }
.pct-90 { --percentage: 90%; }
.pct-95 { --percentage: 95%; }
.pct-100 { --percentage: 100%; }

.studio-tabs {
  overscroll-behavior-x: contain;
  scroll-padding-inline: 12px;
}
.studio-tab {
  scroll-snap-align: center;
  white-space: nowrap;
}
.studio-tab:focus-visible {
  outline: 3px solid rgba(111, 66, 193, 0.52);
  outline-offset: 2px;
}
.studio-control-explainer {
  margin: 7px 0 0;
  color: #6e657d;
  font-size: 11px;
  line-height: 1.5;
}
.studio-toggle-copy .studio-control-explainer {
  color: #756b83;
}
.studio-side-actions .studio-control-explainer {
  margin-top: -2px;
  padding: 0 2px;
}
.studio-inline-action .studio-control-explainer {
  flex: 1 1 100%;
}
.modal.modal-wide {
  width: min(680px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
}

.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;
}
.client-list-panel {
  overflow: visible;
}
.client-name-link {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 4px 0;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.client-name-link:hover { color: var(--primary); text-decoration: underline; }
.client-name-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.client-management-table tr[data-client-row] { cursor: pointer; }
.client-list-head,
.client-list-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.client-list-head {
  justify-content: space-between;
  align-items: flex-start;
}
.client-list-head p {
  margin: 5px 0 0;
}
.client-list-filters .btn {
  min-height: 34px;
  padding: 7px 11px;
  font-size: 12px;
}
.client-list-filters .btn.active {
  border-color: #7b3fc7;
  background: #f1e8ff;
  color: #6732b5;
}
.client-actions-cell {
  position: relative;
  overflow: visible;
}
.client-actions {
  position: relative;
}
.client-actions summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  list-style: none;
  cursor: pointer;
}
.client-actions summary::-webkit-details-marker {
  display: none;
}
.client-actions-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  width: 210px;
  padding: 7px;
  border: 1px solid #e3d9ef;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(48, 27, 79, 0.16);
}
.client-actions-menu button {
  padding: 10px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #352945;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.client-actions-menu button:hover,
.client-actions-menu button:focus-visible {
  background: #f5effd;
}
.client-actions-menu .danger-link {
  color: #b42318;
}
.admin-action-summary {
  display: grid;
  gap: 5px;
  padding: 13px 14px;
  border: 1px solid #ded3eb;
  border-radius: 12px;
  background: #faf7fe;
}
.admin-action-summary span {
  color: #675d73;
  font-size: 12px;
  line-height: 1.5;
}
.admin-action-summary.danger {
  border-color: #f1b9b2;
  background: #fff5f3;
}

.agent-simulator {
  width: min(840px, calc(100vw - 32px));
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto minmax(260px, 1fr) auto auto;
  gap: 14px;
  overflow: hidden;
}
.simulator-head,
.simulator-actions,
.simulator-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}
.simulator-head {
  justify-content: space-between;
}
.simulator-head > div {
  min-width: 0;
}
.simulator-head h3 {
  margin: 3px 0 5px;
}
.simulator-head .icon-btn {
  flex: 0 0 auto;
}
.simulator-meta {
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid #e7def0;
  border-radius: 12px;
  background: #faf8ff;
  color: #665c77;
  font-size: 11px;
  font-weight: 700;
}
.simulator-meta span {
  min-width: 0;
}
.simulator-meta span + span::before {
  content: "•";
  margin-right: 10px;
  color: #aa9abf;
}
.simulator-chat {
  min-height: 260px;
  max-height: min(54vh, 540px);
  display: flex;
  flex-direction: column;
  gap: 11px;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 16px;
  border: 1px solid #e8e1ef;
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfaff, #f7f3fb);
}
.simulator-empty {
  display: grid;
  place-content: center;
  gap: 6px;
  min-height: 200px;
  color: #766d84;
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
}
.simulator-empty b {
  color: #3d3350;
  font-size: 15px;
}
.simulator-bubble {
  display: grid;
  width: fit-content;
  max-width: min(80%, 640px);
  gap: 5px;
  padding: 11px 13px;
  border-radius: 15px;
  overflow-wrap: anywhere;
}
.simulator-bubble span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.simulator-bubble p,
.simulator-bubble small {
  margin: 0;
  line-height: 1.5;
}
.simulator-bubble.customer {
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  background: #6741c6;
  color: #fff;
}
.simulator-bubble.customer span {
  color: #e8ddff;
}
.simulator-bubble.agent {
  align-self: flex-start;
  border: 1px solid #e3d9ee;
  border-bottom-left-radius: 4px;
  background: #fff;
  color: #383044;
}
.simulator-bubble.agent span {
  color: #7047c9;
}
.simulator-bubble small {
  padding-top: 7px;
  border-top: 1px solid #e8def5;
  color: #655b72;
  font-size: 11px;
}
.simulator-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}
.simulator-composer textarea {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  max-height: 130px;
  resize: vertical;
  border: 1px solid #d9cfE5;
  border-radius: 12px;
  padding: 12px;
  color: #2f263b;
  font: 500 13px/1.45 "Manrope", sans-serif;
}
.simulator-composer textarea:focus-visible,
.simulator-actions details:focus-visible {
  outline: 3px solid rgba(112, 71, 201, 0.28);
  outline-offset: 2px;
}
.simulator-composer .btn {
  min-height: 48px;
  white-space: nowrap;
}
.simulator-feedback {
  min-height: 17px;
  margin: -4px 2px 0;
  color: #6a5b7c;
  font-size: 12px;
}
.simulator-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.simulator-actions details {
  margin-right: auto;
  color: #70667f;
  font-size: 11px;
}
.simulator-actions summary {
  cursor: pointer;
  font-weight: 700;
}
.simulator-actions details p {
  max-width: 330px;
  margin: 7px 0 0;
  color: #786e87;
  line-height: 1.45;
}

@media (max-width: 620px) {
  .agent-simulator {
    width: 100%;
    min-height: calc(100vh - 32px);
    grid-template-rows: auto auto minmax(180px, 1fr) auto auto;
    gap: 11px;
    padding: 16px;
  }
  .simulator-meta {
    gap: 5px 9px;
    padding: 9px 10px;
  }
  .simulator-meta span + span::before {
    margin-right: 7px;
  }
  .simulator-chat {
    min-height: 180px;
    max-height: none;
    padding: 12px;
  }
  .simulator-bubble {
    max-width: 92%;
  }
  .simulator-composer {
    grid-template-columns: 1fr;
  }
  .simulator-composer .btn {
    width: 100%;
  }
  .simulator-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }
  .simulator-actions details {
    grid-column: 1 / -1;
    margin: 0;
    order: 3;
  }
  .simulator-actions .btn {
    min-height: 44px;
  }
  .client-list-panel {
    overflow: visible;
    padding: 14px;
  }
  .client-list-panel .data-table,
  .client-list-panel .data-table tbody,
  .client-list-panel .data-table tr,
  .client-list-panel .data-table td {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
  .client-list-panel .data-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .client-list-panel .data-table tbody {
    display: grid;
    gap: 12px;
  }
  .client-list-panel .data-table tr {
    display: grid;
    gap: 0;
    overflow: hidden;
    border: 1px solid #e7e0ef;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 6px 16px rgba(46, 28, 74, 0.05);
  }
  .client-list-panel .data-table td {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 11px 13px;
    border-bottom: 1px solid #f0ecf4;
    font-size: 13px;
    text-align: right;
  }
  .client-list-panel .data-table td::before {
    color: #7c738d;
    font-size: 11px;
    font-weight: 700;
    text-align: left;
  }
  .client-list-panel .data-table td:nth-child(1) {
    display: block !important;
    padding: 15px 13px 11px;
    color: #2d243d;
    font-size: 15px;
    text-align: left;
  }
  .client-list-panel .data-table td:nth-child(1)::before { content: none; }
  .client-list-panel .data-table td:nth-child(2)::before { content: "Segmento"; }
  .client-list-panel .data-table td:nth-child(3)::before { content: "Agentes"; }
  .client-list-panel .data-table td:nth-child(4)::before { content: "Status"; }
  .client-list-panel .data-table td:nth-child(5)::before { content: "Canal"; }
  .client-list-panel .data-table td:nth-child(6)::before { content: "Saúde"; }
  .client-list-panel .data-table td:nth-child(7)::before { content: "Última atividade"; }
  .client-list-panel .data-table td:nth-child(8) {
    display: block !important;
    padding: 13px;
    border-bottom: 0;
  }
  .client-list-panel .data-table td:nth-child(8)::before { content: none; }
  .client-list-panel .data-table td:nth-child(8) .btn {
    width: 100%;
    min-height: 44px;
  }
  .client-list-head,
  .client-list-filters {
    align-items: stretch;
  }
  .client-list-filters .btn {
    flex: 1 1 30%;
    min-height: 44px;
  }
  .client-actions summary {
    width: 100%;
    min-height: 44px;
    border: 1px solid #d9cee6;
    border-radius: 10px;
  }
  .client-actions-menu {
    position: static;
    width: 100%;
    margin-top: 7px;
    box-shadow: none;
  }
  .client-actions-menu button {
    min-height: 44px;
  }
  .studio-tabs {
    margin-inline: -2px;
    padding-inline: 2px 14px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  .studio-tabs::-webkit-scrollbar { display: none; }
  .studio-tab { min-height: 44px; }
  .studio-toggle { min-height: 72px; }
  .studio-toggle-control { flex-shrink: 0; }
  .studio-inline-action .btn,
  .studio-side-actions .btn,
  .studio-agent-card .table-actions .btn { min-height: 44px; }
  .studio-agent-card .table-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }
  .studio-flow-row {
    grid-template-columns: 30px minmax(0, 1fr) auto;
  }
  .studio-flow-row .check-row { grid-column: 2 / -1; }
  .flow-row-actions { gap: 6px; }
  .flow-row-actions .icon-btn {
    width: 44px;
    height: 44px;
  }
  .modal.modal-wide {
    width: 100%;
    max-height: 100%;
    min-height: min(520px, calc(100vh - 32px));
    padding: 18px;
    border-radius: 16px;
  }
}

@media (max-width: 620px) {
  /* All Studio areas stay visible without relying on a partially hidden strip. */
  .studio-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    overflow: visible;
    margin: 15px 0;
    padding: 0;
    border-bottom: 0;
    scroll-snap-type: none;
  }
  .studio-tab {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 10px 8px;
    white-space: normal;
    line-height: 1.25;
    text-align: center;
  }
  .studio-tab:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  transform: translateY(-160%);
  border-radius: 8px;
  background: #1d2033;
  color: #fff;
  padding: 10px 12px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.18s ease;
}
.skip-link:focus-visible {
  transform: translateY(0);
  outline: 3px solid #f0c75e;
  outline-offset: 2px;
}

/* The same service/lead controls stay reachable on narrow screens. This is a
   region of the inbox, not a second operation flow or a production toggle. */
.chat-details-toggle, .chat-details-head { display: none; }
@media (max-width: 1200px) {
  .chat-head { gap: 10px; flex-wrap: wrap; }
  .chat-details-toggle { display: inline-flex; min-height: 44px; white-space: normal; }
  .inbox-layout.details-open .chat-side {
    display: block;
    position: absolute;
    z-index: 5;
    inset: 0 0 0 auto;
    width: min(390px, 100%);
    max-width: 100%;
    background: #fff;
    overflow: auto;
    overscroll-behavior: contain;
    box-shadow: -6px 0 24px #20263d22;
  }
  .chat-details-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: sticky;
    top: -15px;
    z-index: 1;
    padding: 10px 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
  }
  .chat-details-head h3 { margin: 0; font-size: 16px; }
  .chat-details-head button { min-width: 44px; min-height: 44px; flex-shrink: 0; }
  .chat-side .side-row { overflow-wrap: anywhere; }
  .chat-side .side-row > * { min-width: 0; }
}
@media (max-width: 620px) {
  .inbox-layout.details-open .chat-side { width: 100%; }
  .chat-details-toggle { width: 100%; justify-content: center; }
}
