/* ======================================================
   CSS EXCLUSIVO DA PÁGINA AGENDA
====================================================== */

.agenda-page {
    background-color: #f4f6fb;
    min-height: 100vh;
}

.agenda-page .page-content {
    padding: 32px 72px 48px;
}


/* ======================================================
   TÍTULOS
====================================================== */

.agenda-page .page-header h1 {
    font-size: 30px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
}

.agenda-page .page-subtitle {
    font-size: 14px;
    color: #6b7280;
}


/* ======================================================
   FILTROS
====================================================== */

.agenda-page .filters-row {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)); /* 3 filtros com mesma largura */
    gap: 16px;
}

.agenda-page .filter-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0; /* permite que os filtros usem 1fr igualmente */
}

.agenda-page .filter-dropdown {
    width: 100%;
}

.agenda-page .filter-label {
    font-size: 13px;
    color: #374151;
}

.agenda-page .date-picker,
.agenda-page .date-picker .SingleDatePicker,
.agenda-page .date-picker .SingleDatePickerInput,
.agenda-page .date-picker .DateInput {
    width: 100%;
    display: block;
    box-sizing: border-box;
}

.agenda-page .date-picker .DateInput_input {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    line-height: 20px;
    height: 38px;
    color: #374151;
    box-sizing: border-box;
}

.agenda-page .date-picker .DateInput_input__focused {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}


/* ======================================================
   TABELA
====================================================== */

.agenda-page .agenda-table-container {
    margin-top: 24px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.03);
    /* precisa permitir que o popup ultrapasse a área da tabela */
    overflow: visible;
}

.agenda-page .agenda-table {
    width: 100%;
    border-collapse: collapse;
}

.agenda-page .agenda-table th,
.agenda-page .agenda-table td {
    padding: 12px 16px;
    font-size: 13px;
    text-align: left;
}

.agenda-page .agenda-table th {
    background-color: #f3f4f6;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}

.agenda-page .agenda-table td {
    border-bottom: 1px solid #f3f4f6;
    color: #4b5563;
}

.agenda-page .agenda-table tr:nth-child(even) td {
    background-color: #fafafa;
}

.agenda-page .agenda-table tr:hover td {
    background-color: #e5f2ff;
}

/* ======================================================
   TOGGLE (LISTA / CALENDÁRIO)
====================================================== */

.agenda-page .page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.agenda-page .page-header-main {
    min-width: 0;
}

/* Busca de atendimentos (header) */
.agenda-search {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.agenda-search-input {
    width: min(420px, 70vw);
}

.agenda-search-btn {
    padding: 10px 14px;
}

.agenda-search-context {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.agenda-search-chip {
    max-width: 220px;
    padding: 2px 7px;
    border: 1px solid #dbe3ef;
    border-radius: 999px;
    background: #f8fafc;
    color: #475569;
    font-size: 11px;
    line-height: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Botão de roteirização (abre modal) */
.agenda-routing-btn {
    padding: 10px 14px;
    font-weight: 800;
}

.agenda-view-toggle {
    display: inline-flex;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 4px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.03);
}

.agenda-view-btn {
    border: 0;
    background: transparent;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
}

.agenda-view-btn:hover {
    background: #f3f4f6;
}

.agenda-view-btn.is-active {
    background: #111827;
    color: #ffffff;
}

/* ======================================================
   CALENDÁRIO (GRADE MENSAL)
====================================================== */

.agenda-calendar-container {
    margin-top: 24px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.03);
    overflow: visible;
    /*
      "Aumenta" o calendário nas laterais usando o padding lateral da page-content (72px).
      Deixa o calendário quase colado na borda (gutter ~4px).
    */
    margin-left: -68px;
    margin-right: -68px;
}

/* Lista (tabela) - escondida por padrão no desktop (no mobile aparece via media query) */
#agenda-table-wrapper {
    display: none;
}

.agenda-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* mantém alinhamento interno com o resto da página (padding de 72px) */
    padding: 14px 72px;
    border-bottom: 1px solid #eef2f7;
}

.agenda-calendar-title {
    font-size: 16px;
    font-weight: 800;
    color: #111827;
}

.agenda-calendar-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.agenda-cal-nav-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: #111827;
}

.agenda-cal-nav-btn:hover {
    background: #f3f4f6;
}

.agenda-cal-today-btn {
    height: 34px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    color: #111827;
}

