/* =====================================================
   ESTILOS DEL PANEL DE ADMINISTRACIÓN
   Municipalidad Provincial de Santa Cruz
   ===================================================== */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #0891b2;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text: #1e293b;
    --text-light: #64748b;
    --bg: #f8fafc;
    --bg-alt: #f1f5f9;
    --white: #ffffff;
    --border: #e2e8f0;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-md: rgba(0, 0, 0, 0.15);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.3s ease;
    --sidebar-width: 260px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

body.has-sidebar { display: flex; }

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--white);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text);
}

.sidebar-logo img { height: 40px; }
.sidebar-logo span { font-weight: 700; font-size: 1.125rem; }

.sidebar-nav { flex: 1; padding: 1rem 0; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition);
    border-left: 3px solid transparent;
}

.nav-item:hover { background: var(--bg); color: var(--primary); }

.nav-item.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}

.nav-icon { font-size: 1.25rem; }

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
}

.admin-info { display: flex; align-items: center; gap: 0.75rem; }
.admin-avatar { font-size: 1.5rem; }
.admin-details { display: flex; flex-direction: column; }
.admin-name { font-weight: 600; font-size: 0.875rem; color: var(--text); }
.logout-link { font-size: 0.8125rem; color: var(--danger); text-decoration: none; }
.logout-link:hover { text-decoration: underline; }

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
    min-height: 100vh;
}

/* LOGIN */
.login-page {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    min-height: 100vh;
}

.login-container { width: 100%; max-width: 420px; }

.login-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-header { text-align: center; margin-bottom: 2rem; }
.login-logo img { height: 80px; margin-bottom: 1rem; }
.login-header h1 { font-size: 1.5rem; color: var(--text); margin-bottom: 0.25rem; }
.login-header p { color: var(--text-light); font-size: 0.9375rem; }
.login-form { display: flex; flex-direction: column; gap: 1.25rem; }
.login-footer { margin-top: 1.5rem; text-align: center; }
.login-footer a { color: var(--primary); text-decoration: none; font-size: 0.875rem; }

/* CONTENIDO */
.container { max-width: 1200px; margin: 0 auto; }

.breadcrumb-admin { margin-bottom: 1.5rem; }
.breadcrumb-admin a { color: var(--primary); text-decoration: none; font-size: 0.9375rem; font-weight: 500; }
.breadcrumb-admin a:hover { text-decoration: underline; }

.page-header-admin {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header-admin h1 { font-size: 1.75rem; color: var(--text); margin-bottom: 0.25rem; }
.page-header-admin p { color: var(--text-light); }

/* ESTADÍSTICAS */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-bottom: 2rem; }
.stats-grid.stats-4 { grid-template-columns: repeat(4, 1fr); }

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 8px var(--shadow);
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.stat-card:hover { transform: translateY(-4px); box-shadow: 0 8px 20px var(--shadow-md); }

.stat-icon {
    font-size: 2rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--bg);
}

