/* Felipe Maciel Advogado · Sistema de Atendimento
   Folha de estilos única. A ordem importa: regras mais abaixo vencem as de cima com o mesmo peso.
   Ajustes novos entram no fim da seção a que pertencem (ou no fim do arquivo). */

/* ======================================================================
   Base: layout, telas e componentes
   ====================================================================== */

:root {
  --navy: #1D3F5A;
  --navy-dark: #102A3A;
  --institutional-blue: #437B98;
  --light-blue: #96CAD3;
  --background: #F7F8FA;
  --surface: #FFFFFF;
  --border: #E2E7EB;
  --text-primary: #182B3A;
  --text-secondary: #647481;
  --success: #23845B;
  --warning: #B7791F;
  --danger: #C24141;
  --info: #3478A5;
  --blue-pale: #E8F2F5;
  --font-body: "Montserrat",Arial,sans-serif;
  --font-display: "Montserrat",Arial,sans-serif;
  --font-brand: "Playfair Display",Georgia,serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  z-index: 5;
}

.brand {
  height: 44px;
  display: flex;
  align-items: center;
  text-decoration: none;
  padding: 0 8px;
}

.brand-mark {
  display: grid;
  place-content: center;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-copy i {
  color: #a28a65;
  font-style: normal;
}

.brand-copy small {
  font-weight: 700;
}

.workspace-label, .section-kicker {
  font-size: 12px;
  letter-spacing: 1.55px;
  font-weight: 700;
  color: #98a19c;
}

.workspace-label {
  margin: 47px 11px 13px;
}

.main-nav {
  display: grid;
  gap: 5px;
}

.nav-link {
  padding: 0 11px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 500;
  transition: .18s;
}

.nav-icon {
  width: 17px;
  text-align: center;
  font-size: 18px;
  line-height: 1;
}

.nav-count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 10px;
}

.nav-dot {
  margin-left: auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.sidebar-bottom {
  margin-top: auto;
}

.help-card {
  position: relative;
  overflow: hidden;
  padding: 16px 14px 14px;
}

.help-spark {
  display: block;
  margin-bottom: 8px;
}

.help-card p {
  line-height: 1.6;
  margin: 7px 0 0;
}

.profile-button {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--border);
  background: none;
  padding: 14px 6px 3px;
  display: flex;
  align-items: center;
  text-align: left;
  gap: 10px;
  cursor: pointer;
}

.avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
}

.avatar-dark {
  background: #dfe9e2;
  color: #345e4e;
}

.profile-copy {
  display: grid;
  gap: 3px;
}

.profile-copy strong {
  font-size: 12px;
}

.profile-copy small {
  font-size: 12px;
}

.more {
  margin-left: auto;
  font-size: 19px;
  color: #89928d;
  transform: rotate(90deg);
}

.main-area {
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 43px;
  position: sticky;
  top: 0;
  z-index: 4;
}

.breadcrumb span {
  padding: 0 8px;
  color: #c4cac5;
}