.agenda-cal-today-btn:hover {
    background: #f3f4f6;
}

.agenda-cal-dow {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    /* mantém alinhamento interno com o header */
    padding: 10px 68px 0;
}

.agenda-cal-dow-cell {
    font-size: 11px;
    font-weight: 800;
    color: #6b7280;
    padding: 6px 8px 10px;
}

.agenda-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border-top: 1px solid #eef2f7;
    padding: 0 56px 16px;
}

.agenda-cal-cell {
    min-height: 120px;
    border-right: 1px solid #eef2f7;
    border-bottom: 1px solid #eef2f7;
    padding: 10px 10px 12px;
    position: relative;
    overflow: visible;
}

.agenda-cal-cell.has-actions {
    padding-top: 38px;
}

.agenda-cal-add-btn {
    position: static;
    width: 22px;
    height: 22px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    color: #111827;
}

.agenda-cal-add-btn:hover {
    background: #f3f4f6;
}

.agenda-cal-cell-top {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-height: 22px;
    margin-bottom: 8px;
}

.agenda-cal-overview-btn {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    min-height: 26px;
    padding: 3px 6px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: #dbeafe;
    box-shadow: none;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    color: #1e40af;
    margin-bottom: 8px;
    white-space: normal;
    text-align: center;
}

.agenda-cal-overview-btn-label {
    letter-spacing: 0.01em;
}

.agenda-cal-overview-btn-count {
    font-size: 13px;
    font-weight: 900;
}

.agenda-cal-overview-btn:hover {
    filter: brightness(0.97);
}

.agenda-cal-overview-btn.is-avail-low {
    background: #fee2e2;
    color: #b91c1c;
}

.agenda-cal-overview-btn.is-avail-mid {
    background: #fef9c3;
    color: #a16207;
}

.agenda-cal-overview-btn.is-avail-high {
    background: #dbeafe;
    color: #1e40af;
}

.agenda-cal-cell:nth-child(7n) {
    border-right: 0;
}

.agenda-cal-cell.is-outside {
    background: #fafafa;
    color: #9ca3af;
}

.agenda-cal-cell.is-today {
    /* Contorno azul no dia atual (sem afetar o grid) */
    box-shadow: inset 0 0 0 2px #2563eb;
    border-radius: 10px;
}

.agenda-cal-cell.is-today .agenda-cal-daynum {
    color: #1d4ed8;
}

.agenda-cal-daynum {
    position: absolute;
    top: 10px;
    left: 10px;
    display: block;
    font-weight: 800;
    font-size: 12px;
    color: #111827;
    margin-bottom: 0;
}

.agenda-cal-cell.is-outside .agenda-cal-daynum {
    color: #9ca3af;
}

.agenda-cal-events {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.agenda-cal-event {
    width: 100%;
    background: #1d4ed8;
    color: #ffffff;
    border-radius: 8px;
    padding: 6px 8px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agenda-cal-event .status-flag {
    margin-right: 0;
    flex-shrink: 0;
}

.agenda-cal-event-time {
    flex-shrink: 0;
}

.agenda-cal-event-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

.agenda-cal-event.is-warn {
    background: #7c3aed;
}

.agenda-cal-event.is-ok {
    background: #1d4ed8;
}

.agenda-cal-more {
    font-size: 12px;
    color: #374151;
    font-weight: 700;
    padding: 2px 2px;
}

.agenda-cal-more-btn {
    font-size: 12px;
    color: #374151;
    font-weight: 800;
    padding: 2px 2px;
    background: transparent;
    border: 0;
    text-align: left;
    cursor: pointer;
}

.agenda-cal-more-btn:hover {
    text-decoration: underline;
}

.agenda-cal-event-tooltip .agenda-tooltip {
    top: 100%;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
}

/* Tooltip de detalhes da visita (popup ao passar o mouse) */
.agenda-tooltip-container {
    position: relative;
    display: inline-block;
}

.agenda-tooltip {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 50;
    min-width: 320px;
    max-width: min(540px, 92vw);
    padding: 16px 18px 18px;
    margin-top: 6px;
    background-color: #ffffff;
    color: #111827;
    border-radius: 14px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.28);
    font-size: 12px;
    line-height: 1.45;
    white-space: normal;
    max-height: 420px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
}

.agenda-tooltip-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.agenda-tooltip-spacer {
    flex: 1;
}

.agenda-tooltip-edit-btn {
    margin-left: auto;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #f3f4f6;
    color: #374151;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    padding: 0;
}

.agenda-tooltip-edit-btn:hover {
    background: #e5e7eb;
}

.agenda-tooltip-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
}

