/* Reset & Base */
body { margin: 0; padding: 0; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: #f0f2f5; color: #333; }
* { box-sizing: border-box; }
a { text-decoration: none; color: inherit; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 15px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    text-align: center;
    min-height: 36px;
    font-weight: 500;
}
.btn:not(.btn-sm) {
    min-width: 120px;
}
.btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-primary { background-color: #2196F3; color: white; }
.btn-success { background-color: #4CAF50; color: white; }
.btn-danger { background-color: #f44336; color: white; }
.btn-warning { background-color: #ff9800; color: white; }
.btn-secondary { background-color: #9e9e9e; color: white; }
.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
    min-height: 32px;
    min-width: 32px; /* Allows square icon buttons */
}

/* Forms */
.form-control { width: 100%; padding: 8px 10px; border: 1px solid #ddd; border-radius: 4px; margin-bottom: 10px; font-size: 14px; height: 36px; }
.form-control:focus { outline: none; border-color: #2196F3; }
.form-label { display: block; margin-bottom: 5px; font-weight: 500; }

/* Tables */
table { width: 100%; border-collapse: collapse; background: white; border-radius: 8px; overflow: hidden; }
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid #eee; }
th { background-color: #f8f9fa; font-weight: 600; color: #555; }
tr:last-child td { border-bottom: none; }

/* Cards */
.card { background: rgba(255,255,255,0.8); padding: 10px; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); margin-bottom: 10px; }

/* Dashboard Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.stat-card { background: white; padding: 20px; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); text-align: center; }
.stat-number { font-size: 2rem; font-weight: bold; color: #2196F3; margin: 10px 0; }
.stat-label { color: #666; }

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

/* Footer Logo Class */
.footer-inforben {
    position: fixed;
    bottom: 15px;
    right: 15px;
    z-index: 999;
    background: white;
    padding: 6px 15px;
    border-radius: 50px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Segoe UI', sans-serif;
    font-size: 11px;
    color: #999;
    border: 1px solid #f0f0f0;
    transition: all 0.3s;
}
/* Hover effect for footer logo */
.footer-inforben:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Alerts */
.alert { padding: 15px; border-radius: 4px; margin-bottom: 20px; }
.alert-success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* Utilities */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

/* Header Actions Layout */
.page-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
    flex-wrap: wrap;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}
.header-actions .form-control {
    margin-bottom: 0;
}

/* Mobile Tables (Cards) */
@media screen and (max-width: 768px) {
    /* Header Reordering for Mobile */
    .page-header-flex {
        flex-direction: column;
        align-items: stretch;
    }

    .page-header-flex h3, .page-header-flex h2 {
        text-align: center;
        margin-bottom: 10px;
        width: 100%;
    }

    .header-actions {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .header-actions .btn {
        width: 100%;
        order: 1; /* Button first */
        margin-bottom: 5px; /* Espaçamento pequeno abaixo */
    }

    .header-actions .form-control,
    .header-actions input {
        width: 100%;
        order: 2; /* Search input second */
        margin-bottom: 0;
    }

    /* Dashboard Mobile */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .stat-card {
        padding: 15px;
    }
    .stat-number {
        font-size: 1.5rem;
        margin: 5px 0;
    }

    /* Quick Actions Mobile */
    .quick-actions {
        flex-direction: column;
        gap: 8px;
    }
    .quick-actions .btn {
        width: 100%;
    }

    /* Table Cards */
    table, thead, tbody, th, td, tr {
        display: block;
    }

    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    tr {
        margin-bottom: 15px;
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
        border: 1px solid #eee;
    }

    td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding: 12px 15px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        min-height: 45px;
        word-break: break-word; /* Evita quebra de layout, mas permite quebra de texto longo */
    }

    td:before {
        content: attr(data-label);
        font-weight: 600;
        color: #555;
        text-align: left;
        margin-right: auto;
        padding-right: 15px;
        flex-shrink: 0; /* Garante que o label não encolha */
    }

    td:last-child {
        border-bottom: none;
        justify-content: flex-end;
    }

    td[data-label="Foto"] {
        justify-content: center;
        padding: 15px;
        background-color: #f9f9f9;
        border-bottom: 1px solid #eee;
        border-radius: 8px 8px 0 0;
    }

    td[data-label="Foto"]:before {
        display: none;
    }

    /* Actions buttons spacing */
    td[data-label="Ações"] {
        gap: 10px;
        justify-content: center;
    }
}
