/* ============================================
   TimeFlow - Sistema de Controle de Ponto
   Design: Dark Modern com tema Azul/Roxo
   ============================================ */

/* CSS Variables */
:root {
    /* Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-card: rgba(26, 26, 37, 0.7);
    --bg-glass: rgba(26, 26, 37, 0.5);
    
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-indigo: #6366f1;
    --accent-cyan: #06b6d4;
    --accent-green: #10b981;
    --accent-yellow: #f59e0b;
    --accent-red: #ef4444;
    
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --gradient-secondary: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    --gradient-accent: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.12);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);
    --shadow-glow-purple: 0 0 40px rgba(139, 92, 246, 0.3);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Spacing */
    --sidebar-width: 260px;
    --header-height: 70px;
}

/* Reset & Base Styles */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

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

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

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

::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}

/* Selection */
::selection {
    background: rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
}

/* Hidden Class */
.hidden {
    display: none !important;
}

/* Glass Card Effect */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

/* ============================================
   Loading Screen
   ============================================ */
.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
}

.loading-logo img {
    width: 80px;
    height: 80px;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.3)); }
    50% { filter: drop-shadow(0 0 30px rgba(139, 92, 246, 0.6)); }
}

.loading-text {
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 1.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.loading-bar {
    width: 200px;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    margin-top: 1.5rem;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    animation: loading-progress 2s ease-in-out infinite;
}

@keyframes loading-progress {
    0% { width: 0; margin-left: 0; }
    50% { width: 70%; margin-left: 15%; }
    100% { width: 0; margin-left: 100%; }
}

/* ============================================
   Login Screen
   ============================================ */
.login-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.login-background {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.bg-gradient {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(59, 130, 246, 0.1) 0%, transparent 70%),
        var(--bg-primary);
}

.bg-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent-indigo);
    border-radius: 50%;
    opacity: 0.3;
    animation: float-particle 20s linear infinite;
}

@keyframes float-particle {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 0.3; }
    90% { opacity: 0.3; }
    100% { transform: translateY(-100vh) rotate(720deg); opacity: 0; }
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 1rem;
}

.login-card {
    padding: 2.5rem;
    animation: slide-up 0.6s ease-out;
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-icon {
    display: inline-flex;
    margin-bottom: 1rem;
}

.logo-icon img {
    width: 56px;
    height: 56px;
    animation: pulse-glow 3s ease-in-out infinite;
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    pointer-events: none;
    transition: color var(--transition-base);
}

.input-icon svg {
    width: 20px;
    height: 20px;
}

.input-group input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all var(--transition-base);
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-indigo);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.input-group input:focus + .input-icon,
.input-group input:focus ~ .input-icon {
    color: var(--accent-indigo);
}

.input-group input::placeholder {
    color: var(--text-muted);
}

.toggle-password {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    transition: color var(--transition-fast);
}

.toggle-password:hover {
    color: var(--text-primary);
}

.toggle-password svg {
    width: 20px;
    height: 20px;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.remember-me:hover {
    color: var(--text-primary);
}

.remember-me input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-light);
    border-radius: 4px;
    position: relative;
    transition: all var(--transition-fast);
}

.remember-me input:checked + .checkmark {
    background: var(--accent-indigo);
    border-color: var(--accent-indigo);
}

.remember-me input:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.forgot-password {
    color: var(--accent-indigo);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.forgot-password:hover {
    color: var(--accent-purple);
}

.login-btn {
    position: relative;
    padding: 0.95rem;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    transition: all var(--transition-base);
}

.login-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.login-btn:hover::before {
    transform: translateX(100%);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn .btn-loader {
    display: flex;
    justify-content: center;
}

.spinner {
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

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

.login-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.login-footer p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.login-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.login-footer a:hover {
    color: var(--accent-indigo);
}

/* ============================================
   Main App Layout
   ============================================ */
.main-app {
    display: flex;
    min-height: 100vh;
}

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

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.logo svg {
    width: 36px;
    height: 36px;
}

.logo span {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.sidebar-nav ul {
    list-style: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    position: relative;
    margin: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: height var(--transition-fast);
}

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

.nav-item:hover {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.08);
}

.nav-item.active {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.12);
}

.nav-item.active::before {
    height: 24px;
}

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

.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.logout-btn:hover {
    color: var(--accent-red);
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.08);
}

/* Mobile Header */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    padding: 0 1rem;
    z-index: 90;
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
}

