/* ============================================================
   AGENDAMENTOS - Listagem
   ============================================================ */

/* ---------- Toolbar de filtros ---------- */
.ag-filtros {
    background: #fff;
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 18px;
    display: grid;
    grid-template-columns: 140px 140px 1fr 180px 180px 180px auto;
    gap: 12px;
    align-items: end;
}

.ag-filtros .ag-campo {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ag-filtros label {
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ag-filtros input,
.ag-filtros select {
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    color: #1f2937;
    background: #fff;
    font-family: inherit;
    width: 100%;
}

.ag-filtros input:focus,
.ag-filtros select:focus {
    outline: none;
    border-color: #2f5f57;
    box-shadow: 0 0 0 3px rgba(47, 95, 87, 0.12);
}

.ag-filtros .ag-botoes {
    display: flex;
    gap: 8px;
}

.ag-btn-buscar {
    padding: 8px 18px;
    background: #2f5f57;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.ag-btn-buscar:hover {
    background: #245049;
}

.ag-btn-limpar {
    padding: 8px 14px;
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.ag-btn-limpar:hover {
    background: #e5e7eb;
}

/* ---------- Cards de resumo (totais) ---------- */
.ag-totais {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.ag-total-card {
    background: #fff;
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border-left: 3px solid #e5e7eb;
}

.ag-total-card .ag-total-label {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.ag-total-card .ag-total-valor {
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1;
}

.ag-total-card.is-total     { border-left-color: #1f2937; }
.ag-total-card.is-agendado  { border-left-color: #b26a00; }
.ag-total-card.is-confirmado{ border-left-color: #00695c; }
.ag-total-card.is-atendido  { border-left-color: #1b5e20; }
.ag-total-card.is-faltou    { border-left-color: #c62828; }
.ag-total-card.is-cancelado { border-left-color: #757575; }

.ag-total-card.is-agendado   .ag-total-valor { color: #b26a00; }
.ag-total-card.is-confirmado .ag-total-valor { color: #00695c; }
.ag-total-card.is-atendido   .ag-total-valor { color: #1b5e20; }
.ag-total-card.is-faltou     .ag-total-valor { color: #c62828; }
.ag-total-card.is-cancelado  .ag-total-valor { color: #757575; }

/* ---------- Tabela ---------- */
.ag-tabela-wrap {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.ag-tabela {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.ag-tabela thead {
    background: #f9fafb;
}

.ag-tabela th {
    text-align: left;
    padding: 12px 14px;
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid #e5e7eb;
}

.ag-tabela td {
    padding: 12px 14px;
    border-bottom: 1px solid #f3f4f6;
    color: #1f2937;
    vertical-align: middle;
}

.ag-tabela tbody tr:hover {
    background: #f9fafb;
}

.ag-tabela tbody tr:last-child td {
    border-bottom: none;
}

.ag-tabela .ag-col-data  { white-space: nowrap; width: 90px; }
.ag-tabela .ag-col-hora  { white-space: nowrap; width: 60px; font-weight: 600; color: #2f5f57; }
.ag-tabela .ag-col-prof  { white-space: nowrap; }
.ag-tabela .ag-col-sala  { color: #6b7280; font-size: 12px; }

.ag-prof-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.ag-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    display: inline-block;
}

.ag-status-Agendado   { background: #fff8e1; color: #b26a00; }
.ag-status-Confirmado { background: #e0f2f1; color: #00695c; }
.ag-status-Atendido   { background: #e8f5e9; color: #1b5e20; }
.ag-status-Faltou     { background: #ffebee; color: #c62828; }
.ag-status-Cancelado  { background: #f5f5f5; color: #757575; }

/* ---------- Acoes ---------- */
.ag-acoes {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.ag-btn-acao {
    padding: 5px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    color: #6b7280;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.12s;
}

.ag-btn-acao:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.ag-btn-acao.is-confirmar {
    background: #e0f2f1;
    color: #00695c;
    border-color: #b2dfdb;
}

.ag-btn-acao.is-confirmar:hover {
    background: #00695c;
    color: #fff;
}

.ag-btn-acao.is-cancelar {
    background: #ffebee;
    color: #c62828;
    border-color: #ffcdd2;
}

.ag-btn-acao.is-cancelar:hover {
    background: #c62828;
    color: #fff;
}

.ag-btn-acao:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ---------- Vazio / loading ---------- */
.ag-vazio {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
    font-size: 14px;
}

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
    .ag-filtros {
        grid-template-columns: 1fr 1fr;
    }
    .ag-filtros .ag-botoes {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}

@media (max-width: 700px) {
    .ag-filtros {
        grid-template-columns: 1fr;
    }
    .ag-tabela-wrap {
        overflow-x: auto;
    }
    .ag-tabela {
        min-width: 720px;
    }
}


/* ---------- Acoes (padrao ERP: Bootstrap 5 .btn + custom) ---------- */
.acoes-cell {
    white-space: nowrap;
    text-align: right;
}

.acoes-cell .ag-btn-icone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    transition: color .15s ease-in-out, background-color .15s ease-in-out,
                border-color .15s ease-in-out, box-shadow .15s ease-in-out;
    margin: 0 2px;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    text-decoration: none;
    font-family: inherit;
}

.acoes-cell .ag-btn-icone:hover {
    filter: brightness(0.92);
}

.acoes-cell .ag-btn-icone:focus,
.acoes-cell .ag-btn-icone:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.12);
}

.acoes-cell .ag-btn-icone:active {
    transform: translateY(1px);
}

.ag-btn-icone.is-ver        { background: #7c4dff; }
.ag-btn-icone.is-ver:hover  { background: #6a3de8; }

.ag-btn-icone.is-confirmar    { background: #00c853; }
.ag-btn-icone.is-confirmar:hover { background: #00a844; }

.ag-btn-icone.is-atender    { background: #1a237e; }
.ag-btn-icone.is-atender:hover { background: #0d1659; }

.ag-btn-icone.is-faltou    { background: #ff9100; }
.ag-btn-icone.is-faltou:hover { background: #e67e00; }

.ag-btn-icone.is-cancelar    { background: #ff1744; }
.ag-btn-icone.is-cancelar:hover { background: #d32f2f; }
