/* =======================================================
   UNLR VMS - PREMIUM SAAS STYLESHEET
   Archivo principal de estilos para el Panel de Manager
   ======================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --vms-orange: #FF5722;
    --vms-orange-hover: #E64A19;
    --vms-orange-light: rgba(255, 87, 34, 0.15); /* Aumentado para mayor visibilidad */
    --vms-bg: #f8fafc;
    --vms-card-bg: #ffffff;
    --vms-border: #e2e8f0;
    --vms-border-focus: #FF5722; /* Borde naranja al enfocar */
    --vms-text-main: #1e293b;
    --vms-text-muted: #64748b;
    --vms-danger: #ef4444;
    --vms-success: #10b981;
    --vms-info: #3b82f6;
    
    --vms-radius-sm: 8px;
    --vms-radius-md: 12px;
    --vms-radius-lg: 16px;
    
    --vms-shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --vms-shadow-md: 0 8px 30px rgba(0,0,0,0.06); /* Sombra más envolvente */
    --vms-shadow-focus: 0 0 0 4px rgba(255, 87, 34, 0.2); /* Glow ring */
}

/* =======================================================
   1. ESTRUCTURA BASE Y TARJETAS
   ======================================================= */
.vms-manager-wrapper {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--vms-text-main);
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px; /* Padding general para separar de los bordes del sitio */
    line-height: 1.6;
}

.vms-manager-wrapper * {
    box-sizing: border-box;
}

.vms-manager-card {
    background: var(--vms-card-bg);
    border: 1px solid var(--vms-border);
    border-radius: var(--vms-radius-lg);
    padding: 30px; /* Mucho más respiro interno */
    margin-bottom: 30px;
    box-shadow: var(--vms-shadow-md);
    transition: box-shadow 0.3s ease;
}

.vms-manager-header {
    border-bottom: 1px solid var(--vms-border);
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.vms-manager-header h2 {
    margin: 0 0 8px 0;
    color: var(--vms-text-main);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.vms-manager-header h2 .material-symbols-rounded {
    color: var(--vms-orange);
    font-size: 32px;
}

.vms-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--vms-text-muted);
    background: #f8fafc;
    border-radius: var(--vms-radius-lg);
    border: 2px dashed #cbd5e1;
    font-weight: 500;
}

/* =======================================================
   2. FORMULARIOS Y BOTONES (UI INTERACTIVA)
   ======================================================= */
.vms-manager-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.vms-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.vms-group, .vms-group-full {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vms-group label, .vms-group-full label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--vms-text-main);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Campos de texto, selects y textareas */
.vms-manager-wrapper input[type="text"],
.vms-manager-wrapper input[type="number"],
.vms-manager-wrapper input[type="date"],
.vms-manager-wrapper input[type="time"],
.vms-manager-wrapper textarea,
.vms-manager-wrapper select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--vms-border); /* Borde más definido */
    border-radius: var(--vms-radius-md);
    font-size: 1rem;
    color: var(--vms-text-main);
    background: #fcfcfc;
    transition: all 0.25s ease;
    font-family: inherit;
}

/* Efecto Focus Ring (Glow) MUY visible */
.vms-manager-wrapper input:focus,
.vms-manager-wrapper textarea:focus,
.vms-manager-wrapper select:focus {
    border-color: var(--vms-border-focus);
    background: #ffffff;
    outline: none;
    box-shadow: var(--vms-shadow-focus); /* Halo naranja brillante */
}

/* Botones Premium */
.vms-btn-primary {
    background: var(--vms-orange);
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: var(--vms-radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(255, 87, 34, 0.25);
}

.vms-btn-primary:hover {
    background: var(--vms-orange-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 87, 34, 0.35);
}

.vms-btn-primary:active {
    transform: translateY(0);
}

.vms-btn-primary:disabled {
    background: #cbd5e1;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.vms-btn-outline {
    background: transparent;
    color: var(--vms-orange);
    border: 2px solid var(--vms-orange);
    padding: 12px 24px;
    border-radius: var(--vms-radius-md);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.vms-btn-outline:hover {
    background: var(--vms-orange-light);
}

/* =======================================================
   3. COMPONENTES ESPECÍFICOS (BADGES, SWITCHES, ICONS)
   ======================================================= */
.vms-section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--vms-text-main);
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 12px;
    margin-top: 15px;
}

