:root {
    --bg-dark: #0f172a;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --primary: #6366f1;
    --primary-low: rgba(99, 102, 241, 0.15);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.05);
    --header-height: 72px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
}

/* Glassmorphism primitives */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Essential Utilities (Tailwind-like) */
.flex { display: flex !important; }
.flex-col { flex-direction: column !important; }
.items-center { align-items: center !important; }
.justify-center { justify-content: center !important; }
.justify-between { justify-content: space-between !important; }
.w-full { width: 100% !important; }
.h-screen { height: 100vh !important; }
.min-h-screen { min-height: 100vh !important; }

/* Direct Fix for Auth Centering */
#auth-root {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 100vh !important;
    background-color: var(--bg-dark);
    z-index: 9999;
}

#auth-root.hidden {
    display: none !important;
}

#auth-root main {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 100% !important;
    max-width: 420px !important;
    margin: 0 !important;
}

.p-6 { padding: 1.5rem; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mr-2 { margin-right: 0.5rem; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.hidden { display: none !important; }

/* Layout V2 */
.v2-layout {
    display: grid;
    grid-template-columns: auto 1fr;
    min-height: 100vh;
    transition: all 0.3s ease;
}

.v2-sidebar {
    background: rgba(15, 23, 42, 0.98);
    border-right: 1px solid var(--border);
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    width: 260px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: sticky;
    top: 0;
    height: 100vh;
}

/* 3-State Logic */
.v2-sidebar.collapsed {
    width: 80px;
    padding: 2rem 0.5rem;
}

.v2-sidebar.collapsed .sidebar-logo span,
.v2-sidebar.collapsed .nav-item span {
    display: none;
}

.v2-sidebar.collapsed .sidebar-logo {
    justify-content: center;
}

.v2-sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 0.75rem;
}

.v2-sidebar.collapsed .nav-item i {
    font-size: 1.5rem;
    margin: 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    transition: all 0.3s;
}

.sidebar-logo img {
    height: 32px;
    width: 32px;
    object-fit: contain;
}

.nav-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Quick Access / Acesso RÁPIDO Style */
.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    border-radius: 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-item i {
    font-size: 1.25rem;
    transition: all 0.3s;
}

.nav-item:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--primary);
    transform: translateX(4px);
}

.v2-sidebar.collapsed .nav-item:hover {
    transform: scale(1.1);
}

.nav-item.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.4);
    border-color: var(--primary);
}

.nav-item.active i {
    color: white !important;
}

.v2-nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    border-radius: 12px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s;
    margin-bottom: 0.5rem;
}

.v2-nav-item:hover, .v2-nav-item.active {
    background: var(--primary-low);
    color: var(--primary);
}

.v2-content {
    padding: 2rem;
    max-width: 100%; /* Changed from 1400px to avoid alignment issues */
    width: 100%;
    min-height: calc(100vh - var(--header-height, 70px));
}

/* Forms & Buttons V2 */
.v2-input {
    width: 100%;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    color: white;
    outline: none;
    transition: border-color 0.2s;
}

.v2-input:focus {
    border-color: var(--primary);
}

.v2-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

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

.v2-btn-primary:hover {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.v2-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid var(--border);
}

.v2-btn-secondary:hover { background: hsla(0, 0%, 100%, 0.1); }

.v2-icon-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: hsla(0, 0%, 100%, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.v2-icon-btn:hover {
    background: hsla(230, 85%, 65%, 0.1);
    color: var(--primary);
    border-color: var(--primary);
}

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

/* Punch Interface (Fase 4 Preview) */
.v2-punch-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(167, 139, 250, 0.05));
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.v2-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status-working { background-color: var(--success); box-shadow: 0 0 10px var(--success); }
.status-paused { background-color: var(--warning); box-shadow: 0 0 10px var(--warning); }
.status-offline { background-color: var(--text-muted); }

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

.animate-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Responsive Utilities */
@media (min-width: 1025px) {
    .lg\:hidden { display: none !important; }
}

@media (max-width: 1024px) {
    .v2-layout {
        grid-template-columns: 1fr;
    }
    
    .v2-sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 280px;
        z-index: 2000;
        transition: transform 0.3s ease;
        background: var(--bg-dark);
        box-shadow: 20px 0 50px rgba(0,0,0,0.5);
    }
    
    .v2-sidebar.active {
        transform: translateX(280px);
    }

    .v2-sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        backdrop-filter: blur(4px);
        z-index: 1999;
        transition: opacity 0.3s;
    }
    
    .v2-content {
        padding: 1rem;
    }
}

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

.report-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.report-card:hover {
    background: var(--primary-low);
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(99, 102, 241, 0.2);
}

.report-card i {
    font-size: 3rem;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    margin-bottom: 0.5rem;
}

/* Settings Logo Box */
.logo-upload-box {
    border: 2px dashed var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    transition: all 0.2s;
    background: rgba(255,255,255,0.02);
    position: relative;
    overflow: hidden;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.logo-upload-box:hover {
    border-color: var(--primary);
    background: var(--primary-low);
}

.logo-upload-box img {
    max-width: 140px;
    max-height: 140px;
    object-fit: contain;
    border-radius: 12px;
}