.agenda-tooltip-delete-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid #fecaca;
    background: #fee2e2;
    color: #b91c1c;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    padding: 0;
}

.agenda-tooltip-delete-btn:hover {
    background: #fecaca;
}

.agenda-tooltip-duplicate-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid #bfdbfe;
    background: #dbeafe;
    color: #1d4ed8;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.agenda-tooltip-duplicate-btn:hover {
    background: #bfdbfe;
}

.agenda-tooltip-remarcar-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid #fed7aa;
    background: #ffedd5;
    color: #c2410c;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    line-height: 1;
    padding: 0;
}

.agenda-tooltip-remarcar-btn:hover {
    background: #fed7aa;
}

.agenda-tooltip-restore-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid #bbf7d0;
    background: #dcfce7;
    color: #166534;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    line-height: 1;
    padding: 0;
}

.agenda-tooltip-restore-btn:hover {
    background: #bbf7d0;
}

.agenda-tooltip-duplicate-icon {
    display: block;
    font-size: 14px;
    line-height: 1;
}

.agenda-dot {
    width: 10px;
    height: 10px;
    margin-top: 4px;
    border-radius: 50%;
    background-color: #fbbc04;
    flex-shrink: 0;
}

.agenda-tooltip-title {
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 2px;
}

.agenda-tooltip-subtitle {
    color: #4b5563;
    font-size: 12px;
}

.agenda-chip {
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    height: fit-content;
}

/* Tag de Zona (cores por zona) */
.agenda-chip-zona {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

/* Mesmas cores para o chip do tooltip e a pílula do modal do dia */
.agenda-chip-zona.is-zona-recreio,
.agenda-day-zona.is-zona-recreio {
    background: #dcfce7; /* verde claro */
    color: #166534;
    border-color: #86efac;
}

.agenda-chip-zona.is-zona-jacarepagua,
.agenda-day-zona.is-zona-jacarepagua {
    background: #166534; /* verde escuro */
    color: #ffffff;
    border-color: #14532d;
}

.agenda-chip-zona.is-zona-sul-centro,
.agenda-day-zona.is-zona-sul-centro {
    background: #1e3a8a; /* azul escuro */
    color: #ffffff;
    border-color: #1e40af;
}

.agenda-chip-zona.is-zona-norte,
.agenda-day-zona.is-zona-norte {
    background: #b91c1c; /* vermelha */
    color: #ffffff;
    border-color: #991b1b;
}

.agenda-chip-zona.is-zona-tijuca,
.agenda-day-zona.is-zona-tijuca {
    background: #f97316; /* laranja */
    color: #ffffff;
    border-color: #ea580c;
}

.agenda-chip-zona.is-zona-niteroi-ilha,
.agenda-day-zona.is-zona-niteroi-ilha {
    background: #92400e; /* marrom */
    color: #ffffff;
    border-color: #78350f;
}

.agenda-chip-zona.is-zona-campo-grande,
.agenda-day-zona.is-zona-campo-grande {
    background: #6d28d9; /* roxo */
    color: #ffffff;
    border-color: #5b21b6;
}

.agenda-tooltip-header .agenda-chip {
    margin-left: 0;
}

.agenda-chip-detetizador {
    margin-left: 0;
}

.agenda-tooltip-address {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: #111827;
}

.agenda-tooltip-icon {
    margin-top: 1px;
}

.agenda-tooltip-text-strong {
    font-weight: 600;
}

.agenda-divider {
    border-top: 1px solid #e5e7eb;
    margin: 10px 0;
}

.agenda-tooltip-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.agenda-tooltip-row {
    display: flex;
    gap: 6px;
}

.agenda-tooltip-label {
    font-weight: 600;
    color: #111827;
    min-width: 165px;
}

/* ======================================================
   LOGIN
====================================================== */
.login-page {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 360px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-card h2 {
    margin: 0 0 6px 0;
    color: #111827;
}

.login-role {
    display: flex;
    gap: 12px;
}

.login-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
}

.login-button {
    padding: 10px 12px;
    background: #1d4ed8;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.login-message {
    min-height: 20px;
    color: #b91c1c;
    font-size: 13px;
}

/* Tooltip abre por clique (JS adiciona .is-open no container) */
.agenda-tooltip-container.is-open .agenda-tooltip {
    display: block;
}

/* Quando o tooltip é usado "inline" (dentro do modal), ele deve ficar sempre visível e estático */
.agenda-tooltip-inline {
    display: block;
    position: static;
    top: auto;
    left: auto;
    margin-top: 0;
    max-width: 100%;
    max-height: none;
}

.agenda-detail-parallel-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.agenda-detail-parallel-divider {
    border: 0;
    border-top: 2px dashed #d1d5db;
    margin: 4px 0;
}

.agenda-day-item-btn {
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.agenda-day-item-btn:hover {
    background: #f9fafb;
}

/* ======================================================
   MODAL: LISTA DE VISITAS DO DIA (CALENDÁRIO)
====================================================== */

.agenda-day-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.45);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

#agenda-routing-modal {
    z-index: 220;
}

