/* === CLINIC.CSS === */
/* ====== GERAL ====== */
:root {
    --azul: #0b5394;
    --azul-claro: #E2EFF7;
    --laranja: #ff9800;
    --texto: #333;
    --branco: #fff;
}

body {
    font-family: "Segoe UI", sans-serif;
    color: var(--texto);
}

/* ====== TÍTULOS ====== */
h2 {
    color: var(--azul);
    text-align: center;
    margin-top: 20px;
}

/* ====== BOTÕES ====== */
.btn {
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--azul);
    color: white;
}

.btn-primary:hover {
    background: #063769;
}

.btn-secondary {
    background: #ccc;
    color: #333;
}

.btn-secondary:hover {
    background: #bbb;
}

.btn-warning {
    background: var(--laranja);
    color: white;
}

.btn-warning:hover {
    background: #e68900;
}

/* ====== FILTROS ====== */
.filtros-container {
    background: var(--azul-claro);
    border-radius: 12px;
    padding: 10px 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    width: 90%;
    max-width: 1000px;
    margin: 20px auto 24px auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.filtros-container .form-control,
.filtros-container .form-select {
    height: 38px;
    font-size: 0.95rem;
}

/* ====== TABELAS (DESKTOP) ====== */

.table-container {
  width: 90%;
  max-width: 1200px;
  display: flex;  
  justify-self: center;             /* 🔹 Centraliza horizontalmente */
  background: white;
  border-radius: 16px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  padding: 24px 30px;              /* 🔹 Espaço interno generoso */
  text-align: left;                /* 🔹 Garante conteúdo alinhado à esquerda */
  display: block;                  /* 🔹 Remove flex (não precisa aqui) */
}

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

.table th {
  background-color: #f4f6fa;
  color: var(--azul);
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.9rem;
  padding: 12px 10px;
  text-align: left;
}

.table td {
  padding: 10px;
  border-bottom: 1px solid #eee;
  color: var(--texto);
  text-align: left;
}

.table-striped tbody tr:nth-child(even) {
  background-color: #f9fbfd;
}

.table tr:hover {
  background-color: #e2eff7;
  transition: background 0.25s ease;
}


/* ====== MOBILE (CARD VIEW) ====== */
@media (max-width: 768px) {
  .table-container {
    width: 92%;
    max-width: 600px;
    padding: 16px;
  }

  .table thead { display: none; }

  .table, .table tbody, .table tr, .table td {
    display: block;
    width: 100%;
  }

  .table tr {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin: 0 auto 18px auto;
    padding: 14px 12px;
  }

  .table td {
    padding: 8px 10px;
    border: none;
  }

  .table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--azul);
    display: block;
    margin-bottom: 3px;
    font-size: 0.8rem;
    text-transform: uppercase;
  }

  .table td:last-child { text-align: right; }
}

/* ====== FORMULÁRIOS ====== */
form {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 20px auto;
}

label {
    font-weight: 600;
    color: #444;
}

input[type=text],
input[type=email],
input[type=date],
input[type=datetime-local],
select,
textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fafafa;
}

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

/* ====== MODO MOBILE: CARD VIEW ====== */
@media (max-width: 768px) {
    .table-container {
        width: 92%;
        max-width: 600px;
        padding: 16px;
        text-align: left;
    }

    .table thead {
        display: none;
    }

    .table,
    .table tbody,
    .table tr,
    .table td {
        display: block;
        width: 100%;
    }

    .table tr {
        display: flex;
        flex-direction: column;
        align-items: center;
        /* centraliza cada card */
        justify-content: center;
    }

    .table td {
        padding: 8px 10px;
        border: none;
    }

    .table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--azul);
        display: block;
        margin-bottom: 3px;
        font-size: 0.8rem;
        text-transform: uppercase;
    }

    .table td:last-child {
        text-align: right;
    }

    .badge {
        font-size: 0.8rem;
        padding: 4px 6px;
    }

    .btn-sm {
        padding: 4px 8px;
        font-size: 0.8rem;
    }

    /* Centraliza os “cards” em telas pequenas */
    .table tr {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }

    .table td {
        width: 100%;
    }
}

/* ====== LOGO CENTRALIZADA EM TELAS PEQUENAS ====== */
@media (max-width: 768px) {
    .logo-container {
        justify-content: center;
        width: 100%;
    }
}

/* 🩺 Tabelas responsivas reais */
@media (max-width: 768px) {

    table thead {
        display: none;
    }

    table.table, 
    table.table tbody, 
    table.table tr, 
    table.table td {
        display: block;
        width: 100%;
    }

    table.table tr {
        margin-bottom: 0.75rem;
        background: #fff;
        border-radius: 10px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.06);
        padding: 8px 12px;
    }

    table.table td {
        border: none;
        padding: 4px 0;
    }

    table.table td::before {
        content: attr(data-label) ": ";
        font-weight: 600;
        color: #555;
        display: inline-block;
        min-width: 90px;
    }
}