@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&display=swap');

body { 
    margin: 0; font-family: 'Inter', sans-serif; 
    background-color: var(--bg-body); color: var(--texto-principal); 
    display: flex; height: 100vh; overflow: hidden; 
}

.sidebar { 
    width: 250px; background: var(--bg-panel); padding: 20px; 
    display: flex; flex-direction: column; border-right: 1px solid var(--border-suave); overflow-y: auto; 
}

.logo { font-size: 1.5rem; font-weight: 800; color: var(--color-primario); margin-bottom: 40px; display: flex; align-items: center; gap: 10px; cursor: pointer; }

.menu-item { padding: 12px; border-radius: 8px; cursor: pointer; color: var(--texto-secundario); transition: 0.2s; display: flex; align-items: center; gap: 10px; margin-bottom: 5px; font-weight: 500;}
.menu-item:hover { background: var(--bg-input-focus); color: var(--color-primario); }
.menu-item.active { background: rgba(227, 6, 19, 0.08); color: var(--color-primario); font-weight: bold; }
.menu-item.drag-over { background: var(--color-primario); color: #fff; transform: scale(1.05); }

.folder-header { margin-top: 30px; margin-bottom: 10px; font-size: 0.8rem; text-transform: uppercase; color: var(--texto-mudo); font-weight: bold; display: flex; justify-content: space-between; align-items: center; }
.btn-add-folder { background: transparent; border: none; color: var(--texto-mudo); cursor: pointer; font-size: 1rem; }
.btn-add-folder:hover { color: var(--color-primario); }

.session-info { margin-top: auto; padding-top: 20px; border-top: 1px solid var(--border-suave); }
.user-card { display: flex; align-items: center; gap: 10px; padding: 10px; background: var(--bg-input-focus); border-radius: 12px; cursor: pointer; transition: 0.2s; margin-bottom: 10px; border: 1px solid transparent; }
.user-card:hover { border-color: var(--border-suave); }
.user-avatar-sidebar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--color-primario); color: #fff; display: flex; justify-content: center; align-items: center; font-weight: bold; font-size: 1.2rem; }
.user-details { display: flex; flex-direction: column; overflow: hidden; }
.user-name { font-weight: bold; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--texto-principal); }
.user-role { font-size: 0.75rem; color: var(--texto-terciario); }

.btn-logout { width: 100%; background: transparent; color: var(--texto-secundario); border: 1px solid var(--border-fuerte); padding: 8px; border-radius: 8px; cursor: pointer; transition: 0.2s; font-size: 0.85rem; font-weight: 600;}
.btn-logout:hover { background: var(--bg-input-focus); color: var(--color-peligro); border-color: var(--color-peligro); }

.main { flex: 1; padding: 40px 0; overflow-y: auto; overflow-x: hidden; }
.main-content-wrapper { padding: 0 40px; }

header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
h1 { margin: 0; font-size: 2rem; color: var(--texto-principal); font-weight: 800; }

.search-container { position: relative; width: 40px; transition: width 0.3s ease, background 0.3s ease, border-color 0.3s ease; flex-shrink: 0; border-radius: 20px; background: var(--bg-elemento); border: 1px solid var(--border-fuerte); }
.search-container.search-expanded { width: 280px; background: var(--bg-input-focus); border-color: var(--color-primario); }
.search-container input { width: 100%; padding: 10px 15px 10px 40px; background: transparent; border: none; color: var(--texto-principal); outline: none; transition: opacity 0.3s ease 0.1s; opacity: 0; }
.search-container.search-expanded input { opacity: 1; }
.search-container i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--texto-oscuro); z-index: 10; cursor: pointer; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }

.card-new { border: 2px dashed var(--border-fuerte); border-radius: 12px; display: flex; flex-direction: column; justify-content: center; align-items: center; height: 200px; cursor: pointer; color: var(--texto-oscuro); transition: 0.2s; background: var(--bg-elemento); }
.card-new:hover { border-color: var(--color-primario); color: var(--color-primario); background: rgba(227, 6, 19, 0.05); transform: translateY(-2px); }

