:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-main: #f8fafc;
    --bg-side: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --card-bg: #ffffff;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --purple: #8b5cf6;
    --green: #10b981;
    --orange: #f59e0b;
    --blue: #3b82f6;
    --red: #ef4444;
    --accent: #ec4899;
    --primary-light: rgba(99, 102, 241, 0.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.4;
    font-size: 0.9rem;
    overflow: hidden;
    height: 100vh;
}

    /* Loading Overlay */
    #app-loading {
        position: fixed;
        inset: 0;
        background: var(--bg-main);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        z-index: 1000;
        gap: 20px;
    }

    .loader {
        width: 48px;
        height: 48px;
        border: 4px solid var(--border);
        border-bottom-color: var(--primary);
        border-radius: 50%;
        display: inline-block;
        box-sizing: border-box;
        animation: rotation 1s linear infinite;
    }

    @keyframes rotation {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }

    .app-container {
        display: none; /* Hidden until auth check */
        flex-direction: column;
        height: 100vh;
    }

.content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.page-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.page-title p {
    color: var(--text-muted);
    margin-top: 4px;
}

.header-actions {
    display: flex;
    gap: 12px;
}

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

@keyframes slideUp {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tab System */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Sub-tab System */
.sub-content {
    display: none;
    animation: fadeIn 0.2s ease-out;
}

.sub-content.active {
    display: block;
}

/* Global Responsive */
@media (max-width: 768px) {
    .content {
        padding: 24px 16px;
    }
    .header-actions {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .header-actions button {
        width: 100%;
        justify-content: center;
    }
}
