:root {
  --bg: #f3f6fa;
  --panel: #ffffff;
  --panel-soft: #f6f8fb;
  --line: #c7ccd5;
  --line-soft: #e4e8ef;
  --text: #101418;
  --muted: #596171;
  --blue: #075bc5;
  --blue-2: #2874e3;
  --blue-soft: #e7f0ff;
  --green: #009f68;
  --green-soft: #c9f8df;
  --red: #c91414;
  --red-soft: #ffd8d8;
  --dark: #111b2d;
  --shadow: 0 16px 35px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

[hidden] {
  display: none !important;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-screen {
  display: grid;
  grid-template-columns: minmax(480px, 1.15fr) minmax(520px, 1fr);
  min-height: 100vh;
  background: #f4f7fb;
}

.login-visual {
  position: relative;
  display: grid;
  align-content: space-between;
  min-height: 100vh;
  padding: 54px;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(8, 15, 28, 0.88), rgba(8, 15, 28, 0.78)),
    linear-gradient(135deg, #0d1a2b, #213247);
}

.login-visual::before {
  content: "";
  position: absolute;
  inset: 25% 0 0;
  background:
    linear-gradient(90deg, transparent 0 15%, rgba(190, 207, 222, 0.12) 15% 16%, transparent 16% 28%, rgba(190, 207, 222, 0.16) 28% 29%, transparent 29% 48%, rgba(190, 207, 222, 0.14) 48% 49%, transparent 49% 76%, rgba(190, 207, 222, 0.12) 76% 77%, transparent 77%),
    linear-gradient(180deg, rgba(214, 225, 235, 0.10), rgba(11, 20, 34, 0.84)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 2px, transparent 2px 128px);
  border-top: 8px solid rgba(5, 12, 22, 0.55);
}

.login-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
}

.brand-logo {
  display: block;
  width: auto;
  object-fit: contain;
}

.brand-logo-login {
  height: 72px;
  max-width: 320px;
}

.brand-logo-sidebar {
  height: 58px;
  max-width: 210px;
}

.office-visual {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 22%;
  height: 210px;
  opacity: 0.45;
}

.office-visual span {
  position: absolute;
  bottom: 0;
  border: 2px solid rgba(189, 208, 226, 0.3);
  background: rgba(10, 21, 36, 0.18);
}

.office-visual span:nth-child(1) { left: 18%; width: 18%; height: 120px; }
.office-visual span:nth-child(2) { left: 42%; width: 16%; height: 160px; }
.office-visual span:nth-child(3) { right: 18%; width: 15%; height: 132px; }
.office-visual span:nth-child(4) { left: 31%; width: 22%; height: 18px; }
.office-visual span:nth-child(5) { right: 31%; width: 18%; height: 18px; }

.login-copy {
  position: relative;
  z-index: 1;
  max-width: 620px;
  margin-bottom: 120px;
}

.login-copy h1 {
  max-width: 620px;
  margin: 0 0 28px;
  font-size: 30px;
  line-height: 1.32;
}

.login-copy p {
  max-width: 540px;
  margin: 0;
  color: #8f9aad;
  font-size: 20px;
  line-height: 1.45;
}

.login-footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  color: #8f9aad;
  font-size: 14px;
  font-weight: 700;
}

.login-footer a {
  color: inherit;
  text-decoration: none;
}

.login-panel-wrap {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 48px;
}

.login-card {
  display: grid;
  gap: 28px;
  width: min(500px, 100%);
  padding: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.login-card h2 {
  margin: 0 0 14px;
  font-size: 30px;
}

.login-card p {
  margin: 0;
  color: #303744;
  font-size: 16px;
  line-height: 1.5;
}

.login-card label {
  display: grid;
  gap: 12px;
  font-weight: 600;
}

.label-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.label-row a,
.login-help a {
  color: var(--blue);
  text-decoration: none;
}

.login-input {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 66px;
  padding: 0 24px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  color: #7a828f;
}

.login-input input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 18px;
}

.login-submit,
.sso-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 64px;
  border-radius: 5px;
  font-size: 20px;
}

.login-submit {
  border: 1px solid #0149ad;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
}

.sso-button {
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--text);
}

.login-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 28px;
  color: #111;
}

.login-divider::before,
.login-divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.login-status {
  min-height: 24px;
  color: var(--red) !important;
}

.login-status[data-state="success"] {
  color: var(--green) !important;
}

.login-help {
  text-align: center;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  width: 300px;
  height: 100vh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #eef2f7;
  overflow: hidden;
}

.brand {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding: 24px 26px 18px;
}

.brand small {
  display: block;
  margin-top: 0;
  color: #2f3540;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sidebar-nav {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  gap: 10px;
  align-content: start;
  padding: 18px 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #b8c2d1 transparent;
}

.sidebar-nav::-webkit-scrollbar {
  width: 8px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: #b8c2d1;
  border-radius: 999px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.nav-item,
.plain-action {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  border: 0;
  background: transparent;
  color: #202631;
  text-align: left;
  text-decoration: none;
}

.nav-item {
  min-height: 56px;
  padding: 10px 22px;
  border-radius: 5px;
  font-size: 18px;
  line-height: 1.25;
}

.nav-item.is-active {
  background: var(--blue-2);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.plain-action {
  padding: 12px 22px;
  font-size: 17px;
}

.sidebar-footer {
  flex: 0 0 auto;
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: #eef2f7;
}

.main-area {
  position: relative;
  z-index: 1;
  min-width: 0;
  margin-left: 300px;
  overflow-x: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 80px;
  padding: 14px 40px;
  border-bottom: 1px solid var(--line);
  background: rgba(243, 246, 250, 0.96);
  backdrop-filter: blur(10px);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(720px, 52vw);
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 17px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  color: #151922;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-left: 22px;
  border-left: 1px solid var(--line);
}

.logout-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
}

.user-menu strong,
.user-menu small {
  display: block;
  text-align: right;
}

.user-menu strong {
  font-size: 20px;
  font-weight: 500;
}

.user-menu small {
  color: #424956;
  font-size: 13px;
}

.avatar,
.mini-avatar,
.letter-avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
}

.avatar {
  width: 48px;
  height: 48px;
  color: #fff;
  background: linear-gradient(135deg, #0b2740, #348d9d);
  font-weight: 700;
}

.screen {
  display: none;
  padding: 44px 40px 64px;
}

.connection-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 24px 40px 0;
  padding: 16px 18px;
  border: 1px solid #f1c96b;
  border-radius: 8px;
  background: #fff7df;
}

.connection-panel[data-state="success"] {
  border-color: #91dfbd;
  background: #e9fff3;
}

.connection-panel strong,
.connection-panel p {
  margin: 0;
}

.connection-panel p {
  margin-top: 4px;
  color: #4b5563;
}

.admin-login-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-login-form input {
  width: 180px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
}

.admin-login-form .primary-button,
.connection-panel > .secondary-button {
  min-height: 42px;
  padding: 0 18px;
  font-size: 15px;
}

.screen.is-visible {
  display: block;
}

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

.page-heading h1 {
  margin: 0;
  font-size: 40px;
  line-height: 1.1;
}

.page-heading p {
  margin: 8px 0 0;
  color: #2f3540;
  font-size: 20px;
}

.compact-heading {
  align-items: center;
  margin-bottom: 26px;
}

.heading-actions,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 54px;
  padding: 0 28px;
  border-radius: 5px;
  font-size: 19px;
}

.primary-button {
  border: 1px solid #0149ad;
  background: var(--blue);
  color: #fff;
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
}

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.metrics-grid {
  display: grid;
  grid-template-columns: minmax(280px, 2.3fr) minmax(150px, 1fr) minmax(150px, 1fr) minmax(280px, 2.3fr);
  gap: 30px;
  margin-bottom: 40px;
}

.status-card,
.compact-metric,
.latency-card {
  min-height: 264px;
  padding: 32px;
}

.status-card {
  position: relative;
  display: grid;
  align-content: space-between;
}

