/* =========================================================
   calidad.css - Sistema de Gestion de Calidad ISO 9001
   Paleta: #900 (primario) | Roboto | 12px base
   ========================================================= */

/* ---- Barra de busqueda ---- */
.cal-search-bar {
    background: linear-gradient(135deg, #fafafa 0%, #f3f3f3 100%);
    border-bottom: 1px solid #e0e0e0;
    padding: 14px 20px;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
}
.cal-search-logo {
    height: 48px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}
.cal-search-wrap {
    position: relative;
    width: 500px;
    flex-shrink: 0;
}
.cal-search-wrap > i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 14px;
    z-index: 2;
    pointer-events: none;
}
/* Override jQuery UI styles on search input */
.cal-search-input,
.cal-search-input.ui-autocomplete-input {
    width: 100% !important;
    padding: 10px 14px 10px 38px !important;
    border: 2px solid #e2e2e2 !important;
    border-radius: 12px !important;
    font-family: Roboto, sans-serif !important;
    font-size: 13px !important;
    color: #333 !important;
    background: #fff !important;
    outline: none !important;
    box-sizing: border-box !important;
    transition: border-color .2s, box-shadow .2s !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.04) !important;
}
.cal-search-input:focus,
.cal-search-input.ui-autocomplete-input:focus {
    border-color: #900 !important;
    box-shadow: 0 0 0 3px rgba(153,0,0,.08), 0 2px 8px rgba(0,0,0,.06) !important;
}
.cal-search-input::placeholder { color: #b0b0b0; font-weight: 400; }

/* ---- Popup resultados busqueda ---- */
.cal-sr-popup {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 14px;
    box-shadow: 0 16px 48px rgba(0,0,0,.14), 0 4px 12px rgba(0,0,0,.06);
    max-height: 460px;
    overflow-y: auto;
    z-index: 9999;
    min-width: 500px;
    padding: 6px 0;
}
.cal-sr-popup::-webkit-scrollbar { width: 5px; }
.cal-sr-popup::-webkit-scrollbar-track { background: transparent; }
.cal-sr-popup::-webkit-scrollbar-thumb { background: #d0d0d0; border-radius: 3px; }
.cal-sr-popup::-webkit-scrollbar-thumb:hover { background: #aaa; }

.cal-sr-empty {
    padding: 36px 20px;
    text-align: center;
    color: #b0b0b0;
    font-size: 13px;
    font-family: Roboto, sans-serif;
}
.cal-sr-empty i { display: block; font-size: 28px; margin-bottom: 10px; color: #ddd; }

/* Grupo / seccion */
.cal-sr-group {
    padding: 10px 18px 5px;
    font-family: Roboto, sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .7px;
    color: #999;
    border-top: 1px solid #f2f2f2;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}
.cal-sr-group:first-child { border-top: none; margin-top: 0; }
.cal-sr-group i { font-size: 11px; }
.cal-sr-count {
    background: #f0f0f0;
    color: #888;
    font-size: 9px;
    padding: 2px 7px;
    border-radius: 10px;
    margin-left: auto;
    font-weight: 600;
}

/* Card resultado */
.cal-sr-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 18px;
    margin: 0 6px;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: background .15s;
}
.cal-sr-card:hover { background: #f8f4f4; }

/* Icono extension */
.cal-sr-card-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    border-radius: 10px;
    margin-top: 2px;
}
.cal-sr-ext {
    font-family: Roboto, sans-serif;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .5px;
    line-height: 1;
}

/* Body */
.cal-sr-card-body {
    flex: 1;
    min-width: 0;
    font-family: Roboto, sans-serif;
}
.cal-sr-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* Meta tags */
.cal-sr-card-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    flex-wrap: wrap;
}
.cal-sr-badge {
    background: #900;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: .3px;
}
.cal-sr-tag {
    background: #eef2ff;
    color: #4a5fb5;
    font-size: 9px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
}
.cal-sr-ver {
    font-size: 10px;
    color: #94a3b8;
    font-weight: 600;
}
.cal-sr-file {
    font-size: 10px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}
.cal-sr-file i { font-size: 9px; color: #cbd5e1; margin-right: 2px; }
.cal-sr-lock { color: #ef4444; font-size: 10px; }
.cal-sr-sub {
    background: #fef3c7;
    color: #92400e;
    font-size: 9px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
}
.cal-sr-sub i { font-size: 8px; margin-right: 2px; }

/* Descripcion */
.cal-sr-card-desc {
    font-size: 11px;
    color: #a0aec0;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* Flecha */
.cal-sr-card-arrow {
    flex-shrink: 0;
    color: #d0d5dd;
    font-size: 11px;
    margin-top: 6px;
    transition: color .15s, transform .15s;
}
.cal-sr-card:hover .cal-sr-card-arrow { color: #900; transform: translateX(3px); }

/* Botones accion */
.cal-sr-card-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
    margin-top: 2px;
}
.cal-sr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    border-radius: 7px;
    border: none;
    font-size: 12px;
    text-decoration: none;
    cursor: pointer;
    color: #fff;
    transition: all .18s ease;
}
.cal-sr-btn-view { background: #fff; color: #2563eb; border: 1px solid #e2e8f0; }
.cal-sr-btn-view:hover {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
    box-shadow: 0 3px 10px rgba(37,99,235,.3);
    transform: translateY(-1px);
}
.cal-sr-btn-download { background: #fff; color: #16a34a; border: 1px solid #e2e8f0; }
.cal-sr-btn-download:hover {
    background: #16a34a;
    color: #fff;
    border-color: #16a34a;
    box-shadow: 0 3px 10px rgba(22,163,74,.3);
    transform: translateY(-1px);
}


/* ---- Tabs de navegacion ---- */
.cal-tabs {
    border-bottom: 2px solid #900;
    padding: 0 16px;
    background: #fff;
}
.cal-tabs .nav-link {
    font-family: Roboto, sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 10px 16px;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.cal-tabs .nav-link:hover {
    color: #900;
    border-bottom-color: rgba(153,0,0,0.3);
    background: transparent;
}
.cal-tabs .nav-link.active {
    color: #900;
    border-bottom-color: #900;
    background: transparent;
}
.cal-tabs .nav-link i {
    margin-right: 5px;
    font-size: 12px;
}

/* ---- Contenido principal ---- */
.cal-content {
    padding: 16px;
    min-height: 400px;
}

/* ---- Toolbar (botones de accion) ---- */
.cal-toolbar {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---- Titulo de seccion ---- */
.cal-section-title {
    font-family: Roboto, sans-serif;
    font-size: 14px;
    font-weight: bold;
    color: #900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 20px 0 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid #f0e0e0;
}
.cal-section-title i {
    margin-right: 6px;
    font-size: 13px;
}

/* ---- Cards de documentos ---- */
.cal-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}
.cal-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    display: flex;
    overflow: hidden;
    transition: box-shadow 0.15s;
}
.cal-card:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.cal-cards-2col {
    grid-template-columns: repeat(2, 1fr);
}
.cal-card-wide {
    grid-column: 1 / -1;
    max-width: 100%;
}
.cal-card-icon {
    background: #fdf2f2;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 16px 14px;
    min-width: 50px;
}
.cal-card-icon i {
    font-size: 22px;
    color: #900;
}
.cal-card-body {
    flex: 1;
    padding: 12px 14px;
}
.cal-card-body h4 {
    font-family: Roboto, sans-serif;
    font-size: 13px;
    font-weight: bold;
    color: #333;
    margin: 0 0 6px;
}
.cal-card-desc {
    font-size: 11px;
    color: #777;
    margin: 4px 0 8px;
    line-height: 1.4;
}
.cal-card-actions {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

/* ---- Badges ---- */
.cal-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: bold;
    background: #900;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    margin-right: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.cal-badge-cat {
    background: #2980b9;
}

/* ---- Lista de archivos ---- */
.cal-file-list {
    margin-top: 8px;
}
.cal-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    background: #fafafa;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    margin-bottom: 4px;
    font-size: 11px;
    transition: background 0.1s;
}
.cal-file-item:hover {
    background: #f4f4f4;
}
.cal-file-info {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
}
.cal-file-name {
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cal-file-ver {
    font-size: 9px;
    background: #eee;
    color: #666;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 4px;
    flex-shrink: 0;
}
.cal-file-desc {
    font-size: 10px;
    color: #999;
    margin-left: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cal-file-actions {
    display: flex;
    gap: 3px;
    flex-shrink: 0;
    margin-left: 8px;
}

/* ---- Sub-archivos (arbol) ---- */
.cal-subtree {
    margin-top: 10px;
    padding: 8px 10px;
    background: #f9f9f9;
    border: 1px dashed #ddd;
    border-radius: 6px;
}
.cal-subtree h5 {
    font-size: 11px;
    font-weight: bold;
    color: #555;
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.cal-subtree h5 i {
    color: #e67e22;
    margin-right: 4px;
}
.cal-subfile-list .cal-file-item {
    background: #fff;
    border-color: #e8e8e8;
}

/* ---- Estado vacio ---- */
.cal-empty {
    text-align: center;
    padding: 40px;
    color: #bbb;
}
.cal-empty i {
    font-size: 40px;
    margin-bottom: 12px;
    display: block;
}
.cal-empty p {
    font-size: 13px;
    font-style: italic;
}
.cal-empty-sm {
    text-align: center;
    padding: 16px;
    color: #ccc;
    font-style: italic;
    font-size: 12px;
}

/* ---- Inicio (politica / objetivo) ---- */
.cal-inicio {
    max-width: 800px;
    margin: 0 auto;
}
.cal-inicio-header {
    text-align: center;
    margin-bottom: 24px;
    padding: 24px;
    background: linear-gradient(135deg, #fdf2f2 0%, #fff5f5 100%);
    border-radius: 10px;
    border: 1px solid #f0e0e0;
}
.cal-iso-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}
.cal-iso-text h2 {
    font-family: Roboto, sans-serif;
    font-size: 18px;
    font-weight: bold;
    color: #900;
    margin: 0;
}
.cal-iso-text h3 {
    font-family: Roboto, sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #666;
    margin: 4px 0 0;
}
.cal-inicio-section {
    margin-bottom: 20px;
    padding: 16px;
    background: #fcfcfc;
    border: 1px solid #eee;
    border-radius: 6px;
}
.cal-inicio-section h3 {
    font-family: Roboto, sans-serif;
    font-size: 13px;
    font-weight: bold;
    color: #900;
    margin: 0 0 10px;
    text-transform: uppercase;
}
.cal-inicio-section h3 i {
    margin-right: 6px;
}
/* Texto plano (antes del editor) */
.cal-inicio-section > div > p {
    color: #444;
    line-height: 1.6;
    margin: 0 0 6px;
}

/* Contenido guardado desde el editor HTML:
   NO fijar font-size para que los estilos inline de Summernote se respeten.
   Solo colores y espaciado base. */
#txtPolitica, #txtObjetivo {
    color: #444;
    line-height: 1.6;
}
#txtPolitica p, #txtObjetivo p,
#txtPolitica li, #txtObjetivo li {
    margin: 0 0 6px;
    color: inherit;
    line-height: inherit;
}

/* Evitar que el CSS del modulo se filtre al area editable de Summernote */
.note-editable p {
    font-size: inherit !important;
    color: inherit !important;
    margin: 0 0 6px;
}
.cal-editable {
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.15s;
}
.cal-editable:hover {
    background: #fff5f0;
}
.cal-edit-form textarea {
    font-family: Roboto, sans-serif;
    font-size: 12px;
}
.cal-hint {
    font-size: 11px;
    color: #999;
    font-style: italic;
    margin-top: 10px;
}
.cal-hint i {
    margin-right: 4px;
}

/* ---- Visor PDF bloqueado ---- */
.cal-pdf-viewer {
    background: #f4f4f4;
    border-radius: 8px;
    overflow: hidden;
}
.cal-pdf-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #900;
    color: #fff;
}
.cal-pdf-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: Roboto, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}
.cal-pdf-title i {
    font-size: 14px;
}
.cal-pdf-lock-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    background: rgba(0,0,0,0.3);
    color: #ffd;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.cal-pdf-header button {
    font-size: 11px;
    flex-shrink: 0;
}
.cal-pdf-blocked-bar {
    background: #fff3cd;
    border-bottom: 1px solid #ffc107;
    color: #856404;
    font-family: Roboto, sans-serif;
    font-size: 11px;
    font-weight: 600;
    padding: 7px 16px;
    display: flex;
    align-items: center;
    gap: 7px;
}
.cal-pdf-container {
    width: 100%;
    height: calc(100vh - 200px);
    min-height: 500px;
    position: relative;
}
.cal-pdf-embed {
    width: 100%;
    height: 100%;
    border: none;
}

/* ---- Toast de notificacion ---- */
.cal-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #27ae60;
    color: #fff;
    padding: 10px 20px;
    border-radius: 6px;
    font-family: Roboto, sans-serif;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    z-index: 99999;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
}
.cal-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Tabla desplegable de documentos ---- */
.cal-tree-table {
    width: 100%;
    border-collapse: collapse;
    font-family: Roboto, sans-serif;
    font-size: 12px;
    margin-bottom: 16px;
    background: #fff;
    border: 1px solid #e4e4e4;
    border-radius: 6px;
    overflow: hidden;
}
.cal-tree-table thead tr {
    background: #f5f5f5;
    border-bottom: 2px solid #e0e0e0;
}
.cal-tree-table thead th {
    padding: 9px 12px;
    font-weight: 700;
    color: #555;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.cal-tree-th-toggle  { width: 32px; text-align: center; }
.cal-tree-th-code    { width: 110px; }
.cal-tree-th-name    { min-width: 200px; }
.cal-tree-th-desc    { }
.cal-tree-th-actions { width: 130px; text-align: center; }

/* Resaltado desde busqueda */
@keyframes calHighlightPulse {
    0%   { background: rgba(153,0,0,.15); }
    50%  { background: rgba(153,0,0,.08); }
    100% { background: rgba(153,0,0,.15); }
}
.cal-row-highlight td {
    animation: calHighlightPulse .8s ease infinite;
    box-shadow: inset 3px 0 0 #900;
}
.cal-row-highlight {
    transition: background .5s ease;
}
@keyframes calHighlightYellow {
    0%   { background: rgba(234,179,8,.25); }
    50%  { background: rgba(234,179,8,.12); }
    100% { background: rgba(234,179,8,.25); }
}
.cal-file-highlight {
    animation: calHighlightYellow .8s ease infinite;
    box-shadow: inset 3px 0 0 #eab308;
    border-radius: 6px;
}

/* Fila de documento */
.cal-tree-row td {
    padding: 9px 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}
.cal-tree-row:last-child td { border-bottom: none; }
.cal-tree-clickable {
    cursor: pointer;
    transition: background 0.12s;
}
.cal-tree-clickable:hover {
    background: #fdf5f5;
}
.cal-tree-row-open {
    background: #fff8f8 !important;
    border-left: 3px solid #900;
}
.cal-tree-row-open td { border-bottom: none; }

/* Chevron */
.cal-tree-chevron {
    color: #900;
    font-size: 11px;
    transition: transform 0.18s;
    display: block;
    text-align: center;
}

/* Celdas de fila */
.cal-tree-td-code    { white-space: nowrap; }
.cal-tree-td-name    { font-size: 12px; color: #222; }
.cal-tree-td-desc    { font-size: 11px; color: #777; }
.cal-tree-td-actions { text-align: center; white-space: nowrap; }
.cal-tree-th-archivo { width: 130px; }
.cal-tree-td-archivo { white-space: nowrap; }

/* ---- Toggle Solo Consulta ---- */
.cal-lock-btn {
    min-width: 26px;
    text-align: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.cal-lock-on {
    background: #fdf2f2;
    border-color: #e0b0b0;
    color: #900 !important;
}
.cal-lock-off {
    background: #f0f9f0;
    border-color: #a0d0a0;
    color: #27ae60 !important;
}
.cal-lock-on:hover {
    background: #900;
    border-color: #900;
    color: #fff !important;
}
.cal-lock-off:hover {
    background: #27ae60;
    border-color: #27ae60;
    color: #fff !important;
}

.cal-tree-dash       { color: #ccc; }

/* Fila de detalle (oculta por defecto) */
.cal-tree-detail { display: none; }
.cal-tree-detail-open { display: table-row; }
.cal-tree-detail-cell {
    padding: 10px 16px 14px 32px !important;
    background: #fafafa;
    border-bottom: 1px solid #e8e8e8;
    border-left: 3px solid #900;
}

/* ---- Marca de agua PDF ---- */
.cal-pdf-watermark {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
    overflow: hidden;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 0;
    transform: rotate(-30deg) scale(1.4);
    transform-origin: center center;
    user-select: none;
    -webkit-user-select: none;
}
.cal-pdf-watermark span {
    display: block;
    width: 100%;
    padding: 22px 0;
    font-family: Roboto, sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: rgba(153,0,0,0.1);
    white-space: nowrap;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ---- Aviso captura de pantalla ---- */
.cal-pdf-screen-warn {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(140,0,0,0.92);
    color: #fff;
    font-family: Roboto, sans-serif;
    font-size: 18px;
    font-weight: 700;
    padding: 20px 40px;
    border-radius: 8px;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
}
.cal-pdf-screen-warn.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
.cal-pdf-screen-warn i {
    margin-right: 10px;
}

/* ---- Modal visor PDF ---- */
.cal-pdf-modal-content {
    border: none;
    border-radius: 8px;
    overflow: hidden;
}
.cal-pdf-modal-content .cal-pdf-header {
    border-radius: 0;
}
.cal-pdf-modal-content .modal-body {
    padding: 0;
}
.cal-pdf-modal-content .cal-pdf-container {
    height: calc(100vh - 160px);
    min-height: 500px;
    overflow-y: auto;
    padding: 8px 0;
}
.cal-pdf-loading,
.cal-pdf-error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 200px;
    font-family: Roboto, sans-serif;
    font-size: 13px;
    color: #fff;
}
.cal-pdf-error { color: #f9a; }

/* ---- Formularios del modulo (clase central) ---- */
.cal-form {
    max-width: 860px;
    margin: 16px auto;
}

/* Panel / fieldset */
.cal-form .fieldset {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
    padding: 0 0 12px;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.cal-form .fieldset h2 {
    font-family: Roboto, sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: #900;
    margin: 0 0 12px;
    padding: 9px 14px;
    border-radius: 5px 5px 0 0;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* Tabla interior */
.cal-form .fieldset table {
    width: 100%;
    border-collapse: collapse;
}
.cal-form .tdInfo {
    padding: 7px 12px;
    vertical-align: middle;
    font-family: Roboto, sans-serif;
    font-size: 12px;
}

/* Labels */
.cal-form .labelForm {
    font-family: Roboto, sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

/* Inputs de texto y textarea */
.cal-form .inputForm {
    font-family: Roboto, sans-serif;
    font-size: 12px;
    color: #333;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 6px 10px;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}
.cal-form .inputForm:focus {
    border-color: #900;
    box-shadow: 0 0 0 3px rgba(153,0,0,0.1);
    outline: none;
}
.cal-form textarea.inputForm {
    resize: vertical;
    min-height: 70px;
    line-height: 1.45;
}

/* Campo solo lectura (Infor) */
.cal-form .inforForm {
    font-family: Roboto, sans-serif;
    font-size: 12px;
    color: #444;
    background: transparent;
    border: none;
    padding: 4px 0;
    width: 100%;
}

/* Input file */
.cal-form input[type="file"] {
    font-family: Roboto, sans-serif;
    font-size: 12px;
    color: #555;
}

/* Checkbox */
.cal-form input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #900;
    cursor: pointer;
}

/* Botones de accion */
.cal-form .fg-button {
    font-family: Roboto, sans-serif;
    font-size: 12px;
    font-weight: 600;
    padding: 7px 18px;
    border-radius: 4px;
    border: 1px solid #900;
    background: #900;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
    margin-right: 6px;
}
.cal-form .fg-button:hover {
    background: #700;
    border-color: #700;
    box-shadow: 0 2px 6px rgba(153,0,0,0.2);
}
.cal-form .fg-button:last-of-type {
    background: #fff;
    color: #900;
}
.cal-form .fg-button:last-of-type:hover {
    background: #fdf2f2;
    box-shadow: none;
}

/* ---- Panel Archivo Actual (formularios) ---- */
.cal-archivo-actual {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin: 4px 0;
}
.cal-archivo-actual-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}
.cal-archivo-actual-info {
    flex: 1;
    min-width: 0;
}
.cal-archivo-actual-nombre {
    font-weight: 600;
    font-size: 13px;
    color: #2c3e50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cal-archivo-actual-meta {
    margin-top: 3px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.cal-archivo-actual-actions {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
}
.cal-archivo-actual-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #2c3e50;
    background: #fff;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    text-decoration: none;
    transition: all .15s;
    white-space: nowrap;
}
.cal-archivo-actual-btn:hover {
    background: #eaf0f6;
    border-color: #2980b9;
    color: #2980b9;
}

/* ---- Panel Versiones Anteriores (formularios) ---- */
.cal-versiones-panel { padding: 4px 14px 14px; }
.cal-versiones-panel .cal-ver-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.cal-versiones-panel .cal-ver-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f0f4f8;
    color: #555;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}
.cal-versiones-panel .cal-ver-badge i { color: #900; font-size: 10px; }

/* Timeline */
.cal-ver-timeline { position: relative; padding-left: 22px; margin: 0; }
.cal-ver-timeline::before {
    content: '';
    position: absolute;
    left: 7px; top: 4px; bottom: 4px;
    width: 2px;
    background: linear-gradient(180deg, #900 0%, #e0e0e0 100%);
    border-radius: 2px;
}

/* Cada version */
.cal-ver-item {
    position: relative;
    background: #fff;
    border: 1px solid #e8ecf0;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 8px;
    transition: border-color .15s, box-shadow .15s;
}
.cal-ver-item:hover {
    border-color: #c0c8d0;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

/* Dot en el timeline */
.cal-ver-item::before {
    content: '';
    position: absolute;
    left: -19px; top: 15px;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #900;
    z-index: 1;
}
.cal-ver-item:first-child::before { background: #900; }

/* Row superior */
.cal-ver-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.cal-ver-version {
    display: inline-block;
    background: #900;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.cal-ver-item:not(:first-child) .cal-ver-version {
    background: #6c757d;
}
.cal-ver-nombre {
    font-size: 12px;
    font-weight: 600;
    color: #2c3e50;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cal-ver-tipo {
    display: inline-block;
    background: #eef2ff;
    color: #4a5fb5;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 3px;
    text-transform: uppercase;
}

/* Row inferior meta */
.cal-ver-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 5px;
    font-size: 11px;
    color: #777;
    flex-wrap: wrap;
}
.cal-ver-meta i { color: #aaa; width: 12px; text-align: center; }
.cal-ver-obs {
    font-style: italic;
    color: #666;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Acciones */
.cal-ver-actions {
    display: flex;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
}
.cal-ver-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: #fff;
    color: #555;
    font-size: 12px;
    cursor: pointer;
    transition: all .15s;
    text-decoration: none;
}
.cal-ver-btn:hover {
    background: #900;
    border-color: #900;
    color: #fff;
}
.cal-ver-btn.btn-view:hover { background: #2980b9; border-color: #2980b9; }
.cal-ver-btn.btn-download:hover { background: #27ae60; border-color: #27ae60; }

/* Empty state */
.cal-ver-empty {
    text-align: center;
    padding: 20px 10px;
    color: #aaa;
    font-size: 12px;
}
.cal-ver-empty i { font-size: 24px; display: block; margin-bottom: 6px; color: #ccc; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .cal-search-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    .cal-search-wrap {
        width: 100%;
    }
    .cal-sr-popup {
        min-width: auto;
        left: 0;
        right: 0;
    }
    .cal-sr-card { padding: 10px 12px; margin: 0 4px; }
    .cal-cards,
    .cal-cards-2col {
        grid-template-columns: 1fr;
    }
    .cal-tabs .nav-link {
        padding: 8px 10px;
        font-size: 11px;
    }
    .cal-file-item {
        flex-wrap: wrap;
    }
    .cal-file-actions {
        margin-top: 6px;
        margin-left: 0;
    }
    .cal-iso-logo {
        flex-direction: column;
    }
}
