:root {
  --ink: #102334;
  --muted: #6e7d8e;
  --line: #dfe8ee;
  --canvas: #eef3f8;
  --card: #ffffff;
  --navy: #132b47;
  --navy-deep: #08192b;
  --mint: #22c7a9;
  --mint-dark: #15977f;
  --mint-soft: #e4fbf6;
  --coral: #ff7a6a;
  --gold: #f2b84b;
  --blue: #4f7df3;
  --purple: #7357ff;
  --shadow: 0 18px 48px rgba(9, 30, 66, .10);
  --soft-shadow: 0 10px 30px rgba(9, 30, 66, .07);
  --radius: 20px;
  --border: #dfe8ee;
}

.tasks-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.tasks-side-panel,
.tasks-main-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--soft-shadow);
}

.tasks-side-panel {
  padding: 18px;
  max-height: calc(100vh - 190px);
  overflow: auto;
}

.tasks-main-panel {
  overflow: hidden;
}

.tasks-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(5, minmax(130px, .7fr));
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.task-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(245px, 1fr);
  gap: 14px;
  padding: 16px;
  overflow-x: auto;
  min-height: 520px;
  background: linear-gradient(180deg, #f8fbfd, #fff);
}

.task-column {
  background: #f8fbfd;
  border: 1px solid var(--border);
  border-radius: 18px;
  min-width: 245px;
}

.task-column-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
}

.task-column-head span {
  background: #e9f2ff;
  color: #2452a5;
  border-radius: 999px;
  padding: 3px 9px;
  font-weight: 800;
  font-size: 12px;
}

.task-column-body {
  display: grid;
  gap: 10px;
  padding: 12px;
  max-height: calc(100vh - 310px);
  overflow: auto;
}

.task-card {
  text-align: left;
  background: #fff;
  border: 1px solid #dfe8ef;
  border-left: 5px solid #67b7dc;
  border-radius: 16px;
  padding: 12px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(21, 55, 75, .07);
}

.task-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(21, 55, 75, .12);
}

.task-priority-urgent { border-left-color: #ff6f61; }
.task-priority-high { border-left-color: #ffb347; }
.task-priority-normal { border-left-color: #48c7b5; }
.task-priority-low { border-left-color: #93a4b7; }

.task-card-top,
.task-card-footer,
.task-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}

.task-card h3 {
  margin: 10px 0 6px;
  font-size: 15px;
  line-height: 1.3;
}

.task-card p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.task-code {
  font-size: 11px;
  font-weight: 900;
  color: #4772a5;
  letter-spacing: .04em;
}

.task-meta {
  flex-wrap: wrap;
  justify-content: flex-start;
  color: var(--muted);
  font-size: 11px;
}

.task-meta .icon {
  width: 14px;
  height: 14px;
}

.task-overdue {
  color: #d94f45 !important;
  font-weight: 900;
}

.task-progress {
  margin-left: auto;
  background: #eef7ff;
  color: #2452a5;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 900;
}

.empty-task-column {
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  font-size: 12px;
}

.task-project-list,
.mini-stat-list {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.task-project-row {
  width: 100%;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 16px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  text-align: left;
}

.task-project-row small,
.mini-stat-row span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}

.mini-stat-row {
  display: flex;
  justify-content: space-between;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.checkbox-card {
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  background: #fff;
}

.checkbox-card span {
  display: grid;
  font-weight: 800;
}

.checkbox-card small {
  color: var(--muted);
  font-weight: 600;
}

.task-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(260px, .8fr);
  gap: 18px;
}

.task-detail-main,
.task-detail-side {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
  background: #fff;
}

.task-detail-actions,
.task-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.task-description {
  background: #f8fbfd;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  color: var(--ink);
  line-height: 1.6;
  margin-bottom: 18px;
}

.task-comments,
.attachment-list,
.activity-feed {
  display: grid;
  gap: 10px;
  max-height: 320px;
  overflow: auto;
}

.task-comment,
.attachment-link,
.activity-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: #fbfdff;
}

.task-comment small,
.attachment-link small,
.activity-item small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}

.task-comment-form,
.task-attachment-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.task-attachment-form input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
}

.task-detail-page {
  display: grid;
  gap: 16px;
}

.task-detail-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  border: 1px solid rgba(207, 224, 229, .95);
  border-radius: 18px;
  padding: 22px 24px;
  background: #fff;
  box-shadow: none;
}

.task-detail-hero h1 {
  margin: 8px 0;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.08;
  letter-spacing: -.04em;
}

.task-detail-hero p {
  max-width: 980px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  white-space: pre-wrap;
}

.task-detail-hero-actions,
.task-detail-status-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.task-detail-context {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border: 1px solid rgba(207, 224, 229, .95);
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
}

.task-context-tile {
  display: grid;
  gap: 5px;
  min-width: 0;
  text-align: left;
  border: 0;
  border-right: 1px solid rgba(207, 224, 229, .95);
  border-radius: 0;
  padding: 16px 18px;
  color: var(--ink);
  background: #fff;
  box-shadow: none;
}

.task-context-tile:last-child { border-right: 0; }

button.task-context-tile:not(:disabled) {
  cursor: pointer;
}

button.task-context-tile:not(:disabled):hover {
  background: #f6fbfb;
}

.task-context-tile small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.task-context-tile strong,
.task-context-tile span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-context-tile strong {
  font-size: 14px;
}

.task-context-tile span {
  color: var(--muted);
  font-size: 11px;
}

.task-detail-status-strip {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 12px 14px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.task-detail-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, .7fr);
  gap: 16px;
  align-items: start;
}

.task-detail-workspace,
.task-detail-sidebar {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.task-page-section {
  min-width: 0;
  border: 1px solid rgba(207, 224, 229, .95);
  border-radius: 18px;
  padding: 18px;
  background: #fff;
}

.task-description-section {
  border-left: 4px solid var(--mint);
  background:
    linear-gradient(135deg, rgba(68, 199, 162, .08), rgba(255, 255, 255, 0) 38%),
    #fff;
}

.task-description-rich {
  min-height: 130px;
  max-height: 440px;
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfefd, #fff);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.75;
  overflow-wrap: anywhere;
  white-space: normal;
}

.task-filter-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(68, 199, 162, .32);
  border-radius: 16px;
  background: #effbf7;
  color: #244a42;
  font-size: 12px;
  font-weight: 800;
}

.task-filter-banner strong {
  color: var(--ink);
}

.task-form-page {
  display: grid;
  gap: 16px;
}

.task-form-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  border: 1px solid rgba(207, 224, 229, .95);
  border-radius: 18px;
  padding: 22px 24px;
  background: #fff;
}

.task-form-header h1 {
  margin: 8px 0;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.08;
  letter-spacing: -.04em;
}

.task-form-header p {
  max-width: 860px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.task-form-summary {
  display: grid;
  min-width: 280px;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: #fbfefd;
}

.task-form-summary span {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.task-form-summary span:last-child { border-bottom: 0; }

.task-form-summary small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.task-form-summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.task-screen-form {
  display: grid;
  gap: 16px;
}

.task-form-section {
  border: 1px solid rgba(207, 224, 229, .95);
  border-radius: 18px;
  padding: 18px;
  background: #fff;
}

.task-form-section--primary {
  border-left: 4px solid var(--mint);
}

.task-form-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border: 1px solid rgba(207, 224, 229, .95);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(10px);
  z-index: 5;
}

.task-page-section h2 {
  margin: 0 0 8px;
  font-size: 15px;
}

.mini-task-link {
  display: grid;
  gap: 4px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 11px;
  background: #fbfdff;
  color: var(--ink);
}

.mini-task-link.active {
  border-color: rgba(59, 194, 158, .65);
  background: #effbf7;
}

.mini-task-link span,
.mini-task-link small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-task-link small {
  color: var(--muted);
}

@media (max-width: 1100px) {
  .tasks-layout,
  .task-detail-grid,
  .task-detail-context,
  .task-detail-page-grid {
    grid-template-columns: 1fr;
  }
  .task-context-tile { border-right: 0; border-bottom: 1px solid rgba(207, 224, 229, .95); }
  .task-context-tile:last-child { border-bottom: 0; }
  .task-detail-hero {
    flex-direction: column;
  }
  .task-form-header {
    flex-direction: column;
  }
  .task-form-summary {
    width: 100%;
  }
  .tasks-toolbar {
    grid-template-columns: 1fr 1fr;
  }
}

.tasks-command-center {
  display: grid;
  gap: 16px;
}

.task-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
}

.task-top-rail {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, .55fr);
  gap: 14px;
  background: linear-gradient(135deg, rgba(255,255,255,.92), rgba(236,248,246,.9));
  border: 1px solid rgba(210, 225, 230, .9);
  border-radius: 26px;
  padding: 16px;
  box-shadow: 0 18px 45px rgba(24, 43, 58, .08);
}

.task-project-list--rail,
.mini-stat-list--rail {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  margin: 0;
  padding-bottom: 4px;
}

.task-project-list--rail .task-project-row {
  min-width: 260px;
  max-width: 340px;
  background: rgba(255,255,255,.94);
  border-color: #dbe9ef;
  box-shadow: 0 10px 26px rgba(18, 53, 71, .06);
}

.task-project-row.active,
.task-project-row:hover {
  border-color: var(--mint);
  background: #f0fbf8;
}

.mini-stat-list--rail .mini-stat-row {
  min-width: 160px;
  background: #fff;
}

.tasks-main-panel--full {
  border-radius: 28px;
  box-shadow: 0 20px 60px rgba(18, 53, 71, .10);
}

.tasks-main-panel--full .tasks-toolbar {
  grid-template-columns: minmax(260px, 1.5fr) repeat(4, minmax(145px, .65fr)) auto;
  background: rgba(255,255,255,.96);
  position: sticky;
  top: 0;
  z-index: 4;
}