.eyebrow {
  display: block;
  color: #252b35;
  font-size: 20px;
  line-height: 1.4;
  text-transform: uppercase;
}

.status-card strong {
  display: block;
  margin-top: 12px;
  font-size: 30px;
}

.success-ring {
  position: absolute;
  right: 30px;
  top: 30px;
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: var(--green-soft);
}

.success-ring::after {
  content: "✓";
  position: absolute;
  inset: 9px;
  display: grid;
  place-items: center;
  border: 3px solid var(--green);
  border-radius: 50%;
  color: var(--green);
  font-weight: 700;
}

.uptime-row {
  display: flex;
  justify-content: space-between;
  align-items: end;
}

.uptime-row small {
  color: #39404b;
  text-transform: uppercase;
}

.uptime-row span {
  color: var(--blue);
  font-family: Consolas, monospace;
  font-size: 22px;
}

.progress-line {
  height: 7px;
  overflow: hidden;
  border-radius: 10px;
  background: #dce6f5;
}

.progress-line span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.compact-metric {
  display: grid;
  align-content: center;
  gap: 20px;
}

.compact-metric strong,
.latency-card strong {
  display: block;
  font-size: 42px;
  line-height: 1;
}

.compact-metric small,
.latency-card small {
  color: #404754;
  line-height: 1.5;
}

.positive {
  color: var(--green) !important;
}

.mini-lines {
  display: flex;
  gap: 6px;
}

.mini-lines span {
  width: 36px;
  height: 5px;
  border-radius: 20px;
  background: var(--blue);
}

.mini-lines span:last-child {
  background: #b7d3f7;
}

.latency-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.bars {
  display: flex;
  align-items: end;
  gap: 8px;
  height: 72px;
}

.bars span {
  width: 10px;
  border-radius: 3px 3px 0 0;
  background: #b9d7f4;
}

.bars span:nth-child(1) { height: 34px; }
.bars span:nth-child(2) { height: 48px; }
.bars span:nth-child(3) { height: 42px; }
.bars span:nth-child(4) { height: 64px; background: #357bd8; }
.bars span:nth-child(5) { height: 39px; }
.bars span:nth-child(6) { height: 44px; background: var(--blue); }

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 386px;
  gap: 30px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 30px;
}

.card-header h2,
.right-stack h2,
.permissions-card h2,
.smtp-card h2,
.webhook-card h2,
.integrations-card h2,
.general-card h2,
.placeholder-card h2 {
  margin: 0;
  font-size: 23px;
}

.card-header a,
.ghost-link {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 18px;
  text-decoration: none;
}

.table-wrap {
  overflow-x: auto;
}

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

th {
  padding: 20px 30px;
  background: var(--panel-soft);
  color: #2c3340;
  text-align: left;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: uppercase;
}

td {
  padding: 28px 30px;
  border-top: 1px solid var(--line-soft);
  font-size: 18px;
  vertical-align: middle;
}

.activity-card td:first-child,
.activity-card td:nth-child(2),
.users-table td:first-child {
  display: flex;
  align-items: center;
  gap: 18px;
}

.row-icon {
  color: var(--blue);
}

.mini-avatar {
  width: 24px;
  height: 24px;
  margin-right: 8px;
  color: #fff;
  background: #153b48;
  font-size: 9px;
}

.mini-avatar.muted {
  color: #111;
  background: #d9dee7;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.pill.success {
  background: var(--green-soft);
  color: #00784e;
}

.pill.danger {
  background: var(--red-soft);
  color: var(--red);
}

.pill.neutral {
  background: #e5e8eb;
  color: #252b35;
}

.pill.admin {
  background: #d8e8ff;
  color: var(--blue);
}

.right-stack {
  display: grid;
  gap: 30px;
}

.insights-card,
.nodes-card {
  padding: 30px;
}

.timeline {
  display: grid;
  gap: 28px;
  margin: 28px 0 0;
  padding-left: 24px;
  border-left: 3px solid #d7dce5;
}

.timeline li {
  position: relative;
  padding-left: 4px;
  font-size: 18px;
}

.timeline li::marker {
  color: var(--blue);
}

.timeline small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.timeline .danger strong {
  color: var(--red);
}

.node-row {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 82px;
  margin-top: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel-soft);
}

.node-row div {
  flex: 1;
}

.node-row strong,
.node-row small {
  display: block;
}

.node-row small {
  margin-top: 4px;
  color: #2f3540;
}

.node-row i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #76d4b0;
}

.dashboard-calendar-card {
  margin-bottom: 28px;
  overflow: hidden;
}

.dashboard-presentation-card {
  margin-bottom: 28px;
  overflow: hidden;
}

.dashboard-presentation-card .card-header {
  padding-bottom: 18px;
}

.dashboard-presentation-card h2 {
  margin: 5px 0 0;
}

.dashboard-presentation-table {
  min-width: 780px;
}

.dashboard-presentation-table td {
  padding-top: 18px;
  padding-bottom: 18px;
}

.dashboard-presentation-table td:first-child strong,
.dashboard-presentation-table td:first-child small {
  display: block;
}

.dashboard-presentation-table td:first-child small {
  margin-top: 4px;
  color: var(--muted);
}

#screen-dashboard > .metrics-grid,
#screen-dashboard > .dashboard-layout {
  display: none;
}

.dashboard-calendar-header,
.dashboard-calendar-actions,
.dashboard-calendar-filters,
.dashboard-calendar-legend {
  display: flex;
  align-items: center;
}

.dashboard-calendar-header {
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 14px;
}

.dashboard-calendar-header h2 {
  margin: 5px 0 0;
  text-transform: capitalize;
}

.dashboard-calendar-actions {
  gap: 8px;
}

.dashboard-calendar-actions .primary-button,
.dashboard-calendar-actions .secondary-button {
  min-height: 40px;
  padding: 0 15px;
  font-size: 15px;
}

.dashboard-calendar-filters {
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 24px 16px;
}

.calendar-filter {
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--text);
  background: #fff;
  cursor: pointer;
}

.calendar-filter.is-active {
  border-color: var(--blue);
  color: #fff;
  background: var(--blue);
}

.calendar-filter-field {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.calendar-filter-field select,
.calendar-filter-field input {
  min-height: 35px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--text);
  background: #fff;
}

.calendar-search-field {
  margin-left: auto;
}

.calendar-search-field input {
  width: min(240px, 100%);
}

