:root {
    --bg: #f5f6f8;
    --panel: #ffffff;
    --muted: #667085;
    --text: #111827;
    --line: #e5e7eb;
    --primary: #111111;
    --primary-text: #ffffff;
    --accent: #2563eb;
    --tag: #eef2ff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px 1fr;
}

.sidebar {
    border-right: 1px solid var(--line);
    background: #f1f2f4;
    padding: 20px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    margin-bottom: 18px;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--primary);
    color: var(--primary-text);
    font-weight: 700;
}

.brand h1 {
    margin: 0;
    font-size: 18px;
    line-height: 1.1;
}

.brand p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.nav-section {
    margin: 14px 0;
}

.nav-section h3 {
    margin: 8px 10px;
    font-size: 13px;
    color: #6b7280;
    font-weight: 600;
}

.nav-item {
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    color: #1f2937;
    cursor: pointer;
    margin-bottom: 4px;
}

.nav-item:hover {
    background: #e5e7eb;
}

.nav-item.active {
    background: #e5e7eb;
    font-weight: 600;
}

.main-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    padding: 16px 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar h2 {
    margin: 0;
    font-size: 30px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn {
    border: none;
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 14px;
    cursor: pointer;
}

.btn-primary {
    background: #0f172a;
    color: #fff;
}

.btn-secondary {
    background: #f3f4f6;
    color: #1f2937;
}

.workspace {
    padding: 24px;
    display: grid;
    gap: 18px;
}

.hero {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 20px;
}

.hero h3 {
    margin: 0 0 8px;
    font-size: 22px;
}

.hero p {
    margin: 0;
    color: var(--muted);
}

.plan-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.plan-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px;
}

.plan-card.featured {
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb inset;
}

.plan-card h4 {
    margin: 0 0 8px;
}

.price {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
}

.price span {
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.module-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px;
    cursor: pointer;
}

.module-card h4 {
    margin: 0 0 8px;
}

.module-card p {
    margin: 0;
    color: var(--muted);
    min-height: 58px;
}

.module-card:hover,
.module-card.active {
    border-color: #c7d2fe;
    box-shadow: 0 0 0 1px #c7d2fe inset;
}

.tag {
    display: inline-block;
    margin-top: 12px;
    font-size: 12px;
    background: var(--tag);
    color: #3730a3;
    padding: 6px 10px;
    border-radius: 999px;
}

.details-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 18px;
}

.details-panel h3 {
    margin: 0 0 8px;
}

.details-panel p,
.details-panel li {
    color: var(--muted);
}

.auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}

.auth-overlay.show {
    display: flex;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: var(--panel);
    border-radius: 16px;
    border: 1px solid var(--line);
    padding: 18px;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.auth-tab {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    font-weight: 600;
}

.auth-tab.active {
    background: #0f172a;
    color: #fff;
    border-color: #0f172a;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-form h3 {
    margin: 8px 0;
}

.auth-form p {
    margin: 0 0 12px;
    color: var(--muted);
}

.auth-form label {
    display: block;
    font-size: 13px;
    margin: 10px 0 6px;
}

.auth-form input,
.auth-form select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    font-size: 14px;
}

.full {
    width: 100%;
    margin-top: 14px;
}

@media (max-width: 1200px) {
    .module-grid,
    .plan-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .topbar {
        position: static;
    }

    .module-grid,
    .plan-cards {
        grid-template-columns: 1fr;
    }
}