#agenda-overview-modal {
    z-index: 200;
}

#agenda-detail-modal {
    z-index: 250;
}

#agenda-overview-horarios-modal {
    z-index: 240;
}

.agenda-day-modal {
    width: min(860px, 96vw);
    max-height: min(80vh, 720px);
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.35);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.agenda-day-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #eef2f7;
}

.agenda-day-modal-title {
    font-weight: 800;
    font-size: 14px;
    color: #111827;
}

.agenda-profissionais-modal {
    width: min(720px, 94vw);
}

.agenda-day-modal-close {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #111827;
}

.agenda-day-modal-close:hover {
    background: #f3f4f6;
}

.agenda-day-modal-body {
    padding: 14px 16px 16px;
    overflow: auto;
}

.agenda-day-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.agenda-day-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #eef2f7;
    border-radius: 12px;
    background: #ffffff;
}

.agenda-day-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.agenda-day-time {
    font-weight: 900;
    color: #111827;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
}

.agenda-day-client {
    font-weight: 800;
    color: #111827;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 360px;
}

.agenda-day-date {
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    padding: 4px 8px;
    border-radius: 999px;
    white-space: nowrap;
}

.agenda-day-item-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.agenda-day-det,
.agenda-day-zona {
    font-size: 12px;
    font-weight: 700;
    color: #374151;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    padding: 4px 8px;
    border-radius: 999px;
}

.agenda-routing-det-open-btn {
    cursor: pointer;
}

.agenda-routing-det-open-btn:hover {
    background: #e5e7eb;
}

.agenda-routing-item-open-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0;
    text-align: left;
    cursor: pointer;
}

.agenda-day-status {
    font-size: 12px;
    font-weight: 900;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid transparent;
    text-transform: uppercase;
}

.agenda-day-status.is-ok {
    background: #dbeafe;
    color: #1e40af;
    border-color: #bfdbfe;
}

.agenda-day-status.is-warn {
    background: #fef9c3;
    color: #854d0e;
    border-color: #fde68a;
}

.agenda-day-empty {
    color: #6b7280;
    font-weight: 700;
}

.agenda-page .no-results {
    text-align: center;
    padding: 12px;
    color: #9ca3af;
    font-style: italic;
}


/* ======================================================
   FLAG AMARELA (clientes a confirmar)
====================================================== */

.status-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background-color: #facc15;
    color: #111827;
    font-weight: 700;
    font-size: 11px;
    margin-right: 4px;
}

/* Flag de tipo (Serviço / Vistoria) ao lado do cliente */
.agenda-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 11px;
    margin-right: 6px;
    border: 1px solid transparent;
}

.agenda-flag.is-servico {
    background: #dbeafe;
    color: #1e40af;
    border-color: #bfdbfe;
}

