@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

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

body {
    font-family: var(--font-stack);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    /* Default hidden for desktop app-like feel */
    /* We now rely on the bg-slider for background, but keep a fallback */
    background: #f0f2f5;
}

/* Glassmorphism Base */
.glass {
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
}

/* --- Layout --- */
#dashboard {
    position: relative;
    height: 100vh;
    display: none;
    /* JS toggles this */
    flex-direction: column;
    z-index: 10;
}

#dashboard.visible {
    display: flex;
    animation: fadeIn 0.8s ease-out forwards;
}

/* Header */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 3rem;
    margin: 20px 30px;
    border-radius: var(--radius-xl);
    z-index: 20;
}

.brand {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.05);
    /* very subtle container */
    padding: 4px;
    border-radius: var(--radius-l);
    gap: 5px;
}

.nav-tab {
    padding: 8px 20px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-m);
    transition: all 0.3s var(--ease-smooth);
    font-size: 0.95rem;
}

.nav-tab:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.3);
}

.nav-tab.active {
    background: white;
    color: var(--primary);
    /* We use text color instead of bg for cleaner look */
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

[data-theme="dark"] .nav-tab.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Content Area */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 0 40px 40px 40px;
    /* Hide scrollbar */
    scrollbar-width: none;
}

.content-area::-webkit-scrollbar {
    display: none;
}

.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.module-title {
    font-size: 1.8rem;
    font-weight: 600;
}

/* Grid System */
.data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    padding-bottom: 80px;
    /* Space for FAB */
}

/* Cards */
.card-tile {
    position: relative;
    padding: 24px;
    border-radius: var(--radius-l);
    transition: all 0.4s var(--ease-elastic);
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 160px;
}

.card-tile:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-lg);
    background: var(--surface-hover);
    border-color: rgba(255, 255, 255, 0.8);
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Hover Actions inside Card */
.card-actions-hover {
    position: absolute;
    top: 15px;
    right: 15px;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
}

.card-tile:hover .card-actions-hover {
    opacity: 1;
    transform: translateX(0);
}

.icon-btn-sm {
    background: rgba(255, 255, 255, 0.8);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    color: #e74c3c;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.icon-btn-sm:hover {
    background: white;
    transform: scale(1.1);
}

/* Floating Action Button (FAB) */
.fab-container {
    position: fixed;
    bottom: 40px;
    right: 40px;
    z-index: 100;
}

.fab-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s var(--ease-elastic);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab-btn:hover {
    transform: scale(1.1) rotate(90deg);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    z-index: 200;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}

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

.modal-card {
    width: 90%;
    max-width: 500px;
    background: var(--surface-hover);
    /* More opaque */
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    transform: scale(0.9);
    transition: transform 0.3s var(--ease-elastic);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-overlay.open .modal-card {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.close-modal {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

/* Forms in Modal */
.modal-input {
    width: 100%;
    padding: 14px 18px;
    margin-bottom: 1.2rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-m);
    font-family: inherit;
    font-size: 1rem;
    transition: 0.3s;
}

.modal-input:focus {
    background: white;
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 184, 148, 0.1);
}

.primary-btn {
    width: 100%;
    padding: 15px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-m);
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: 0.3s;
}

.primary-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.secondary-btn {
    width: 100%;
    padding: 15px;
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    /* Text color matches primary theme color */
    border-radius: var(--radius-m);
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: 0.3s;
}

.secondary-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* Background Slider & Lock Screen (Preserved) */
/* (Re-use previous styles if not overwritten, but ensure they match new variables) */

/* Re-stating critical lock styles to ensure integrity */
#bg-slider {
    position: fixed;
    inset: 0;
    z-index: -2;
    background: #333;
}

#bg-slider .slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    opacity: 0;
    transition: opacity 1.5s;
    background-position: center;
}

#bg-slider .slide.active {
    opacity: 1;
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
    z-index: -1;
    pointer-events: none;
}

#lock-screen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.6s cubic-bezier(0.8, 0, 0.2, 1);
}

#lock-screen.hidden {
    transform: translateY(-100%);
}

.lock-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    padding: 3rem;
    border-radius: 32px;
    text-align: center;
    width: 340px;
}

.lock-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    margin-bottom: 1.5rem;
    object-fit: cover;
    border: 3px solid var(--primary);
}

.lock-input {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
    text-align: center;
}

.lock-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
}