/* TOPMEMBERS - DESIGN SYSTEM UNIFICADO */

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --sidebar-bg: #0f172a;
    --bg-main: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --white: #ffffff;
    --border: #e2e8f0;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --danger: #dc2626;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
    display: flex;
    background: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
}

/* SIDEBAR */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: white;
    height: 100vh;
    padding: 30px 20px;
    position: sticky;
    top: 0;
    flex-shrink: 0;
}

.sidebar h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 40px;
    background: linear-gradient(to right, #60a5fa, #2563eb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
}

.sidebar a {
    display: block;
    color: #94a3b8;
    text-decoration: none;
    padding: 12px 15px;
    margin: 5px 0;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar a:hover, .sidebar a.active {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    transform: translateX(5px);
}

/* ÁREA PRINCIPAL */
.main {
    flex: 1;
    padding: 40px;
    width: 100%;
    overflow-x: hidden;
}

/* HEADERS */
.header, .header-page {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.header h1, .header-page h1 {
    font-size: 28px;
    font-weight: 700;
}

.header small {
    display: block;
    font-size: 16px;
    color: var(--text-muted);
}

/* CARDS DO DASHBOARD */
.dashboard {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.section h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.card {
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card h3 {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.card .value {
    font-size: 36px;
    font-weight: 800;
    color: var(--sidebar-bg);
}

.card .desc {
    font-size: 13px;
    color: #94a3b8;
}

/* TABELAS (MEMBERS.PHP) */
.table-container {
    overflow-x: auto;
    width: 100%;
    border-radius: var(--radius);
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1600px;
    background: white;
}

.table th {
    background: #f8fafc;
    padding: 14px 18px;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border);
    text-align: left;
}

.table td {
    padding: 12px 18px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    white-space: nowrap;
}

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

/* Coluna Fixa (Nome) */
.table td:first-child, .table th:first-child {
    position: sticky;
    left: 0;
    background: white;
    z-index: 2;
    box-shadow: 2px 0 5px rgba(0,0,0,0.03);
}

.table th:first-child { background: #f8fafc; z-index: 3; }

/* BADGES E STATUS */
.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    background: #e2e8f0;
    color: #475569;
    display: inline-block;
}

.badge.status {
    background: #dcfce7;
    color: #166534;
}

/* BOTÕES */
.btn-primary {
    background: var(--primary);
    color: white !important;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: 0.2s;
    display: inline-block;
}

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

.btn-action {
    text-decoration: none;
    padding: 6px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: white;
    transition: 0.2s;
    display: inline-inline-block;
}

.btn-action:hover {
    background: #f1f5f9;
    transform: scale(1.1);
}

.btn-action.delete:hover {
    color: var(--danger);
    border-color: #fee2e2;
}

/* SCROLLBAR */
.table-container::-webkit-scrollbar { height: 8px; }
.table-container::-webkit-scrollbar-track { background: #f1f5f9; }
.table-container::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

/* RESPONSIVIDADE */
@media (max-width: 1024px) {
    .sidebar { width: 80px; padding: 20px 10px; }
    .sidebar h2, .sidebar a span { display: none; }
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filters input,
.filters select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.btn-secondary {
    background: #ccc;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: #000;
}
@media print {

    .sidebar,
    .header-page,
    .filters,
    .btn-primary,
    .btn-secondary,
    .actions {
        display: none !important;
    }

    body {
        background: #fff;
    }

    .card {
        box-shadow: none;
        border: none;
    }

    .table {
        font-size: 12px;
    }
}
.badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    color: #fff;
    display: inline-block;
}

/* cores */
.badge-success {
    background: #22c55e;
}

.badge-danger {
    background: #ef4444;
}

.badge-warning {
    background: #f59e0b;
}

.badge-secondary {
    background: #6b7280;
}

.badge-default {
    background: #3b82f6;
}

/* container */
.filters-card {
    padding: 15px;
}

/* topo */
.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

/* linha principal */
.filters-main {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

/* avançado */
.filters-advanced {
    display: none;
    margin-top: 10px;
}

/* grupos */
.filter-group {
    margin-bottom: 15px;
}

/* checkbox layout */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 120px;
    overflow-y: auto;
    padding: 5px;
    border: 1px solid #eee;
    border-radius: 6px;
}

/* cada item */
.checkbox-group label {
    background: #f3f4f6;
    padding: 5px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}
.badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    color: #fff;
    display: inline-block;
}

/* cores */
.badge-success { background: #22c55e; }   /* verde */
.badge-danger { background: #ef4444; }    /* vermelho */
.badge-warning { background: #f59e0b; }   /* amarelo */
.badge-secondary { background: #6b7280; } /* cinza */
.badge-default { background: #3b82f6; }   /* azul */
/* base */
.badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    color: #fff;
    display: inline-block;
}

/* faixa etária */
.badge-baby    { background: #f472b6; } /* rosa */
.badge-child   { background: #22c55e; } /* verde */
.badge-teen    { background: #3b82f6; } /* azul */
.badge-young   { background: #6366f1; } /* roxo */
.badge-adult   { background: #f59e0b; } /* laranja */
.badge-senior  { background: #6b7280; } /* cinza */
.badge-default { background: #9ca3af; } /* neutro */

.modal {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 25px;
    width: 400px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.close {
    float: right;
    font-size: 22px;
    cursor: pointer;
}

.lista .item {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}
.login-logo {
    width: 120px;
    margin-bottom: 20px;
}
/* =========================
   FORMS (GLOBAL)
========================= */

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

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

.form-group label {
    font-size: 13px;
    margin-bottom: 5px;
    color: var(--text-muted);
}

.form-group input,
.form-group select {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

/* ALERTS */

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
animation: fadeIn 0.3s ease;
}


/* TELA DE LOGIN */
.login-container {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    text-align: center;
}

.login-card h1 {
    margin-bottom: 10px;
    font-size: 24px;
}

.login-card p {
    color: var(--text-muted);
    margin-bottom: 25px;
}

.login-card input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 14px;
}

.login-card input:focus {
    outline: none;
    border-color: var(--primary);
}

.login-card button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: var(--primary);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.login-card button:hover {
    background: var(--primary-hover);
}

.error {
    background: #fee2e2;
    color: #991b1b;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
}
.table-fixed {
    width: 100%;
    table-layout: fixed;
}

.table-fixed th,
.table-fixed td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Larguras específicas */
.table-fixed th:nth-child(1) { width: 40px; }   /* Data */
.table-fixed th:nth-child(2) { width: 120px; }  /* Culto */
.table-fixed th:nth-child(3) { width: 30px; }   /* Total */
.table-fixed th:nth-child(4) { width: 40px; }  /* Visitantes */
.table-fixed th:nth-child(5) { width: 30px; }   /* Crianças */
.table-fixed th:nth-child(6) { width: 50px; }  /* Clima */
.table-fixed th:nth-child(7) { width: 80px; }  /* Campanha */
.table-fixed th:nth-child(8) { width: 200px; }  /* Anotações */
.table-fixed th:nth-child(9) { width: 40px; }  /* Contado por */

.notes-cell {
    max-width: 220px;
    white-space: normal;
    word-break: break-word;
    font-size: 13px;
}

.user-cell {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.table {
    min-width: 1000px; /* força largura mínima */
}