:root {
  --bg: #f6f9fa;
  --panel: #ffffff;
  --ink: #263238;
  --muted: #60717b;
  --line: #dce9ee;
  --blue: #62b6de;
  --blue-dark: #4aa7d0;
  --green: #8fc31f;
  --green-dark: #7aaa15;
  --danger: #c84d5c;
  --shadow: 0 18px 45px rgba(47, 96, 117, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #fff url("https://converto.pt/wp-content/uploads/2025/09/Capturar.png") center/contain no-repeat;
  border: 1px solid rgba(98, 182, 222, 0.22);
  box-shadow: 0 10px 24px rgba(98, 182, 222, 0.16);
}

.brand h1 {
  margin: 0;
  font-size: 2rem;
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  letter-spacing: 0;
}

.brand p {
  margin: 5px 0 0;
  color: var(--muted);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-panel {
  max-width: 420px;
  margin: 12vh auto;
  padding: 28px;
  position: relative;
  overflow: hidden;
}

.login-panel::before,
.lead-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--green));
}

.login-panel .brand {
  align-items: center;
  margin-bottom: 22px;
}

.login-panel .brand-mark {
  width: 62px;
  height: 62px;
}

.password-change-page {
  min-width: 0;
  padding: 24px 16px;
}

.password-change-panel {
  width: 100%;
  max-width: 520px;
  margin: max(32px, 9vh) auto;
  padding: 30px;
  overflow: hidden;
  position: relative;
}

.password-change-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--green));
}

.password-change-panel .brand {
  align-items: center;
  margin-bottom: 20px;
}

.password-change-panel .brand-mark {
  width: 58px;
  height: 58px;
}

.password-change-panel .brand h1 {
  font-size: 1.9rem;
}

.password-change-eyebrow {
  margin: 0 0 3px !important;
  color: var(--green-dark) !important;
  font-size: 0.72rem;
  font-weight: 750;
  text-transform: uppercase;
}

.password-change-intro {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.55;
}

.password-change-form {
  display: grid;
  gap: 16px;
}

.password-change-form input,
.password-change-form button,
.password-change-logout button,
.password-change-login {
  min-height: 44px;
}

.password-change-form input:focus-visible,
.password-change-form button:focus-visible,
.password-change-logout button:focus-visible,
.password-change-login:focus-visible {
  outline: 3px solid rgba(98, 182, 222, 0.35);
  outline-offset: 2px;
}

.password-change-logout {
  margin-top: 12px;
}

.password-change-logout button,
.password-change-login {
  width: 100%;
}

.password-change-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  text-decoration: none;
  font-weight: 650;
  font-size: 0.9rem;
}

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

.button,
button {
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: #fff;
  cursor: pointer;
  font-weight: 750;
  padding: 9px 14px;
}

.button.secondary {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
}

.button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

label {
  display: block;
  margin: 0 0 7px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--muted);
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  padding: 10px 12px;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.field {
  margin-bottom: 14px;
}

.lead-list {
  display: grid;
  gap: 14px;
}

