/* RAGAR - Estilos Completos */
:root {
  --primary: #1a365d; --primary-dark: #0f2442; --primary-light: #2c5282;
  --secondary: #c53030; --secondary-light: #e53e3e; --accent: #d69e2e;
  --bg-main: #f7f8fc; --bg-card: #ffffff; --bg-sidebar: #1a202c;
  --text-primary: #1a202c; --text-secondary: #4a5568; --text-muted: #718096; --text-light: #a0aec0;
  --border-color: #e2e8f0; --success: #38a169; --warning: #d69e2e; --danger: #e53e3e; --info: #3182ce;
  --sidebar-width: 280px; --header-height: 70px;
  --radius-sm: 6px; --radius-md: 10px; --radius-lg: 16px; --radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08); --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.12); --shadow-xl: 0 20px 60px rgba(0,0,0,0.15);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'DM Sans', sans-serif; background: var(--bg-main); color: var(--text-primary); line-height: 1.6; min-height: 100vh; }
.hidden { display: none !important; }

/* LOGIN */
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; position: relative; }
.login-bg { position: absolute; inset: 0; background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%); }
.login-pattern { position: absolute; inset: 0; background-image: radial-gradient(circle at 20% 80%, rgba(255,255,255,0.03) 0%, transparent 50%); }
.login-container { position: relative; z-index: 1; width: 100%; max-width: 420px; padding: 20px; }
.login-card { background: var(--bg-card); border-radius: var(--radius-xl); padding: 40px 36px 30px; box-shadow: var(--shadow-xl); animation: slideUp 0.6s ease-out; }
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
.login-header { text-align: center; margin-bottom: 28px; }
.logo-icon { width: 70px; height: 70px; margin: 0 auto 16px; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 20px rgba(26, 54, 93, 0.3); overflow: hidden; }
.logo-icon img { width: 85%; height: 85%; object-fit: contain; }
.logo-icon i { font-size: 32px; color: white; }
.login-title { font-family: 'DM Sans', sans-serif; font-size: 32px; font-weight: 800; color: var(--text-primary); letter-spacing: 3px; margin-bottom: 4px; text-transform: uppercase; }
.login-subtitle { font-size: 13px; color: var(--text-secondary); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px; }
.login-org { font-size: 12px; color: var(--text-muted); font-weight: 400; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-form .form-group { display: flex; flex-direction: column; gap: 6px; }
.login-form label { font-size: 12px; font-weight: 600; color: var(--text-secondary); letter-spacing: 0.5px; }
.login-form input { padding: 12px 14px; border: 1.5px solid var(--border-color); border-radius: var(--radius-md); font-size: 14px; font-family: inherit; transition: var(--transition); background: var(--bg-main); }
.login-form input:focus { outline: none; border-color: var(--primary); background: white; box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.08); }
.password-wrapper { position: relative; }
.password-wrapper input { width: 100%; padding-right: 50px; }
.toggle-password { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-muted); cursor: pointer; }
.login-error { color: var(--danger); font-size: 13px; text-align: center; padding: 10px; background: rgba(229, 62, 62, 0.1); border-radius: var(--radius-sm); display: none; }
.login-error.show { display: block; animation: shake 0.5s ease; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.btn-login { margin-top: 6px; padding: 13px 24px; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); color: white; border: none; border-radius: var(--radius-md); font-size: 14px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; transition: var(--transition); box-shadow: 0 4px 15px rgba(26, 54, 93, 0.3); }
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(26, 54, 93, 0.4); }
.login-footer { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border-color); text-align: center; font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.login-footer strong { color: var(--text-secondary); }

