:root {
    /* DailyTickers World-Class Theme - Institutional Palette */
    --bg-app: #f8fafc;
    --bg-panel: rgba(255, 255, 255, 0.9);
    --bg-sidebar: rgba(255, 255, 255, 0.98);

    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;

    --accent: #2563eb;
    /* Royal Blue */
    --accent-gradient: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    --accent-glow: rgba(37, 99, 235, 0.15);

    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;

    --border: 1px solid #e2e8f0;
    --glass-border: 1px solid rgba(255, 255, 255, 0.6);

    --radius-sm: 6px;
    --radius: 12px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.05);

    --header-height: 64px;
    --anim-speed: 0.3s;
}

body {
    background-color: var(--bg-app);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

button {
    font-family: inherit;
    cursor: pointer;
}

/* --- ANIMATIONS --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp var(--anim-speed) ease-out forwards;
    opacity: 0;
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

/* --- LAYOUT --- */
.app-layout {
    display: flex;
    min-height: 100vh;
    max-width: 1920px;
    margin: 0 auto;
}

/* Old sidebar-nav/context rules removed — now handled by sidebar.css */

/* Main Content */
.main-content {
    flex: 1;
    padding: 3rem 4rem;
    max-width: 100%;
    /* Allow expansion */
    width: 0;
    /* Flex fix */
    box-sizing: border-box;
}

/* Mobile Header */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: var(--border);
    padding: 0 1.5rem;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
}

.mobile-menu-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-primary);
}

/* --- COMPONENTS --- */

/* Brand - Matched to dailytickers.com */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 16px;
    color: #0f172a;
    letter-spacing: 0.02em;
    margin-bottom: 2rem;
}

.brand img {
    height: 32px;
    width: 32px;
}

/* Navigation */
.nav-section {
    margin-bottom: 2rem;
}

.nav-title {
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    padding-left: 12px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
}

.nav-link:hover {
    background: #f1f5f9;
    color: var(--text-primary);
}

.nav-link.active {
    background: #eff6ff;
    color: var(--accent);
    font-weight: 600;
}

.nav-link i {
    width: 24px;
    margin-right: 10px;
    font-size: 1em;
    text-align: center;
}

/* Cards */
.mw-card {
    background: var(--bg-panel);
    border: var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.mw-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 0.75rem;
}

.mw-card-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

/* Tables - Institutional Style */
.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: 0.85rem;
    border: 1px solid #e2e8f0;
}

.data-table th {
    text-align: left;
    padding: 10px 14px;
    background: #f8fafc;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid #cbd5e1;
    white-space: nowrap;
}

.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #e2e8f0;
    color: var(--text-primary);
    background: white;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: #f8fafc;
}

/* Typography */
h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 1rem 0;
    line-height: 1.2;
    color: var(--text-primary);
}

h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 3rem 0 1.5rem 0;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

h2::before {
    content: '';
    display: block;
    width: 4px;
    height: 24px;
    background: var(--accent);
    margin-right: 12px;
    border-radius: 2px;
}

h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
}

p {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    color: var(--text-secondary);
}