.menu-toggle svg {
    width: 24px;
    height: 24px;
}

.mobile-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    margin-left: auto;
    margin-right: auto;
}

.mobile-logo svg {
    width: 28px;
    height: 28px;
}

.mobile-logo span {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mobile-user {
    width: 40px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 95;
    opacity: 0;
    transition: opacity var(--transition-base);
}

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

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

/* Pages */
.page {
    display: none;
    animation: fade-in 0.3s ease;
}

.page.active {
    display: block;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.page-title h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.page-title p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Live Clock */
.live-clock {
    padding: 1rem 1.5rem;
    text-align: right;
}

.clock-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2rem;
    font-weight: 500;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.clock-date {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* ============================================
   Dashboard
   ============================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto auto;
    gap: 1.5rem;
}

/* Animate In */
.animate-in {
    animation: animate-in 0.5s ease-out backwards;
}

@keyframes animate-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Status Card */
.status-card {
    grid-column: span 1;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
}

.status-icon {
    width: 48px;
    height: 48px;
    background: rgba(99, 102, 241, 0.15);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-indigo);
}

.status-icon svg {
    width: 24px;
    height: 24px;
}

.status-icon.working {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
    animation: pulse-working 2s ease-in-out infinite;
}

@keyframes pulse-working {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 0 0 12px rgba(16, 185, 129, 0); }
}

.status-icon.paused {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-yellow);
}

.status-info {
    flex: 1;
}

.status-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

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

.status-indicator.working {
    background: var(--accent-green);
    animation: blink 1.5s ease-in-out infinite;
}

.status-indicator.paused {
    background: var(--accent-yellow);
}

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

/* Hours Card */
.hours-card {
    grid-column: span 1;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-icon svg {
    width: 22px;
    height: 22px;
}

.card-icon.blue {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}

.card-icon.purple {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
}

.card-info {
    flex: 1;
}

.card-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-value {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.75rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

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

.progress-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-secondary);
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

.progress-fill.purple {
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-indigo));
}

.progress-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Quick Punch */
.quick-punch {
    grid-column: span 1;
    grid-row: span 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.punch-btn {
    width: 100%;
    height: 100%;
    min-height: 180px;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-lg);
    color: white;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.punch-btn::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    z-index: -1;
    filter: blur(20px);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.punch-btn:hover::before {
    opacity: 0.6;
}

.punch-btn:hover {
    transform: scale(1.02);
}

.punch-btn:active {
    transform: scale(0.98);
}

.punch-icon {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse-punch 2s ease-in-out infinite;
}

@keyframes pulse-punch {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4); }
    50% { box-shadow: 0 0 0 20px rgba(255, 255, 255, 0); }
}

.punch-icon svg {
    width: 28px;
    height: 28px;
}

.punch-text {
    font-size: 1.25rem;
    font-weight: 600;
}

.punch-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    opacity: 0.8;
}

.punch-btn.registered {
    animation: punch-success 0.5s ease;
}

@keyframes punch-success {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Timeline Card */
.timeline-card {
    grid-column: span 2;
    padding: 1.5rem;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.timeline-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.timeline-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

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

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

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

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

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--accent-indigo);
}

.timeline-item.entrada::before {
    background: var(--accent-green);
    border-color: var(--accent-green);
}

.timeline-item.saida::before {
    background: var(--accent-red);
    border-color: var(--accent-red);
}

.timeline-item.pausa::before {
    background: var(--accent-yellow);
    border-color: var(--accent-yellow);
}

.timeline-item.retorno::before {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
}

.timeline-item-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.timeline-item-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    font-weight: 500;
}

.timeline-item-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.timeline-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    color: var(--text-muted);
}