.dashboard-calendar-weekdays,
.dashboard-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.dashboard-calendar-weekdays {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.dashboard-calendar-weekdays span {
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}

.calendar-day {
  min-height: 126px;
  padding: 9px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.calendar-day:nth-child(7n) {
  border-right: 0;
}

.calendar-day.is-outside {
  background: #f8fafc;
  color: #a3adba;
}

.calendar-day.is-today > strong {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
}

.calendar-day ul {
  display: grid;
  gap: 5px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.calendar-event {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px;
  align-items: center;
  width: 100%;
  padding: 5px 6px;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  border-left: 3px solid currentColor;
  border-radius: 3px;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}

.calendar-event.technical {
  color: #075eb5;
  background: #e8f2ff;
}

.calendar-event.commercial {
  color: #08775a;
  background: #e8f8f1;
}

.calendar-event.cancelled {
  opacity: 0.58;
  text-decoration: line-through;
}

.calendar-event time {
  font-weight: 700;
}

.calendar-event span {
  overflow: hidden;
  color: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-day small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.dashboard-calendar-legend {
  justify-content: flex-end;
  gap: 18px;
  padding: 13px 24px;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-calendar-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dashboard-calendar-legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.dashboard-calendar-legend .technical {
  background: #075eb5;
}

.dashboard-calendar-legend .commercial {
  background: #08775a;
}

.breadcrumb {
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.breadcrumb span {
  color: #111;
  margin: 0 6px;
}

.user-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 2.1fr;
  gap: 24px;
  margin-bottom: 30px;
}

.small-stat {
  min-height: 118px;
  padding: 24px;
}

.small-stat strong {
  display: block;
  margin: 10px 0;
  font-size: 26px;
}

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

.integrity-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 28px;
  border-radius: 5px;
  background: var(--blue-2);
  color: #fff;
}

.integrity-banner h2 {
  margin: 0 0 12px;
  font-size: 22px;
}

.integrity-banner p {
  max-width: 560px;
  margin: 0;
  color: #eef5ff;
}

.integrity-banner span {
  flex: none;
  display: grid;
  place-items: center;
  width: 104px;
  height: 72px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.18);
  text-align: center;
  text-transform: uppercase;
}

.users-table-card {
  margin-bottom: 30px;
}

.tabs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 24px;
}

.tabs,
.table-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.tabs button,
.table-actions button {
  min-height: 34px;
  border: 0;
  background: transparent;
  color: #111;
}

.tabs button.is-selected {
  color: var(--blue);
  border-bottom: 2px solid var(--blue);
}

.letter-avatar {
  width: 34px;
  height: 34px;
  margin-right: 16px;
  border-radius: 12px;
}

.letter-avatar.blue {
  background: #dce5ff;
}

.letter-avatar.red {
  color: var(--red);
  background: #ffdcdc;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
}

.status-dot.active { background: #13b879; }
.status-dot.inactive { background: #aaaeb7; }
.status-dot.flagged { background: var(--red); }

.pagination-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 24px;
  border-top: 1px solid var(--line-soft);
  color: #313844;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pagination button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: var(--panel);
}

.pagination button.current {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.permissions-card {
  margin-bottom: 30px;
}

.permissions-card h2 {
  padding: 22px 24px 0;
}

.permission-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(5, minmax(100px, 1fr));
  overflow-x: auto;
  padding-top: 24px;
}

.permission-grid > * {
  min-height: 46px;
  padding: 14px 24px;
  border-top: 1px solid var(--line-soft);
}

.permission-grid input {
  justify-self: center;
  align-self: center;
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}

.permission-head,
.permission-section {
  background: var(--panel-soft);
  color: var(--blue);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.permission-section {
  grid-column: 1 / -1;
  min-height: 36px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.permissions-card .form-actions {
  padding: 18px 24px;
  border-top: 1px solid var(--line-soft);
}

.utility-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.dashed-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  min-height: 230px;
  padding: 42px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--panel);
  text-align: center;
}

.dashed-card h2,
.dashed-card p {
  margin: 0;
}

.dashed-card p {
  max-width: 440px;
  color: #404754;
}

.sales-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.sales-metric {
  position: relative;
  display: grid;
  align-content: start;
  gap: 18px;
  min-height: 230px;
  padding: 28px;
}

.sales-metric > .icon {
  position: absolute;
  right: 26px;
  top: 28px;
  color: var(--blue);
}

.sales-metric .eyebrow {
  max-width: 170px;
  font-size: 14px;
  font-weight: 700;
}

.sales-metric strong {
  font-size: 34px;
  line-height: 1.28;
}

.sales-metric small {
  color: var(--blue);
  font-size: 15px;
  line-height: 1.35;
}

.pipeline-card {
  margin-bottom: 32px;
  padding: 34px;
}

.pipeline-card h2 {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0 0 34px;
  font-size: 22px;
}

.pipeline-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  min-height: 134px;
}

.pipeline-step {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  padding: 22px 18px;
  color: #0c1625;
  text-align: center;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%, 14px 50%);
}

.pipeline-step:first-child {
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%);
}

.pipeline-step:last-child {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 14px 50%);
}

.pipeline-step.muted { background: #e5e7ea; }
.pipeline-step.soft { background: #dce6ff; }
.pipeline-step.mid { background: #d0e0f4; }
.pipeline-step.active {
  background: var(--blue-2);
  color: #fff;
}

.pipeline-step small {
  color: inherit;
  font-size: 11px;
  text-transform: uppercase;
}

.pipeline-step strong {
  font-size: 28px;
  line-height: 1;
}

.pipeline-step span {
  font-size: 13px;
}

.proposal-clients-card {
  margin-bottom: 32px;
}

.proposal-clients-table {
  width: 100%;
  border-collapse: collapse;
}

.proposal-clients-table th,
.proposal-clients-table td {
  padding: 18px 22px;
  border-top: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
}

.proposal-clients-table th {
  background: var(--panel-soft);
  color: #273244;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.proposal-clients-table td strong,
.proposal-clients-table td small {
  display: block;
}

.proposal-clients-table td small {
  margin-top: 5px;
  color: var(--muted);
}

.proposal-builder-form {
  display: grid;
  gap: 18px;
}

.proposal-builder-actions {
  flex-wrap: wrap;
}

.proposal-builder-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.proposal-send-status {
  min-height: 20px;
  margin: -13px 0 16px;
  color: var(--red);
}

.proposal-send-status[data-state="success"] {
  color: var(--green);
}

.proposal-builder-section {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.proposal-builder-section h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.proposal-builder-grid,
.proposal-modules-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px 18px;
}

.proposal-builder-form label {
  display: grid;
  gap: 7px;
  color: #172033;
  font-size: 13px;
  font-weight: 700;
}

.proposal-builder-form input,
.proposal-builder-form select,
.proposal-builder-form textarea {
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font: inherit;
  font-weight: 400;
}

.proposal-builder-form textarea {
  min-height: 80px;
  resize: vertical;
}

.proposal-module-option {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px !important;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.proposal-module-option:has(input:checked) {
  border-color: var(--blue);
  background: #eef6ff;
}

.proposal-module-option input {
  min-height: auto;
}

.proposal-module-option span,
.proposal-module-option small {
  display: block;
}

.proposal-module-option small {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 400;
}

.proposal-values-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
}

.proposal-values-summary > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 18px;
  border-radius: 7px;
  background: #f4f2ea;
}

.proposal-values-summary small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.proposal-values-summary strong {
  font-size: 20px;
  text-align: right;
}

.proposal-values-summary strong small {
  color: #b42318;
  font-size: 12px;
  font-weight: 600;
}

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

.proposal-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  overflow: auto;
  padding: 28px;
  background: rgba(7, 20, 42, .72);
}

.proposal-modal-card {
  display: grid;
  gap: 22px;
  max-width: 980px;
  margin: 0 auto;
}

.proposal-modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(7, 20, 42, .18);
}

.proposal-modal-header h2,
.proposal-modal-header p {
  margin: 0;
}

.proposal-modal-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.proposal-pages {
  display: grid;
  justify-content: center;
  gap: 24px;
}

.proposal-pages.is-generating-pdf .proposal-a4-page {
  width: 794px;
  height: 1123px;
}

.proposal-pdf-capture {
  position: fixed;
  top: 0;
  left: -10000px;
  z-index: -1;
  display: grid;
  width: 794px;
  pointer-events: none;
}

.proposal-a4-page {
  position: relative;
  width: min(100%, 794px);
  aspect-ratio: 210 / 297;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .35);
}

.contract-a4-page {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: 44px 58px 38px;
  color: #111827;
  background: #fff;
  font-family: Arial, sans-serif;
}

.contract-document-header {
  display: grid;
  gap: 4px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #0b4f91;
  color: #0b3b70;
}

.contract-document-header strong {
  font-size: 16px;
  letter-spacing: .05em;
}

.contract-document-header span {
  color: #526273;
  font-size: 11px;
}

.contract-a4-page main {
  flex: 1;
}

.contract-a4-page h2 {
  margin: 0 0 18px;
  color: #0b3b70;
  font-size: 16px;
  line-height: 1.35;
  text-align: center;
}

.contract-clause {
  margin-top: 14px;
}

.contract-clause h3 {
  margin: 0 0 7px;
  color: #0b3b70;
  font-size: 12px;
  line-height: 1.3;
}

.contract-a4-page p {
  margin: 0 0 8px;
  font-size: 10.5px;
  line-height: 1.42;
  text-align: justify;
}

.contract-a4-page footer {
  padding-top: 10px;
  border-top: 1px solid #d8e1ea;
  color: #637384;
  font-size: 9px;
  text-align: center;
}

.contract-signatures {
  margin-top: 28px;
}

