@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    --bg: #0b1410;
    --panel: #0f1c16;
    --card: #12251c;
    --text: #e8f2ec;
    --muted: #98ada3;
    --accent: #24c08b;
    --accent-2: #0da26a;
    --danger: #f25f5c;
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    --radius: 16px;
    --spacing: 16px;
    --glass: rgba(255, 255, 255, 0.04);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: radial-gradient(circle at 20% 20%, rgba(36, 192, 139, 0.08), transparent 25%),
                radial-gradient(circle at 80% 0%, rgba(13, 162, 106, 0.12), transparent 30%),
                var(--bg);
    color: var(--text);
    font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
}

a {
    color: var(--text);
    text-decoration: none;
}

.app-shell {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 16px;
    padding: 16px;
    min-height: 100vh;
}

.sidebar {
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    padding: 16px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 12px;
    align-self: start;
    min-height: calc(100vh - 24px);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    position: sticky;
    top: 12px;
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 18px;
    box-shadow: var(--shadow);
    z-index: 5;
}

.topbar h4 {
    margin: 6px 0 0;
}

.content-area {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: calc(100vh - 32px);
}

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

.logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #0b1410;
    font-weight: 700;
    display: grid;
    place-items: center;
    box-shadow: var(--shadow);
}

.brand-name {
    font-weight: 700;
    letter-spacing: -0.4px;
}

