/* ============================================================
   SMARTCLINIC - AGENDA
   Grid de horários × dias
   ============================================================ */

/* ============================================================
   BARRA UNICA (navegacao + semana + acoes)
   ============================================================ */

.agenda-barra {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.agenda-barra-esquerda {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.agenda-barra-centro {
    flex: 1;
    text-align: center;
    font-size: 14px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agenda-barra-direita {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* Botoes de icone (setas) */
.agenda-btn-icone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 6px;
    background: var(--bg-soft);
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s ease;
}

.agenda-btn-icone:hover {
    background: var(--brand-light);
    color: var(--brand-dark);
}

/* Botao de texto (Hoje) */
.agenda-btn-texto {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    background: var(--card);
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.agenda-btn-texto:hover {
    background: var(--brand-light);
    border-color: var(--brand);
    color: var(--brand-dark);
}

/* Botao Novo (primario) */
.agenda-btn-novo {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 0;
    border-radius: 6px;
    background: var(--brand);
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.agenda-btn-novo:hover {
    background: var(--brand-dark);
}

/* ============================================================
   CONTAINER DA GRADE
   ============================================================ */

.agenda-container {
    background: var(--card);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow: auto;
    max-height: calc(100vh - 240px);
}

.agenda-grade {
    min-width: 900px;
}

/* ============================================================
   HEADER (DIAS DA SEMANA)
   ============================================================ */

.agenda-header {
    display: grid;
    grid-template-columns: 50px repeat(7, 1fr);
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--card);
    border-bottom: 2px solid var(--border-soft);
}

.agenda-header-hora {
    background: var(--bg-soft);
    border-right: 1px solid var(--border-soft);
}

.agenda-header-dia {
    padding: 8px 6px;
    text-align: center;
    border-right: 1px solid var(--border-soft);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

.agenda-header-dia:last-child {
    border-right: 0;
}

.agenda-header-dia strong {
    font-size: 12px;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.agenda-header-dia span {
    font-size: 10px;
    color: var(--muted);
}

.agenda-header-dia.is-domingo {
    background: #f5f5f5;
}

.agenda-header-dia.is-domingo strong,
.agenda-header-dia.is-domingo span {
    color: #999;
}

/* ============================================================
   BODY (GRADE)
   ============================================================ */

.agenda-body {
    display: flex;
    flex-direction: column;
}

.agenda-linha {
    display: grid;
    grid-template-columns: 50px repeat(7, 1fr);
    border-bottom: 1px solid #f0f0f0;
    min-height: 48px;
}

.agenda-linha:last-child {
    border-bottom: 0;
}

.agenda-hora {
    background: var(--bg-soft);
    border-right: 1px solid var(--border-soft);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 4px 2px;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    min-height: 48px;
}

.agenda-slot {
    border-right: 1px solid #f0f0f0;
    padding: 2px;
    min-height: 48px;
    position: relative;
    transition: background 0.15s ease;
    cursor: default;
}

.agenda-slot:last-child {
    border-right: 0;
}

.agenda-slot:hover {
    background: var(--brand-lighter);
}

.agenda-slot.is-domingo {
    background: #fafafa;
}

.agenda-slot.is-domingo:hover {
    background: #f0f0f0;
}

.agenda-slot-conteudo {
    display: flex;
    flex-direction: column;
    gap: 2px;
    height: 100%;
}

/* ============================================================
   CARD DE AGENDAMENTO DENTRO DO SLOT
   ============================================================ */

.agendamento-card {
    background: var(--brand-light);
    border-left: 3px solid var(--brand);
    border-radius: 4px;
    padding: 2px 5px;
    font-size: 10.5px;
    line-height: 1.25;
    cursor: pointer;
    transition: all 0.15s ease;
    overflow: hidden;
    position: relative;
}

.agendamento-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

.agendamento-card-nome {
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.agendamento-card-prof {
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    font-size: 9.5px;
}

.agendamento-card-status {
    position: absolute;
    top: 2px;
    right: 3px;
    font-size: 9px;
}

/* ============================================================
   TOOLTIP
   ============================================================ */

.agenda-tooltip {
    position: fixed;
    background: var(--brand-darker);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11.5px;
    line-height: 1.45;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    pointer-events: none;
    z-index: 9999;
    max-width: 260px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.agenda-tooltip.is-visible {
    opacity: 1;
}

.agenda-tooltip strong {
    color: #fff;
    display: block;
    margin-bottom: 3px;
    font-size: 12px;
}

.agenda-tooltip .tooltip-linha {
    display: block;
    opacity: 0.9;
}

.agenda-tooltip .tooltip-status {
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid rgba(255,255,255,0.15);
    font-weight: 600;
}

/* ============================================================
   RESPONSIVIDADE
   ============================================================ */

@media (max-width: 1024px) {
    .agenda-header,
    .agenda-linha {
        grid-template-columns: 45px repeat(7, minmax(90px, 1fr));
    }

    .agenda-barra-centro {
        font-size: 13px;
    }

    .agenda-btn-texto,
    .agenda-btn-novo {
        padding: 6px 10px;
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .agenda-barra {
        flex-wrap: wrap;
    }

    .agenda-barra-centro {
        order: 3;
        width: 100%;
        text-align: center;
        padding-top: 6px;
        border-top: 1px solid var(--border-soft);
        margin-top: 6px;
    }
}

/* ============================================================
   BOTOES DE NAVEGACAO COM TEXTO
   ============================================================ */

.agenda-barra-esquerda .agenda-btn-icone {
    width: auto;
    height: 32px;
    padding: 0 10px;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
}

.agenda-barra-esquerda .agenda-btn-icone span {
    display: inline-block;
}

@media (max-width: 768px) {
    .agenda-barra-esquerda .agenda-btn-icone span {
        display: none;
    }
    .agenda-barra-esquerda .agenda-btn-icone {
        width: 32px;
        padding: 0;
    }
}

/* ============================================================
   "+N" AGRUPADOR
   ============================================================ */

.agendamento-mais {
    display: block;
    background: rgba(0,0,0,0.06);
    color: var(--muted);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.agendamento-mais:hover {
    background: rgba(0,0,0,0.12);
    color: var(--text);
}