.contract-signatures > p {
  margin-bottom: 52px;
  text-align: center;
}

.contract-signatures > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 38px;
}

.contract-signatures span {
  display: grid;
  gap: 5px;
  text-align: center;
}

.contract-signatures i {
  display: block;
  border-top: 1px solid #111827;
}

.contract-signatures small {
  color: #526273;
  font-size: 9px;
}

.proposal-html-page {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: 58px 56px 42px;
  color: #fff;
  background: linear-gradient(150deg, #05204f, #0063b7);
}

.proposal-cover-page {
  color: #fff;
  background: linear-gradient(150deg, #05204f, #0063b7);
}

.proposal-company-page {
  color: #fff;
  background: linear-gradient(150deg, #05204f, #0063b7);
}

.proposal-company-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.proposal-company-top h2,
.proposal-company-top p {
  margin: 0;
}

.proposal-company-top h2 {
  font-size: 42px;
  line-height: 1.05;
}

.proposal-company-top p {
  margin-top: 8px;
  color: #80d9ff;
  font-size: 23px;
  font-weight: 700;
}

.proposal-company-top img {
  width: 112px;
  max-height: 96px;
  object-fit: contain;
  object-position: right center;
}

.proposal-company-layout {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  gap: 30px;
  margin-top: 42px;
}

.proposal-company-about {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.proposal-company-rule {
  width: 86px;
  height: 3px;
  margin-bottom: 18px;
  background: #69d5ff;
}

.proposal-company-about p {
  margin: 0 0 16px;
  color: rgba(255, 255, 255, .92);
  font-size: 15px;
  line-height: 1.52;
}

.proposal-company-about strong {
  max-width: 250px;
  color: #80d9ff;
  font-size: 18px;
  line-height: 1.35;
}

.proposal-company-devices {
  width: calc(100% + 32px);
  height: 230px;
  margin: 38px 0 0 -32px;
  border-radius: 6px;
  object-fit: cover;
  object-position: center;
}

.proposal-company-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.proposal-company-benefits {
  display: grid;
  gap: 12px;
}

.proposal-company-benefit {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 14px;
  align-items: center;
  min-height: 78px;
  padding: 14px;
  border: 1px solid rgba(105, 213, 255, .62);
  border-radius: 7px;
  background: rgba(2, 35, 88, .48);
}

.proposal-company-benefit-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 2px solid #69d5ff;
  border-radius: 50%;
  color: #fff;
  background: #0878d1;
  font-family: Arial, sans-serif;
  font-size: 27px;
  font-weight: 700;
}

.proposal-company-benefit h3,
.proposal-company-benefit p {
  margin: 0;
}

.proposal-company-benefit h3 {
  color: #80d9ff;
  font-size: 14px;
  text-transform: uppercase;
}

.proposal-company-benefit p {
  margin-top: 4px;
  color: rgba(255, 255, 255, .92);
  font-size: 13px;
  line-height: 1.36;
}

.proposal-company-contact {
  margin-top: 26px;
}

.proposal-company-contact h3 {
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid #69d5ff;
  font-size: 22px;
  text-transform: uppercase;
}

.proposal-company-contact dl {
  display: grid;
  gap: 0;
  margin: 0;
}

.proposal-company-contact dl div {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(105, 213, 255, .45);
  font-size: 13px;
  line-height: 1.35;
}

.proposal-company-contact dt {
  color: #80d9ff;
  font-weight: 700;
}

.proposal-company-contact dd {
  margin: 0;
  color: rgba(255, 255, 255, .96);
}

.proposal-html-brand {
  display: grid;
  gap: 2px;
  align-content: start;
}

.proposal-html-brand img {
  width: 158px;
  max-height: 132px;
  object-fit: contain;
  object-position: left center;
}

.proposal-cover-copy {
  display: grid;
  gap: 14px;
  margin-top: 58px;
}

.proposal-cover-copy p,
.proposal-cover-copy h2 {
  margin: 0;
}

.proposal-cover-copy p {
  color: #80d9ff;
  font-size: 24px;
  font-weight: 700;
  text-transform: uppercase;
}

.proposal-cover-copy h2 {
  max-width: 620px;
  font-size: 47px;
  line-height: 1.05;
}

.proposal-cover-copy span {
  max-width: 590px;
  font-size: 18px;
  line-height: 1.45;
}

.proposal-cover-devices {
  display: block;
  width: 100%;
  max-height: 340px;
  margin: 22px 0 16px;
  border-radius: 7px;
  object-fit: cover;
  object-position: center;
}

.proposal-cover-data {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: auto 0 18px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 8px;
  background: rgba(2, 28, 78, .5);
}

.proposal-cover-data div:last-child {
  grid-column: 1 / -1;
}

.proposal-cover-data dt {
  margin-bottom: 5px;
  color: #80d9ff;
  font-size: 12px;
  text-transform: uppercase;
}

.proposal-cover-data dd {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.proposal-html-page footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid currentColor;
  font-size: 13px;
  opacity: .8;
}

.proposal-html-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 2px solid #69d5ff;
  color: #80d9ff;
}

.proposal-html-header img {
  width: 84px;
  max-height: 72px;
  object-fit: contain;
  object-position: left center;
}

.proposal-html-header strong {
  font-size: 16px;
  text-transform: uppercase;
}

.proposal-document-section {
  margin-top: 34px;
}

.proposal-document-section h2 {
  margin: 8px 0 18px;
  color: #fff;
  font-size: 28px;
}

.proposal-document-eyebrow {
  margin: 0;
  color: #80d9ff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.proposal-modules-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.proposal-modules-list li {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 6px;
}

.proposal-module-card.is-included {
  border: 1px solid #75b6ed;
  background: #eef7ff;
  color: #10203c;
}

.proposal-module-card.is-not-included {
  border: 1px solid #dedede;
  background: #fafafa;
  color: #919191;
}

.proposal-module-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: transparent;
}

.proposal-module-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.proposal-module-card.is-not-included .proposal-module-icon {
  filter: grayscale(1);
  opacity: .62;
}

.proposal-module-card strong,
.proposal-module-card small,
.proposal-module-card em {
  display: block;
}

.proposal-module-card small {
  margin-top: 3px;
  color: inherit;
  font-size: 12px;
}

.proposal-module-card em {
  margin-top: 6px;
  color: #008357;
  font-size: 12px;
}

.proposal-module-card.is-not-included em {
  color: #8b8b8b;
}

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

.proposal-price-grid div {
  display: grid;
  gap: 6px;
  padding: 15px;
  border: 1px solid rgba(105, 213, 255, .62);
  border-radius: 6px;
  background: rgba(2, 35, 88, .48);
}

.proposal-implementation-intro {
  max-width: 680px;
  margin: -5px 0 26px;
  color: rgba(255, 255, 255, .9);
  font-size: 16px;
  line-height: 1.45;
}

.proposal-implementation-timeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
}

.proposal-implementation-step {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  padding: 0 8px;
  text-align: center;
}

.proposal-implementation-step::before {
  position: absolute;
  top: 17px;
  left: 0;
  width: 100%;
  height: 3px;
  background: #75b6ed;
  content: "";
}

.proposal-implementation-step:first-child::before {
  left: 50%;
  width: 50%;
}

.proposal-implementation-step:last-child::before {
  width: 50%;
}

.proposal-implementation-step strong {
  z-index: 1;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 3px solid #75b6ed;
  border-radius: 50%;
  color: #fff;
  background: #075eb5;
  font-size: 18px;
}

.proposal-implementation-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 15px 0 11px;
  border: 2px solid #75b6ed;
  border-radius: 50%;
  color: #fff;
  background: rgba(2, 35, 88, .48);
  font-family: Arial, sans-serif;
  font-size: 31px;
  line-height: 1;
}

.proposal-implementation-step h3 {
  min-height: 38px;
  margin: 0 0 7px;
  color: #fff;
  font-size: 14px;
  line-height: 1.28;
}

.proposal-implementation-step p {
  margin: 0;
  color: rgba(255, 255, 255, .84);
  font-size: 12px;
  line-height: 1.4;
}

