@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

html, body {
    background: #f6f7f9;
    color: #1b2430;
    font-family: Inter, 'Segoe UI', Arial, sans-serif;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.content {
    padding-top: 1.1rem;
}

.language-switch {
    background: #ffffff;
    border: 1px solid #cbd5df;
    border-radius: 10px;
    display: inline-flex;
    overflow: hidden;
}

.language-switch button {
    background: transparent;
    border: 0;
    color: #334155;
    font-weight: 700;
    min-height: 2.25rem;
    min-width: 3.1rem;
    padding: .35rem .7rem;
}

.language-switch button + button {
    border-left: 1px solid #cbd5df;
}

.language-switch button.active {
    background: #3f382e;
    color: #ffffff;
}

.page-header {
    align-items: end;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.page-header h1 {
    font-size: 1.85rem;
    font-weight: 650;
    margin: 0;
}

.page-header p,
.muted {
    color: #617080;
    margin: .25rem 0 1rem;
}

.notice {
    background: #fff8e1;
    border: 1px solid #ead48a;
    border-radius: 6px;
    color: #5d4a00;
    margin: 0 0 1rem;
    padding: .75rem .9rem;
}

.toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1rem;
}

input {
    border: 1px solid #cbd5df;
    border-radius: 6px;
    min-height: 2.25rem;
    padding: .35rem .55rem;
}

.filter {
    color: #465568;
    display: grid;
    font-size: .9rem;
    gap: .25rem;
    min-width: 9rem;
}

.dashboard-controls {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    justify-content: flex-end;
}

.check-filter {
    align-items: center;
    background: #fff;
    border: 1px solid #d9e2ec;
    border-radius: 6px;
    color: #334155;
    cursor: pointer;
    display: flex;
    gap: .45rem;
    min-height: 2.25rem;
    padding: .35rem .65rem;
}

.check-filter input {
    min-height: auto;
}

.filter-help {
    margin-top: -.35rem;
}

.indicator-filters {
    background: #ffffff;
    border: 1px solid #dfe7ef;
    border-radius: 8px;
    margin: 0 0 1rem;
    padding: .85rem;
}

.indicator-filters-header {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: .45rem .8rem;
    margin-bottom: .65rem;
}

.indicator-filters-header strong {
    color: #1f2a37;
    font-size: .95rem;
}

.indicator-filters-header span {
    color: #617080;
    font-size: .84rem;
}

.indicator-filter-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
}

.indicator-filter-grid label {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #d9e2ec;
    border-radius: 6px;
    color: #334155;
    cursor: help;
    display: inline-flex;
    gap: .4rem;
    min-height: 2.1rem;
    padding: .32rem .6rem;
}

.indicator-filter-grid input {
    min-height: auto;
}

.backtest-guide {
    background: #ffffff;
    border: 1px solid #dfe7ef;
    border-radius: 8px;
    color: #334155;
    margin: 0 0 1rem;
    padding: .85rem 1rem;
}

.backtest-guide strong {
    display: block;
    font-size: .95rem;
    margin-bottom: .35rem;
}

.backtest-guide ol {
    margin: 0;
    padding-left: 1.25rem;
}

.backtest-guide li {
    margin: .18rem 0;
}

.refresh-status {
    margin: .65rem 0 0;
}

.signal-badge {
    border-radius: 999px;
    display: inline-block;
    font-size: .78rem;
    font-weight: 650;
    line-height: 1;
    padding: .32rem .5rem;
    white-space: nowrap;
}

.signal-badge.entry {
    background: #dcfce7;
    color: #166534;
}

.signal-badge.exit {
    background: #fee2e2;
    color: #991b1b;
}

.muted-badge {
    background: #eef2f6;
    color: #64748b;
}

.btn {
    border-radius: 6px;
}

.btn-secondary {
    background: #eef2f6;
    border-color: #d8e0e8;
    color: #1f2a37;
}

.data-table {
    background: white;
    border: 1px solid #e1e7ee;
    border-collapse: separate;
    border-radius: 8px;
    border-spacing: 0;
    font-size: .92rem;
    margin-top: 1rem;
    overflow: hidden;
    width: 100%;
}