.brand-sub {
    color: var(--muted);
    font-size: 12px;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav.vertical a {
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--muted);
    font-weight: 600;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nav.vertical a.active {
    background: var(--glass);
    border-color: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.nav-label {
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-size: 11px;
    color: var(--muted);
    margin: 10px 0 2px;
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
}

.lang-toggle a.active {
    color: var(--accent);
    font-weight: 600;
}

.sidebar-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-chip {
    display: flex;
    gap: 10px;
    align-items: center;
    background: var(--glass);
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

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

.page {
    padding: 0 4px 16px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.hero {
    display: grid;
    gap: 18px;
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: calc(var(--radius) * 1.2);
    padding: 20px;
    box-shadow: var(--shadow);
}
.hero.landing {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
}

.hero-text h1 {
    margin: 6px 0 8px;
    font-size: 28px;
    letter-spacing: -0.8px;
}

.subtitle {
    color: var(--muted);
    margin: 0 0 14px;
    line-height: 1.5;
}
.guarantee {
    background: rgba(36, 192, 139, 0.08);
    border: 1px solid rgba(36, 192, 139, 0.25);
    border-radius: 12px;
    padding: 12px;
}

.eyebrow {
    color: var(--accent);
    letter-spacing: 1px;
    font-size: 12px;
    text-transform: uppercase;
    margin: 0;
}

.actions {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.btn {
    border: none;
    border-radius: 14px;
    padding: 12px 16px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn.primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #0b1410;
    box-shadow: var(--shadow);
}

.btn.ghost {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
}

.btn.small {
    padding: 10px 12px;
    font-size: 14px;
}

.btn.icon {
    background: var(--glass);
}

.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn.icon.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #0b1410;
    animation: pulse-voice 1.5s infinite;
}

.btn.icon.active .dot {
    background: #0b1410;
    animation: pulse-dot 1s infinite;
}

@keyframes pulse-voice {
    0%, 100% { box-shadow: 0 0 0 0 rgba(36, 192, 139, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(36, 192, 139, 0); }
}

@keyframes pulse-dot {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

.badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badges span {
    background: var(--glass);
    padding: 8px 12px;
    border-radius: 12px;
    color: var(--muted);
    font-size: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.hero-card {
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    padding: 16px;
}

.card-header {
    color: var(--muted);
    margin-bottom: 10px;
    font-size: 13px;
}

.kpis, .kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.kpi, .kpi-card {
    background: var(--glass);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.kpi .label, .kpi-card .label {
    color: var(--muted);
    font-size: 13px;
}

.kpi .value, .kpi-card .value {
    font-size: 22px;
    font-weight: 700;
    margin: 4px 0;
}

.kpi .trend, .kpi-card .trend {
    font-size: 12px;
    color: var(--accent);
}

.trend.down {
    color: var(--danger);
}

.trend.neutral {
    color: var(--muted);
}

.section {
    margin-top: 18px;
    padding: 16px;
    background: var(--panel);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: var(--shadow);
}

.section.compact {
    padding: 16px;
}

.section-title {
    font-weight: 700;
    margin-bottom: 12px;
}

.grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-bottom: 20px;
}

.card {
    background: var(--card);
    border-radius: 14px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.card.feature p {
    color: var(--muted);
    margin: 6px 0 0;
    line-height: 1.4;
}

.card-title {
    font-weight: 700;
    margin-bottom: 4px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    margin-top: 8px;
}

.chart-card {
    margin-top: 12px;
    margin-bottom: 20px;
}

.chart-placeholder {
    height: 180px;
    border-radius: 12px;
    background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.03) 12px, rgba(255, 255, 255, 0.06) 12px, rgba(255, 255, 255, 0.06) 24px);
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 14px;
}

.list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-item {
    background: var(--glass);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.title {
    font-weight: 600;
}

.muted {
    color: var(--muted);
    font-size: 13px;
}

.small {
    font-size: 12px;
}

.balance {
    font-weight: 700;
}

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

.chat-window {
    background: var(--card);
    border-radius: 16px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    max-height: 360px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.chat-window::-webkit-scrollbar {
    width: 8px;
}

.chat-window::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.chat-window::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent), var(--accent-2));
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.chat-window::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
    border: none;
}

.chat-bubble {
    padding: 12px;
    border-radius: 14px;
    max-width: 90%;
}

.chat-bubble.assistant {
    background: var(--glass);
    border: 1px solid rgba(255, 255, 255, 0.05);
    align-self: flex-start;
}

.chat-bubble.user {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #0b1410;
    align-self: flex-end;
}

.sender {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 4px;
}

.chat-input {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chat-input input {
    flex: 1;
    min-width: 200px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px;
    background: var(--glass);
    color: var(--text);
}

.chat-input button {
    border: none;
}

.badge {
    background: var(--glass);
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--accent);
    font-weight: 600;
}

.badge.ghost {
    color: var(--muted);
}

.footer {
    padding: 18px;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 10px;
}

.footer-links {
    display: flex;
    gap: 12px;
}

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

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    display: inline-block;
}

.dot.warn {
    background: var(--danger);
}

.dot.neutral {
    background: var(--muted);
}

.auth-body {
    display: grid;
    place-items: center;
    min-height: 100vh;
}

.auth-shell {
    width: min(380px, 90vw);
}

.auth-card {
    background: var(--panel);
    padding: 22px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: var(--shadow);
}

.auth-header h2 {
    margin: 4px 0 6px;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--muted);
    font-size: 14px;
}

.form input,
.form select,
.form textarea {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px;
    background: var(--glass);
    color: var(--text);
    font-size: 15px;
}

/* Fix dropdown options visibility */
.form select option {
    background: #1a2f25;
    color: #e8f2ec;
    padding: 10px;
}

.form select option:hover,
.form select option:focus,
.form select option:checked {
    background: #24c08b;
    color: #0b1410;
}

select {
    cursor: pointer;
}

select option {
    background: #1a2f25;
    color: #e8f2ec;
}

/* CAPTCHA Styling */
.captcha-group {
    margin: 12px 0;
}

.captcha-question {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 8px;
    text-align: center;
}

.captcha-math {
    font-size: 18px;
    font-weight: 700;
    color: #0b1410;
    letter-spacing: 2px;
}

.captcha-input {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 4px;
}

.btn.full {
    width: 100%;
    justify-content: center;
}

.alert {
    border-radius: 12px;
    padding: 10px 12px;
    margin: 10px 0;
    font-size: 14px;
}

.alert.error {
    background: rgba(242, 95, 92, 0.12);
    border: 1px solid rgba(242, 95, 92, 0.3);
    color: #ffb3b0;
}

.alert.success {
    background: rgba(36, 192, 139, 0.12);
    border: 1px solid rgba(36, 192, 139, 0.3);
    color: #b7ffe0;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border-radius: 12px;
    overflow: hidden;
}

th, td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

th {
    color: var(--muted);
    font-weight: 600;
}

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

.actions-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.pill {
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--glass);
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 12px;
    color: var(--muted);
}
.pill.ghost {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.08);
}

form.inline {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.assistant-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 14px;
    align-items: start;
}

.chat-window.tall {
    max-height: 520px;
    min-height: 360px;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--glass);
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: var(--text);
}

.tip-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--muted);
}

.chip-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px;
}
.chip {
    padding: 8px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--muted);
    font-weight: 600;
    background: var(--glass);
}
.chip.active {
    border-color: var(--accent);
    color: var(--text);
    box-shadow: 0 8px 30px rgba(36, 192, 139, 0.25);
}
.chip:hover {
    color: var(--text);
}

@media (max-width: 768px) {
    .chip-tabs {
        width: 100%;
        margin-bottom: 8px;
    }
    .chip {
        flex: 1;
        text-align: center;
        justify-content: center;
        display: inline-flex;
    }
    .chip + .card {
        margin-top: 6px;
    }
}

/* Mobile-first responsive classes */
.desktop-only { display: none !important; }
.mobile-only { display: block !important; }

@media (min-width: 769px) {
    .desktop-only { display: block !important; }
    .mobile-only { display: none !important; }
}