.timeline-empty svg {
    width: 40px;
    height: 40px;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

/* Chart Card */
.chart-card {
    grid-column: span 3;
    padding: 1.5rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.chart-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.chart-legend {
    display: flex;
    gap: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot.blue { background: var(--accent-blue); }
.dot.gray { background: var(--text-muted); }

.chart-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chart-bars {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 120px;
    gap: 1rem;
}

.chart-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.bar-container {
    width: 100%;
    height: 100px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    position: relative;
    overflow: hidden;
}

.bar-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--gradient-secondary);
    border-radius: var(--radius-sm);
    transition: height 0.5s ease;
}

.bar-reference {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 62.5%;
    border-top: 2px dashed rgba(255, 255, 255, 0.1);
}

.chart-labels {
    display: flex;
    justify-content: space-between;
    padding: 0 0.5rem;
}

.chart-labels span {
    flex: 1;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============================================
   Registro Page
   ============================================ */
.registro-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.registro-clock {
    padding: 2rem;
    text-align: center;
}

.registro-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 3.5rem;
    font-weight: 500;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.registro-date {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-top: 0.5rem;
}

.registro-status {
    padding: 1.5rem;
    text-align: center;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: rgba(99, 102, 241, 0.15);
    border-radius: var(--radius-full);
    color: var(--accent-indigo);
    font-weight: 500;
}

.status-badge svg {
    width: 18px;
    height: 18px;
}

.status-badge.working {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.status-badge.paused {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-yellow);
}

.status-description {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.status-description strong {
    color: var(--text-primary);
}

.registro-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.registro-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.registro-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.registro-btn.entrada::before {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), transparent);
}

.registro-btn.saida::before {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), transparent);
}

.registro-btn.pausa::before {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), transparent);
}

.registro-btn.retorno::before {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), transparent);
}

.registro-btn:not(:disabled):hover::before {
    opacity: 1;
}

.registro-btn:not(:disabled):hover {
    transform: translateY(-3px);
    border-color: var(--accent-indigo);
}

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

.registro-btn .btn-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    transition: all var(--transition-base);
}

.registro-btn.entrada:not(:disabled):hover .btn-icon {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-green);
}

.registro-btn.saida:not(:disabled):hover .btn-icon {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
}

.registro-btn.pausa:not(:disabled):hover .btn-icon {
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-yellow);
}

.registro-btn.retorno:not(:disabled):hover .btn-icon {
    background: rgba(6, 182, 212, 0.2);
    color: var(--accent-cyan);
}

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

.registro-btn span {
    font-weight: 500;
    font-size: 1rem;
}

.registro-btn .btn-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.registro-btn.active .btn-icon {
    background: var(--accent-green);
    color: white;
}

.registro-timeline {
    padding: 1.5rem;
}

.registro-timeline h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.timeline.visual {
    display: flex;
    justify-content: space-between;
    padding: 1rem 0;
    position: relative;
}

.timeline.visual::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--border-color);
    transform: translateY(-50%);
}

.timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
}

.step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}

.timeline-step.completed .step-icon {
    background: var(--accent-green);
    border-color: var(--accent-green);
}

.timeline-step.active .step-icon {
    border-color: var(--accent-indigo);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

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

.timeline-step.completed .step-icon svg,
.timeline-step.active .step-icon svg {
    color: white;
}

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

.timeline-step.completed .step-label,
.timeline-step.active .step-label {
    color: var(--text-primary);
}

.step-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ============================================
   Histórico Page
   ============================================ */
.historico-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.25rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 150px;
}

.filter-group label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group select,
.filter-group input {
    padding: 0.625rem 0.875rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: var(--accent-indigo);
}