.vms-days-badge {
    background: var(--vms-orange-light);
    color: var(--vms-orange);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
}

.vms-badge.status-active {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
    border-radius: var(--vms-radius-sm);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* iOS Style Switch */
.vms-switch-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    padding: 20px;
    border-radius: var(--vms-radius-md);
    border: 1px solid var(--vms-border);
}

.vms-switch { position: relative; display: inline-block; width: 54px; height: 30px; }
.vms-switch input { opacity: 0; width: 0; height: 0; }
.vms-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #cbd5e1; transition: .4s; border-radius: 34px; }
.vms-slider:before { position: absolute; content: ""; height: 22px; width: 22px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; box-shadow: var(--vms-shadow-sm); }
.vms-switch input:checked + .vms-slider { background-color: var(--vms-orange); }
.vms-switch input:checked + .vms-slider:before { transform: translateX(24px); }

/* Icon Grid */
.vms-icon-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.vms-icon-option { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; background: #fff; border: 2px solid var(--vms-border); border-radius: var(--vms-radius-md); cursor: pointer; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); color: var(--vms-text-muted); }
.vms-icon-option:hover { border-color: #94a3b8; color: var(--vms-text-main); }
.vms-icon-option.selected { border-color: var(--vms-orange); background: var(--vms-orange); color: #fff; box-shadow: 0 6px 12px var(--vms-orange-light); transform: scale(1.08); }

/* =======================================================
   4. WORKSPACE Y MOTOR DE TURNOS
   ======================================================= */
.vms-action-icon { cursor: pointer; transition: all 0.2s ease; font-size: 20px; color: var(--vms-text-muted); padding: 4px; border-radius: 6px; }
.vms-action-icon:hover { background: #f1f5f9; color: var(--vms-text-main); transform: scale(1.1); }
.vms-action-icon[title="Edit Role"]:hover { color: var(--vms-info); background: #eff6ff; }
.vms-action-icon[title="Archive Role"]:hover { color: var(--vms-danger); background: #fef2f2; }

/* Botones de Días (Pills) */
.vms-day-btn { padding: 12px 20px; border: 2px solid transparent; border-radius: var(--vms-radius-md); background: #f1f5f9; cursor: pointer; text-align: center; font-weight: 600; transition: all 0.2s ease; color: var(--vms-text-muted); font-size:0.95rem; }
.vms-day-btn:hover { background: #e2e8f0; color: var(--vms-text-main); }
.vms-day-btn.active { background: var(--vms-orange); color: #fff; box-shadow: 0 6px 15px var(--vms-orange-light); transform: translateY(-2px); }

/* Time Chips (Rangos creados) */
.vms-time-chip { background: #fff; border: 1.5px solid var(--vms-orange); color: var(--vms-orange); padding: 8px 16px; border-radius: 30px; font-size: 0.85rem; font-weight: 600; display: inline-flex; align-items: center; gap: 10px; box-shadow: var(--vms-shadow-sm); transition: all 0.2s; }
.vms-time-chip:hover { box-shadow: var(--vms-shadow-md); transform: translateY(-1px); }
.vms-time-chip .del { cursor: pointer; background: #fee2e2; color: var(--vms-danger); border-radius: 50%; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; font-size: 14px; transition: 0.2s; }
.vms-time-chip .del:hover { background: var(--vms-danger); color: #fff; }

/* =======================================================
   5. TABLA DE ROSTER (RESUMEN MAESTRO)
   ======================================================= */
.vms-summary-table-wrapper { margin-top: 50px; }
.vms-summary-day-title { background: var(--vms-orange); color: #fff; padding: 14px 24px; border-radius: var(--vms-radius-lg) var(--vms-radius-lg) 0 0; margin: 0; font-size: 1.2rem; display: flex; align-items: center; gap: 12px; font-weight: 600; letter-spacing: 0.5px; }
.vms-summary-table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; box-shadow: var(--vms-shadow-md); border-radius: 0 0 var(--vms-radius-lg) var(--vms-radius-lg); overflow: hidden; margin-bottom: 40px; border: 1px solid var(--vms-border); border-top: none; }
.vms-summary-table th { background: #f8fafc; color: var(--vms-text-muted); text-align: left; padding: 16px 20px; font-size: 0.85rem; text-transform: uppercase; font-weight: 700; letter-spacing: 1px; border-bottom: 2px solid #e2e8f0; }
.vms-summary-table td { padding: 20px; border-bottom: 1px solid #f1f5f9; vertical-align: top; font-size: 0.95rem; color: var(--vms-text-main); transition: background 0.2s; }
.vms-summary-table tr:hover td { background: #fdfdfd; }
.vms-summary-table tr:last-child td { border-bottom: none; }

.vms-td-area { font-weight: 700; color: var(--vms-orange); background: #fcfcfc; border-right: 1px solid #f1f5f9; text-transform: uppercase; font-size: 1rem; letter-spacing: 0.5px; }
.vms-td-role { font-weight: 600; color: var(--vms-text-main); font-size: 1.05rem; }
.vms-role-hc-badge { display: inline-block; background: #f1f5f9; color: var(--vms-text-muted); padding: 4px 10px; border-radius: 12px; font-size: 0.75rem; font-weight: 700; margin-top: 6px; border: 1px solid var(--vms-border); }

/* Categorías y Tareas */
.vms-td-category { text-align: center; vertical-align: middle; }
.vms-cat-badge { display: inline-block; padding: 6px 14px; border-radius: 30px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.vms-cat-leader { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.vms-cat-staff { background: #f8fafc; color: #475569; border: 1px solid #e2e8f0; }
.vms-cat-backup { background: #fff7ed; color: #ea580c; border: 1px solid #fed7aa; }

.vms-td-duties { color: #475569; line-height: 1.6; font-size: 0.9rem; }
.vms-td-duties ul, .vms-td-duties ol { margin: 0; padding-left: 20px; }
.vms-td-duties p { margin: 0 0 10px 0; }
.vms-td-duties p:last-child { margin: 0; }

/* Items de Edición en línea (Rangos en Roster) */
.vms-shift-rg-item { display: flex; justify-content: space-between; align-items: center; background: #ffffff; border: 1px solid var(--vms-border); border-radius: var(--vms-radius-sm); padding: 8px 12px; margin-bottom: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); transition: all 0.2s; font-weight: 500; color: var(--vms-text-main); }
.vms-shift-rg-item:hover { border-color: var(--vms-border-focus); box-shadow: var(--vms-shadow-sm); transform: translateX(2px); }
.vms-edit-icon { font-size: 18px; color: var(--vms-info); cursor: pointer; transition: all 0.2s; padding: 4px; border-radius: 4px; }
.vms-edit-icon:hover { background: #eff6ff; transform: scale(1.1); }

/* Tarjetas de Áreas (Constructor en la pantalla Crear Evento) */
.vms-areas-display-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); 
    gap: 16px; 
    margin-top: 20px; 
}

.vms-area-card { 
    background: var(--vms-card-bg); 
    border: 2px solid var(--vms-border); 
    border-radius: var(--vms-radius-md); 
    padding: 20px 10px; 
    position: relative; 
    display: flex;
    flex-direction: column;
    align-items: center; /* Esto centra horizontalmente */
    justify-content: center; /* Esto centra verticalmente */
    text-align: center; 
    box-shadow: var(--vms-shadow-sm);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.vms-area-card:hover {
    border-color: var(--vms-orange);
    box-shadow: var(--vms-shadow-md);
    transform: translateY(-4px); /* Efecto de levitar */
}

/* El botón rojo de eliminar en la esquina de la tarjeta */
.vms-card-delete-btn {
    position: absolute; 
    top: -10px; 
    right: -10px; 
    background: var(--vms-danger); 
    width: 28px; 
    height: 28px; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3); 
    border: 2px solid #fff; 
    z-index: 10; 
    transition: 0.2s;
}

.vms-card-delete-btn:hover {
    background: var(--vms-danger-hover);
    transform: scale(1.15);
}

/* Tarjetas Archivadas / Ocultas */
.vms-area-archived {
    opacity: 0.5;
    filter: grayscale(100%);
    border-style: dashed;
    background: #f1f5f9;
}
.vms-area-archived:hover {
    opacity: 0.8;
    transform: none; /* Quitamos el efecto de levitar para que se sienta inactiva */
    box-shadow: var(--vms-shadow-sm);
}
/* Roles Archivados / Pausados */
.vms-role-archived {
    opacity: 0.5;
    background: #f8fafc;
    border-left: 4px solid #cbd5e1 !important;
}
.vms-role-archived strong {
    color: #64748b !important;
    text-decoration: line-through;
}