/* Transactions cards (mobile-first) */
.tx-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.tx-card .tx-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}
.tx-card .tx-title {
    font-weight: 700;
    margin-bottom: 6px;
}
.tx-card .tx-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: 4px;
}
.tx-amount {
    font-weight: 700;
}

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

.mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-brand .logo {
    width: 36px;
    height: 36px;
    font-size: 14px;
}

.mobile-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lang-toggle-mobile {
    display: flex;
    gap: 4px;
}

.lang-toggle-mobile a {
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
}

.lang-toggle-mobile a.active {
    background: var(--accent);
    color: #0b1410;
}

/* Menu Toggle Button */
.menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s ease;
}

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

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

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

/* Mobile Navigation Overlay */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 150;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-nav-overlay.open {
    display: block;
    opacity: 1;
}

/* Mobile Navigation */
.mobile-nav {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100vh;
    background: var(--panel);
    z-index: 200;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    overflow: hidden;
}

.mobile-nav.open {
    right: 0;
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.menu-close {
    background: none;
    border: none;
    color: var(--text);
    font-size: 28px;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
}

.mobile-nav-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.mobile-nav-content a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    color: var(--muted);
    font-weight: 500;
    margin-bottom: 4px;
    transition: all 0.2s ease;
}

.mobile-nav-content a:hover,
.mobile-nav-content a.active {
    background: var(--glass);
    color: var(--text);
}

.mobile-nav-content a.active {
    border-left: 3px solid var(--accent);
}

.mobile-nav-content svg {
    flex-shrink: 0;
}

.mobile-nav-content .nav-label {
    margin: 16px 0 8px 4px;
}

.mobile-nav-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Desktop styles */
@media (min-width: 769px) {
    .mobile-header,
    .mobile-nav,
    .mobile-nav-overlay {
        display: none !important;
    }
}

/* Mobile styles */
@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }

    .app-shell {
        grid-template-columns: 1fr;
        padding: 70px 12px 12px;
    }

    .sidebar {
        display: none;
    }

    .topbar {
        display: none;
    }

    .content-area {
        min-height: calc(100vh - 82px);
    }

    .page {
        padding: 0 0 16px;
    }

    /* Assistant Page Mobile */
    .assistant-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .chat-window.tall {
        max-height: calc(100vh - 280px);
        min-height: 300px;
    }

    .chat-input {
        flex-direction: column;
        gap: 10px;
    }

    .chat-input input {
        min-width: 100%;
    }

    .chat-input .btn {
        width: 100%;
        justify-content: center;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    /* Cards */
    .card {
        padding: 12px;
    }

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

    /* KPIs */
    .kpis, .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-bottom: 16px;
    }

    .kpi, .kpi-card {
        padding: 14px;
    }

    .kpi .value, .kpi-card .value {
        font-size: 18px;
    }

    /* Better spacing for quick actions */
    .grid {
        gap: 12px;
        margin-bottom: 16px;
    }

    /* Hero */
    .hero {
        padding: 16px;
    }
    .hero.landing {
        grid-template-columns: 1fr;
    }

    .hero-text h1 {
        font-size: 22px;
    }

    /* Tables */
    .table-wrapper {
        overflow-x: auto;
    margin: 0 -12px;
    padding: 0 12px;
}

table {
    min-width: 500px;
}

    /* Footer */
    .footer {
        flex-direction: column;
        text-align: center;
        padding: 16px 12px;
    }

    /* Forms */
    .form {
        gap: 10px;
    }

    .actions {
        flex-direction: column;
    }

    .actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* Stack cards on assistant page */
    .stack {
        display: none;
    }
}

/* Very small screens */
@media (max-width: 400px) {
    .mobile-header {
        padding: 0 12px;
    }

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

    .chat-bubble {
        max-width: 95%;
        padding: 10px;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        min-height: auto;
    }

    .topbar {
        position: relative;
    }

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

@media (min-width: 900px) {
    .hero {
        grid-template-columns: 1.2fr 1fr;
        align-items: center;
    }

    .page {
        padding: 6px 12px 16px;
    }
}

/* ============================================
   MARKDOWN CONTENT STYLES
   ============================================ */

.markdown-content {
    line-height: 1.6;
}

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

.markdown-content em {
    font-style: italic;
}

.markdown-content h2, .markdown-content h3, .markdown-content h4 {
    margin: 12px 0 8px;
    font-weight: 600;
    color: var(--text);
}

.markdown-content h2 {
    font-size: 1.2em;
}

.markdown-content h3 {
    font-size: 1.1em;
}

.markdown-content h4 {
    font-size: 1em;
}

.markdown-content .code-block {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    margin: 8px 0;
    overflow-x: auto;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 13px;
}

.markdown-content .inline-code {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.9em;
}

.markdown-content .md-list {
    margin: 8px 0;
    padding-left: 20px;
}

.markdown-content .md-list li {
    margin: 4px 0;
}

.markdown-content .md-hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 12px 0;
}

