:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --bg-dark: #1e293b;
    --bg-light: #f1f5f9;
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --radius: 0.5rem;
    --sidebar-width: 260px;
    --header-height: 70px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; line-height: 1.6; color: var(--text); background: var(--bg); }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
ul, ol { padding-left: 1.5rem; }
li { margin-bottom: 0.25rem; }
h1, h2, h3, h4 { font-weight: 600; line-height: 1.3; margin-bottom: 1rem; }
h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; color: var(--primary); }
p { margin-bottom: 1rem; }
code { font-family: 'Courier New', monospace; background: var(--bg-light); padding: 0.2rem 0.4rem; border-radius: 0.25rem; font-size: 0.9rem; color: var(--primary); }
.container { max-width: 1000px; margin: 0 auto; padding: 0 2rem; }

/* Header */
.header { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: white; height: var(--header-height); display: flex; align-items: center; position: fixed; top: 0; left: 0; right: 0; z-index: 100; box-shadow: var(--shadow-md); }
.header .container { display: flex; align-items: center; gap: 1rem; }
.header h1 { color: white; font-size: 1.5rem; margin: 0; }
.header p { opacity: 0.9; margin: 0; font-size: 0.9rem; }

/* Sidebar */
.sidebar { position: fixed; top: var(--header-height); left: 0; bottom: 0; width: var(--sidebar-width); background: var(--bg-card); border-right: 1px solid var(--border); overflow-y: auto; z-index: 90; padding: 1rem 0; }
.sidebar-nav { list-style: none; padding: 0; margin: 0; }
.sidebar-nav li { margin: 0; }
.sidebar-nav a { display: block; padding: 0.6rem 1.5rem; color: var(--text-secondary); font-weight: 500; font-size: 0.9rem; border-left: 3px solid transparent; transition: all 0.2s; }
.sidebar-nav a:hover { color: var(--primary); background: var(--bg-light); }
.sidebar-nav a.active { color: var(--primary); background: #eff6ff; border-left-color: var(--primary); font-weight: 600; }
.sidebar-section { padding: 0.5rem 1.5rem; margin-top: 1rem; font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* Main Content */
main { margin-left: var(--sidebar-width); margin-top: var(--header-height); padding: 2rem 0; min-height: calc(100vh - var(--header-height)); }
.page-title { margin-bottom: 0.5rem; padding-bottom: 0.75rem; border-bottom: 2px solid var(--primary); display: inline-block; }
.page-intro { font-size: 1.05rem; color: var(--text-secondary); margin-bottom: 2rem; max-width: 800px; }

/* Cards */
.card { background: var(--bg-card); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem; box-shadow: var(--shadow); border: 1px solid var(--border); }
.card:hover { box-shadow: var(--shadow-md); }
.card h3 { margin-bottom: 0.75rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--bg-light); }
.card h4 { font-size: 1.1rem; margin-top: 1.25rem; margin-bottom: 0.5rem; color: var(--text); }

/* Steps */
.card ol { counter-reset: steps; list-style: none; padding: 0; }
.card ol li { counter-increment: steps; position: relative; padding-left: 2rem; margin-bottom: 0.75rem; }
.card ol li::before { content: counter(steps); position: absolute; left: 0; width: 1.5rem; height: 1.5rem; background: var(--primary); color: white; border-radius: 50%; text-align: center; line-height: 1.5rem; font-size: 0.8rem; font-weight: 600; }

/* Feature List */
.feature-list { list-style: none; padding: 0; }
.feature-list li { padding: 0.5rem 0.75rem; margin-bottom: 0.5rem; background: var(--bg-light); border-radius: var(--radius); }
.feature-list li::before { content: ""; display: inline-block; width: 8px; height: 8px; background: var(--primary); border-radius: 50%; margin-right: 0.5rem; }

/* Tables */
table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; font-size: 0.95rem; }
thead { background: var(--primary); color: white; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
th { font-weight: 600; }
tbody tr:hover { background: var(--bg-light); }
tbody tr:nth-child(even) { background: var(--bg-light); }

/* Notes */
.note { padding: 1rem; border-radius: var(--radius); margin-bottom: 1rem; border-left: 4px solid; }
.note-info { background: #e0f2fe; border-color: var(--info); }
.note-warning { background: #fef3c7; border-color: var(--warning); }
.note-success { background: #d1fae5; border-color: var(--success); }
.note-danger { background: #fee2e2; border-color: var(--danger); }
.note strong { display: block; margin-bottom: 0.25rem; }

/* Footer */
.footer { background: var(--bg-dark); color: var(--text-muted); padding: 1.5rem 0; margin-top: 2rem; text-align: center; margin-left: var(--sidebar-width); }
.footer p { margin: 0; }

/* Mobile Toggle */
.menu-toggle { display: none; background: none; border: none; color: white; font-size: 1.5rem; cursor: pointer; padding: 0.5rem; }

/* Responsive */
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.3s ease; z-index: 200; box-shadow: var(--shadow-lg); }
    .sidebar.open { transform: translateX(0); }
    main { margin-left: 0; }
    .footer { margin-left: 0; }
    .menu-toggle { display: block; }
    .overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 150; }
    .overlay.active { display: block; }
}

@media (max-width: 600px) {
    html { font-size: 14px; }
    .container { padding: 0 1rem; }
    thead { display: none; }
    table, tbody, tr, td { display: block; }
    tr { margin-bottom: 1rem; border: 1px solid var(--border); border-radius: var(--radius); }
    td { padding: 0.5rem 1rem; }
    td::before { content: attr(data-label); font-weight: 600; display: block; }
}

@media print {
    .sidebar, .header, .footer, .menu-toggle { display: none; }
    main { margin-left: 0; margin-top: 0; }
    .card { box-shadow: none; border: 1px solid #ddd; page-break-inside: avoid; }
}

/* Sidebar Search */
.sidebar-search { padding: 0.75rem 1rem; }
.sidebar-search input { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.85rem; background: var(--bg-light); transition: all 0.2s; }
.sidebar-search input:focus { outline: none; border-color: var(--primary); background: white; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.sidebar-search input::placeholder { color: var(--text-muted); }
.search-results-list { list-style: none; padding: 0; margin: 0; max-height: 200px; overflow-y: auto; background: white; border: 1px solid var(--border); border-radius: var(--radius); margin-top: 0.25rem; display: none; }
.search-results-list.active { display: block; }
.search-results-list li { margin: 0; }
.search-results-list a { display: block; padding: 0.5rem 0.75rem; color: var(--text); font-size: 0.85rem; border-bottom: 1px solid var(--bg-light); }
.search-results-list a:hover { background: #eff6ff; color: var(--primary); }
.search-results-list .no-result { padding: 0.75rem; color: var(--text-muted); font-size: 0.85rem; text-align: center; }