.agenda-flag.is-vistoria {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.agenda-flag.is-repasse {
    background: #fef9c3;
    color: #854d0e;
    border-color: #fde68a;
}

.agenda-flag.is-complemento {
    background: #e0f2fe;
    color: #075985;
    border-color: #bae6fd;
}

.agenda-flag.is-manutencao {
    background: #ede9fe;
    color: #5b21b6;
    border-color: #ddd6fe;
}

.agenda-flag.is-recolher_pagamento {
    background: #fce7f3;
    color: #9d174d;
    border-color: #fbcfe8;
}

.agenda-chip-tipo.is-servico {
    background: #dbeafe;
    color: #1e40af;
    border-color: #bfdbfe;
}

.agenda-chip-tipo.is-vistoria {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.agenda-chip-tipo.is-repasse {
    background: #fef9c3;
    color: #854d0e;
    border-color: #fde68a;
}

.agenda-chip-tipo.is-complemento {
    background: #e0f2fe;
    color: #075985;
    border-color: #bae6fd;
}

.agenda-chip-tipo.is-manutencao {
    background: #ede9fe;
    color: #5b21b6;
    border-color: #ddd6fe;
}

.agenda-chip-tipo.is-recolher_pagamento {
    background: #fce7f3;
    color: #9d174d;
    border-color: #fbcfe8;
}


/* ======================================================
   CARD "NOVAS VISITAS"
====================================================== */

.nova-visita-card {
    margin-top: 32px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.03);
    padding: 20px 24px 24px;
}

.nova-visita-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 14px;
}

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

.nova-visita-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.janela-item {
    grid-column: 1 / -1;
}

.janela-row {
    display: grid;
    grid-template-columns: 1fr; /* mantém o dropdown com largura total */
    gap: 8px;
    align-items: center;
}

.janela-ate {
    font-size: 13px;
    color: #4b5563;
}


/* ======================================================
   INPUTS
====================================================== */

.input-text {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 13px;
    box-sizing: border-box;
}

/* Mantém inputs e dropdowns com a mesma altura visual */
input.input-text {
    height: 38px;
}

/* Não força altura em textarea */
textarea.input-text {
    height: auto;
}

.nova-visita-card .filter-dropdown {
    width: 100%;
}

.naturezas-checklist {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 8px;
    align-items: stretch;
}

.naturezas-checklist-label {
    min-height: 38px;
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    padding: 8px 11px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    font-size: 13px;
    line-height: 1.2;
    color: #374151;
    cursor: pointer;
    user-select: none;
}

.naturezas-checklist-input {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    margin: 0 !important;
    accent-color: #2563eb;
}

/* ======================================================
   DROPDOWN (Dash / react-select) — melhora de legibilidade
====================================================== */

/* Campo (control) - mesma altura dos inputs */
.agenda-page .filter-dropdown .Select-control {
    min-height: 38px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    box-sizing: border-box;
}

/* Single-select: mantém altura fixa */
.agenda-page .filter-dropdown .Select.Select--single .Select-control {
    height: 38px;
}

/* Multi-select: não pode cortar os chips selecionados */
.agenda-page .filter-dropdown .Select.Select--multi .Select-control {
    height: auto;
}

/* Texto dentro do campo */
.agenda-page .filter-dropdown .Select-placeholder,
.agenda-page .filter-dropdown .Select-value-label,
.agenda-page .filter-dropdown .Select-input > input {
    font-size: 13px;
    line-height: 20px;
}

/* Centraliza o texto verticalmente no control */
.agenda-page .filter-dropdown .Select.Select--single .Select-placeholder,
.agenda-page .filter-dropdown .Select.Select--single .Select-value {
    line-height: 36px;
}

/* Ajusta a área de input/ícone para acompanhar a altura */
.agenda-page .filter-dropdown .Select.Select--single .Select-input {
    height: 36px;
}

.agenda-page .filter-dropdown .Select-arrow-zone,
.agenda-page .filter-dropdown .Select-clear-zone {
    padding-top: 4px;
    padding-bottom: 4px;
}

/* Área do menu */
.agenda-page .filter-dropdown .Select-menu-outer {
    max-height: 420px;
    border-radius: 10px;
    /* Deixa o menu mais largo que o campo para ler opções longas */
    min-width: 560px;
    max-width: 90vw;
}

/* Lista de opções */
.agenda-page .filter-dropdown .Select-menu {
    max-height: 420px;
}

/* Opções mais altas + permite quebrar linha em textos longos */
.agenda-page .filter-dropdown .Select-option {
    padding: 12px 14px;
    font-size: 13px;
    line-height: 22px;
    white-space: normal;
}

/* Item selecionado / hover */
.agenda-page .filter-dropdown .Select-option.is-selected {
    background: #eef2ff;
}

.agenda-page .filter-dropdown .Select-option.is-focused {
    background: #e0e7ff;
}

.nova-visita-card .date-picker,
.nova-visita-card .date-picker .SingleDatePicker,
.nova-visita-card .date-picker .SingleDatePickerInput,
.nova-visita-card .date-picker .DateInput,
.nova-visita-card .date-picker .DateInput_input {
    width: 100%;
    display: block;
    box-sizing: border-box;
}