.lead-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 20px;
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.lead-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.lead-title {
  margin: 0;
  font-size: 1.2rem;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.status {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(98, 182, 222, 0.12);
  color: #217ea9;
  font-weight: 750;
  font-size: 0.82rem;
}

.details {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
}

.details strong {
  color: var(--ink);
}

.empty {
  padding: 34px;
  text-align: center;
  color: var(--muted);
}

.message {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(143, 195, 31, 0.14);
  color: #587a10;
  margin-bottom: 16px;
}

.error {
  background: rgba(200, 77, 92, 0.1);
  color: var(--danger);
}

@media (max-width: 820px) {
  .topbar,
  .lead-head {
    display: block;
  }

  .lead-card {
    grid-template-columns: 1fr;
  }
}

.top-actions,
.report-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-actions form {
  margin: 0;
}

.report-list {
  display: grid;
  gap: 14px;
}

.report-card {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 22px;
  padding: 18px;
}

.report-card-main > p {
  color: var(--muted);
}

.report-card-actions {
  display: grid;
  gap: 16px;
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.report-screenshot-link,
.report-whatsapp {
  color: #217ea9;
  font-weight: 700;
}

.message.warning {
  background: #fff4d8;
  color: #77540d;
}

.support-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px 28px;
  margin-bottom: 18px;
  padding: 18px;
}

.support-controls h2 {
  margin: 0 0 5px;
  font-size: 1.12rem;
}

.support-controls p {
  margin: 0;
  color: var(--muted);
}

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

.support-expiry {
  flex-basis: 100%;
  text-align: right;
  font-size: 0.84rem;
}

.support-link-result,
.support-controls > .message {
  grid-column: 1 / -1;
}

.support-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.support-session-notice {
  border-left: 3px solid var(--green);
}

.report-widget {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 1000;
}

.feedback-widget {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(74px, calc(74px + env(safe-area-inset-bottom)));
  z-index: 1000;
}

.feedback-trigger {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid #17704a;
  border-radius: 8px;
  background: #ffffff;
  color: #15583d;
  box-shadow: 0 10px 24px rgba(38, 50, 56, 0.16);
  font: inherit;
  font-weight: 700;
}

.feedback-trigger > span:first-child {
  font-size: 1.25rem;
  line-height: 1;
}

.feedback-dialog {
  width: min(520px, calc(100% - 28px));
  max-height: min(720px, calc(100dvh - 28px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(38, 50, 56, 0.3);
}

.feedback-dialog::backdrop {
  background: rgba(28, 42, 49, 0.58);
}

.feedback-form {
  overflow: auto;
  max-height: inherit;
  padding: 22px;
}

.feedback-form .field > span {
  display: block;
  margin-bottom: 7px;
}

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

.feedback-dialog-head h2 {
  margin: 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 1.8rem;
  font-weight: 400;
}

.feedback-eyebrow {
  margin: 0 0 3px;
  color: #17704a;
  font-size: 0.72rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0;
}

.feedback-close {
  width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
}

.feedback-context,
.feedback-privacy {
  color: var(--muted);
  font-size: 0.86rem;
}

.feedback-context {
  margin: 0 0 16px;
}

.feedback-privacy {
  padding-left: 10px;
  border-left: 3px solid #d39c32;
}

.feedback-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.feedback-whatsapp,
.feedback-confirm {
  display: block;
  min-height: 44px;
  margin-top: 12px;
  text-align: center;
}

.feedback-whatsapp {
  padding: 11px 12px;
}

.feedback-whatsapp[hidden],
.feedback-confirm[hidden] {
  display: none;
}

.report-trigger {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  box-shadow: 0 12px 30px rgba(38, 50, 56, 0.2);
}

.report-trigger > span:first-child {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  font-family: Georgia, serif;
  font-weight: 700;
}

.report-dialog {
  width: min(520px, calc(100% - 28px));
  max-height: min(760px, calc(100dvh - 28px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(38, 50, 56, 0.3);
}

.report-dialog::backdrop {
  background: rgba(28, 42, 49, 0.58);
}

.report-form {
  overflow: auto;
  max-height: inherit;
  padding: 22px;
}

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

.report-dialog-head h2 {
  margin: 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 1.8rem;
  font-weight: 400;
}

.report-eyebrow {
  margin: 0 0 3px;
  color: var(--blue-dark);
  font-size: 0.72rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0;
}

.report-close {
  width: 44px;
  min-height: 44px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
}

.report-preview-shell {
  display: grid;
  min-height: 180px;
  max-height: 280px;
  margin-bottom: 10px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #edf4f6;
}

.report-preview {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
}

.report-capture-state,
.report-privacy {
  color: var(--muted);
  font-size: 0.86rem;
}

.report-remove-capture {
  min-height: 44px;
  margin: 0 0 16px auto;
  padding: 5px 8px;
  background: transparent;
  color: var(--danger);
}

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

.report-whatsapp {
  display: block;
  margin-top: 14px;
  text-align: center;
}

@media (max-width: 820px) {
  .top-actions {
    margin-top: 14px;
  }

  .report-card {
    grid-template-columns: 1fr;
  }

  .support-controls {
    grid-template-columns: 1fr;
  }

  .support-control-actions {
    justify-content: flex-start;
  }

  .support-expiry {
    text-align: left;
  }

  .report-card-actions {
    padding: 16px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 520px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
    padding-bottom: 84px;
  }

  .report-trigger > span:last-child {
    display: none;
  }

  .report-trigger {
    width: 46px;
    min-height: 46px;
    justify-content: center;
    padding: 0;
  }

  .feedback-trigger > span:last-child {
    display: none;
  }

  .feedback-trigger {
    width: 46px;
    min-height: 46px;
    justify-content: center;
    padding: 0;
  }

  .feedback-form {
    padding: 18px;
  }

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

  .report-form {
    padding: 18px;
  }

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

  .support-link-row {
    grid-template-columns: 1fr;
  }
}

/* Operational CRM shell */
.crm-app {
  min-height: 100vh;
  background: #f4f7f8;
}

.app-shell {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  min-height: 100vh;
}

.app-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 22px 16px 18px;
  overflow-y: auto;
  border-right: 1px solid #d8e2e5;
  background: #fff;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 52px;
  color: var(--ink);
  text-decoration: none;
}

.app-brand .brand-mark {
  width: 42px;
  height: 42px;
}

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

.app-brand strong {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 1.25rem;
  font-weight: 400;
}

.app-brand small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.desktop-app-nav {
  display: grid;
  gap: 3px;
  margin-top: 24px;
}

.nav-section-label {
  margin: 19px 10px 5px;
  color: #7a8990;
  font-size: 0.69rem;
  font-weight: 700;
  text-transform: uppercase;
}

.nav-section-label:first-child {
  margin-top: 0;
}

.app-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 9px 10px;
  border-left: 3px solid transparent;
  border-radius: 6px;
  color: #506169;
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
}

.app-nav-link:hover {
  background: #f0f5f6;
  color: var(--ink);
}

.app-nav-link.is-active {
  border-left-color: var(--green-dark);
  background: #edf5dd;
  color: #3f5b0b;
}

.app-nav-link--pro {
  color: #56666e;
}

.app-nav-link--pro.is-active {
  border-left-color: #b08a25;
  background: #fff8df;
  color: #5f4a10;
}

.pro-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 6px;
  border: 1px solid #d5b65c;
  border-radius: 6px;
  background: #fff8df;
  color: #765b10;
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
}

.app-logout {
  margin-top: auto;
  padding-top: 20px;
}

.app-logout button {
  width: 100%;
}

.mobile-app-nav {
  display: none;
}

.app-main {
  width: min(100%, 1120px);
  min-width: 0;
  margin: 0 auto;
  padding: 34px 38px 64px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  padding-bottom: 19px;
  border-bottom: 1px solid #d8e2e5;
}

.page-heading h1 {
  margin: 0;
  font-size: 1.85rem;
  font-weight: 700;
}

.page-heading p {
  margin: 5px 0 0;
  color: var(--muted);
}

.page-eyebrow {
  margin-bottom: 4px !important;
  color: #46788d !important;
  font-size: 0.72rem;
  font-weight: 750;
  text-transform: uppercase;
}

/* Deliberate, read-only Pro previews */
.pro-main {
  max-width: 1040px;
}

.pro-page-heading {
  align-items: center;
}

.pro-page-heading > div {
  min-width: 0;
}

.pro-page-heading > div > p:last-child {
  max-width: 720px;
  overflow-wrap: anywhere;
}

.pro-preview-state {
  display: grid;
  flex: 0 0 auto;
  justify-items: end;
  gap: 6px;
  margin: 0;
  color: #53636a;
  font-size: 0.78rem;
}

.pro-preview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.75fr);
  gap: 34px;
  align-items: start;
  padding: 8px 0 28px;
}

