:root {
  --aqua: #00e785;
  --cyan: #3db39e;
  --purple: #6a43b9;
  --purple-dark: #2b4554;
  --coral: #ff5b57;
  --yellow: #ffd447;
  --blue-soft: #74b7ff;
  --bg: #f4f8f6;
  --surface: #ffffff;
  --text: #203543;
  --muted: #5f7180;
  --border: #dbe7e4;
  --shadow: 0 16px 40px rgba(32, 53, 67, 0.09);
  --shadow-soft: 0 8px 24px rgba(32, 53, 67, 0.07);
  --ring: 0 0 0 3px rgba(0, 231, 133, 0.2);
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.settings-user-create {
  display: grid;
  gap: 12px;
}

.settings-user-create > input,
.settings-user-create > select {
  min-width: 0;
}

.settings-users {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.user-access-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface);
}

.user-access-head {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.user-access-head small,
.function-card small {
  color: var(--muted);
  display: block;
}

.chip-list {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.chip {
  align-items: center;
  background: rgba(0, 231, 133, 0.12);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  display: inline-flex;
  font-size: 0.78rem;
  min-height: 26px;
  padding: 3px 9px;
}

.muted-chip {
  background: #eef4f1;
  color: var(--muted);
}

.function-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.function-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.function-card label {
  display: grid;
  gap: 6px;
}

.function-card select[multiple] {
  min-height: 110px;
}

.check-line {
  align-items: center;
  display: flex !important;
  gap: 8px !important;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

::selection {
  background: rgba(0, 231, 133, 0.28);
}

a {
  color: inherit;
  text-decoration: none;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
  outline: none;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(0, 231, 133, 0.32);
  outline-offset: 2px;
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(255, 91, 87, 0.14);
}

.field-error {
  display: block;
  margin-top: 5px;
  color: #a71928;
  font-size: 12px;
  font-weight: 750;
}

.button-loader {
  width: 22px;
  height: 22px;
  object-fit: contain;
  vertical-align: middle;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 20;
  transform: translateY(-150%);
  border-radius: 8px;
  background: var(--purple-dark);
  color: #fff;
  padding: 10px 12px;
  font-weight: 800;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  display: grid;
  grid-template-columns: 264px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  background:
    linear-gradient(180deg, rgba(43, 69, 84, 0.98), rgba(32, 53, 67, 1)),
    var(--purple-dark);
  color: #fff;
  padding: 22px 16px;
  overflow: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}

.brand-mark {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.34);
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
}

.brand-mark img {
  width: 42px;
  height: 42px;
  object-fit: cover;
}

.brand-wordmark {
  display: block;
  width: 136px;
  height: auto;
  margin-bottom: 3px;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: rgba(255, 255, 255, 0.68);
  margin-top: 2px;
}

.sidebar-nav {
  display: grid;
  gap: 4px;
  margin-top: 28px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border-radius: 8px;
  padding: 0 10px;
  color: rgba(255, 255, 255, 0.78);
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(0, 231, 133, 0.14);
  color: #fff;
}

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

.nav-item:hover {
  transform: translateX(2px);
}

.sidebar-companion {
  display: grid;
  gap: 4px;
  justify-items: start;
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  padding: 12px 10px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  text-align: left;
}

.sidebar-companion strong {
  font-size: 14px;
}

.sidebar-companion small {
  max-width: 100%;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.64);
  text-overflow: ellipsis;
}

.sidebar-companion-kicker {
  color: var(--aqua);
  font-weight: 850;
  text-transform: uppercase;
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  min-height: 72px;
  border-bottom: 1px solid var(--border);
  background: rgba(250, 253, 252, 0.9);
  backdrop-filter: blur(12px);
  padding: 0 28px;
}

.global-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(680px, 56vw);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  padding: 0 12px;
  box-shadow: var(--shadow-soft);
}

.global-search input {
  border: 0;
  padding-left: 0;
}

.global-search-disabled {
  visibility: hidden;
  pointer-events: none;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.topbar-actions,
.page-actions,
.quick-actions,
.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar-user {
  display: grid;
  justify-items: end;
  gap: 2px;
  min-width: 126px;
}

.topbar-user span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.topbar-user strong {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid rgba(61, 179, 158, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
  box-shadow: var(--shadow-soft);
}

.live-status-dot,
.live-toast-pulse {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--aqua);
  box-shadow: 0 0 0 4px rgba(0, 231, 133, 0.14);
}

.live-status[data-state="connecting"] .live-status-dot,
.live-status[data-state="reconnecting"] .live-status-dot,
.live-status[data-state="updating"] .live-status-dot,
.live-status[data-state="fallback"] .live-status-dot {
  background: var(--yellow);
  box-shadow: 0 0 0 4px rgba(255, 203, 92, 0.2);
}

.live-status[data-state="disabled"] {
  color: var(--muted);
}

.live-status[data-state="disabled"] .live-status-dot {
  background: #a9b8b6;
  box-shadow: 0 0 0 4px rgba(169, 184, 182, 0.18);
}

.live-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: min(430px, calc(100vw - 32px));
  border: 1px solid rgba(61, 179, 158, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 44px rgba(32, 53, 67, 0.18);
  padding: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.live-toast[data-visible="true"] {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.live-toast strong,
.live-toast small {
  display: block;
}

.live-toast small {
  margin-top: 2px;
  color: var(--muted);
}

.app-flash {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(420px, calc(100vw - 32px));
  border: 1px solid rgba(61, 179, 158, 0.34);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(32, 53, 67, 0.16);
  color: var(--text);
  padding: 12px 14px;
  transform: translateY(0);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.app-flash::before {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--aqua);
  content: "";
}

.app-flash.error::before {
  background: var(--coral);
}

.app-flash.info::before {
  background: var(--blue-soft);
}

.app-flash[data-closing="true"] {
  opacity: 0;
  transform: translateY(8px);
}

.app-flash strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}

.app-flash button {
  width: 30px;
  min-height: 30px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-weight: 850;
}

.content {
  padding: 28px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
}

.page-header h1,
.client-hero h1,
.login-card h1 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: 0;
}

.page-header h1 {
  font-size: 32px;
}

.page-header p,
.muted {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--cyan);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 12px;
}

.brand-brief {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  align-items: center;
  gap: 18px;
  min-height: 150px;
  margin-bottom: 20px;
  border: 1px solid rgba(61, 179, 158, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(232, 255, 245, 0.96)),
    #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
  padding: 20px 22px;
}