.header-meta {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.lead {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 65ch;
    line-height: 1.6;
}

/* Utilities */
.text-green {
    color: var(--success);
    font-weight: 600;
}

.text-red {
    color: var(--danger);
    font-weight: 600;
}

.text-blue {
    color: var(--accent);
    font-weight: 600;
}

.text-warning {
    color: var(--warning);
    font-weight: 600;
}

.text-muted {
    color: var(--text-muted);
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.badge {
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    background: #f1f5f9;
    color: var(--text-secondary);
}

.badge-blue {
    background: #eff6ff;
    color: var(--accent);
}

/* Level Selector */
.level-selector {
    display: flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 8px;
    margin-top: auto;
}

.level-btn {
    flex: 1;
    text-align: center;
    padding: 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
}

.level-btn:hover {
    color: var(--text-primary);
}

.level-btn.active {
    background: white;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

/* --- RESPONSIVE --- */
@media (max-width: 1200px) {
    .app-layout {
        flex-direction: column;
    }

    /* Old sidebar-nav/context mobile rules removed — now handled by sidebar.css */

    .main-content {
        width: 100%;
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 900px) {
    .app-layout {
        padding-top: var(--header-height);
    }

    .mobile-header {
        display: flex;
    }

    /* Old sidebar-nav mobile toggle removed — now handled by sidebar.css */

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

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.25rem;
    }
}

/* ── Series Tab Header ───────────────────────────────── */
.series-tab-header {
    text-align: center;
    margin: 2rem 0 1.25rem;
}
.series-tab-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.series-tab-title i { color: #6366f1; }
.series-tab-sub {
    color: #94a3b8;
    margin: 0.4rem 0 0;
    font-size: 0.92rem;
    line-height: 1.5;
}

/* ── Parcours Guidés ─────────────────────────────────── */
.parcours-section {
    max-width: 920px;
    margin: 0.5rem auto 2.5rem;
}
.parcours-section > h3 {
    font-size: 0.7rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    margin: 0 0 1.25rem 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.parcours-section > h3 i { font-size: 0.75rem; }
.parcours-item {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 20px;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
    overflow: hidden;
}
.parcours-item:hover {
    box-shadow: 0 8px 30px -6px rgba(0,0,0,0.1);
}
.parcours-item[open] {
    border-color: rgba(0,0,0,0.08);
    box-shadow: 0 12px 40px -8px rgba(0,0,0,0.12);
}
.parcours-item summary {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    list-style: none;
    font-weight: 700;
    font-size: 1rem;
    color: #0f172a;
    background: transparent;
    border: none;
    border-radius: 0;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.parcours-item summary::-webkit-details-marker { display: none; }
.parcours-item summary::before { display: none; }
.parcours-item summary:hover { background: rgba(0,0,0,0.015); }
.parcours-item[open] summary {
    background: transparent;
    padding-bottom: 0.75rem;
}
.parcours-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.parcours-meta { flex: 1; min-width: 0; }
.parcours-meta .parcours-title {
    display: block;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.3;
}
.parcours-meta .parcours-sub {
    display: block;
    font-size: 0.77rem;
    color: #94a3b8;
    font-weight: 500;
    margin-top: 0.2rem;
    letter-spacing: 0.01em;
}
.parcours-chevron {
    color: #cbd5e1;
    font-size: 0.7rem;
    transition: transform 0.3s cubic-bezier(.4,0,.2,1), color 0.2s;
    flex-shrink: 0;
}
.parcours-item[open] .parcours-chevron {
    transform: rotate(90deg);
    color: #64748b;
}
.parcours-steps {
    padding: 0 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.parcours-step {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    text-decoration: none;
    color: #334155;
    font-size: 0.88rem;
    transition: background 0.15s, transform 0.15s;
    position: relative;
}
.parcours-step:hover {
    background: #f8fafc;
    transform: translateX(2px);
}
.parcours-step-num {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    color: #94a3b8;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}
.parcours-step:hover .parcours-step-num {
    background: #e2e8f0;
    color: #64748b;
}
.parcours-step-new .parcours-step-num {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    box-shadow: 0 2px 6px rgba(37,99,235,0.3);
}
.parcours-step-new:hover .parcours-step-num {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
}
.parcours-step-title {
    font-weight: 600;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.parcours-step-badge {
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    background: #f1f5f9;
    color: #64748b;
    margin-left: auto;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}
.parcours-step-badge-new {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #2563eb;
    font-weight: 800;
}
@media (max-width: 768px) {
    .parcours-section { margin: 0.5rem auto 1.5rem; }
    .parcours-item summary { padding: 1rem 1.15rem; gap: 0.85rem; }
    .parcours-icon { width: 38px; height: 38px; font-size: 0.95rem; border-radius: 10px; }
    .parcours-meta .parcours-title { font-size: 0.95rem; }
    .parcours-steps { padding: 0 0.85rem 1rem; }
    .parcours-step { padding: 0.55rem 0.65rem; font-size: 0.82rem; gap: 0.65rem; }
    .parcours-step-num { width: 24px; height: 24px; font-size: 0.65rem; }
    .parcours-step-badge { font-size: 0.58rem; padding: 0.15rem 0.4rem; }
}