/* Componente colapsable "FORMATOS APLICABLES" — skin Ejecutivo Navy.
   Progressive enhancement de un <WRAP center round download> existente;
   ver bez/scripts/formatos-colapsable.js */

.nicc-formatos-colapsable {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    overflow: hidden;
    margin: 1.2em 0;
    background: #fff;
    font-size: 0.95em;
}

.nicc-formatos-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #0f172a;
    color: #fff;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
}
.nicc-formatos-header:focus-visible {
    outline: 2px solid #38bdf8;
    outline-offset: -2px;
}

.nicc-formatos-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.9em;
    min-width: 0;
}

.nicc-formatos-titulo {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nicc-formatos-badge {
    background: #0369a1;
    color: #fff;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 0.82em;
    font-weight: 700;
    flex: none;
}

.nicc-formatos-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: none;
}

.nicc-formatos-chevron {
    display: inline-block;
    transition: transform 0.2s ease;
    flex: none;
}
.nicc-formatos-colapsable.is-open > .nicc-formatos-header .nicc-formatos-chevron {
    transform: rotate(180deg);
}
@media (prefers-reduced-motion: reduce) {
    .nicc-formatos-chevron,
    .nicc-formatos-body { transition: none !important; }
}

.nicc-formatos-editbtn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.45);
    color: #fff;
    border-radius: 6px;
    padding: 5px 11px;
    font-size: 0.82em;
    font-weight: 700;
    cursor: pointer;
}
.nicc-formatos-editbtn:hover { background: rgba(255,255,255,0.12); }
.nicc-formatos-editbtn:focus-visible { outline: 2px solid #38bdf8; }

.nicc-formatos-body {
    max-height: 0;
    overflow: hidden;
    background: #f8fafc;
    transition: max-height 0.25s ease;
}
.nicc-formatos-colapsable.is-open .nicc-formatos-body {
    max-height: 4000px;
}

.nicc-formatos-body ul {
    list-style: none;
    margin: 0;
    padding: 4px 16px;
}
.nicc-formatos-body li {
    padding: 7px 0;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.nicc-formatos-body li:last-child { border-bottom: none; }

.nicc-formatos-body a {
    color: #1e3a5f;
    font-weight: 700;
    text-decoration: none;
    flex: 1;
    min-width: 0;
    word-break: break-word;
}
.nicc-formatos-body a:hover { text-decoration: underline; }
.nicc-formatos-body a:focus-visible { outline: 2px solid #0369a1; }

.nicc-formatos-vacio {
    margin: 0;
    padding: 14px 16px;
    color: #64748b;
    font-style: italic;
    font-size: 0.9em;
}

/* ---- Modo edición (solo manager/director) ---- */
.nicc-formatos-editrow {
    display: flex;
    gap: 8px;
    padding: 6px 16px;
    align-items: center;
    flex-wrap: wrap;
}
.nicc-formatos-editrow input {
    flex: 1;
    min-width: 140px;
    padding: 6px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font: inherit;
}
.nicc-formatos-editrow input:focus-visible { outline: 2px solid #0369a1; }
.nicc-formatos-urlinput {
    font-family: ui-monospace, Consolas, "Courier New", monospace;
    font-size: 0.85em;
    flex: 0 1 230px;
}

.nicc-formatos-iconbtn {
    background: transparent;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    width: 30px;
    height: 30px;
    flex: none;
    cursor: pointer;
    color: #334155;
    font-size: 0.85em;
    line-height: 1;
}
.nicc-formatos-iconbtn:hover { background: #e2e8f0; }
.nicc-formatos-iconbtn.danger { color: #dc2626; border-color: #fecaca; }
.nicc-formatos-iconbtn.danger:hover { background: #fee2e2; }
.nicc-formatos-iconbtn:disabled { opacity: 0.35; cursor: not-allowed; }

.nicc-formatos-addrow {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px dashed #cbd5e1;
    flex-wrap: wrap;
}
.nicc-formatos-addbtn {
    background: #0f172a;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 7px 14px;
    font-weight: 700;
    font-size: 0.85em;
    cursor: pointer;
    flex: none;
}
.nicc-formatos-addbtn:hover { background: #1e293b; }

.nicc-formatos-savebar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: #eef2f7;
    border-top: 1px solid #dbe3ee;
}
.nicc-formatos-status {
    font-size: 0.82em;
    color: #475569;
    margin-right: auto;
}
.nicc-formatos-status.is-error { color: #dc2626; font-weight: 700; }

.nicc-formatos-cancelbtn {
    background: transparent;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 7px 14px;
    font-size: 0.85em;
    cursor: pointer;
    color: #334155;
}
.nicc-formatos-cancelbtn:hover { background: #e2e8f0; }

.nicc-formatos-savebtn {
    background: #0369a1;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 7px 16px;
    font-weight: 700;
    font-size: 0.85em;
    cursor: pointer;
}
.nicc-formatos-savebtn:hover { background: #075985; }
.nicc-formatos-savebtn:disabled { opacity: 0.6; cursor: wait; }