.pro-outcome h2,
.pro-section-heading h2 {
  margin: 0;
  font-size: 1.2rem;
}

.pro-outcome > p:last-child {
  margin: 9px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.pro-requirement {
  margin: 0;
  padding-left: 24px;
  border-left: 1px solid #d8e2e5;
}

.pro-requirement div + div {
  margin-top: 18px;
}

.pro-requirement dt {
  color: #74858c;
  font-size: 0.7rem;
  font-weight: 750;
  text-transform: uppercase;
}

.pro-requirement dd {
  margin: 5px 0 0;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.pro-example {
  padding-top: 24px;
  border-top: 1px solid #d8e2e5;
}

.pro-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.pro-section-heading > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.pro-preview-frame {
  overflow: hidden;
  border: 1px solid #d6e1e4;
  border-radius: 8px;
  background: #fff;
}

.pro-preview-row {
  display: grid;
  grid-template-columns: minmax(92px, 0.42fr) minmax(160px, 0.9fr) minmax(200px, 1.3fr);
  gap: 16px;
  align-items: center;
  min-height: 64px;
  padding: 12px 16px;
}

.pro-preview-row + .pro-preview-row {
  border-top: 1px solid #e1e8ea;
}

.pro-preview-row span,
.pro-preview-row small {
  color: var(--muted);
}

.pro-preview-row span {
  font-size: 0.74rem;
  font-weight: 750;
  text-transform: uppercase;
}

.pro-preview-row strong {
  overflow-wrap: anywhere;
  font-size: 0.92rem;
}

.pro-preview-row small {
  overflow-wrap: anywhere;
  font-size: 0.82rem;
}

.pro-preview-note {
  margin: 12px 0 0;
  color: #65767d;
  font-size: 0.82rem;
  line-height: 1.5;
}

.queue-total {
  flex: 0 0 auto;
  font-size: 0.9rem;
}

.queue-total strong {
  color: var(--ink);
  font-size: 1.3rem;
}

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

.today-filters form {
  min-width: 0;
  margin: 0;
}

.today-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 10px 13px;
  border: 1px solid #d6e1e4;
  border-radius: 8px;
  background: #fff;
  color: #52636b;
  text-align: left;
}

.today-filter:hover,
.today-filter.is-active {
  border-color: #6ea5bb;
  background: #eef7fa;
  color: #275f78;
}

.today-filter strong {
  display: grid;
  min-width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 6px;
  background: #e7eef0;
  color: var(--ink);
}

.work-queue {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.work-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  padding: 17px 18px;
  overflow: hidden;
  border: 1px solid #d6e1e4;
  border-left: 4px solid #6ea5bb;
  border-radius: 8px;
  background: #fff;
}

.work-item--overdue {
  border-left-color: var(--danger);
}

.work-item--new_due {
  border-left-color: #c58716;
}

.work-item--today {
  border-left-color: var(--green-dark);
}

.work-item-main {
  min-width: 0;
}

.work-item-priority,
.work-item-heading,
.work-item-actions {
  display: flex;
  align-items: center;
}

.work-item-priority {
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-bottom: 10px;
}

.urgency-label {
  color: #3c5965;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.deadline-text {
  color: var(--muted);
  font-size: 0.8rem;
}

.work-item-heading {
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.work-item-heading h2 {
  margin: 0;
  font-size: 1.13rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.work-item-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.work-item-facts {
  display: grid;
  grid-template-columns: minmax(110px, 0.75fr) minmax(110px, 0.75fr) minmax(170px, 1.5fr);
  gap: 12px 22px;
  margin: 15px 0 0;
}

.work-item-facts div {
  min-width: 0;
}

.work-item-facts dt {
  color: #7b8a91;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.work-item-facts dd {
  margin: 3px 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.work-item-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  align-content: center;
  gap: 8px;
  width: 260px;
}

.work-item-actions .button,
.lead-summary-actions .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  text-decoration: none;
}

.whatsapp-action {
  background: #3d7f45;
}

.today-empty {
  padding: 44px 20px;
  border-top: 1px solid #d8e2e5;
  text-align: center;
}

.today-empty h2 {
  margin: 0;
  font-size: 1.1rem;
}

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

.lead-filters {
  padding: 0 0 18px;
  border-bottom: 1px solid #d8e2e5;
}

.lead-card--summary {
  grid-template-columns: minmax(0, 1fr);
}

.lead-summary-actions {
  display: flex;
  justify-content: flex-end;
}

/* Opportunity detail and contact workflow */
.detail-main {
  max-width: 1120px;
}

.detail-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.84rem;
}

.detail-breadcrumb a {
  color: #246d8c;
  font-weight: 700;
}

.detail-heading-status {
  display: grid;
  justify-items: end;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -8px 0 24px;
}

.detail-actions .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  text-decoration: none;
}

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