.brand-brief h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
  color: var(--purple-dark);
}

.brand-brief p:last-child {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--muted);
}

.brand-brief img {
  justify-self: end;
  width: 200px;
  max-height: 150px;
  object-fit: contain;
  filter: drop-shadow(0 16px 18px rgba(43, 69, 84, 0.18));
}

.ops-launchpad {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.ops-launchpad a {
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 74px;
  border: 1px solid rgba(219, 231, 228, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-soft);
  padding: 12px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.ops-launchpad a:hover {
  border-color: rgba(61, 179, 158, 0.42);
  box-shadow: 0 16px 34px rgba(32, 53, 67, 0.1);
  transform: translateY(-2px);
}

.ops-launchpad svg {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(0, 231, 133, 0.14);
  color: var(--purple-dark);
  padding: 10px;
}

.ops-launchpad strong,
.ops-launchpad small {
  display: block;
}

.ops-launchpad small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.report-card {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  align-items: start;
  min-height: 150px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
  padding: 14px;
  transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.report-card:hover {
  border-color: rgba(61, 179, 158, 0.45);
  box-shadow: 0 16px 34px rgba(32, 53, 67, 0.1);
  transform: translateY(-2px);
}

.report-card svg {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(61, 179, 158, 0.14);
  color: var(--purple-dark);
  padding: 8px;
}

.report-card span {
  display: grid;
  gap: 6px;
}

.report-card small {
  color: var(--muted);
  line-height: 1.45;
}

.report-card b {
  grid-column: 2;
  align-self: end;
  color: var(--aqua-dark);
  font-size: 12px;
}

.report-card.tone-yellow svg {
  background: rgba(255, 210, 77, 0.22);
}

.report-card.tone-coral svg {
  background: rgba(255, 108, 92, 0.16);
}

.button,
.icon-button,
.avatar,
.pagination button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 750;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.button.primary {
  background: var(--aqua);
  color: #173641;
  box-shadow: 0 10px 24px rgba(0, 231, 133, 0.18);
}

.button.primary:hover {
  background: #12f09a;
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(0, 231, 133, 0.24);
}

.button.secondary,
.icon-button,
.pagination button {
  border-color: var(--border);
  background: #fff;
  color: var(--text);
}

.button.secondary:hover,
.icon-button:hover,
.pagination button:hover:not(:disabled) {
  border-color: rgba(61, 179, 158, 0.5);
  background: #f3fffa;
  box-shadow: var(--shadow-soft);
}

.button.danger {
  border-color: rgba(255, 91, 87, 0.34);
  color: #b8323b;
}

.button.danger:hover {
  border-color: rgba(255, 91, 87, 0.58);
  background: rgba(255, 91, 87, 0.08);
}

.button.danger-fill {
  border-color: rgba(255, 91, 87, 0.78);
  background: var(--coral);
  color: #fff;
  box-shadow: 0 10px 24px rgba(255, 91, 87, 0.18);
}

.button.danger-fill:hover {
  border-color: var(--coral);
  background: #ff4642;
  box-shadow: 0 12px 28px rgba(255, 91, 87, 0.24);
  transform: translateY(-1px);
}

.button.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--cyan);
}

.button.ghost:hover {
  border-color: rgba(61, 179, 158, 0.28);
  background: rgba(61, 179, 158, 0.08);
}

.button.ghost.danger,
.icon-button.danger {
  color: #b8323b;
}

.button.ghost.danger:hover,
.icon-button.danger:hover {
  border-color: rgba(255, 91, 87, 0.42);
  background: rgba(255, 91, 87, 0.08);
}

.link-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border: 0;
  background: transparent;
  color: var(--cyan);
  cursor: pointer;
  font: inherit;
  font-weight: 750;
  padding: 0;
}

.link-button:hover {
  color: var(--purple);
}

.button.full {
  width: 100%;
}

.icon-button,
.avatar {
  width: 40px;
  padding: 0;
}

.avatar {
  border-color: var(--border);
  background: var(--purple-dark);
  color: #fff;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.compact-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.kpi,
.panel,
.metric-tile,
.login-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.kpi {
  min-height: 126px;
  padding: 16px;
  position: relative;
  overflow: hidden;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.kpi::before {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--aqua));
  content: "";
}

.kpi:hover,
.panel:hover {
  box-shadow: 0 18px 44px rgba(32, 53, 67, 0.11);
}

.kpi:hover {
  transform: translateY(-2px);
}

.kpi span {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: rgba(61, 179, 158, 0.14);
  color: var(--purple-dark);
}

.kpi.aqua span {
  background: rgba(0, 231, 133, 0.18);
  color: #087b50;
}

.kpi.coral span {
  background: rgba(255, 79, 94, 0.12);
  color: var(--coral);
}

.kpi.yellow span {
  background: rgba(255, 212, 71, 0.25);
  color: #7a5b00;
}

.kpi p {
  margin: 14px 0 5px;
  color: var(--muted);
  font-size: 13px;
}

.kpi strong {
  font-size: 24px;
  letter-spacing: 0;
}

.two-column,
.three-column {
  display: grid;
  gap: 18px;
  margin-bottom: 20px;
}

.two-column {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-column {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel {
  padding: 18px;
  min-width: 0;
  transition: box-shadow 0.16s ease, border-color 0.16s ease;
}

.panel:hover {
  border-color: rgba(61, 179, 158, 0.28);
}

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

.panel-header h2 {
  margin: 0;
  font-size: 18px;
}

.panel-header a {
  color: var(--cyan);
  font-weight: 750;
}

.panel-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.dense-list {
  display: grid;
  gap: 10px;
}

.priority-inbox {
  margin-bottom: 20px;
}

.priority-inbox .panel-header {
  align-items: flex-start;
}

.priority-inbox .panel-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.priority-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.priority-summary span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 10px;
  background: #fbfffd;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.priority-summary strong {
  color: var(--text);
}

.priority-list {
  display: grid;
  gap: 8px;
}

.priority-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 62px;
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.priority-item:hover {
  background: #fbfffd;
  border-color: rgba(61, 179, 158, 0.46);
  transform: translateY(-1px);
}

.priority-critical {
  border-left-color: var(--coral);
}

.priority-high {
  border-left-color: var(--yellow);
}

.priority-medium {
  border-left-color: var(--cyan);
}

.priority-low {
  border-left-color: var(--blue-soft);
}

.priority-item small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.priority-meta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 112px;
  white-space: nowrap;
}