.confirmado-checklist {
    margin: 0;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    height: 38px;
    box-sizing: border-box;
    width: 100%;
}

.confirmado-checklist label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.confirmado-checklist input {
    margin: 0;
}

.input-text:focus {
    border-color: #2563eb;
}


/* ======================================================
   AÇÕES
====================================================== */

.nova-visita-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Sidebar em edição de Serviço "A confirmar": exibe o botão de confirmar */
.sidebar-mode-edit.sidebar-status-a-confirmar #btn-confirmar-visita {
    display: inline-flex !important;
}

/* Modal do dia: botão "Horários Disponíveis" */
.agenda-day-modal-overview-btn {
    margin-left: auto;
    margin-right: 10px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #111827;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 13px;
    cursor: pointer;
}
.agenda-day-modal-overview-btn:hover {
    background: #f9fafb;
}

/* Quadro geral */
.agenda-overview-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.agenda-overview-title-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.agenda-overview-title-actions {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 10px;
}

.agenda-overview-title-btn {
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #ffffff;
    color: #111827;
    font-size: 12px;
    font-weight: 700;
    padding: 8px 12px;
    cursor: pointer;
}

.agenda-overview-title-btn:hover {
    background: #f9fafb;
}

.agenda-overview-title-btn.is-primary {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

.agenda-overview-title-btn.is-primary:hover {
    background: #1d4ed8;
}

.agenda-overview-transfer-panel {
    display: none;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    border: 1px solid #dbe3f0;
    border-radius: 12px;
    background: #f8fbff;
    flex-wrap: wrap;
}

.agenda-overview-transfer-panel.is-open {
    display: flex;
}

.agenda-overview-horarios-modal {
    width: min(760px, 96vw);
}

.agenda-overview-horarios-window {
    flex-direction: column;
    display: flex;
    gap: 10px;
}

.agenda-overview-horarios-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
}

.agenda-overview-horarios-help {
    color: #475569;
    font-size: 12px;
    line-height: 1.35;
}

.agenda-overview-horarios-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    max-height: 280px;
    overflow: auto;
}

.agenda-overview-horario-row {
    display: grid;
    grid-template-columns: minmax(140px, 220px) minmax(220px, 1fr);
    align-items: center;
    gap: 8px;
}

.agenda-overview-horario-det {
    color: #111827;
    font-size: 12px;
    font-weight: 800;
}

.agenda-overview-horario-input {
    min-height: 38px;
    font-size: 12px;
}

.agenda-overview-transfer-professional {
    min-width: 220px;
    width: 220px;
}

.agenda-overview-transfer-zones {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    max-width: 520px;
}

.agenda-overview-transfer-zone-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #ffffff;
    color: #111827;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.agenda-overview-transfer-zone-input {
    margin: 0;
}

.agenda-overview-transfer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.agenda-overview-board {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
}

.agenda-overview-zone {
    border: 1px solid #dbe3f0;
    border-radius: 14px;
    background: #f8fbff;
    overflow: hidden;
}

.agenda-overview-zone-title {
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 800;
    color: #1e3a8a;
    background: #e8f0ff;
    border-bottom: 1px solid #dbe3f0;
}

.agenda-overview-zone-title.is-recreio-barra {
    color: #166534;
    background: #bbf7d0;
}

.agenda-overview-zone-title.is-jacarepagua {
    color: #ffffff;
    background: #166534;
}

.agenda-overview-zone-title.is-zona-sul {
    color: #ffffff;
    background: #2563eb;
}

.agenda-overview-zone-title.is-zona-norte {
    color: #ffffff;
    background: #dc2626;
}

.agenda-overview-zone-title.is-tijuca {
    color: #ffffff;
    background: #ea580c;
}

.agenda-overview-zone-title.is-niteroi-ilha {
    color: #ffffff;
    background: #7c2d12;
}

.agenda-overview-zone-title.is-campo-grande {
    color: #713f12;
    background: #fde047;
}

.agenda-overview-zone-body {
    min-height: 160px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.agenda-overview-zone-body.is-dragover {
    background: #dbeafe;
    box-shadow: inset 0 0 0 2px #2563eb;
}

.agenda-overview-zone-empty {
    min-height: 120px;
    border: 2px dashed #bfdbfe;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 13px;
    text-align: center;
    padding: 12px;
}

.agenda-overview-det-card {
    border: 1px solid #dbe3f0;
    border-radius: 12px;
    background: #ffffff;
    padding: 7px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.05);
}