.detail-content {
  min-width: 0;
}

.detail-section {
  padding: 22px 0;
  border-top: 1px solid #d8e2e5;
}

.detail-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.detail-section h2 {
  margin: 0 0 16px;
  font-size: 1.08rem;
}

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

.detail-grid div {
  min-width: 0;
}

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

.detail-grid dt,
.operational-summary span,
.next-action-summary > span {
  color: #778890;
  font-size: 0.7rem;
  font-weight: 750;
  text-transform: uppercase;
}

.detail-grid dd {
  margin: 5px 0 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.detail-side {
  position: sticky;
  top: 24px;
  min-width: 0;
  padding-left: 22px;
  border-left: 1px solid #d8e2e5;
}

.detail-side .detail-section:first-child {
  padding-top: 0;
}

.operational-summary > div {
  display: grid;
  gap: 5px;
  margin-top: 18px;
}

.operational-summary strong,
.next-action-summary h2,
.next-action-summary p {
  overflow-wrap: anywhere;
}

.next-action-summary p {
  margin: -8px 0 12px;
  color: var(--muted);
}

.section-heading-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-heading-row h2 {
  margin-bottom: 0;
}

.section-heading-row > span,
.detail-muted {
  color: var(--muted);
  font-size: 0.82rem;
}

.timeline-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline-entry {
  position: relative;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 23px;
}

.timeline-entry:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 13px;
  bottom: -1px;
  left: 7px;
  width: 1px;
  background: #cfdbdf;
}

