/* ============================================
   LISTS - Tables, Search, Header, Buttons
   ============================================ */

/* === Table Responsive Container === */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 20px;
    margin-top: 20px;
}

/* === Table === */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 20px;
    margin-left: auto;
    margin-right: auto;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

th,
td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

th {
    background-color: var(--bg-main);
    font-weight: 600;
    color: var(--text-main);
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: var(--primary-light);
}

/* === List Header (title + button row) === */
.header-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* === Search Container === */
.search-container {
    margin-bottom: 20px;
}

.search-container form {
    display: flex;
    gap: 10px;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.search-container-group {
    flex: 1;
}

.search-container-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.search-container-input-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.search-container-input-row input {
    margin-bottom: 0;
    flex: 1;
    min-width: 150px;
}

.search-container-input-row button {
    background-color: var(--secondary-color);
    color: white;
    padding: 0 12px;
    font-size: 0.9rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    width: auto !important;
    flex: 0 0 auto;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
}

/* === Action Buttons === */
.btn-novo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s, transform 0.1s;
    white-space: nowrap;
    width: auto;
    max-width: 100%;
    box-sizing: border-box;
}

.btn-novo:hover {
    background-color: var(--primary-hover);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

.btn-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s, transform 0.1s;
    white-space: nowrap;
    width: auto;
}

.btn-badge:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.btn-badge-primary {
    background-color: var(--primary-color);
    color: white;
}

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

.btn-badge-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-badge-danger:hover {
    background-color: var(--danger-hover);
    color: white;
}

/* === Card List Container === */
.card-list {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: visible;
    box-sizing: border-box;
}

/* === Mobile List Adjustments === */
@media (max-width: 768px) {
    .table-responsive {
        padding: 8px;
        margin-left: 0;
        margin-right: 0;
        border-radius: var(--radius-md);
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        box-sizing: border-box;
        max-width: 100%;
        width: 100%;
    }

    table {
        min-width: 500px;
        table-layout: auto;
        max-width: none;
    }

    table th,
    table td {
        font-size: 12px !important;
        padding: 8px 6px !important;
        white-space: nowrap;
    }

    .btn-badge {
        padding: 4px 6px !important;
        font-size: 10px !important;
    }

    .header-list {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        box-sizing: border-box;
    }

    .header-list .btn-novo {
        padding: 10px 15px !important;
        font-size: 0.9rem !important;
        width: 100% !important;
        text-align: center;
        box-sizing: border-box;
    }

    .search-container {
        width: 100%;
        box-sizing: border-box;
    }

    .search-container-input-row {
        flex-direction: column;
    }

    .search-container-input-row input {
        min-width: 0;
        width: 100% !important;
        box-sizing: border-box;
    }

    .search-container-input-row button {
        width: 100% !important;
        box-sizing: border-box;
    }

    .card-list {
        overflow-x: hidden;
        width: 100%;
    }
}