.proposal-price-grid span {
  color: #80d9ff;
  font-size: 13px;
}

.proposal-price-grid strong {
  font-size: 18px;
}

.proposal-document-note {
  margin-top: auto;
  padding: 18px;
  border-left: 4px solid #69d5ff;
  background: rgba(2, 35, 88, .48);
  line-height: 1.55;
}

.proposal-acceptance {
  margin-top: auto;
}

.proposal-acceptance div {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 10px;
  align-items: end;
  margin-top: 20px;
}

.proposal-acceptance i {
  display: block;
  min-height: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, .72);
}

.client-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 28px;
  margin-bottom: 32px;
}

.client-stat {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 132px;
  padding: 28px;
}

.client-stat strong {
  display: block;
  margin: 6px 0;
  font-size: 36px;
}

.clients-table-card {
  overflow: hidden;
}

.clients-table {
  min-width: 920px;
}

.clients-table td {
  height: 76px;
}

.clients-table td strong,
.clients-table td small {
  display: block;
}

.clients-table td small {
  max-width: 260px;
  margin-top: 4px;
  color: var(--muted);
}

.clients-table tbody tr,
.commercial-client-card,
.process-table tbody tr {
  cursor: pointer;
}

.client-detail-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.client-profile-panel {
  position: sticky;
  top: 104px;
  display: grid;
  gap: 18px;
  padding: 26px;
}

.client-profile-panel h1 {
  margin: 0;
  font-size: 24px;
  text-align: center;
}

.client-profile-panel > strong {
  color: var(--muted);
  text-align: center;
}

.client-photo-placeholder {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.client-photo-placeholder .icon {
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  border: 2px solid var(--line);
  border-radius: 999px;
  color: #9aa6b7;
}

.client-data-section {
  display: grid;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.client-data-section h2 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.client-data-section dl {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 14px 12px;
  margin: 0;
}

.client-data-section dt {
  color: var(--muted);
  font-size: 13px;
}

.client-data-section dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
}

.client-activity-panel {
  display: grid;
  gap: 22px;
  min-width: 0;
}

.client-detail-tabs {
  order: 0;
  display: flex;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--line);
}

.client-detail-tabs button {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #4c5565;
  white-space: nowrap;
  font-weight: 700;
}

.client-detail-tabs button.is-active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.interaction-card {
  order: 2;
  display: grid;
  gap: 14px;
  padding: 20px;
}

.interaction-card[hidden],
.client-detail-metrics[hidden] {
  display: none;
}

.interaction-tabs,
.interaction-actions,
.interaction-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.interaction-tabs button {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: #4b5564;
}

.interaction-tabs button.is-active {
  color: var(--blue);
  font-weight: 700;
}

.interaction-actions {
  color: #667386;
}

.interaction-card > textarea:not(#clientInteractionNote) {
  display: none;
}

.interaction-card textarea {
  min-height: 86px;
  resize: vertical;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

.interaction-footer {
  justify-content: space-between;
}

.client-detail-metrics {
  order: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 18px;
}

.client-detail-metrics.client-process-context {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.client-process-context-heading,
.client-process-context-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.client-process-context h2,
.client-process-context p {
  margin: 0;
}

.client-process-context h2 {
  margin-top: 6px;
  font-size: 26px;
}

.client-process-context p {
  max-width: 760px;
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.45;
}

.client-process-progress {
  display: grid;
  grid-template-columns: repeat(6, minmax(94px, 1fr));
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.client-process-progress span {
  min-width: 94px;
  padding: 11px 8px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  background: #f6f8fb;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}

.client-process-progress span:last-child {
  border-right: 0;
}

.client-process-progress .is-complete {
  color: #08775a;
  background: #e8f8f1;
}

.client-process-progress .is-current {
  color: #fff;
  background: var(--blue);
}

.client-process-context-footer strong,
.client-process-context-footer small {
  display: block;
}

.client-process-context-footer small {
  max-width: 680px;
  margin-top: 6px;
  color: var(--muted);
}

.client-process-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 860px) {
  .client-process-context-heading,
  .client-process-context-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .client-process-actions {
    justify-content: flex-start;
  }
}

.client-timeline-card {
  order: 3;
  padding: 24px;
}

.client-rdv-card,
.client-proposals-card,
.client-contracts-card {
  order: 3;
  overflow: hidden;
}

.client-rdv-card .card-header,
.client-proposals-card .card-header,
.client-contracts-card .card-header {
  padding: 22px 24px;
}

.client-rdv-card h2,
.client-proposals-card h2,
.client-contracts-card h2 {
  margin: 5px 0 0;
}

.client-rdv-table,
.client-proposals-table,
.client-contracts-table {
  min-width: 760px;
}

.client-rdv-table td,
.client-proposals-table td,
.client-contracts-table td {
  height: 72px;
}

.client-rdv-table td strong,
.client-rdv-table td small,
.client-proposals-table td strong,
.client-proposals-table td small,
.client-contracts-table td strong,
.client-contracts-table td small {
  display: block;
}

.client-rdv-table td small,
.client-proposals-table td small,
.client-contracts-table td small {
  margin-top: 4px;
  color: var(--muted);
}

.empty-table-message {
  margin: 0;
  padding: 16px 0;
  color: var(--muted);
  text-align: center;
}

.client-timeline {
  display: grid;
  gap: 18px;
  margin: 0;
  padding-left: 28px;
  border-left: 2px solid var(--line);
}

.client-timeline li {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
}

.client-timeline li::before {
  content: "";
  position: absolute;
  left: -38px;
  top: 18px;
  width: 18px;
  height: 18px;
  border: 4px solid #dce6f4;
  border-radius: 999px;
  background: var(--blue);
}

.client-timeline span {
  color: #303848;
}

.client-timeline small {
  color: var(--muted);
}

.sales-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 316px;
  gap: 32px;
  margin-bottom: 32px;
}

.opportunities-card .card-header {
  padding: 24px 28px;
}

.opportunities-table {
  min-width: 720px;
}

.opportunities-table td {
  height: 84px;
}

.pill.solid {
  background: var(--blue);
  color: #fff;
}

.probability {
  display: inline-block;
  width: 52px;
  height: 6px;
  margin-right: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe3ea;
  vertical-align: middle;
}

.probability i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.goals-card {
  padding: 28px;
}

.goals-card h2 {
  margin: 0 0 32px;
  font-size: 22px;
}

.goal-row {
  display: grid;
  gap: 12px;
  margin-bottom: 30px;
}

.goal-row div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.goal-row small {
  color: #2f3540;
}

.goal-row strong {
  color: var(--blue);
  font-size: 12px;
  text-transform: uppercase;
}

.goal-bar {
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbe0e7;
}

.goal-bar span {
  display: block;
  height: 100%;
  background: var(--blue);
}

.forecast-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.opportunities-table td:last-child {
  white-space: nowrap;
}

.opportunities-table td:last-child .ghost-link + .ghost-link {
  margin-left: 10px;
  color: var(--red);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(15, 23, 42, 0.48);
}

.modal-card {
  width: min(760px, 100%);
  max-height: calc(100vh - 56px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 26px 28px;
  border-bottom: 1px solid var(--line-soft);
}

.modal-header h2,
.modal-header p {
  margin: 0;
}

.modal-header p {
  margin-top: 6px;
  color: var(--muted);
}

.modal-header .icon-button {
  font-size: 30px;
}

.opportunity-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 28px;
}

.opportunity-form label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

.opportunity-form input,
.opportunity-form select,
.opportunity-form textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  color: var(--text);
}

.opportunity-form textarea {
  resize: vertical;
}

.full-field,
.form-status,
.modal-actions {
  grid-column: 1 / -1;
}

.form-status {
  min-height: 20px;
  margin: 0;
  color: var(--red);
}

.form-status[data-state="success"] {
  color: var(--green);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
}

.appointment-modal-actions span {
  flex: 1;
}

.danger-button {
  min-height: 54px;
  padding: 0 20px;
  border: 1px solid #ef4444;
  border-radius: 5px;
  color: #b91c1c;
  background: #fff;
}

.process-fields-panel {
  display: grid;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.process-fields-panel h3,
.process-fields-panel h4,
.process-fields-panel p {
  margin: 0;
}

.process-fields-panel p {
  color: var(--muted);
}

.process-fields-panel section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
}

.process-fields-panel h4 {
  grid-column: 1 / -1;
  font-size: 16px;
}

.implementation-checklist-group {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #f8fbff;
}

.implementation-checklist-group h5 {
  margin: 0;
  color: #172033;
  font-size: 14px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.implementation-checklist-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px 16px;
}

.implementation-checklist-grid label {
  margin: 0;
}

.field-missing {
  padding: 8px;
  border: 1px solid var(--red);
  border-radius: 8px;
  background: #fff5f3;
}

#clientForm.is-focused-requirements .process-fields-panel {
  border-color: var(--blue);
  background: #f2f7ff;
}

