/* ==========================================================
   🌿 Lifeel App - Estilo Responsivo Consolidado (v3)
   ========================================================== */

:root {
    --primary: #4caf50;
    --secondary: #e8f5e9;
    --accent: #2e7d32;
    --text: #333;
    --border: #dcdcdc;
    --radius: 10px;
    --bg-light: #ffffff;
    --bg-input: #f9f9f9;
}

/* ===== GLOBAL ===== */
body {
    font-family: 'Poppins', Arial, sans-serif;
    background: var(--secondary);
    color: var(--text);
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1100px;
    margin: auto;
    padding: 1rem;
}

/* ===== HEADER ===== */
header {
    text-align: center;
    margin-bottom: 1.5rem;
}

header h1 {
    color: var(--accent);
    margin-bottom: 0.3rem;
}

header p {
    color: #555;
    font-size: 0.95rem;
}

/* ===== FIELDSETS (Cards) ===== */
fieldset {
    border: none;
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.2rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

legend {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 0.8rem;
}

/* ===== FORM LAYOUT ===== */
.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .form-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.3rem;
}

/* ===== INPUTS & SELECTS ===== */
input[type=text],
input[type=email],
input[type=tel],
input[type=number],
input[type=date],
input[type=password],
textarea,
select {
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    background: var(--bg-input);
    transition: all 0.2s ease-in-out;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 4px rgba(76, 175, 80, 0.3);
    outline: none;
}

/* ===== CHECKBOXES & RADIO ===== */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem 1rem;
    align-items: center;
}

input[type=checkbox],
input[type=radio] {
    transform: scale(1.2);
    accent-color: var(--primary);
}

/* ===== FOTO AVATAR ===== */
.foto-container {
    text-align: center;
    background: var(--bg-light);
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.2rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.foto-preview {
    width: 160px;
    height: 160px;
    margin: 0.5rem auto;
    border: 2px dashed var(--primary);
    border-radius: var(--radius);
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f6fff6;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.foto-preview:hover {
    transform: scale(1.03);
}

.foto-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-foto {
    background: var(--primary);
    border: none;
    color: #fff;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.btn-foto:hover {
    background: var(--accent);
}

/* ===== PDF UPLOAD ===== */
.pdf-list {
    list-style: none;
    padding: 0;
    margin-top: 0.6rem;
}

.pdf-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f6fff6;
    padding: 0.4rem 0.7rem;
    margin-bottom: 0.3rem;
    border-radius: 6px;
    font-size: 0.9rem;
    border: 1px solid #c8e6c9;
}

.pdf-list button {
    background: #ff5252;
    border: none;
    color: #fff;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
}

.pdf-list button:hover {
    background: #d32f2f;
}

/* ===== TABELAS ===== */
.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.table-scroll::-webkit-scrollbar {
    height: 8px;
}

.table-scroll::-webkit-scrollbar-thumb {
    background-color: #c8e6c9;
    border-radius: 10px;
}

.table-compact {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 750px;
    font-size: 0.9rem;
}

.table-compact th {
    background: var(--accent);
    color: #fff;
    padding: 8px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 2;
    font-weight: 600;
}

.table-compact td {
    border: 1px solid #eee;
    padding: 6px;
    text-align: center;
    background: #fafafa;
}

.table-compact tr:nth-child(even) td {
    background: #f9f9f9;
}

.table-compact input {
    width: 100%;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-align: center;
}

/* ===== ADMIN TABLE ===== */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-top: 1rem;
}

.admin-table th,
.admin-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.admin-table th {
    background-color: var(--primary);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.admin-table tr:hover {
    background-color: #f1f1f1;
}

.admin-table td {
    color: #555;
    font-size: 0.95rem;
}

/* ===== MOBILE CARD MODE ===== */
@media (max-width: 600px) {

    .table-compact,
    .table-compact thead,
    .table-compact tbody,
    .table-compact th,
    .table-compact td,
    .table-compact tr {
        display: block;
    }

    .table-compact tr {
        margin-bottom: 1rem;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
        background: #fff;
        padding: 0.6rem;
    }

    .table-compact td {
        border: none;
        display: flex;
        flex-direction: column;
        /* Stack vertically */
        align-items: flex-start;
        padding: 0.5rem 0;
        border-bottom: 1px solid #f0f0f0;
    }

    .table-compact td:last-child {
        border-bottom: none;
    }

    .table-compact td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--accent);
        text-transform: capitalize;
        margin-bottom: 0.3rem;
        font-size: 0.85rem;
    }

    .table-compact input {
        width: 100%;
        text-align: left;
        /* Better for editing on mobile */
        padding: 0.6rem;
        /* Larger touch target */
    }

    .table-compact thead {
        display: none;
    }
}

/* ===== BOTÕES ===== */
.btn-submit {
    display: block;
    width: 100%;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.btn-submit:hover {
    background: var(--accent);
}

/* ===== UTILITÁRIOS ===== */
.upper {
    text-transform: uppercase;
}

.commitment {
    margin-top: 1rem;
}

small {
    color: #666;
}


/* ===== TABS ===== */
.tab-container {
    background: var(--bg-light);
    border-radius: var(--radius);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 1.2rem;
}

.tab-header {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    flex: 1;
    padding: 1rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    white-space: nowrap;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: #e0e0e0;
    color: var(--primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: #fff;
}

.tab-content {
    display: none;
    padding: 1.5rem;
    animation: fadeIn 0.4s;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Remove default fieldset styling when inside tabs to avoid double padding/border */
.tab-content fieldset {
    box-shadow: none;
    padding: 0;
    margin: 0;
    background: transparent;
}

/* ===== NAVIGATION BUTTONS ===== */
.tab-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.btn-nav {
    background: var(--secondary);
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}

.btn-nav:hover {
    background: var(--accent);
    color: #fff;
}

/* ===== PAGINAÇÃO ===== */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.pagination-info {
    color: #666;
    font-size: 0.9rem;
}

.pagination-controls {
    display: flex;
    gap: 5px;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 5px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    color: #555;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin: 0 2px;
}

.page-link:hover {
    background: #f8f9fa;
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.page-link.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(76, 175, 80, 0.3);
}

.page-link.disabled {
    opacity: 0.4;
    pointer-events: none;
    background: #f5f5f5;
    box-shadow: none;
}

.records-per-page {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #555;
}

.records-per-page select {
    padding: 5px 10px;
    border-radius: 5px;
    border: 1px solid #ddd;
    cursor: pointer;
}

/* ===== RESPONSIVIDADE ===== */
@media (min-width: 992px) {
    .container {
        padding: 2rem;
    }

    /* Adjust tab content padding for desktop */
    .tab-content {
        padding: 2rem;
    }
}