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

:root {
    --color-primary: #0B7A75;
    --color-primary-dark: #065A56;
    --color-primary-light: #E8F5F4;
    --color-accent: #D4943A;
    --color-accent-hover: #C0842E;
    --color-bg: #F4F3F0;
    --color-surface: #FFFFFF;
    --color-text: #1B2A3D;
    --color-text-secondary: #5F6D7E;
    --color-border: #E3E6EB;
    --color-success: #2E9E5E;
    --color-success-light: #EAF7EF;
    --color-sidebar: #1B2A3D;
    --color-sidebar-hover: #263849;
    --color-sidebar-active: #0B7A75;
    --sidebar-width: 272px;
    --header-height: 64px;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow-sm: 0 1px 3px rgba(27, 42, 61, 0.06);
    --shadow-md: 0 4px 12px rgba(27, 42, 61, 0.08);
    --shadow-lg: 0 8px 30px rgba(27, 42, 61, 0.1);
    --font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ========== APP SHELL ========== */

.app {
    display: flex;
    min-height: 100vh;
}

/* ========== MOBILE HEADER ========== */

.header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--color-sidebar);
    color: #fff;
    align-items: center;
    padding: 0 20px;
    z-index: 100;
    gap: 16px;
}

.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.header-brand h1 {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.header-brand span {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* ========== SIDEBAR ========== */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--color-sidebar);
    color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 28px 24px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand h1 {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.sidebar-brand p {
    font-size: 0.8rem;
    opacity: 0.55;
    margin-top: 4px;
    font-weight: 400;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s ease;
    cursor: pointer;
    position: relative;
}

.nav-item:hover {
    background: var(--color-sidebar-hover);
    color: #fff;
}

.nav-item.active {
    background: var(--color-sidebar-active);
    color: #fff;
}

.nav-item .nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.8;
}

.nav-item.active .nav-icon {
    opacity: 1;
}

.nav-section-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.35);
    padding: 20px 12px 8px;
    font-weight: 600;
}

.module-num {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.nav-item.active .module-num {
    background: rgba(255, 255, 255, 0.2);
}

.nav-check {
    margin-left: auto;
    width: 18px;
    height: 18px;
    color: #4ADE80;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s ease;
}

.nav-check.visible {
    opacity: 1;
    transform: scale(1);
}

.sidebar-progress {
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    margin-bottom: 10px;
}

.progress-label span:first-child {
    opacity: 0.6;
}

.progress-label span:last-child {
    font-weight: 600;
    color: #4ADE80;
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0B7A75, #4ADE80);
    border-radius: 3px;
    width: 0%;
    transition: width 0.5s ease;
}

/* ========== SIDEBAR OVERLAY ========== */

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-overlay.visible {
    opacity: 1;
}

/* ========== MAIN CONTENT ========== */

.main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.view {
    display: none;
    animation: fadeIn 0.25s ease;
}

.view.active {
    display: block;
}

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

/* ========== DASHBOARD ========== */

.dashboard {
    padding: 48px 40px;
    max-width: 960px;
    margin: 0 auto;
}

.dashboard-hero {
    margin-bottom: 40px;
}

.dashboard-hero h2 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    color: var(--color-text);
}

.dashboard-hero p {
    font-size: 1.05rem;
    color: var(--color-text-secondary);
    max-width: 560px;
    line-height: 1.65;
}

.dashboard-progress-bar {
    margin-top: 24px;
    background: var(--color-border);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    max-width: 400px;
}

.dashboard-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-success));
    border-radius: 4px;
    width: 0%;
    transition: width 0.5s ease;
}

.dashboard-progress-text {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin-top: 8px;
}