.priority-meta b {
  font-size: 13px;
}

.risk-row,
.document-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.risk-row:hover,
.document-row:hover {
  border-color: rgba(61, 179, 158, 0.42);
  background: #fbfffd;
  transform: translateY(-1px);
}

.document-row {
  justify-content: flex-start;
}

.risk-row small,
td small,
.document-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.aging-chart {
  display: grid;
  gap: 12px;
}

.aging-row {
  display: grid;
  grid-template-columns: 58px 1fr 108px;
  align-items: center;
  gap: 10px;
}

.bar {
  height: 10px;
  overflow: hidden;
  border-radius: 99px;
  background: #edf2f7;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--coral));
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.table-wrap.compact {
  box-shadow: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
  text-align: left;
  vertical-align: middle;
}

.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

th {
  position: sticky;
  top: 0;
  background: #f8fbfc;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

td {
  font-size: 14px;
}

tbody tr {
  transition: background 0.14s ease;
}

tbody tr:hover {
  background: #fbfffd;
}

tr:last-child td {
  border-bottom: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: #edf2f7;
  color: #314056;
  font-size: 12px;
  font-weight: 800;
  gap: 6px;
}

.badge::before {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.badge-active,
.badge-paid,
.badge-purchased,
.badge-committed,
.badge-purchase-order,
.badge-sent,
.badge-published,
.badge-valid,
.badge-met,
.badge-on-track,
.badge-healthy {
  background: rgba(0, 231, 133, 0.18);
  color: #087b50;
}

.badge-overdue,
.badge-at-risk,
.badge-collections,
.badge-invalid-variables,
.badge-failed,
.badge-breached,
.badge-critical {
  background: rgba(255, 79, 94, 0.13);
  color: #b32836;
}

.badge-renewal,
.badge-in-followup,
.badge-proposal-sent,
.badge-deferred,
.badge-scheduled,
.badge-partially-paid,
.badge-pending,
.badge-due-soon,
.badge-attention,
.badge-risk {
  background: rgba(255, 212, 71, 0.25);
  color: #795c00;
}

.badge-no-payment-plan,
.badge-stale,
.badge-watch,
.badge-declined,
.badge-prospect-declined,
.badge-former-client,
.badge-recover,
.badge-recover-client {
  background: rgba(116, 183, 255, 0.18);
  color: #245c8c;
}

.badge-next-action-due,
.badge-suspended {
  background: rgba(255, 212, 71, 0.25);
  color: #795c00;
}

.badge-five-year,
.badge-seven-year,
.badge-biannual,
.badge-triennial {
  background: rgba(106, 67, 185, 0.12);
  color: var(--purple);
}

.money-danger {
  color: var(--coral);
  font-weight: 850;
}

.filter-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.filter-strip form {
  display: flex;
  flex: 1 1 560px;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 100%;
  min-width: 0;
  width: auto;
}

.page-size {
  flex: 0 1 132px;
  width: auto;
  min-width: 132px;
}

.page-size select {
  min-height: 38px;
  padding-block: 8px;
  white-space: nowrap;
}

.result-summary {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid rgba(61, 179, 158, 0.2);
  border-radius: 8px;
  background: #f8fffb;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  padding: 0 10px;
  white-space: nowrap;
}

.global-search-strip {
  margin: -4px 0 18px;
}

.global-search-strip form {
  display: flex;
  gap: 10px;
  width: min(860px, 100%);
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 260px;
  min-width: 220px;
}

.search-box > svg {
  position: absolute;
  left: 12px;
  z-index: 1;
  color: var(--muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding-left: 38px;
}

.search-box-ready {
  isolation: isolate;
}

.search-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 40;
  display: grid;
  gap: 4px;
  max-height: 330px;
  overflow: auto;
  border: 1px solid rgba(219, 231, 228, 0.96);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 48px rgba(32, 53, 67, 0.16);
  padding: 6px;
}

.search-suggestions[hidden] {
  display: none;
}

.search-suggestion-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 9px 10px;
  text-align: left;
}

.search-suggestion-item:hover,
.search-suggestion-item.active {
  border-color: rgba(61, 179, 158, 0.34);
  background: #f4fffa;
}

.search-suggestion-item strong,
.search-suggestion-item small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-suggestion-item small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.search-suggestion-item b {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: rgba(106, 67, 185, 0.1);
  color: var(--purple);
  font-size: 11px;
  padding: 0 8px;
  white-space: nowrap;
}

.search-suggestion-state {
  color: var(--muted);
  padding: 12px;
  text-align: center;
}

.client-name-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  max-width: 100%;
  min-width: 0;
}

.client-name-cell strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  line-height: 1.22;
}

.client-badge-list {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  max-width: 100%;
}

.client-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 180px;
  min-height: 22px;
  overflow: hidden;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: #fff;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
  padding: 0 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-badge-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.client-badge.more {
  border-color: var(--border);
  color: var(--muted);
}

.client-badge-panel,
.client-notes-panel {
  margin-bottom: 20px;
}

.badge-editor {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
}

.badge-editor.create {
  margin-bottom: 14px;
}

.badge-editor.compact {
  grid-template-columns: minmax(140px, 1fr) auto auto;
}

.badge-color-picker {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
}

.badge-color-picker label {
  position: relative;
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  cursor: pointer;
}

.badge-color-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.badge-color-picker span {
  display: block;
  width: 22px;
  height: 22px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(32, 53, 67, 0.18);
}

.badge-color-picker input:checked + span {
  box-shadow: 0 0 0 2px var(--purple-dark), 0 0 0 5px rgba(61, 179, 158, 0.16);
}

.badge-color-picker input:focus-visible + span {
  outline: 3px solid rgba(0, 231, 133, 0.32);
  outline-offset: 3px;
}

.badge-color-picker.compact {
  max-width: 160px;
}

.badge-manager-list,
.client-note-list {
  display: grid;
  gap: 10px;
}

.badge-manager-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfffd;
  padding: 10px;
}

.badge-manager-actions,
.document-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.badge-manager-actions form,
.document-row-actions form {
  margin: 0;
}

.client-note-row {
  display: grid;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.client-note-row p {
  margin: 0;
  white-space: pre-wrap;
}

.client-note-row details {
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.client-note-row summary {
  color: var(--cyan);
  cursor: pointer;
  font-weight: 750;
}

.compact-form {
  margin-bottom: 14px;
}

.activity-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 18px;
  align-items: start;
}

.activity-priority-panel {
  position: sticky;
  top: 92px;
}

.activity-row-overdue td {
  background: rgba(255, 91, 87, 0.04);
}

.urgent-row {
  border-color: rgba(255, 91, 87, 0.26);
  background: rgba(255, 91, 87, 0.06);
}

.pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
}

