* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: #1e293b;
    padding: 20px;
    border-right: 1px solid #334155;
}

.logo h2 {
    color: #60a5fa;
    margin-bottom: 30px;
    font-size: 1.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.nav-link span {
    margin-right: 12px;
    font-size: 1.2rem;
}

.nav-link:hover,
.nav-link.active {
    background: #334155;
    color: #60a5fa;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

h1 {
    font-size: 2rem;
    margin-bottom: 24px;
    color: #f1f5f9;
}

h2 {
    font-size: 1.25rem;
    margin-bottom: 16px;
    color: #60a5fa;
}

/* Pages */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* Cards */
.card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 24px;
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    border-color: #475569;
}

.stat-card {
    text-align: center;
}

.stat {
    font-size: 2.5rem;
    font-weight: bold;
    color: #60a5fa;
    margin-top: 8px;
}

/* Form Elements */
.input,
textarea,
select {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 14px;
}

textarea {
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
}

.input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #60a5fa;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-primary:hover {
    transform: scale(1.02);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading */
.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.loading.active {
    display: block;
}

.spinner {
    border: 3px solid #334155;
    border-top: 3px solid #60a5fa;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Results */
.result {
    display: none;
    margin-top: 16px;
    padding: 16px;
    border-radius: 8px;
    background: #0f172a;
}

.result.active {
    display: block;
}

.result.success {
    border: 2px solid #10b981;
}

.result.error {
    border: 2px solid #ef4444;
}

.result img {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 12px;
}

.result pre {
    background: #000;
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin-top: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #334155;
    }

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
}