/* ===== SAT MANAGER PRO - CSS LIMPIO ===== */

/* ========== VARIABLES CSS ========== */
:root {
    /* Colores primarios */
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #dbeafe;
    --secondary: #64748b;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #06b6d4;
    --info-light: #cffafe;
    
    /* Sidebar - tema oscuro */
    --sidebar-bg: #1e293b;
    --sidebar-bg-hover: #334155;
    --sidebar-text: #f8fafc;
    --sidebar-text-muted: #94a3b8;
    --sidebar-border: #334155;
    
    /* Contenido - tema claro */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    
    /* Medidas */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    /* Layout */
    --sidebar-width: 260px;
    --topbar-height: 64px;
}

/* ========== RESET Y BASE ========== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    font-size: 0.875rem;
}

/* ========== LAYOUT PRINCIPAL ========== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo {
    max-width: 140px;
    max-height: 50px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.sidebar-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--sidebar-text);
}

.sidebar-header p {
    font-size: 0.75rem;
    color: var(--sidebar-text-muted);
    margin-top: 0.25rem;
}

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

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

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-primary);
}

/* Top Bar */
.top-bar {
    min-height: var(--topbar-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 50;
    gap: 1rem;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.content-area {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    background: var(--bg-primary);
}

/* ========== NAVEGACIÓN ========== */
.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    padding: 0 1.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--sidebar-text-muted);
    margin-bottom: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.25rem;
    color: var(--sidebar-text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

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

.nav-item.active {
    background: var(--primary);
    color: white;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-item .badge {
    margin-left: auto;
    font-size: 0.6875rem;
    padding: 0.125rem 0.5rem;
    background: var(--danger);
    color: white;
    border-radius: var(--radius-full);
    min-width: 18px;
    text-align: center;
}

.nav-item .badge:empty,
.nav-item .badge[style*="none"] {
    display: none !important;
}

/* User Info */
.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: white;
}

.user-details {
    flex: 1;
    overflow: hidden;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--sidebar-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: var(--sidebar-text-muted);
    text-transform: capitalize;
}

/* ========== BOTONES ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    text-decoration: none;
    background: none;
}

.btn:hover { opacity: 0.9; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

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

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-sm svg {
    width: 14px;
    height: 14px;
}

.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-icon {
    padding: 0.5rem;
}

.btn-icon svg {
    width: 18px;
    height: 18px;
}

/* Botones de acción para listados */
.action-buttons {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.btn-action-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.375rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-action-primary:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.btn-action-success {
    background: var(--success);
    color: white;
    border: none;
    padding: 0.375rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-action-success:hover {
    background: #059669;
    transform: scale(1.05);
}

.btn-action-danger {
    background: var(--danger);
    color: white;
    border: none;
    padding: 0.375rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-action-danger:hover {
    background: #dc2626;
    transform: scale(1.05);
}

/* ========== FORMULARIOS ========== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: 0.01em;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-family: inherit;
    line-height: 1.5;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-control::placeholder {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.form-control:disabled {
    background: var(--bg-tertiary);
    cursor: not-allowed;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.form-row .form-group {
    margin-bottom: 0;
}

.form-row:last-child {
    margin-bottom: 0;
}

/* Campo destacado */
.form-group-highlight {
    background: var(--warning-light);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--warning);
    margin-bottom: 1.5rem;
}

.form-group-highlight .form-label {
    color: #92400e;
    font-weight: 600;
}

/* ========== MODALES ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: modalFadeIn 0.25s ease forwards;
}

@keyframes modalFadeIn {
    from { opacity: 0; backdrop-filter: blur(0px); }
    to   { opacity: 1; backdrop-filter: blur(10px); }
}

.modal {
    background: #ffffff;
    background: var(--bg-secondary, #ffffff);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 750px;
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    max-height: calc(100vh - 220px);
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    background: var(--bg-tertiary);
}

.modal-footer .btn-group {
    display: flex;
    gap: 0.75rem;
    margin-left: auto;
}

/* ========== TABLAS ========== */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table th,
.table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.table tbody tr:hover {
    background: var(--bg-tertiary);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ========== BADGES ========== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.badge-abierta { background: var(--warning-light); color: #92400e; }
.badge-en_curso { background: var(--info-light); color: #155e75; }
.badge-resuelta { background: var(--success-light); color: #065f46; }
.badge-cerrada { background: var(--secondary); color: white; }
.badge-pendiente { background: var(--warning-light); color: #92400e; }
.badge-en_proceso { background: var(--info-light); color: #155e75; }
.badge-completada { background: var(--success-light); color: #065f46; }
.badge-validada { background: var(--primary-light); color: #1e40af; }
.badge-aprobada { background: var(--success-light); color: #065f46; }
.badge-rechazada { background: var(--danger-light); color: #991b1b; }
.badge-confirmado { background: var(--success-light); color: #065f46; }
.badge-realizado { background: var(--primary-light); color: #1e40af; }
.badge-cancelado { background: var(--danger-light); color: #991b1b; }

.badge-baja { background: var(--success-light); color: #065f46; }
.badge-media { background: var(--warning-light); color: #92400e; }
.badge-alta { background: #ffedd5; color: #9a3412; }
.badge-critica { background: var(--danger-light); color: #991b1b; }

.badge-vip { background: #ede9fe; color: #5b21b6; }
.badge-regular { background: var(--primary-light); color: #1e40af; }
.badge-nuevo { background: var(--success-light); color: #065f46; }
.badge-info { background: var(--info-light); color: #155e75; }

/* ========== CARDS ========== */
.card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

/* ========== DASHBOARD ========== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.dashboard-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.stats-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.2s;
}

.stats-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

/* ========== KANBAN ========== */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    overflow-x: auto;
}

.kanban-column {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    min-height: 400px;
    min-width: 280px;
}

.kanban-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kanban-header h4 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
}

.kanban-items {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.kanban-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.875rem;
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.kanban-card:hover {
    box-shadow: var(--shadow-md);
}

.kanban-card-title {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.kanban-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ========== CALENDARIO ========== */
.calendario-dias-semana {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    margin-bottom: 1px;
}

.calendario-dias-semana .dia-header {
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.calendario-dias-semana .dia-header:first-child {
    border-radius: var(--radius-md) 0 0 0;
}

.calendario-dias-semana .dia-header:last-child {
    border-radius: 0 var(--radius-md) 0 0;
}

.calendario-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.calendario-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.calendario-dia {
    background: var(--bg-secondary);
    min-height: 100px;
    padding: 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
}

.calendario-dia:hover {
    background: var(--bg-tertiary);
}

.calendario-dia.vacio {
    background: var(--bg-tertiary);
}

.calendario-dia.hoy {
    background: var(--primary-light);
}

.calendario-dia .dia-numero {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.calendario-dia.hoy .dia-numero {
    color: var(--primary);
}

.dia-eventos {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.evento-barra {
    height: 6px;
    border-radius: var(--radius-full);
}

.evento-mas {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-align: center;
}

/* ========== CALENDARIO SEMANA ========== */
.calendario-semana-container {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.calendario-semana-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--border-color);
}

.semana-header-dia {
    padding: 1rem 0.5rem;
    text-align: center;
    color: var(--sidebar-text-muted);
    border-right: 1px solid var(--sidebar-border);
}

.semana-header-dia:last-child {
    border-right: none;
}

.semana-header-dia.hoy {
    background: var(--primary);
    color: white;
}

.semana-header-dia .dia-nombre {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.semana-header-dia .dia-numero {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
}

.calendario-semana-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    min-height: 400px;
}

.semana-dia {
    border-right: 1px solid var(--border-color);
    padding: 0.75rem;
    position: relative;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.semana-dia:last-child {
    border-right: none;
}

.semana-dia.hoy {
    background: var(--primary-light);
}

.semana-dia-numero-mobile {
    display: none;
    font-weight: 600;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.semana-dia-eventos {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.semana-evento {
    background: white;
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.2s;
    box-shadow: var(--shadow-sm);
}

.semana-evento:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(2px);
}

.semana-evento-hora {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.semana-evento-titulo {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.semana-evento-cliente {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.sin-eventos {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 2rem 0;
    font-style: italic;
}

.semana-dia .btn-add {
    margin-top: auto;
    opacity: 0;
    transition: opacity 0.2s;
}

.semana-dia:hover .btn-add {
    opacity: 1;
}

/* Calendario día */
.calendario-dia-vista {
    display: flex;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    height: 720px;
}

.dia-hora-columna {
    width: 50px;
    border-right: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    overflow-y: auto;
}

.dia-hora {
    height: 30px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 0.15rem;
    position: relative;
}

.hora-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.hora-linea {
    position: absolute;
    left: 100%;
    right: -100vw;
    top: 0;
    border-top: 1px dashed var(--border-color);
    z-index: 1;
}

.dia-eventos-columna {
    flex: 1;
    position: relative;
    overflow-y: auto;
    overflow-x: auto;
    background: var(--bg-secondary);
    min-width: 0;
}

.dia-evento {
    position: absolute;
    background: white;
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.5rem;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    font-size: 0.75rem;
    box-sizing: border-box;
}

.dia-evento:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 100;
    transform: scale(1.02);
}

.dia-evento-solapado {
    min-width: 140px;
}

.dia-evento-solapado:hover {
    width: 180px !important;
    min-width: 180px !important;
    z-index: 100;
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.dia-eventos-wrapper {
    min-width: 100%;
}

.dia-evento-hora {
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.dia-evento-titulo {
    font-weight: 500;
    font-size: 0.75rem;
    margin: 0.15rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dia-evento-cliente {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sin-eventos-dia {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-style: italic;
}

/* ========== FILTROS ========== */
.filters {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.filters .form-control {
    width: auto;
    min-width: 200px;
}

/* ========== UTILIDADES ========== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

.hidden { display: none !important; }
.block { display: block; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

/* ========== SCROLLBARS ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .top-bar-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .kanban-board {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .dashboard-sections {
        grid-template-columns: 1fr;
    }
    
    /* Calendario semana responsive */
    .calendario-semana-header {
        display: none;
    }
    
    .calendario-semana-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .semana-dia {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        min-height: auto;
    }
    
    .semana-dia:last-child {
        border-bottom: none;
    }
    
    .semana-dia-numero-mobile {
        display: block;
    }
    
    .semana-dia .btn-add {
        opacity: 1;
    }
}

/* ========== ANIMACIONES ========== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal {
    animation: fadeIn 0.2s ease-out;
}

/* ========== FOCUS VISIBLE ========== */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ========== SELECCIÓN DE COLOR ========== */
.color-picker {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.color-option {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: transform 0.2s, border-color 0.2s;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    border-color: var(--text-primary);
}

/* ========== LISTADOS ========== */
.list-group {
    display: flex;
    flex-direction: column;
}

.list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}

.list-item:hover {
    background: var(--bg-tertiary);
}

.list-item:last-child {
    border-bottom: none;
}

.list-item-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.color-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ========== USUARIOS ========== */
.user-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

/* ========== BACKUP ========== */
.backup-info-card {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, #ede9fe 0%, #e0e7ff 100%);
    border: 1px solid #c7d2fe;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
}

.backup-info-card .info-icon {
    flex-shrink: 0;
    color: #5b21b6;
}

.backup-info-card .info-content h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.backup-info-card .info-content p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.backup-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.backup-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: background 0.2s, border-color 0.2s;
}

.backup-item:hover {
    background: var(--bg-secondary);
    border-color: var(--primary);
}

.backup-info {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    flex: 1;
}

.backup-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    color: var(--primary);
}

.backup-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.backup-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.backup-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.backup-user {
    color: var(--text-muted);
}

.backup-actions {
    display: flex;
    gap: 0.5rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-icon {
    margin-bottom: 1rem;
    opacity: 0.5;
    color: var(--text-muted);
}

.empty-state p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.empty-state small {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ========== CONFIGURACIÓN / ALERTAS ========== */
.config-sections {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.switch-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.switch-label input {
    display: none;
}

.switch-slider {
    width: 44px;
    height: 24px;
    background: var(--border-color);
    border-radius: var(--radius-full);
    position: relative;
    transition: background 0.3s;
    flex-shrink: 0;
}

.switch-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.switch-label input:checked + .switch-slider {
    background: var(--success);
}

.switch-label input:checked + .switch-slider::before {
    transform: translateX(20px);
}

.form-help {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.375rem;
}

.form-group-highlight {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

/* ========== SPINNER ========== */
.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ========== PLACEHOLDER CONTENT ========== */
.placeholder-content {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border-color);
}

.placeholder-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.placeholder-content p {
    color: var(--text-muted);
}

/* ========== BADGES ADICIONALES ========== */
.badge-completo { background: #ede9fe; color: #5b21b6; }
.badge-database { background: #dbeafe; color: #1e40af; }
.badge-archivos { background: #d1fae5; color: #065f46; }

/* ========== INVENTARIO ========== */
.inventario-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.inventario-filters .search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.inventario-filters .search-box svg {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.inventario-filters .search-box input {
    padding-left: 2.5rem;
}

.inventario-filters select {
    width: 180px;
}

.empty-state-card {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border-color);
}

.empty-icon-large {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

.empty-state-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.empty-state-card p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.inventario-stats {
    display: flex;
    gap: 2rem;
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.inventario-stats .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.inventario-stats .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.inventario-stats .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Inventario tabla */
.inventario-table .codigo-equipo {
    background: var(--bg-tertiary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 0.8125rem;
}

.inventario-table .equipo-nombre {
    font-weight: 500;
    color: var(--text-primary);
}

.inventario-table .equipo-desc {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.inventario-table .tipo-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.inventario-table .mantenimiento-info {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.inventario-table .mantenimiento-info.urgente {
    color: var(--danger);
    font-weight: 500;
}

.inventario-table .mantenimiento-info.urgente svg {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Inventario cards */
.inventario-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.inventario-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.inventario-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.inventario-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    border-left: 3px solid var(--primary);
}

.inventario-card-tipo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.inventario-card-body {
    padding: 1rem;
}

.inventario-card-nombre {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.inventario-card-codigo {
    display: inline-block;
    background: var(--bg-tertiary);
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    margin-bottom: 0.75rem;
}

.inventario-card-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.inventario-card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.inventario-card-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.inventario-card-meta .meta-item.urgente {
    color: var(--danger);
    font-weight: 500;
}

.inventario-card-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

/* ========== SOLICITUDES ========== */
.solicitudes-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.solicitudes-filters select {
    width: 200px;
}

.solicitudes-table .solicitud-evento {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.solicitudes-table .solicitud-descripcion {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* Kanban solicitudes */
.solicitudes-kanban {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    overflow-x: auto;
}

.solicitud-column {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    min-width: 280px;
    display: flex;
    flex-direction: column;
}

.solicitud-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.solicitud-column-header.pendiente { background: var(--warning-light); }
.solicitud-column-header.aprobada { background: var(--success-light); }
.solicitud-column-header.rechazada { background: var(--danger-light); }
.solicitud-column-header.completada { background: var(--primary-light); }

.solicitud-column-header h4 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
}

.solicitud-column-items {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
    min-height: 200px;
}

.solicitud-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-style: italic;
}

.solicitud-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.2s;
}

.solicitud-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.solicitud-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.solicitud-card-titulo {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
}

.solicitud-card-fecha {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.solicitud-card-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.solicitud-card-evento {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.solicitud-card-solicitante {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.solicitud-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

@media (max-width: 1200px) {
    .solicitudes-kanban {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .solicitudes-kanban {
        grid-template-columns: 1fr;
    }
    
    .inventario-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .inventario-stats {
        justify-content: center;
    }
}

/* ========== ALERTAS - TIMELINE ========== */
.alertas-intro {
    margin-bottom: 1.5rem;
}

.alertas-info-card {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 100%);
    border: 1px solid #c7d2fe;
    border-radius: var(--radius-lg);
    align-items: flex-start;
}

.alertas-info-card svg {
    flex-shrink: 0;
    color: var(--primary);
}

.alertas-info-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.alertas-info-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.alertas-timeline {
    position: relative;
    padding-left: 2rem;
}

.alertas-timeline::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-icon {
    position: absolute;
    left: -1.625rem;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: var(--shadow-sm);
}

.timeline-icon.alerta-preparacion {
    background: #ede9fe;
    color: #5b21b6;
}

.timeline-icon.alerta-revision {
    background: #dbeafe;
    color: #1e40af;
}

.timeline-icon.alerta-dia {
    background: var(--warning-light);
    color: #92400e;
}

.timeline-icon.alerta-recogida {
    background: var(--success-light);
    color: #065f46;
}

.timeline-content {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.timeline-content h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.timeline-content p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.timeline-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.6875rem;
    font-family: monospace;
    color: var(--text-muted);
}

/* ==================== GALERÍA DE FOTOS ==================== */

.galeria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.album-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.album-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.album-cover {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

.album-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.album-card:hover .album-cover img {
    transform: scale(1.05);
}

.album-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}

.album-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
}

.album-count {
    font-size: 0.875rem;
    font-weight: 500;
}

.album-info {
    padding: 1rem;
}

.album-title {
    margin: 0 0 0.25rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
}

.album-cliente {
    margin: 0 0 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.album-fecha {
    margin: 0;
    font-size: 0.8rem;
    color: #6b7280;
}

.album-desc {
    margin: 0.5rem 0 0;
    font-size: 0.875rem;
    color: #6b7280;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Grid de fotos en álbum */
.fotos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.foto-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: #f3f4f6;
}

.foto-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}

.foto-item:hover img {
    transform: scale(1.05);
}

.foto-overlay {
    position: absolute;
    top: 0;
    right: 0;
    padding: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s;
    background: linear-gradient(135deg, rgba(0,0,0,0.3), transparent);
}

.foto-item:hover .foto-overlay {
    opacity: 1;
}

.foto-overlay .btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #dc2626;
    transition: background 0.2s;
}

.foto-overlay .btn-icon:hover {
    background: #dc2626;
    color: white;
}

/* Fullscreen viewer */
.foto-fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.95);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.foto-fullscreen-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Vista semanal tipo grid con horas */
.calendario-semana-nuevo {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    position: relative;
}

.semana-grid-header {
    display: flex;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    height: 50px;
}

.semana-hora-label {
    width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
}

.semana-dia-header {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--border-color);
    min-width: 0;
}

.semana-dia-header:last-child {
    border-right: none;
}

.semana-dia-header .dia-nombre {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.semana-dia-header .dia-numero {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.semana-dia-header.hoy {
    background: var(--primary-light);
}

.semana-dia-header.hoy .dia-numero {
    color: var(--primary);
}

.semana-grid-body {
    position: relative;
    height: 850px; /* 17 horas * 50px */
    overflow-y: auto;
    overflow-x: hidden;
}

.semana-fila-hora {
    display: flex;
    height: 50px;
    border-bottom: 1px solid var(--border-color);
}

.semana-fila-hora:last-child {
    border-bottom: none;
}

.semana-celda-hora {
    flex: 1;
    border-right: 1px solid var(--border-color);
    position: relative;
    cursor: pointer;
    transition: background 0.15s;
    min-width: 0;
}

.semana-celda-hora:last-child {
    border-right: none;
}

.semana-celda-hora:hover {
    background: var(--bg-tertiary);
}

.semana-celda-hora.hoy {
    background: var(--primary-light);
    opacity: 0.5;
}

.semana-eventos-layer {
    position: absolute;
    top: 50px;
    left: 60px;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.semana-evento-nuevo {
    position: absolute;
    background: white;
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.5rem;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.2s ease;
    overflow: hidden;
    font-size: 0.75rem;
    box-sizing: border-box;
    min-width: 80px;
}

.semana-evento-nuevo:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 100;
    transform: scale(1.02);
}

.semana-evento-titulo-nuevo {
    font-weight: 500;
    font-size: 0.75rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.1rem;
}

.semana-evento-hora-nuevo {
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 1024px) {
    .semana-grid-body {
        height: 680px; /* 17 horas * 40px */
    }
    
    .semana-fila-hora {
        height: 40px;
    }
    
    .semana-eventos-layer {
        top: 40px;
    }
}

@media (max-width: 768px) {
    .galeria-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .fotos-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.5rem;
    }
}

/* ========== VISTA SEMANAL V2 (CORREGIDA) ========== */
.calendario-semana-v2 {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.semana-v2-header {
    display: flex;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    height: 45px;
}

.semana-v2-hora-col {
    width: 50px;
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
}

.semana-v2-dia-header {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--border-color);
    min-width: 0;
}

.semana-v2-dia-header:last-child {
    border-right: none;
}

.semana-v2-dia-header .dia-nombre {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.semana-v2-dia-header .dia-numero {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
}

.semana-v2-dia-header.hoy {
    background: var(--primary-light);
}

.semana-v2-dia-header.hoy .dia-numero {
    color: var(--primary);
}

.semana-v2-body {
    height: 680px;
    overflow-y: auto;
}

.semana-v2-grid {
    display: flex;
    min-height: 680px;
}

.semana-v2-hora-col {
    width: 50px;
    border-right: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    flex-shrink: 0;
}

.semana-v2-hora-label {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.semana-v2-dia-col {
    flex: 1;
    position: relative;
    border-right: 1px solid var(--border-color);
    min-width: 0;
    cursor: pointer;
}

.semana-v2-dia-col:last-child {
    border-right: none;
}

.semana-v2-dia-col.hoy {
    background: var(--primary-light);
}

.semana-v2-hora-linea {
    height: 40px;
    border-bottom: 1px solid var(--border-color);
}

.semana-v2-dia-col:hover {
    background: var(--bg-tertiary);
}

.semana-v2-dia-col.hoy:hover {
    background: var(--primary-light);
}

.semana-v2-evento {
    position: absolute;
    left: 3px;
    right: 3px;
    background: white;
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.35rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.15s ease;
    overflow: hidden;
    font-size: 0.6875rem;
    box-sizing: border-box;
    z-index: 1;
    margin: 1px 0;
}

.semana-v2-evento:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 10;
    transform: scale(1.03);
    left: 2px;
    right: 2px;
}

.semana-v2-evento-titulo {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.semana-v2-evento-columna {
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.semana-v2-evento-columna:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    z-index: 10 !important;
}

.semana-v2-evento-hora {
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

/* Grupo de eventos solapados con pestañas */
.semana-v2-grupo {
    position: absolute;
    left: 2px;
    right: 2px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.semana-v2-pestanas {
    display: flex;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    scrollbar-width: none;
}

.semana-v2-pestanas::-webkit-scrollbar {
    display: none;
}

.semana-v2-pestaña {
    flex: 1;
    min-width: 45px;
    padding: 3px 6px;
    background: transparent;
    border: none;
    border-left: 3px solid var(--primary);
    border-bottom: 2px solid transparent;
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.15s ease;
}

.semana-v2-pestaña:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.semana-v2-pestaña.activa {
    background: white;
    color: var(--text-primary);
    border-bottom-color: var(--primary);
}

.semana-v2-contenido {
    position: relative;
    padding: 2px;
}

.semana-v2-evento-contenido {
    display: none;
}

.semana-v2-evento-contenido.visible {
    display: block;
}

.semana-v2-evento-unico {
    left: 2px;
    right: 2px;
}

/* ==================== ADMIN ARCHIVOS ==================== */

.admin-archivos-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-archivos-stats {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1rem;
    border: 1px solid var(--border-color);
}

.admin-archivos-stats .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.admin-archivos-stats .stat-card {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    text-align: center;
}

.admin-archivos-stats .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.admin-archivos-stats .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.admin-archivos-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.admin-archivos-toolbar .checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
}

.admin-archivos-filtros {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.admin-archivos-filtros select,
.admin-archivos-filtros input {
    min-width: 150px;
}

.admin-archivos-tabla-container {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow-x: auto;
}

.admin-archivos-tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.admin-archivos-tabla th {
    background: var(--bg-tertiary);
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.admin-archivos-tabla th:hover {
    background: var(--bg-hover);
}

.admin-archivos-tabla td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.admin-archivos-tabla tr:hover {
    background: var(--bg-hover);
}

.admin-archivos-tabla tr.selected {
    background: var(--primary-light);
}

.admin-archivos-tabla .col-checkbox {
    width: 40px;
    text-align: center;
}

.admin-archivos-tabla .col-tipo {
    width: 100px;
}

.admin-archivos-tabla .col-nombre {
    min-width: 200px;
}

.admin-archivos-tabla .col-entidad {
    min-width: 150px;
}

.admin-archivos-tabla .col-fecha {
    width: 150px;
    white-space: nowrap;
}

.admin-archivos-tabla .col-tamaño {
    width: 100px;
    text-align: right;
}

.admin-archivos-tabla .col-acciones {
    width: 80px;
    text-align: center;
}

.admin-archivos-tabla .tipo-badge {
    font-size: 1rem;
    margin-right: 0.5rem;
}

.admin-archivos-tabla .tipo-texto {
    font-size: 0.75rem;
    text-transform: capitalize;
    color: var(--text-muted);
}

.admin-archivos-tabla .nombre-principal {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

.admin-archivos-tabla .nombre-secundario {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

.admin-archivos-tabla .tamaño-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.admin-archivos-tabla .tamaño-badge.tamaño-pequeño {
    background: var(--success-light);
    color: var(--success);
}

.admin-archivos-tabla .tamaño-badge.tamaño-medio {
    background: var(--warning-light);
    color: var(--warning);
}

.admin-archivos-tabla .tamaño-badge.tamaño-grande {
    background: var(--danger-light);
    color: var(--danger);
}

.admin-archivos-tabla a {
    color: var(--primary);
    text-decoration: none;
}

.admin-archivos-tabla a:hover {
    text-decoration: underline;
}

/* ========== PAGINACIÓN ========== */
.pagination-container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.pagination {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.pagination .btn {
    min-width: 32px;
    height: 32px;
    padding: 0 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    border-radius: var(--radius-md);
    transition: all 0.2s;
    border: 1px solid var(--border-color);
}

.pagination .btn-primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination .btn-secondary {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.pagination .btn-secondary:hover:not(:disabled) {
    background: var(--bg-tertiary);
    border-color: var(--primary);
    color: var(--primary);
}

.pagination .btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--bg-tertiary);
}
