:root { --urjc-radio: 4px; }

/* === CONTROLES ============================================================ */
.urjc-coop-controles {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
    margin-bottom: 16px; padding: 11px 16px;
    background: #f8f8f8; border-left: 4px solid #CB0017; margin-top: 0;
}
.urjc-coop-label    { font-weight: bold; color: #111; font-size: 14px; white-space: nowrap; margin-bottom: 0; }
.urjc-coop-select   { padding: 6px 10px; border: 1px solid #ccc; border-radius: var(--urjc-radio); font-size: 14px; color: #111; background: white; cursor: pointer; height: 34px; }
.urjc-coop-select:focus { outline: none; box-shadow: 0 0 0 2px rgba(0,0,0,.08); }
.urjc-coop-buscador { flex-grow: 1; min-width: 200px; padding: 6px 12px; border: 1px solid #ccc; border-radius: var(--urjc-radio); font-size: 14px; height: 34px; }
.urjc-coop-buscador:focus { outline: none; border-color: #CB0017; box-shadow: 0 0 0 2px rgba(203,0,23,.12); }
.urjc-coop-btn      { padding: 6px 16px; border: 1px solid #bbb; border-radius: var(--urjc-radio); font-size: 13px; font-weight: bold; cursor: pointer; height: 34px; white-space: nowrap; transition: background .15s, border-color .15s; background: white; color: #111; }
.urjc-coop-btn:hover  { background: #f0f0f0; border-color: #999; }
.urjc-coop-btn:active { background: #e4e4e4; }
.urjc-coop-btn-excel { background: white; color: #111; border-color: #bbb; }
.urjc-coop-btn-csv   { background: white; color: #111; border-color: #bbb; }

/* === STATS ================================================================ */
.urjc-coop-stats-row { display: flex; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.urjc-coop-stat-card { flex: 1; min-width: 160px; padding: 14px 18px; background: white; border: 1px solid #e0e0e0; border-left: 4px solid #CB0017; border-radius: var(--urjc-radio); box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.urjc-coop-stat-numero { font-size: 26px; font-weight: 700; color: #CB0017; line-height: 1; }
.urjc-coop-stat-label  { font-size: 13px; font-weight: bold; color: #333; margin-top: 6px; }
.urjc-coop-stat-sub    { font-size: 12px; color: #999; margin-top: 3px; }

/* === AVISO VIGENCIA ======================================================= */
.urjc-coop-vigencia-box {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 18px; margin-bottom: 18px;
    background: white; border: 1px solid #e0e0e0; border-left: 4px solid #CB0017;
    border-radius: var(--urjc-radio); box-shadow: 0 1px 3px rgba(0,0,0,.05);
    font-size: 13px; color: #333;
}
.urjc-coop-vigencia-box i { color: #CB0017; font-size: 16px; }

/* === TRIMESTRES =========================================================== */
.urjc-coop-trimestres-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; padding: 7px 16px; background: #f8f8f8; border-left: 4px solid #CB0017; }
.urjc-coop-trim-label { font-size: 12px; font-weight: bold; color: #111; margin-right: 4px; white-space: nowrap; }
.urjc-btn-trim-coop { padding: 3px 13px; border: 1px solid #CB0017; border-radius: var(--urjc-radio); background: white; color: #CB0017; font-size: 12px; font-weight: bold; cursor: pointer; transition: background .12s, color .12s; white-space: nowrap; }
.urjc-btn-trim-coop:hover  { background: #fde8ea; }
.urjc-btn-trim-coop.activo { background: #CB0017; color: white; }
.urjc-btn-trim-coop:disabled { border-color: #d0d0d0; color: #bbb; background: #f5f5f5; cursor: not-allowed; }
.urjc-btn-trim-coop:disabled:hover { background: #f5f5f5; }

/* === TABLA ================================================================ */
.urjc-coop-tabla-wrapper { width: 100%; max-height: 600px; overflow-y: auto; overflow-x: auto; border: 1px solid #d0d0d0; border-radius: var(--urjc-radio); }
.urjc-coop-tabla { width: 100%; border-collapse: collapse; font-size: 11px; table-layout: auto; min-width: 600px; }
.urjc-coop-tabla thead tr:first-child th { position: sticky; top: 0; z-index: 3; background: #CB0017; color: white; padding: 9px 10px; text-align: left; font-size: 12px; font-weight: bold; white-space: nowrap; border-bottom: 1px solid #9e0011; user-select: none; }
.urjc-coop-th-sortable { cursor: pointer; }
.urjc-coop-th-sortable:hover { background: #a80014 !important; }
.urjc-coop-sort-icon { font-style: normal; font-size: 10px; opacity: .55; margin-left: 3px; vertical-align: middle; }
.urjc-coop-th-sortable.urjc-sort-asc  .urjc-coop-sort-icon,
.urjc-coop-th-sortable.urjc-sort-desc .urjc-coop-sort-icon { opacity: 1; }

.urjc-coop-fila-filtros th { position: sticky; top: 37px; z-index: 2; background: #fff5f5; padding: 4px 5px; border-bottom: 2px solid #CB0017; }
.urjc-coop-filtro-col { width: 100%; padding: 3px 6px; font-size: 11px; border: 1px solid #ddd; border-radius: var(--urjc-radio); background: white; box-sizing: border-box; height: 24px; color: #333; }
.urjc-coop-filtro-col:focus { outline: none; border-color: #CB0017; }

.urjc-coop-tabla tbody tr { border-bottom: 1px solid #ebebeb; transition: background-color .08s; }
.urjc-coop-tabla tbody tr:nth-child(even) { background: #fafafa; }
.urjc-coop-tabla tbody tr:hover           { background: #fde8ea; }
.urjc-coop-tabla tbody td { padding: 7px 10px; color: #333; vertical-align: top; white-space: normal; word-break: break-word; font-size: 11px; }
.urjc-coop-tabla tbody td.urjc-coop-td-fecha { white-space: nowrap; word-break: normal; color: #777; }
.urjc-coop-sin-datos { text-align: center; padding: 40px 20px; color: #888; font-style: italic; font-size: 14px; }

/* === COMBO CHIPS ========================================================== */
.urjc-coop-combo-col { position: relative; width: 100%; }
.urjc-coop-chips-wrap { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; min-height: 24px; padding: 2px 4px; border: 1px solid #ddd; border-radius: var(--urjc-radio); background: white; box-sizing: border-box; cursor: text; }
.urjc-coop-chips-wrap:focus-within { border-color: #CB0017; }
.urjc-coop-chip { display: inline-flex; align-items: center; gap: 3px; background: #CB0017; color: white; border-radius: 3px; padding: 1px 5px; font-size: 10px; white-space: nowrap; max-width: 130px; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
.urjc-coop-chip-text { overflow: hidden; text-overflow: ellipsis; max-width: 100px; }
.urjc-coop-chip-remove { cursor: pointer; font-size: 11px; line-height: 1; opacity: .8; flex-shrink: 0; }
.urjc-coop-chip-remove:hover { opacity: 1; }
.urjc-coop-combo-input { border: none; outline: none; font-size: 11px; background: transparent; min-width: 60px; flex: 1; padding: 1px 2px; height: 18px; color: #333; }
.urjc-coop-combo-dropdown { display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 999; background: white; border: 1px solid #CB0017; border-top: none; border-radius: 0 0 var(--urjc-radio) var(--urjc-radio); max-height: 220px; overflow-y: auto; box-shadow: 0 4px 10px rgba(0,0,0,.12); }
.urjc-coop-combo-item { padding: 5px 9px; font-size: 11px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #333; }
.urjc-coop-combo-item:hover         { background: #fde8ea; }
.urjc-coop-combo-item-all           { color: #999; font-style: italic; border-bottom: 1px solid #eee; }
.urjc-coop-combo-item-all:hover     { background: #f5f5f5; }
.urjc-coop-combo-item-selected      { background: #fde8ea; font-weight: bold; }

/* === PAGINACIÓN =========================================================== */
.urjc-coop-paginacion { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 10px; flex-wrap: wrap; }
.urjc-coop-pag-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 28px; padding: 0 7px; border: 1px solid #d0d0d0; border-radius: var(--urjc-radio); background: white; color: #333; font-size: 12px; cursor: pointer; transition: background .12s, color .12s, border-color .12s; white-space: nowrap; }
.urjc-coop-pag-btn:hover:not(:disabled):not(.activo) { background: #fde8ea; border-color: #CB0017; color: #CB0017; }
.urjc-coop-pag-btn.activo  { background: #CB0017; color: white; border-color: #CB0017; font-weight: bold; cursor: default; }
.urjc-coop-pag-btn:disabled { opacity: .4; cursor: default; }
.urjc-coop-pag-puntos { padding: 0 4px; font-size: 12px; color: #aaa; cursor: default; line-height: 28px; }

/* === INFO ================================================================= */
.urjc-coop-info-resultados { margin-top: 8px; font-size: 12px; color: #aaa; text-align: right; }

/* === CHECKBOX DROPDOWN (filtro empresa multiselect) ======================== */
.urjc-checkbox-col  { position: relative; width: 100%; }
.urjc-checkbox-btn  {
    width: 100%; padding: 3px 6px; font-size: 11px; border: 1px solid #ddd;
    border-radius: var(--urjc-radio); background: white; box-sizing: border-box;
    height: 24px; color: #333; cursor: pointer; text-align: left;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.urjc-checkbox-btn:focus  { outline: none; border-color: #CB0017; }
.urjc-checkbox-btn.activo { border-color: #CB0017; background: #fff5f5; color: #CB0017; font-weight: bold; }
.urjc-checkbox-panel {
    display: none; position: fixed; top: 0; left: 0;
    min-width: 220px; max-width: 400px; z-index: 9999; background: white;
    border: 1px solid #CB0017; border-radius: var(--urjc-radio);
    box-shadow: 0 4px 12px rgba(0,0,0,.15); padding: 6px 0;
    max-height: 280px; overflow-y: auto;
}
.urjc-checkbox-panel.abierto { display: block; }
.urjc-checkbox-item { display: flex; align-items: center; gap: 7px; padding: 4px 10px; font-size: 11px; cursor: pointer; color: #333; }
.urjc-checkbox-item:hover { background: #fde8ea; }
.urjc-checkbox-item input[type="checkbox"] { cursor: pointer; flex-shrink: 0; accent-color: #CB0017; }
.urjc-checkbox-item label { cursor: pointer; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.urjc-checkbox-sep   { border: none; border-top: 1px solid #eee; margin: 4px 0; }
.urjc-checkbox-search {
    display: block;
    width: calc(100% - 16px);
    margin: 4px 8px 6px;
    padding: 3px 7px;
    font-size: 11px;
    border: 1px solid #ddd;
    border-radius: var(--urjc-radio);
    box-sizing: border-box;
    color: #333;
    background: white;
}
.urjc-checkbox-search:focus {
    outline: none;
    border-color: #CB0017;
    box-shadow: 0 0 0 2px rgba(203,0,23,0.10);
}
.urjc-checkbox-todos { color: #999; font-style: italic; padding: 4px 10px 6px; cursor: pointer; }
.urjc-checkbox-todos:hover { background: #f5f5f5; }

@media (max-width: 768px) {
    .urjc-coop-stat-card    { min-width: 100%; }
    .urjc-coop-tabla-wrapper{ max-height: 400px; }
    .urjc-coop-fila-filtros { display: none; }
}