.breadcrumb strong {
  font-weight: 600;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.icon-button {
  border: 0;
  background: transparent;
  color: #63716a;
  cursor: pointer;
  font-size: 18px;
  position: relative;
}

.notification-button {
  font-size: 20px;
  transform: rotate(180deg);
}

.notification-button i {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #d58a45;
  top: 2px;
  right: 1px;
  border: 1px solid white;
}

.avatar-top {
  width: 28px;
  height: 28px;
  background: #dfe9e2;
  color: #345e4e;
  font-size: 12px;
}

.menu-button {
  display: none;
}

.page-content {
  margin: 0 auto;
}

.welcome-row {
  display: flex;
  justify-content: space-between;
}

.eyebrow {
  font-weight: 700;
  display: flex;
  align-items: center;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

h1, h2, h3, p {
  margin-top: 0;
}

.wave {
  font-size: 16px;
  color: #b59a6d;
  vertical-align: 4px;
  margin-left: 2px;
}

.page-subtitle {
  margin: 0;
}

.button {
  cursor: pointer;
  transition: .18s;
}

.button-primary {
  border: 1px solid var(--navy);
  color: white;
}

.button-primary:hover {
  transform: translateY(-1px);
}

.plus {
  font-size: 17px;
  vertical-align: -1px;
  margin-right: 5px;
  font-weight: 400;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
}

.stat-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
}

.stat-icon {
  display: grid;
  place-items: center;
  font-size: 14px;
}

.sage {
  background: #edf4ee;
  color: #5e8a6b;
}

.amber {
  background: #fbf2e6;
  color: #bb8745;
}

.blue {
  background: #edf3f7;
  color: #698da3;
}

.lilac {
  background: #f3eff8;
  color: #8879a4;
}

.stat-value small {
  letter-spacing: 0;
}

.stat-indicator, .success-text {
  color: #578468;
  font-weight: 600;
}

.warning-text {
  font-weight: 600;
}

.foot-separator {
  margin: 0 4px;
  color: #c5cbc6;
}

.content-grid {
  display: grid;
  align-items: start;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-heading h2 {
  margin: 5px 0 0;
}

.text-link, .pending-link {
  text-decoration: none;
  font-weight: 600;
}

.text-link span, .pending-link span {
  font-size: 14px;
  margin-left: 4px;
}

.agenda-toolbar {
  height: 68px;
  border-top: 1px solid #f0f2ef;
  border-bottom: 1px solid #f0f2ef;
  display: flex;
  align-items: center;
}

.selected-day {
  display: flex;
  align-items: center;
  gap: 9px;
}

.selected-day strong {
  letter-spacing: -1px;
}

.selected-day > span {
  line-height: 1.45;
}

.agenda-switch {
  display: flex;
  margin-left: auto;
  background: #f6f7f5;
  padding: 3px;
  border-radius: 6px;
  gap: 1px;
}

.view-toggle {
  border: 0;
  background: none;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
}

.view-toggle.selected {
  background: white;
  font-weight: 700;
}

.date-arrows {
  display: flex;
  margin-left: 14px;
  gap: 3px;
}

.date-arrows button {
  width: 24px;
  height: 24px;
  border: 1px solid #e9ede9;
  border-radius: 5px;
  background: white;
  color: #68766e;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}

.agenda-item {
  display: grid;
  grid-template-columns: 43px 13px minmax(0,1fr);
  gap: 9px;
}

.time-col {
  text-align: right;
  padding-top: 15px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.time-col strong {
  font-weight: 700;
}

.timeline {
  position: relative;
  display: flex;
  justify-content: center;
}

.timeline:after {
  content: "";
  position: absolute;
  top: 17px;
  bottom: -2px;
  width: 1px;
}

.agenda-item:last-child .timeline:after {
  display: none;
}

.timeline-dot {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  width: 7px;
  height: 7px;
  border: 2px solid #fff;
  box-sizing: content-box;
  border-radius: 50%;
  background: #6f9b79;
  box-shadow: 0 0 0 1px #b9cfbe;
}

.blue-dot {
  background: #7393aa;
  box-shadow: 0 0 0 1px #c1d0dc;
}

.orange-dot {
  background: #c49050;
  box-shadow: 0 0 0 1px #e2cfad;
}

.lilac-dot {
  background: #9584ac;
  box-shadow: 0 0 0 1px #d5cce0;
}

.event-card {
  margin: 7px 0 8px;
  border: 1px solid #e9eee9;
  min-width: 0;
}

.event-blue {
  border-left-color: #8ba5b8;
}

.event-orange {
  border-left-color: #d0a266;
}

.event-lilac {
  border-left-color: #a495b7;
}

.event-main {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.event-blue .event-type {
  color: #7891a1;
}

.event-orange .event-type {
  color: #b78a52;
}

.event-lilac .event-type {
  color: #9384a6;
}

.event-main h3 {
  margin: 4px 0 5px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-main p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.client-avatar {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
}

.ca-green {
  background: #e6efe8;
  color: #567761;
}

.ca-blue {
  background: #e8eef3;
  color: #5f7c91;
}

.ca-orange {
  background: #f6ede1;
  color: #a37943;
}

.ca-lilac {
  background: #eeeaf3;
  color: #7e7094;
}

.ca-pink {
  background: #f7e9e9;
  color: #a16e6e;
}

.confirm-pill {
  white-space: nowrap;
  align-self: flex-start;
  font-weight: 600;
}

.confirmed {
  color: #5c8467;
  background: #eef5ef;
}

.waiting {
  color: #af7d3b;
  background: #fbf3e8;
}

.event-bottom {
  border-top: 1px solid #f0f2ef;
  margin-top: 8px;
  padding-top: 6px;
  display: flex;
  justify-content: space-between;
}

.event-owner {
  color: #abb3ad;
}

.event-owner b {
  font-weight: 500;
  color: #78837c;
}

.agenda-footer {
  border-top: 1px solid #f0f2ef;
  margin-top: 3px;
  padding-top: 13px;
  display: flex;
  justify-content: space-between;
}

.agenda-footer a {
  text-decoration: none;
  font-weight: 600;
}

.agenda-footer a span {
  font-size: 13px;
  margin-left: 3px;
}

.legend-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #75a080;
  margin-right: 5px;
  vertical-align: 1px;
}

.side-column {
  display: grid;
  gap: 15px;
}

.compact {
  align-items: flex-start;
}

.pending-count {
  border-radius: 5px;
  padding: 4px 7px;
  font-weight: 700;
}

.panel-description {
  margin: 8px 0 12px;
}

.pending-list {
  display: grid;
}

.pending-item {
  border-top: 1px solid #f0f2ef;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pending-info {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.pending-info strong {
  font-weight: 600;
}

.pending-info small {
  white-space: nowrap;
}

.message-icon {
  margin-left: auto;
  border: 1px solid #e7ece8;
  background: #fff;
  border-radius: 5px;
  width: 25px;
  height: 25px;
  color: #64836c;
  cursor: pointer;
}

.message-icon:hover {
  background: #eff5f0;
}

.pending-link {
  display: block;
  border-top: 1px solid #f0f2ef;
  padding-top: 12px;
  margin-top: 1px;
}

.tip-card {
  position: relative;
  overflow: hidden;
}

.tip-top {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
}

.tip-card h3 {
  position: relative;
  z-index: 1;
}

.tip-card p {
  margin-bottom: 11px;
  position: relative;
  z-index: 1;
}

.tip-action {
  border: 0;
  padding: 0;
  color: #e4d3ae;
  background: transparent;
  font: 600 12px var(--font-body);
  cursor: pointer;
  position: relative;
  z-index: 1;
}

.tip-action span {
  font-size: 12px;
  margin-left: 4px;
}

.tip-decoration {
  position: absolute;
}

.page-footer {
  display: flex;
  justify-content: space-between;
  padding: 23px 2px 0;
  margin-top: 1px;
}

.page-footer i {
  font-style: normal;
  margin: 0 4px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: #14221cb0;
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 20;
  backdrop-filter: blur(3px);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  background: #fff;
  width: min(100%,460px);
}

.modal-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.modal-heading h2 {
  margin: 5px 0 0;
  letter-spacing: -.5px;
}

.close-modal {
  font-size: 23px;
}

.modal-note {
  line-height: 1.5;
  margin: 13px 0 18px;
}

.modal form {
  display: grid;
}

.modal label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}

.modal input, .modal select, .modal textarea {
  width: 100%;
  border: 1px solid #e3e9e4;
  padding: 10px;
  background: #fff;
  outline: none;
}

.modal textarea {
  min-height: 70px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.toast {
  position: fixed;
  bottom: 23px;
  left: 50%;
  transform: translate(-50%,20px);
  opacity: 0;
  color: #fff;
  border-radius: 7px;
  padding: 11px 16px;
  box-shadow: 0 8px 25px #17251d30;
  pointer-events: none;
  transition: .2s;
  z-index: 30;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%,0);
}

@media (max-width: 1120px) {

  .topbar {
    padding: 0 27px;
  }

  .stats-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
}

@media (max-width: 820px) {

  .sidebar {
    transform: translateX(-100%);
    transition: transform .2s;
    box-shadow: none;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 12px 0 35px #25362b1c;
  }

  .menu-button {
    display: block;
    margin-right: 11px;
  }

  .topbar {
    justify-content: flex-start;
    padding: 0 20px;
  }

  .breadcrumb {
    flex: 1;
  }

  .top-actions {
    gap: 12px;
  }

  .today-date {
    display: none;
  }

  .side-column {
    align-items: start;
  }
}

@media (max-width: 560px) {

  .topbar {
    padding: 0 15px;
  }

  .welcome-row {
    flex-direction: column;
  }

  .welcome-row .button {
    justify-content: center;
    display: block;
  }

  .welcome-row .button .plus {
    margin-right: 6px;
  }

  .stat-top {
    gap: 5px;
  }

  .text-link {
    font-size: 12px;
  }

  .agenda-toolbar {
    height: 60px;
  }

  .agenda-switch {
    margin-left: auto;
  }

  .view-toggle {
    padding: 6px 7px;
  }

  .date-arrows {
    margin-left: 7px;
  }

  .agenda-item {
    grid-template-columns: 37px 10px minmax(0,1fr);
    gap: 6px;
  }

  .event-main h3 {
    max-width: 210px;
  }

  .event-main p {
    flex-wrap: wrap;
    gap: 4px;
  }

  .event-meta {
    display: none;
  }

  .event-owner b {
    display: none;
  }

  .page-footer {
    gap: 8px;
  }

  .page-footer span:last-child {
    text-align: right;
  }

  .avatar-top {
    width: 26px;
    height: 26px;
  }
}

.screen-view {
  display: grid;
  gap: 15px;
}

.screen-toolbar {
  min-height: 70px;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.screen-period {
  margin: 0;
}

.screen-date {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: auto;
}

.screen-date strong {
  min-width: 130px;
  text-align: center;
}

.date-arrow {
  width: 25px;
  height: 25px;
  border: 1px solid #e8ede9;
  background: #fff;
  border-radius: 5px;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}

.today-button {
  height: 28px;
  padding: 0 9px;
  font-size: 12px;
}

.screen-select-label {
  display: grid;
  gap: 5px;
  font-weight: 700;
}

.screen-select-label select {
  height: 31px;
  min-width: 140px;
  border: 1px solid #e6ebe7;
  border-radius: 5px;
  background: #fff;
  padding: 0 8px;
  color: #57635b;
  font: 12px var(--font-body);
  letter-spacing: 0;
}

.screen-new-event {
  white-space: nowrap;
  height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.full-agenda {
  padding: 19px;
}

.result-count {
  color: #8e9992;
  font-size: 12px;
}

.full-agenda-list {
  padding-top: 12px;
}

.full-agenda-item {
  grid-template-columns: 55px 43px 13px minmax(0,1fr);
  min-height: 99px;
  gap: 8px;
}

.agenda-date-col {
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: right;
}

.full-agenda-item .event-card {
  margin-top: 7px;
}

.full-agenda-item .timeline:after {
  bottom: -4px;
}

.full-agenda-item:last-child .timeline:after {
  display: none;
}

.empty-state {
  min-height: 180px;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.empty-state > span {
  font-size: 23px;
  margin-bottom: 8px;
}

.empty-state p {
  margin: 6px 0 0;
}

.client-toolbar {
  justify-content: flex-start;
}

.search-field {
  height: 34px;
  border: 1px solid #e7ece8;
  border-radius: 6px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  flex: 1;
  max-width: 390px;
  color: #89958d;
}

.search-field span {
  font-size: 19px;
  line-height: 1;
}

.search-field input {
  border: 0;
  outline: 0;
  width: 100%;
  font: 12px var(--font-body);
  color: #344039;
}

.search-field input::placeholder {
  color: #a0a9a3;
}

.client-toolbar .result-count {
  margin-left: auto;
  white-space: nowrap;
}

.client-panel {
  padding: 19px;
}

.client-panel > .panel-heading {
  margin-bottom: 16px;
}

.client-panel > .panel-heading .button {
  height: 33px;
  font-size: 12px;
}

.client-table-wrap {
  overflow-x: auto;
}

.client-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  white-space: nowrap;
}

.client-table th {
  padding: 10px 9px;
  border-top: 1px solid #edf0ed;
  border-bottom: 1px solid #edf0ed;
  font-weight: 700;
}

.client-table td {
  height: 55px;
  padding: 7px 9px;
  border-bottom: 1px solid #f0f2f0;
}

.client-table tr:last-child td {
  border-bottom: 0;
}

.client-name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.client-name-cell strong {
  font-weight: 600;
}

.area-tag {
  padding: 5px 7px;
  border-radius: 4px;
}

.client-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border-radius: 4px;
}

.client-status:before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.row-menu {
  border: 0;
  background: transparent;
  color: #89958d;
  font-size: 15px;
  cursor: pointer;
}

.client-mobile-list {
  display: none;
}

.empty-table {
  text-align: center !important;
  color: #8a958e !important;
  padding: 35px !important;
}

.pending-summary {
  display: grid;
  gap: 13px;
}

.pending-summary-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px;
  background: #fff;
  border: 1px solid #e9ede9;
}

.pending-summary-card > div {
  display: grid;
  gap: 4px;
}

.pending-summary-card strong {
  letter-spacing: -.6px;
}

.pending-page-panel {
  padding: 20px;
}

.pending-page-panel .panel-heading {
  align-items: center;
}

.pending-page-panel > .panel-description {
  margin: 9px 0 15px;
}

.pending-rows {
  border-top: 1px solid #edf0ed;
}

.pending-row {
  min-height: 83px;
  display: grid;
  grid-template-columns: 30px minmax(115px,.8fr) minmax(150px,1.2fr) minmax(150px,1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #edf0ed;
}

.pending-row > .client-avatar {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  font-size: 12px;
}

.pending-client, .pending-event, .pending-message {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.pending-client strong, .pending-event strong {
  font-weight: 600;
}

.pending-client small, .pending-event small, .pending-message small {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-state {
  display: flex;
  align-items: center;
  gap: 5px;
}

.message-state i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.pending-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pending-actions .button {
  height: 29px;
  padding: 0 8px;
  white-space: nowrap;
}

.mark-confirmed {
  border: 0;
  background: transparent;
  white-space: nowrap;
  cursor: pointer;
}

.mark-confirmed:hover {
  text-decoration: underline;
}

@media (max-width: 1120px) {

  .screen-toolbar {
    flex-wrap: wrap;
  }

  .screen-date {
    order: 2;
    margin: 0 auto;
  }

  .screen-period {
    order: 1;
  }

  .screen-select-label {
    order: 3;
  }

  .screen-new-event {
    order: 4;
    margin-left: auto;
  }

  .pending-row {
    grid-template-columns: 30px minmax(100px,.8fr) minmax(135px,1fr) minmax(130px,1fr);
    gap: 9px;
  }

  .pending-actions {
    grid-column: 2/-1;
    justify-content: flex-end;
    padding: 0 0 10px;
  }

  .pending-row {
    padding-top: 10px;
  }
}

@media (max-width: 820px) {

  .client-table-wrap {
    display: none;
  }

  .client-mobile-list {
    display: grid;
  }

  .client-mobile-card {
    padding: 12px 0;
    border-bottom: 1px solid #edf0ed;
  }

  .client-mobile-head {
    display: flex;
    align-items: center;
    gap: 9px;
  }

  .client-mobile-head > div {
    display: grid;
    gap: 4px;
    flex: 1;
  }

  .client-mobile-head small {
    font-size: 12px;
    color: #89948d;
  }

  .client-mobile-head .client-avatar {
    width: 27px;
    height: 27px;
    flex-basis: 27px;
    font-size: 12px;
  }

  .client-mobile-head .client-status {
    font-size: 12px;
  }

  .client-mobile-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 0 5px 36px;
    color: #818d85;
    font-size: 12px;
  }

  .client-contact {
    margin-left: 36px;
    border: 0;
    padding: 0;
    background: transparent;
    color: #547d60;
    font: 600 12px var(--font-body);
    cursor: pointer;
  }

  .client-contact span {
    font-size: 12px;
    margin-left: 4px;
  }

  .pending-row {
    grid-template-columns: 30px 1fr 1fr;
  }

  .pending-message {
    grid-column: 2/-1;
  }

  .pending-actions {
    grid-column: 2/-1;
    justify-content: flex-start;
  }

  .screen-date {
    order: 3;
    margin: 0;
  }

  .screen-select-label {
    order: 4;
  }

  .screen-new-event {
    order: 2;
  }

  .screen-period {
    order: 1;
  }
}

@media (max-width: 560px) {

  .screen-toolbar {
    gap: 10px;
    padding: 11px;
  }

  .screen-period {
    width: 100%;
    justify-content: center;
  }

  .screen-date {
    width: 100%;
    justify-content: center;
    order: 2;
  }

  .screen-date strong {
    min-width: 115px;
    font-size: 12px;
  }

  .screen-select-label {
    flex: 1;
    order: 3;
  }

  .screen-select-label select {
    width: 100%;
    min-width: 0;
  }

  .screen-new-event {
    order: 4;
    width: 100%;
    margin: 0;
    justify-content: center;
  }

  .full-agenda {
    padding: 14px 10px;
  }

  .full-agenda-item {
    grid-template-columns: 38px 34px 9px minmax(0,1fr);
    gap: 5px;
    min-height: 102px;
  }

  .full-agenda-item .event-card {
    padding: 8px 7px;
  }

  .full-agenda-item .event-main {
    gap: 4px;
  }

  .full-agenda-item .event-main h3 {
    white-space: normal;
    line-height: 1.35;
  }

  .full-agenda-item .event-meta {
    display: none;
  }

  .full-agenda-item .event-bottom {
    font-size: 12px;
  }

  .full-agenda-item .event-owner {
    display: none;
  }

  .full-agenda-item .confirm-pill {
    font-size: 12px;
    padding: 4px 5px;
  }

  .client-toolbar {
    align-items: stretch;
  }

  .search-field {
    max-width: none;
    flex-basis: 100%;
  }

  .client-toolbar .screen-select-label {
    flex: 1;
  }

  .client-toolbar .result-count {
    align-self: center;
    margin-left: 0;
  }

  .client-panel > .panel-heading h2 {
    font-size: 14px;
  }

  .client-panel > .panel-heading .button {
    height: 31px;
    padding: 0 8px;
    font-size: 12px;
  }

  .pending-summary {
    gap: 8px;
  }

  .pending-page-panel .panel-heading {
    gap: 8px;
    align-items: flex-start;
  }

  .pending-page-panel .screen-select-label select {
    width: 118px;
  }

  .pending-client {
    grid-column: 2;
  }

  .pending-event, .pending-message, .pending-actions {
    grid-column: 2;
  }

  .pending-event {
    margin-top: -2px;
  }

  .pending-actions {
    justify-content: flex-start;
  }

  .pending-actions .button {
    height: 28px;
  }

  .mark-confirmed {
    padding: 7px 3px;
  }

  .result-count {
    font-size: 12px;
  }
}

/* ======================================================================
   Calendário mensal e menu de ações dos compromissos
   ====================================================================== */

.page-content > [hidden] {
  display: none !important;
}

.month-calendar {
  margin-top: 14px;
  overflow-x: auto;
}

.month-weekdays, .month-days {
  display: grid;
  grid-template-columns: repeat(7,minmax(92px,1fr));
  min-width: 644px;
}

.month-weekdays span {
  padding: 9px 8px;
  text-align: right;
  border-bottom: 1px solid #e9eeea;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
}

.month-day {
  min-height: 94px;
  border: 0;
  border-right: 1px solid #edf0ed;
  border-bottom: 1px solid #edf0ed;
  background: #fff;
  padding: 7px 6px;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  cursor: pointer;
}

.month-day:nth-child(7n) {
  border-right: 0;
}

.month-day:hover {
  background: #f8faf7;
}

.month-day.empty-day {
  background: #fafbf9;
  cursor: default;
}

.month-day-number {
  align-self: flex-end;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.month-event-chip {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 3px;
  padding: 4px 5px;
  font-weight: 600;
}

.chip-green {
  background: #edf4ee;
  color: #55785d;
}

.chip-blue {
  background: #edf3f7;
  color: #5e7d91;
}

.chip-orange {
  background: #f8f0e4;
  color: #a47a43;
}

.chip-lilac {
  background: #f2eef6;
  color: #807193;
}

.chip-pink {
  background: #f7eaea;
  color: #986d70;
}

.month-more {
  padding: 1px 4px;
}

.event-actions {
  position: relative;
  margin-left: auto;
  align-self: flex-start;
}

.event-actions summary {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid #e6ebe7;
  border-radius: 5px;
  background: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  list-style: none;
}

.event-actions summary::-webkit-details-marker {
  display: none;
}

.event-action-menu {
  position: absolute;
  right: 0;
  top: 25px;
  z-index: 3;
  width: 135px;
  padding: 4px;
  background: #fff;
  border: 1px solid #e7ece8;
  border-radius: 7px;
  display: grid;
}

.event-action-menu button {
  border: 0;
  background: #fff;
  text-align: left;
  padding: 8px 9px;
  border-radius: 4px;
  cursor: pointer;
}

.event-action-menu button:hover {
  background: #f4f7f4;
}

.event-action-menu .danger-action {
  color: #a3534c;
}

.client-edit {
  border: 0;
  background: transparent;
  font: 600 12px var(--font-body);
  white-space: nowrap;
  cursor: pointer;
}

.client-edit:hover {
  text-decoration: underline;
}

.client-mobile-actions {
  display: flex;
  gap: 14px;
  margin-left: 36px;
}

.client-mobile-actions .client-contact {
  margin-left: 0;
}

.optional-label {
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.modal {
  max-height: calc(100vh - 34px);
  overflow-y: auto;
}

.modal form {
  gap: 11px;
}

.modal .form-row {
  gap: 12px;
}

@media (max-width: 560px) {

  .month-calendar {
    margin: 9px -6px 0;
    overflow-x: hidden;
  }

  .month-weekdays span {
    text-align: center;
  }

  .month-days, .month-weekdays {
    grid-template-columns: repeat(7,minmax(78px,1fr));
    min-width: 546px;
  }
}

.pending-summary {
  grid-template-columns: repeat(4,minmax(0,1fr));
}

@media (max-width: 900px) {

  .pending-summary {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
}

/* ======================================================================
   Identidade visual (azul marinho, Montserrat/Playfair) e ajustes posteriores
   ====================================================================== */

body {
  background: var(--background);
  color: var(--text-primary);
  font: 400 14px/1.5 var(--font-body);
}

.sidebar {
  width: 258px;
  background: var(--navy-dark);
  border: 0;
  padding: 25px 17px 16px;
  color: #fff;
}

.main-area {
  margin-left: 258px;
}

.brand {
  gap: 12px;
  color: #fff;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border: 1px solid #96CAD355;
  border-radius: 5px;
  background: transparent;
  color: #fff;
  font: 600 18px/1 var(--font-brand);
  letter-spacing: -2px;
}

.brand-mark span {
  color: var(--light-blue);
  font-size: 16px;
}

.brand-copy strong {
  font: 600 16px/1.2 var(--font-brand);
  letter-spacing: 0;
  color: #fff;
}

.brand-copy small {
  font-size: 12px;
  letter-spacing: 2px;
  color: #b5c4cf;
}

.workspace-label {
  margin-top: 46px;
  color: #a8bac7;
  font-size: 12px;
  letter-spacing: 1.1px;
}

.nav-link {
  height: 44px;
  color: #c5d1d9;
  font-size: 12px;
  border-radius: 5px;
}

.nav-link:hover {
  background: #ffffff10;
  color: #fff;
}

.nav-link.active {
  background: #1D3F5A;
  color: #fff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--light-blue);
}

.nav-icon {
  color: #b5c6d1;
}

.active .nav-icon {
  color: #fff;
}

.nav-count {
  background: #ffffff20;
  color: #fff;
}

.nav-dot {
  background: #e2a943;
}

.help-card {
  margin: 0 4px 14px;
  background: #ffffff0a;
  border: 1px solid #ffffff20;
  border-radius: 6px;
  color: #fff;
}

.help-card strong {
  font: 500 14px/1.45 var(--font-brand);
  letter-spacing: 0;
}

.help-card p {
  font-size: 12px;
  color: #bdcbd4;
}

.help-spark {
  font: 600 15px var(--font-brand);
  color: var(--light-blue);
}

.profile-button {
  border-color: #ffffff24;
  color: #fff;
}

.avatar-dark, .avatar-top {
  background: #ffffff17;
  color: #e8f2f5;
}

.profile-copy small {
  color: #b5c4cf;
}

.main-area {
  background: var(--background);
}

.topbar {
  height: 68px;
  padding-inline: clamp(20px,3vw,44px);
  background: #fff;
  border-bottom: 1px solid var(--border);
  backdrop-filter: none;
}

.breadcrumb {
  color: var(--text-secondary);
  font-size: 12px;
}

.breadcrumb strong {
  color: var(--text-primary);
}

.today-date {
  font-size: 12px;
  color: var(--text-secondary);
}

.preview-pill {
  border: 1px solid #d9e3e9;
  border-radius: 4px;
  padding: 5px 8px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .7px;
}

.page-content {
  padding: 34px clamp(20px,3vw,44px) 24px;
  max-width: 1530px;
}

.welcome-row {
  align-items: center;
  margin-bottom: 25px;
}

.eyebrow {
  gap: 9px;
  font-size: 12px;
  letter-spacing: .7px;
  color: var(--text-secondary);
}

.live-dot {
  background: var(--institutional-blue);
  box-shadow: 0 0 0 3px #e7f0f3;
}

h1 {
  font: 600 29px/1.2 var(--font-brand);
  letter-spacing: -.35px;
  color: var(--navy-dark);
  margin: 8px 0 6px;
}

.wave {
  display: none;
}

.page-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
}

.button {
  min-height: 38px;
  height: auto;
  padding: 9px 15px;
  border-radius: 5px;
  font: 600 12px var(--font-body);
}

.button-primary {
  background: var(--navy);
  border-color: var(--navy);
  box-shadow: none;
}

.button-primary:hover {
  background: var(--navy-dark);
  border-color: var(--navy-dark);
}

.button-quiet {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.button-quiet:hover {
  background: #f5f8fa;
  border-color: #bdcbd3;
}

.button:disabled {
  cursor: not-allowed;
  opacity: .62;
  transform: none;
}

.stats-grid {
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card, .panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  box-shadow: none;
}

.stat-card {
  padding: 17px 18px;
  min-height: 118px;
}

.stat-top {
  font-size: 12px;
  color: var(--text-secondary);
}

.stat-icon {
  width: 29px;
  height: 29px;
  border-radius: 5px;
}

.stat-icon.sage {
  background: #e8f4ee;
  color: var(--success);
}

.stat-icon.amber {
  background: #fbf2e4;
  color: var(--warning);
}

.stat-icon.blue {
  background: #eaf2f7;
  color: var(--info);
}

.stat-icon.lilac {
  background: #eaf2f7;
  color: var(--institutional-blue);
}

.stat-icon.muted {
  background: #edf0f2;
  color: #697987;
}

.stat-icon.danger {
  background: #faebeb;
  color: var(--danger);
}

.stat-value {
  font: 600 26px/1.1 var(--font-body);
  letter-spacing: -.6px;
  color: var(--navy-dark);
  margin: 12px 0 7px;
}

.stat-value small {
  font: 500 12px var(--font-body);
  color: var(--text-secondary);
}

.stat-value.status-word {
  font-size: 17px;
  letter-spacing: -.3px;
}

.stat-foot {
  font-size: 12px;
  color: var(--text-secondary);
}

.success-text {
  color: var(--success);
}

.warning-text {
  color: var(--warning);
}

.content-grid {
  grid-template-columns: minmax(0,1.65fr) minmax(280px,.85fr);
  gap: 16px;
}

.panel {
  padding: 20px;
}

.panel-heading h2 {
  font: 600 15px/1.3 var(--font-body);
  letter-spacing: -.2px;
  color: var(--navy-dark);
}

.section-kicker {
  font-size: 12px;
  letter-spacing: 1px;
  color: #748491;
}

.text-link, .pending-link {
  color: var(--institutional-blue);
  font-size: 12px;
}

.agenda-toolbar {
  margin-top: 14px;
  border-color: var(--border);
}

.selected-day strong {
  font: 600 21px var(--font-body);
  color: var(--navy);
}

.selected-day > span {
  font-size: 12px;
  color: var(--text-secondary);
}

.selected-day small {
  font-size: 12px;
  color: var(--text-secondary);
}

.agenda-list {
  padding-top: 5px;
}

.agenda-item {
  min-height: 88px;
}

.time-col strong {
  font-size: 12px;
  color: var(--navy-dark);
}

.time-col span {
  font-size: 12px;
  color: var(--text-secondary);
}

.timeline:after {
  background: #dce5e9;
}

.timeline-dot.agenda-dot {
  background: var(--institutional-blue);
  box-shadow: 0 0 0 1px #b9cdd7;
}

.event-card {
  border-color: var(--border);
  border-left: 3px solid var(--institutional-blue);
  border-radius: 5px;
  background: #fff;
  padding: 11px 12px 9px;
}

.event-type {
  display: inline-block;
  color: var(--navy);
  background: #edf3f6;
  border-radius: 3px;
  padding: 3px 6px;
  font-size: 12px;
  letter-spacing: .2px;
  font-weight: 700;
}

.event-main h3 {
  font: 600 12px/1.4 var(--font-body);
  letter-spacing: 0;
  color: var(--text-primary);
  white-space: normal;
}

.event-main p {
  font-size: 12px;
  color: var(--text-secondary);
}

.client-avatar {
  font-family: var(--font-body);
}

.ca-neutral {
  background: #eaf1f4;
  color: var(--navy);
}

.event-meta {
  color: #71818c;
}

.confirm-pill {
  border-radius: 4px;
  padding: 5px 7px;
  font-size: 12px;
  line-height: 1.3;
}

.confirm-pill.confirmed {
  background: #eaf4ee;
  color: #1f704c;
}

.confirm-pill.waiting {
  background: #fbf2e4;
  color: #8d5b12;
}

.confirm-pill.cancelled, .confirm-pill.failed {
  background: #faebeb;
  color: #a33434;
}

.event-bottom {
  border-color: #edf0f2;
  color: var(--text-secondary);
  font-size: 12px;
}

.event-owner, .event-owner b {
  color: var(--text-secondary);
}

.agenda-footer {
  border-color: var(--border);
  font-size: 12px;
  color: var(--text-secondary);
}

.agenda-footer a {
  color: var(--institutional-blue);
}

.pending-panel {
  padding: 19px 17px 15px;
}

.compact h2 {
  font-size: 14px;
}

.pending-count {
  background: #fbf2e4;
  color: #8d5b12;
  font-size: 12px;
}

.panel-description {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.pending-item {
  border-color: #edf0f2;
  min-height: 57px;
}

.pending-item .client-avatar {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  font-size: 12px;
}

.pending-info strong {
  font-size: 12px;
  color: var(--text-primary);
}

.pending-info small {
  font-size: 12px;
  color: var(--text-secondary);
}

.pending-state-short {
  flex: 0 0 auto;
  color: var(--warning);
  font-size: 12px;
  font-weight: 600;
}

.home-empty-note {
  padding: 15px 0;
  color: var(--text-secondary);
  font-size: 12px;
}

.tip-card {
  background: var(--navy-dark);
  border-radius: 7px;
  min-height: 170px;
  padding: 19px;
  color: #fff;
}

.tip-top {
  color: #cfdae1;
  font-size: 12px;
  letter-spacing: .8px;
}

.tip-star {
  color: var(--light-blue);
  font: 600 14px var(--font-brand);
}

.tip-card h3 {
  font: 500 17px/1.45 var(--font-brand);
  letter-spacing: 0;
  max-width: 260px;
  margin: 16px 0 8px;
}

.tip-card p {
  font-size: 12px;
  line-height: 1.6;
  color: #d0dbe2;
  max-width: 260px;
}

.tip-decoration {
  font: 100px var(--font-brand);
  color: #ffffff0b;
  right: 12px;
  bottom: -36px;
}

.page-footer {
  font-size: 12px;
  color: #74818c;
  padding-top: 19px;
}

.screen-view[hidden] {
  display: none !important;
}

.screen-toolbar {
  border-color: var(--border);
}

.screen-period {
  background: #f1f4f6;
}

.view-toggle {
  font: 500 12px var(--font-body);
  color: var(--text-secondary);
}

.view-toggle.selected {
  color: var(--navy-dark);
  box-shadow: 0 1px 3px #102a3a1b;
}

.screen-date {
  color: var(--navy-dark);
  font-size: 12px;
}

.screen-date strong {
  font-weight: 600;
}

.date-arrow {
  border-color: var(--border);
  color: var(--navy);
}

.date-arrow:hover {
  background: #edf3f6;
}

.screen-select-label {
  font-size: 12px;
  letter-spacing: .55px;
  color: var(--text-secondary);
}

.screen-select-label select, .search-field {
  border-color: var(--border);
  border-radius: 5px;
}

.screen-select-label select, .search-field input {
  font: 12px var(--font-body);
  color: var(--text-primary);
}

.full-agenda {
  border-color: var(--border);
}

.agenda-date-col strong {
  font-size: 12px;
  color: var(--navy-dark);
}

.agenda-date-col small {
  font-size: 12px;
  color: var(--text-secondary);
}

.empty-state {
  color: var(--text-secondary);
  padding: 18px;
}

.empty-state > span {
  color: var(--institutional-blue);
}

.empty-state strong {
  font: 600 13px var(--font-body);
  color: var(--navy-dark);
}

.empty-state p {
  font-size: 12px;
  color: var(--text-secondary);
}

.client-panel {
  border-color: var(--border);
}

.client-table th {
  font-size: 12px;
  letter-spacing: .45px;
  color: #647481;
  background: #f9fafb;
}

.client-table td {
  font-size: 12px;
  color: var(--text-secondary);
  border-color: #edf0f2;
}

.client-name-cell strong {
  font-size: 12px;
  color: var(--text-primary);
}

.client-name-cell .client-avatar {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  font-size: 12px;
}

.area-tag {
  background: #edf3f6;
  color: #345b72;
  font-size: 12px;
}

.client-status {
  background: #eaf4ee;
  color: #1f704c;
  font-size: 12px;
}

.client-status:before {
  background: var(--success);
}

.client-status.inactive {
  background: #edf0f2;
  color: #596a76;
}

.client-status.inactive:before {
  background: #8a98a2;
}

.client-edit {
  font-size: 12px;
  color: var(--institutional-blue);
}

.client-mobile-card {
  border-color: var(--border);
}

.client-mobile-head strong {
  font-size: 12px;
  color: var(--text-primary);
}

.client-mobile-head small, .client-mobile-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

.pending-summary-card {
  border-color: var(--border);
  border-radius: 7px;
  min-height: 86px;
}

.pending-summary-card strong {
  font: 600 22px var(--font-body);
  color: var(--navy-dark);
}

.pending-summary-card small {
  font-size: 12px;
  color: var(--text-secondary);
}

.pending-summary-card .metric-note {
  font-size: 12px;
  color: var(--text-secondary);
}

.pending-page-panel {
  border-color: var(--border);
}

.pending-page-panel > .panel-description {
  font-size: 12px;
}

.pending-rows {
  border-color: var(--border);
}

.pending-row {
  border-color: #edf0f2;
}

.pending-client strong, .pending-event strong {
  font-size: 12px;
  color: var(--text-primary);
}

.pending-client small, .pending-event small, .pending-message small {
  font-size: 12px;
  color: var(--text-secondary);
}

.message-state {
  font-size: 12px;
  color: var(--warning);
}

.message-state i {
  background: var(--warning);
}

.unavailable-state {
  color: var(--text-secondary);
}

.confirmed-state {
  color: var(--success);
}

.confirmed-state i {
  background: var(--success);
}

.cancelled-state {
  color: var(--danger);
}

.cancelled-state i {
  background: var(--danger);
}

.followup-no-action {
  color: var(--text-secondary);
  font-size: 12px;
  padding-inline: 8px;
}

.unavailable-state i {
  background: #82919b;
}

.pending-actions .button {
  font: 600 12px var(--font-body);
}

.mark-confirmed {
  font: 600 12px var(--font-body);
  color: var(--success);
}

.danger-action {
  color: var(--danger) !important;
}

.event-actions summary {
  border-color: var(--border);
  color: var(--text-secondary);
}

.event-action-menu {
  border-color: var(--border);
  box-shadow: 0 8px 24px #102a3a16;
}

.event-action-menu button {
  font: 500 12px var(--font-body);
  color: var(--text-primary);
}

.month-weekdays span {
  font-size: 12px;
  color: var(--text-secondary);
  border-color: var(--border);
}

.month-day {
  border-color: #edf0f2;
}

.month-day-number {
  color: var(--text-primary);
  font: 500 12px var(--font-body);
}

.selected-month-day .month-day-number {
  background: var(--navy);
  color: #fff;
}

.month-event-chip {
  background: #eaf1f4;
  color: var(--navy);
  font-size: 12px;
}

.month-more {
  font-size: 12px;
  color: var(--text-secondary);
}

@media (max-width: 560px) {

  .month-weekdays, .month-days {
    grid-template-columns: repeat(7,minmax(0,1fr));
    min-width: 0;
  }

  .month-weekdays span {
    padding: 7px 1px;
    font-size: 12px;
  }

  .month-day {
    min-width: 0;
    min-height: 67px;
    padding: 3px 1px;
    gap: 3px;
  }

  .month-day-number {
    width: 18px;
    height: 18px;
    font-size: 12px;
  }

  .month-event-chip {
    width: 5px;
    height: 5px;
    padding: 0;
    margin-inline: auto;
    border-radius: 50%;
    font-size: 0;
  }

  .month-more {
    padding: 0;
    font-size: 12px;
    text-align: center;
  }
}

.modal {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 25px;
  box-shadow: 0 20px 60px #102a3a24;
}

.modal-heading h2 {
  font: 600 20px var(--font-brand);
  color: var(--navy-dark);
}

.modal-note {
  font-size: 12px;
  color: var(--text-secondary);
}

.modal label {
  font-size: 12px;
  color: var(--text-primary);
}

.modal input, .modal select, .modal textarea {
  font: 12px var(--font-body);
  border-color: var(--border);
  border-radius: 5px;
  color: var(--text-primary);
}

.modal input:focus, .modal select:focus, .modal textarea:focus {
  border-color: var(--institutional-blue);
  box-shadow: 0 0 0 3px #437b9822;
}

.optional-label {
  color: var(--text-secondary);
}

.toast {
  background: var(--navy-dark);
  font-size: 12px;
}

.button:focus-visible,
.nav-link:focus-visible,
.text-link:focus-visible,
.pending-link:focus-visible,
.client-edit:focus-visible,
.event-actions summary:focus-visible,
.event-action-menu button:focus-visible,
.month-day:focus-visible,
.mark-confirmed:focus-visible,
.date-arrow:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #96CAD3;
  outline-offset: 2px;
}

.month-day:focus-visible {
  position: relative;
  z-index: 1;
}

@media (max-width: 1120px) {

  .sidebar {
    width: 238px;
  }

  .main-area {
    margin-left: 238px;
  }

  .content-grid {
    grid-template-columns: minmax(0,1.45fr) minmax(260px,.85fr);
  }
}

@media (max-width: 820px) {

  .sidebar {
    width: 258px;
  }

  .main-area {
    margin-left: 0;
  }

  .topbar {
    padding-inline: 20px;
  }

  .page-content {
    padding: 28px 20px 20px;
  }

  .side-column {
    grid-template-columns: 1fr 1fr;
  }

  .pending-panel {
    height: auto;
  }
}

@media (max-width: 560px) {

  .sidebar {
    width: min(290px,86vw);
  }

  .topbar {
    height: 58px;
    padding-inline: 15px;
  }

  .page-content {
    padding: 23px 14px 18px;
  }

  .welcome-row {
    gap: 13px;
  }

  .welcome-row .button {
    width: 100%;
    text-align: center;
  }

  .stats-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 9px;
  }

  .stat-card {
    min-height: 108px;
    padding: 12px;
  }

  .stat-top {
    font-size: 12px;
  }

  .stat-value {
    font-size: 22px;
  }

  .stat-value.status-word {
    font-size: 14px;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .agenda-panel {
    padding: 15px 12px;
  }

  .agenda-toolbar {
    justify-content: space-between;
  }

  .side-column {
    grid-template-columns: 1fr;
  }

  .pending-summary {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  .pending-summary-card {
    min-height: 72px;
    padding: 10px;
  }

  .pending-summary-card .stat-icon {
    width: 25px;
    height: 25px;
  }

  .pending-summary-card strong {
    font-size: 19px;
  }

  .pending-summary-card small {
    font-size: 12px;
  }

  .pending-page-panel {
    padding: 14px 12px;
  }

  .pending-row {
    grid-template-columns: 28px minmax(0,1fr);
    gap: 8px;
    padding: 12px 0;
  }

  .pending-client, .pending-event, .pending-message, .pending-actions {
    grid-column: 2;
  }

  .pending-actions {
    flex-wrap: wrap;
  }

  .full-agenda-item .event-main h3 {
    font-size: 12px;
  }

  .full-agenda-item .event-main p {
    font-size: 12px;
  }

  .client-panel {
    padding: 14px 12px;
  }

  .modal {
    padding: 20px 16px;
  }

  .modal .form-row {
    grid-template-columns: 1fr;
  }

  .page-footer {
    font-size: 12px;
  }

  .preview-pill {
    font-size: 12px;
  }
}

.client-row-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.client-delete {
  color: var(--danger);
}

.modal-delete {
  margin-right: auto;
  color: var(--danger);
}

.modal-delete[hidden] {
  display: none;
}

body.modal-open {
  overflow: hidden;
}

/* Agenda: na visão Dia todos os compromissos são do mesmo dia, então a coluna de data sai. */
.full-agenda-list.period-dia .agenda-date-col {
  display: none;
}

.full-agenda-list.period-dia .full-agenda-item {
  grid-template-columns: 43px 13px minmax(0,1fr);
}

/* O botão do topo repete o da barra da Agenda. */
.welcome-row .button[hidden] {
  display: none;
}

/* Situação ao lado do "···", e não solta no meio do cartão. */
.full-agenda-item .event-main > div:first-child {
  flex: 1;
  min-width: 0;
}

.screen-date strong {
  white-space: nowrap;
}

@media (max-width: 560px) {

  /* O título fica centralizado pela regra geral acima; no celular ele alinha à esquerda. */
  .welcome-row {
    align-items: stretch;
  }

  .full-agenda-list.period-dia .full-agenda-item {
    grid-template-columns: 40px 9px minmax(0,1fr);
  }

  /* Situação e "···" numa linha acima do conteúdo, para a etiqueta não vazar do cartão. */
  .full-agenda-item .event-main {
    flex-wrap: wrap;
    align-items: center;
  }

  .full-agenda-item .event-main > div:first-child {
    order: 2;
    flex: 1 1 100%;
    min-width: 0;
  }

  .full-agenda-item .confirm-pill {
    order: 1;
    white-space: normal;
  }

  .full-agenda-item .event-actions {
    order: 1;
  }

  .month-more-label {
    display: none;
  }
}

/* Desfechos */
.confirm-pill.done {
  background: #e8f0f5;
  color: var(--navy);
}

.confirm-pill.noshow {
  background: #f8ede4;
  color: #94511c;
}

.mark-confirmed.outcome-noshow {
  color: #94511c;
}

.outcome-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 14px;
  padding: 11px 14px;
  border: 1px solid #f0dcbc;
  border-radius: 6px;
  background: #fdf7ee;
  color: #6f4a12;
  font-size: 12px;
}

.outcome-notice[hidden] {
  display: none;
}

.outcome-notice .button {
  min-height: 32px;
  padding: 6px 12px;
}

/* Ficha do cliente */
.client-name-link {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.client-name-link:hover {
  color: var(--institutional-blue);
  text-decoration: underline;
}

.client-name-link:focus-visible {
  outline: 3px solid #96CAD3;
  outline-offset: 2px;
  border-radius: 2px;
}

.client-detail {
  width: min(620px,100%);
}

.client-detail-fields {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 12px 18px;
  margin: 4px 0 14px;
}

.client-detail-fields dt {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.client-detail-fields dd {
  margin: 0;
  font-size: 13px;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.muted-value {
  color: var(--text-secondary);
}

.client-detail-notes {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 5px;
  background: var(--background);
  font-size: 12px;
  color: var(--text-primary);
  white-space: pre-line;
}

.client-detail-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 16px 0 6px;
  font: 600 13px var(--font-body);
  color: var(--navy-dark);
}

.client-detail-heading small {
  font-weight: 500;
  font-size: 12px;
  color: var(--text-secondary);
}

.client-history {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
}

.client-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.client-history-item div {
  min-width: 0;
}

.client-history-item strong {
  display: block;
  font-size: 12px;
  color: var(--text-primary);
}

.client-history-item small {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-history-empty {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.client-detail .modal-actions {
  flex-wrap: wrap;
}

@media (max-width: 560px) {

  .client-detail-fields {
    grid-template-columns: 1fr;
  }

  .client-detail .modal-actions .button {
    flex: 1 1 100%;
  }
}

/* Processo, vara e sala virtual no cartão do compromisso */
.event-main p.event-case {
  margin-top: 4px;
  flex-wrap: wrap;
  gap: 4px 10px;
  color: var(--text-secondary);
}

.event-link {
  color: var(--institutional-blue);
  font-weight: 600;
  text-decoration: none;
}

.event-link:hover {
  text-decoration: underline;
}

.event-link:focus-visible {
  outline: 3px solid #96CAD3;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Observações no cartão: até duas linhas */
.event-main p.event-notes {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 4px;
  color: var(--text-secondary);
  font-style: italic;
}

.client-history-item small.history-notes {
  font-style: italic;
}

/* Reagendamento */
.modal-hint {
  margin: -2px 0 12px;
  padding: 8px 10px;
  border-radius: 5px;
  background: #eaf2f7;
  color: var(--navy);
  font-size: 12px;
}

.modal select:disabled {
  background: #f3f5f7;
  color: var(--text-secondary);
  cursor: not-allowed;
}

/* Calendário: dia de hoje e situação nos chips */
.today-month-day .month-day-number {
  box-shadow: inset 0 0 0 2px var(--institutional-blue);
  color: var(--navy);
  font-weight: 700;
}

.selected-month-day.today-month-day .month-day-number {
  box-shadow: none;
  color: #fff;
}

.month-event-chip.chip-status-confirmed {
  background: #eaf4ee;
  color: #1f704c;
}

.month-event-chip.chip-status-waiting {
  background: #fbf2e4;
  color: #8d5b12;
}

.month-event-chip.chip-status-cancelled {
  background: #eef0f2;
  color: #7b8790;
  text-decoration: line-through;
}

.month-event-chip.chip-status-done {
  background: #e8f0f5;
  color: var(--navy);
}

.month-event-chip.chip-status-noshow {
  background: #f8ede4;
  color: #94511c;
}

@media (max-width: 560px) {

  .month-event-chip.chip-status-confirmed {
    background: #23845b;
  }

  .month-event-chip.chip-status-waiting {
    background: #b7791f;
  }

  .month-event-chip.chip-status-cancelled {
    background: #a5aeb5;
  }

  .month-event-chip.chip-status-done {
    background: var(--navy);
  }

  .month-event-chip.chip-status-noshow {
    background: #c0632a;
  }
}

/* Aviso ao abrir o index.html direto do disco (os módulos não carregam em file://) */
.file-warning {
  position: fixed;
  inset: 16px 16px auto;
  z-index: 100;
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 16px;
  border: 1px solid #f0dcbc;
  border-radius: 7px;
  background: #fdf7ee;
  color: #6f4a12;
  font-size: 13px;
  line-height: 1.55;
  box-shadow: 0 12px 32px #102a3a24;
}

.file-warning code {
  padding: 1px 5px;
  border-radius: 3px;
  background: #f6e9d3;
  font-size: 12px;
}

.file-warning a {
  color: var(--navy);
  font-weight: 600;
}

/* Autorização de mensagens pelo WhatsApp (cadastro, lista, ficha e Acompanhamento) */
.modal .consent-check {
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px;
  margin: 2px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--background);
  cursor: pointer;
}

.modal .consent-check input {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  padding: 0;
  accent-color: var(--navy);
  cursor: pointer;
}

.modal .consent-check input:focus {
  box-shadow: none;
}

.modal .consent-check input:focus-visible {
  outline: 2px solid var(--institutional-blue);
  outline-offset: 2px;
}

.consent-check span {
  display: grid;
  gap: 3px;
}

.consent-check small {
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.45;
}

.consent-missing, .pending-message .consent-missing {
  font-size: 12px;
  font-weight: 600;
  color: var(--warning);
}

.whatsapp-link {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--institutional-blue);
}

/* Remarcação pedida pelo cliente */
.confirm-pill.reschedule {
  background: #f1ecf8;
  color: #5d4391;
}

.month-event-chip.chip-status-reschedule {
  background: #f1ecf8;
  color: #5d4391;
}

@media (max-width: 560px) {

  .month-event-chip.chip-status-reschedule {
    background: #6b51a3;
  }
}

.reschedule-state {
  color: #5d4391;
}

.reschedule-state i {
  background: #6b51a3;
}

.pending-row.reschedule-row {
  box-shadow: inset 3px 0 0 #6b51a3;
  background: #faf8fd;
}

.mark-confirmed.reschedule-action {
  color: #5d4391;
}

.outcome-notice.reschedule-notice {
  border-color: #ddd2ee;
  background: #f7f3fc;
  color: #4a3478;
}

/* Prévia das mensagens de WhatsApp */
.message-preview-link {
  justify-self: start;
  border: 0;
  background: none;
  padding: 0;
  font: 600 12px var(--font-body);
  color: var(--institutional-blue);
  text-decoration: underline;
  cursor: pointer;
}

.message-preview {
  width: min(560px,100%);
}

.message-preview-summary {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.message-block {
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.message-block-head {
  display: grid;
  gap: 3px;
  margin-bottom: 10px;
}

.message-block-head h3 {
  margin: 0;
  font-size: 13px;
  color: var(--text-primary);
}

.message-timing {
  font-size: 12px;
  color: var(--success);
}

.message-timing.blocked {
  color: var(--warning);
}

.message-chat {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 5px;
  background: #efeae2;
}

.message-bubble {
  max-width: 92%;
  padding: 8px 10px;
  border-radius: 0 7px 7px 7px;
  background: #fff;
  color: #111b21;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 1px 1px #0b141a1a;
  overflow-wrap: anywhere;
}

.message-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 92%;
}

.message-replies span {
  flex: 1 1 0;
  min-width: 110px;
  padding: 7px 10px;
  border-radius: 7px;
  background: #fff;
  color: #027eb5;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 1px 1px #0b141a1a;
}

.message-block-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.message-block-actions .button {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 12px;
  font-size: 12px;
  text-decoration: none;
}

.message-template {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-secondary);
}

.message-template summary {
  cursor: pointer;
  font-weight: 600;
}

.message-template pre {
  margin: 8px 0;
  padding: 10px;
  border-radius: 5px;
  background: var(--background);
  color: var(--text-primary);
  font: 12px/1.5 var(--font-body);
  white-space: pre-wrap;
}

.message-template ul {
  margin: 0;
  padding-left: 18px;
}

.message-template code {
  font-size: 12px;
}

.event-action-menu button {
  white-space: nowrap;
}

/* Carregando os dados do servidor (ou falha ao carregar) */
body[data-load] .page-content > :not(.welcome-row):not(.load-state) {
  display: none !important;
}

body[data-load] #newAppointment {
  visibility: hidden;
}

.load-state {
  display: none;
}

body[data-load] .load-state {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 13px;
}

body[data-load="error"] .load-state {
  border-color: #f0dcbc;
  background: #fdf7ee;
  color: #6f4a12;
}

.load-state .button {
  min-height: 32px;
  padding: 6px 12px;
}

.load-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--institutional-blue);
  border-radius: 50%;
  animation: load-spin 0.8s linear infinite;
}

@keyframes load-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Login e botão Sair */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.modal-backdrop.login-screen {
  z-index: 25;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: var(--navy-dark);
}

.modal-backdrop.login-screen[hidden] {
  display: none;
}

.login-panel {
  width: min(380px,100%);
  display: grid;
  gap: 22px;
}

.login-brand {
  justify-self: center;
  pointer-events: none;
}

.login-card {
  display: grid;
  gap: 14px;
  padding: 28px 26px 26px;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 24px 60px #0000004d;
}

.login-card h1 {
  margin: 0;
  font: 600 26px var(--font-brand);
  color: var(--text-primary);
}

.login-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.login-card label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.login-card input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: 14px var(--font-body);
  color: var(--text-primary);
  outline: none;
}

.login-card input:focus {
  border-color: var(--institutional-blue);
  box-shadow: 0 0 0 3px #437b9822;
}

#loginCode {
  letter-spacing: 4px;
  font-variant-numeric: tabular-nums;
}

.login-error {
  margin: 0;
  padding: 9px 11px;
  border-radius: 5px;
  background: #faebeb;
  color: #a33434;
  font-size: 12px;
  line-height: 1.45;
}

.login-error[hidden] {
  display: none;
}

.login-card .button {
  width: 100%;
  justify-content: center;
  min-height: 42px;
  margin-top: 4px;
}

.logout-button {
  justify-self: start;
  border: 0;
  background: none;
  padding: 0;
  font: 12px var(--font-body);
  color: #b5c4cf;
  text-decoration: underline;
  cursor: pointer;
}

.logout-button:hover {
  color: #fff;
}

/* Histórico de alterações (ficha do cliente) */
.client-audit {
  margin: 4px 0 14px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  font-size: 12px;
}

.client-audit summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.audit-list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
}

.audit-item {
  padding: 0 0 10px;
  border-bottom: 1px solid #edf0f2;
}

.audit-meta {
  color: var(--text-secondary);
}

.audit-title {
  margin-top: 2px;
  font-weight: 600;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.audit-item ul {
  margin: 4px 0 0;
  padding-left: 16px;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

.audit-item ul strong {
  font-weight: 600;
  color: var(--text-primary);
}

/* WhatsApp: forma da autorização, mensagens registradas e simulação (modo de teste) */
.modal .consent-method {
  margin-top: 10px;
}

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

.client-message-list {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  font-size: 12px;
}

.client-message-list li {
  display: grid;
  gap: 2px;
  padding-bottom: 8px;
  border-bottom: 1px solid #edf0f2;
}

.client-message-list small {
  color: var(--text-secondary);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.message-timing.logged {
  font-weight: 600;
}

.message-reply-bubble {
  justify-self: end;
  max-width: 80%;
  padding: 7px 10px;
  border-radius: 7px 0 7px 7px;
  background: #d9fdd3;
  color: #111b21;
  font-size: 13px;
  box-shadow: 0 1px 1px #0b141a1a;
  overflow-wrap: anywhere;
}

.message-simulate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px dashed var(--border);
  border-radius: 5px;
  font-size: 12px;
  color: var(--text-secondary);
}

.message-simulate .button {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
}

/* Prévia: a cor do que já saiu segue a situação da mensagem */
.message-timing.logged.unavailable-state {
  color: var(--text-secondary);
}

.message-timing.logged.confirmed-state {
  color: var(--success);
}

.message-timing.logged.cancelled-state {
  color: var(--danger);
}

.message-timing.logged.reschedule-state {
  color: #5d4391;
}

/* Em produção (servidor do escritório, com dados reais) não aparecem os avisos de versão de testes */
body[data-env="producao"] .test-only {
  display: none !important;
}