.pagination .disabled {
  cursor: not-allowed;
  opacity: 0.52;
  pointer-events: none;
}

.pagination-status {
  font-size: 0.88rem;
  font-weight: 750;
  white-space: nowrap;
}

.client-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--border);
  margin: -4px 0 20px;
  padding-bottom: 20px;
}

.hero-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
}

.tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(244, 248, 246, 0.94);
  backdrop-filter: blur(10px);
}

.tabs a {
  white-space: nowrap;
  padding: 12px 10px;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  font-weight: 700;
}

.tabs a:hover {
  color: var(--purple);
  border-color: var(--aqua);
}

.tabs a.active,
.tabs a[aria-current="page"] {
  border-color: var(--purple);
  color: var(--purple);
}

.tabs a:focus-visible,
.module-subnav a:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.detail-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.detail-list dt {
  color: var(--muted);
  font-size: 12px;
}

.detail-list dd {
  margin: 0 0 8px;
  font-weight: 750;
}

.timeline {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 10px;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 4px rgba(0, 231, 133, 0.14);
}

.timeline small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

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

.inline-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 10px;
  margin-top: 14px;
}

.stack-form,
.form-panel {
  display: grid;
  gap: 14px;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.action-panel-body {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(61, 179, 158, 0.22);
  border-radius: 8px;
  background: #fbfffd;
  padding: 14px;
}

.action-panel-body strong {
  color: var(--purple-dark);
  font-size: 24px;
  line-height: 1;
}

.action-panel-body small {
  color: var(--muted);
  font-weight: 750;
}

.payment-plan-form textarea {
  resize: vertical;
}

.payment-plan-preview {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 10px;
  border: 1px solid rgba(61, 179, 158, 0.28);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f7fbfa);
  padding: 12px;
}

.payment-plan-preview span {
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 3px;
  border-left: 3px solid var(--cyan);
  padding-left: 10px;
}

.payment-plan-preview span:nth-child(2) {
  border-left-color: var(--yellow);
}

.payment-plan-preview span:nth-child(3) {
  border-left-color: var(--coral);
}

.payment-plan-preview small {
  color: var(--muted);
  font-weight: 750;
}

.payment-plan-preview strong {
  font-size: 15px;
}

.plan-summary-row {
  border-left: 4px solid var(--cyan);
}

.billing-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.billing-item:hover,
.billing-item:focus-within {
  border-color: rgba(61, 179, 158, 0.42);
  box-shadow: var(--shadow-soft);
}

.billing-item-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 11px 12px;
  text-align: left;
}

.billing-item-trigger:disabled {
  cursor: default;
}

.billing-item-trigger:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.billing-item-trigger small,
.billing-note-preview small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.billing-item-meta,
.channel-hints {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.billing-note-preview {
  margin: 0 12px 12px;
  border-left: 3px solid var(--yellow);
  background: #fffaf0;
  border-radius: 6px;
  color: #4a5568;
  padding: 9px 10px;
}

.billing-edit-form {
  background: transparent;
}

.receivable-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(57, 198, 212, 0.28);
  border-radius: 8px;
  background: #f3fcfd;
  padding: 12px;
}

.receivable-modal-actions strong,
.receivable-modal-actions small {
  display: block;
}

.receivable-modal-actions small {
  margin-top: 2px;
  color: var(--muted);
  font-weight: 750;
}

.receivable-modal-action-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.invoice-status-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid rgba(61, 179, 158, 0.24);
  border-radius: 8px;
  background: #fbfefe;
  padding: 12px;
}

.invoice-status-card div {
  min-width: 0;
}

.invoice-status-card small,
.invoice-status-card strong,
.invoice-status-card code {
  display: block;
}

.invoice-status-card small {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.invoice-status-card strong,
.invoice-status-card code {
  overflow-wrap: anywhere;
}

.invoice-status-card code {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--purple);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 850;
}

.invoice-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.billing-note-history {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(255, 197, 61, 0.34);
  border-radius: 8px;
  background: #fffaf0;
  padding: 10px;
}

.mini-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mini-section-header small {
  color: var(--muted);
  font-weight: 750;
}

.billing-note-list {
  display: grid;
  gap: 8px;
}

.billing-note-entry {
  border-left: 3px solid var(--yellow);
  background: #fff;
  border-radius: 6px;
  padding: 8px 10px;
  display: grid;
  gap: 8px;
}

.billing-note-entry-header {
  display: grid;
  gap: 4px;
}

.billing-note-entry p {
  margin: 0;
}

.billing-note-entry small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.billing-note-edit summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  color: var(--link);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 750;
  list-style: none;
}

.billing-note-edit summary::-webkit-details-marker {
  display: none;
}

.billing-note-edit-form {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 8px;
}

.billing-note-edit-form textarea {
  min-height: 74px;
}

.billing-note-delete-form {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.compact-actions {
  justify-content: flex-end;
}

.reminder-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  border: 1px solid rgba(61, 179, 158, 0.28);
  border-radius: 8px;
  background: #f3fffa;
  color: #254155;
  font-size: 13px;
  font-weight: 750;
  padding: 9px 10px;
}

.notification-editor {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(180px, 0.8fr) minmax(240px, 1.4fr);
  gap: 12px;
}

.wide-field {
  grid-column: 1 / -1;
}

.channel-hints span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  border: 1px solid rgba(61, 179, 158, 0.28);
  border-radius: 999px;
  background: #f3fffa;
  color: #254155;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 9px;
}

.channel-hints .muted-pill {
  border-color: var(--border);
  background: #f7fafc;
  color: var(--muted);
}

.contract-center {
  margin-bottom: 20px;
}

.contract-center > .panel-header {
  align-items: flex-start;
}

.contract-center .panel-header small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 650;
}

.empty-contract-center {
  display: grid;
  gap: 4px;
  border: 1px dashed rgba(61, 179, 158, 0.38);
  border-radius: 8px;
  background: #fbfffd;
  padding: 18px;
}

.empty-contract-center small {
  color: var(--muted);
}

.contract-cycle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.contract-cycle-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.contract-cycle-card:hover {
  border-color: rgba(106, 67, 185, 0.24);
  box-shadow: var(--shadow-soft);
}