#clientForm.is-focused-requirements .process-fields-panel section {
  grid-template-columns: 1fr;
}

.team-activity-card {
  padding: 30px;
}

.team-activity-card h2 {
  margin: 0 0 28px;
  font-size: 22px;
}

.team-timeline {
  display: grid;
  gap: 28px;
  margin: 0;
  padding-left: 36px;
  border-left: 2px solid #d7dce5;
}

.team-timeline li {
  position: relative;
  font-size: 17px;
  line-height: 1.45;
}

.team-timeline li::before {
  content: "";
  position: absolute;
  left: -45px;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--blue);
}

.team-timeline li:nth-child(2)::before {
  background: #b7c5e4;
}

.team-timeline li.danger::before {
  background: var(--red);
}

.team-timeline a {
  color: var(--blue);
  text-decoration: none;
}

.team-timeline span {
  color: var(--red);
}

.team-timeline small {
  display: block;
  margin-top: 8px;
  color: #4c5360;
  font-size: 12px;
  text-transform: uppercase;
}

.contract-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 28px;
  margin-bottom: 38px;
}

.contract-stat {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 148px;
  padding: 30px;
}

.contract-stat .eyebrow {
  font-size: 15px;
  font-weight: 700;
  text-transform: none;
}

.contract-stat strong {
  display: block;
  margin: 6px 0 8px;
  font-size: 40px;
  line-height: 1;
}

.contract-stat small {
  color: #07142a;
  font-weight: 600;
}

.danger-text {
  color: var(--red) !important;
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
}

.stat-icon.blue {
  color: var(--blue);
  background: #dce5ff;
}

.stat-icon.red {
  color: var(--red);
  background: #ffd7d1;
}

.stat-icon.soft {
  color: #12324d;
  background: #d5e7fb;
}

.contracts-table-card {
  margin-bottom: 38px;
}

.contract-filters {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 18px;
  align-items: center;
  padding: 30px;
  border-bottom: 1px solid var(--line);
}

.contracts-filter-note {
  margin: 0;
  color: var(--muted);
}

.contract-filters label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  font-weight: 600;
}

.contract-filters select {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.filter-button {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: #222936;
  font-size: 17px;
}

.contracts-table {
  min-width: 1020px;
}

.contracts-table td {
  height: 112px;
  font-size: 18px;
}

.contracts-table td:first-child strong {
  display: block;
  max-width: 230px;
  font-size: 20px;
  line-height: 1.35;
}

.contracts-table td:first-child small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.contracts-table td:nth-child(2) {
  color: #272d37;
  font-size: 20px;
  line-height: 1.35;
}

.contracts-table .pill {
  min-width: 118px;
  justify-content: flex-start;
}

.pill.waiting {
  max-width: 150px;
  background: #dceaff;
  color: var(--blue);
  white-space: normal;
}

.pill.process-pill {
  background: #e7f0ff;
  color: var(--blue);
}

.process-summary-grid {
  display: none;
}

.process-stat {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 138px;
  padding: 24px;
}

.process-stat strong {
  display: block;
  margin: 6px 0;
  font-size: 34px;
  line-height: 1;
}

.process-stat small {
  display: block;
  color: var(--muted);
}

.process-flow-card {
  padding: 28px;
  margin-bottom: 32px;
}

.process-flow-card .card-header {
  margin-bottom: 24px;
}

.process-flow {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 14px;
}

.process-flow article {
  position: relative;
  min-height: 132px;
  padding: 22px;
  background: #eef3fb;
  border: 1px solid #d5ddea;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%, 14px 50%);
}

.process-flow article:first-child {
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%);
}

.process-flow article.is-complete {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.process-flow small {
  display: block;
  color: inherit;
  font-size: 12px;
  text-transform: uppercase;
}

.process-flow strong {
  display: block;
  margin: 8px 0;
  font-size: 30px;
}

.process-flow span {
  color: inherit;
  font-size: 14px;
}

.process-content-grid {
  display: block;
}

.process-kanban-card {
  grid-column: 1 / -1;
  overflow: hidden;
}

.process-kanban-card .card-header {
  padding: 28px 30px 18px;
}

.process-kanban-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(180px, 1fr));
  gap: 14px;
  padding: 0 30px 30px;
  overflow-x: auto;
}

.kanban-column {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 260px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f8fb;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.kanban-column.is-drop-target {
  border-color: var(--blue);
  background: #eef5ff;
}

.kanban-column header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.kanban-column header strong {
  font-size: 13px;
  text-transform: uppercase;
}

.kanban-column header span {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e7f0ff;
  color: var(--blue);
  font-weight: 800;
}

.kanban-column > div {
  display: grid;
  gap: 10px;
}

.kanban-client-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(29, 41, 57, 0.06);
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.kanban-client-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(29, 41, 57, 0.1);
}

.kanban-client-card.is-dragging {
  opacity: 0.55;
  transform: scale(0.98);
  cursor: grabbing;
}

.kanban-client-card strong {
  font-size: 15px;
  line-height: 1.25;
}

.kanban-client-card span {
  width: fit-content;
  padding: 3px 9px;
  border-radius: 999px;
  background: #dbeafe;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.kanban-client-card small,
.kanban-empty {
  color: var(--muted);
  font-size: 13px;
}

.kanban-card-actions {
  display: flex;
  gap: 10px;
  padding-top: 6px;
}

.kanban-card-actions .ghost-link {
  font-size: 13px;
}

.process-table-card {
  display: none;
}

.process-table {
  min-width: 880px;
}

.process-table td {
  height: 92px;
}

.process-table td strong,
.process-table td small {
  display: block;
}

.process-table td small {
  margin-top: 6px;
  color: var(--muted);
}

.process-checklist-card {
  display: none;
  align-content: start;
  gap: 18px;
  padding: 28px;
}

.process-checklist-card h2 {
  margin: 0 0 6px;
}

.process-checklist-card label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.process-checklist-card input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

.process-sla-box {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 18px;
  background: var(--panel);
  border-radius: 6px;
}

.process-sla-box strong {
  font-size: 30px;
}

.contracts-bottom-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 0.9fr);
  gap: 36px;
}

.recent-contracts-card {
  padding: 30px;
}

.recent-contracts-card h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 26px;
  font-size: 24px;
}

.contract-timeline {
  display: grid;
  gap: 28px;
  margin: 0;
  padding-left: 42px;
  border-left: 3px solid #d0d6df;
}

.contract-timeline li {
  position: relative;
  font-size: 16px;
  line-height: 1.45;
}

.contract-timeline li::before {
  content: "↥";
  position: absolute;
  left: -52px;
  top: 0;
  display: grid;
  place-items: center;
  width: 28px;
  height: 38px;
  border-radius: 14px;
  background: #8a8f99;
  color: #fff;
}

.contract-timeline li.done::before {
  content: "✓";
  background: var(--blue);
}

.contract-timeline li.warning::before {
  content: "△";
  background: var(--red);
}

.contract-timeline strong,
.contract-timeline small {
  display: block;
}

.contract-timeline small {
  color: #111827;
}

