/* ===================================================
   CEPIBA — Design System
   Evento: Encontro Estadual de Conselhos e Fundos
            da Pessoa Idosa do Estado da Bahia
   Empresa: CaraCrachá Eventos
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700;800&family=Inter:wght@400;500;600&display=swap');

/* ── Variáveis ── */
:root {
    --color-bg:       #FDF0E0;
    --color-surface:  #FFFFFF;
    --color-primary:  #7B4CAA;
    --color-primary-dark: #5E3688;
    --color-primary-light: #EDE0F5;
    --color-accent:   #E8C832;
    --color-accent-dark: #C8A800;
    --color-text:     #1E1B2E;
    --color-muted:    #9B8AB0;
    --color-border:   #DDD0EE;
    --color-success:  #2E7D52;
    --color-success-bg: #D4EDDA;
    --color-danger:   #C0392B;
    --color-danger-bg: #FDECEA;
    --color-warning-bg: #FFF8DC;

    --radius-sm:  6px;
    --radius-md:  10px;
    --radius-lg:  14px;
    --radius-xl:  20px;

    --shadow-sm:  0 1px 4px rgba(123,76,170,0.10);
    --shadow-md:  0 4px 16px rgba(123,76,170,0.14);
    --shadow-lg:  0 8px 32px rgba(123,76,170,0.18);

    --font-title: 'Poppins', sans-serif;
    --font-body:  'Inter', sans-serif;

    --transition: 150ms ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--color-text);
    background-color: var(--color-bg);
    min-height: 100vh;
    position: relative;
}

/* Marca d'água sutil com o logo */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: url('../img/cara.png');
    background-repeat: repeat;
    background-size: 90px;
    opacity: 0.04;
}

/* ── Tipografia ── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-title);
    color: var(--color-text);
    line-height: 1.3;
}

/* ── Container principal ── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px;
}

/* ── Header do evento (faixa superior) ── */
.event-header {
    background: var(--color-primary);
    color: #fff;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
    border-radius: var(--radius-md);
}

.event-header .event-title {
    font-family: var(--font-title);
    font-size: 14px;
    font-weight: 700;
    color: var(--color-accent);
    line-height: 1.3;
    max-width: 480px;
}

.event-header .event-subtitle {
    font-size: 11px;
    font-weight: 400;
    color: rgba(255,255,255,0.75);
    margin-top: 2px;
}

.event-header .logo-caracracha {
    height: 36px;
    opacity: 0.95;
    filter: brightness(0) invert(1);
}

/* ── Título de página (h2 padrão) ── */
h2 {
    font-family: var(--font-title);
    font-size: 22px;
    font-weight: 700;
    color: var(--color-primary);
    text-align: center;
    margin-bottom: 8px;
}

/* ── Card ── */
.card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
    overflow: hidden;
}

.card-header {
    background: var(--color-primary) !important;
    color: #fff !important;
    padding: 18px 24px;
    font-family: var(--font-title);
    font-weight: 700;
}

.card-header h3,
.card-header h4 {
    color: #fff;
    font-size: 18px;
    margin-bottom: 2px;
}

.card-header small {
    font-size: 11px;
    font-weight: 400;
    color: rgba(255,255,255,0.75);
    font-family: var(--font-body);
}

.card-body {
    padding: 28px 24px;
}

/* ── Formulários ── */
.form-label {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 13px;
    color: var(--color-text);
    margin-bottom: 5px;
}

.form-control, .form-select {
    font-family: var(--font-body);
    font-size: 14px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--color-text);
    background-color: var(--color-surface);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(123,76,170,0.18);
    outline: none;
}

.form-control::placeholder {
    color: var(--color-muted);
    font-size: 13px;
}

/* ── Botões ── */
.btn {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14px;
    border-radius: var(--radius-sm);
    padding: 9px 20px;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
    border: none;
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--color-primary-dark);
    color: #fff;
    box-shadow: 0 4px 12px rgba(123,76,170,0.30);
}

.btn-accent {
    background: var(--color-accent);
    color: var(--color-text);
    border: none;
}
.btn-accent:hover {
    background: var(--color-accent-dark);
    color: var(--color-text);
}