.tasks-main-panel--full .task-board {
  grid-auto-columns: minmax(285px, 1fr);
  min-height: calc(100vh - 360px);
  padding: 18px;
  gap: 16px;
  background:
    radial-gradient(circle at 10% 10%, rgba(68,199,162,.12), transparent 28%),
    linear-gradient(180deg, #f4f8fb 0%, #ffffff 100%);
}

.tasks-main-panel--full .task-column {
  background: rgba(255,255,255,.72);
  border-color: #dce9ef;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85), 0 12px 28px rgba(18, 53, 71, .06);
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.tasks-main-panel--full .task-column.is-drop-target {
  border-color: var(--mint);
  background: #effbf7;
  transform: translateY(-2px);
  box-shadow: 0 0 0 3px rgba(68,199,162,.18), 0 18px 36px rgba(36,155,122,.13);
}

.tasks-main-panel--full .task-column-head {
  background: rgba(255,255,255,.85);
  border-radius: 18px 18px 0 0;
}

.tasks-main-panel--full .task-column-body {
  min-height: 430px;
  max-height: calc(100vh - 390px);
  scrollbar-width: thin;
}

.task-card {
  position: relative;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.task-card[draggable="true"] {
  cursor: grab;
}

.task-card[draggable="true"]:active {
  cursor: grabbing;
}

.task-card.is-dragging {
  opacity: .58;
  transform: rotate(1deg) scale(.98);
}

.task-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 7px;
  color: #9aacb8;
  font-weight: 900;
  letter-spacing: -3px;
}

.tasks-main-panel--full .task-card {
  border-radius: 18px;
  padding: 14px;
  background: linear-gradient(180deg, #fff, #fbfdff);
}

.task-card[data-task-status="Backlog"] {
  border-left-color: #94a3b8;
  background: linear-gradient(180deg, #fff, #f8fafc);
}

.task-card[data-task-status="To Do"] {
  border-left-color: #4f7df3;
  background: linear-gradient(180deg, #fff, #f3f7ff);
}

.task-card[data-task-status="In Progress"] {
  border-left-color: #f2b84b;
  background: linear-gradient(180deg, #fff, #fff8eb);
}

.task-card[data-task-status="Review"] {
  border-left-color: #7357ff;
  background: linear-gradient(180deg, #fff, #f5f2ff);
}

.task-card[data-task-status="Blocked"] {
  border-left-color: #ff6f61;
  background: linear-gradient(180deg, #fff, #fff3f1);
}

.task-card[data-task-status="Completed"] {
  border-left-color: #22c7a9;
  background: linear-gradient(180deg, #fff, #effbf7);
}

.tasks-main-panel--full .task-card h3 {
  font-size: 14px;
}

.tasks-main-panel--full .task-card-footer {
  padding-top: 10px;
  border-top: 1px solid #eef3f6;
}

.task-card-open {
  margin-left: auto;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(34,199,169,.28);
  border-radius: 999px;
  color: var(--mint-dark);
  background: var(--mint-soft);
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.task-card-open:hover {
  color: #fff;
  background: var(--mint-dark);
}

.task-list-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-list-actions .secondary-button {
  min-height: 34px;
  padding: 0 11px;
  font-size: 10px;
}

@media (max-width: 1180px) {
  .task-top-rail,
  .task-kpi-strip {
    grid-template-columns: 1fr 1fr;
  }
  .tasks-main-panel--full .tasks-toolbar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .task-top-rail,
  .task-kpi-strip {
    grid-template-columns: 1fr;
  }
}

.task-suite-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(18, 53, 71, .96), rgba(36, 84, 104, .94)),
    radial-gradient(circle at top right, rgba(68, 199, 162, .35), transparent 34%);
  color: #fff;
  box-shadow: 0 24px 55px rgba(18, 53, 71, .22);
}

.task-suite-header h2 {
  margin: 6px 0 4px;
  font-size: 24px;
  letter-spacing: -.03em;
}

.task-suite-header p {
  margin: 0;
  color: rgba(255,255,255,.76);
  max-width: 760px;
}

.task-suite-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #9cf0d8;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 900;
}

.task-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  backdrop-filter: blur(12px);
}

.task-view-toggle button {
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  background: transparent;
  color: rgba(255,255,255,.72);
  font-weight: 900;
  cursor: pointer;
}

.task-view-toggle button.active {
  background: #fff;
  color: var(--navy);
  box-shadow: 0 10px 24px rgba(0,0,0,.12);
}

.task-kpi-strip .metric-card {
  min-height: 112px;
}

.task-top-rail {
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .45fr);
}

.tasks-main-panel--full {
  background: #fff;
}

.tasks-main-panel--full .tasks-toolbar {
  gap: 12px;
  padding: 14px;
  border-bottom-color: #e7eef2;
}

.tasks-main-panel--full .filter-select,
.tasks-main-panel--full .search-box {
  min-height: 42px;
  border-radius: 14px;
}

.task-list-shell {
  overflow: auto;
  max-height: calc(100vh - 340px);
  background:
    linear-gradient(180deg, #ffffff, #f8fbfd);
}

.task-list-table {
  min-width: 1120px;
}

.task-list-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fbfd;
  color: #6f8290;
  font-size: 11px;
  letter-spacing: .08em;
}

.task-list-row {
  cursor: pointer;
  transition: background .15s ease;
}

.task-list-row:hover {
  background: #f4fbf8;
}

.task-list-row.is-overdue {
  background: #fff8f6;
}

.task-list-title {
  display: grid;
  gap: 4px;
  min-width: 260px;
}

.task-list-title strong {
  color: var(--ink);
  font-size: 14px;
}

.task-list-title small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.task-list-status {
  width: 150px;
  min-width: 150px;
  padding: 9px 10px;
  font-size: 12px;
}

.task-progress-line {
  width: 110px;
  height: 8px;
  border-radius: 999px;
  background: #e7eef3;
  overflow: hidden;
  margin-bottom: 5px;
}

.task-progress-line span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--blue));
}

.task-column-add {
  width: calc(100% - 24px);
  margin: 0 12px 12px;
  border: 1px dashed #bfd2db;
  border-radius: 14px;
  background: rgba(255,255,255,.76);
  color: var(--navy);
  padding: 10px;
  font-weight: 900;
  cursor: pointer;
}

.task-column-add:hover {
  border-color: var(--mint);
  background: #f0fbf8;
}

.task-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.task-section-head h3 {
  margin: 0;
}

.task-section-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.task-checklist-panel {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  background: #fff;
  margin-bottom: 18px;
}

.task-progress-line--wide {
  width: 100%;
  margin: 6px 0 12px;
}

.task-checklist {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.task-check-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid #e4edf2;
  border-radius: 14px;
  padding: 10px;
  background: #fbfdff;
}

.task-check-item.completed {
  background: #f0fbf8;
  color: var(--muted);
}

.task-check-item.completed span {
  text-decoration: line-through;
}

.task-checklist-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 12px;
}

.task-checklist-form input {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 12px;
}

.tasks-command-center .metric-card {
  box-shadow: 0 12px 34px rgba(18, 53, 71, .07);
}

@media (max-width: 900px) {
  .task-suite-header {
    align-items: flex-start;
    flex-direction: column;
  }
  .task-view-toggle {
    width: 100%;
  }
  .task-view-toggle button {
    flex: 1;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(79, 125, 243, .13), transparent 32rem),
    radial-gradient(circle at top right, rgba(34, 199, 169, .16), transparent 30rem),
    var(--canvas);
  font-family: "DM Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}

@media (min-width: 900px) {
  body {
    zoom: .85;
  }
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .68; }
button.is-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
}
.button-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: buttonSpin .7s linear infinite;
}
@keyframes buttonSpin { to { transform: rotate(360deg); } }
button, input, select, textarea { outline: none; }
.hidden { display: none !important; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  font-family: "Manrope", sans-serif;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.6px;
}
.brand--light { color: white; }
.brand-mark {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  width: 28px;
  height: 28px;
  padding: 6px;
  border-radius: 9px;
  background: var(--mint);
  box-shadow: inset 0 -8px 12px rgba(0,0,0,.05);
}
.brand-mark span { width: 4px; border-radius: 3px; background: white; transform: rotate(30deg); }
.brand-mark span:nth-child(1) { height: 7px; }
.brand-mark span:nth-child(2) { height: 12px; }
.brand-mark span:nth-child(3) { height: 17px; }