.agenda-overview-det-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    user-select: none;
}

.agenda-overview-det-drag {
    cursor: grab;
    font-size: 10px;
    font-weight: 700;
    color: #2563eb;
}

.agenda-overview-det-drag:active {
    cursor: grabbing;
}

.agenda-overview-det-card.is-dragging {
    opacity: 0.65;
}

.agenda-overview-det-card.is-unavailable {
    border-color: #fecaca;
    background: #fff7f7;
}

.agenda-overview-det-card-header:active {
    cursor: default;
}

.agenda-overview-det-name {
    font-size: 12px;
    font-weight: 800;
    color: #111827;
}

.agenda-overview-det-card.is-unavailable .agenda-overview-det-drag {
    color: #dc2626;
}

.agenda-overview-det-times {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 10px;
    color: #374151;
}

.agenda-overview-det-label {
    font-weight: 700;
}

.agenda-overview-slots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(56px, 1fr));
    gap: 5px;
}

.agenda-overview-slot {
    min-height: 52px;
    border-radius: 10px;
    padding: 6px 5px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    border: 1px solid transparent;
    overflow: hidden;
    --slot-accent: transparent;
}

.agenda-overview-slot-btn {
    width: 100%;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
}

.agenda-overview-slot.is-free {
    background: #e0f2fe;
    border-color: #bae6fd;
    --slot-accent: #2f80ed;
}

.agenda-overview-slot.is-occupied {
    background: #fef2f2;
    border-color: #fecaca;
    --slot-accent: #dc2626;
}

.agenda-overview-slot.is-pending {
    background: #fef9c3;
    border-color: #fde68a;
    --slot-accent: #d97706;
}

.agenda-overview-slot.is-indisponivel {
    background: repeating-linear-gradient(
        135deg,
        #f3f4f6,
        #f3f4f6 6px,
        #e5e7eb 6px,
        #e5e7eb 12px
    );
    border-color: #d1d5db;
    --slot-accent: #9ca3af;
    cursor: not-allowed;
    opacity: 0.85;
}

.agenda-overview-slot.is-indisponivel .agenda-overview-slot-time,
.agenda-overview-slot.is-indisponivel .agenda-overview-slot-icon {
    color: #6b7280;
}

.agenda-overview-slot-icon.is-indisponivel {
    background: #9ca3af;
}

.agenda-overview-slot.is-block {
    align-items: stretch;
    padding-left: 10px;
    box-shadow: inset 4px 0 0 var(--slot-accent);
}

.agenda-overview-slot.is-encaixe {
    border-style: dashed;
}

.agenda-overview-slot.is-block .agenda-overview-slot-top,
.agenda-overview-slot.is-block .agenda-overview-slot-time {
    justify-content: flex-start;
    text-align: left;
}