.contract-cycle-header,
.contract-cycle-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.contract-cycle-header strong {
  display: block;
  color: var(--purple-dark);
}

.contract-cycle-header small,
.contract-cycle-meta span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.contract-fact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.contract-fact-grid div {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdff;
  padding: 9px 10px;
}

.contract-fact-grid dt {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.contract-fact-grid dd {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.contract-document-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.document-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfffd;
  color: var(--ink);
  font-weight: 800;
  padding: 7px 9px;
}

.document-chip small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.contract-loose-documents {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.dashboard-table-panel {
  padding: 0;
  overflow: hidden;
}

.dashboard-table-panel .panel-header {
  margin: 0;
  padding: 16px 18px;
}

.dashboard-table {
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0;
  box-shadow: none;
}

.dashboard-table table {
  min-width: 1180px;
}

.dashboard-table td {
  vertical-align: top;
}

.dashboard-table td > strong,
.dashboard-table td > a > strong {
  display: block;
  margin-bottom: 2px;
}

.row-actions-menu {
  position: relative;
  min-width: 190px;
}

.row-actions-menu summary {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 0 10px;
  cursor: pointer;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.row-actions-menu[open] summary {
  border-color: rgba(61, 179, 158, 0.48);
  box-shadow: var(--ring);
}

.row-action-form {
  display: grid;
  gap: 10px;
  width: 260px;
  max-width: 80vw;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 12px;
}

.row-action-form label {
  font-size: 12px;
}

.row-action-form textarea {
  min-height: 66px;
  resize: vertical;
}

.form-panel {
  max-width: 760px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 20px;
  box-shadow: var(--shadow);
}

label {
  display: grid;
  gap: 7px;
  color: #26344b;
  font-weight: 750;
}

.template-preview .email-preview {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  background: #fff;
}

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

.builder-sidebar,
.builder-main,
.builder-preview {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.builder-sidebar,
.builder-main {
  padding: 18px;
}

.block-palette,
.variable-list,
.format-toolbar,
.attachment-list {
  display: grid;
  gap: 8px;
}

.block-palette {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.block-palette button,
.variable-list button,
.format-toolbar button,
.attachment-chip button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-weight: 750;
  padding: 0 10px;
}

.block-palette button[draggable="true"] {
  cursor: grab;
}

.block-palette button:hover,
.variable-list button:hover,
.format-toolbar button:hover,
.attachment-chip button:hover {
  border-color: rgba(61, 179, 158, 0.45);
  background: rgba(0, 231, 133, 0.08);
}

.builder-group {
  margin-top: 18px;
}

.builder-group h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.variable-list {
  max-height: 300px;
  overflow: auto;
}

.variable-list button {
  justify-content: flex-start;
  font-size: 12px;
  cursor: grab;
}

.format-toolbar {
  grid-template-columns: repeat(5, 40px);
}

.format-toolbar button {
  justify-content: center;
  padding: 0;
}

.builder-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.builder-meta label:nth-child(1),
.builder-meta label:nth-child(3) {
  grid-column: 1 / -1;
}

.attachment-manager {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdff;
  margin-bottom: 16px;
  padding: 14px;
}

.attachment-manager .panel-header h2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.attachment-fields {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}

.attachment-chip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 9px 10px;
}

.attachment-chip small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.attachment-chip button {
  min-height: 32px;
  color: #a71928;
}

.email-canvas-shell {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #edf2f7;
}

.email-subject-line {
  display: grid;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  background: #fbfdff;
  padding: 12px 14px;
}

.email-subject-line span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.email-canvas {
  display: grid;
  gap: 10px;
  min-height: 430px;
  padding: 18px;
  background: #fff;
}

.email-canvas.drag-accept {
  outline: 3px solid rgba(0, 231, 133, 0.22);
  outline-offset: -6px;
  background: #fbfdff;
}

.mail-block {
  position: relative;
  border: 1px dashed transparent;
  border-radius: 8px;
  padding: 12px 12px 12px 42px;
  background: #fff;
}

.mail-block[data-drag-over="before"] {
  border-top-color: var(--cyan);
}

.mail-block[data-drag-over="after"] {
  border-bottom-color: var(--cyan);
}

.mail-block:hover,
.mail-block:focus-within {
  border-color: rgba(61, 179, 158, 0.45);
  background: #fbfdff;
}

.mail-block h2 {
  margin: 0;
  color: var(--purple);
  font-size: 28px;
}

.mail-block p {
  margin: 0;
  color: #2a364d;
  line-height: 1.62;
}

.mail-block figure {
  margin: 0;
}

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

.mail-block img {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 8px;
}

.mail-block figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.mail-block hr {
  border: 0;
  border-top: 1px solid var(--border);
}

.block-settings {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 120px 130px;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f7fafc;
  margin-bottom: 10px;
  padding: 10px;
}

.block-settings label {
  gap: 5px;
  font-size: 12px;
}

.block-settings input,
.block-settings select {
  min-height: 34px;
  padding: 7px 9px;
}

.button-settings {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 130px;
}

.drag-handle {
  position: absolute;
  left: 8px;
  top: 10px;
  width: 24px;
  min-height: 30px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  cursor: grab;
}

.block-context-menu {
  position: fixed;
  z-index: 30;
  display: grid;
  gap: 4px;
  min-width: 180px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 6px;
}

.block-context-menu[hidden] {
  display: none;
}

.block-context-menu button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  padding: 0 10px;
}

.block-context-menu button:hover {
  background: rgba(0, 231, 133, 0.1);
}

.email-cta {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  border-radius: 8px;
  background: var(--aqua);
  color: #173641;
  font-weight: 850;
  padding: 0 18px;
}

.builder-preview {
  position: sticky;
  top: 92px;
  padding: 18px;
}

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

.builder-preview .email-preview {
  max-height: 680px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}

.action-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  background: rgba(23, 32, 51, 0.48);
  padding: 28px;
}

.action-modal[data-open="true"],
.action-modal:target {
  display: grid;
}

.action-modal-backdrop {
  position: absolute;
  inset: 0;
}

.action-modal-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(760px, 96vw);
  max-height: 92vh;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(23, 32, 51, 0.28);
}

.action-modal.wide .action-modal-panel {
  width: min(1040px, 96vw);
}

.action-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--border);
  padding: 16px 18px;
}

.action-modal-header h2 {
  margin: 0;
  font-size: 18px;
}

.action-modal-header small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 750;
}

.modal-close {
  flex: 0 0 auto;
}

