/* Tabla Principal */
#apcc-grid {
    border-collapse: collapse;
    width: 100%;
    min-width: 800px;
    /* Force minimum width to allow scrolling */
}

#apcc-grid th,
#apcc-grid td {
    border: 1px solid var(--border-color);
    padding: 10px;
    text-align: left;
    white-space: nowrap;
    /* Prevent text wrapping in tiny columns */
}

#apcc-grid th {
    background-color: var(--primary-color);
    color: #fff;
    font-weight: 600;
}

#apcc-grid tr:nth-child(even) {
    background-color: #f9f9f9;
}

#apcc-grid tr:hover {
    background-color: var(--primary-light);
}

/* Filtros y Ordenamiento */
.apc-filter-icon,
.apc-sort-icon {
    display: inline-block;
    margin-left: 5px;
    cursor: pointer;
    font-size: 10px;
    opacity: 0.7;
    user-select: none;
}

.apc-filter-icon:hover,
.apc-sort-icon:hover {
    opacity: 1;
}

.apc-filter-active,
.apc-sort-active {
    color: #ffeb3b;
    /* Amarillo para indicar activo */
    opacity: 1;
}

/* Popup de Filtro */
.apc-filter-popup {
    position: absolute;
    background: #fff;
    border: 1px solid #ccc;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    padding: 12px;
    z-index: 10000010;
    /* Higher than modal */
    min-width: 180px;
    max-height: 350px;
    overflow-y: auto;
    color: #333;
    font-weight: normal;
    border-radius: 4px;
}

.apc-filter-popup label {
    display: block;
    margin-bottom: 8px;
    cursor: pointer;
    font-size: 13px;
}

.apc-filter-popup input[type="checkbox"] {
    margin-right: 8px;
    vertical-align: middle;
}

.apc-filter-actions {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    gap: 5px;
}

.apc-filter-actions button {
    padding: 4px 8px;
    font-size: 11px;
    cursor: pointer;
    border: 1px solid #ddd;
    background: #f8f8f8;
    border-radius: 3px;
}

.apc-filter-actions button:hover {
    background: #eee;
}

/* Buscador en Toolbar */
.apc-search-container {
    flex-grow: 1;
    max-width: 400px;
}

#apcc-search-input {
    width: 100%;
}

/* Fix Flatpickr in Modals */
.flatpickr-calendar {
    z-index: 10000010 !important;
    /* Higher than modal (9,999,999) */
}

/* Fix for altInput in modals */
.flatpickr-input[type="hidden"] {
    display: none !important;
}