.agenda-overview-slot-time {
    font-size: 11px;
    font-weight: 800;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agenda-overview-slot-top {
    min-height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.agenda-overview-slot-badge {
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    color: #111827;
}

.agenda-overview-slot-badge.is-type {
    background: #86efac;
}

.agenda-overview-slot-badge.is-duration {
    background: #d1d5db;
}

.agenda-overview-slot-icon {
    width: 16px;
    height: 16px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 9px;
    line-height: 1;
    font-weight: 700;
}

.agenda-overview-slot.is-free .agenda-overview-slot-icon {
    background: #2f80ed;
}

.agenda-overview-hint {
    font-size: 13px;
    color: #6b7280;
}

.agenda-overview-note-input {
    width: 100%;
    min-height: 30px;
    resize: vertical;
    font-size: 10px;
    padding: 5px 7px;
}

.agenda-overview-unavailable-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    border: 1px dashed #fca5a5;
    border-radius: 10px;
    background: #fff1f2;
}

.agenda-overview-unavailable-period {
    font-size: 12px;
    font-weight: 800;
    color: #991b1b;
}

.mensagem-retorno {
    font-size: 13px;
    color: #16a34a;
}


/* ======================================================
   RESPONSIVO
====================================================== */

@media (max-width: 900px) {
    .agenda-page .page-content {
        padding: 16px 16px 24px;
    }

    .agenda-page .filters-row {
        grid-template-columns: 1fr;
    }

    .agenda-page .nova-visita-grid {
        grid-template-columns: 1fr;
    }

    .agenda-page .janela-row {
        grid-template-columns: 1fr;
    }

    .agenda-page .janela-ate {
        text-align: left;
    }

    /* no mobile não expandimos para fora do padding */
    .agenda-calendar-container {
        margin-left: 0;
        margin-right: 0;
    }

    .agenda-calendar-header {
        padding-left: 16px;
        padding-right: 16px;
    }

    .agenda-cal-dow {
        padding-left: 12px;
        padding-right: 12px;
    }

    .agenda-cal-grid {
        padding-left: 0;
        padding-right: 0;
        padding-bottom: 0;
    }
}

/* Celular: calendário inteiro na tela (sem rolagem horizontal) */
@media (max-width: 600px) {
    /* Header: não pode esmagar o título/subtítulo (evita quebra "letra a letra") */
    .agenda-page .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .agenda-page .page-header-actions {
        width: 100%;
    }

    .agenda-page .page-subtitle {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .agenda-page .agenda-search {
        width: 100%;
        justify-content: flex-start;
    }

    .agenda-page .agenda-search-input {
        width: 100%;
    }

    /* No mobile: mostra LISTA (tabela antiga) E mantém CALENDÁRIO visível */
    #agenda-calendar-wrapper {
        display: block !important;
    }

    #agenda-table-wrapper {
        display: block !important;
        margin-top: 16px;
        padding: 0 6px 10px;
        border-radius: 14px;
    }

    /* Calendário compacto no celular (sem rolagem horizontal) */
    .agenda-calendar-header {
        padding: 12px 12px;
        gap: 10px;
        flex-wrap: wrap;
    }

    .agenda-cal-dow {
        padding-left: 8px;
        padding-right: 8px;
    }

    .agenda-cal-dow-cell {
        padding: 6px 4px 10px;
        font-size: 10px;
    }

    .agenda-cal-grid {
        padding: 0 8px 12px;
    }

    .agenda-cal-cell {
        min-height: 92px;
        padding: 8px 6px 10px;
    }

    .agenda-cal-add-btn {
        top: 6px;
        right: 6px;
        width: 20px;
        height: 20px;
        border-radius: 7px;
    }

    .agenda-cal-overview-btn {
        width: 100%;
        min-width: 0;
        min-height: 24px;
        padding: 2px 4px;
        margin-bottom: 6px;
        box-shadow: none;
        font-size: 9px;
    }

    .agenda-cal-overview-btn-count {
        font-size: 11px;
    }

    .agenda-cal-daynum {
        top: 8px;
        left: 6px;
        font-size: 11px;
    }

    .agenda-cal-event {
        font-size: 10px;
        padding: 4px 6px;
        border-radius: 7px;
    }

    /* Tabela responsiva no celular (vira lista vertical por linha) */
    #agenda-table-wrapper .agenda-table thead {
        display: none;
    }

    #agenda-table-wrapper .agenda-table,
    #agenda-table-wrapper .agenda-table tbody,
    #agenda-table-wrapper .agenda-table tr,
    #agenda-table-wrapper .agenda-table td {
        display: block;
        width: 100%;
    }

    #agenda-table-wrapper .agenda-table tr {
        border: 1px solid #eef2f7;
        border-radius: 14px;
        padding: 10px 10px;
        margin-bottom: 10px;
        box-shadow: 0 8px 20px rgba(15, 23, 42, 0.03);
        background: #ffffff;
    }

    #agenda-table-wrapper .agenda-table td {
        border: 0;
        padding: 6px 6px;
    }

    #agenda-table-wrapper .agenda-table td:nth-child(1),
    #agenda-table-wrapper .agenda-table td:nth-child(2) {
        display: inline-block;
        width: auto;
        padding: 4px 6px;
        font-weight: 900;
        font-size: 12px;
        background: #eff6ff;
        border: 1px solid #bfdbfe;
        border-radius: 999px;
        margin-right: 6px;
        color: #111827;
    }

    #agenda-table-wrapper .agenda-table td:nth-child(6) .secondary-button {
        width: 100%;
    }

    /* Modal do dia em fullscreen no celular */
    .agenda-day-modal-backdrop {
        padding: 0;
    }

    .agenda-day-modal {
        width: 100vw;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }
}
