/* CD Reportes Institucional */

.cdri-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #0f172a;
    max-width: 1060px;
    margin: 0 auto;
}

.cdri-aviso {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: .9rem;
    margin-bottom: 16px;
}
.cdri-aviso--error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.cdri-aviso--info  { background: #f0f9ff; border: 1px solid #bae6fd; color: #075985; }

/* Layout 2 columnas */
.cdri-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    align-items: start;
}

/* Sidebar */
.cdri-sidebar {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    position: sticky;
    top: 20px;
}
.cdri-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid #f1f5f9;
}
.cdri-sidebar-titulo {
    font-size: .9rem;
    font-weight: 600;
    color: #0369a1;
    margin: 0;
}
.cdri-sidebar-acciones { display: flex; align-items: center; gap: 4px; }
.cdri-link {
    background: none;
    border: none;
    font-size: .75rem;
    color: #0284c7;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
}
.cdri-link:hover { background: #f0f9ff; }
.cdri-sep { color: #cbd5e1; font-size: .75rem; }

.cdri-search-wrap { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; }
.cdri-search {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: .82rem;
    outline: none;
    box-sizing: border-box;
}
.cdri-search:focus { border-color: #0284c7; }

.cdri-centros-lista {
    max-height: 460px;
    overflow-y: auto;
}

.cdri-centro-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f8fafc;
    transition: background .1s;
}
.cdri-centro-item:hover { background: #f8fafc; }
.cdri-centro-item:last-child { border-bottom: none; }
.cdri-check {
    margin-top: 3px;
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: #0284c7;
}
.cdri-centro-info { display: flex; flex-direction: column; gap: 2px; }
.cdri-centro-nombre { font-size: .84rem; font-weight: 500; color: #0f172a; line-height: 1.3; }
.cdri-centro-codigo { font-size: .72rem; color: #0284c7; }
.cdri-centro-cif    { font-size: .72rem; color: #94a3b8; font-family: monospace; }

.cdri-sidebar-footer {
    padding: 10px 14px;
    border-top: 1px solid #f1f5f9;
    font-size: .78rem;
    color: #64748b;
    background: #f8fafc;
    text-align: center;
}
#cdri-sel-count { font-weight: 700; color: #0284c7; }

/* Reportes */
.cdri-reportes-header { margin-bottom: 16px; }
.cdri-reportes-titulo {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 4px;
    color: #0f172a;
}
.cdri-reportes-hint { font-size: .82rem; color: #94a3b8; margin: 0; }

.cdri-botones { display: flex; flex-direction: column; gap: 12px; }

.cdri-reporte-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px 20px;
    transition: border-color .15s;
}
.cdri-reporte-card:hover { border-color: #bae6fd; }
.cdri-reporte-card--pronto {
    opacity: .55;
    pointer-events: none;
}

.cdri-reporte-icono { font-size: 28px; flex-shrink: 0; }
.cdri-reporte-info  { flex: 1; min-width: 0; }
.cdri-reporte-info strong { display: block; font-size: .92rem; font-weight: 600; margin-bottom: 3px; }
.cdri-reporte-info p { font-size: .78rem; color: #64748b; margin: 0; }

.cdri-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: transparent;
    font-size: .84rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, opacity .15s;
    color: #374151;
}
.cdri-btn--primary {
    background: #0284c7;
    color: #fff;
    border-color: #0284c7;
}
.cdri-btn--primary:hover:not(:disabled) { background: #0369a1; }
.cdri-btn:disabled { opacity: .4; cursor: not-allowed; }

.cdri-badge-pronto {
    display: inline-block;
    padding: 4px 12px;
    background: #f1f5f9;
    border-radius: 999px;
    font-size: .72rem;
    color: #94a3b8;
    white-space: nowrap;
}

.cdri-feedback {
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: .84rem;
}
.cdri-feedback--ok    { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.cdri-feedback--error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

@media (max-width: 680px) {
    .cdri-layout { grid-template-columns: 1fr; }
    .cdri-sidebar { position: static; }
    .cdri-reporte-card { flex-wrap: wrap; }
}
