body { background: #f6f7f9; }
.table td, .table th { vertical-align: middle; }
.card { border-color: #d8dee4; border-radius: 8px; }
.card-body > h2:first-child, .card-body > h1:first-child, .card-body > h3:first-child { margin-bottom: 1rem; }
.form-label { color: #495057; font-size: .86rem; font-weight: 700; margin-bottom: .35rem; }
.form-control, .form-select { border-color: #cfd6df; }
.form-control:focus, .form-select:focus { border-color: #6ea8fe; box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .12); }
.form-section { margin: 0 0 1rem; padding: 1rem; border: 1px solid #e1e7ef; border-radius: 8px; background: #fbfcfd; }
.form-section:last-of-type { margin-bottom: 0; }
.form-section legend { float: none; width: auto; margin: 0 0 .25rem; padding: 0 .35rem 0 0; color: #212529; font-size: .95rem; font-weight: 800; }
.form-section-note { margin-bottom: .9rem; color: #6c757d; font-size: .88rem; }
form.card .card-body { display: grid; gap: 1rem; }
form.card .mb-3 { margin-bottom: 0 !important; }
.paper-badge { border: 1px solid #ffe08a; background: #fff6d6; color: #664d03; }
.stock-chart { position: relative; height: min(72vh, 720px); min-height: 480px; border: 1px solid #d8dee4; background: #fff; }
.chart-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 1rem; align-items: stretch; }
.chart-empty { display: grid; min-height: 480px; place-items: center; color: #6c757d; }
.chart-empty-loading::before { content: ''; width: 2rem; height: 2rem; margin-bottom: 4rem; border: 3px solid #d8dee4; border-top-color: #0d6efd; border-radius: 50%; animation: chart-spin .9s linear infinite; }
@keyframes chart-spin { to { transform: rotate(360deg); } }
.chart-quote-legend { position: absolute; z-index: 4; top: .75rem; left: .85rem; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .75rem; max-width: calc(100% - 1.7rem); padding: .35rem .5rem; border-radius: 6px; background: rgba(255, 255, 255, .86); color: #495057; font-size: .82rem; line-height: 1.35; pointer-events: none; }
.chart-quote-legend .quote-symbol { color: #212529; font-weight: 800; }
.chart-quote-legend strong { color: #212529; font-weight: 700; }
.chart-quote-legend strong.up { color: #198754; }
.chart-quote-legend strong.down { color: #dc3545; }
.chart-hover-events { position: absolute; z-index: 4; top: 3.45rem; left: .85rem; display: grid; gap: .25rem; max-width: min(420px, calc(100% - 1.7rem)); padding: .5rem .6rem; border: 1px solid #d8dee4; border-radius: 6px; background: rgba(255, 255, 255, .94); color: #495057; box-shadow: 0 8px 24px rgba(33, 37, 41, .08); font-size: .78rem; line-height: 1.3; pointer-events: none; }
.chart-hover-events strong { color: #212529; font-size: .8rem; }
.chart-hover-events span { display: flex; align-items: center; gap: .35rem; overflow-wrap: anywhere; }
.event-dot { flex: 0 0 auto; width: .55rem; height: .55rem; border-radius: 999px; background: #212529; }
.event-dot.news { background: #0d6efd; }
.event-dot.press-release { background: #6f42c1; }
.event-dot.insider-trade { background: #fd7e14; }
.event-dot.sec-filing { background: #495057; }
.event-dot.earnings { background: #b58100; }
.event-dot.buy { background: #198754; }
.event-dot.sell { background: #dc3545; }
.chart-data-notice { position: absolute; z-index: 4; right: .85rem; bottom: 2.4rem; max-width: min(520px, calc(100% - 1.7rem)); padding: .35rem .55rem; border: 1px solid #ffe08a; border-radius: 6px; background: rgba(255, 246, 214, .94); color: #664d03; font-size: .78rem; line-height: 1.35; pointer-events: none; }
.chart-page-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.chart-control-form .form-section { margin-bottom: 0; }
.timeframe-picker { display: flex; flex-wrap: wrap; gap: .4rem; }
.timeframe-picker .btn { min-width: 54px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 1rem; color: #495057; font-size: .9rem; }
.chart-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.legend-swatch { display: inline-block; width: 18px; height: 4px; border-radius: 999px; background: #212529; }
.legend-swatch.candle { height: 10px; width: 10px; border-radius: 2px; background: #198754; }
.legend-swatch.primary-line { background: #0d6efd; }
.legend-swatch.compare-line { background: #6f42c1; }
.legend-swatch.event-news { background: #0d6efd; }
.legend-swatch.event-press { background: #6f42c1; }
.legend-swatch.event-insider { background: #fd7e14; }
.legend-swatch.event-sec { background: #495057; }
.legend-swatch.event-er { background: #b58100; }
.chart-event-panel { min-height: 480px; max-height: min(72vh, 720px); overflow: hidden; border: 1px solid #d8dee4; border-radius: 8px; background: #fff; }
.chart-event-panel-header { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .85rem 1rem; border-bottom: 1px solid #eef1f4; background: #fbfcfd; }
.chart-event-list { max-height: calc(min(72vh, 720px) - 52px); overflow: auto; }
.chart-event-selection { position: sticky; top: 0; z-index: 1; padding: .55rem 1rem; border-bottom: 1px solid #eef1f4; background: #fff; color: #495057; font-size: .78rem; font-weight: 800; text-transform: uppercase; }
.chart-event-item { padding: .85rem 1rem; border-bottom: 1px solid #eef1f4; }
.chart-event-item:last-child { border-bottom: 0; }
.chart-event-main { display: grid; grid-template-columns: auto 1fr; gap: .55rem; align-items: start; }
.chart-event-main strong { font-size: .9rem; line-height: 1.3; overflow-wrap: anywhere; }
.chart-event-meta { display: flex; justify-content: space-between; gap: .75rem; margin-top: .45rem; color: #6c757d; font-size: .78rem; }
.chart-event-meta a { font-weight: 700; text-decoration: none; }
.chart-event-empty { padding: 1rem; color: #6c757d; }
.chart-event-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 54px; padding: .2rem .4rem; border-radius: 999px; color: #fff; font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.chart-event-badge.news { background: #0d6efd; }
.chart-event-badge.press-release { background: #6f42c1; }
.chart-event-badge.insider-trade { background: #fd7e14; }
.chart-event-badge.sec-filing { background: #495057; }
.chart-event-badge.earnings { background: #b58100; }
.chart-event-badge.buy { background: #198754; }
.chart-event-badge.sell { background: #dc3545; }
.admin-shell { background: #fff; border: 1px solid #d8dee4; border-radius: 8px; overflow: hidden; }
.admin-hero { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.25rem; border-bottom: 1px solid #e9ecef; }
.admin-eyebrow { color: #6c757d; font-size: .76rem; font-weight: 700; text-transform: uppercase; }
.admin-menu { display: flex; align-items: center; gap: 1rem; padding: .75rem; background: #fbfcfd; border-top: 1px solid #f1f3f5; }
.admin-menu-label { flex: 0 0 auto; color: #6c757d; font-size: .78rem; font-weight: 700; text-transform: uppercase; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: .4rem; }
.admin-tab { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; color: #495057; text-decoration: none; padding: .45rem .75rem; border: 1px solid #d8dee4; border-radius: 6px; font-weight: 600; font-size: .92rem; background: #fff; }
.admin-tab:hover { border-color: #adb5bd; color: #212529; background: #f8f9fa; }
.admin-tab.active { background: #212529; border-color: #212529; color: #fff; }
.admin-card { background: #fff; border: 1px solid #d8dee4; border-radius: 8px; padding: 1rem; }
.admin-card-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-bottom: 1rem; border-bottom: 1px solid #e9ecef; margin-bottom: 1rem; }
.admin-form-card { max-width: 1040px; }
.admin-form-actions { display: flex; justify-content: flex-end; gap: .75rem; padding-top: 1rem; margin-top: 1rem; border-top: 1px solid #e9ecef; }
.admin-action-card { display: block; min-height: 160px; color: #212529; text-decoration: none; background: #fff; border: 1px solid #d8dee4; border-radius: 8px; padding: 1.1rem; transition: border-color .15s ease, transform .15s ease; }
.admin-action-card:hover { border-color: #0d6efd; transform: translateY(-1px); color: #212529; }
.admin-action-label { display: block; font-weight: 700; font-size: 1.05rem; margin-bottom: .45rem; }
.admin-action-copy { display: block; color: #6c757d; }
.admin-list { display: grid; gap: 1rem; }
.admin-list-item { display: grid; grid-template-columns: 1fr auto; gap: 1rem; border: 1px solid #e1e7ef; border-radius: 8px; padding: 1rem; background: #fff; }
.admin-list-actions { display: flex; align-items: flex-end; }
.admin-list-item .form-status { grid-column: 1 / -1; }
.admin-table thead th { color: #6c757d; font-size: .78rem; font-weight: 700; text-transform: uppercase; background: #fbfcfd; border-bottom-color: #d8dee4; }
.admin-table tbody tr:hover { background: #fbfcfd; }
.admin-click-row { cursor: pointer; }
.admin-record-link { color: #212529; text-decoration: none; }
.admin-record-link:hover { color: #0d6efd; text-decoration: underline; }
.admin-detail-layout { display: grid; grid-template-columns: minmax(240px, 320px) 1fr; gap: 1rem; align-items: start; }
.admin-detail-summary { position: sticky; top: 1rem; }
.detail-row { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid #eef1f4; }
.detail-row:last-child { border-bottom: 0; }
.detail-row span { color: #6c757d; }
.detail-row strong { text-align: right; font-weight: 700; }
.danger-zone { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 1rem; padding: 1rem; border: 1px solid #f1b8be; border-radius: 8px; background: #fff8f8; }
.service-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .35rem; }
.service-config-tabs { display: flex; flex-wrap: wrap; gap: .5rem; }
.service-config-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.service-config-card { display: flex; flex-direction: column; min-height: 100%; padding: 1rem; border: 1px solid #e1e7ef; border-radius: 8px; background: #fbfcfd; }
.service-config-card-header { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .35rem; }
.service-config-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .85rem; }
.service-config-help { margin-top: .3rem; color: #6c757d; font-size: .76rem; line-height: 1.35; }
.service-config-card .admin-form-actions { margin-top: auto; }
.service-log-output { max-height: 520px; overflow: auto; margin: 0; padding: 1rem; border-radius: 8px; background: #111820; color: #e9ecef; font-size: .82rem; }
.service-event-message { max-width: 420px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-status-select { min-width: 120px; }
.choice-grid, .permission-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .75rem; }
.choice-grid.compact { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.choice-tile, .permission-tile { display: flex; gap: .7rem; align-items: flex-start; padding: .8rem; border: 1px solid #d8dee4; border-radius: 8px; background: #fbfcfd; cursor: pointer; min-height: 68px; }
.choice-tile small, .permission-tile small { display: block; color: #6c757d; font-size: .78rem; overflow-wrap: anywhere; }
.profile-shell { display: grid; grid-template-columns: minmax(240px, 320px) 1fr; gap: 1rem; align-items: start; }
.profile-summary { text-align: center; }
.profile-avatar { width: 72px; height: 72px; display: grid; place-items: center; margin: 0 auto 1rem; border-radius: 50%; background: #212529; color: #fff; font-size: 1.75rem; font-weight: 700; }
@media (max-width: 991.98px) {
    .chart-workspace { grid-template-columns: 1fr; }
    .chart-event-panel { max-height: none; }
    .chart-event-list { max-height: 420px; }
    .admin-hero, .admin-card-header { align-items: flex-start; flex-direction: column; }
    .admin-menu { align-items: flex-start; flex-direction: column; gap: .5rem; }
    .admin-detail-layout { grid-template-columns: 1fr; }
    .admin-detail-summary { position: static; }
    .danger-zone { align-items: flex-start; flex-direction: column; }
    .admin-list-item { grid-template-columns: 1fr; }
    .admin-list-actions { justify-content: flex-end; }
    .profile-shell { grid-template-columns: 1fr; }
}