.markdown-content a {
    color: var(--accent);
    text-decoration: underline;
}

.chat-bubble.user .markdown-content a {
    color: #0b1410;
}

.chat-bubble.user .markdown-content .code-block,
.chat-bubble.user .markdown-content .inline-code {
    background: rgba(0, 0, 0, 0.15);
}

/* ============================================
   IMPROVED ASSISTANT PAGE STYLES
   ============================================ */

.chat-card {
    display: flex;
    flex-direction: column;
}

.chat-card .section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn.danger {
    color: var(--danger);
    border-color: rgba(242, 95, 92, 0.3);
}

.btn.danger:hover {
    background: rgba(242, 95, 92, 0.1);
    border-color: var(--danger);
}

.btn.danger svg {
    stroke: var(--danger);
}

.assistant-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #0b1410;
    font-size: 11px;
    font-weight: 700;
    margin-right: 6px;
}

.chat-bubble .sender {
    display: flex;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--muted);
}

.chat-bubble .sender .time {
    font-weight: 400;
    margin-left: 4px;
}

.chat-bubble.user .sender {
    color: rgba(11, 20, 16, 0.7);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.empty-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #0b1410;
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.quick-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 16px;
}

.suggestion-btn {
    background: var(--glass);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 8px 16px;
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent);
    color: var(--accent);
}

.voice-note {
    text-align: center;
    margin-top: 8px;
}

.chat-window.tall {
    min-height: 400px;
    max-height: 500px;
}

/* Voice button active state improvement */
#voice-btn.active {
    background: var(--accent);
    color: #0b1410;
    animation: pulse-glow 1.5s ease-in-out infinite;
}

#voice-btn.active .dot {
    background: #0b1410;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(36, 192, 139, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(36, 192, 139, 0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
}

/* Mobile assistant improvements */
@media (max-width: 768px) {
    .chat-card .section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .header-actions {
        justify-content: flex-end;
    }

    .chat-window.tall {
        min-height: 300px;
        max-height: 400px;
    }

    .empty-state {
        padding: 24px 16px;
    }

    .empty-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .quick-actions {
        flex-direction: column;
        width: 100%;
    }

    .suggestion-btn {
        width: 100%;
    }
}

/* ============================================
   LOGO STYLES
   ============================================ */

.brand-logo-link {
    display: block;
    text-decoration: none;
}

.brand-logo-img {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.brand-logo-img.sidebar-logo {
    height: 48px;
    margin-bottom: 16px;
}

.brand-logo-img.nav-logo {
    height: 36px;
}

.mobile-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.mobile-brand .brand-logo-img {
    height: 28px;
}

/* Auth Pages Logo */
.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.auth-logo-img {
    height: 56px;
    width: auto;
    object-fit: contain;
}

.auth-footer-text {
    text-align: center;
    margin-top: 16px;
}

/* Mobile adjustments for logo */
@media (max-width: 768px) {
    .brand-logo-img.sidebar-logo {
        height: 40px;
    }

    .auth-logo-img {
        height: 48px;
    }
}

/* Toast notifications */
.voice-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--card);
    color: var(--text);
    padding: 12px 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 90%;
    text-align: center;
}

.voice-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.voice-toast.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.voice-toast.error {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: white;
}

.voice-toast.success {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    color: white;
}

/* Voice button recording animation */
#voice-btn .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    display: inline-block;
    margin-right: 6px;
    transition: all 0.3s ease;
}

#voice-btn .dot.recording {
    animation: pulse-recording 1s ease-in-out infinite;
    background: #ef4444;
}

#voice-btn.active {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: #ef4444;
}

@keyframes pulse-recording {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.7;
    }
}

/* Toggle checkbox styling */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 0;
}
.toggle-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 44px;
    height: 24px;
    background: var(--glass);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}
.toggle-label input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: var(--muted);
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: all 0.2s;
}
.toggle-label input[type="checkbox"]:checked {
    background: var(--accent);
}
.toggle-label input[type="checkbox"]:checked::before {
    transform: translateX(20px);
    background: white;
}
.toggle-label span {
    color: var(--text);
    font-size: 0.875rem;
}

.reserve-item {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
}

.reserve-amount {
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-shell {
    width: 100%;
    display: grid;
    gap: 6px;
}

.progress-track {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    border-radius: 999px;
    box-shadow: 0 6px 16px rgba(36, 192, 139, 0.35);
}

.progress-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: space-between;
}

.tiny {
    font-size: 11px;
}
