* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f1f5f9;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Wraps sidebar + main content */
.app-layout {
    display: flex;
    flex: 1;
}

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1e3a5f 0%, #0f172a 100%);
    color: white;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    flex-shrink: 0;
}
.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}
.nav-section {
    margin-bottom: 24px;
}
.nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.4);
    padding: 0 12px;
    margin-bottom: 8px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.15s;
}
.nav-item:hover { background: rgba(255,255,255,0.1); color: white; }
.nav-item.active { background: rgba(59, 130, 246, 0.3); color: white; }
.nav-icon { width: 20px; text-align: center; }

/* Main Content Area */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top Navigation */
.topnav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: white;
    border-bottom: 1px solid #e2e8f0;
}
.topnav-left { display: flex; align-items: center; gap: 8px; }
.app-title { font-size: 1rem; font-weight: 600; color: #1e293b; }
.topnav-divider { width: 1px; height: 20px; background: #e2e8f0; margin: 0 8px; }
.topnav-right { display: flex; align-items: center; gap: 12px; }
.breadcrumb { font-size: 0.875rem; color: #64748b; }
.breadcrumb a { color: #3b82f6; text-decoration: none; }
.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #64748b;
}
.search-box input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.875rem;
}
.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: all 0.15s;
}
.icon-btn:hover { background: #f1f5f9; color: #1e293b; }

/* User Profile */
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}
.user-profile:hover { background: #f1f5f9; }
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}
.user-info { text-align: left; }
.user-name { font-size: 0.875rem; font-weight: 500; color: #1e293b; }
.user-role { font-size: 0.75rem; color: #64748b; }

/* Page Content */
.page-content { flex: 1; padding: 24px; }
.page-header { margin-bottom: 24px; }
.page-header h2 { font-size: 1.5rem; font-weight: 600; color: #1e293b; margin-bottom: 4px; }
.page-header p { color: #64748b; font-size: 0.875rem; }

/* Content Cards */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}
.card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.card-title { font-size: 0.875rem; font-weight: 500; color: #64748b; }
.card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}
.card-icon.blue { background: #dbeafe; }
.card-icon.green { background: #dcfce7; }
.card-icon.purple { background: #f3e8ff; }
.card-icon.orange { background: #ffedd5; }
.card-value { font-size: 1.75rem; font-weight: 600; color: #1e293b; }
.card-change { font-size: 0.75rem; margin-top: 4px; }
.card-change.positive { color: #16a34a; }
.card-change.negative { color: #dc2626; }


.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s;
    border: none;
    cursor: pointer;
}
.btn-primary { background: #3b82f6; color: white; }
.btn-primary:hover { background: #2563eb; }
.btn-secondary { background: #f1f5f9; color: #475569; }
.btn-secondary:hover { background: #e2e8f0; }
.quick-links {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}
.main-content-area {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.placeholder { text-align: center; padding: 60px 20px; }
.placeholder-icon { font-size: 4rem; margin-bottom: 20px; }
.placeholder h3 { font-size: 1.25rem; color: #1e293b; margin-bottom: 8px; }
.placeholder p { color: #64748b; max-width: 400px; margin: 0 auto 24px; }

/* Download page (SPA route) */
.download-container { max-width: 900px; margin: 0 auto; }
.download-hero {
    text-align: center;
    padding: 48px 24px;
    background: linear-gradient(135deg, #1e3a5f 0%, #3b82f6 100%);
    color: white;
    border-radius: 16px;
    margin-bottom: 32px;
}
.download-hero h2 { font-size: 2rem; margin-bottom: 8px; }
.download-hero p { font-size: 1.125rem; opacity: 0.9; }
.download-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.download-cards .card h3 { font-size: 1.125rem; margin-bottom: 8px; color: #1e293b; }
.download-cards .card ol { padding-left: 20px; margin-top: 12px; }
.download-cards .card li { margin-bottom: 8px; color: #475569; line-height: 1.5; }
.download-cards .card code { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-size: 0.875rem; }
.download-cards .card strong { color: #1e293b; }
.card-subtitle { color: #64748b; font-size: 0.875rem; line-height: 1.5; margin-bottom: 12px; }
.install-details { margin-top: 16px; padding-top: 16px; border-top: 1px solid #e2e8f0; }
.install-details > strong { display: block; margin-bottom: 8px; color: #1e293b; font-size: 0.875rem; }
.install-details ol { padding-left: 20px; }
.install-details li { margin-bottom: 8px; color: #475569; line-height: 1.5; }
.code-block {
    display: block;
    margin-top: 6px;
    padding: 8px 12px;
    background: #1e293b;
    color: #e2e8f0;
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: 'Courier New', monospace;
    word-break: break-all;
}
.inline-link { color: #3b82f6; text-decoration: none; font-weight: 500; }
.inline-link:hover { text-decoration: underline; }
.how-to {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 24px;
}
.how-to h3 { font-size: 1.125rem; margin-bottom: 12px; color: #1e293b; }
.how-to p { color: #475569; line-height: 1.5; }
.how-to ol { padding-left: 20px; }
.how-to li { margin-bottom: 8px; color: #475569; line-height: 1.5; }
kbd {
    background: #e2e8f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.875rem;
    border: 1px solid #cbd5e1;
}
@media (max-width: 640px) { .download-cards { grid-template-columns: 1fr; } }