/* DASHBOARD */
.dashboard { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-width); background: var(--bg-sidebar); display: flex; flex-direction: column; position: fixed; left: 0; top: 0; bottom: 0; z-index: 100; transition: var(--transition); }
.sidebar-header { padding: 18px 16px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-logo { width: 42px; height: 42px; background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-light) 100%); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; }
.sidebar-logo i { font-size: 20px; color: white; }
.sidebar-brand h2 { color: white; font-size: 20px; font-weight: 700; letter-spacing: 2px; }
.sidebar-brand span { color: var(--text-light); font-size: 12px; display: block; }
.sidebar-nav { flex: 1; padding: 10px 0; overflow-y: auto; }
.sidebar-nav ul { list-style: none; }
.sidebar-nav li { margin: 2px 10px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; color: var(--text-light); text-decoration: none; border-radius: var(--radius-md); transition: var(--transition); font-weight: 500; font-size: 13.5px; }
.nav-item i { font-size: 18px; width: 24px; text-align: center; }
.nav-item:hover { background: rgba(255,255,255,0.08); color: white; }
.nav-item.active { background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-light) 100%); color: white; box-shadow: 0 4px 15px rgba(197, 48, 48, 0.3); }
.sidebar-footer { padding: 12px 14px; border-top: 1px solid rgba(255,255,255,0.1); }
.user-info { display: flex; align-items: center; gap: 10px; padding: 10px; background: rgba(255,255,255,0.05); border-radius: var(--radius-md); margin-bottom: 10px; }
.user-avatar { width: 42px; height: 42px; background: var(--primary-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.user-avatar i { font-size: 18px; color: white; }
.user-name { color: white; font-weight: 600; font-size: 14px; display: block; }
.user-role { color: var(--text-muted); font-size: 12px; }
.btn-logout { width: 100%; padding: 10px; background: rgba(229, 62, 62, 0.1); border: 1px solid rgba(229, 62, 62, 0.3); border-radius: var(--radius-md); color: var(--secondary-light); font-size: 13px; font-weight: 500; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: var(--transition); font-family: inherit; }
.btn-logout:hover { background: var(--secondary); border-color: var(--secondary); color: white; }

.main-content { flex: 1; margin-left: var(--sidebar-width); display: flex; flex-direction: column; min-height: 100vh; }
.main-header { height: var(--header-height); background: var(--bg-card); border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; padding: 0 30px; position: sticky; top: 0; z-index: 50; }
.header-left { display: flex; align-items: center; gap: 20px; }
.btn-menu { display: none; width: 40px; height: 40px; background: var(--bg-main); border: none; border-radius: var(--radius-sm); cursor: pointer; color: var(--text-secondary); font-size: 18px; }
.header-title h1 { font-size: 22px; font-weight: 700; }
.header-title p { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.current-date { font-size: 14px; color: var(--text-secondary); padding: 8px 16px; background: var(--bg-main); border-radius: var(--radius-sm); }
.content-area { flex: 1; padding: 30px; }

/* MODULES */
.module { display: none; animation: fadeIn 0.4s ease; }
.module.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* STATS */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 30px; }
.stat-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 24px; display: flex; align-items: center; gap: 20px; box-shadow: var(--shadow-sm); transition: var(--transition); border: 1px solid var(--border-color); }
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.stat-icon { width: 60px; height: 60px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; }
.stat-icon i { font-size: 26px; color: white; }
.stat-total .stat-icon { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); }
.stat-month .stat-icon { background: linear-gradient(135deg, var(--success) 0%, #48bb78 100%); }
.stat-docs .stat-icon { background: linear-gradient(135deg, var(--info) 0%, #4299e1 100%); }
.stat-active .stat-icon { background: linear-gradient(135deg, var(--accent) 0%, #ecc94b 100%); }
.stat-number { font-size: 32px; font-weight: 700; display: block; line-height: 1; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 6px; display: block; }

.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.recent-card, .info-card { background: var(--bg-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--border-color); overflow: hidden; }
.card-header { padding: 18px 24px; border-bottom: 1px solid var(--border-color); background: var(--bg-main); }
.card-header h3 { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.card-header h3 i { color: var(--primary); }
.card-body { padding: 20px 24px; }
.recent-list { list-style: none; }
.recent-list li { padding: 14px 0; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; gap: 14px; }
.recent-list li:last-child { border-bottom: none; }
.recent-list .empty-state { justify-content: center; flex-direction: column; padding: 40px 0; color: var(--text-muted); }
.recent-list .empty-state i { font-size: 40px; margin-bottom: 10px; opacity: 0.5; }
.info-item { display: flex; align-items: flex-start; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border-color); }
.info-item:last-child { border-bottom: none; }
.info-item i { width: 40px; height: 40px; background: var(--bg-main); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; color: var(--primary); }
.info-item strong { display: block; font-size: 14px; }
.info-item span { font-size: 12px; color: var(--text-muted); }

/* FORM */
.form-container { max-width: 900px; }
.agresor-form { background: var(--bg-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--border-color); overflow: hidden; }
.form-section { padding: 30px; border-bottom: 1px solid var(--border-color); }
.form-section:last-of-type { border-bottom: none; }
.form-section h3 { font-size: 16px; font-weight: 600; margin-bottom: 24px; display: flex; align-items: center; gap: 10px; }
.form-section h3 i { color: var(--primary); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group.full-width { grid-column: 1 / -1; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.form-group input, .form-group textarea, .form-group select { padding: 12px 16px; border: 2px solid var(--border-color); border-radius: var(--radius-md); font-size: 14px; font-family: inherit; transition: var(--transition); }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(26, 54, 93, 0.1); }
.form-group textarea { resize: vertical; min-height: 100px; }

/* FILE INPUT WRAPPER */
.file-input-wrapper { position: relative; }
.file-input-wrapper input[type="file"] { display: none; }
.file-input-btn { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border: 2px solid var(--border-color); border-radius: var(--radius-md); cursor: pointer; transition: var(--transition); background: white; }
.file-input-btn:hover { border-color: var(--primary); background: var(--bg-main); }
.file-input-btn i { color: var(--primary); }
.file-input-btn.has-file { border-color: var(--success); background: rgba(56, 161, 105, 0.1); }
.file-input-btn.has-file i { color: var(--success); }

/* PHOTO UPLOAD */
.photo-upload-area { display: flex; gap: 30px; align-items: center; }
.photo-preview { width: 180px; height: 180px; background: var(--bg-main); border: 2px dashed var(--border-color); border-radius: var(--radius-lg); display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-muted); overflow: hidden; }
.photo-preview i { font-size: 60px; margin-bottom: 10px; opacity: 0.5; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-upload input[type="file"] { display: none; }
.upload-btn { display: inline-flex; align-items: center; gap: 10px; padding: 14px 24px; background: var(--primary); color: white; border-radius: var(--radius-md); cursor: pointer; font-weight: 500; transition: var(--transition); }
.upload-btn:hover { background: var(--primary-dark); }
.upload-hint { margin-top: 12px; font-size: 12px; color: var(--text-muted); }

/* DOCS UPLOAD */
.docs-upload-area { display: flex; flex-direction: column; gap: 20px; }
.docs-dropzone { border: 2px dashed var(--border-color); border-radius: var(--radius-lg); padding: 40px; text-align: center; background: var(--bg-main); transition: var(--transition); }
.docs-dropzone.dragover { border-color: var(--primary); background: rgba(26, 54, 93, 0.05); }
.docs-dropzone i { font-size: 48px; color: var(--text-muted); margin-bottom: 15px; }
.docs-dropzone p { color: var(--text-secondary); margin-bottom: 15px; }
.docs-dropzone input[type="file"] { display: none; }
.upload-btn-secondary { display: inline-block; padding: 12px 24px; background: white; color: var(--primary); border: 2px solid var(--primary); border-radius: var(--radius-md); cursor: pointer; font-weight: 500; transition: var(--transition); }
.upload-btn-secondary:hover { background: var(--primary); color: white; }
.docs-list { display: flex; flex-direction: column; gap: 10px; }
.doc-item { display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: white; border: 1px solid var(--border-color); border-radius: var(--radius-md); }
.doc-item i { font-size: 24px; color: var(--secondary); }
.doc-item .doc-info { flex: 1; }
.doc-item .doc-name { font-weight: 500; display: block; }
.doc-item .doc-size { font-size: 12px; color: var(--text-muted); }
.doc-item .btn-remove { width: 32px; height: 32px; background: rgba(229, 62, 62, 0.1); border: none; border-radius: var(--radius-sm); color: var(--danger); cursor: pointer; transition: var(--transition); }
.doc-item .btn-remove:hover { background: var(--danger); color: white; }

/* FORM ACTIONS */
.form-actions { padding: 24px 30px; background: var(--bg-main); display: flex; justify-content: flex-end; gap: 12px; }
.btn-primary, .btn-secondary, .btn-danger { padding: 12px 24px; border: none; border-radius: var(--radius-md); font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: var(--transition); }
.btn-primary { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); color: white; box-shadow: 0 4px 15px rgba(26, 54, 93, 0.3); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(26, 54, 93, 0.4); }
.btn-secondary { background: white; color: var(--text-secondary); border: 2px solid var(--border-color); }
.btn-secondary:hover { border-color: var(--text-secondary); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #c53030; }

/* LISTADO */
.listado-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.search-box { position: relative; width: 400px; }
.search-box i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.search-box input { width: 100%; padding: 14px 16px 14px 46px; border: 2px solid var(--border-color); border-radius: var(--radius-md); font-size: 14px; font-family: inherit; background: var(--bg-card); transition: var(--transition); }
.search-box input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(26, 54, 93, 0.1); }
.btn-export { padding: 14px 24px; background: var(--success); color: white; border: none; border-radius: var(--radius-md); font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 10px; transition: var(--transition); }
.btn-export:hover { background: #2f855a; transform: translateY(-2px); }

.table-container { background: var(--bg-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--border-color); overflow: hidden; }
.agresores-table { width: 100%; border-collapse: collapse; }
.agresores-table th { background: var(--bg-main); padding: 16px 20px; text-align: left; font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border-color); }
.agresores-table td { padding: 16px 20px; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
.agresores-table tbody tr:hover { background: rgba(26, 54, 93, 0.02); }
.foto-cell { width: 60px; }
.foto-cell img { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border-color); }
.foto-cell .no-photo { width: 50px; height: 50px; border-radius: 50%; background: var(--bg-main); display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.docs-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: var(--bg-main); border-radius: 20px; font-size: 12px; color: var(--text-secondary); }
.link-resolucion { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: rgba(197, 48, 48, 0.1); color: var(--secondary); border-radius: var(--radius-sm); text-decoration: none; font-size: 12px; font-weight: 500; transition: var(--transition); }
.link-resolucion:hover { background: var(--secondary); color: white; }
.link-doc { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); text-decoration: none; font-weight: 500; }
.link-doc:hover { text-decoration: underline; }
.action-btns { display: flex; gap: 8px; }
.btn-action { width: 36px; height: 36px; border: none; border-radius: var(--radius-sm); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.btn-view { background: rgba(49, 130, 206, 0.1); color: var(--info); }
.btn-view:hover { background: var(--info); color: white; }
.btn-delete { background: rgba(229, 62, 62, 0.1); color: var(--danger); }
.btn-delete:hover { background: var(--danger); color: white; }
.empty-row td { text-align: center; padding: 60px 20px; }
.empty-state { display: flex; flex-direction: column; align-items: center; color: var(--text-muted); }
.empty-state i { font-size: 48px; margin-bottom: 15px; opacity: 0.5; }

/* PAGINATION */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 24px; }
.pagination button { width: 40px; height: 40px; border: 1px solid var(--border-color); background: var(--bg-card); border-radius: var(--radius-sm); cursor: pointer; font-family: inherit; font-weight: 500; color: var(--text-secondary); transition: var(--transition); }
.pagination button:hover, .pagination button.active { background: var(--primary); border-color: var(--primary); color: white; }

/* REPORTES */
.reportes-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.reportes-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 1400px) { .reportes-grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .reportes-grid-4 { grid-template-columns: 1fr; } }
.reporte-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 25px 20px; text-align: center; box-shadow: var(--shadow-sm); border: 1px solid var(--border-color); display: flex; flex-direction: column; align-items: center; }
.reporte-icon { width: 60px; height: 60px; margin-bottom: 15px; background: linear-gradient(135deg, var(--success) 0%, #48bb78 100%); border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.reporte-icon i { font-size: 26px; color: white; }
.reporte-card h3 { font-size: 16px; margin-bottom: 8px; }
.reporte-card p { font-size: 13px; color: var(--text-muted); margin-bottom: 15px; }
.reporte-card button { width: 100%; }
.date-range { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 24px; }
.date-range input { padding: 10px 14px; border: 2px solid var(--border-color); border-radius: var(--radius-sm); font-family: inherit; }
.date-range span { color: var(--text-muted); }
.date-range-compact { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-bottom: 15px; }
.date-range-compact input { padding: 10px; border: 2px solid var(--border-color); border-radius: var(--radius-sm); font-family: inherit; font-size: 13px; }

/* Certificados */
.reporte-certificado { border: 2px solid var(--secondary); }
.reporte-certificado .icon-pdf { background: linear-gradient(135deg, var(--secondary) 0%, #E53E3E 100%) !important; }
.btn-pdf { background: var(--secondary) !important; }
.btn-pdf:hover { background: #9B2C2C !important; }
.certificado-form { width: 100%; margin-bottom: 15px; display: flex; flex-direction: column; gap: 8px; }
.certificado-form input { width: 100%; padding: 10px 12px; border: 2px solid var(--border-color); border-radius: var(--radius-sm); font-size: 13px; font-family: inherit; }
.certificado-form input:focus { outline: none; border-color: var(--secondary); }

/* Formulario terceros */
.icon-form { background: linear-gradient(135deg, #805AD5 0%, #9F7AEA 100%) !important; }
.btn-form { background: #805AD5 !important; }
.btn-form:hover { background: #6B46C1 !important; }

/* Calendario */
.icon-calendar { background: linear-gradient(135deg, var(--primary) 0%, #2D4A7C 100%) !important; }

/* MODALES */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.modal.show { display: flex; animation: fadeIn 0.3s ease; }
.modal-content { background: var(--bg-card); border-radius: var(--radius-lg); width: 100%; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; animation: slideUp 0.3s ease; }
.modal-small { max-width: 450px; }
.modal-large { max-width: 800px; }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; background: var(--bg-main); }
.modal-header-danger { background: rgba(229, 62, 62, 0.1); }
.modal-header-danger h2 { color: var(--danger); }
.modal-header-edit { background: rgba(59, 130, 246, 0.1); }
.modal-header-edit h2 { color: var(--info); }
.modal-header h2 { font-size: 18px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.modal-close { width: 36px; height: 36px; background: none; border: none; border-radius: var(--radius-sm); cursor: pointer; color: var(--text-muted); transition: var(--transition); }
.modal-close:hover { background: var(--border-color); color: var(--text-primary); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 12px; background: var(--bg-main); }
.text-danger { color: var(--danger); }

/* FORM EDITAR */
.form-editar .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.form-editar .form-group { display: flex; flex-direction: column; gap: 6px; }
.form-editar .form-group.full { grid-column: 1 / -1; }
.form-editar label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.form-editar input, .form-editar textarea { padding: 10px 12px; border: 2px solid var(--border-color); border-radius: var(--radius-sm); font-size: 14px; font-family: inherit; transition: var(--transition); }
.form-editar input:focus, .form-editar textarea:focus { outline: none; border-color: var(--info); }
.form-editar input[type="file"] { padding: 8px; }
.form-editar .current-file { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-editar .current-file a { color: var(--info); }
.edit-note { margin-top: 15px; padding: 12px; background: rgba(59, 130, 246, 0.1); border-radius: var(--radius-sm); font-size: 13px; color: var(--info); display: flex; align-items: center; gap: 8px; }
@media (max-width: 600px) { .form-editar .form-row { grid-template-columns: 1fr; } }

/* Botón editar en tabla */
.btn-edit { background: var(--info); color: white; }
.btn-edit:hover { background: #2563EB; }

/* DETALLES */
.detalle-grid { display: grid; grid-template-columns: 200px 1fr; gap: 30px; }
.detalle-foto img { width: 180px; height: 180px; border-radius: var(--radius-lg); object-fit: cover; border: 3px solid var(--border-color); }
.detalle-foto .no-photo { width: 180px; height: 180px; border-radius: var(--radius-lg); background: var(--bg-main); display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-muted); }
.detalle-foto .no-photo i { font-size: 60px; margin-bottom: 10px; }
.detalle-info { display: flex; flex-direction: column; gap: 16px; }
.detalle-item { display: grid; grid-template-columns: 120px 1fr; gap: 10px; }
.detalle-item .label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }
.detalle-item .value { font-size: 14px; }
.detalle-descripcion { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border-color); }
.detalle-descripcion h4 { font-size: 14px; font-weight: 600; color: var(--text-secondary); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.detalle-descripcion p { font-size: 14px; line-height: 1.7; background: var(--bg-main); padding: 16px; border-radius: var(--radius-md); }
.detalle-documentos { margin-top: 24px; }
.detalle-documentos h4 { font-size: 14px; font-weight: 600; color: var(--text-secondary); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.docs-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.doc-link { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--bg-main); border-radius: var(--radius-md); text-decoration: none; color: var(--text-primary); transition: var(--transition); }
.doc-link:hover { background: var(--primary); color: white; }
.doc-link i { font-size: 20px; }

/* TOAST */
#toast-container { position: fixed; top: 60px; right: 20px; z-index: 9998; display: flex; flex-direction: column; gap: 10px; }
.toast { padding: 16px 20px; background: var(--bg-card); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 12px; min-width: 300px; animation: slideInRight 0.3s ease; transition: var(--transition); }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.info { border-left: 4px solid var(--info); }
.toast i { font-size: 20px; }
.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }
.toast.warning i { color: var(--warning); }
.toast.info i { color: var(--info); }

/* LOADING */
.loading-overlay { position: fixed; inset: 0; background: rgba(255, 255, 255, 0.9); display: flex; align-items: center; justify-content: center; z-index: 3000; }
.loading-spinner { text-align: center; }
.loading-spinner i { font-size: 48px; color: var(--primary); margin-bottom: 15px; }
.loading-spinner span { display: block; color: var(--text-secondary); font-weight: 500; }

/* REINCIDENTES Y CASOS */
.reincidente-row { background: rgba(229, 62, 62, 0.05); }
.casos-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: var(--bg-main); border-radius: 20px; font-size: 12px; }
.casos-badge.reincidente { background: rgba(229, 62, 62, 0.15); color: var(--danger); font-weight: 600; }
.casos-badge i { font-size: 11px; }
.casos-badge .fa-exclamation-triangle { color: var(--danger); margin-left: 4px; }
.casos-badge-detail { display: inline-block; padding: 3px 10px; background: var(--bg-main); border-radius: 12px; font-size: 13px; }
.casos-badge-detail.reincidente { background: rgba(229, 62, 62, 0.15); color: var(--danger); font-weight: 600; }
.reincidente-tag { display: inline-flex; align-items: center; gap: 5px; margin-left: 10px; padding: 3px 10px; background: var(--danger); color: white; border-radius: 12px; font-size: 11px; font-weight: 600; }

/* CASOS EN MODAL DETALLES */
.detalle-casos { margin-top: 24px; }
.detalle-casos h4 { font-size: 14px; font-weight: 600; color: var(--text-secondary); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.casos-list { display: flex; flex-direction: column; gap: 12px; }
.caso-item { background: var(--bg-main); border-radius: var(--radius-md); padding: 16px; border-left: 4px solid var(--primary); }
.caso-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.caso-numero { font-weight: 600; color: var(--primary); display: flex; align-items: center; gap: 6px; }
.caso-fecha { font-size: 12px; color: var(--text-muted); }
.caso-descripcion { font-size: 13px; line-height: 1.6; color: var(--text-primary); margin-bottom: 10px; }
.caso-docs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.docs-label { font-size: 12px; color: var(--text-muted); margin-right: 5px; }
.doc-link-small { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; background: var(--bg-card); border-radius: var(--radius-sm); font-size: 11px; color: var(--primary); text-decoration: none; }
.doc-link-small:hover { background: var(--primary); color: white; }
.no-casos { color: var(--text-muted); font-style: italic; padding: 20px; text-align: center; }

/* RESPONSIVE */
@media (max-width: 1200px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 992px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .btn-menu { display: flex; }
  .dashboard-grid, .form-row, .reportes-grid { grid-template-columns: 1fr; }
  .photo-upload-area { flex-direction: column; text-align: center; }
  .detalle-grid { grid-template-columns: 1fr; text-align: center; }
  .docs-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .login-card { padding: 35px 25px; }
  .login-title { font-size: 32px; }
  .stats-grid { grid-template-columns: 1fr; }
  .listado-header { flex-direction: column; gap: 16px; }
  .search-box { width: 100%; }
  .btn-export { width: 100%; justify-content: center; }
  .content-area { padding: 20px 15px; }
}

/* MÓDULO DATOS SENSIBLES */
.sensibles-locked { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; text-align: center; }
.sensibles-locked .lock-icon { width: 100px; height: 100px; background: linear-gradient(135deg, #805AD5 0%, #9F7AEA 100%); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 24px; }
.sensibles-locked .lock-icon i { font-size: 40px; color: white; }
.sensibles-locked h3 { font-size: 24px; margin-bottom: 12px; color: var(--text-primary); }
.sensibles-locked p { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }
.pin-form { display: flex; gap: 12px; }
.pin-form input { padding: 12px 16px; border: 2px solid var(--border-color); border-radius: var(--radius-sm); font-size: 16px; width: 200px; text-align: center; letter-spacing: 2px; }
.pin-form input:focus { outline: none; border-color: #805AD5; }
.sensibles-unlocked { display: block; }
.sensibles-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border-color); }
.sensibles-header h3 { font-size: 18px; display: flex; align-items: center; gap: 10px; }
.auditoria-table img { width: 60px; height: 60px; border-radius: var(--radius-sm); object-fit: cover; }

/* MODAL ELIMINAR CON AUDITORÍA */
.eliminar-warning { background: rgba(229, 62, 62, 0.1); padding: 16px; border-radius: var(--radius-md); margin-bottom: 24px; display: flex; align-items: flex-start; gap: 12px; }
.eliminar-warning i { font-size: 24px; color: var(--danger); }
.eliminar-warning p { font-size: 14px; color: var(--danger); margin: 0; }
.auditoria-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.auditoria-form .form-group { display: flex; flex-direction: column; gap: 8px; }
.auditoria-form label { font-size: 13px; font-weight: 600; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }
.auditoria-form input { padding: 12px; border: 2px solid var(--border-color); border-radius: var(--radius-sm); font-size: 14px; }
.auditoria-form input:focus { outline: none; border-color: var(--primary); }

/* CÁMARA */
.camera-container { position: relative; width: 100%; max-width: 400px; aspect-ratio: 4/3; background: #1a1a2e; border-radius: var(--radius-md); overflow: hidden; margin-bottom: 12px; }
.camera-container video, .camera-container img { width: 100%; height: 100%; object-fit: cover; }
.camera-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #666; }
.camera-placeholder i { font-size: 48px; margin-bottom: 12px; }
.camera-controls { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.camera-controls button { flex: 1; min-width: 120px; }
.face-status { padding: 10px; border-radius: var(--radius-sm); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.face-status.detecting { background: rgba(59, 130, 246, 0.1); color: var(--info); }
.face-status.success { background: rgba(72, 187, 120, 0.1); color: var(--success); }
.face-status.error { background: rgba(229, 62, 62, 0.1); color: var(--danger); }
.face-status i { font-size: 16px; }

@media (max-width: 600px) {
  .auditoria-form .form-row { grid-template-columns: 1fr; }
  .pin-form { flex-direction: column; }
  .pin-form input { width: 100%; }
}

/* INDICADOR DE CONEXIÓN */
.connection-status { position: fixed; top: 0; left: 0; right: 0; z-index: 9999; background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%); color: white; padding: 10px 20px; display: flex; justify-content: center; align-items: center; box-shadow: 0 2px 10px rgba(0,0,0,0.2); animation: slideDown 0.3s ease; }
.connection-status.online { background: linear-gradient(135deg, #48bb78 0%, #38a169 100%); }
.connection-status.hidden { display: none; }
.connection-content { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; }
.connection-content i { font-size: 16px; }
.pending-count { background: rgba(255,255,255,0.2); padding: 2px 10px; border-radius: 12px; font-size: 12px; }
@keyframes slideDown { from { transform: translateY(-100%); } to { transform: translateY(0); } }

/* HISTORIAL DE ACTUALIZACIONES */
.changelog-card { background: var(--bg-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); margin-top: 24px; }
.changelog-card .card-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--border-color); }
.changelog-card .card-header h3 { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 10px; color: var(--text-primary); }
.version-badge { background: linear-gradient(135deg, var(--primary) 0%, #2d5a87 100%); color: white; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.changelog-table { padding: 16px 24px; }
.changelog-header { display: grid; grid-template-columns: 80px 100px 1fr; gap: 16px; padding: 12px 0; border-bottom: 2px solid var(--border-color); font-weight: 600; font-size: 13px; color: var(--text-secondary); }
.changelog-row { display: grid; grid-template-columns: 80px 100px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border-color); font-size: 13px; align-items: start; }
.changelog-row:last-child { border-bottom: none; }
.changelog-row .version { font-weight: 600; color: var(--primary); }
.changelog-row .date { color: var(--text-muted); }
.changelog-row .desc { color: var(--text-primary); line-height: 1.5; }

/* MODAL OFFLINE */
.modal-offline { text-align: center; padding: 20px; }
.modal-offline .offline-icon { width: 80px; height: 80px; background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; }
.modal-offline .offline-icon i { font-size: 36px; color: white; }
.modal-offline h3 { font-size: 18px; margin-bottom: 12px; color: var(--text-primary); }
.modal-offline p { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin-bottom: 8px; }
.modal-offline .warning-text { background: rgba(237, 137, 54, 0.1); padding: 12px; border-radius: var(--radius-sm); margin-top: 16px; color: #c05621; font-size: 13px; }

/* PWA Install Banner */
.pwa-install-banner { position: fixed; bottom: 20px; left: 20px; right: 20px; background: var(--bg-card); border-radius: var(--radius-lg); box-shadow: 0 4px 20px rgba(0,0,0,0.15); padding: 16px 20px; display: flex; align-items: center; gap: 16px; z-index: 9998; animation: slideUp 0.3s ease; }
.pwa-install-banner.hidden { display: none; }
.pwa-install-banner .pwa-icon { width: 50px; height: 50px; background: linear-gradient(135deg, var(--primary) 0%, #2d5a87 100%); border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.pwa-install-banner .pwa-icon i { font-size: 24px; color: white; }
.pwa-install-banner .pwa-text { flex: 1; }
.pwa-install-banner .pwa-text h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.pwa-install-banner .pwa-text p { font-size: 12px; color: var(--text-muted); }
.pwa-install-banner .pwa-actions { display: flex; gap: 8px; }
.pwa-install-banner .btn-install { background: var(--primary); color: white; border: none; padding: 8px 16px; border-radius: var(--radius-sm); font-size: 13px; cursor: pointer; }
.pwa-install-banner .btn-dismiss { background: transparent; border: none; color: var(--text-muted); padding: 8px; cursor: pointer; font-size: 16px; }
@keyframes slideUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@media (max-width: 768px) {
  .changelog-header, .changelog-row { grid-template-columns: 60px 80px 1fr; gap: 10px; font-size: 12px; }
  .pwa-install-banner { flex-direction: column; text-align: center; }
  .pwa-install-banner .pwa-actions { width: 100%; justify-content: center; }
}

/* MÓDULO CONFIGURACIÓN */
.config-unlocked { display: block; }
.config-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border-color); }
.config-header h3 { font-size: 18px; display: flex; align-items: center; gap: 10px; }
.config-section { background: var(--bg-card); border-radius: var(--radius-md); padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.config-section h4 { font-size: 16px; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; color: var(--text-primary); }
.config-section h4 i { color: var(--primary); }
.config-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.config-form { display: flex; flex-direction: column; gap: 16px; max-width: 400px; }
.config-form .form-group { display: flex; flex-direction: column; gap: 6px; }
.config-form label { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.config-form input { padding: 10px 14px; border: 2px solid var(--border-color); border-radius: var(--radius-sm); font-size: 14px; transition: var(--transition); }
.config-form input:focus { outline: none; border-color: var(--primary); }

/* Sesiones Activas */
.sessions-list { display: flex; flex-direction: column; gap: 12px; }
.session-item { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; background: var(--bg-main); border-radius: var(--radius-sm); border: 1px solid var(--border-color); }
.session-info { display: flex; align-items: center; gap: 14px; }
.session-icon { width: 40px; height: 40px; background: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; }
.session-details { display: flex; flex-direction: column; }
.session-device { font-weight: 600; font-size: 14px; color: var(--text-primary); }
.session-ip { font-size: 12px; color: var(--text-muted); }
.session-time { font-size: 11px; color: var(--text-light); }
.session-current { background: rgba(56, 161, 105, 0.1); border-color: var(--success); }
.session-current .session-icon { background: var(--success); }
.btn-expulsar { background: var(--danger); color: white; border: none; padding: 6px 12px; border-radius: var(--radius-sm); font-size: 12px; cursor: pointer; display: flex; align-items: center; gap: 6px; transition: var(--transition); }
.btn-expulsar:hover { background: #c53030; }
.loading-sessions { text-align: center; padding: 20px; color: var(--text-muted); }

/* NOTIFICACIÓN DE CONEXIÓN OPTIMIZADA */
.connection-toast { position: fixed; bottom: 20px; left: 20px; background: #e53e3e; color: white; padding: 10px 16px; border-radius: 8px; font-size: 12px; font-weight: 500; display: flex; align-items: center; gap: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); z-index: 9999; animation: fadeInUp 0.3s ease; }
.connection-toast.online { background: #38a169; }
.connection-toast.hidden { display: none; }
.connection-toast i { font-size: 14px; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 600px) {
  .config-form { max-width: 100%; }
  .session-item { flex-direction: column; gap: 12px; align-items: flex-start; }
  .btn-expulsar { width: 100%; justify-content: center; }
}

/* MÓDULO API INSTITUCIONAL */
.api-unlocked { display: block; }
.api-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border-color); }
.api-header h3 { font-size: 18px; display: flex; align-items: center; gap: 10px; }
.api-info-card { background: linear-gradient(135deg, #EBF8FF 0%, #BEE3F8 100%); border: 1px solid #90CDF4; border-radius: var(--radius-md); padding: 20px; margin-bottom: 24px; }
.api-info-card h4 { font-size: 14px; color: #2B6CB0; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.api-endpoint { background: #1A365D; border-radius: var(--radius-sm); padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.api-endpoint code { color: #90CDF4; font-family: monospace; font-size: 12px; word-break: break-all; }
.btn-copy { background: transparent; border: 1px solid #4A5568; color: white; padding: 6px 10px; border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition); }
.btn-copy:hover { background: #4A5568; }
.api-note { font-size: 12px; color: #2B6CB0; }
.api-note code { background: rgba(43, 108, 176, 0.1); padding: 2px 6px; border-radius: 4px; }
.api-section { background: var(--bg-card); border-radius: var(--radius-md); padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.api-section h4 { font-size: 16px; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; color: var(--text-primary); }
.api-section h4 i { color: #3182CE; }
.api-keys-list { display: flex; flex-direction: column; gap: 12px; }
.api-key-item { display: flex; align-items: center; justify-content: space-between; padding: 16px; background: var(--bg-main); border-radius: var(--radius-sm); border: 1px solid var(--border-color); }
.api-key-info { display: flex; align-items: center; gap: 14px; flex: 1; }
.api-key-icon { width: 45px; height: 45px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: white; font-size: 18px; }
.api-key-icon.policia { background: linear-gradient(135deg, #2B6CB0 0%, #1A365D 100%); }
.api-key-icon.fiscalia { background: linear-gradient(135deg, #9F7AEA 0%, #6B46C1 100%); }
.api-key-icon.corte { background: linear-gradient(135deg, #ED8936 0%, #C05621 100%); }
.api-key-details { flex: 1; }
.api-key-name { font-weight: 600; font-size: 14px; color: var(--text-primary); display: block; }
.api-key-value { font-family: monospace; font-size: 11px; color: var(--text-muted); background: var(--bg-card); padding: 4px 8px; border-radius: 4px; display: inline-block; margin-top: 4px; }
.api-key-stats { font-size: 11px; color: var(--text-light); margin-top: 4px; }
.api-key-actions { display: flex; align-items: center; gap: 10px; }
.api-key-status { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.api-key-status.activa { background: rgba(56, 161, 105, 0.1); color: #38A169; }
.api-key-status.inactiva { background: rgba(229, 62, 62, 0.1); color: #E53E3E; }
.btn-toggle-api { background: transparent; border: 1px solid var(--border-color); padding: 6px 12px; border-radius: var(--radius-sm); font-size: 12px; cursor: pointer; transition: var(--transition); }
.btn-toggle-api:hover { background: var(--bg-main); }
.resultado-badge { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.resultado-badge.con { background: rgba(229, 62, 62, 0.1); color: #E53E3E; }
.resultado-badge.sin { background: rgba(56, 161, 105, 0.1); color: #38A169; }

@media (max-width: 768px) {
  .api-endpoint { flex-direction: column; align-items: flex-start; }
  .api-key-item { flex-direction: column; gap: 12px; align-items: flex-start; }
  .api-key-actions { width: 100%; justify-content: space-between; }
}

/* ============================================ */
/* RAGAN v0.1.0 - ESTILOS NUEVOS              */
/* ============================================ */

/* NAV DIVIDERS */
.nav-divider { height: 1px; background: rgba(255,255,255,0.08); margin: 8px 16px !important; }

/* USER AVATAR CON LETRA */
.user-avatar { width: 36px; height: 36px; background: var(--primary-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; font-size: 15px; }

/* PAGE HEADER ROW */
.page-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.breadcrumb-text { font-size: 13px; color: var(--text-muted); }

/* STATUS BADGES */
.status-badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.status-activo { background: rgba(56, 161, 105, 0.15); color: #38A169; }
.status-inactivo { background: rgba(229, 62, 62, 0.15); color: #E53E3E; }

/* PERMISOS DE MODULOS */
.permisos-section { background: var(--bg-card); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm); border: 1px solid var(--border-color); }
.permisos-section h3 { font-size: 16px; margin-bottom: 16px; }
.permisos-select { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.permisos-select select { padding: 10px 14px; border: 2px solid var(--border-color); border-radius: var(--radius-sm); font-size: 14px; font-family: inherit; min-width: 300px; }
.permisos-select select:focus { outline: none; border-color: var(--primary); }
#permisos-container { margin-top: 20px; }
#permisos-admin-msg { background: rgba(59, 130, 246, 0.1); padding: 16px; border-radius: var(--radius-sm); color: var(--info); font-size: 14px; display: flex; align-items: center; gap: 10px; }
#permisos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 20px; }
.permiso-item { background: var(--bg-main); padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border-color); }
.permiso-label { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; font-weight: 500; }
.permiso-label input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
#btn-guardar-permisos { margin-top: 16px; }

/* CONFIGURACION - LOGO */
.config-logo-section { display: flex; gap: 30px; align-items: flex-start; flex-wrap: wrap; }
.logo-preview-area { display: flex; flex-direction: column; align-items: center; gap: 12px; }
#logoPreview { width: 120px; height: 120px; border-radius: 50%; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); display: flex; align-items: center; justify-content: center; overflow: hidden; border: 3px solid var(--border-color); }
#logoPreview img { width: 100%; height: 100%; object-fit: cover; }
#logoStatus { font-size: 12px; color: var(--text-muted); text-align: center; }
.logo-upload-form { flex: 1; min-width: 250px; display: flex; flex-direction: column; gap: 12px; }
.logo-upload-form input[type="file"] { padding: 10px; border: 2px solid var(--border-color); border-radius: var(--radius-sm); font-size: 13px; }
.logo-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-outline { padding: 10px 18px; background: transparent; border: 2px solid var(--border-color); border-radius: var(--radius-md); font-size: 13px; font-weight: 500; cursor: pointer; transition: var(--transition); font-family: inherit; color: var(--text-secondary); }
.btn-outline:hover { border-color: var(--text-secondary); background: var(--bg-main); }

/* COPIAS DE SEGURIDAD */
.backup-main { margin-bottom: 24px; }
.backup-main button { width: 100%; padding: 16px; font-size: 15px; }
.backup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-top: 20px; }
.backup-card { background: var(--bg-card); border-radius: var(--radius-md); padding: 20px; text-align: center; box-shadow: var(--shadow-sm); border: 1px solid var(--border-color); display: flex; flex-direction: column; gap: 10px; }
.backup-card h4 { font-size: 14px; color: var(--text-primary); }
.backup-card p { font-size: 12px; color: var(--text-muted); }
.backup-card button { width: 100%; padding: 8px; font-size: 12px; }

/* INFO GRID PARA CONFIGURACION */
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.info-box { background: var(--bg-main); padding: 16px; border-radius: var(--radius-sm); border: 1px solid var(--border-color); }
.info-box label { font-size: 11px; text-transform: uppercase; color: var(--text-muted); font-weight: 600; display: block; margin-bottom: 6px; }
.info-box span { font-size: 14px; font-weight: 500; color: var(--text-primary); }

/* CAMBIAR CONTRASENA */
.password-form { background: var(--bg-card); border-radius: var(--radius-lg); padding: 30px; max-width: 500px; box-shadow: var(--shadow-sm); border: 1px solid var(--border-color); }
.password-form .form-group { margin-bottom: 16px; }
.password-form label { font-size: 13px; font-weight: 600; color: var(--text-secondary); display: block; margin-bottom: 6px; }
.password-form input { width: 100%; padding: 12px 14px; border: 2px solid var(--border-color); border-radius: var(--radius-sm); font-size: 14px; font-family: inherit; }
.password-form input:focus { outline: none; border-color: var(--primary); }
.password-form button { margin-top: 10px; }

@media (max-width: 768px) {
  #permisos-grid { grid-template-columns: 1fr; }
  .config-logo-section { flex-direction: column; }
  .backup-grid { grid-template-columns: 1fr 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .permisos-select select { min-width: 100%; }
}
@media (max-width: 480px) {
  .backup-grid { grid-template-columns: 1fr; }
}

/* Backup Items */
.backup-item { background: var(--bg-main); padding: 18px; border-radius: var(--radius-md); border: 1px solid var(--border-color); display: flex; flex-direction: column; gap: 8px; }
.backup-item-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.backup-item-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; flex: 1; }
.btn-sm { padding: 8px 14px !important; font-size: 12px !important; }

/* Info Box */
.info-box-label { font-size: 11px; text-transform: uppercase; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; letter-spacing: 0.5px; }
.info-box-value { font-size: 14px; font-weight: 500; color: var(--text-primary); }

/* Permisos grid class used in HTML */
.permisos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }

/* Select styling for permisos */
#permisos-user-select { width: 100%; padding: 10px 14px; border: 2px solid var(--border-color); border-radius: var(--radius-sm); font-size: 14px; font-family: inherit; }
#permisos-user-select:focus { outline: none; border-color: var(--primary); }

/* USER ACTIONS - Tabla de usuarios */
.user-actions { display: flex; gap: 6px; align-items: center; }
.btn-user-action { width: 32px; height: 32px; border: none; border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; font-size: 13px; }
.btn-user-edit { background: rgba(59, 130, 246, 0.1); color: #3B82F6; }
.btn-user-edit:hover { background: #3B82F6; color: white; }
.btn-user-pause { background: rgba(245, 158, 11, 0.1); color: #F59E0B; }
.btn-user-pause:hover { background: #F59E0B; color: white; }
.btn-user-activate { background: rgba(16, 185, 129, 0.1); color: #10B981; }
.btn-user-activate:hover { background: #10B981; color: white; }
.btn-user-delete { background: rgba(239, 68, 68, 0.1); color: #EF4444; }
.btn-user-delete:hover { background: #EF4444; color: white; }

/* RESTAURACION MODULE */
.restore-dropzone { border: 2px dashed var(--border-color); border-radius: var(--radius-lg); padding: 40px; text-align: center; background: var(--bg-main); transition: var(--transition); cursor: pointer; }
.restore-dropzone:hover { border-color: var(--primary); background: rgba(26, 54, 93, 0.03); }
.restore-dropzone.dragover { border-color: var(--primary); background: rgba(26, 54, 93, 0.05); }
.restore-dropzone input[type="file"] { display: none; }
.restore-preview { margin-top: 20px; }
.restore-table-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--bg-main); border-radius: var(--radius-sm); border: 1px solid var(--border-color); margin-bottom: 8px; }
.restore-table-name { font-weight: 600; font-size: 14px; }
.restore-table-count { font-size: 12px; color: var(--text-muted); }
.restore-table-check { display: flex; align-items: center; gap: 8px; }
.restore-table-check input { width: 16px; height: 16px; accent-color: var(--primary); }
.restore-warning { background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.3); border-radius: var(--radius-md); padding: 16px; margin: 16px 0; display: flex; align-items: flex-start; gap: 12px; font-size: 13px; color: #92400E; }
.restore-warning i { font-size: 18px; color: #F59E0B; margin-top: 2px; }