.action-modal-body {
  overflow: auto;
  padding: 18px;
}

.modal-form .form-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.modal-form[data-submit-pending="true"] {
  opacity: 0.72;
}

.modal-form[data-submit-pending="true"] button[type="submit"] {
  cursor: wait;
}

.form-error {
  border: 1px solid rgba(255, 91, 87, 0.32);
  border-radius: 8px;
  background: rgba(255, 91, 87, 0.09);
  color: #9d1f2b;
  font-weight: 750;
  padding: 10px 12px;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 82px;
}

.password-toggle {
  position: absolute;
  right: 7px;
  bottom: 7px;
  min-height: 30px;
  border: 0;
  background: transparent;
  color: var(--purple);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.quick-view-bar,
.saved-views {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.quick-view-bar {
  margin: -2px 0 14px;
}

.quick-view-chip,
.saved-view-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.quick-view-chip {
  padding: 5px 10px;
}

.quick-view-chip:hover,
.quick-view-chip.active {
  border-color: rgba(106, 67, 185, 0.36);
  background: rgba(106, 67, 185, 0.08);
  color: var(--purple);
}

.saved-view-chip a {
  padding: 5px 4px 5px 10px;
}

.saved-view-chip button {
  min-width: 26px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.saved-views small {
  color: var(--muted);
}

.upload-dropzone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 116px;
  border: 1px dashed rgba(61, 179, 158, 0.72);
  border-radius: 8px;
  background: rgba(0, 231, 133, 0.04);
  color: var(--muted);
  cursor: pointer;
  padding: 16px;
  text-align: center;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.upload-dropzone.drag-over,
.upload-dropzone.has-file {
  border-color: var(--purple);
  background: rgba(106, 67, 185, 0.07);
  color: var(--purple);
}

.upload-dropzone svg {
  color: var(--cyan);
}

.upload-dropzone.has-file svg {
  color: var(--purple);
}

.upload-dropzone input {
  max-width: 100%;
  margin-top: 8px;
}

.invoice-dropzone {
  align-content: center;
  gap: 7px;
  min-height: 168px;
  overflow: hidden;
}

.invoice-dropzone input {
  max-width: 280px;
}

.upload-progress {
  display: block;
  width: min(260px, 100%);
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(32, 53, 67, 0.1);
}

.upload-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--aqua);
  transition: width 0.2s ease;
}

.upload-dropzone.has-file .upload-progress i {
  width: 100%;
}

.modal-form[data-submit-pending="true"] .upload-dropzone.has-file .upload-progress i {
  width: 70%;
  animation: upload-progress-pulse 1.1s ease-in-out infinite;
}

@keyframes upload-progress-pulse {
  0% {
    transform: translateX(-35%);
  }

  50% {
    transform: translateX(35%);
  }

  100% {
    transform: translateX(85%);
  }
}

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

.admin-health-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.admin-health-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.audit-detail summary {
  color: var(--purple);
  cursor: pointer;
  font-weight: 800;
}

.audit-detail pre {
  max-width: 560px;
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fbfc;
  padding: 10px;
  white-space: pre-wrap;
  font-size: 12px;
}

.sla-breached {
  color: #b32836;
  font-weight: 850;
}

.sla-due-soon {
  color: #795c00;
  font-weight: 850;
}

.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(23, 32, 51, 0.52);
  padding: 28px;
}

.preview-modal[hidden] {
  display: none;
}

.preview-modal-panel {
  width: min(960px, 96vw);
  max-height: 92vh;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(23, 32, 51, 0.28);
  padding: 18px;
}

.preview-modal-body {
  max-height: calc(92vh - 96px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f7fafc;
  padding: 30px;
}

body.modal-open {
  overflow: hidden;
}

body.confirm-open {
  overflow: hidden;
}

.confirm-dialog {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  place-items: center;
  padding: 24px;
}

.confirm-dialog[data-open="true"] {
  display: grid;
}

.confirm-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 32, 51, 0.56);
}

.confirm-dialog-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  width: min(460px, 94vw);
  border: 1px solid rgba(255, 91, 87, 0.24);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(23, 32, 51, 0.24);
  padding: 18px;
}

.confirm-dialog-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: rgba(255, 91, 87, 0.12);
  color: #b8323b;
  font-size: 22px;
  font-weight: 900;
}

.confirm-dialog-copy {
  display: grid;
  gap: 6px;
}

.confirm-dialog-copy h2 {
  margin: 0;
  color: var(--purple-dark);
  font-size: 18px;
}

.confirm-dialog-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.confirm-dialog-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.builder-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid rgba(61, 179, 158, 0.28);
  border-radius: 8px;
  background: rgba(0, 231, 133, 0.08);
  color: #254155;
  padding: 12px;
}

.campaign-form {
  max-width: 860px;
}

.automation-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.automation-summary article {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 6px 12px;
  align-items: center;
  min-height: 92px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 14px;
}

.automation-summary span {
  grid-row: span 2;
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: rgba(0, 231, 133, 0.16);
  color: var(--purple-dark);
  font-weight: 900;
}

.automation-summary strong,
.automation-summary small {
  display: block;
}

.automation-summary small {
  color: var(--muted);
}

.automation-config {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.automation-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.automation-form-grid label:nth-child(1),
.automation-form-grid label:nth-child(2) {
  grid-column: span 2;
}

.automation-messages {
  margin-top: 18px;
}

.notification-console {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

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

.notification-metrics span {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 2px 9px;
  align-items: center;
  min-height: 62px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdff;
  padding: 10px;
}

.notification-metrics svg {
  grid-row: span 2;
  color: var(--coral);
}

.notification-metrics strong,
.notification-metrics small {
  display: block;
}

.notification-metrics small {
  color: var(--muted);
}

.notification-group-form {
  display: grid;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.notification-channel-grid,
.topic-picker {
  display: grid;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fbfd;
  padding: 10px;
}

.topic-picker {
  margin: 0;
}

.topic-picker legend {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 0 4px;
}

.notification-group-list {
  display: grid;
  gap: 8px;
}

.notification-group-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}

.notification-group-list small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.module-subnav {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  margin: -6px 0 18px;
  border-bottom: 1px solid var(--border);
}

.module-subnav a {
  min-height: 40px;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-weight: 800;
  padding: 10px 12px 9px;
}

.module-subnav a:hover,
.module-subnav a.active {
  color: var(--purple-dark);
  border-color: var(--aqua);
}

.cs-filter-strip form {
  grid-template-columns:
    minmax(220px, 1.2fr) minmax(140px, 0.7fr) minmax(140px, 0.7fr)
    minmax(170px, 0.9fr) minmax(132px, 0.5fr) auto;
  display: grid;
  width: min(1120px, 100%);
}

@media (max-width: 1180px) {
  .cs-filter-strip form {
    grid-template-columns: minmax(220px, 1fr) minmax(140px, 1fr) minmax(140px, 1fr);
  }
}

.cs-bars {
  display: grid;
  gap: 12px;
}

.cs-note-form {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.email-composer {
  margin-bottom: 20px;
}

.email-compose-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.recipient-chips,
.email-compose-form .compose-body,
.compose-toolbar {
  grid-column: 1 / -1;
}

.recipient-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.recipient-chips span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid rgba(61, 179, 158, 0.28);
  border-radius: 999px;
  background: rgba(0, 231, 133, 0.1);
  color: #254155;
  font-size: 12px;
  font-weight: 800;
  padding: 0 10px;
}

.compose-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdff;
  padding: 10px;
}

.compose-toolbar button {
  min-width: 38px;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
}

.compose-toolbar .button.primary {
  margin-left: auto;
  min-width: 132px;
}

.crm360-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 18px;
  margin-bottom: 20px;
}