.efficiency-card {
  min-height: 260px;
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.45)),
    radial-gradient(circle at 20% 20%, rgba(8, 91, 197, 0.18), transparent 42%);
  box-shadow: 0 22px 40px rgba(15, 23, 42, 0.14);
  color: #fff;
}

.efficiency-card h2 {
  margin: 0 0 18px;
  color: #fff;
  font-size: 28px;
}

.efficiency-card p {
  max-width: 560px;
  margin: 0 0 96px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 18px;
  line-height: 1.45;
}

.efficiency-card strong {
  color: #dbe8ff;
}

.efficiency-progress {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.36);
}

.efficiency-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #c8d8ff;
}

.efficiency-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.9);
}

.settings-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.95fr);
  gap: 24px;
  margin-bottom: 24px;
}

.smtp-card,
.webhook-card,
.integrations-card,
.general-card {
  padding: 26px;
}

.smtp-card h2,
.webhook-card h2,
.integrations-card h2,
.general-card h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.settings-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.smtp-test-recipient {
  grid-column: 1 / -1;
}

.smtp-provider-hint {
  margin: 14px 0 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.45;
}

.smtp-provider-hint strong {
  color: #0f4fb8;
}

.settings-form label,
.general-grid label {
  display: grid;
  gap: 10px;
  color: #101418;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.settings-form input,
.general-grid select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #f0f2f5;
  color: #111;
  font-family: Consolas, monospace;
  font-size: 14px;
}

.toggle-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 40px 0 26px;
  padding: 20px;
  border-radius: 4px;
  background: var(--panel-soft);
}

.toggle-panel strong,
.toggle-panel small {
  display: block;
}

.toggle-panel strong {
  font-size: 18px;
}

.toggle-panel small {
  margin-top: 4px;
  color: #343b47;
}

.switch {
  position: relative;
  display: inline-flex;
  width: 46px;
  height: 24px;
}

.switch input {
  opacity: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #c7ccd5;
}

.switch span::after {
  content: "";
  position: absolute;
  right: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
}

.switch input:checked + span {
  background: var(--blue);
}

.settings-aside {
  display: grid;
  gap: 24px;
}

.health-panel {
  min-height: 230px;
  padding: 28px;
  border-radius: 6px;
  background: var(--dark);
  color: #fff;
}

.health-panel h2 {
  margin: 14px 0 12px;
}

.health-panel p {
  color: #aeb9cb;
}

.health-panel div {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 26px;
}

.health-panel span:not(.icon) {
  padding: 8px 12px;
  border: 1px solid #254d8d;
  border-radius: 3px;
  background: #17346a;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
}

.update-card {
  padding: 26px;
}

.update-card div {
  display: flex;
  gap: 18px;
  margin-top: 24px;
  padding: 20px;
  border-left: 4px solid var(--blue);
  background: var(--panel-soft);
}

.update-card p {
  margin: 0;
}

.update-card p strong {
  display: block;
  margin-bottom: 6px;
}

.webhook-card {
  margin-bottom: 24px;
}

.settings-bottom-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.6fr);
  gap: 24px;
}

.integration-row {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px 16px;
}

.integration-row strong,
.integration-row small {
  display: block;
}

.integration-row small {
  margin-top: 4px;
  color: #353c48;
}

.integration-logo {
  width: 42px;
  height: 42px;
  border-radius: 2px;
}

.integration-logo.google {
  background: linear-gradient(135deg, #e9eef6, #ffffff);
  box-shadow: inset 16px 16px 0 #e5e7eb, inset 26px 18px 0 #4a90e2;
}

.integration-logo.stripe {
  background: linear-gradient(135deg, #082033, #0a5166);
}

.integration-logo.aws {
  background: radial-gradient(circle at 60% 40%, #315b6d, #0d2632 60%);
}

.checkmark {
  margin-left: auto;
  color: var(--green);
  font-size: 28px;
}

.broken-link {
  margin-left: auto;
  color: #1b2029;
  font-size: 28px;
}

.general-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 44px;
}

.retention-box,
.debug-row {
  padding: 18px;
  border-radius: 4px;
  background: var(--panel-soft);
}

.retention-box strong {
  display: block;
  margin-bottom: 16px;
}

.retention-box input {
  width: 70%;
  accent-color: var(--blue);
}

.retention-box span {
  margin-left: 16px;
  font-family: Consolas, monospace;
}

.debug-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.debug-row strong,
.debug-row small {
  display: block;
}

.debug-row small {
  color: var(--muted);
}

.map-panel {
  display: grid;
  place-items: center;
  min-height: 164px;
  margin-top: 32px;
  border-radius: 4px;
  background:
    linear-gradient(rgba(214, 232, 241, 0.5), rgba(214, 232, 241, 0.5)),
    repeating-linear-gradient(165deg, #b9d2dc 0 8px, #d7e7ee 8px 18px);
  color: var(--blue);
  text-transform: uppercase;
}

.map-panel small {
  color: #1f2937;
  letter-spacing: 0;
}

.placeholder-card {
  padding: 32px;
}

.floating-action {
  position: fixed;
  right: 40px;
  bottom: 40px;
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  border: 0;
  border-radius: 18px;
  background: var(--blue);
  color: #fff;
  box-shadow: var(--shadow);
}

.icon {
  position: relative;
  display: inline-block;
  width: 24px;
  height: 24px;
  flex: none;
  color: currentColor;
}

.grid-icon {
  background:
    linear-gradient(currentColor 0 0) 2px 2px / 7px 7px,
    linear-gradient(currentColor 0 0) 15px 2px / 7px 7px,
    linear-gradient(currentColor 0 0) 2px 15px / 7px 7px,
    linear-gradient(currentColor 0 0) 15px 15px / 7px 7px;
  background-repeat: no-repeat;
}

.users-icon::before,
.users-icon::after,
.add-user-icon::before,
.add-user-icon::after {
  content: "";
  position: absolute;
  border: 2px solid currentColor;
}

.users-icon::before {
  left: 3px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 10px 2px 0 -2px currentColor;
}

.users-icon::after {
  left: 1px;
  bottom: 4px;
  width: 17px;
  height: 7px;
  border-radius: 9px 9px 0 0;
}

.gear-icon::before {
  content: "⚙";
  position: absolute;
  inset: -3px 0 0;
  font-size: 23px;
}

.diamond-icon {
  background:
    linear-gradient(45deg, currentColor 45%, transparent 46%) 2px 8px / 9px 9px,
    linear-gradient(45deg, currentColor 45%, transparent 46%) 13px 8px / 9px 9px,
    linear-gradient(45deg, currentColor 45%, transparent 46%) 8px 2px / 9px 9px,
    linear-gradient(45deg, currentColor 45%, transparent 46%) 8px 14px / 9px 9px;
  background-repeat: no-repeat;
}

.help-icon::before {
  content: "?";
  position: absolute;
  inset: 1px;
  display: grid;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-weight: 700;
}

.exit-icon::before {
  content: "↪";
  position: absolute;
  inset: 0;
  font-size: 25px;
}

.search-icon::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.search-icon::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 10px;
  height: 2px;
  background: currentColor;
  transform: rotate(45deg);
}

.bell-icon::before { content: "♧"; position: absolute; inset: -2px 0 0; font-size: 25px; transform: rotate(180deg); }
.refresh-icon::before { content: "⟳"; position: absolute; inset: -2px 0 0; font-size: 24px; }
.download-icon::before { content: "⇩"; position: absolute; inset: -2px 0 0; font-size: 24px; }
.plus-icon::before { content: "+"; position: absolute; inset: -1px 0 0; display: grid; place-items: center; font-size: 30px; }
.filter-icon::before { content: "≡"; position: absolute; inset: -2px 0 0; font-size: 22px; transform: rotate(180deg); }
.mail-icon::before { content: "✉"; position: absolute; inset: -1px 0 0; font-size: 22px; }
.webhook-icon::before { content: "⌘"; position: absolute; inset: 0; font-size: 22px; }
.puzzle-icon::before { content: "✣"; position: absolute; inset: 0; font-size: 22px; }
.map-icon::before { content: "♧"; position: absolute; inset: 0; font-size: 22px; }
.sliders-icon::before { content: "≋"; position: absolute; inset: -4px 0 0; font-size: 28px; }
.alert-icon::before { content: "◇"; position: absolute; inset: 0; color: var(--red); font-size: 24px; }
.shield-icon::before { content: "⬟"; position: absolute; inset: 0; font-size: 20px; }
.server-icon::before { content: "▣"; position: absolute; inset: -2px 0 0; font-size: 25px; }
.server-icon.dark { color: #1b2029; }
.add-user-icon::before { content: "+"; right: 0; top: -2px; border: 0; font-size: 18px; font-weight: 700; }
.add-user-icon::after { left: 3px; bottom: 3px; width: 16px; height: 8px; border-radius: 9px 9px 0 0; }
.document-icon::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 3px;
  width: 13px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 2px;
  box-shadow: inset 0 -5px 0 rgba(8, 91, 197, 0.12);
}

.document-icon::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 9px;
  width: 8px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor;
}

.calendar-alert-icon::before {
  content: "➜";
  position: absolute;
  inset: 2px 0 0;
  display: grid;
  place-items: center;
  border: 2px solid currentColor;
  border-top-width: 5px;
  border-radius: 2px;
  font-size: 16px;
}

.money-icon::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 6px;
  width: 18px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 2px;
}