.data-table th {
    background: #eef3f8;
    color: #405064;
    font-weight: 650;
    text-align: left;
}

.data-table th,
.data-table td {
    border-bottom: 1px solid #e7edf3;
    padding: .65rem .75rem;
    vertical-align: top;
}

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

.compact {
    font-size: .84rem;
}

.chart-stack {
    display: grid;
    gap: 1rem;
    margin: 1rem 0;
}

.chart-toolbar {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.chart-toolbar strong {
    display: block;
    font-size: .95rem;
}

.chart-toolbar span {
    color: #617080;
    display: block;
    font-size: .82rem;
}

.chart-note {
    background: #eef6ff;
    border: 1px solid #cfe4ff;
    border-radius: 6px;
    color: #31506f;
    font-size: .84rem;
    padding: .6rem .75rem;
}

.session-summary {
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.daily-session {
    align-items: stretch;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(280px, 420px) 1fr;
}

.daily-indicators {
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.mini-chart-card {
    background: white;
    border: 1px solid #e1e7ee;
    border-radius: 8px;
    padding: .8rem;
}

.mini-chart-card h3 {
    font-size: .9rem;
    font-weight: 650;
    margin: 0 0 .35rem;
}

.mini-chart-card strong {
    display: block;
    font-size: 1rem;
    margin-top: .2rem;
}

.mini-axis {
    stroke: #cbd5e1;
    stroke-width: 2;
}

.mini-zero,
.mini-threshold {
    stroke: #ef4444;
    stroke-dasharray: 4 4;
    stroke-width: 1.2;
}

.mini-label {
    fill: #667386;
    font-size: 10px;
    text-anchor: middle;
}

.mini-label.end {
    text-anchor: end;
}

.mini-zone.low {
    fill: rgba(239, 68, 68, .14);
}

.mini-zone.high {
    fill: rgba(245, 158, 11, .16);
}

.mini-dot {
    stroke: white;
    stroke-width: 1.4;
}

.rsi-dot {
    fill: #2563eb;
}

.macd-dot {
    fill: #dc2626;
}

.signal-dot {
    fill: #374151;
}

.close-dot {
    fill: #111827;
}

.ema50-dot {
    fill: #14803c;
}

.ema200-dot {
    fill: #6d28d9;
}

.bollinger-dot {
    fill: #f59e0b;
}

.volume-track {
    fill: #e5ebf2;
}

.volume-fill {
    fill: #22c55e;
}

.daily-candle-panel {
    background: white;
    border: 1px solid #e1e7ee;
    border-radius: 8px;
    padding: .85rem;
}

.daily-candle-panel h2 {
    font-size: 1rem;
    font-weight: 650;
    margin: 0 0 .5rem;
}

.daily-candle-chart {
    display: block;
    height: auto;
    width: 100%;
}

.candle-wick {
    stroke: #111827;
    stroke-width: 3;
}

.candle-body {
    stroke: #111827;
    stroke-width: 1.5;
}

.candle-body.up {
    fill: #22c55e;
}

.candle-body.down {
    fill: #ef4444;
}

.ohlc-label {
    fill: #526173;
    font-size: 11px;
    dominant-baseline: middle;
}

.session-summary div {
    background: white;
    border: 1px solid #e1e7ee;
    border-radius: 8px;
    padding: .85rem;
}

.session-summary span {
    color: #617080;
    display: block;
    font-size: .82rem;
}

.session-summary strong {
    display: block;
    font-size: 1.15rem;
    margin-top: .25rem;
}

.daily-session .session-summary {
    grid-column: 1 / -1;
}

.segmented {
    background: #e8eef5;
    border: 1px solid #d7e0ea;
    border-radius: 8px;
    display: inline-flex;
    padding: .2rem;
}

.segmented button {
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: #405064;
    font-size: .84rem;
    min-height: 2rem;
    min-width: 3rem;
    padding: .25rem .65rem;
}

.segmented button.active {
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
    color: #102033;
    font-weight: 650;
}

.chart-panel {
    background: white;
    border: 1px solid #e1e7ee;
    border-radius: 8px;
    padding: .85rem;
}

.tradingview-panel {
    background: white;
    border: 1px solid #e1e7ee;
    border-radius: 8px;
    display: none;
    padding: .75rem .85rem;
}

.tv-header {
    align-items: start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: .35rem;
}

.tv-header h2 {
    font-size: 1rem;
    font-weight: 650;
    margin: 0;
}

.tv-header span {
    color: #617080;
    display: block;
    font-size: .82rem;
    margin-top: .15rem;
}

.price-up {
    color: #059669;
}

.price-down {
    color: #dc2626;
}

.tv-chart {
    display: block;
    height: auto;
    width: 100%;
}

.tv-wick {
    stroke-width: 1.15;
}

.tv-wick.up {
    stroke: #10b981;
}

.tv-wick.down {
    stroke: #ef4444;
}

.tv-candle.up {
    fill: #10b981;
}

.tv-candle.down {
    fill: #ef4444;
}

.intraday-price {
    opacity: .55;
    stroke: #111827;
    stroke-width: 1.2;
}

.rsi-zone {
    fill: rgba(124, 58, 237, .09);
}

.tv-histogram {
    opacity: .68;
}

.tv-histogram.positive {
    fill: #2dd4bf;
}

.tv-histogram.negative {
    fill: #f87171;
}

.chart-title {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: .5rem;
}

.chart-title h2 {
    font-size: 1rem;
    font-weight: 650;
    margin: 0;
}

.legend {
    align-items: center;
    color: #526173;
    display: flex;
    flex-wrap: wrap;
    font-size: .78rem;
    gap: .65rem;
}

.legend span {
    align-items: center;
    display: inline-flex;
    gap: .28rem;
}

.legend i {
    border-radius: 999px;
    display: inline-block;
    height: .55rem;
    width: .55rem;
}

.indicator-chart {
    display: block;
    height: auto;
    max-height: 280px;
    width: 100%;
}

.indicator-chart.tv-style-chart {
    max-height: 420px;
}

.indicator-chart.small {
    max-height: 190px;
}

.grid-line {
    stroke: #e5ebf2;
    stroke-width: 1;
}

.grid-line.vertical {
    opacity: .45;
}

.axis-tick {
    stroke: #94a3b8;
    stroke-width: 1;
}

.axis-label {
    fill: #667386;
    font-size: 10px;
    text-anchor: middle;
}

.axis-label-start,
.axis-label-end {
    fill: #667386;
    font-size: 11px;
    font-weight: 650;
}

.axis-label-start {
    text-anchor: start;
}

.axis-label-end {
    text-anchor: end;
}

.zero-line {
    stroke: #94a3b8;
    stroke-dasharray: 4 5;
    stroke-width: 1.1;
}

.threshold-line {
    stroke: #ef4444;
    stroke-dasharray: 5 6;
    stroke-width: 1.1;
}

.tv-threshold {
    stroke: #94a3b8;
    stroke-dasharray: 4 5;
    stroke-width: 1;
}

.line {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.2;
}

.close {
    stroke: #111827;
}

.ema50 {
    stroke: #14803c;
}

.ema200 {
    stroke: #6d28d9;
}

.bollinger {
    opacity: .85;
    stroke: #f59e0b;
    stroke-width: 1.5;
}

.rsi {
    stroke: #2563eb;
    stroke-width: 2.4;
}

.tv-rsi {
    stroke: #8b5cf6;
    stroke-width: 1.7;
}

.tv-rsi-average {
    stroke: #eab308;
    stroke-width: 1.5;
}

.macd {
    stroke: #dc2626;
    stroke-width: 2.5;
}

.tv-macd {
    stroke: #6366f1;
    stroke-width: 1.8;
}

.macd-signal {
    stroke: #374151;
    stroke-width: 2;
}

.tv-macd-signal {
    stroke: #f97316;
    stroke-width: 1.6;
}

.histogram {
    opacity: .45;
}

.histogram.positive {
    fill: #22c55e;
}

.histogram.negative {
    fill: #f97316;
}

.tv-pane-title {
    fill: #334155;
    font-size: 10px;
    font-weight: 650;
}

.tv-value-label {
    fill: #ffffff;
    font-size: 8px;
    font-weight: 700;
    text-anchor: middle;
}

.tv-tag-rsi {
    fill: #8b5cf6;
}

.tv-tag-rsi-average {
    fill: #eab308;
}

.tv-tag-histogram {
    fill: #2f9e95;
}

.tv-tag-macd {
    fill: #6366f1;
}

.tv-tag-macd-signal {
    fill: #f97316;
}

.point {
    stroke: white;
    stroke-width: 1.4;
}

.close-point {
    fill: #111827;
}

.rsi-point {
    fill: #2563eb;
}

.macd-point {
    fill: #dc2626;
}

.signal-point {
    fill: #374151;
}

.metrics {
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    margin: 1rem 0;
}

.metrics div {
    background: white;
    border: 1px solid #e1e7ee;
    border-radius: 8px;
    padding: .8rem;
}

.metrics span {
    color: #617080;
    display: block;
    font-size: .8rem;
}

.metrics strong {
    display: block;
    font-size: 1.35rem;
    margin-top: .2rem;
}

.portfolio-panel {
    background: #fff;
    border: 1px solid #e1e7ee;
    border-radius: 10px;
    margin: 1rem 0;
    padding: 1rem;
}

.portfolio-panel h2 {
    font-size: 1.1rem;
    margin: 0 0 .8rem;
}

.portfolio-form label {
    display: grid;
    font-size: .82rem;
    gap: .25rem;
}

.portfolio-form select {
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    min-height: 38px;
    padding: .35rem .55rem;
}

.add-simulator {
    margin-top: 1.25rem;
}

.purchase-zone {
    border-radius: 999px;
    display: inline-block;
    font-size: .75rem;
    font-weight: 700;
    padding: .2rem .55rem;
}

.purchase-zone.excellent {
    background: #dcfce7;
    color: #166534;
}

.purchase-zone.good {
    background: #dbeafe;
    color: #1d4ed8;
}

.purchase-zone.acceptable {
    background: #fef3c7;
    color: #92400e;
}

.purchase-zone.wait {
    background: #f1f5f9;
    color: #475569;
}

.purchase-plan-card {
    background: #fff;
    border: 1px solid #dfe7ef;
    border-radius: 10px;
    margin-bottom: 1rem;
    padding: 1rem;
}

.purchase-plan-heading {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.purchase-plan-heading strong,
.purchase-plan-heading span {
    display: block;
}

.purchase-plan-heading div > span {
    color: #617080;
    font-size: .82rem;
    margin-top: .2rem;
}

@media (max-width: 760px) {
    .page-header {
        align-items: stretch;
        display: grid;
    }

    .data-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .chart-toolbar,
    .chart-title {
        align-items: stretch;
        display: grid;
    }

    .segmented {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        width: 100%;
    }

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

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

.signed-in-user {
    color: #526170;
    font-size: .9rem;
    margin-left: 1.25rem;
}

.login-page {
    align-items: center;
    background: linear-gradient(145deg, #071f52 0%, #28104f 100%);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
    max-width: 440px;
    padding: 2.5rem;
    text-align: center;
    width: 100%;
}

.login-brand {
    color: #0b3b88;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: .04em;
    margin-bottom: 1.25rem;
}

.login-card h1 {
    color: #172033;
    font-size: 2rem;
    margin-bottom: .75rem;
}

.login-card p {
    color: #617080;
    line-height: 1.55;
}

.login-error {
    background: #fff1f1;
    border: 1px solid #ffc7c7;
    border-radius: 8px;
    color: #a11919 !important;
    padding: .75rem;
}

.google-login-button {
    align-items: center;
    background: #fff;
    border: 1px solid #cbd3dc;
    border-radius: 8px;
    color: #263238;
    display: flex;
    font-weight: 600;
    gap: .75rem;
    justify-content: center;
    margin-top: 1.5rem;
    padding: .85rem 1rem;
    text-decoration: none;
}

.google-login-button:hover {
    background: #f7f9fb;
    color: #172033;
}

.google-mark {
    color: #4285f4;
    font-size: 1.2rem;
    font-weight: 800;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD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uNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }
