/* ==========================================================================
   GasGestión MX — Estilos personalizados para listados
   Complementa AdminLTE 3 + Bootstrap 4 + DataTables
   ========================================================================== */

/* --- Card de Listado --- */
.card-listado {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease;
}

.card-listado:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.card-listado > .card-header {
    background: linear-gradient(135deg, #343a40 0%, #495057 100%);
    color: #fff;
    border-radius: 0.5rem 0.5rem 0 0 !important;
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.card-listado > .card-header .card-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-listado > .card-header .card-title i {
    opacity: 0.85;
}

/* --- Badge de conteo --- */
.badge-count {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25em 0.65em;
    border-radius: 1rem;
    margin-left: 0.25rem;
}

/* --- Filtro inline en el header --- */
.filter-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-inline label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    font-weight: 400;
    margin-bottom: 0;
    white-space: nowrap;
}

.filter-inline select {
    background-color: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    border-radius: 0.35rem;
    padding: 0.3rem 2rem 0.3rem 0.6rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 0.75em;
}

.filter-inline select:focus {
    background-color: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
    outline: none;
    box-shadow: 0 0 0 0.15rem rgba(255, 255, 255, 0.15);
}

.filter-inline select option {
    background-color: #343a40;
    color: #fff;
}

.filter-inline .btn-filter {
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 0.8rem;
    padding: 0.3rem 0.75rem;
    border-radius: 0.35rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.filter-inline .btn-filter:hover {
    background-color: rgba(255, 255, 255, 0.35);
}

/* --- Card Body con tabla --- */
.card-listado > .card-body {
    padding: 0;
}

.card-listado > .card-body .table-container {
    padding: 1rem 1.25rem;
}

/* --- Tabla --- */
.card-listado .table {
    margin-bottom: 0;
}

.card-listado .table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #495057;
    padding: 0.75rem 0.85rem;
    white-space: nowrap;
}

.card-listado .table tbody td {
    padding: 0.65rem 0.85rem;
    font-size: 0.875rem;
    vertical-align: middle;
    border-color: #f0f0f0;
    transition: background-color 0.15s ease;
}

.card-listado .table tbody tr:hover td {
    background-color: #f0f7ff;
}

/* --- Botones de acción --- */
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 0.35rem;
    border: none;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none !important;
}

.btn-action-view {
    background-color: #e8f4fd;
    color: #0d6efd;
}

.btn-action-view:hover {
    background-color: #0d6efd;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(13, 110, 253, 0.35);
}

.btn-action-delete {
    background-color: #fde8e8;
    color: #dc3545;
}

.btn-action-delete:hover {
    background-color: #dc3545;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.35);
}

.action-group {
    display: flex;
    gap: 0.35rem;
    justify-content: center;
}

/* --- Badges de estado --- */
.badge-status {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.3em 0.7em;
    border-radius: 1rem;
}

.badge-status-yes {
    background-color: #d4edda;
    color: #155724;
}

.badge-status-no {
    background-color: #f8d7da;
    color: #721c24;
}

.badge-tipo-p {
    background-color: #cce5ff;
    color: #004085;
}

.badge-tipo-c {
    background-color: #fff3cd;
    color: #856404;
}

/* --- Estado vacío --- */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #adb5bd;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1rem;
    margin-bottom: 0;
}

/* --- DataTables overrides para AdminLTE --- */
.card-listado .dataTables_wrapper {
    padding: 1rem 1.25rem;
}

.card-listado .dataTables_wrapper .dataTables_filter input {
    border: 1px solid #ced4da;
    border-radius: 0.35rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.card-listado .dataTables_wrapper .dataTables_filter input:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.15rem rgba(0, 123, 255, 0.25);
    outline: none;
}

.card-listado .dataTables_wrapper .dataTables_length select {
    border: 1px solid #ced4da;
    border-radius: 0.35rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.card-listado .dataTables_wrapper .dataTables_info {
    font-size: 0.8rem;
    color: #6c757d;
    padding-top: 0.75rem;
}

.card-listado .dataTables_wrapper .dataTables_paginate {
    padding-top: 0.75rem;
}

.card-listado .dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 0.3rem !important;
    margin: 0 2px;
}

/* --- Responsive mejoras --- */
@media (max-width: 768px) {
    .card-listado > .card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-inline {
        width: 100%;
    }

    .filter-inline select {
        flex: 1;
    }

    .card-listado .table thead th {
        font-size: 0.72rem;
    }

    .card-listado .table tbody td {
        font-size: 0.8rem;
    }
}