.auth-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(460px, 1.08fr) minmax(420px, .92fr); background: white; }
.auth-brand {
  position: relative;
  min-height: 100vh;
  padding: 48px 7vw;
  overflow: hidden;
  color: white;
  background:
    radial-gradient(circle at 12% 85%, rgba(68,199,162,.18), transparent 24%),
    linear-gradient(145deg, var(--navy-deep) 0%, #174558 100%);
}
.auth-brand::after {
  content: "";
  position: absolute;
  width: 480px;
  height: 480px;
  right: -260px;
  top: -230px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(255,255,255,.025), 0 0 0 140px rgba(255,255,255,.02);
}
.auth-copy { position: relative; z-index: 1; max-width: 570px; margin-top: 15vh; }
.eyebrow { color: #80e2c7; font-size: 12px; letter-spacing: 2.2px; font-weight: 700; }
.auth-copy h1 { max-width: 560px; margin: 18px 0 20px; font: 800 clamp(38px, 4.6vw, 66px)/1.04 "Manrope"; letter-spacing: -2.6px; }
.auth-copy p { max-width: 510px; margin: 0; color: #b8ccd4; font-size: 17px; line-height: 1.7; }
.source-preview { position: relative; width: 520px; height: 280px; margin: 44px auto 5px; }
.source-orbit, .source-hub {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px 9px 9px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 13px;
  color: #d8e6ea;
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
  font-size: 12px;
}
.source-logo { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 9px; color: white; background: #6a8fe0; font-weight: 800; }
.source-logo--coral { background: var(--coral); }
.source-logo--gold { background: var(--gold); }
.orbit-one { top: 12px; left: 20px; }
.orbit-two { top: 18px; right: 7px; }
.orbit-three { right: 15px; bottom: 8px; }
.source-hub { top: 102px; left: 205px; display: grid; grid-template-columns: auto 1fr; padding: 13px 18px 13px 13px; background: white; color: var(--ink); }
.source-hub .brand-mark { grid-row: 1 / 3; }
.source-hub strong { align-self: end; font-size: 13px; }
.source-hub small { align-self: start; color: var(--muted); }
.orbit-lines { position: absolute; inset: 0; z-index: 1; overflow: visible; }
.orbit-lines path { fill: none; stroke: rgba(116,220,192,.37); stroke-width: 1.5; stroke-dasharray: 5 5; }
.auth-trust { display: flex; gap: 19px; align-items: center; color: #97b0ba; font-size: 11px; }
.auth-trust span { color: var(--mint); }
.auth-form-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px; background: #fbfcfc; }
.auth-form-card { width: 100%; max-width: 410px; }
.mobile-brand { display: none; }
.auth-heading { margin-bottom: 34px; }
.welcome-icon { display: grid; place-items: center; width: 43px; height: 43px; margin-bottom: 20px; border-radius: 13px; background: var(--mint-soft); color: var(--mint-dark); font-size: 22px; font-weight: 700; }
.auth-heading h2 { margin: 0 0 9px; font: 800 32px/1.2 "Manrope"; letter-spacing: -1px; }
.auth-heading p { margin: 0; color: var(--muted); }
label { display: block; margin-bottom: 8px; color: #324753; font-size: 13px; font-weight: 600; }
.label-row { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; }
.label-row label { margin: 0 0 8px; }
.text-button { border: 0; padding: 0; color: var(--mint-dark); background: transparent; font-size: 12px; font-weight: 600; }
.input-shell { position: relative; display: flex; align-items: center; }
.input-shell input, .form-field input, .form-field select, .form-field textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid #dce3e6;
  border-radius: 11px;
  color: var(--ink);
  background: white;
  transition: border .2s, box-shadow .2s;
}
.input-shell input { padding: 0 44px; }
.input-shell input:focus, .form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--mint); box-shadow: 0 0 0 3px rgba(68,199,162,.12); }
.form-help { display: block; color: var(--muted); font-size: 11px; line-height: 1.5; }
[data-collection-mode="manual"] [data-payment-mode-fields="online"],
[data-collection-mode="online"] [data-payment-mode-fields="manual"] { display: none !important; }
.payment-link-workflow {
  padding: 14px;
  border: 1px solid #d7edf0;
  border-radius: 14px;
  background: #f4fbfc;
}
.payment-link-readonly {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px;
  border: 1px dashed #c7dde2;
  border-radius: 12px;
  background: #fff;
}
.payment-link-readonly a {
  color: var(--mint-dark);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.payment-link-copy {
  padding: 3px 8px;
  border: 1px solid #d8e5e8;
  border-radius: 999px;
  color: var(--navy);
  background: #fff;
}
.payment-link-copy:hover { background: var(--mint-soft); color: var(--mint-dark); }
.payment-link-checkbox { margin: 12px 0 0; }
.input-icon { position: absolute; left: 15px; z-index: 1; color: #91a0a9; }
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
}
.icon-button:hover { color: var(--ink); background: #f0f3f3; }
.password-toggle { position: absolute; right: 5px; }
.checkbox-row { display: flex; align-items: center; gap: 9px; margin: 17px 0 22px; color: var(--muted); font-weight: 400; }
.checkbox-row input { width: 16px; height: 16px; accent-color: var(--mint-dark); }
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 17px;
  border: 0;
  border-radius: 12px;
  color: white;
  background: linear-gradient(135deg, var(--navy), #1d4f75);
  box-shadow: 0 12px 24px rgba(19, 43, 71, .18);
  font-size: 13px;
  font-weight: 700;
  transition: transform .2s, background .2s;
}
.primary-button:hover { transform: translateY(-1px); background: linear-gradient(135deg, #163756, #24638f); }
.primary-button--wide { width: 100%; min-height: 50px; background: var(--mint-dark); box-shadow: 0 10px 22px rgba(36,155,122,.2); font-size: 14px; }
.primary-button--wide:hover { background: #218c6f; }
.demo-note { padding: 11px; border-radius: 9px; color: #809099; background: #f0f4f3; text-align: center; font-size: 11px; }
.demo-note span { color: var(--mint-dark); font-weight: 700; }
.auth-footer { margin: 50px 0 -30px; color: #a0abb1; font-size: 11px; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  width: 246px;
  height: 100vh;
  max-height: 100vh;
  padding: 27px 19px 20px;
  border-right: 1px solid rgba(223, 232, 238, .78);
  background: rgba(255,255,255,.92);
  box-shadow: 14px 0 36px rgba(9,30,66,.045);
  backdrop-filter: blur(18px);
  overflow: hidden;
}
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 27px; }
.sidebar-close { display: none; }
.nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  padding-right: 2px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.nav-list::-webkit-scrollbar { width: 5px; }
.nav-list::-webkit-scrollbar-track { background: transparent; }
.nav-list::-webkit-scrollbar-thumb { border-radius: 99px; background: #d8e1e3; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 43px;
  padding: 0 12px;
  border: 0;
  border-radius: 13px;
  color: #647487;
  background: transparent;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
}
.nav-item:hover { color: var(--ink); background: #f3f7fb; }
.nav-item.active { color: var(--navy); background: linear-gradient(135deg, rgba(34,199,169,.14), rgba(79,125,243,.10)); box-shadow: inset 3px 0 0 var(--mint); }
.nav-item.active svg { color: var(--mint-dark); }
.nav-item svg { width: 18px; height: 18px; }
.nav-count { margin-left: auto; padding: 2px 7px; border-radius: 8px; color: var(--muted); background: #edf1f1; font-size: 10px; }
.nav-label { margin: 25px 12px 7px; color: #a4aeb4; font-size: 9px; letter-spacing: 1.5px; font-weight: 700; }
.sidebar-insight { margin-top: 14px; padding: 16px; border: 1px solid rgba(34,199,169,.14); border-radius: 16px; background: linear-gradient(135deg, #f3fbf8, #f5f8ff); }
.insight-spark { display: grid; place-items: center; width: 30px; height: 30px; margin-bottom: 11px; border-radius: 9px; color: #fff; background: var(--mint); }
.sidebar-insight strong { font-size: 12px; }
.sidebar-insight p { margin: 5px 0 12px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.sidebar-insight button { padding: 0; border: 0; color: var(--mint-dark); background: transparent; font-size: 11px; font-weight: 700; }
.sidebar-user { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 12px 4px 0; border-top: 1px solid var(--line); }
.sidebar-user > span:nth-child(2) { min-width: 0; flex: 1; }
.sidebar-user strong, .sidebar-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user strong { font-size: 11px; }
.sidebar-user small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.avatar { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 11px; color: white; background: var(--navy); font-size: 10px; font-weight: 700; }
.main-panel { min-height: 100vh; margin-left: 246px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  height: 76px;
  padding: 0 34px;
  border-bottom: 1px solid rgba(223, 232, 238, .76);
  background: rgba(248,251,254,.82);
  backdrop-filter: blur(18px);
}
.topbar-title { flex: 1; color: #98a4aa; font-size: 11px; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.global-search { display: flex; align-items: center; width: 245px; height: 39px; padding: 0 11px; border: 1px solid rgba(213,225,233,.9); border-radius: 13px; background: rgba(255,255,255,.82); box-shadow: 0 8px 24px rgba(9,30,66,.04); }
.global-search svg { width: 16px; color: #a1acb2; }
.global-search input { min-width: 0; flex: 1; border: 0; padding: 0 9px; background: transparent; font-size: 12px; }
kbd { padding: 3px 6px; border: 1px solid #dfe4e5; border-radius: 5px; color: #9aa5ab; background: white; font-family: inherit; font-size: 9px; }
.notification-button { position: relative; border: 1px solid var(--line); }
.notification-button #notification-dot { position: absolute; top: 8px; right: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--coral); }
.notification-wrap { position: relative; }
.notification-panel {
  position: absolute;
  top: calc(100% + 11px);
  right: 0;
  width: 360px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: white;
  box-shadow: 0 22px 55px rgba(18,53,71,.18);
}
.notification-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 17px; border-bottom: 1px solid var(--line); }
.notification-head strong, .notification-head span { display: block; }
.notification-head strong { font: 700 13px "Manrope"; }
.notification-head span { margin-top: 2px; color: var(--muted); font-size: 9px; }
.notification-list { max-height: 340px; overflow-y: auto; }
.notification-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 11px;
  width: 100%;
  padding: 14px 17px;
  border: 0;
  border-bottom: 1px solid #eff2f2;
  color: var(--ink);
  background: white;
  text-align: left;
}
.notification-item:hover { background: #f8faf9; }
.notification-item.unread { background: #f1faf7; }
.notification-item.unread > span:nth-child(2) { position: relative; }
.notification-item.unread > span:nth-child(2)::after { content: ""; position: absolute; top: 3px; right: 0; width: 6px; height: 6px; border-radius: 50%; background: var(--mint); }
.notification-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #edf5f8; color: #3d7b99; font-weight: 800; }
.notification-icon--mint { color: var(--mint-dark); background: var(--mint-soft); }
.notification-icon--gold { color: #a97917; background: #fff5d9; }
.notification-icon--purple { color: #7258bc; background: #f0edff; }
.notification-item strong, .notification-item small, .notification-item time { display: block; padding-right: 10px; }
.notification-item strong { margin: 1px 0 3px; font-size: 11px; }
.notification-item small { color: var(--muted); font-size: 9px; line-height: 1.4; }
.notification-item time { margin-top: 5px; color: #a0aab0; font-size: 8px; }

.notification-page-list {
  display: grid;
  gap: 10px;
  max-height: 62vh;
  overflow-y: auto;
  padding-right: 6px;
}

.notification-item--page {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.notification-item--page strong { font-size: 13px; }
.notification-item--page small { font-size: 11px; }
.logs-panel {
  margin-top: 16px;
  padding: 18px;
}
.logs-table td { vertical-align: top; }
.logs-table td strong,
.logs-table td small,
.logs-table code {
  display: block;
  max-width: 360px;
  overflow-wrap: anywhere;
}
.logs-table td small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}
.logs-table code {
  padding: 5px 7px;
  border-radius: 8px;
  color: #38505d;
  background: #f3f7f8;
  font-size: 10px;
}
.log-level {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
}
.log-level--critical,
.log-level--error { color: #b73848; background: rgba(255,92,111,.13); }
.log-level--warning { color: #8a5a00; background: rgba(255,193,7,.18); }
.log-level--info { color: #315fba; background: rgba(95,141,222,.14); }
.log-row--resolved { opacity: .58; }
.log-resolve-button { min-height: 32px; padding: 0 10px; font-size: 10px; }
.notification-footer { width: 100%; height: 39px; border: 0; color: var(--mint-dark); background: white; font-size: 10px; font-weight: 700; }
.notification-empty { margin: 0; padding: 35px; color: var(--muted); text-align: center; font-size: 11px; }
.menu-button { display: none; margin-right: 8px; }
.page-content { max-width: 1620px; margin: auto; padding: 34px 36px 64px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-head h1 { margin: 0 0 7px; font: 900 30px/1.12 "Manrope"; letter-spacing: -1.1px; }
.page-head p { margin: 0; color: var(--muted); font-size: 13px; }
.date-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; color: #5f717c; background: white; font-size: 11px; font-weight: 600; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.metric-card { position: relative; overflow: hidden; min-height: 144px; padding: 20px; border: 1px solid rgba(217,227,235,.92); border-radius: var(--radius); background: rgba(255,255,255,.92); box-shadow: var(--soft-shadow); }
.metric-card::after { content: ""; position: absolute; inset: auto -28px -36px auto; width: 110px; height: 110px; border-radius: 50%; background: rgba(34,199,169,.08); pointer-events: none; }
.metric-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; font-weight: 600; }
.metric-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--mint-dark); background: var(--mint-soft); }
.metric-icon--coral { color: #d76650; background: #fff0ec; }
.metric-icon--gold { color: #b78317; background: #fff7e4; }
.metric-icon--blue { color: #4c78bc; background: #eef4ff; }
.metric-value { display: flex; align-items: end; gap: 9px; margin-top: 20px; }
.metric-value strong { font: 800 28px/1 "Manrope"; letter-spacing: -1px; }
.trend { padding: 3px 6px; border-radius: 6px; color: var(--mint-dark); background: var(--mint-soft); font-size: 9px; font-weight: 700; }
.trend--down { color: #cb6653; background: #fff0ec; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, .8fr); gap: 16px; margin-top: 16px; }
.dashboard-grid--exec { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; }
.panel { border: 1px solid rgba(217,227,235,.92); border-radius: var(--radius); background: rgba(255,255,255,.94); box-shadow: var(--soft-shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 21px 14px; }
.panel-head h2 { margin: 0; font: 700 15px "Manrope"; }
.panel-head p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.panel-link { border: 0; color: var(--mint-dark); background: transparent; font-size: 10px; font-weight: 700; }
.chart-wrap { position: relative; height: 256px; padding: 14px 19px 19px; }
.chart-y { position: absolute; inset: 18px auto 36px 20px; display: flex; flex-direction: column; justify-content: space-between; color: #a0abb0; font-size: 9px; }
.line-chart { width: 100%; height: 195px; padding-left: 25px; overflow: visible; }
.line-chart .grid-line { stroke: #edf0f0; stroke-width: 1; }
.line-chart .area { fill: url(#areaGradient); }
.line-chart .line { fill: none; stroke: var(--mint); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.line-chart circle { fill: white; stroke: var(--mint); stroke-width: 3; }
.chart-x { display: flex; justify-content: space-between; padding: 5px 4px 0 31px; color: #a0abb0; font-size: 9px; }
.source-list { padding: 1px 20px 21px; }
.source-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; padding: 13px 0; border-bottom: 1px solid #eff1f1; }
.source-row:last-child { border: 0; }
.website-favicon { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 10px; color: white; background: var(--navy); font-size: 10px; font-weight: 800; }
.source-row strong { display: block; font-size: 11px; }
.source-row small { color: var(--muted); font-size: 9px; }
.source-bar { height: 4px; margin-top: 7px; overflow: hidden; border-radius: 5px; background: #edf1f1; }
.source-bar span { display: block; height: 100%; border-radius: 5px; background: var(--mint); }
.source-count { color: var(--muted); font-size: 10px; font-weight: 600; }
.exec-list { display: grid; gap: 0; padding: 0 20px 18px; }
.exec-list > div { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.exec-list > div:last-child { border-bottom: 0; }
.exec-list span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; }
.exec-list strong { color: var(--ink); font-size: 11px; white-space: nowrap; }
.brand-analytics-panel { margin: 18px 0; overflow: hidden; }
.brand-analytics-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0 20px 20px; }
.brand-analytics-card { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(135deg, #ffffff, #f8fbfb); }
.brand-analytics-head { display: flex; align-items: center; gap: 10px; min-width: 0; margin-bottom: 13px; }
.brand-analytics-head div { min-width: 0; }
.brand-analytics-head strong,
.brand-analytics-head small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-analytics-head strong { color: var(--ink); font: 900 13px/1.25 "Manrope"; }
.brand-analytics-head small { margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 800; }
.brand-analytics-money { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 11px; }
.brand-analytics-money span { min-width: 0; padding: 9px; border-radius: 12px; background: #f3f8f8; color: var(--muted); font-size: 9px; font-weight: 800; }
.brand-analytics-money strong { display: block; overflow: hidden; margin-top: 3px; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.recent-panel { margin-top: 16px; overflow: hidden; }

.profile-layout {
  display: grid;
  grid-template-columns: minmax(260px, .7fr) minmax(0, 1.3fr);
  gap: 16px;
}

.profile-card,
.profile-form-panel,
.profile-permissions {
  padding: 20px;
}

.profile-hero {
  display: flex;
  gap: 15px;
  align-items: center;
  margin-bottom: 18px;
}

.profile-avatar {
  width: 62px;
  height: 62px;
  font: 900 18px "Manrope";
  box-shadow: 0 12px 30px rgba(20, 62, 80, .12);
}

.profile-hero h2 {
  margin: 0;
  color: var(--ink);
  font: 900 22px/1.05 "Manrope";
  letter-spacing: -.04em;
}

.profile-hero p {
  margin: 5px 0 8px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.profile-form-panel {
  grid-row: span 2;
}

.profile-password-box {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(95, 141, 222, .22);
  border-radius: 18px;
  background: rgba(95, 141, 222, .06);
}

.profile-password-box h3 {
  margin: 0;
  color: var(--ink);
  font: 900 14px "Manrope";
}

.profile-password-box p {
  margin: 6px 0 14px;
  color: var(--muted);
  font-size: 11px;
}

.profile-permissions {
  align-self: start;
}

.table-tools { display: flex; align-items: center; gap: 9px; padding: 0 20px 15px; }
.table-search { display: flex; align-items: center; flex: 1; max-width: 330px; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; }
.table-search svg { width: 15px; color: #9ca8ae; }
.table-search input { min-width: 0; width: 100%; border: 0; padding-left: 8px; font-size: 11px; }
.filter-select { height: 38px; border: 1px solid var(--line); border-radius: 9px; padding: 0 30px 0 11px; color: #60717b; background: white; font-size: 10px; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 11px 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: #95a0a6; background: #fafbfb; text-align: left; font-size: 9px; letter-spacing: .4px; font-weight: 700; }
.data-table td { padding: 14px 20px; border-bottom: 1px solid rgba(255,255,255,.72); font-size: 11px; }
.data-table tbody tr { position: relative; transition: transform .18s, box-shadow .18s, filter .2s; }
.data-table tbody tr:hover { filter: saturate(1.1) brightness(.995); transform: translateY(-1px); box-shadow: 0 8px 22px rgba(15,41,54,.08); }
.lead-row td { background: inherit; }
.lead-row td:first-child { border-left: 6px solid transparent; }
.row-status-new { background: linear-gradient(90deg, #c7efff 0%, #ecfaff 55%, #ffffff 100%); }
.row-status-new td:first-child { border-left-color: #1599d6; }
.row-status-contacted { background: linear-gradient(90deg, #ffe59b 0%, #fff6d8 55%, #ffffff 100%); }
.row-status-contacted td:first-child { border-left-color: #d99a13; }
.row-status-qualified { background: linear-gradient(90deg, #bdf2df 0%, #e6fbf3 55%, #ffffff 100%); }
.row-status-qualified td:first-child { border-left-color: #19a879; }
.row-status-won { background: linear-gradient(90deg, #dacdff 0%, #f0ecff 55%, #ffffff 100%); }
.row-status-won td:first-child { border-left-color: #7156d9; }
.row-status-lost { background: linear-gradient(90deg, #ffc8bd 0%, #fff0ed 55%, #ffffff 100%); }
.row-status-lost td:first-child { border-left-color: #d55d46; }
.lead-cell { display: flex; align-items: center; gap: 10px; }
.lead-cell strong { display: block; margin-bottom: 2px; font-size: 11px; }
.lead-cell small { color: var(--muted); font-size: 9px; }
.lead-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.lead-account-button {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  color: #235aa8;
  background: #eef7ff;
  border-color: rgba(95, 141, 222, .32);
  font-size: 10px;
  font-weight: 900;
}
.lead-account-button:hover {
  color: #123f7d;
  background: #e1f0ff;
  border-color: rgba(49, 95, 186, .52);
}
.mini-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: var(--navy); background: #eaf1f3; font-size: 9px; font-weight: 700; }
.website-cell { display: inline-flex; align-items: center; gap: 7px; color: #536772; }
.website-dot { width: 7px; height: 7px; border-radius: 3px; background: var(--blue); }
.status-badge { display: inline-flex; padding: 5px 10px; border-radius: 999px; font-size: 9px; font-weight: 800; letter-spacing: .02em; box-shadow: inset 0 0 0 1px rgba(255,255,255,.55); }
.status-new { color: #075b82; background: #bdefff; }
.status-contacted { color: #775100; background: #ffe08a; }
.status-qualified { color: #086f50; background: #b6f0db; }
.status-won { color: #4b35a2; background: #d8ccff; }
.status-lost { color: #9b351f; background: #ffc7bb; }
.status-backlog { color: #475569; background: #e6edf5; }
.status-to-do { color: #2452a5; background: #d8e8ff; }
.status-in-progress { color: #7a4d00; background: #ffe2a8; }
.status-review { color: #5639b5; background: #e0d7ff; }
.status-blocked { color: #a72d1c; background: #ffd4cc; }
.status-completed { color: #0e684e; background: #c8f5e5; }
.status-cancelled { color: #7a2b1d; background: #ffd9d2; }
.assignee-select {
  width: 132px;
  height: 32px;
  border: 1px solid rgba(83,103,114,.16);
  border-radius: 9px;
  padding: 0 25px 0 9px;
  color: #334c59;
  background-color: rgba(255,255,255,.62);
  font-size: 10px;
  font-weight: 600;
}
.assignee-select:focus { border-color: var(--mint); box-shadow: 0 0 0 3px rgba(68,199,162,.12); }
.assignee-select.unassigned { color: #9a6d25; border-style: dashed; }
.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; }
.table-action { width: 30px; height: 30px; }
.empty-state { padding: 55px 20px !important; color: var(--muted); text-align: center; }
.empty-state strong { display: block; margin-bottom: 5px; color: var(--ink); }

.website-grid, .team-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.website-card, .team-card { padding: 20px; }
.website-card-head, .team-card-head { display: flex; align-items: center; justify-content: space-between; }
.website-card .website-favicon { width: 43px; height: 43px; font-size: 13px; }
.live-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 8px; color: var(--mint-dark); background: var(--mint-soft); font-size: 9px; font-weight: 700; }
.live-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--mint); }
.presence-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
}
.presence-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.presence-badge--online { color: #10664f; background: rgba(68,199,162,.18); }
.presence-badge--online::before { background: #19b989; box-shadow: 0 0 0 4px rgba(25,185,137,.13); }
.presence-badge--away { color: #8a5a00; background: rgba(255,193,7,.18); }
.presence-badge--away::before { background: #f5a400; }
.presence-badge--offline { color: #6f7f88; background: #eef2f4; }
.presence-badge--offline::before { background: #9aa9b0; }
.website-card h3, .team-card h3 { margin: 17px 0 3px; font: 700 14px "Manrope"; }
.website-card p, .team-card p { margin: 0; color: var(--muted); font-size: 10px; }
.website-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.website-stats span { color: var(--muted); font-size: 9px; }
.website-stats strong { display: block; margin-top: 4px; color: var(--ink); font: 700 16px "Manrope"; }

.email-shell {
  display: grid;
  grid-template-columns: 260px minmax(330px, 390px) minmax(0, 1fr);
  height: calc(100vh - 244px);
  min-height: 680px;
  padding: 0;
  overflow: hidden;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 18px 55px rgba(15,41,54,.08);
}

.email-command-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 12px 34px rgba(15,41,54,.07);
}

.email-command-left,
.email-command-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.email-command-actions { flex-wrap: wrap; justify-content: flex-end; }

.email-command-title {
  min-width: 0;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font: 900 12px "Manrope";
}

.email-command-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 6px 9px;
  border-radius: 999px;
  color: #506974;
  background: #eef4f6;
  font-size: 9px;
  font-weight: 900;
}

.email-command-pill::before {
  content: "";
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9db0b8;
}

.email-command-pill--syncing::before { background: #315fba; animation: pulseDot 1.1s ease-in-out infinite; }
.email-command-pill--success::before { background: var(--mint); }
.email-command-pill--error::before { background: var(--coral); }

.email-command-actions .primary-button,
.email-command-actions .secondary-button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 10px;
}

.email-command-primary {
  background: linear-gradient(135deg, #083447, #0f5d75);
  box-shadow: 0 12px 22px rgba(15, 41, 54, .16);
}

.email-sidebar {
  min-width: 0;
  max-height: 100%;
  padding: 14px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #f8fbfd, #ffffff);
  overflow: hidden auto;
  scrollbar-width: thin;
  scrollbar-color: #c8d5dc transparent;
}

.email-sidebar *,
.mailbox-card *,
.mailbox-detail-card * {
  box-sizing: border-box;
  max-width: 100%;
}

.mailbox-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  box-shadow: 0 8px 24px rgba(15,41,54,.05);
}

.mailbox-card strong {
  color: var(--ink);
  font-size: 11.5px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mailbox-card small { color: var(--muted); font-size: 9px; line-height: 1.45; }

.email-folders {
  display: grid;
  gap: 4px;
  margin-top: 12px;
}

.email-folders button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 0;
  border-radius: 11px;
  padding: 9px 10px;
  background: transparent;
  color: #516570;
  font: 800 10px "Manrope";
  cursor: pointer;
}

.email-folders button.active,
.email-folders button:hover {
  background: var(--navy);
  color: white;
}

.email-folders small {
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--coral);
  color: white;
  text-align: center;
}

.email-config-button,
.team-email-button { width: 100%; margin-top: 10px; justify-content: center; }

.email-switch-label {
  display: grid;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  margin-top: 12px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.email-switch-label select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 9px;
  color: var(--ink);
  background: white;
  font: 700 10px "Manrope";
  text-transform: none;
  letter-spacing: 0;
}

.email-switch-label--hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

.mailbox-switcher {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.mailbox-switcher-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.mailbox-switcher-head small {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #eaf1f5;
  color: #526977;
  letter-spacing: 0;
}

.mailbox-switcher-list {
  display: grid;
  gap: 7px;
  max-height: 230px;
  overflow: auto;
  padding-right: 2px;
}

.mailbox-switch-card {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 10px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease, transform .15s ease;
}

.mailbox-switch-card:hover {
  border-color: rgba(95, 141, 222, .45);
  background: #f7fbff;
  transform: translateY(-1px);
}

.mailbox-switch-card.active {
  border-color: rgba(49, 95, 186, .45);
  background: linear-gradient(135deg, rgba(95, 141, 222, .16), rgba(68, 199, 162, .10));
  box-shadow: inset 3px 0 0 #315fba, 0 8px 18px rgba(49,95,186,.10);
}

.mailbox-switch-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--mint));
  font: 900 10px "Manrope";
}

.mailbox-switch-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.mailbox-switch-copy strong,
.mailbox-switch-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mailbox-switch-copy strong {
  color: var(--ink);
  font-size: 10px;
  font-weight: 900;
}

.mailbox-switch-copy small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
}

.mailbox-switch-card b {
  min-width: 20px;
  padding: 3px 6px;
  border-radius: 999px;
  color: white;
  background: var(--coral);
  font-size: 8px;
  text-align: center;
}

.mailbox-switch-card i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #c8d5dc;
}

.mailbox-settings-button {
  width: 100%;
  margin-top: 8px;
  border: 1px solid rgba(95, 141, 222, .28);
  border-radius: 10px;
  padding: 7px 9px;
  color: #315fba;
  background: rgba(95, 141, 222, .08);
  font: 900 9px "Manrope";
  cursor: pointer;
}

.mailbox-settings-button:hover {
  background: rgba(95, 141, 222, .14);
}

.mailbox-manage-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.mailbox-manage-list button {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  color: #4c6170;
  background: white;
  font-size: 10px;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.mailbox-manage-list button:hover { border-color: var(--blue); color: var(--blue); }

.email-config-note {
  display: grid;
  gap: 4px;
  margin: 0 0 16px;
  padding: 13px 15px;
  border: 1px solid rgba(95, 141, 222, .22);
  border-radius: 16px;
  background: rgba(95, 141, 222, .08);
}

.email-config-note strong { color: var(--ink); font: 800 12px "Manrope"; }
.email-config-note span { color: #365060; font-size: 12px; font-weight: 800; }
.email-config-note small { color: var(--muted); font-size: 10px; line-height: 1.5; }

.email-list {
  min-width: 0;
  max-height: 100%;
  border-right: 1px solid var(--line);
  background: #f6f9fb;
  overflow: hidden auto;
  scrollbar-width: thin;
  scrollbar-color: #c8d5dc transparent;
}

.email-sidebar::-webkit-scrollbar,
.email-list::-webkit-scrollbar,
.email-reader::-webkit-scrollbar,
.email-body::-webkit-scrollbar,
.rich-editor::-webkit-scrollbar {
  width: 8px;
}

.email-sidebar::-webkit-scrollbar-track,
.email-list::-webkit-scrollbar-track,
.email-reader::-webkit-scrollbar-track,
.email-body::-webkit-scrollbar-track,
.rich-editor::-webkit-scrollbar-track {
  background: transparent;
}

.email-sidebar::-webkit-scrollbar-thumb,
.email-list::-webkit-scrollbar-thumb,
.email-reader::-webkit-scrollbar-thumb,
.email-body::-webkit-scrollbar-thumb,
.rich-editor::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: #c8d5dc;
  background-clip: padding-box;
}

.email-list-head {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 13px 14px 11px;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 253, 255, .94);
  backdrop-filter: blur(10px);
}

.email-list-head > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.email-list-head strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font: 900 15px/1.1 "Manrope";
}

.email-list-head strong small {
  min-width: 22px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #eaf1f5;
  color: #526977;
  font: 900 9px/1 "Manrope";
  text-align: center;
}

.email-sync-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 420px;
  min-width: 0;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.35;
}

.email-sync-status--syncing { color: #315fba; }
.email-sync-status--success { color: #178963; }
.email-sync-status--error { color: #bd3545; }

.email-refresh-button.is-loading {
  color: #315fba;
}

.email-item {
  position: relative;
  display: grid;
  grid-template-columns: 22px 36px minmax(0, 1fr) auto;
  gap: 9px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 12px 12px 12px 14px;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease, border-color .15s ease, transform .15s ease;
}

.email-select-box,
.email-select-all {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--slate);
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.email-select-box {
  align-self: start;
  justify-content: center;
  padding-top: 8px;
}

.email-select-box input,
.email-select-all input {
  width: 15px;
  height: 15px;
  accent-color: var(--mint);
  cursor: pointer;
}

.email-item:hover,
.email-item.active { background: #eef7ff; }

.email-item:hover { transform: translateX(1px); }

.email-item.active { box-shadow: inset 3px 0 0 var(--mint); }

.email-item.unread {
  border-bottom-color: rgba(49, 95, 186, .24);
  background: linear-gradient(90deg, rgba(95, 141, 222, .24), rgba(255, 255, 255, .98) 62%);
  box-shadow: inset 4px 0 0 #315fba;
}

.email-item.unread::after {
  content: "Unread";
  position: absolute;
  top: 9px;
  right: 12px;
  padding: 2px 7px;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, #315fba, #44c7a2);
  font: 900 7px/1.4 "Manrope";
  letter-spacing: .03em;
  text-transform: uppercase;
  pointer-events: none;
}

.email-item.unread:hover,
.email-item.unread.active {
  background: linear-gradient(90deg, rgba(95, 141, 222, .28), #eef7ff 62%);
}

.email-item.unread strong { color: #082f49; font-weight: 900; padding-right: 58px; }
.email-item.unread small { color: #244f77; font-weight: 800; }
.email-item.unread em { color: #315fba; font-weight: 800; }
.email-item:not(.unread) { opacity: .82; }
.email-item:not(.unread).active,
.email-item:not(.unread):hover { opacity: 1; }

.email-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--blue), var(--mint));
  color: white;
  font: 900 10px "Manrope";
}

.email-item:not(.unread) .email-avatar {
  background: #eef3f5;
  color: #6b7d86;
}

.email-item.unread .email-avatar {
  box-shadow: 0 8px 18px rgba(49, 95, 186, .24);
}

.email-item-main,
.email-item span:nth-child(3) {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.email-item strong,
.email-item small,
.email-item em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-item strong { position: relative; color: var(--ink); font-size: 11px; line-height: 1.25; }
.email-item small { color: #60737d; font-size: 9px; }
.email-item small b { margin-right: 4px; color: #8aa0ac; font-size: 8px; text-transform: uppercase; }
.email-item em { color: var(--muted); font-size: 9px; font-style: normal; line-height: 1.35; }
.email-item time { color: var(--muted); font-size: 8px; white-space: nowrap; font-weight: 800; }

.email-unread-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 999px;
  background: #315fba;
  box-shadow: 0 0 0 4px rgba(49,95,186,.12);
  vertical-align: 1px;
}

.email-item-side {
  display: grid;
  justify-items: end;
  align-content: start;
  gap: 7px;
}

.email-row-delete {
  border: 0;
  border-radius: 999px;
  padding: 4px 8px;
  color: #b73848;
  background: rgba(255, 92, 111, .10);
  font: 800 8px "Manrope";
  opacity: 0;
  cursor: pointer;
  transition: opacity .15s ease, background .15s ease;
}

.email-item:hover .email-row-delete,
.email-item.active .email-row-delete {
  opacity: 1;
}

.email-row-delete:hover {
  background: rgba(255, 92, 111, .18);
}

.danger-button {
  border-color: rgba(255, 92, 111, .32);
  color: #b73848;
  background: rgba(255, 92, 111, .08);
}

.danger-button:hover {
  background: rgba(255, 92, 111, .14);
}

.email-load-more {
  display: grid;
  place-items: center;
  padding: 14px;
}

.email-load-more .secondary-button {
  width: 100%;
  justify-content: center;
}

.email-reader {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: linear-gradient(180deg, #ffffff, #fbfdfd);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #c8d5dc transparent;
}

.email-reader-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
}

.email-reader-head > div { min-width: 0; }
.email-reader-folder {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef7ff;
  color: #315fba;
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.email-reader-head h2 { margin: 0 0 7px; color: var(--ink); font: 900 22px/1.18 "Manrope"; letter-spacing: -.025em; overflow-wrap: anywhere; }
.email-reader-actions { display: flex; align-items: flex-start; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.email-reader-actions .secondary-button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 10px;
}
.email-reader-actions .icon-button {
  width: 34px;
  height: 34px;
}

.email-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: #fbfdfd;
}

.email-meta--full {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.email-meta span {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #edf2f4;
  border-radius: 12px;
  background: white;
  color: #38505d;
  font-size: 10px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.email-meta span.is-empty {
  color: #9aabb4;
  background: #f8fbfc;
}

.email-meta b {
  display: block;
  margin-bottom: 4px;
  color: #8aa0ac;
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.email-meta strong { color: var(--coral); }

.email-body {
  flex: 0 0 auto;
  min-width: 0;
  min-height: 0;
  overflow: visible;
  overflow-wrap: anywhere;
  padding: 30px 40px 54px;
  color: #1d303b;
  font-size: 14px;
  line-height: 1.78;
  white-space: normal;
  scrollbar-width: thin;
  scrollbar-color: #c8d5dc transparent;
}

.email-body * {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.email-body > table:first-child,
.email-body > div:first-child,
.email-body > p:first-child {
  margin-top: 0;
}

.email-body p,
.email-body div {
  margin-block: .55em;
}

.email-body b,
.email-body strong {
  font-weight: 800;
}

.email-body h1,
.email-body h2,
.email-body h3,
.email-body h4,
.email-body h5,
.email-body h6 {
  margin: .85em 0 .45em;
  line-height: 1.25;
  color: inherit;
}

.email-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.email-body table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.email-body td,
.email-body th {
  max-width: 620px;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.email-body blockquote {
  margin: 14px 0;
  padding: 10px 14px;
  border-left: 3px solid #c8d5dc;
  color: #526977;
  background: #f8fbfc;
  border-radius: 0 12px 12px 0;
}

.email-thread {
  flex: 0 0 auto;
  margin: 0 24px 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff, #fbfdfd);
  overflow: hidden;
  box-shadow: 0 18px 38px rgba(15,41,54,.07);
}

.email-thread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: #f8fbfc;
}

.email-thread-head strong {
  color: var(--ink);
  font: 900 14px "Manrope";
}

.email-thread-head span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.email-thread-head-toggle {
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--navy);
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.email-thread-head-toggle:hover {
  border-color: rgba(68,199,162,.42);
  background: #eefbf7;
}

.email-thread.is-collapsed .email-thread-head {
  border-bottom: 0;
}

.email-thread-stack {
  display: grid;
}

.email-thread-card {
  border-bottom: 1px solid var(--line);
  background: white;
}

.email-thread-card:last-child {
  border-bottom: 0;
}

.email-thread-card.expanded {
  background: #ffffff;
  box-shadow: inset 4px 0 0 rgba(68, 199, 162, .85);
}

.email-thread-card-toggle {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  width: 100%;
  padding: 13px 16px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.email-thread-card-toggle:hover {
  background: #f5fafb;
}

.email-thread-chevron {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 8px;
  color: #267d68;
  background: rgba(68, 199, 162, .14);
  font: 900 15px/1 "Manrope";
}

.email-thread-summary {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.email-thread-summary strong,
.email-thread-summary small,
.email-thread-summary em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-thread-summary strong {
  color: var(--ink);
  font: 900 11px "Manrope";
}

.email-thread-summary small {
  color: #314a59;
  font-size: 10px;
  font-weight: 850;
}

.email-thread-summary em {
  color: #6a7f8a;
  font-size: 10px;
  font-style: normal;
  line-height: 1.35;
}

.email-thread-time {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.email-thread-expanded {
  display: grid;
  gap: 12px;
  padding: 0 16px 18px 54px;
}

.email-thread-card-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.email-thread-card-meta div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #edf2f4;
  border-radius: 12px;
  background: #fbfdfd;
}

.email-thread-card-meta b {
  display: block;
  margin-bottom: 3px;
  color: #8aa0ac;
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.email-thread-card-meta span {
  display: block;
  color: #273f4c;
  font-size: 10px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.email-thread-card-actions {
  display: flex;
  justify-content: flex-end;
}

.email-thread-card-actions .secondary-button {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 10px;
}

.email-thread-card-body.email-body {
  max-height: 420px;
  overflow: auto;
  padding: 18px 20px 22px;
  border: 1px solid #edf2f4;
  border-radius: 16px;
  background: #ffffff;
  color: #1f3440;
  font-size: 13px;
  line-height: 1.7;
  scrollbar-width: thin;
}

.mailbox-detail-card {
  display: grid;
  gap: 3px;
  min-width: 0;
  overflow: hidden;
  padding: 10px;
  margin: 8px 0;
  border: 1px solid rgba(21, 119, 146, .18);
  border-radius: 13px;
  background: linear-gradient(180deg, #f7fbfd, #f0f8f8);
}

.mailbox-detail-card strong {
  color: var(--ink);
  font-size: 10px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mailbox-detail-card small {
  color: var(--muted);
  font-size: 8.5px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.mailbox-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 8px 0 4px;
  padding: 7px 9px;
  border-radius: 11px;
  background: #eef7ff;
  color: #315fba;
  font-size: 9px;
  font-weight: 900;
}

.mailbox-stats b {
  color: var(--ink);
  font-size: 11px;
}

.rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  background: #f7fafb;
}

.rich-toolbar button,
.rich-toolbar label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--ink);
  font: 800 10px "Manrope";
  white-space: nowrap;
}

.rich-toolbar label {
  min-width: 0;
}

.rich-toolbar input[type="color"] {
  width: 28px;
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
}

.rich-toolbar select {
  max-width: 150px;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.rich-editor {
  width: 100%;
  max-width: 100%;
  min-height: 300px;
  max-height: 48vh;
  overflow: auto;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 0 0 14px 14px;
  background: white;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.7;
  outline: none;
  overflow-wrap: anywhere;
}

.rich-editor:focus {
  border-color: rgba(68, 199, 162, .75);
  box-shadow: 0 0 0 4px rgba(68, 199, 162, .12);
}

.rich-toolbar--quill.ql-toolbar.ql-snow {
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 16px 16px 0 0;
  background: #fbfdfc;
}

.rich-toolbar--quill .ql-formats { margin-right: 6px; }
.rich-toolbar--quill button,
.rich-toolbar--quill .ql-picker { border-radius: 8px; }

.rich-editor.ql-container.ql-snow {
  min-height: 320px;
  max-height: 52vh;
  padding: 0;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 16px 16px;
  background: white;
}

.rich-editor .ql-editor {
  min-height: 320px;
  max-height: 52vh;
  padding: 18px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.65;
}

.rich-editor .ql-editor.ql-blank::before {
  color: #9aa7ad;
  font-style: normal;
}

.email-body .ql-align-center { text-align: center; }
.email-body .ql-align-right { text-align: right; }
.email-body .ql-align-justify { text-align: justify; }
.email-body .ql-size-small { font-size: .75em; }
.email-body .ql-size-large { font-size: 1.35em; }
.email-body .ql-size-huge { font-size: 1.85em; }
.email-body .ql-font-serif { font-family: Georgia, "Times New Roman", serif; }
.email-body .ql-font-monospace { font-family: "Courier New", monospace; }

.rich-editor blockquote,
.email-body blockquote {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-left: 3px solid var(--blue);
  border-radius: 10px;
  background: #f5f8fa;
  color: #60737d;
}

.email-empty {
  padding: 28px;
  color: var(--muted);
  font-size: 12px;
}

.email-empty strong { display: block; color: var(--ink); font: 800 15px "Manrope"; margin-bottom: 6px; }
.email-empty--reader { margin: auto; text-align: center; }

.roles-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.role-card { padding: 20px; }
.role-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.role-card h3 { margin: 0 0 5px; color: var(--ink); font: 800 16px "Manrope"; }
.role-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }

.permission-list {
  display: grid;
  gap: 7px;
  margin: 18px 0;
}

.permission-list span {
  padding: 8px 10px;
  border-radius: 10px;
  color: #89979f;
  background: #f5f7f8;
  font-size: 10px;
  font-weight: 700;
}

.permission-list span.allowed {
  color: #176f58;
  background: rgba(68, 199, 162, .14);
}

.role-users {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 11px;
}

.role-users strong { color: var(--ink); font: 800 20px "Manrope"; }

.permission-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfdff;
}

.permission-option {
  position: relative;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 12px;
  background: white;
  color: #516570;
  cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease, color .15s ease;
}

.permission-option:hover {
  background: #f7fbff;
  box-shadow: inset 0 0 0 1px rgba(95, 141, 222, .18);
}

.permission-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.permission-check {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1.5px solid #b8c4ca;
  border-radius: 6px;
  background: #fff;
  box-shadow: inset 0 0 0 2px #fff;
}

.permission-check::after {
  content: "";
  width: 8px;
  height: 4px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
  opacity: 0;
}

.permission-option input:checked + .permission-check {
  border-color: #1677ff;
  background: #1677ff;
}

.permission-option input:checked + .permission-check::after {
  opacity: 1;
}

.permission-label {
  min-width: 0;
  color: #304b5b;
  font-size: 10px;
  font-weight: 850;
  line-height: 1.25;
}

#modal[data-variant="role"] .modal-card {
  width: min(820px, 100%);
  border-radius: 24px;
}

#modal[data-variant="role"] .modal-form {
  padding: 20px 25px 0;
}

#modal[data-variant="role"] .permission-picker {
  max-height: min(48vh, 440px);
  overflow-y: auto;
  padding: 12px;
}

#modal[data-variant="role"] .modal-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin: 16px -25px 0;
  padding: 14px 25px;
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
}
.team-card-head .avatar { width: 43px; height: 43px; }
.role-badge { padding: 4px 8px; border-radius: 8px; color: #536772; background: #f0f3f3; font-size: 9px; font-weight: 700; }
.team-meta { display: flex; align-items: center; gap: 14px; margin-top: 17px; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.team-meta span { display: flex; align-items: center; gap: 5px; }
.team-meta svg { width: 13px; }
.settings-stack { display: grid; gap: 16px; max-width: 820px; }
.settings-panel { padding: 24px; }
.settings-panel h2 { margin: 0 0 5px; font: 700 15px "Manrope"; }
.settings-panel > p { margin: 0 0 20px; color: var(--muted); font-size: 11px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 0; border-top: 1px solid var(--line); }
.settings-row strong { display: block; font-size: 11px; }
.settings-row small { color: var(--muted); font-size: 9px; }
.integration-card { display: grid; gap: 12px; border-top: 1px solid var(--line); padding-top: 15px; }
.integration-card div { display: grid; gap: 6px; }
.integration-card strong { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.integration-card code { display: block; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #f7faf9; padding: 11px 12px; color: var(--ink); font-size: 11px; }
.switch { position: relative; width: 40px; height: 23px; border: 0; border-radius: 20px; background: #dfe5e6; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: white; box-shadow: 0 2px 5px rgba(0,0,0,.15); transition: left .2s; }
.switch.on { background: var(--mint); }
.switch.on::after { left: 20px; }

.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 22px; pointer-events: auto; }
.modal-backdrop { position: absolute; inset: 0; z-index: 0; border: 0; background: rgba(9,30,40,.55); backdrop-filter: blur(5px); }
.modal-card { position: relative; z-index: 2; width: min(540px, 100%); max-height: calc(100vh - 44px); overflow: auto; border-radius: 20px; background: white; box-shadow: 0 30px 80px rgba(6,28,39,.28); animation: modalIn .25s ease; pointer-events: auto; }
#modal[data-variant="lead"] .modal-card { width: min(900px, 100%); border-radius: 26px; }
#modal[data-variant="email-compose"] .modal-card { width: min(920px, 100%); border-radius: 24px; }
#modal[data-variant="email-signatures"] .modal-card { width: min(720px, 100%); border-radius: 22px; }
#modal[data-variant="email-signatures"] textarea {
  width: 100%;
  min-height: 120px;
  line-height: 1.6;
  resize: vertical;
}

.signature-editor-list {
  display: grid;
  gap: 12px;
}

.signature-editor-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfdfd;
}

.signature-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.signature-editor-head strong {
  color: var(--ink);
  font: 800 13px "Manrope";
}

.signature-add-button {
  width: 100%;
  justify-content: center;
  margin-top: 12px;
}
#modal[data-variant="email-compose"] .modal-head { padding: 19px 24px 14px; }
#modal[data-variant="email-compose"] .modal-head h2 { font-size: 19px; }
#modal[data-variant="email-compose"] .modal-form { padding: 16px 24px 22px; }
#modal[data-variant="email-compose"] .form-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px 13px;
}
#modal[data-variant="email-compose"] .form-field {
  min-width: 0;
  margin-bottom: 6px;
}
#modal[data-variant="email-compose"] .form-field input,
#modal[data-variant="email-compose"] .form-field select {
  width: 100%;
  min-width: 0;
  height: 40px;
}
#modal[data-variant="email-compose"] .form-field--full { grid-column: 1 / -1; }

.compose-from-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) minmax(260px, 360px);
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid rgba(95,141,222,.24);
  border-radius: 16px;
  background: linear-gradient(135deg, #f7fbff, #ffffff);
}

.compose-from-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--mint));
  font: 900 13px "Manrope";
}

.compose-from-card strong,
.compose-from-card small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compose-from-card strong { color: var(--ink); font: 900 12px "Manrope"; }
.compose-from-card small { margin-top: 3px; color: var(--muted); font-size: 9px; }

#modal[data-variant="email-compose"] .modal-actions {
  position: sticky;
  bottom: -24px;
  z-index: 3;
  margin: 13px -24px -22px;
  padding: 13px 24px;
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes pulseDot { 0%, 100% { transform: scale(1); opacity: .75; } 50% { transform: scale(1.35); opacity: 1; } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 24px 25px 19px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0 0 5px; font: 800 19px "Manrope"; }
.modal-head p { margin: 0; color: var(--muted); font-size: 10px; }
.modal-form { padding: 21px 25px 25px; }
.lead-detail-modal { background: #fff; }
.lead-detail-hero { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 28px 30px; border-bottom: 1px solid rgba(15,41,54,.08); }
.lead-detail-identity { display: flex; align-items: center; gap: 17px; min-width: 0; }
.lead-detail-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 64px; height: 64px; border-radius: 22px; color: #0f2936; background: rgba(255,255,255,.55); border: 1px solid rgba(255,255,255,.75); font: 800 17px "Manrope"; box-shadow: 0 14px 32px rgba(15,41,54,.12); }
.lead-detail-identity small { display: block; margin-bottom: 5px; color: #51666f; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.lead-detail-identity h2 { margin: 0; color: #102b38; font: 800 30px/1.05 "Manrope"; }
.lead-detail-identity p { margin: 8px 0 0; color: #405660; font-size: 13px; }
.lead-detail-close { flex: 0 0 auto; background: rgba(255,255,255,.58); border: 1px solid rgba(255,255,255,.7); }
.lead-detail-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 18px 25px 0; }
.lead-detail-summary article { min-width: 0; padding: 14px 15px; border: 1px solid var(--line); border-radius: 16px; background: #fbfdfc; }
.lead-detail-summary span, .lead-detail-summary small { display: block; color: var(--muted); font-size: 9px; }
.lead-detail-summary article > span { margin-bottom: 7px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.lead-detail-summary strong { display: block; overflow: hidden; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.lead-detail-summary small { margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-detail-form { padding-top: 18px; }
.lead-detail-form .form-grid { gap: 16px 18px; }
.lead-detail-form .form-field label { font-size: 11px; font-weight: 800; }
.lead-detail-form .form-field input,
.lead-detail-form .form-field select { height: 46px; font-size: 13px; }
.lead-detail-form .form-field textarea { min-height: 128px; font-size: 13px; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-field { margin-bottom: 15px; }
.form-field input, .form-field select, .form-field textarea { padding: 0 13px; font-size: 12px; }
.form-field textarea { min-height: 90px; padding-top: 12px; resize: vertical; }
.form-field--full { grid-column: 1 / -1; }
.form-error-message {
  margin: 4px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 122, 106, .35);
  border-radius: 14px;
  color: #a93528;
  background: #fff1ef;
  font-size: 12px;
  font-weight: 800;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 5px; }
.secondary-button { min-height: 42px; padding: 0 16px; border: 1px solid var(--line); border-radius: 10px; color: #5f717a; background: white; font-size: 12px; font-weight: 600; }
.secondary-button:hover { background: #f7f9f8; }
.toast-region { position: fixed; top: 18px; right: 18px; z-index: 200; display: grid; gap: 8px; }
.toast { min-width: 270px; padding: 13px 15px; border: 1px solid #dfe9e5; border-radius: 12px; color: #29433e; background: white; box-shadow: var(--shadow); font-size: 11px; animation: toastIn .3s ease; }
.toast strong { display: block; margin-bottom: 2px; color: var(--ink); font-size: 12px; }
@keyframes toastIn { from { opacity: 0; transform: translateX(12px); } }
.lead-live-alert {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  width: min(430px, calc(100vw - 36px));
  border: 0;
  border-radius: 20px;
  padding: 15px;
  color: white;
  text-align: left;
  background: linear-gradient(135deg, #12b886 0%, #1594d6 48%, #7755dd 100%);
  box-shadow: 0 22px 55px rgba(21,148,214,.32), 0 8px 18px rgba(18,184,134,.18);
  animation: liveAlertIn .35s cubic-bezier(.2,.9,.2,1), liveAlertPulse 1.4s ease-in-out infinite;
}
.lead-live-alert__spark { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 16px; color: #123; background: #fff; font-size: 22px; box-shadow: 0 10px 20px rgba(0,0,0,.15); }
.lead-live-alert__copy { min-width: 0; }
.lead-live-alert__copy strong,
.lead-live-alert__copy span,
.lead-live-alert__copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-live-alert__copy strong { font: 800 15px "Manrope"; }
.lead-live-alert__copy span { margin-top: 3px; font-size: 12px; font-weight: 700; }
.lead-live-alert__copy small { margin-top: 4px; color: rgba(255,255,255,.82); font-size: 10px; }
.lead-live-alert__action { padding: 8px 10px; border-radius: 999px; color: #173342; background: rgba(255,255,255,.9); font-size: 10px; font-weight: 800; }
.email-live-alert {
  width: min(520px, calc(100vw - 36px));
  background: linear-gradient(135deg, #0f4c81 0%, #2563eb 48%, #8b5cf6 100%);
  box-shadow: 0 22px 55px rgba(37,99,235,.34), 0 8px 18px rgba(139,92,246,.2);
}
.email-live-alert__spark { color: #16416c; }
@keyframes liveAlertIn { from { opacity: 0; transform: translateX(18px) scale(.96); } }
@keyframes liveAlertPulse { 0%, 100% { filter: saturate(1); } 50% { filter: saturate(1.25) brightness(1.04); } }
.sidebar-scrim { display: none; }

svg.icon { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 1100px) {
  .profile-layout { grid-template-columns: 1fr; }
  .profile-form-panel { grid-row: auto; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .website-grid, .team-grid, .roles-grid { grid-template-columns: repeat(2, 1fr); }
  .email-shell {
    grid-template-columns: 230px minmax(280px, 340px) minmax(0, 1fr);
    height: calc(100vh - 160px);
  }
  .auth-brand { padding: 40px 5vw; }
  .auth-copy h1 { font-size: 48px; }
  .source-preview { transform: scale(.82); transform-origin: left center; }
}
@media (max-width: 850px) {
  .auth-screen { display: block; background: #fbfcfc; }
  .auth-brand { display: none; }
  .auth-form-wrap { min-height: 100vh; padding: 30px 24px; }
  .mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 70px; font: 800 19px "Manrope"; }
  .auth-footer { margin-bottom: 0; }
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: grid; }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 25; border: 0; background: rgba(9,30,40,.35); }
  .sidebar-scrim.open { display: block; }
  .main-panel { margin-left: 0; }
  .menu-button { display: grid; }
  .global-search { display: none; }
  .dashboard-grid, .dashboard-grid--exec { grid-template-columns: 1fr; }
  .brand-analytics-list { grid-template-columns: 1fr; }
  .email-command-bar { align-items: stretch; flex-direction: column; }
  .email-command-left,
  .email-command-actions { justify-content: space-between; }
  .email-shell { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .email-sidebar, .email-list { border-right: 0; border-bottom: 1px solid var(--line); }
  .email-folders { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .email-list { max-height: 360px; }
  .email-reader { min-height: 520px; }
  #modal[data-variant="email-compose"] .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .topbar { height: 68px; padding: 0 17px; }
  .topbar-title { display: none; }
  .topbar-actions { margin-left: auto; }
  .notification-panel { position: fixed; top: 62px; right: 10px; left: 10px; width: auto; }
  .page-content { padding: 24px 17px 50px; }
  .page-head { align-items: flex-start; }
  .page-head h1 { font-size: 22px; }
  .date-chip { display: none; }
  .metrics-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 124px; }
  .website-grid, .team-grid, .roles-grid { grid-template-columns: 1fr; }
  .table-tools { flex-wrap: wrap; }
  .table-search { max-width: none; flex-basis: 100%; }
  .data-table th:nth-child(2), .data-table td:nth-child(2), .data-table th:nth-child(4), .data-table td:nth-child(4), .data-table th:nth-child(6), .data-table td:nth-child(6) { display: none; }
  .data-table th, .data-table td { padding-left: 13px; padding-right: 13px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-field--full { grid-column: auto; }
  .modal { padding: 10px; }
  .lead-detail-hero { align-items: flex-start; padding: 22px; }
  .lead-detail-identity { align-items: flex-start; }
  .lead-detail-avatar { width: 54px; height: 54px; border-radius: 18px; }
  .lead-detail-identity h2 { font-size: 23px; }
  .lead-detail-summary { grid-template-columns: 1fr; padding: 14px 16px 0; }
  .lead-detail-form { padding-left: 16px; padding-right: 16px; }
  .lead-live-alert { grid-template-columns: auto 1fr; }
  .lead-live-alert__action { grid-column: 1 / -1; text-align: center; }
  .email-folders { grid-template-columns: repeat(2, 1fr); }
  .email-command-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .email-command-actions .primary-button,
  .email-command-actions .secondary-button { width: 100%; justify-content: center; }
  .email-item { grid-template-columns: 32px 1fr; }
  .email-select-box { grid-row: 1 / span 2; }
  .email-item { grid-template-columns: 22px 32px 1fr; }
  .email-item-side { grid-column: 3; justify-items: start; grid-auto-flow: column; justify-content: space-between; }
  .email-bulk-bar { align-items: stretch; flex-direction: column; }
  .email-bulk-bar > div { justify-content: flex-start; }
  .email-meta--full { grid-template-columns: 1fr; }
  .email-row-delete { opacity: 1; }
  .email-reader-head, .email-meta { display: grid; }
  .email-meta { grid-template-columns: 1fr; }
  .email-reader-actions { align-items: stretch; }
  .email-reader-actions .secondary-button,
  .email-reader-actions .icon-button { width: 100%; justify-content: center; }
  .email-body { padding: 22px 18px 38px; }
  .email-thread { margin: 0 14px 22px; }
  .email-thread-card-toggle { grid-template-columns: 24px minmax(0, 1fr); }
  .email-thread-time { grid-column: 2; white-space: normal; }
  .email-thread-expanded { padding: 0 12px 14px 36px; }
  .email-thread-card-meta { grid-template-columns: 1fr; }
  .email-thread-card-body.email-body { padding: 14px; }
  #modal[data-variant="email-compose"] .modal-form { padding: 14px; }
  #modal[data-variant="email-compose"] .modal-actions {
    margin: 12px -14px -14px;
    padding: 12px 14px;
    display: grid;
    grid-template-columns: 1fr;
  }
  .compose-from-card { grid-template-columns: 36px minmax(0, 1fr); }
  .compose-from-card select { grid-column: 1 / -1; }
  .compose-from-avatar { width: 36px; height: 36px; border-radius: 12px; }
  .rich-toolbar { gap: 6px; padding: 8px; }
  .rich-toolbar button,
  .rich-toolbar label { flex: 1 1 auto; min-width: 74px; }
  .rich-editor { min-height: 220px; max-height: 42vh; }
  .permission-picker { grid-template-columns: 1fr; }
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 18px;
}

.account-card {
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}

.account-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.account-card-top,
.account-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.account-card h3 {
  margin: 18px 0 6px;
  font: 800 20px/1.2 "Manrope";
  color: var(--ink);
}

.account-brand-chip {
  display: inline-flex;
  width: fit-content;
  margin-top: 14px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfdfd;
  font-size: 12px;
  font-weight: 800;
}

.account-card p {
  margin: 0 0 18px;
  color: var(--muted);
}

.account-money-row,
.account-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.account-money-row span,
.account-meta-grid small {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfdfd;
  color: var(--muted);
  font-size: 12px;
}

.account-money-row strong,
.account-meta-grid strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 14px;
}

.account-progress {
  height: 9px;
  margin: 16px 0;
  border-radius: 999px;
  background: #eef4f5;
  overflow: hidden;
}

.account-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #44c7a2, #5f8dde);
}

.account-stage-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0;
}

.account-stage-row span,
.account-stage-row strong {
  padding: 7px 10px;
  border-radius: 999px;
  background: #eef7fb;
  color: var(--ink);
  font-size: 12px;
}

.account-actions {
  margin-top: 16px;
  justify-content: flex-end;
}

.account-detail {
  padding: 0 24px 24px;
}

.account-workspace {
  overflow: hidden;
}

.account-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid #eef2f2;
}

.account-toolbar h2 {
  margin: 0;
  font: 800 17px/1.15 "Manrope";
  letter-spacing: -.02em;
  color: var(--ink);
}

.account-toolbar p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.account-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.account-count-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfdfd;
  color: #536772;
  font-size: 10px;
  font-weight: 800;
}

.account-filter-bar {
  display: grid;
  grid-template-columns: minmax(230px, 1.4fr) repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
  padding: 14px 20px;
  border-bottom: 1px solid #eef2f2;
  background: #fbfdfd;
}

.account-filter-bar .table-search {
  max-width: none;
  background: white;
}

.account-filter-bar .filter-select {
  min-width: 130px;
  background: white;
}

.account-list-shell {
  max-height: min(68vh, 760px);
  overflow: auto;
  background:
    linear-gradient(90deg, white 30%, rgba(255,255,255,0)) left / 18px 100% local,
    linear-gradient(270deg, white 30%, rgba(255,255,255,0)) right / 18px 100% local,
    #fff;
}

.account-table {
  width: 100%;
  min-width: 860px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.account-table th:nth-child(1) { width: 27%; }
.account-table th:nth-child(2) { width: 14%; }
.account-table th:nth-child(3) { width: 13%; }
.account-table th:nth-child(4) { width: 19%; }
.account-table th:nth-child(5) { width: 14%; }
.account-table th:nth-child(6) { width: 10%; }
.account-table th:nth-child(7) { width: 155px; }

.account-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #f8fbfb;
  color: #87949a;
  text-align: left;
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 900;
}

.account-table th:last-child {
  position: sticky;
  right: 0;
  z-index: 3;
  background: #f8fbfb;
  box-shadow: -10px 0 18px rgba(248,251,251,.92);
}

.account-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #edf1f1;
  vertical-align: middle;
  font-size: 11px;
}

.account-row {
  cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease;
}

.account-row:hover td {
  background: #f8fcfc;
}

.account-main-cell {
  min-width: 0;
  max-width: 310px;
}

.account-code-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.account-code-line span {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 8px;
  background: #eef4ff;
  color: #4c78bc;
  font-size: 9px;
  font-weight: 900;
}

.account-code-line strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font: 800 13px/1.25 "Manrope";
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-main-cell small,
.account-payment-cell small,
.account-team-cell small,
.account-date-cell small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.account-brand-inline {
  max-width: 155px;
  font-size: 10px;
  font-weight: 800;
}

.account-brand-inline span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-stage-stack,
.account-team-cell,
.account-date-cell {
  display: grid;
  gap: 4px;
}

.account-stage-stack span {
  width: fit-content;
  min-width: 88px;
  padding: 8px 12px;
  border-radius: 12px;
  background: #eef7fb;
  color: #2e5969;
  text-align: center;
  font-size: 12px;
  font-weight: 900;
}

.account-stage-stack strong {
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
}

.account-followup-button {
  width: fit-content;
  margin-top: 2px;
  padding: 0;
  font-size: 10px;
  font-weight: 900;
}

.account-stage-stack strong.priority-low { background: #eef4f1; color: #557066; }
.account-stage-stack strong.priority-normal { background: #eef4ff; color: #4c78bc; }
.account-stage-stack strong.priority-high { background: #fff4dc; color: #9c6500; }
.account-stage-stack strong.priority-urgent { background: #ffe8e3; color: #b33824; }

.account-payment-cell {
  min-width: 175px;
}

.account-payment-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.account-payment-top strong {
  color: var(--ink);
  font-size: 12px;
  white-space: nowrap;
}

.account-progress--table {
  height: 6px;
  margin: 8px 0 0;
}

.account-team-cell strong,
.account-date-cell strong {
  color: var(--ink);
  font-size: 11px;
}

.account-row-actions {
  position: sticky;
  right: 0;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  background: white;
  box-shadow: -10px 0 18px rgba(255,255,255,.9);
  white-space: nowrap;
}

.account-row:hover .account-row-actions {
  background: #f8fcfc;
}

.account-row-actions .secondary-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 10px;
}

.account-row-actions .icon-button {
  width: 32px;
  height: 32px;
}

.account-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid #eef2f2;
  background: #fbfdfd;
}

.account-pagination span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.account-pagination div {
  display: flex;
  gap: 8px;
}

.account-pagination button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.account-screen-card,
.account-inline-form {
  overflow: hidden;
  margin-top: 16px;
}

.lead-conversion-banner {
  display: grid;
  gap: 4px;
  margin: 16px 20px 0;
  padding: 14px 16px;
  border: 1px solid rgba(68, 199, 162, .28);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(68, 199, 162, .14), rgba(95, 141, 222, .10));
}

.lead-conversion-banner span {
  color: #087758;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.lead-conversion-banner strong {
  color: var(--ink);
  font: 900 15px/1.25 "Manrope";
}

.lead-conversion-banner small {
  color: #526977;
  font-size: 11px;
}

.account-screen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #eef2f2;
}

.account-screen-head h2 {
  margin: 0;
  color: var(--ink);
  font: 800 17px/1.2 "Manrope";
}

.account-screen-head h3 {
  margin: 0;
}

.account-screen-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.account-screen-form {
  padding: 20px;
}

.account-form-section {
  padding: 18px 0;
  border-bottom: 1px solid #eef2f2;
}

.account-form-section:first-child {
  padding-top: 0;
}

.account-form-section:last-of-type {
  border-bottom: 0;
}

.account-form-section h3 {
  margin: 0 0 12px;
  color: var(--ink);
  font: 800 14px/1.2 "Manrope";
}

.account-screen-actions {
  position: sticky;
  bottom: 0;
  z-index: 4;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 18px -20px -20px;
  padding: 14px 20px;
  border-top: 1px solid #eef2f2;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
}

.account-detail-screen {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.account-detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  padding: 22px;
  align-items: stretch;
}

.account-detail-hero h2 {
  margin: 12px 0 8px;
  color: var(--ink);
  font: 900 28px/1.05 "Manrope";
  letter-spacing: -.04em;
}

.account-detail-hero p {
  max-width: 820px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.account-contract-card {
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
  border: 1px solid #dcebea;
  border-radius: 20px;
  background: linear-gradient(135deg, #f3fbf9, #ffffff);
}

.account-contract-card span,
.account-contract-card small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.account-contract-card strong {
  color: var(--ink);
  font: 900 30px/1 "Manrope";
  letter-spacing: -.04em;
}

.account-stage-path {
  display: flex;
  gap: 4px;
  padding: 6px;
  border: 1px solid #dde9e9;
  border-radius: 18px;
  background: white;
  overflow-x: auto;
}

.account-stage-path button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 14px;
  background: #f3f7f7;
  color: #60717b;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
}

.account-stage-path button span {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: white;
  color: inherit;
  font-size: 9px;
}

.account-stage-path button.done {
  background: #e5f8f1;
  color: #18724f;
}

.account-stage-path button.active {
  background: var(--navy);
  color: white;
  box-shadow: 0 10px 24px rgba(13, 58, 75, .18);
}

.account-stage-path button:disabled {
  cursor: default;
}

.account-record-tabs {
  display: flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid #e4eeee;
  border-radius: 18px;
  background: #fbfdfd;
  overflow-x: auto;
}

.account-record-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: #60717b;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
}

.account-record-tabs button span {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e9f0f1;
  color: #536772;
  font-size: 9px;
}

.account-record-tabs button.active {
  background: white;
  color: var(--navy);
  box-shadow: 0 8px 20px rgba(15, 41, 54, .08);
}

.account-tab-panel {
  display: grid;
  gap: 16px;
}

.account-summary-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.25fr) repeat(3, minmax(180px, 1fr));
  gap: 12px;
  padding: 18px 20px 0;
}

.account-next-action-card,
.account-summary-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.045);
}

.account-next-action-card {
  display: grid;
  gap: 10px;
  color: var(--ink);
}

.account-next-action-card span,
.account-summary-card span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.account-next-action-card h3 {
  margin: 0;
  color: var(--ink);
  font: 900 18px/1.15 "Manrope";
  letter-spacing: -0.03em;
}

.account-next-action-card p {
  margin: 0;
  color: var(--slate);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.account-next-action-card.tone-mint {
  background: linear-gradient(135deg, rgba(79, 208, 163, 0.18), #fff 60%);
  border-color: rgba(79, 208, 163, 0.34);
}

.account-next-action-card.tone-blue {
  background: linear-gradient(135deg, rgba(95, 141, 222, 0.16), #fff 60%);
  border-color: rgba(95, 141, 222, 0.32);
}

.account-next-action-card.tone-gold {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.17), #fff 60%);
  border-color: rgba(245, 158, 11, 0.30);
}

.account-next-action-card.tone-coral {
  background: linear-gradient(135deg, rgba(255, 122, 103, 0.16), #fff 60%);
  border-color: rgba(255, 122, 103, 0.32);
}

.account-summary-card {
  display: grid;
  gap: 7px;
}

.account-summary-card strong {
  overflow: hidden;
  color: var(--ink);
  font: 900 15px/1.2 "Manrope";
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-summary-card small,
.account-summary-card em {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.35;
  text-overflow: ellipsis;
}

.account-overview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 20px 0;
}

.account-archived-note {
  margin: 14px 20px 0;
  padding: 11px 13px;
  border: 1px solid rgba(255, 122, 103, 0.28);
  border-radius: 14px;
  background: rgba(255, 122, 103, 0.10);
  color: #9f341f;
  font-size: 12px;
  font-weight: 900;
}

.account-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, .85fr);
  gap: 16px;
}

.account-detail-main,
.account-side-panel {
  overflow: hidden;
}

.account-phase-list {
  display: grid;
  gap: 10px;
  padding: 16px 20px 20px;
}

.account-phase-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 14px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfdfd;
}

.account-phase-card h3 {
  margin: 9px 0 5px;
  color: var(--ink);
  font: 800 15px/1.2 "Manrope";
}

.account-phase-card p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.account-impact {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 7px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.account-phase-card a,
.account-phase-card small {
  color: var(--mint-dark);
  font-size: 11px;
  font-weight: 800;
}

.payment-link-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.payment-link-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #eef2f7;
  color: #475569;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.payment-link-status--active {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.28);
}

.payment-link-status--expired {
  background: rgba(245, 158, 11, 0.16);
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.34);
}

.payment-link-status--paid {
  background: rgba(37, 99, 235, 0.13);
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.25);
}

.payment-link-status--cancelled {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.25);
}

.payment-merchant-select {
  width: min(210px, 100%);
  min-height: 34px;
  padding: 0 10px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: 800 11px/1.2 "Manrope";
  outline: none;
}

.merchant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
  padding: 18px 20px 22px;
}

.merchant-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, #fff 0%, #f8fbfc 100%);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.05);
}

.merchant-card-head,
.merchant-card-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.merchant-card h3 {
  margin: 8px 0 4px;
  color: var(--ink);
  font: 900 18px/1.15 "Manrope";
}

.merchant-card p,
.merchant-card small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.merchant-balance-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.merchant-balance-row > div,
.merchant-mini-list {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255,255,255,0.74);
  min-width: 0;
}

.merchant-balance-row strong {
  display: grid;
  gap: 3px;
  color: var(--ink);
  font-size: 14px;
}

.merchant-mini-list strong {
  color: var(--ink);
  font-size: 12px;
}

.merchant-mini-list span {
  overflow: hidden;
  color: var(--slate);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-log-list {
  display: grid;
  gap: 10px;
  padding: 16px 20px 22px;
}

.payment-log-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.payment-log-card.resolved {
  opacity: 0.66;
  background: #f8fafc;
}

.payment-log-card h3 {
  margin: 8px 0 5px;
  color: var(--ink);
  font: 900 14px/1.25 "Manrope";
}

.payment-log-card p {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.payment-log-card > div:last-child {
  display: grid;
  justify-items: end;
  align-content: center;
  gap: 8px;
  text-align: right;
}

.status-info {
  background: #e8f1ff;
  color: #1d4ed8;
}

.status-warning {
  background: #fff4dc;
  color: #9c6500;
}

.status-error,
.status-critical {
  background: #ffe8e3;
  color: #b33824;
}

.account-phase-card > div:last-child {
  display: grid;
  justify-items: end;
  align-content: center;
  gap: 8px;
  text-align: right;
}

.account-phase-card > div:last-child strong {
  color: var(--ink);
  font-size: 12px;
}

.account-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.account-card-actions .secondary-button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 9px;
  font-size: 10px;
}

.account-detail-side {
  display: grid;
  gap: 16px;
  align-content: start;
}

.account-info-grid,
.account-related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 20px 20px;
}

.account-info-grid span,
.account-related-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfdfd;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.account-info-grid strong,
.account-related-card strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 13px;
}

.account-description-box {
  margin: 0 20px 20px;
  padding: 16px;
  border: 1px solid #dfeaea;
  border-radius: 18px;
  background: white;
}

.account-description-box strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 12px;
}

.account-description-box p,
.account-related-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.account-related-card span,
.account-related-card small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.account-timeline--screen {
  padding: 16px 20px 20px;
}

.account-info-list {
  display: grid;
  gap: 8px;
  padding: 16px 20px 20px;
}

.account-info-list span {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eef2f2;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.account-info-list strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-badge.priority-low { background: #eef4f1; color: #557066; }
.role-badge.priority-normal { background: #eef4ff; color: #4c78bc; }
.role-badge.priority-high { background: #fff4dc; color: #9c6500; }
.role-badge.priority-urgent { background: #ffe8e3; color: #b33824; }

.email-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 60px;
  z-index: 2;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(246, 249, 251, .96);
  backdrop-filter: blur(10px);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: #c8d5dc transparent;
}

.email-filter-search {
  flex: 1 0 220px;
  max-width: none;
  min-width: 0;
}

.email-filter-bar .filter-select {
  flex: 0 0 122px;
}

.email-filter-bar .email-clear-filter {
  flex: 0 0 auto;
  white-space: nowrap;
}

.email-bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.email-bulk-bar.active {
  background: linear-gradient(90deg, rgba(68,199,162,.14), #fff);
}

.email-bulk-bar strong {
  color: var(--ink);
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.email-bulk-bar > div {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.email-bulk-bar .secondary-button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 9px;
}

.email-clear-filter[disabled] {
  opacity: .45;
  cursor: not-allowed;
}

.email-clear-filter.active {
  color: #315fba;
}

.account-meta-grid--detail {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 14px 0;
}

.account-mini-list,
.account-timeline {
  display: grid;
  gap: 10px;
}

.account-mini-list article,
.account-timeline article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfdfd;
}

.account-mini-list strong,
.account-timeline strong {
  display: block;
  color: var(--ink);
}

.account-mini-list small,
.account-timeline span,
.account-timeline small {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.account-timeline p {
  margin: 6px 0;
  color: var(--muted);
}

.status-partially-paid,
.status-pending {
  background: #fff4dc;
  color: #9c6500;
}

.status-unpaid,
.status-failed,
.status-cancelled {
  background: #ffe8e3;
  color: #b33824;
}

.status-paid {
  background: #dff8ed;
  color: #18724f;
}

.status-connected {
  background: #dff8ed;
  color: #18724f;
}

.status-not-configured {
  background: #eef2f7;
  color: #475569;
}

.status-error {
  background: #ffe8e3;
  color: #b33824;
}

.status-disabled {
  background: #ece8ff;
  color: #5c44a8;
}

.status-refunded {
  background: #ece8ff;
  color: #5c44a8;
}

@media (max-width: 1180px) {
  .account-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .account-detail-hero,
  .account-detail-layout,
  .account-phase-card,
  .account-info-grid,
  .account-summary-grid,
  .account-related-grid {
    grid-template-columns: 1fr;
  }

  .account-phase-card > div:last-child {
    justify-items: start;
    text-align: left;
  }

  .account-info-list span {
    grid-template-columns: 1fr;
  }

  .account-screen-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .account-toolbar,
  .account-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .account-toolbar-actions,
  .account-pagination div {
    justify-content: space-between;
  }

  .account-filter-bar {
    grid-template-columns: minmax(220px, 1fr);
  }

  .account-list-shell {
    max-height: 66vh;
  }

  .account-grid,
  .account-money-row,
  .account-meta-grid,
  .account-meta-grid--detail,
  .email-filter-bar {
    grid-template-columns: 1fr;
  }
}