.timeline-marker {
  position: relative;
  z-index: 1;
  width: 15px;
  height: 15px;
  margin-top: 2px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #5b9db9;
  box-shadow: 0 0 0 1px #8eb9ca;
}

.timeline-entry--task .timeline-marker {
  border-radius: 4px;
  background: var(--green-dark);
  box-shadow: 0 0 0 1px #a4bf67;
}

.timeline-body {
  min-width: 0;
}

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  color: #718188;
  font-size: 0.72rem;
}

.timeline-body h3 {
  margin: 4px 0 0;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.timeline-body p {
  margin: 7px 0 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.timeline-detail {
  color: var(--muted);
  font-size: 0.84rem;
}

.detail-not-found {
  max-width: 560px;
  margin: 14vh auto 0;
}

.detail-not-found h1 {
  margin: 6px 0;
}

.detail-not-found .button {
  display: inline-flex;
  align-items: center;
  margin-top: 14px;
  text-decoration: none;
}

.contact-dialog {
  width: min(620px, calc(100% - 28px));
  max-height: min(820px, calc(100dvh - 28px));
  padding: 0;
  overflow: hidden;
  border: 1px solid #cbd9dd;
  border-radius: 8px;
  color: var(--ink);
  box-shadow: 0 26px 72px rgba(31, 49, 57, 0.32);
}

.contact-dialog::backdrop {
  background: rgba(28, 42, 49, 0.62);
}

.contact-form {
  max-height: inherit;
  padding: 22px;
  overflow: auto;
}

.contact-form [hidden] {
  display: none !important;
}

.contact-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.contact-dialog-head h2 {
  margin: 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 1.65rem;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.contact-close {
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 1.45rem;
  line-height: 1;
}

.interaction-mode {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

.interaction-mode legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.interaction-mode label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7fafb;
  color: var(--ink);
  font-size: 0.86rem;
  text-transform: none;
}

.interaction-mode label:has(input:checked) {
  border-color: #5f9eb9;
  background: #eef7fa;
  color: #275f78;
}

.interaction-mode input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.contact-form label span {
  font-weight: 500;
  text-transform: none;
}

.next-action-fields {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(190px, 0.65fr);
  gap: 12px;
}

.contact-warning {
  padding: 11px 12px;
  border-left: 3px solid #c58716;
  background: #fff7e5;
  color: #77540d;
  font-size: 0.86rem;
  line-height: 1.45;
}

.contact-status {
  min-height: 24px;
  margin: 4px 0 10px;
  color: var(--danger);
  font-size: 0.86rem;
}

.contact-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.contact-form-actions button:disabled {
  cursor: wait;
  opacity: 0.65;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #1c7199;
  outline-offset: 3px;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 208px minmax(0, 1fr);
  }

  .app-main {
    padding-right: 24px;
    padding-left: 24px;
  }

  .work-item {
    grid-template-columns: minmax(0, 1fr);
  }

  .work-item-actions {
    justify-content: flex-start;
    width: auto;
  }

  .detail-layout {
    grid-template-columns: minmax(0, 1fr) 230px;
    gap: 22px;
  }
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }

  .app-sidebar {
    display: none;
  }

  .app-main {
    width: 100%;
    padding: 24px 18px 112px;
  }

  .mobile-app-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 900;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    min-height: calc(66px + env(safe-area-inset-bottom));
    padding: 4px 6px env(safe-area-inset-bottom);
    border-top: 1px solid #cfdadd;
    background: #fff;
    box-shadow: 0 -8px 24px rgba(38, 50, 56, 0.1);
  }

  .mobile-nav-link,
  .mobile-more > summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    min-height: 58px;
    padding: 6px 4px;
    border-radius: 6px;
    color: #65757c;
    font-size: 0.76rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
  }

  .mobile-nav-link.is-active {
    background: #edf5dd;
    color: #3f5b0b;
  }

  .mobile-nav-link--pro {
    flex-wrap: wrap;
  }

  .mobile-more {
    position: relative;
    min-width: 0;
  }

  .mobile-more > summary {
    cursor: pointer;
    list-style: none;
  }

  .mobile-more > summary::-webkit-details-marker {
    display: none;
  }

  .mobile-more > summary.is-active,
  .mobile-more-menu a.is-active {
    background: #fff8df;
    color: #5f4a10;
  }

  .mobile-more-menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    display: grid;
    width: min(270px, calc(100vw - 20px));
    padding: 8px;
    border: 1px solid #cfdadd;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 44px rgba(38, 50, 56, 0.2);
  }

  .mobile-more-menu a,
  .mobile-more-menu button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    padding: 9px 10px;
    border-radius: 6px;
    background: transparent;
    color: var(--ink);
    font-size: 0.86rem;
    text-align: left;
    text-decoration: none;
  }

  .mobile-more-menu form {
    margin: 0;
  }

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

  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-side {
    position: static;
    padding: 0;
    border-top: 1px solid #d8e2e5;
    border-left: 0;
  }

  .pro-preview-layout {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .pro-requirement {
    padding: 20px 0 0;
    border-top: 1px solid #d8e2e5;
    border-left: 0;
  }

  .today-filter {
    min-height: 52px;
  }

  .work-item-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .work-item-facts div:last-child {
    grid-column: 1 / -1;
  }

  .report-widget {
    bottom: calc(78px + env(safe-area-inset-bottom));
  }

  .feedback-widget {
    bottom: calc(134px + env(safe-area-inset-bottom));
  }

  .crm-app:has(.mobile-more[open]) .report-widget,
  .crm-app:has(.mobile-more[open]) .feedback-widget {
    display: none;
  }
}

