/* ============================================================
   MÓDULO DOCUMENTACIÓN
   ============================================================ */

.doc-module {
    position: relative;
}

/* ---- Header ---- */
.doc-module .module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    flex-wrap: wrap;
    gap: 8px;
}

.doc-module .module-header h2 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-color, #0a2463);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.doc-header-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

/* ---- Botones principales ---- */
.btn-doc {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 13px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    transition: all 0.18s;
    font-family: inherit;
    line-height: 1.4;
}

.btn-nueva-carpeta {
    background: var(--accent-color, #0a2463);
    color: white;
}
.btn-nueva-carpeta:hover { opacity: 0.88; }

.btn-subir-archivo {
    background: #3498db;
    color: white;
    cursor: pointer;
}
.btn-subir-archivo:hover { background: #2980b9; }

.btn-camara {
    background: #27ae60;
    color: white;
    cursor: pointer;
}
.btn-camara:hover { background: #219a52; }

.btn-pegar {
    background: #8e44ad;
    color: white;
}
.btn-pegar:hover { background: #7d3c98; }

.btn-doc-confirm {
    background: var(--accent-color, #0a2463);
    color: white;
}
.btn-doc-confirm:hover { opacity: 0.88; }

.btn-doc-cancel {
    background: #f1f5f9;
    color: #475569;
}
.btn-doc-cancel:hover { background: #e2e8f0; }

.btn-doc-danger {
    background: #e74c3c;
    color: white;
}
.btn-doc-danger:hover { background: #c0392b; }

/* ---- Breadcrumb ---- */
.doc-breadcrumb {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    font-size: 0.78rem;
}

.doc-bc-item {
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 4px;
    color: var(--accent-color, #3498db);
    font-weight: 600;
    transition: background 0.15s;
    white-space: nowrap;
}
.doc-bc-item:hover { background: rgba(52,152,219,0.1); }
.doc-bc-current {
    color: #64748b;
    cursor: default;
    font-weight: 400;
}
.doc-bc-current:hover { background: transparent; }
.doc-bc-sep { color: #cbd5e1; font-size: 0.6rem; padding: 0 1px; }

/* ---- Toolbar ---- */
.doc-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.doc-count {
    font-size: 0.72rem;
    color: #94a3b8;
}

.doc-view-toggle {
    display: flex;
    gap: 2px;
    background: #f1f5f9;
    border-radius: 6px;
    padding: 2px;
}

.btn-view-toggle {
    background: none;
    border: none;
    padding: 5px 9px;
    border-radius: 4px;
    cursor: pointer;
    color: #94a3b8;
    font-size: 0.82rem;
    transition: all 0.15s;
    line-height: 1;
}
.btn-view-toggle.active {
    background: white;
    color: var(--accent-color, #0a2463);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ---- Contenido ---- */
.doc-content { min-height: 180px; }

.doc-section { margin-bottom: 18px; }

.doc-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    margin-bottom: 7px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ---- Grid (cards) ---- */
.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 10px;
}

/* ---- Lista ---- */
.doc-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* ---- Card: común ---- */
.doc-item-card {
    background: white;
    border-radius: 10px;
    padding: 14px 10px 8px;
    border: 1px solid #e5e7eb;
    transition: all 0.18s;
    position: relative;
    text-align: center;
    overflow: hidden;
}

.doc-folder-item.doc-item-card {
    cursor: pointer;
}
.doc-folder-item.doc-item-card:hover {
    border-color: var(--accent-color, #0a2463);
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}
.doc-file-item.doc-item-card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

.doc-card-icon {
    font-size: 2.4rem;
    margin-bottom: 8px;
    border-radius: 8px;
    padding: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.doc-card-thumb {
    width: 100%;
    height: 90px;
    overflow: hidden;
    border-radius: 7px;
    margin-bottom: 8px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
}
.doc-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.doc-card-thumb.doc-thumb-error {
    color: #cbd5e1;
    font-size: 2rem;
}

.doc-card-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 2px;
}

.doc-card-desc {
    font-size: 0.68rem;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 2px;
}

.doc-card-meta {
    font-size: 0.65rem;
    color: #94a3b8;
}

.doc-card-actions {
    display: none;
    justify-content: center;
    gap: 3px;
    margin-top: 7px;
}
.doc-item-card:hover .doc-card-actions { display: flex; }

/* ---- Lista: común ---- */
.doc-item-list {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    background: white;
    border-radius: 6px;
    border: 1px solid #f1f5f9;
    transition: all 0.14s;
}
.doc-folder-item.doc-item-list { cursor: pointer; }
.doc-folder-item.doc-item-list:hover {
    border-color: var(--accent-color, #0a2463);
    background: #fafbff;
}
.doc-file-item.doc-item-list:hover { background: #fafbff; }

.doc-item-icon-wrap {
    font-size: 1.35rem;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.doc-item-thumb {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 5px;
    overflow: hidden;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}
.doc-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.doc-item-info { flex: 1; min-width: 0; }

.doc-item-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doc-item-meta {
    font-size: 0.68rem;
    color: #94a3b8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doc-item-actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.14s;
    flex-shrink: 0;
}
.doc-item-list:hover .doc-item-actions { opacity: 1; }

/* ---- Botones ícono ---- */
.btn-doc-icon {
    background: none;
    border: none;
    cursor: pointer;
    width: 27px;
    height: 27px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: #64748b;
    font-size: 0.72rem;
    transition: all 0.14s;
}
.btn-doc-icon:hover { background: #f1f5f9; color: #1e293b; }
.btn-delete-folder:hover,
.btn-delete-file:hover  { background: #fee2e2; color: #dc2626; }
.btn-download-file      { text-decoration: none; }
.btn-download-file:hover { background: #dbeafe; color: #2563eb; }

/* ---- Empty state ---- */
.doc-empty {
    text-align: center;
    padding: 50px 20px;
    color: #94a3b8;
}
.doc-empty i { font-size: 3.5rem; display: block; margin-bottom: 10px; opacity: 0.35; }
.doc-empty p  { margin: 4px 0; font-size: 0.88rem; color: #64748b; }
.doc-empty-hint { font-size: 0.78rem; color: #cbd5e1 !important; }

/* ---- Drop zone ---- */
.doc-drop-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(52,152,219,0.1);
    border: 2px dashed #3498db;
    border-radius: 10px;
    z-index: 50;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.doc-drop-overlay.active {
    display: flex;
    pointer-events: all;
}
.doc-drop-message {
    text-align: center;
    color: #3498db;
    font-weight: 700;
}
.doc-drop-message i { font-size: 2.8rem; display: block; margin-bottom: 6px; }

/* ---- Modal ---- */
.doc-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.42);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.doc-modal {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    overflow: hidden;
    animation: docModalIn 0.18s ease;
}

@keyframes docModalIn {
    from { opacity: 0; transform: scale(0.95) translateY(-8px); }
    to   { opacity: 1; transform: scale(1)    translateY(0); }
}

.doc-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid #f1f5f9;
}
.doc-modal-header h3 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: #0a2463;
}
.doc-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    font-size: 0.95rem;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.14s;
}
.doc-modal-close:hover { background: #f1f5f9; color: #475569; }

.doc-modal-body { padding: 18px; }

.doc-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 10px 18px;
    border-top: 1px solid #f1f5f9;
    background: #fafbff;
}

/* ---- Formulario dentro del modal ---- */
.doc-form-group { margin-bottom: 13px; }
.doc-form-group:last-child { margin-bottom: 0; }
.doc-form-group label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 4px;
}

.doc-input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.82rem;
    color: #1e293b;
    background: white;
    box-sizing: border-box;
    transition: border-color 0.14s;
    font-family: inherit;
}
.doc-input:focus {
    outline: none;
    border-color: var(--accent-color, #0a2463);
    box-shadow: 0 0 0 2px rgba(10,36,99,0.07);
}
.doc-textarea { resize: vertical; min-height: 68px; }

/* ---- Opciones de color ---- */
.doc-color-options {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}
.doc-color-opt {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.14s;
    border: 2px solid transparent;
    box-sizing: border-box;
}
.doc-color-opt:hover { transform: scale(1.15); }
.doc-color-opt.selected {
    border-color: #1e293b;
    transform: scale(1.12);
    box-shadow: 0 0 0 2px white inset;
}

/* ---- Texto de advertencia en modal ---- */
.doc-warning {
    color: #dc2626;
    font-size: 0.78rem;
    margin-top: 8px;
    display: flex;
    align-items: flex-start;
    gap: 5px;
}
.doc-warning i { margin-top: 1px; flex-shrink: 0; }

/* ---- Preview de foto ---- */
.doc-photo-preview {
    text-align: center;
    margin-bottom: 6px;
}
.doc-photo-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    object-fit: contain;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.doc-photo-hint {
    text-align: center;
    font-size: 0.72rem;
    color: #94a3b8;
    margin: 4px 0 10px;
}

/* ---- Preview de imagen en modal ---- */
.doc-preview-img {
    text-align: center;
}
.doc-preview-img img {
    max-width: 100%;
    max-height: 65vh;
    border-radius: 8px;
    object-fit: contain;
}

/* ---- Botón papelera ---- */
.btn-papelera {
    background: #f1f5f9;
    color: #64748b;
}
.btn-papelera:hover { background: #fee2e2; color: #dc2626; }

/* ---- Vista papelera ---- */
.doc-trash-hint {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.doc-trash-item { background: #fffbf5; border-color: #fde68a; }
.doc-trash-item:hover { background: #fff8e1; }

.doc-trash-meta { margin-top: 3px; }

.doc-trash-dias {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    background: #fef9c3;
    color: #b45309;
}
.doc-trash-dias.urgent { background: #fee2e2; color: #dc2626; }

.doc-item-meta strong { color: #475569; }

/* ---- Auditoría en vista previa ---- */
.doc-preview-audit {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 8px 10px;
    background: #f8fafc;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #64748b;
    border: 1px solid #e2e8f0;
}
.doc-preview-audit i { color: #94a3b8; flex-shrink: 0; }
.doc-preview-audit strong { color: #1e293b; }

/* ---- Vista previa de documento (no imagen) ---- */
.doc-preview-doc {
    text-align: center;
    padding: 28px 0 12px;
}
.doc-preview-doc i { font-size: 3.5rem; }
.doc-preview-doc-name {
    margin-top: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #1e293b;
    word-break: break-all;
}

/* Responsive en css/responsive/documentacion/{mobile,tablet,desktop}.css */
