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

:root {
    --primary: #1e3a5f;
    --primary-light: #2c5282;
    --primary-lighter: #3182ce;
    --primary-bg: #ebf4ff;
    --bg: #f0f2f5;
    --surface: #ffffff;
    --text: #1a202c;
    --text-secondary: #718096;
    --border: #e2e8f0;
    --border-dark: #cbd5e0;
    --success: #38a169;
    --warning: #d69e2e;
    --danger: #e53e3e;
    --header-h: 64px;
    --sidebar-w: 300px;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
}

html { font-size: 15px; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
}

/* ===== HEADER ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-h);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 24px;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

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

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

.header-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-logo {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: -0.5px;
}

.header-brand h1 {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.header-subtitle {
    font-size: 0.8rem;
    opacity: 0.8;
    font-weight: 400;
}

/* ===== LAYOUT ===== */
.layout {
    display: flex;
    margin-top: var(--header-h);
    height: calc(100vh - var(--header-h));
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 20px 20px 12px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-secondary);
    font-weight: 600;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius: 4px; }

.nav-section { margin-bottom: 2px; }

.nav-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    cursor: pointer;
    user-select: none;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    transition: background 0.15s;
    border-left: 3px solid transparent;
}

.nav-section-header:hover { background: var(--bg); }

.nav-section-header .section-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.nav-section-header .chevron {
    margin-left: auto;
    font-size: 0.7rem;
    transition: transform 0.2s;
    color: var(--text-secondary);
}

.nav-section.open > .nav-section-header .chevron { transform: rotate(90deg); }

.nav-section-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.nav-section.open > .nav-section-items { max-height: 2000px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px 8px 42px;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--text-secondary);
    transition: all 0.15s;
    border-left: 3px solid transparent;
    line-height: 1.35;
}

.nav-item:hover {
    background: var(--bg);
    color: var(--text);
}

.nav-item.active {
    background: var(--primary-bg);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}

.nav-item .item-icon {
    font-size: 0.7rem;
    flex-shrink: 0;
    width: 16px;
    text-align: center;
}

.nav-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 20px;
}

.nav-item.nav-special {
    font-weight: 600;
    color: var(--primary-light);
}

/* ===== MAIN ===== */
.main {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

.main::-webkit-scrollbar { width: 6px; }
.main::-webkit-scrollbar-track { background: transparent; }
.main::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius: 4px; }

/* ===== WELCOME ===== */
.welcome-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--header-h) - 64px);
}

.welcome-content {
    text-align: center;
    max-width: 500px;
}

.welcome-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 28px;
    letter-spacing: -1px;
    margin: 0 auto 24px;
    box-shadow: 0 4px 12px rgba(30,58,95,0.3);
}

.welcome-content h2 {
    font-size: 1.6rem;
    margin-bottom: 12px;
    color: var(--primary);
}

.welcome-content > p {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.welcome-stats {
    display: flex;
    gap: 24px;
    justify-content: center;
}

.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 24px;
    min-width: 100px;
    box-shadow: var(--shadow);
}

.stat-number {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== CONTENT SCREEN ===== */
.content-header {
    margin-bottom: 24px;
}

.breadcrumb {
    background: none;
    border: none;
    color: var(--primary-lighter);
    font-size: 0.82rem;
    cursor: pointer;
    padding: 0;
    margin-bottom: 8px;
    font-family: inherit;
}

.breadcrumb:hover { text-decoration: underline; }

.content-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.content-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== VIDEO ===== */
.video-container {
    margin-bottom: 32px;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.video-container::before {
    content: "";
    display: block;
    padding-top: 56.25%;
}

.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
}

/* ===== DOCUMENTS ===== */
.documents-section {
    margin-top: 8px;
}

.documents-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

.doc-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.15s;
    box-shadow: var(--shadow);
}

.doc-card:hover {
    border-color: var(--primary-lighter);
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.doc-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.doc-icon.pdf { background: #e53e3e; }
.doc-icon.xlsx, .doc-icon.xlsm { background: #38a169; }
.doc-icon.docx { background: #3182ce; }

.doc-info { flex: 1; min-width: 0; }

.doc-name {
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.doc-meta {
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.doc-download {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.75rem;
    color: var(--primary-lighter);
    transition: background 0.15s;
}

.doc-card:hover .doc-download { background: var(--primary-bg); }

/* ===== OVERLAY ===== */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 49;
}

.overlay.active { display: block; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .menu-toggle { display: flex; }

    .sidebar {
        position: fixed;
        top: var(--header-h);
        left: 0;
        bottom: 0;
        z-index: 50;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: none;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 12px rgba(0,0,0,0.1);
    }

    .main { padding: 20px; }

    .welcome-stats { flex-direction: column; align-items: center; }

    .doc-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .header { padding: 0 16px; }
    .header-brand h1 { font-size: 1rem; }
    .header-subtitle { display: none; }
    .main { padding: 16px; }
    .content-header h2 { font-size: 1.2rem; }
}