@media (max-width: 520px) {
  .password-change-page {
    padding: 12px;
  }

  .password-change-panel {
    margin: 18px auto;
    padding: 22px 18px;
  }

  .password-change-panel .brand {
    align-items: flex-start;
  }

  .password-change-panel .brand h1 {
    font-size: 1.65rem;
  }

  .page-heading,
  .work-item-heading {
    display: block;
  }

  .page-heading {
    margin-bottom: 18px;
  }

  .pro-preview-state {
    justify-items: start;
    margin-top: 14px;
  }

  .pro-section-heading {
    display: block;
  }

  .pro-section-heading > p {
    margin-top: 8px;
  }

  .pro-preview-row {
    grid-template-columns: 1fr;
    gap: 4px;
    min-height: 88px;
    padding: 13px 14px;
  }

  .queue-total {
    margin-top: 12px !important;
  }

  .work-item {
    gap: 16px;
    padding: 15px 14px;
  }

  .work-item-heading .status {
    margin-top: 9px;
  }

  .work-item-facts {
    grid-template-columns: 1fr;
  }

  .work-item-facts div:last-child {
    grid-column: auto;
  }

  .work-item-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .work-item-actions .button:last-child {
    grid-column: 1 / -1;
  }

  .lead-head {
    display: block;
  }

  .lead-head .status {
    margin-top: 10px;
  }

  .detail-heading-status {
    justify-items: start;
    margin-top: 12px;
  }

  .detail-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-actions > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .detail-grid,
  .next-action-fields {
    grid-template-columns: 1fr;
  }

  .detail-grid-wide {
    grid-column: auto;
  }

  .contact-form {
    padding: 18px;
  }

  .contact-form-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}
