* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #E31937;
    --primary-dark: #B01030;
    --primary-light: #FF6B6B;
    --secondary: #1A1A1A;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --purple: #8b5cf6;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;
}

/* Scroll SOLO en el body */
html, body {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--gradient);
    padding: 20px;
}

/* Login */
.login-container {
    max-width: 500px;
    margin: 50px auto;
    background: white;
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.5s ease;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo-container {
    width: 80px;
    height: 80px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: var(--shadow-lg);
}

.logo-icon {
    font-size: 40px;
    color: white;
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--gray-800);
}

.login-subtitle {
    color: var(--gray-500);
    font-size: 14px;
}

.users-list {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

.users-list::-webkit-scrollbar {
    width: 6px;
}

.users-list::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: var(--radius-full);
}

.users-list::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: var(--radius-full);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    cursor: pointer;
    margin-bottom: 15px;
    transition: all 0.3s;
    background: white;
}

.user-card:hover {
    border-color: var(--primary);
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 24px;
    box-shadow: var(--shadow-md);
}

.login-info {
    margin-top: 20px;
    padding: 15px;
    background: var(--gray-100);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    gap: 10px;
}

.login-info i {
    color: var(--info);
}

/* Dashboard - SIN scroll interno */
.dashboard {
    max-width: 1600px;
    margin: 0 auto;
    background: var(--gray-100);
    border-radius: var(--radius-xl);
    overflow: visible;
    box-shadow: var(--shadow-xl);
    display: none;
}

.header {
    background: white;
    padding: 20px 30px;
    border-bottom: 3px solid var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-small {
    width: 50px;
    height: 50px;
    background: var(--gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.user-name {
    font-size: 20px;
    margin-bottom: 4px;
}

.user-role {
    color: var(--gray-500);
    font-size: 14px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.status-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-badge {
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 14px;
}

.status-active { background: var(--success); color: white; }
.status-comida { background: var(--warning); color: white; }
.status-banio { background: var(--info); color: white; }
.status-descanso { background: var(--purple); color: white; }

.receso-timer {
    font-size: 14px;
    color: var(--gray-500);
    font-weight: 500;
}

.clock {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Courier New', monospace;
    background: var(--gray-100);
    padding: 10px 20px;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
}

/* Layout - SIN overflow hidden */
.main-layout {
    display: flex;
}

.sidebar {
    width: 280px;
    background: white;
    border-right: 2px solid var(--gray-200);
    padding: 30px 0;
}

.sidebar-item {
    padding: 15px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--gray-600);
    font-weight: 500;
}

.sidebar-item:hover {
    background: rgba(227, 25, 55, 0.05);
    color: var(--primary);
}

.sidebar-item.active {
    background: var(--gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

.sidebar-item i {
    width: 24px;
    font-size: 18px;
}

.menu-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 15px 0;
}

/* Content - SIN overflow, que fluya naturalmente */
.content {
    flex: 1;
    padding: 30px;
    background: var(--gray-100);
}

/* Stats */
.section-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 30px;
    color: var(--gray-800);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow-md);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-card h3 {
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.stat-card p {
    font-size: 36px;
    font-weight: 700;
    color: var(--gray-800);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary { background: var(--gradient); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-secondary { background: var(--gray-200); color: var(--gray-700); }

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Recesos */
.receso-panel {
    background: white;
    padding: 30px;
    border-radius: var(--radius-lg);
    margin-bottom: 30px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    box-shadow: var(--shadow-md);
}

.receso-btn {
    padding: 15px 30px;
    border: none;
    border-radius: var(--radius-full);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    flex: 1;
    min-width: 180px;
    justify-content: center;
}

.receso-btn.comida { background: var(--warning); color: white; }
.receso-btn.banio { background: var(--info); color: white; }
.receso-btn.descanso { background: var(--success); color: white; }
.receso-btn.activo { background: var(--primary); color: white; }

/* Tables - Solo scroll horizontal */
.table-container {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-top: 20px;
    overflow-x: auto;
    box-shadow: var(--shadow-md);
}

.table-container h3 {
    margin-bottom: 20px;
    color: var(--gray-700);
    font-size: 18px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

th {
    text-align: left;
    padding: 15px;
    border-bottom: 2px solid var(--gray-200);
    color: var(--gray-600);
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 15px;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-700);
}

tr:hover td {
    background: var(--gray-50);
}

/* Badges */
.badge {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.badge-pendiente { background: #fef3c7; color: #92400e; }
.badge-progreso { background: #dbeafe; color: #1e40af; }
.badge-completada { background: #d1fae5; color: #065f46; }
.badge-bloqueada { background: #fee2e2; color: #991b1b; }
.badge-urgente { background: #fee2e2; color: var(--danger); animation: pulse 2s infinite; }

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
}

.modal-sm { max-width: 400px; }

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.modal-header h3 {
    font-size: 20px;
    color: var(--gray-800);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-500);
    transition: color 0.3s;
}

.modal-close:hover {
    color: var(--danger);
}

.modal-body { padding: 30px; }

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    position: sticky;
    bottom: 0;
    background: white;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
    padding: 0 30px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    padding: 0 30px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--gray-700);
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: all 0.3s;
    font-family: 'Inter', sans-serif;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(227,25,55,0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: white;
    color: var(--gray-800);
    padding: 15px 25px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: none;
    align-items: center;
    gap: 12px;
    z-index: 2000;
    animation: slideInRight 0.3s ease;
    border-left: 4px solid var(--success);
    max-width: 350px;
}

.toast.show { display: flex; }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast.info { border-left-color: var(--info); }

.toast i { font-size: 20px; }
.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }
.toast.warning i { color: var(--warning); }
.toast.info i { color: var(--info); }

.toast-message {
    flex: 1;
    font-size: 14px;
}

/* Reset button */
.reset-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: var(--danger);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-weight: 600;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.reset-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%,100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.hidden { display: none !important; }

/* Acciones */
.acciones {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Textarea de registro más alto */
#actividades {
    min-height: 180px;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar { width: 80px; }
    .sidebar-item span { display: none; }
    .sidebar-item i { margin: 0 auto; }
    .stats-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}

@media (max-width: 768px) {
    body { padding: 10px; }
    .header { flex-direction: column; align-items: flex-start; }
    .header-right { width: 100%; justify-content: space-between; }
    .clock { font-size: 24px; padding: 8px 16px; }
    .main-layout { flex-direction: column; }
    .sidebar { width: 100%; border-right: none; border-bottom: 2px solid var(--gray-200); padding: 10px; }
    .sidebar-nav { display: flex; overflow-x: auto; padding-bottom: 5px; }
    .sidebar-item { flex-shrink: 0; }
    .form-row { grid-template-columns: 1fr; padding: 0 20px; }
    .form-group { padding: 0 20px; }
    .modal-footer { padding: 15px 20px; }
    .modal-header { padding: 15px 20px; }
    .reset-btn { bottom: 10px; left: 10px; padding: 8px 16px; font-size: 12px; }
}