.btn-success {
    background: var(--color-success);
    color: #fff;
    border: none;
}
.btn-success:hover { opacity: 0.88; color: #fff; }

.btn-outline-secondary {
    background: transparent;
    color: var(--color-muted);
    border: 1.5px solid var(--color-border);
}
.btn-outline-secondary:hover {
    background: var(--color-primary-light);
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn-outline-info {
    background: transparent;
    color: #0d8;
    border: 1.5px solid #0d8;
}
.btn-outline-info:hover { background: rgba(0,221,136,0.1); color: #0b7; }

.btn-outline-success {
    background: transparent;
    color: var(--color-success);
    border: 1.5px solid var(--color-success);
}
.btn-outline-success:hover { background: var(--color-success-bg); }

.btn-light {
    background: var(--color-primary-light);
    color: var(--color-primary);
    border: none;
}
.btn-light:hover { background: var(--color-primary); color: #fff; }

.btn-sm {
    font-size: 12px;
    padding: 6px 13px;
}

/* ── Tabela ── */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    font-size: 13px;
}

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

.table thead th {
    background: var(--color-primary);
    color: #fff;
    font-family: var(--font-title);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: none;
}

.table-primary thead th {
    background: var(--color-primary);
    color: #fff;
}

.table tbody tr:nth-child(even) { background: var(--color-primary-light); }
.table tbody tr:hover { background: #EDE0F5 !important; }
.table tbody tr.table-success { background: var(--color-success-bg) !important; }
.table tbody tr.table-success:hover { background: #C3E6CB !important; }

/* ── Badges ── */
.badge {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: var(--radius-xl);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.bg-primary { background: var(--color-primary) !important; color: #fff; }
.bg-success { background: var(--color-success) !important; color: #fff; }
.bg-secondary { background: var(--color-muted) !important; color: #fff; }
.bg-dark { background: var(--color-text) !important; color: #fff; }

/* Badge de contagem de GT (destaque amarelo) */
.badge-gt {
    background: var(--color-accent);
    color: var(--color-text);
    font-size: 12px;
    padding: 6px 14px;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.badge-total {
    background: var(--color-primary);
    color: #fff;
    font-size: 12px;
    padding: 6px 14px;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

/* ── Alertas ── */
.alert {
    border-radius: var(--radius-md);
    padding: 13px 18px;
    font-size: 14px;
    border: none;
    font-family: var(--font-body);
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert-info    { background: var(--color-primary-light); color: var(--color-primary-dark); }
.alert-success { background: var(--color-success-bg); color: var(--color-success); }
.alert-warning { background: var(--color-warning-bg); color: #856404; }
.alert-danger  { background: var(--color-danger-bg); color: var(--color-danger); }

/* ── Botões de ação da tabela ── */
.acoes { display: flex; gap: 6px; justify-content: center; align-items: center; }

.acoes a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    text-decoration: none;
    transition: all var(--transition);
}

.editar  { background: var(--color-accent); color: var(--color-text); }
.editar:hover { background: var(--color-accent-dark); color: var(--color-text); }

.imprimir { background: var(--color-primary); color: #fff; }
.imprimir:hover { background: var(--color-primary-dark); color: #fff; }

/* ── Texto de busca sem resultados ── */
.resultado-titulo {
    font-family: var(--font-title);
    font-size: 15px;
    font-weight: 600;
    color: var(--color-muted);
    text-align: center;
    margin: 20px 0 8px;
}

.mensagem-erro {
    text-align: center;
    color: var(--color-danger);
    font-weight: 600;
    font-size: 14px;
    margin-top: 10px;
}

/* ── Responsivo ── */
@media (max-width: 768px) {
    .container { padding: 16px 12px; }
    .card-body { padding: 20px 16px; }

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

    .table-responsive thead tr { display: none; }

    .table-responsive tbody tr {
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-md);
        padding: 14px;
        margin-bottom: 12px;
        box-shadow: var(--shadow-sm);
    }

    .table-responsive td {
        text-align: left;
        padding: 6px 10px;
        border: none;
        font-size: 13px;
        position: relative;
        padding-left: 42%;
    }

    .table-responsive td::before {
        position: absolute;
        left: 12px;
        font-weight: 600;
        color: var(--color-primary);
        font-size: 12px;
    }

    td:nth-of-type(1)::before { content: "ID"; }
    td:nth-of-type(2)::before { content: "Nome"; }
    td:nth-of-type(3)::before { content: "Nome Social"; }
    td:nth-of-type(4)::before { content: "Categoria"; }
    td:nth-of-type(5)::before { content: "GT"; }
    td:nth-of-type(6)::before { content: "Município"; }
    td:nth-of-type(7)::before { content: "Território"; }
    td:nth-of-type(8)::before { content: "Credenciado"; }
    td:nth-of-type(9)::before { content: "Ações"; }

    .acoes { justify-content: flex-start; }

    h2 { font-size: 18px; }
}

/* ── Input de busca grande ── */
.search-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    background: var(--color-surface);
    border: 2px solid var(--color-primary);
    border-radius: var(--radius-lg);
    padding: 6px 6px 6px 16px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 18px;
}

.search-bar input {
    flex: 1;
    border: none;
    outline: none;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--color-text);
    background: transparent;
}

.search-bar input::placeholder { color: var(--color-muted); }

.search-bar button {
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    padding: 8px 18px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-bar button:hover { background: var(--color-primary-dark); }

/* ── Painel de totais GT ── */
.gt-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding: 16px;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    margin-bottom: 20px;
}

/* ── Toolbar de ações ── */
.action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
    align-items: center;
}