.search-input {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input svg {
    position: absolute;
    left: 0.75rem;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.search-input input {
    padding-left: 2.5rem;
    width: 100%;
}

.historico-summary {
    display: flex;
    justify-content: space-around;
    padding: 1.25rem;
}

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

.summary-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 0.25rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.historico-table {
    overflow: hidden;
}

.historico-table table {
    width: 100%;
    border-collapse: collapse;
}

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

.historico-table th {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    background: var(--bg-tertiary);
}

.historico-table td {
    font-size: 0.9rem;
}

.historico-table tbody tr {
    transition: background var(--transition-fast);
}

.historico-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

.historico-table .time-cell {
    font-family: 'JetBrains Mono', monospace;
}

.status-badge-cell {
    display: inline-flex;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge-cell.complete {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.status-badge-cell.incomplete {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-yellow);
}

.table-empty {
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 3rem;
    color: var(--text-muted);
}

.table-empty.show {
    display: flex;
}

.table-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ============================================
   Perfil Page
   ============================================ */
.perfil-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.perfil-card {
    grid-column: span 2;
    padding: 2rem;
}

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

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

.perfil-info h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.perfil-info p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.perfil-departamento {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(99, 102, 241, 0.15);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    color: var(--accent-indigo);
}

.perfil-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.detail-item svg {
    width: 22px;
    height: 22px;
    color: var(--accent-indigo);
    flex-shrink: 0;
}

.detail-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.detail-value {
    display: block;
    font-size: 0.9rem;
    margin-top: 0.125rem;
}

.settings-card,
.stats-card {
    padding: 1.5rem;
}

.settings-card h3,
.stats-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

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

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.setting-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.setting-info svg {
    width: 20px;
    height: 20px;
    color: var(--accent-indigo);
}

.setting-title {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
}

.setting-desc {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.125rem;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
    border: 1px solid var(--border-color);
}

.slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all var(--transition-base);
}

.toggle-switch input:checked + .slider {
    background: var(--accent-indigo);
    border-color: var(--accent-indigo);
}

.toggle-switch input:checked + .slider::before {
    transform: translateX(22px);
    background: white;
}

.edit-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.edit-btn:hover {
    color: var(--accent-indigo);
    border-color: var(--accent-indigo);
}

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

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

/* ============================================
   User Avatar
   ============================================ */
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
}

.user-avatar.small {
    width: 36px;
    height: 36px;
    font-size: 0.8rem;
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 1000;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    max-width: 400px;
    animation: toast-in 0.3s ease;
    backdrop-filter: blur(20px);
}

.toast.fade-out {
    animation: toast-out 0.3s ease forwards;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.toast-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.toast.success .toast-icon { color: var(--accent-green); }
.toast.error .toast-icon { color: var(--accent-red); }
.toast.warning .toast-icon { color: var(--accent-yellow); }
.toast.info .toast-icon { color: var(--accent-blue); }

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 500;
    font-size: 0.9rem;
}

.toast-message {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.125rem;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    transition: color var(--transition-fast);
}

.toast-close:hover {
    color: var(--text-primary);
}

.toast-close svg {
    width: 18px;
    height: 18px;
}

/* ============================================
   Modal
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    padding: 1rem;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal {
    max-width: 400px;
    width: 100%;
    padding: 2rem;
    text-align: center;
    animation: modal-in 0.3s ease;
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-icon.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.modal-icon.error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.modal-icon.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-yellow);
}

.modal-icon.info {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}

.modal-icon svg {
    width: 32px;
    height: 32px;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.modal-message {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.modal-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.modal-btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-btn.primary {
    background: var(--gradient-primary);
    border: none;
    color: white;
}

.modal-btn.primary:hover {
    box-shadow: var(--shadow-glow);
}

.modal-btn.secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.modal-btn.secondary:hover {
    border-color: var(--accent-indigo);
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .status-card {
        grid-column: span 1;
    }
    
    .hours-card {
        grid-column: span 1;
    }
    
    .quick-punch {
        grid-column: span 1;
        grid-row: span 1;
    }
    
    .timeline-card {
        grid-column: span 2;
    }
    
    .chart-card {
        grid-column: span 2;
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .mobile-header {
        display: flex;
    }
    
    .sidebar-overlay {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
        margin-top: var(--header-height);
        padding: 1.5rem;
    }
    
    .perfil-container {
        grid-template-columns: 1fr;
    }
    
    .perfil-card {
        grid-column: span 1;
    }
    
    .perfil-details {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .status-card,
    .hours-card,
    .quick-punch,
    .timeline-card,
    .chart-card {
        grid-column: span 1;
    }
    
    .quick-punch {
        order: -1;
    }
    
    .page-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .live-clock {
        text-align: center;
    }
    
    .registro-buttons {
        grid-template-columns: 1fr;
    }
    
    .filters {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .historico-summary {
        flex-direction: column;
        gap: 1rem;
    }
    
    .historico-table {
        overflow-x: auto;
    }
    
    .historico-table table {
        min-width: 600px;
    }
    
    .perfil-header {
        flex-direction: column;
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .toast-container {
        left: 1rem;
        right: 1rem;
    }
    
    .toast {
        min-width: auto;
        width: 100%;
    }
}

@media (max-width: 480px) {
    :root {
        --header-height: 60px;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .page-title h1 {
        font-size: 1.5rem;
    }
    
    .clock-time,
    .registro-time {
        font-size: 2.5rem;
    }
    
    .login-card {
        padding: 1.5rem;
    }
    
    .punch-btn {
        min-height: 140px;
    }
    
    .chart-bars {
        height: 80px;
    }
    
    .bar-container {
        height: 60px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    .sidebar,
    .mobile-header,
    .toast-container,
    .modal-overlay,
    .loading-screen {
        display: none !important;
    }
    
    .main-content {
        margin: 0;
        padding: 0;
    }
    
    .glass-card {
        background: white;
        border: 1px solid #ddd;
        box-shadow: none;
    }
}
