:root {
    --bot-gold: #65d6c2;
    --bot-gold-strong: #37b6a2;
    --bot-green: #65d6c2;
    --bot-green-deep: #087f75;
    --bot-bg: #0a1c2b;
    --bot-surface: #102b3f;
    --bot-surface-2: #16354a;
    --bot-surface-3: #244153;
    --bot-text: #f6f3ea;
    --bot-muted: #a0b8c4;
    --bot-border: #29465a;
    --primary: #087f75;
}

[data-theme="white"] {
    --bot-gold: #087f75;
    --bot-gold-strong: #08685f;
    --bot-green: #087f75;
    --bot-bg: #f6f3ea;
    --bot-surface: #fffefa;
    --bot-surface-2: #f0ede3;
    --bot-surface-3: #e7e3d8;
    --bot-text: #102b3f;
    --bot-muted: #586d78;
    --bot-border: #deded1;
}

body, body.ai-user-body, body.auth-bg {
    background: radial-gradient(ellipse at top right, #15998c14, transparent 65%), var(--bot-bg);
    color: var(--bot-text);
}
.ai-user-body .ai-template-main, .dark .ai-user-body .ai-template-main,
.ai-panel, .dark .ai-panel, .ai-mobile-shell {
    background: var(--bot-bg);
    color: var(--bot-text);
}
.ai-panel, .dark .ai-panel { background: var(--bot-surface); border-color: var(--bot-border); }
.ai-main-bottom-nav__panel { background: var(--bot-surface) !important; border-color: var(--bot-border) !important; }
.ai-main-bottom-nav__item { color: var(--bot-muted) !important; }
.ai-main-bottom-nav__item.is-active { color: var(--bot-gold) !important; }
.ai-main-bottom-nav__item.is-active .ai-main-bottom-nav__icon { background: #15998c24 !important; color: var(--bot-gold) !important; }
.ai-submit, .dark .ai-submit { background: var(--bot-gold); color: var(--bot-bg); }
.avantu-nav-brand { display: none; }
.avantu-landing-shell { width: 100%; max-width: 1280px; margin: auto; }
.avantu-landing-hero h2 { letter-spacing: -.045em; }
.avantu-landing-hero { background: radial-gradient(ellipse at 80% 35%, #15998c20, transparent 65%); }
.avantu-portfolio > *, .avantu-dashboard-grid > * { min-width: 0; }
.ai-auth-theme-switch { right: 20px; }
button, a, input, select { touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--bot-gold); outline-offset: 3px; }

.avantu-dashboard-summary { display: contents; }

@media (min-width: 768px) {
    .avantu-landing-shell { padding: 24px 36px; }
    #landing { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
    #landing > * { margin: 0; }
    #landing > :first-child, #landing > .avantu-landing-hero,
    #landing > .avantu-landing-features, #landing > :last-child { grid-column: 1 / -1; }
    .avantu-landing-hero { padding: 56px 36px 32px; border-radius: 32px; }
    .avantu-landing-hero > :first-child { min-height: 320px; }
    .avantu-landing-hero h2 { font-size: clamp(3rem, 5vw, 4.8rem); }
    .avantu-landing-hero p { font-size: 18px; max-width: 52%; }
    #landHero { width: 290px; max-height: 300px; right: 4%; }
    .avantu-landing-hero > a { max-width: 360px; }
    #landing h3 { font-size: 23px; }
    #landing [class*="text-[9px]"], #landing [class*="text-[10px]"],
    #landing [class*="text-[11px]"] { font-size: 13px; }
    .ai-user-body .ai-template-main { max-width: 100%; box-shadow: none; border-radius: 0; overflow: visible; }
    .ai-user-body { padding: 0 !important; }
    .avantu-dashboard-shell { max-width: none; }
    .avantu-dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
    .avantu-dashboard-grid > * { margin-bottom: 0; }
    .avantu-dashboard-grid > :first-child { grid-column: 1 / -1; }
    .avantu-dashboard-summary { display: flex; flex-direction: column; gap: 20px; align-self: start; }
    .avantu-dashboard-summary > * { margin-bottom: 0; }
    .avantu-dashboard-summary .avantu-dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
    .avantu-dashboard-stats > div { padding: 24px 16px; }
    .avantu-dashboard-stats .font-black { font-size: 22px; }
    .avantu-dashboard-summary .truncate { white-space: normal; }
    .avantu-portfolio { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; padding: 24px !important; align-content: start; }
    .avantu-portfolio > * { margin: 0; }
    .avantu-portfolio > header, .avantu-portfolio > :nth-child(2),
    .avantu-portfolio > #portfolioHero { grid-column: 1 / -1; }
    .avantu-portfolio .portfolio-chart-shell { height: 300px; }
    .ai-user-page { padding: 24px 28px 48px; }
    .ai-asset-list, .ai-bot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
    .ai-user-body .ai-template-main > .container { max-width: 1100px; padding: 24px 28px 48px !important; }
}

@media (min-width: 1100px) {
    .ai-user-body { padding-left: 248px !important; }
    .ai-user-body .ai-template-main { max-width: 1440px; padding: 24px; }
    .ai-main-bottom-nav { inset: 0 auto 0 0; width: 248px; max-width: none; transform: none; padding: 0; }
    .ai-main-bottom-nav__panel { height: 100vh; border-radius: 0; border-width: 0 1px 0 0; padding: 28px 16px; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 8px; box-shadow: none; }
    .avantu-nav-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 36px; color: var(--bot-text); text-decoration: none; }
    .avantu-nav-brand img { width: 42px; height: 42px; }
    .avantu-nav-brand strong { display: block; font-size: 16px; }
    .avantu-nav-brand small { color: var(--bot-muted); font-size: 11px; letter-spacing: .15em; text-transform: uppercase; }
    .ai-main-bottom-nav__item { flex: 0 0 auto; flex-direction: row; justify-content: flex-start; min-height: 56px; gap: 12px; padding: 8px 12px; border-radius: 14px; }
    .ai-main-bottom-nav__item.is-active { background: #15998c18; }
    .ai-main-bottom-nav__label { font-size: 14px; }
    .ai-main-bottom-nav__label-prefix { display: inline; }
    .ai-main-bottom-nav__icon { width: 30px; height: 30px; }
    .ai-user-body [class*="text-[8px]"], .ai-user-body [class*="text-[9px]"],
    .ai-user-body [class*="text-[10px]"], .ai-user-body [class*="text-[11px]"] { font-size: 12px; }
    .ai-user-body .pb-28, .ai-user-body .pb-32 { padding-bottom: 32px; }
}

@media (max-width: 767px) {
    .avantu-landing-shell { max-width: 100%; }
    #landing .grid-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
    #landing [class*="text-[9px]"], #landing [class*="text-[10px]"] { font-size: 11px; }
    .ai-user-body .ai-template-main { max-width: 100%; }
    .avantu-dashboard-shell { max-width: 100%; }
}

body.admin-panel { background: var(--bot-bg); color: var(--bot-text); --bs-body-bg: var(--bot-bg); --bs-body-color: var(--bot-text); --bs-primary: #087f75; --bs-primary-rgb: 8,127,117; }
.admin-panel .sidebar, .admin-panel .card, .admin-panel .modal-content,
.admin-panel .stat-card, .admin-panel .admin-table { background: var(--bot-surface); color: var(--bot-text); border-color: var(--bot-border); }
.admin-panel .nav-link-group, .admin-panel .nav-child { color: var(--bot-muted); }
.admin-panel .nav-link-group.active { background: #15998c20 !important; color: var(--bot-gold) !important; border-left-color: var(--bot-gold); }
.admin-panel .bg-white, .admin-panel .bg-light { background: var(--bot-surface) !important; }
.admin-panel .text-dark { color: var(--bot-text) !important; }
.admin-panel .text-muted { color: var(--bot-muted) !important; }
.admin-panel .table { --bs-table-bg: var(--bot-surface); --bs-table-color: var(--bot-text); --bs-table-border-color: var(--bot-border); }
.admin-panel .form-control, .admin-panel .form-select { background-color: var(--bot-surface); color: var(--bot-text); border-color: var(--bot-border); }
.admin-panel .btn-primary { --bs-btn-bg: #087f75; --bs-btn-border-color: #087f75; --bs-btn-hover-bg: #08685f; --bs-btn-hover-border-color: #08685f; }
.avantu-admin-toolbar { display: flex; justify-content: flex-end; gap: 12px; margin-bottom: 20px; }
.avantu-admin-menu { display: none; }
@media (max-width: 991px) {
    .admin-panel .sidebar { position: static; display: none; width: 100%; height: auto; max-height: 70vh; border-bottom: 1px solid var(--bot-border); }
    .admin-panel .sidebar.is-open { display: block; }
    .admin-panel .main-content { margin-left: 0; padding: 16px; }
    .avantu-admin-menu { display: inline-flex; }
    .avantu-admin-toolbar { justify-content: space-between; }
    .admin-panel .table-responsive { overflow-x: auto; }
}

/* Keep brand accents readable on both palettes. */
[data-theme="white"] .text-gold { color: var(--bot-gold); }
[data-theme="dark"] .text-brand { color: var(--bot-gold); }
[data-theme="white"] .from-grn.text-black { color: #fffefa; }
.ai-submit, .ai-login-submit { background: var(--bot-gold); color: var(--bot-bg); }
[data-theme="white"] .ai-submit, [data-theme="white"] .ai-login-submit { color: #fffefa; }
.ai-login-hero { background: radial-gradient(circle at 92% 8%, #15998c25, transparent 20rem), var(--bot-surface); }
[data-theme="white"] .ai-template-auth-page .bg-zinc-900 { background: var(--bot-surface-2); }
[data-theme="white"] .ai-template-auth-page .border-zinc-800 { border-color: var(--bot-border); }
[data-theme="white"] .ai-template-auth-page input.text-white { color: var(--bot-text); }
[data-theme="white"] .ai-template-auth-page .text-gray-300 { color: var(--bot-muted); }
@media (min-width: 900px) {
    .ai-template-auth-body .ai-template-main { max-width: none; width: 100%; }
    .ai-template-auth-page { padding: 48px 24px; align-items: center; }
    .ai-template-auth-page > div { max-width: 960px; min-height: 0; border: 1px solid var(--bot-border); border-radius: 24px; overflow: hidden; }
    #login { display: grid; grid-template-columns: 1fr 1fr; align-items: center; background: var(--bot-surface); }
    .ai-login-hero { height: 100%; padding: 36px; }
    .ai-login-intro { display: flex; flex-direction: column; align-items: stretch; gap: 28px; }
    .ai-login-copy h2 { font-size: 38px; }
    .ai-login-hero-visual { height: 190px; }
    .ai-login-visual-dark { width: 200px; }
    .ai-login-card { margin: 32px !important; }
    .ai-template-auth-page > div:not(.ai-login-shell) { max-width: 640px; }
}
@media (prefers-reduced-motion: reduce) {
    .portfolio-chart-live-dot { animation: none; }
}

.ai-admin-login { width: 100%; max-width: 440px; background: var(--bot-surface); color: var(--bot-text); border: 1px solid var(--bot-border); }
.ai-admin-login-muted { color: var(--bot-muted); }
.ai-admin-login .form-control { background: var(--bot-surface-2); color: var(--bot-text); border-color: var(--bot-border); min-height: 48px; }
