:root {
    --bg-color: #0d0d0d;
    --panel-bg: rgba(25, 25, 25, 0.6);
    --panel-border: rgba(255, 255, 255, 0.08);
    --text-main: #f5f5f7;
    --text-muted: #86868b;
    --accent: #0066cc;
    --accent-hover: #0077ed;
    --danger: #ff3b30;
    --success: #34c759;
    --blur-amount: 20px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    height: 100vh;
    overflow: hidden;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(0, 102, 204, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(204, 0, 102, 0.1), transparent 25%);
}

.hidden { display: none !important; }

/* --- Glassmorphism --- */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}

.glass-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

/* --- App Layout --- */
.app-container {
    display: flex;
    height: 100vh;
    padding: 16px;
    gap: 16px;
}

/* Sidebar */
.sidebar {
    width: 260px;
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #ff00a0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.2rem;
}

.brand h3 {
    font-size: 1.1rem;
    font-weight: 600;
}
.brand span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: all 0.2s ease;
    display: block;
}

.nav-links a:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
}

.nav-links a.active {
    background: rgba(255,255,255,0.1);
    color: var(--text-main);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow: hidden;
}

.topbar {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.topbar h1 {
    font-size: 1.25rem;
    font-weight: 600;
}

.view-container {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 24px;
    display: flex;
    flex-direction: column;
}

/* --- Components --- */
.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease;
}
.btn-icon:hover { color: var(--text-main); }

input[type="text"], input[type="password"] {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--panel-border);
    color: var(--text-main);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s ease;
}
input:focus { border-color: var(--accent); }

/* --- Auth Card --- */
.auth-card {
    padding: 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.auth-card h2 { font-weight: 600; }
.auth-card p { color: var(--text-muted); font-size: 0.9rem; }
.error-text { color: var(--danger) !important; }

/* --- Flows Grid --- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.card {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.card h4 {
    font-size: 1.1rem;
    font-weight: 500;
}
.card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}
.tag {
    background: rgba(255,255,255,0.1);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    display: inline-block;
}