.crm-search-results {
  margin-bottom: 18px;
}

.command-center,
.revenue-command-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 18px;
  align-items: center;
  border-color: rgba(61, 179, 158, 0.3);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(241, 255, 249, 0.94)),
    #fff;
}

.command-center {
  margin-bottom: 20px;
}

.revenue-command-shell {
  border: 1px solid rgba(61, 179, 158, 0.3);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  padding: 18px;
}

.command-copy h2,
.revenue-command-main h2 {
  margin: 0;
  font-size: 24px;
}

.command-copy p,
.revenue-command-main p {
  margin: 7px 0 0;
  color: var(--muted);
}

.command-metrics,
.revenue-command-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

.command-metrics span,
.revenue-command-stats span {
  min-height: 74px;
  border: 1px solid rgba(61, 179, 158, 0.24);
  border-radius: 8px;
  background: #fff;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 10px 12px;
}

.command-metrics small,
.revenue-command-stats small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.command-metrics strong,
.revenue-command-stats strong {
  color: var(--purple-dark);
  font-size: 18px;
}

.revenue-command-main {
  display: grid;
  gap: 10px;
}

.revenue-command-main .button {
  width: fit-content;
}

.next-action-panel {
  margin-bottom: 20px;
}

.next-action-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.next-action-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 18px;
  gap: 10px;
  align-items: center;
  min-height: 74px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--cyan);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 11px 12px;
}

.next-action-card:hover {
  border-color: rgba(61, 179, 158, 0.5);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.next-action-card.priority-critical,
.next-action-card.priority-high {
  border-left-color: var(--coral);
}

.next-action-card.priority-medium {
  border-left-color: var(--yellow);
}

.next-action-card small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.next-action-impact {
  border: 1px solid rgba(61, 179, 158, 0.24);
  border-radius: 8px;
  background: rgba(0, 231, 133, 0.08);
  color: #087b50;
  font-size: 12px;
  font-weight: 850;
  padding: 7px 9px;
  white-space: nowrap;
}

.crm360-capabilities {
  display: grid;
  gap: 10px;
}

.crm360-capabilities article {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.crm360-capabilities article svg {
  margin-top: 2px;
  color: #087b50;
}

.crm360-capabilities small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.pipeline-filters form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 0.8fr) minmax(160px, 0.8fr) auto;
  width: min(960px, 100%);
}

.pipeline-board {
  display: grid;
  grid-auto-columns: minmax(280px, 1fr);
  grid-auto-flow: column;
  gap: 14px;
  min-height: 620px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.pipeline-column {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
  min-width: 280px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  padding: 12px;
}

.pipeline-column header {
  display: grid;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.pipeline-column header span {
  font-weight: 850;
}

.pipeline-column header small {
  color: var(--muted);
}

.pipeline-cards {
  display: grid;
  align-content: start;
  gap: 10px;
}

.pipeline-empty {
  min-height: 96px;
  border: 1px dashed rgba(61, 179, 158, 0.42);
  border-radius: 8px;
  background: rgba(0, 231, 133, 0.06);
  color: var(--muted);
  display: grid;
  place-items: center;
  padding: 14px;
  text-align: center;
  font-weight: 750;
}

.opportunity-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--cyan);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  padding: 12px;
}

.opportunity-card.health-attention {
  border-left-color: var(--yellow);
}

.opportunity-card.health-risk,
.opportunity-card.health-critical {
  border-left-color: var(--coral);
}

.opportunity-card-title,
.opportunity-meta,
.thread-context {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.opportunity-card small,
.opportunity-card p {
  color: var(--muted);
}

.opportunity-card p {
  margin: 0;
}

.opportunity-card form {
  display: grid;
  gap: 8px;
}

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

.email-inbox-layout {
  grid-template-columns: minmax(240px, 0.32fr) minmax(0, 1fr) minmax(280px, 0.38fr);
}

.email-inbox-layout > .panel:last-child {
  grid-column: 1 / -1;
}

.inbox-list,
.inbox-thread {
  min-height: 640px;
}

.risk-row.active,
.risk-row.active-row {
  border-color: rgba(0, 231, 133, 0.56);
  background: #f3fffa;
}

.thread-context {
  margin-bottom: 14px;
  color: var(--muted);
}

.thread-context a {
  color: var(--cyan);
  font-weight: 850;
}

.panel-count {
  min-width: 32px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(61, 179, 158, 0.28);
  border-radius: 8px;
  background: rgba(0, 231, 133, 0.1);
  color: #087b50;
  font-weight: 850;
}

.message-thread {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.message-bubble {
  justify-self: start;
  max-width: 76%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}

.message-bubble.outbound {
  justify-self: end;
  background: rgba(0, 231, 133, 0.1);
}

.message-bubble.internal {
  background: rgba(255, 212, 71, 0.16);
}

.message-bubble small {
  color: var(--muted);
  font-weight: 800;
}

.message-bubble p {
  margin: 6px 0;
}

.message-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.email-row.inbound {
  border-left: 3px solid var(--cyan);
}

.email-row.outbound {
  border-left: 3px solid var(--aqua);
}

.failed-email-row {
  align-items: flex-start;
}

.compact-button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 0.82rem;
}

.inbox-reply {
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.portal-shell {
  display: grid;
  gap: 18px;
}

.portal-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 18px;
  align-items: center;
  border: 1px solid rgba(61, 179, 158, 0.28);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 20px;
}

.portal-hero h2 {
  margin: 0;
  font-size: 26px;
}

.portal-hero img {
  width: 210px;
  max-height: 150px;
  object-fit: contain;
}

.badge-won,
.badge-hot,
.badge-succeeded,
.badge-ready,
.badge-stub {
  background: rgba(0, 231, 133, 0.18);
  color: #087b50;
}

.badge-lost,
.badge-risk,
.badge-critical,
.badge-failed {
  background: rgba(255, 79, 94, 0.13);
  color: #b32836;
}

.badge-warm,
.badge-cold,
.badge-queued,
.badge-skipped,
.badge-handoff,
.badge-noted {
  background: rgba(255, 212, 71, 0.25);
  color: #795c00;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 260px;
  text-align: center;
  color: var(--muted);
}

.empty-state.compact {
  min-height: 130px;
  padding: 18px;
}

.empty-state.branded {
  grid-template-columns: auto minmax(0, 1fr);
  justify-content: center;
  place-items: center start;
  max-width: 560px;
  margin: 0 auto;
  text-align: left;
}

.empty-state h2 {
  color: var(--text);
  margin: 12px 0 0;
}

.empty-state.branded h2 {
  margin-top: 0;
}

.empty-state.branded p {
  margin: 5px 0 0;
}

.empty-mascot {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 10px 14px rgba(43, 69, 84, 0.12));
}