.module-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.module-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--color-border);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.module-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.module-card[data-module="1"]::before { background: #0B7A75; }
.module-card[data-module="2"]::before { background: #3B82BD; }
.module-card[data-module="3"]::before { background: #D4943A; }
.module-card[data-module="4"]::before { background: #7C5CBF; }
.module-card[data-module="5"]::before { background: #2E9E5E; }

.module-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.module-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.module-card-num {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-secondary);
}

.module-card-status {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--color-bg);
    color: var(--color-text-secondary);
}

.module-card-status.completed {
    background: var(--color-success-light);
    color: var(--color-success);
}

.module-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.module-card p {
    font-size: 0.88rem;
    color: var(--color-text-secondary);
    line-height: 1.55;
}

/* ========== MODULE VIEW ========== */

.module-view {
    max-width: 820px;
    margin: 0 auto;
    padding: 40px;
}

.module-header {
    margin-bottom: 32px;
}

.module-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

.module-label[data-module="1"] { color: #0B7A75; }
.module-label[data-module="2"] { color: #3B82BD; }
.module-label[data-module="3"] { color: #D4943A; }
.module-label[data-module="4"] { color: #7C5CBF; }
.module-label[data-module="5"] { color: #2E9E5E; }

.module-header h2 {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.module-header p {
    font-size: 1rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    max-width: 620px;
}

/* ========== VIDEO ========== */

.video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    overflow: hidden;
    background: #0F1923;
    margin-bottom: 36px;
    box-shadow: var(--shadow-lg);
}

.video-container video {
    display: block;
    width: 100%;
    height: 100%;
    border: none;
    object-fit: contain;
    background: #0F1923;
}

.video-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.video-placeholder .play-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.video-placeholder .play-icon svg {
    width: 24px;
    height: 24px;
    fill: rgba(255, 255, 255, 0.6);
    margin-left: 3px;
}

.video-placeholder span {
    font-size: 0.85rem;
    font-weight: 500;
}

/* ========== GUIDE CONTENT ========== */

.guide-content {
    background: var(--color-surface);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    padding: 40px;
    margin-bottom: 32px;
}

.guide-content h3 {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-top: 36px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border);
}

.guide-content h3:first-child {
    margin-top: 0;
}

.guide-content p {
    margin-bottom: 14px;
    line-height: 1.7;
    color: var(--color-text);
}

.guide-content .lead {
    font-size: 1.02rem;
    color: var(--color-text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
}

.guide-content ol {
    margin: 14px 0;
    padding-left: 24px;
}

.guide-content ol li {
    margin-bottom: 10px;
    line-height: 1.65;
    padding-left: 4px;
}

.guide-content ol li::marker {
    color: var(--color-primary);
    font-weight: 600;
}

.guide-content strong {
    font-weight: 600;
    color: var(--color-text);
}

.guide-content .tip {
    background: var(--color-primary-light);
    border-left: 3px solid var(--color-primary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 14px 18px;
    margin: 18px 0;
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--color-primary-dark);
}

.guide-content .screenshot-placeholder {
    background: var(--color-bg);
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-sm);
    padding: 20px;
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 0.82rem;
    margin: 16px 0;
}

.guide-content ul.learn-list {
    list-style: none;
    padding: 0;
    margin: 16px 0;
}

.guide-content ul.learn-list li {
    padding: 8px 0 8px 28px;
    position: relative;
    line-height: 1.6;
}

.guide-content ul.learn-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 14px;
    width: 16px;
    height: 16px;
    background: var(--color-primary-light);
    border-radius: 50%;
}

.guide-content ul.learn-list li::after {
    content: '✓';
    position: absolute;
    left: 3px;
    top: 12px;
    font-size: 0.65rem;
    color: var(--color-primary);
    font-weight: 700;
}

.screenshot {
    margin: 20px 0;
    text-align: center;
}

.screenshot img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.screenshot-phone {
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.screenshot-phone img {
    border-radius: 16px;
    border: none;
    box-shadow: var(--shadow-md);
}

.screenshot-caption {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    margin-top: 8px;
}

/* ========== MODULE ACTIONS ========== */

.module-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
}

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

.btn-complete {
    background: var(--color-primary);
    color: #fff;
}

.btn-complete:hover {
    background: var(--color-primary-dark);
}

.btn-complete.completed {
    background: var(--color-success);
}

.btn-complete.completed:hover {
    background: #268A4F;
}

.btn-ghost {
    background: none;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.btn-ghost:hover {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-text-secondary);
}

.btn svg {
    width: 16px;
    height: 16px;
}

.nav-buttons {
    display: flex;
    gap: 10px;
}

/* ========== COMPLETION BANNER ========== */

.completion-banner {
    background: linear-gradient(135deg, var(--color-primary), #0DA39E);
    color: #fff;
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    margin-bottom: 32px;
    display: none;
}

.completion-banner.visible {
    display: block;
    animation: fadeIn 0.4s ease;
}

.completion-banner h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.completion-banner p {
    opacity: 0.9;
    font-size: 1rem;
}

/* ========== RESPONSIVE ========== */

@media (max-width: 1024px) {
    .header {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.visible {
        display: block;
    }

    .main {
        margin-left: 0;
        padding-top: var(--header-height);
    }

    .dashboard {
        padding: 32px 24px;
    }

    .module-view {
        padding: 28px 20px;
    }

    .guide-content {
        padding: 28px 24px;
    }
}

@media (max-width: 640px) {
    .module-cards {
        grid-template-columns: 1fr;
    }

    .module-header h2 {
        font-size: 1.35rem;
    }

    .dashboard-hero h2 {
        font-size: 1.4rem;
    }

    .module-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .nav-buttons {
        justify-content: space-between;
    }

    .btn {
        justify-content: center;
    }

    .guide-content {
        padding: 24px 20px;
    }
}
