/* Estilos gerais */
:root {
    --primary-color: #ff69b4;
    --primary-light: #ff8fbf;
    --danger-color: #dc3545;
    --success-color: #198754;
}

/* Estilos gerais para tabelas responsivas */
.table-responsive {
    width: 100%;
    margin-bottom: 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Ajustes para DataTables responsivo */
.dtr-control {
    background: none !important;
    cursor: pointer;
}

.dtr-control:before {
    display: inline-block;
    color: #ff69b4;
    content: '►';
}

.dtr-control.expanded:before {
    content: '▼';
}

table.dataTable>tbody>tr.child ul.dtr-details {
    display: block;
    list-style-type: none;
    margin: 0;
    padding: 0;
}

table.dataTable>tbody>tr.child ul.dtr-details>li {
    border-bottom: 1px solid #efefef;
    padding: 0.5em 0;
}

table.dataTable>tbody>tr.child ul.dtr-details>li:last-child {
    border-bottom: none;
}

table.dataTable>tbody>tr.child span.dtr-title {
    display: inline-block;
    min-width: 75px;
    font-weight: bold;
}

/* Ajustes para os botões de ação */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.action-buttons .btn {
    margin: 0.25rem 0;
    white-space: nowrap;
}

/* Ajustes para telas pequenas */
@media screen and (max-width: 767px) {
    /* Layout da tabela */
    table.dataTable,
    table.dataTable thead,
    table.dataTable tbody,
    table.dataTable th,
    table.dataTable td,
    table.dataTable tr {
        display: block;
    }

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

    /* Estilo do card */
    table.dataTable tr {
        border: none;
        margin-bottom: 1rem;
        background: #fff;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        border-radius: 0.5rem;
        position: relative;
    }

    table.dataTable td {
        position: relative;
        padding: 1rem !important;
        border: none !important;
        border-bottom: 1px solid rgba(0,0,0,0.05) !important;
        text-align: right;
        min-height: 50px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    table.dataTable td:before {
        content: attr(data-title);
        font-weight: 600;
        color: #666;
        padding-right: 1rem;
        text-align: left;
        flex: 1;
    }

    table.dataTable td:last-child {
        border-bottom: none !important;
    }

    /* Badges e valores */
    table.dataTable .badge {
        font-size: 0.875rem;
        padding: 0.5em 0.75em;
        white-space: nowrap;
    }

    /* Botões de ação */
    .action-buttons {
        display: flex;
        gap: 0.5rem;
        justify-content: flex-end;
        width: 100%;
    }

    .action-buttons .btn {
        padding: 0.5rem;
        border-radius: 0.375rem;
        min-width: 40px;
        height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .action-buttons .btn i {
        font-size: 1rem;
    }

    /* Controles do DataTable */
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        width: 100%;
        margin-bottom: 1rem;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 100%;
        margin: 0.5rem 0 !important;
        padding: 0.5rem;
        border: 1px solid #ddd;
        border-radius: 0.375rem;
    }

    .dataTables_wrapper .dataTables_paginate {
        display: flex;
        justify-content: center;
        gap: 0.5rem;
        margin: 1rem 0;
        flex-wrap: wrap;
    }

    .dataTables_wrapper .dataTables_paginate .paginate_button {
        padding: 0.5rem 0.75rem !important;
        margin: 0 !important;
        border: 1px solid #ddd !important;
        border-radius: 0.375rem;
        background: #fff !important;
    }

    .dataTables_wrapper .dataTables_paginate .paginate_button.current {
        background: var(--primary-color) !important;
        color: #fff !important;
        border-color: var(--primary-color) !important;
    }

    .dataTables_wrapper .dataTables_info {
        text-align: center;
        margin: 1rem 0;
        width: 100%;
    }

    /* Ajustes para modais */
    .modal-dialog {
        margin: 0.5rem;
    }

    .modal-content {
        border-radius: 0.5rem;
    }

    .modal-body {
        padding: 1.5rem;
    }

    /* Melhorias nos formulários */
    .form-control {
        padding: 0.75rem;
        border-radius: 0.375rem;
    }

    .form-label {
        font-weight: 500;
        margin-bottom: 0.5rem;
    }
}

/* Estilos para desktop */
@media screen and (min-width: 768px) {
    .table th, .table td {
        padding: 1rem;
    }

    .action-buttons {
        display: flex;
        gap: 0.5rem;
        justify-content: center;
    }

    .badge {
        font-size: 0.875rem;
        padding: 0.5em 0.75em;
    }
}

/* Estilos comuns */
.card {
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 0.5rem;
}

.card-header.bg-pink {
    background: linear-gradient(45deg, var(--primary-color), var(--primary-light));
    border-top-left-radius: 0.5rem !important;
    border-top-right-radius: 0.5rem !important;
    padding: 1rem;
}

.btn {
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn i {
    font-size: 1rem;
}

.table-hover tbody tr:hover {
    background-color: rgba(0,0,0,0.02);
}

/* Cores personalizadas para badges */
.badge.bg-success {
    background-color: var(--success-color) !important;
}

.badge.bg-danger {
    background-color: var(--danger-color) !important;
}

/* Estilos gerais da tabela */
.table {
    width: 100%;
    margin-bottom: 1rem;
    background-color: transparent;
}

.table th,
.table td {
    padding: 0.75rem;
    vertical-align: middle;
}

/* Estilos para os botões */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.btn i {
    font-size: 0.875rem;
}