.stat-icon.stat-resolucion { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.stat-icon.stat-ordenanza { background: linear-gradient(135deg, #0891b2, #0e7490); }
.stat-icon.stat-acuerdo { background: linear-gradient(135deg, #10b981, #059669); }
.stat-icon.stat-decreto { background: linear-gradient(135deg, #f59e0b, #d97706); }

.stat-info { display: flex; flex-direction: column; }
.stat-number { font-size: 1.75rem; font-weight: 700; color: var(--text); }
.stat-label { color: var(--text-light); font-size: 0.875rem; }

/* FILTROS */
.filtros-bar { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }

.filtro-btn {
    padding: 0.625rem 1.25rem;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 25px;
    color: var(--text);
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all var(--transition);
}

.filtro-btn:hover { border-color: var(--primary); color: var(--primary); }
.filtro-btn.active { background: var(--primary); border-color: var(--primary); color: white; }

/* TARJETAS */
.content-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 2px 8px var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
}

.card-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); }
.card-header h2 { font-size: 1.125rem; color: var(--text); }

/* LISTA ITEMS */
.items-list { display: flex; flex-direction: column; }

.item-row {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 1.5rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    align-items: center;
    transition: background var(--transition);
}

.item-row:hover { background: var(--bg); }
.item-row.inactiva { opacity: 0.6; }

.item-imagen { width: 100px; height: 65px; border-radius: var(--radius-sm); overflow: hidden; }
.item-imagen img { width: 100%; height: 100%; object-fit: cover; }

.item-badge {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.item-badge.tipo-resolucion { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.item-badge.tipo-ordenanza { background: linear-gradient(135deg, #0891b2, #0e7490); }
.item-badge.tipo-acuerdo { background: linear-gradient(135deg, #10b981, #059669); }
.item-badge.tipo-decreto { background: linear-gradient(135deg, #f59e0b, #d97706); }

.item-info h3 { font-size: 1rem; color: var(--text); margin-bottom: 0.5rem; line-height: 1.4; }
.item-header-line { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }

.tipo-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: white;
}

.tipo-badge.resolucion { background: var(--primary); }
.tipo-badge.ordenanza { background: #0891b2; }
.tipo-badge.acuerdo { background: #10b981; }
.tipo-badge.decreto { background: #f59e0b; }

.numero-doc { font-weight: 700; color: var(--text-light); font-size: 0.875rem; }
.item-meta { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.8125rem; color: var(--text-light); }

.categoria-badge {
    background: var(--primary);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.categoria-badge.events { background: var(--secondary); }
.categoria-badge.social { background: var(--success); }
.categoria-badge.announcements { background: var(--warning); }

.item-estado { text-align: center; }

.estado-badge { display: inline-block; padding: 0.375rem 0.75rem; border-radius: 20px; font-size: 0.8125rem; font-weight: 600; }
.estado-badge.activo { background: #dcfce7; color: #166534; }
.estado-badge.inactivo { background: #fee2e2; color: #991b1b; }

.item-acciones { display: flex; gap: 0.5rem; }

/* FORMULARIOS */
.form-noticia { margin-top: 1rem; }
.form-grid { display: grid; grid-template-columns: 1fr 350px; gap: 2rem; }

.form-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 2px 8px var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.form-card h2 { font-size: 1rem; color: var(--text); margin-bottom: 1.25rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border); }
.form-card.info-card { background: var(--bg); }
.form-card.info-card p { font-size: 0.875rem; margin-bottom: 0.5rem; color: var(--text-light); }

.form-row { display: flex; gap: 1rem; }
.form-group { margin-bottom: 1.25rem; }
.form-group:last-child { margin-bottom: 0; }
.form-group.half { flex: 1; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.5rem; color: var(--text); font-size: 0.9375rem; }

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="url"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
    background: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea { resize: vertical; min-height: 120px; }
.form-group small { display: block; margin-top: 0.375rem; color: var(--text-light); font-size: 0.8125rem; }

/* FILE UPLOAD */
.file-upload { position: relative; }
.file-upload input[type="file"] { position: absolute; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 2; }

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    text-align: center;
    transition: all var(--transition);
}

.file-upload:hover .file-upload-label { border-color: var(--primary); background: rgba(37, 99, 235, 0.05); }
.file-upload-label .file-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.file-upload-label span { color: var(--text); font-weight: 500; }
.file-upload-label small { color: var(--text-light); margin-top: 0.25rem; }

/* PDF PREVIEW */
.pdf-preview { margin-top: 1rem; }

.pdf-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.pdf-info .pdf-icon { font-size: 2rem; }
.pdf-details { flex: 1; display: flex; flex-direction: column; }
.pdf-name { font-weight: 600; color: var(--text); word-break: break-all; }
.pdf-size { font-size: 0.875rem; color: var(--text-light); }
.pdf-check { color: var(--success); font-size: 0.875rem; }

.pdf-actual {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.pdf-info-actual { flex: 1; display: flex; flex-direction: column; }

.imagen-preview, .imagen-actual { margin-top: 1rem; }
.imagen-preview img, .imagen-actual img { max-width: 100%; max-height: 200px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.imagen-preview .error, .pdf-preview .error { color: var(--danger); font-size: 0.875rem; padding: 0.75rem; background: #fee2e2; border-radius: var(--radius-sm); }

/* CHECKBOX */
.checkbox-group { padding: 1rem; background: var(--bg); border-radius: var(--radius-sm); }
.checkbox-label { display: flex; align-items: center; gap: 0.75rem; cursor: pointer; font-weight: 500; }
.checkbox-label input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--primary); }

/* TIPO PREVIEW */
.tipo-preview { text-align: center; }

.tipo-badge-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
    border-radius: var(--radius-sm);
    color: white;
}

.tipo-badge-preview.resolucion { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.tipo-badge-preview.ordenanza { background: linear-gradient(135deg, #0891b2, #0e7490); }
.tipo-badge-preview.acuerdo { background: linear-gradient(135deg, #10b981, #059669); }
.tipo-badge-preview.decreto { background: linear-gradient(135deg, #f59e0b, #d97706); }

.tipo-badge-preview .badge-icon { font-size: 2rem; }
.tipo-badge-preview .badge-text { font-weight: 700; font-size: 0.9375rem; }

.form-actions { display: flex; flex-direction: column; gap: 0.75rem; }

/* BOTONES */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3); }
.btn-outline { background: transparent; border: 2px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 0.5rem 0.875rem; font-size: 0.875rem; }
.btn-block { width: 100%; }

/* ALERTAS */
.alerta { padding: 1rem 1.25rem; border-radius: var(--radius-sm); margin-bottom: 1.5rem; font-weight: 500; }
.alerta ul { margin: 0; padding-left: 1.25rem; }
.alerta-exito { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alerta-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* ESTADO VACÍO */
.empty-state { text-align: center; padding: 4rem 2rem; }
.empty-icon { font-size: 4rem; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.25rem; color: var(--text); margin-bottom: 0.5rem; }
.empty-state p { color: var(--text-light); margin-bottom: 1.5rem; }

/* PAGINACIÓN */
.pagination-admin { display: flex; justify-content: center; align-items: center; gap: 1rem; padding: 1.5rem; border-top: 1px solid var(--border); }
.pagination-info { color: var(--text-light); font-size: 0.875rem; }

/* RESPONSIVE */
@media (max-width: 1024px) {
    .form-grid { grid-template-columns: 1fr; }
    .form-sidebar { order: -1; }
    .stats-grid, .stats-grid.stats-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform var(--transition); }
    .sidebar.active { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 1rem; }
    .item-row { grid-template-columns: auto 1fr; gap: 1rem; }
    .item-estado, .item-acciones { grid-column: span 2; justify-content: flex-start; }
    .page-header-admin { flex-direction: column; }
    .page-header-admin .btn { width: 100%; }
    .stats-grid, .stats-grid.stats-4 { grid-template-columns: 1fr; }
    .form-row { flex-direction: column; gap: 0; }
}

@media (max-width: 480px) {
    .login-card { padding: 1.5rem; }
    .item-row { grid-template-columns: 1fr; }
    .item-imagen, .item-badge { width: 100%; height: 120px; }
}

/* =====================================================
   ESTILOS PARA FUNCIONARIOS
   ===================================================== */

/* Header actions múltiples */
.header-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* Sección título */
.seccion-titulo {
    padding: 1rem 1.5rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Avatar en items */
.item-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 3px solid white;
    box-shadow: 0 2px 8px var(--shadow);
}

.item-avatar img { width: 100%; height: 100%; object-fit: cover; }

.avatar-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Badge de cargo */
.cargo-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--bg);
    border-radius: 15px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-light);
}

.cargo-badge.alta-dir {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

/* Árbol de unidades */
.unidades-arbol { padding: 1rem; }

.unidad-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    border-left: 4px solid var(--primary);
    transition: all var(--transition);
}

.unidad-item:hover { background: white; box-shadow: 0 2px 8px var(--shadow); }
.unidad-item.inactiva { opacity: 0.5; }

.unidad-info { display: flex; align-items: center; gap: 1rem; }
.unidad-icono { font-size: 1.5rem; }
.unidad-datos { display: flex; flex-direction: column; gap: 0.25rem; }
.unidad-datos h4 { font-size: 1rem; font-weight: 600; color: var(--text); margin: 0; }
.unidad-datos .siglas { font-size: 0.8125rem; color: var(--text-light); font-weight: 600; }
.unidad-acciones { display: flex; gap: 0.5rem; }

/* Tipos de unidad colores */
.tipo-unidad {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: white;
}

.tipo-unidad.administracion, .tipo-unidad.default { background: #2563eb; }
.tipo-unidad.desarrollo { background: #10b981; }
.tipo-unidad.servicios { background: #0891b2; }
.tipo-unidad.social { background: #f59e0b; }
.tipo-unidad.juridica { background: #8b5cf6; }
.tipo-unidad.planeamiento { background: #ec4899; }

/* =====================================================
   ESTILOS ADICIONALES PARA USUARIOS Y ACTIVIDAD
   ===================================================== */

/* Separador en sidebar */
.sidebar-separator {
    height: 1px;
    background: var(--border);
    margin: 1rem 0.75rem;
}

/* Rol en sidebar */
.admin-role {
    font-size: 0.6875rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-top: -2px;
}

/* Grid de estadísticas */
.stats-grid.stats-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1100px) {
    .stats-grid.stats-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .stats-grid.stats-4 {
        grid-template-columns: 1fr;
    }
}

/* Colores adicionales para stat-icon */
.stat-icon.cyan { background: linear-gradient(135deg, #0891b2, #0e7490); }
.stat-icon.purple { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.stat-icon.orange { background: linear-gradient(135deg, #f59e0b, #d97706); }

/* Estados en tabla */
.estado-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.estado-badge.activo {
    background: #dcfce7;
    color: #15803d;
}

.estado-badge.inactivo {
    background: #fee2e2;
    color: #dc2626;
}

/* Botones pequeños */
.btn-sm {
    padding: 0.35rem 0.6rem !important;
    font-size: 0.8rem !important;
    min-width: auto !important;
}

.btn-danger {
    background: #ef4444;
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Filas inactivas */
.row-inactive {
    opacity: 0.6;
    background: #fafafa;
}

/* =====================================================
   ESTILOS PARA DOCUMENTOS DE GESTIÓN
   ===================================================== */

/* Selector de iconos */
.icon-selector {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
}

.icon-option {
    cursor: pointer;
}

.icon-option input[type="radio"] {
    display: none;
}

.icon-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 0.5rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    transition: all var(--transition);
    background: white;
}

.icon-option input:checked + .icon-display {
    border-color: var(--primary);
    background: #eff6ff;
}

.icon-emoji {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.icon-name {
    font-size: 0.6875rem;
    color: var(--text-light);
    text-align: center;
}

/* Área de subida de archivos */
.file-upload-area {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--bg-alt);
}

.file-upload-area:hover,
.file-upload-area.drag-over {
    border-color: var(--primary);
    background: #eff6ff;
}

.file-upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.file-upload-content .file-icon {
    font-size: 3rem;
}

.file-upload-content .file-text {
    font-weight: 600;
    color: var(--text);
}

.file-upload-content .file-hint {
    font-size: 0.875rem;
    color: var(--text-light);
}

.file-selected {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: center;
}

.file-selected .selected-icon {
    font-size: 1.5rem;
}

.file-selected .selected-name {
    font-weight: 600;
    color: var(--text);
}

.file-selected .selected-size {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Archivo actual */
.current-file {
    background: var(--bg-alt);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.current-file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.current-file-info .file-icon {
    font-size: 2rem;
}

.current-file-info .file-details {
    flex: 1;
}

.current-file-info .file-name {
    display: block;
    font-weight: 600;
    color: var(--text);
}

.current-file-info .file-size {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Estadísticas de documento */
.stats-card .doc-stats {
    display: flex;
    gap: 2rem;
    justify-content: center;
}

.stat-item {
    text-align: center;
}

.stat-item .stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-item .stat-label {
    font-size: 0.8125rem;
    color: var(--text-light);
}

/* Badges adicionales */
.badge-primary {
    background: #dbeafe;
    color: #1e40af;
}

.badge-secondary {
    background: #e0f2fe;
    color: #0369a1;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

/* Item info en tabla */
.item-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.item-icon {
    font-size: 1.5rem;
}

.item-details {
    display: flex;
    flex-direction: column;
}

.item-title {
    font-weight: 600;
    color: var(--text);
}

.item-meta {
    font-size: 0.8125rem;
    color: var(--text-light);
}

/* Grupo de acciones */
.acciones-grupo {
    display: flex;
    gap: 0.25rem;
}

@media (max-width: 768px) {
    .icon-selector {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .stats-card .doc-stats {
        flex-direction: column;
        gap: 1rem;
    }
}

/* =====================================================
   SIDEBAR RESPONSIVE - MÓVIL
   ===================================================== */

/* Botón toggle móvil */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

/* Botón cerrar dentro del sidebar */
.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.sidebar-close:hover {
    opacity: 1;
}

/* Overlay oscuro */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* =====================================================
   RESPONSIVE - TABLET
   ===================================================== */
@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }
    
    .has-sidebar {
        margin-left: 220px;
    }
    
    .main-content {
        padding: 1.5rem;
    }
}

/* =====================================================
   RESPONSIVE - MÓVIL
   ===================================================== */
@media (max-width: 768px) {
    /* Mostrar botón toggle */
    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Sidebar oculto por defecto */
    .sidebar {
        position: fixed;
        left: -280px;
        width: 280px;
        z-index: 999;
        transition: left 0.3s ease;
    }
    
    /* Sidebar visible cuando está activo */
    .sidebar.active {
        left: 0;
        box-shadow: 4px 0 25px rgba(0, 0, 0, 0.3);
    }
    
    /* Mostrar botón cerrar */
    .sidebar-close {
        display: block;
    }
    
    /* Ajustar header del sidebar */
    .sidebar-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-right: 0.5rem;
    }
    
    /* Sin margen en el body */
    .has-sidebar {
        margin-left: 0;
    }
    
    /* Main content ocupa todo */
    .main-content {
        padding: 1rem;
        padding-top: 5rem; /* Espacio para el botón toggle */
    }
    
    /* Ajustes de contenido */
    .page-header-admin {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .page-header-admin h1 {
        font-size: 1.5rem;
    }
    
    .header-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* Stats grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .stats-grid.stats-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-number, .stat-value {
        font-size: 1.5rem;
    }
    
    /* Tabla responsive */
    .tabla-container,
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tabla-admin,
    .admin-table {
        min-width: 600px;
    }
    
    /* Items list */
    .item-row {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
    }
    
    .item-imagen {
        width: 100%;
        height: 150px;
    }
    
    .item-acciones {
        width: 100%;
        justify-content: flex-end;
    }
    
    /* Form layout */
    .form-main {
        grid-template-columns: 1fr;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    /* Filtros */
    .filtros-bar {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .filtro-btn {
        flex: 1;
        min-width: 120px;
        text-align: center;
        justify-content: center;
    }
    
    /* Botones */
    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
    
    .btn-primary {
        width: 100%;
        justify-content: center;
    }
    
    /* Acciones en tabla */
    .acciones-btn,
    .acciones-grupo {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
}

/* =====================================================
   RESPONSIVE - MÓVIL PEQUEÑO
   ===================================================== */
@media (max-width: 480px) {
    .sidebar-toggle {
        top: 0.75rem;
        left: 0.75rem;
        width: 44px;
        height: 44px;
    }
    
    .main-content {
        padding: 0.75rem;
        padding-top: 4.5rem;
    }
    
    .stats-grid,
    .stats-grid.stats-4 {
        grid-template-columns: 1fr;
    }
    
    .page-header-admin h1 {
        font-size: 1.25rem;
    }
    
    .content-card,
    .form-card {
        padding: 1rem;
        border-radius: 12px;
    }
    
    .card-header h2 {
        font-size: 1.125rem;
    }
}