.money-icon::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 9px;
  width: 6px;
  height: 6px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.lock-icon::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 10px;
  width: 12px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 2px;
}

.lock-icon::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 3px;
  width: 8px;
  height: 10px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.building-icon::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 4px;
  width: 14px;
  height: 17px;
  border: 2px solid currentColor;
}

.building-icon::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 8px;
  width: 2px;
  height: 2px;
  background: currentColor;
  box-shadow: 5px 0 0 currentColor, 0 5px 0 currentColor, 5px 5px 0 currentColor, 0 10px 0 currentColor, 5px 10px 0 currentColor;
}

.trend-icon::before {
  content: "";
  position: absolute;
  left: 2px;
  bottom: 5px;
  width: 19px;
  height: 13px;
  border-left: 3px solid currentColor;
  border-top: 3px solid currentColor;
  transform: skewY(-35deg) rotate(135deg);
}

.trend-icon::after {
  content: "";
  position: absolute;
  right: 2px;
  top: 4px;
  width: 7px;
  height: 7px;
  border-top: 3px solid currentColor;
  border-right: 3px solid currentColor;
}

.wallet-icon::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 6px;
  width: 18px;
  height: 13px;
  border: 2px solid currentColor;
  border-radius: 2px;
}

.wallet-icon::after {
  content: "";
  position: absolute;
  right: 2px;
  top: 10px;
  width: 8px;
  height: 6px;
  border: 2px solid currentColor;
  border-radius: 2px;
  background: var(--panel);
}

.chart-icon::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 2px solid currentColor;
  border-radius: 2px;
}

.chart-icon::after {
  content: "";
  position: absolute;
  left: 8px;
  bottom: 7px;
  width: 3px;
  height: 5px;
  background: currentColor;
  box-shadow: 5px -4px 0 currentColor, 10px -1px 0 currentColor;
}

.funnel-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 16px;
  height: 16px;
  border: 3px solid currentColor;
  border-bottom: 0;
  clip-path: polygon(0 0, 100% 0, 60% 62%, 60% 100%, 40% 100%, 40% 62%);
}

@media (max-width: 1180px) {
  .login-screen {
    grid-template-columns: 1fr;
  }

  .login-visual {
    min-height: 420px;
  }

  .login-copy {
    margin-bottom: 60px;
  }

  .sidebar { width: 230px; }
  .main-area { margin-left: 230px; }

  .brand-logo-sidebar {
    height: 50px;
    max-width: 180px;
  }

  .brand {
    padding: 18px 18px 12px;
  }

  .sidebar-nav {
    gap: 8px;
    padding: 12px;
  }

  .nav-item {
    min-height: 50px;
    padding: 9px 16px;
    font-size: 15px;
    gap: 12px;
  }

  .plain-action {
    padding: 10px 16px;
    font-size: 15px;
    gap: 12px;
  }

  .sidebar-footer {
    padding: 12px;
  }

  .metrics-grid,
  .dashboard-layout,
  .settings-top-grid,
  .settings-bottom-grid,
  .sales-metrics-grid,
  .sales-content-grid,
  .client-summary-grid,
  .client-detail-layout,
  .client-detail-metrics,
  .process-summary-grid,
  .process-content-grid,
  .contract-summary-grid,
  .contracts-bottom-grid {
    grid-template-columns: 1fr;
  }

  .pipeline-steps {
    grid-template-columns: 1fr;
  }

  .pipeline-step,
  .pipeline-step:first-child,
  .pipeline-step:last-child,
  .process-flow article,
  .process-flow article:first-child {
    clip-path: none;
  }

  .process-flow {
    grid-template-columns: 1fr;
  }

  .process-kanban-board {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }

  .right-stack {
    grid-template-columns: 1fr 1fr;
  }

  .user-summary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .login-visual,
  .login-panel-wrap {
    min-height: auto;
    padding: 28px 20px;
  }

  .login-card {
    padding: 28px 20px;
  }

  .brand-logo-login {
    height: 58px;
    max-width: 260px;
  }

  .login-copy h1 {
    font-size: 25px;
  }

  .login-copy p {
    font-size: 17px;
  }

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

  .main-area {
    margin-left: 0;
  }

  .sidebar-nav {
    padding: 12px;
  }

  .sidebar-footer {
    padding: 16px;
  }

  .topbar,
  .connection-panel,
  .page-heading,
  .heading-actions,
  .tabs-row,
  .pagination-row,
  .utility-grid,
  .right-stack,
  .settings-form,
  .general-grid {
    flex-direction: column;
    display: flex;
    align-items: stretch;
  }

  .dashboard-calendar-card {
    overflow-x: auto;
  }

  .dashboard-calendar-header {
    min-width: 760px;
  }

  .dashboard-calendar-filters,
  .dashboard-calendar-weekdays,
  .dashboard-calendar-grid,
  .dashboard-calendar-legend {
    min-width: 760px;
  }

  .screen {
    padding: 28px 16px 80px;
  }

  .search-box {
    width: 100%;
  }

  .connection-panel {
    margin: 16px;
  }

  .admin-login-form {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-login-form input {
    width: 100%;
  }

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

  .metrics-grid,
  .dashboard-layout,
  .settings-top-grid,
  .settings-bottom-grid,
  .sales-metrics-grid,
  .sales-content-grid,
  .client-summary-grid,
  .client-detail-layout,
  .client-detail-metrics,
  .process-summary-grid,
  .process-content-grid,
  .contract-summary-grid,
  .contracts-bottom-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .contract-filters {
    grid-template-columns: 1fr;
  }

  .filter-button {
    justify-self: stretch;
  }

  .process-kanban-board {
    grid-template-columns: 1fr;
    padding: 0 18px 18px;
  }

  .client-profile-panel {
    position: static;
  }

  .permission-grid {
    grid-template-columns: minmax(190px, 1.3fr) repeat(5, 95px);
  }

  .floating-action {
    right: 18px;
    bottom: 18px;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  body * {
    visibility: hidden !important;
  }

  #proposalPages,
  #proposalPages * {
    visibility: visible !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  #proposalPages {
    position: absolute;
    inset: 0 auto auto 0;
    display: block;
    width: 210mm;
  }

  .proposal-modal {
    position: static;
    overflow: visible;
    padding: 0;
    background: transparent;
  }

  .proposal-modal-header {
    display: none;
  }

  .proposal-a4-page {
    width: 210mm;
    height: 297mm;
    box-shadow: none;
    break-after: page;
    page-break-after: always;
  }

  .proposal-html-page {
    background-color: #05204f !important;
    background-image: linear-gradient(150deg, #05204f, #0063b7) !important;
  }

  .proposal-a4-page:last-child {
    break-after: auto;
    page-break-after: auto;
  }
}