.card { background: var(--bg-elemento); border-radius: 12px; height: 200px; position: relative; transition: 0.2s; cursor: grab; border: 1px solid var(--border-suave); background-size: cover; background-position: center; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.card:hover { transform: translateY(-5px); border-color: var(--border-fuerte); box-shadow: 0 10px 20px rgba(0,0,0,0.1); }

.card-content { position: relative; z-index: 2; padding: 15px 20px; height: 100%; display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.8)); border-radius: 12px; }
.card-content h3 { margin: 0 0 5px 0; font-size: 1.1rem; color: #ffffff; font-weight: 700;}
.card-content p { font-size: 0.8rem; color: #e0e0e0; margin: 0; }
.card-footer { display: flex; justify-content: space-between; align-items: flex-end; font-size: 0.8rem; color: #cccccc; width: 100%; }

.card-creator { font-size: 0.75rem; color: #ffffff; margin-top: 5px; display: flex; align-items: center; gap: 5px; opacity: 0.9; }

.btn-icon { background: transparent; border: none; cursor: pointer; font-size: 1.1rem; transition: 0.2s; padding: 5px; margin-left: 5px;}
.btn-icon:hover { transform: scale(1.2); }
.btn-edit { color: #5cbbf6; } 
.btn-trash { color: #dddddd; } 
.btn-trash:hover { color: #ff4444; }
.btn-restore { color: #28a745 !important; } 
.btn-perm-delete { color: #dc3545 !important; }

.star-icon { position: absolute; top: 15px; right: 15px; cursor: pointer; color: rgba(255,255,255,0.5); z-index: 10; }
.star-icon:hover, .star-icon.active { color: #ffeb3b; transform: scale(1.2); }

/* MODALES BASE (Totalmente en blanco para Fe y Alegría) */
.modal-bg { position: fixed; top:0; left:0; width:100%; height:100%; background: rgba(0,0,0,0.5); display: none; justify-content: center; align-items: center; z-index: 100; backdrop-filter: blur(3px); }
.modal { background: #ffffff; padding: 30px; border-radius: 16px; width: 400px; border: 1px solid var(--border-suave); text-align: center; box-shadow: 0 15px 35px rgba(0,0,0,0.15); }
.modal h2 { margin-top: 0; color: var(--texto-principal); font-weight: 800; margin-bottom: 20px;}
.modal input { width: 100%; padding: 12px; margin-bottom: 20px; background: #f9f9f9; border: 1px solid #ccc; color: #333; border-radius: 8px; outline: none; box-sizing: border-box; font-family: inherit;}
.modal input:focus { border-color: var(--color-primario); background: #fff;}

.btn-create, .btn-save { background: var(--color-primario); color: #fff; border: none; padding: 12px 25px; border-radius: 25px; font-weight: bold; cursor: pointer; width: 100%; transition: 0.2s; }
.btn-create:hover, .btn-save:hover { background: var(--color-primario-hover); transform: translateY(-1px);}
.btn-cancel { background: transparent; border: none; color: var(--texto-secundario); margin-top: 10px; cursor: pointer; width: 100%; font-weight: 600; }
.btn-cancel:hover { color: var(--texto-principal); text-decoration: underline;}

/* Estilos Modal Perfil */
.profile-preview { width: 100px; height: 100px; border-radius: 50%; background: var(--bg-input-focus); margin: 0 auto 20px; display: flex; justify-content: center; align-items: center; overflow: hidden; border: 3px solid var(--color-primario); position: relative; }
.profile-preview img { width: 100%; height: 100%; object-fit: cover; }
.profile-preview i { font-size: 40px; color: var(--texto-oscuro); }

.password-wrapper { position: relative; width: 100%; margin-bottom: 15px; }
.password-wrapper input { margin-bottom: 0; padding-right: 40px; }
.toggle-icon { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); cursor: pointer; color: var(--texto-terciario); z-index: 10; transition: 0.2s; }
.toggle-icon:hover { color: var(--color-primario); }
.tip-profile { font-size: 0.75rem; color: var(--texto-mudo); text-align: left; margin-top: 5px; margin-bottom: 15px; }

/* TABLA ADMIN */
#modalUsuarios .modal { width: 650px; max-width: 90%; max-height: 80vh; overflow-y: auto; text-align: left; }
table { width: 100%; border-collapse: collapse; margin-top: 10px; text-align: left; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--border-suave); font-size: 0.9rem; color: var(--texto-principal); }
th { color: var(--color-primario); border-bottom: 2px solid var(--border-fuerte); font-weight: 700;}
.btn-view-user { color: var(--color-exito); background: none; border: none; cursor: pointer; margin-right: 10px; font-size: 1.1rem; }
.btn-del-user { color: var(--color-peligro); background: none; border: none; cursor: pointer; font-size: 1.1rem; }