/* ===== CSS Variables & Reset ===== */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --accent: #22d3ee;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #334155;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-darker);
    color: var(--text-primary);
    min-height: 100vh;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.screen {
    display: none;
    min-height: 100vh;
}

.screen.active {
    display: flex;
}

/* Login */
#login-screen {
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--bg-darker), var(--bg-dark), var(--bg-darker));
}

.login-container {
    background: var(--bg-card);
    padding: 3rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    text-align: center;
    max-width: 380px;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo svg {
    width: 40px;
    height: 40px;
    color: white;
}

.login-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary);
}

.pin-dots {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.pin-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 2px solid var(--border);
}

.pin-dot.filled {
    background: var(--primary);
    border-color: var(--primary);
}

.pin-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    max-width: 280px;
    margin: 0 auto;
}

.pin-btn {
    width: 70px;
    height: 70px;
    border: none;
    border-radius: var(--radius);
    background: var(--bg-dark);
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pin-btn:hover {
    background: var(--bg-card-hover);
    transform: scale(1.05);
}

.pin-btn svg {
    width: 24px;
    height: 24px;
}

.error-msg {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 1rem;
    min-height: 1.2rem;
}

/* Sidebar */
.sidebar {
    width: 260px;
    min-height: 100vh;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.logo-small {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-small svg {
    width: 24px;
    height: 24px;
    color: white;
}

.sidebar-header span {
    font-size: 1.25rem;
    font-weight: 700;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-dark);
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
}

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
}

.user-name {
    font-weight: 600;
}

.user-role {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.nav-menu {
    list-style: none;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 0.25rem;
}

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

.nav-item.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.nav-item svg {
    width: 20px;
    height: 20px;
}

.nav-item.admin-only {
    display: none;
}

body.is-admin .nav-item.admin-only {
    display: flex;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-sm);
    background: rgba(239, 68, 68, 0.1);
    border: none;
    color: var(--danger);
    cursor: pointer;
    width: 100%;
    margin-top: auto;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}

.logout-btn svg {
    width: 20px;
    height: 20px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
    min-height: 100vh;
}

.view {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

.view-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
}

/* Clock View */
.header-right-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.clock-user-welcome {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--danger);
    margin-bottom: 0.25rem;
}

.current-datetime {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.current-date {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.current-time {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.clock-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.clock-status {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: var(--bg-card);
    border-radius: 50px;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-indicator.working {
    background: var(--success);
    animation: blink 1s ease infinite;
}

.status-indicator.paused {
    background: var(--warning);
    animation: blink 1s ease infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.clock-actions {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.clock-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 2rem;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    min-width: 140px;
    font-weight: 600;
    font-size: 1rem;
}

.clock-btn svg {
    width: 40px;
    height: 40px;
}

.clock-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.clock-btn.entry {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
}

.clock-btn.pause {
    background: linear-gradient(135deg, var(--warning), #d97706);
    color: white;
}

.clock-btn.exit {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
}

.clock-btn:hover:not(:disabled) {
    transform: translateY(-3px);
}

.project-selector {
    margin-bottom: 2rem;
}

.project-selector label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.project-selector select {
    width: 100%;
    max-width: 300px;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
}

.today-summary {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.today-summary h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.summary-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

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

/* Filters & Tables - continuará en styles2.css */