.login-shell {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 520px) 1fr;
  background:
    linear-gradient(90deg, rgba(43, 69, 84, 0.98), rgba(61, 179, 158, 0.76)),
    var(--purple-dark);
}

.login-panel {
  display: grid;
  align-content: center;
  gap: 28px;
  padding: 40px;
}

.login-brand {
  color: #fff;
}

.login-card {
  display: grid;
  gap: 16px;
  padding: 26px;
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow: 0 24px 56px rgba(32, 53, 67, 0.18);
}

.login-card input {
  min-height: 44px;
}

.forgot {
  justify-self: center;
  color: var(--purple-dark);
  font-weight: 750;
}

.login-insight {
  display: grid;
  align-content: center;
  grid-template-columns: repeat(3, minmax(0, 190px));
  gap: 16px;
  padding: 40px;
  position: relative;
  z-index: 1;
}

.login-crew {
  grid-column: 1 / -1;
  justify-self: center;
  width: min(430px, 82vw);
  max-height: 330px;
  object-fit: contain;
  filter: drop-shadow(0 26px 34px rgba(43, 69, 84, 0.3));
}

.metric-tile {
  min-height: 150px;
  padding: 18px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px);
}

.metric-tile strong {
  display: block;
  margin-top: 18px;
  font-size: 24px;
}

.metric-tile.aqua {
  background: rgba(0, 231, 133, 0.22);
}

.metric-tile.coral {
  background: rgba(255, 79, 94, 0.24);
}

.alert {
  border-radius: 8px;
  padding: 12px;
  font-weight: 750;
}

.alert.error {
  background: rgba(255, 79, 94, 0.12);
  color: #a71928;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 88px 1fr;
  }

  .brand span:last-child,
  .nav-item span,
  .sidebar-companion {
    display: none;
  }

  .kpi-grid,
  .compact-grid,
  .three-column,
  .crm360-grid,
  .command-center,
  .revenue-command-shell,
  .automation-summary,
  .notification-metrics,
  .contract-cycle-grid,
  .payment-plan-preview,
  .ops-launchpad,
  .report-grid,
  .template-builder {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .builder-preview {
    position: static;
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .app-shell,
  .login-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .sidebar-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .main,
  .content {
    min-width: 0;
  }

  .topbar,
  .page-header,
  .client-hero,
  .filter-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-user {
    display: none;
  }

  .live-status {
    justify-self: start;
  }

  .live-toast {
    right: 16px;
    bottom: 16px;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .app-flash {
    right: 16px;
    bottom: 16px;
    align-items: flex-start;
  }

  .live-toast .button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .action-modal {
    align-items: end;
    padding: 12px;
  }

  .action-modal-panel,
  .action-modal.wide .action-modal-panel {
    width: 100%;
    max-height: 94vh;
  }

  .confirm-dialog {
    align-items: end;
    padding: 12px;
  }

  .confirm-dialog-panel {
    width: 100%;
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .global-search {
    width: 100%;
  }

  .global-search-strip form,
  .filter-strip form {
    flex-direction: column;
    width: 100%;
  }

  .page-size,
  .page-size select,
  .result-summary {
    width: 100%;
  }

  .pagination {
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .pagination .button,
  .pagination-status {
    flex: 1 1 100%;
  }

  .search-box {
    width: 100%;
    min-width: 0;
  }

  .badge-editor,
  .badge-editor.compact,
  .badge-manager-row {
    grid-template-columns: 1fr;
  }

  .badge-manager-row {
    display: grid;
    justify-items: start;
  }

  .badge-manager-actions,
  .document-row-actions {
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
  }

  .document-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .two-column,
  .brand-brief,
  .crm360-grid,
  .command-center,
  .command-metrics,
  .revenue-command-shell,
  .revenue-command-stats,
  .next-action-list,
  .inbox-layout,
  .portal-hero,
  .ops-launchpad,
  .report-grid,
  .automation-summary,
  .kpi-grid,
  .compact-grid,
  .three-column,
  .notification-editor,
  .notification-metrics,
  .template-builder,
  .cs-filter-strip form,
  .email-compose-form,
  .automation-form-grid,
  .activity-workbench,
  .form-grid.two,
  .form-grid.three,
  .contract-cycle-grid,
  .contract-fact-grid,
  .builder-meta,
  .attachment-fields,
  .block-settings,
  .email-columns,
  .inline-form,
  .pipeline-filters form,
  .login-insight {
    grid-template-columns: 1fr;
  }

  .brand-brief img {
    justify-self: center;
    width: 180px;
  }

  .login-crew {
    width: min(360px, 92vw);
  }

  .automation-form-grid label:nth-child(1),
  .automation-form-grid label:nth-child(2) {
    grid-column: auto;
  }

  .builder-meta label:nth-child(1),
  .builder-meta label:nth-child(3) {
    grid-column: auto;
  }

  .activity-priority-panel {
    position: static;
  }
}
