:root {
    --bg-main: #0f0f0f;
    /*--bg-card: #151921;
    --bg-card-hover: #1c222e;*/
    /*-bg-input: #1a202c;
    --border-color: #262c3a;*/
    --text-main: #f1f5f9;
    --text-muted: #8e9bb0;
    --accent-green: #10b981;
    --accent-green-glow: rgba(16, 185, 129, 0.25);
    --accent-red: #ef4444;
    --accent-red-glow: rgba(239, 68, 68, 0.25);
    --accent-blue: #3b82f6;
    --accent-amber: #f59e0b;
    /* --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
       --font-mono: 'JetBrains Mono', monospace;*/
    --font-sans: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;

}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
    font-size: 13px;
    /* Reduced overall base font size from 16px to 13px */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    height: 100%;
    height: 100vh;
    height: 100dvh;
    height: var(--app-height, 100dvh);
    max-height: 100vh;
    max-height: 100dvh;
    max-height: var(--app-height, 100dvh);
    overflow: hidden;
    margin: 0;
    padding: 0;
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 400;
    /* Regular font weight across entire application */
    line-height: 1.35;
    box-sizing: border-box;
}

/* Enforce regular/medium weights on headings and structural text */
h1,
h2,
h3,
h4,
h5,
h6,
th,
b,
strong {
    font-weight: 500;
}

.app-container {
    width: 100%;
    height: 100%;
    height: 100vh;
    height: 100dvh;
    height: var(--app-height, 100dvh);
    max-height: 100vh;
    max-height: 100dvh;
    max-height: var(--app-height, 100dvh);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Header Navbar */
.header {
    /*bckground: var(--bg-card);*/
    border: 1px solid var(--border-color);
    border-radius: 0px;
    padding: 0px 14px;
    display: flex;
    
    justify-content: space-between;
    align-items: center;
    width: 100%;
    min-height: 32px;
    position: relative;
    background: #151b21;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pulse-icon {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 6px var(--accent-green);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.header-brand-picture {
    display: inline-flex;
    align-items: center;
    line-height: 1;
    flex-shrink: 0;
}

.header-brand-logo {
    height: 20px;
    width: auto;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
    user-select: none;
    -webkit-user-drag: none;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
    transition: transform 0.2s ease, filter 0.2s ease;
}

.header-brand-logo:hover {
    transform: scale(1.02);
    filter: drop-shadow(0 2px 4px rgba(0, 209, 143, 0.3));
}

@media (max-width: 768px) and (orientation: portrait),
(max-width: 540px) {
    .header-brand-logo {
        height: 22px;
        width: 22px;
        object-fit: contain;
    }
}

.logo-text h1 {
    font-size: 0.92rem;
    font-weight: 500;
    letter-spacing: 0.4px;
}

.logo-text h1 span {
    color: var(--accent-blue);
    font-weight: 400;
}

.header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    z-index: 5;
}

@media (max-width: 768px) {
    .header-center {
        position: static;
        transform: none;
        margin-left: auto;
    }
}

.live-ticker {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-input);
    padding: 3px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.ticker-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 400;
}

.ticker-price {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-main);
}

.ticker-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-right:empty {
    display: none;
}

.option-config-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.option-config-group label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.strategy-dropdown {
    background: var(--bg-input);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: var(--font-sans);
    cursor: pointer;
    outline: none;
}

.strategy-dropdown:hover {
    border-color: var(--accent-blue);
}

/* Manual Control Bar */
.manual-control-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 16px;
    width: 100%;
}

.control-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: 100%;
}

.btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    max-width: 320px;
    align-items: center;
    gap: 6px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-call {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px var(--accent-green-glow);
}

.btn-call:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--accent-green-glow);
    filter: brightness(1.1);
}

.btn-put {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px var(--accent-red-glow);
}

.btn-put:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--accent-red-glow);
    filter: brightness(1.1);
}

.btn-exit {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px var(--accent-red-glow);
}

.btn-exit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--accent-red-glow);
    filter: brightness(1.1);
}

.btn-action:disabled,
.btn-action.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none !important;
    transform: none !important;
    background: rgba(255, 255, 255, 0.08) !important;
    color: #94a3b8 !important;
    border: 1px dashed rgba(255, 255, 255, 0.2) !important;
}

/* Card General Styling */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0px;
    /* padding: 14px;*/
    overflow: hidden;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.card-header h2 {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-main);
}

/* Dashboard Grid Layout */
.dashboard-grid {
    flex: 1 1 0%;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: 1fr auto auto;
    gap: 4px;
    width: 100%;
    height: auto;
    min-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.chart-section {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    display: flex;
    flex-direction: row;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    padding: 0 !important;
    position: relative;
}

.right-panel-wrapper {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0px;
    height: 100%;
    min-height: 0;
    position: relative;
}

.sidebar-section {
    width: var(--sidebar-width, 320px);
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
    opacity: 1;
}

.dashboard-grid.sidebar-collapsed .sidebar-section {
    width: 0px !important;
    opacity: 0;
    margin: 0;
    padding: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Sidebar Resizer Handle (Dhan / TradingView Style) */
.sidebar-resizer {
    width: 6px;
    cursor: col-resize;
    position: relative;
    z-index: 20;
    background: transparent;
    user-select: none;
    -webkit-user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    margin-right: -2px;
}

.sidebar-resizer::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 2px;
    width: 1px;
    background: rgba(255, 255, 255, 0.08);
    transition: background 0.2s ease;
}

.sidebar-resizer::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 32px;
    border-radius: 1px;
    background: rgba(255, 255, 255, 0.25);
    transition: background 0.2s ease, height 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-resizer:hover::before,
.sidebar-resizer.is-dragging::before {
    background: var(--accent-blue, #3b82f6);
}

.sidebar-resizer:hover::after,
.sidebar-resizer.is-dragging::after {
    background: #ffffff;
    height: 48px;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.8);
}

.dashboard-grid.sidebar-collapsed .sidebar-resizer {
    display: none !important;
}

.dashboard-grid.is-resizing-sidebar .sidebar-section,
.dashboard-grid.is-resizing-chart .chart-pane,
.dashboard-grid.is-resizing-chart #multiChartGrid {
    transition: none !important;
}

/* Fixed Vertical Side Panel Bar (TradingView Style) */
.fixed-vertical-bar {
    width: 32px;
    min-width: 32px;
    height: 100%;
    max-height: 100%;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    z-index: 90;
    border-radius: 0px;
    box-shadow: -2px 0 12px rgba(0, 0, 0, 0.25);
}

.fixed-vertical-bar::-webkit-scrollbar {
    display: none;
}

.vbar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.vbar-btn {
    width: 36px;
    height: 36px;
    border-radius: 0px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.vbar-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-main);
}

.vbar-btn.active {
    background: rgba(37, 99, 235, 0.18);
    color: var(--accent-blue);
    border-right: 2px solid var(--accent-blue);
}

.vbar-btn svg,
.vbar-btn img {
    pointer-events: none;
}

.vbar-fx-icon {
    font-family: 'JetBrains Mono', 'Roboto', monospace, sans-serif;
    font-style: italic;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1;
    letter-spacing: -0.5px;
    user-select: none;
    pointer-events: none;
    display: inline-block;
    color: var(--text-muted);
    transition: color 0.2s ease, transform 0.15s ease;
}

.vbar-btn:hover .vbar-fx-icon {
    color: var(--text-main);
    transform: scale(1.08);
}

.vbar-btn.active .vbar-fx-icon {
    color: var(--accent-blue);
}

/* Tooltip on Hover */
.vbar-tooltip {
    position: absolute;
    right: 48px;
    top: 50%;
    transform: translateY(-50%);
    background: #1e293b;
    color: #f8fafc;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 0px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 1000;
}

.vbar-btn:hover .vbar-tooltip {
    opacity: 1;
    visibility: visible;
}

.manual-control-bar {
    grid-column: 1 / 3;
    grid-row: 2 / 3;
    flex-shrink: 0;
    min-height: max-content;
    z-index: 10;
}

.trades-section {
    grid-column: 1 / -1;
    grid-row: 3 / 4;
    flex-shrink: 0;
    min-height: max-content;
    position: relative;
    z-index: 100;
    transition: all 0.3s ease;
}

.trades-section .card-header {
    cursor: pointer;
    user-select: none;
}

.trades-section.logs-collapsed .table-wrapper {
    display: none !important;
}

.btn-logs-toggle {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-weight: 400;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Multi-Chart Header Selector */
.chart-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.layout-selector {
    display: flex;
    background: var(--bg-input);
    border-radius: 0px;
    padding: 2px;
    gap: 2px;
}

.layout-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 0px;
    font-size: 0.75rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s;
}

.layout-btn.active {
    background: var(--accent-blue);
    color: #fff;
}

.tf-selector {
    display: flex;
    background: var(--bg-input);
    border-radius: 6px;
    padding: 2px;
}

.tf-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 0px;
    font-size: 0.75rem;
    font-weight: 400;
    cursor: pointer;
}

.tf-btn.active {
    background: var(--accent-blue);
    color: #fff;
}

.chart-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sound-btn {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 5px 10px;
    border-radius: 0px;
    font-size: 0.78rem;
    cursor: pointer;
}

.sound-btn.active {
    color: var(--accent-green);
    border-color: rgba(16, 185, 129, 0.4);
}

.btn-reset {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 5px 10px;
    border-radius: 0px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-reset:hover {
    background: rgba(239, 68, 68, 0.25);
}

.status-indicator {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 0px;
}

.status-indicator.online {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

/* Timeframe & Indicators Toolbar in Top Header */
.header-toolbar-separator {
    width: 1px;
    height: 15px;
    background: rgba(255, 255, 255, 0.18);
    margin: 0 4px;
    flex-shrink: 0;
}

.tf-dropdown-wrapper,
.indicators-dropdown-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.tf-dropdown-btn,
.indicators-dropdown-btn {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    padding: 3px 6px;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-weight: 400;
    font-size: 0.76rem;
    font-family: var(--font-sans);
    line-height: 1;
    transition: background 0.15s ease, color 0.15s ease;
    user-select: none;
}

.tf-dropdown-btn:hover,
.indicators-dropdown-btn:hover,
.tf-dropdown-wrapper.open .tf-dropdown-btn,
.indicators-dropdown-wrapper.open .indicators-dropdown-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.tf-label-preview {
    font-weight: 400;
    font-size: 0.76rem;
    color: #f1f5f9;
    letter-spacing: 0.2px;
}

.indicators-fx {
    /*font-family: 'JetBrains Mono', serif, monospace;*/
    font-size: 0.78rem;
    font-style: italic;
    font-weight: 400;
    color: #94a3b8;
    margin-right: 1px;
}

.indicators-title {
    font-weight: 400;
    font-size: 0.76rem;
    color: #38bdf8;
    letter-spacing: 0.2px;
}

/* Dropdown Menus */
.tf-dropdown-menu,
.indicators-dropdown-menu {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    z-index: 1000;
    background: #14171f;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65);
    display: none;
}

.tf-dropdown-wrapper.open .tf-dropdown-menu,
.indicators-dropdown-wrapper.open .indicators-dropdown-menu {
    display: flex;
    animation: fadeInDown 0.12s ease-out;
}

.tf-dropdown-menu {
    padding: 4px;
    min-width: 60px;
    width: max-content;
}

.tf-menu-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tf-option-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 400;
    padding: 4px 10px;
    border-radius: 3px;
    text-align: center;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all 0.15s ease;
    width: 100%;
}

.tf-option-btn:hover {
    background: rgba(56, 189, 248, 0.15);
    color: var(--text-main);
}

.tf-option-btn.active {
    background: rgba(59, 130, 246, 0.22);
    color: #38bdf8;
    font-weight: 500;
}

.indicators-dropdown-menu {
    padding: 8px 10px;
    min-width: 175px;
    flex-direction: column;
    gap: 6px;
}

.indicators-menu-header {
    font-size: 0.66rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.indicators-menu-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.indicator-option-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-main);
    transition: background 0.15s;
    user-select: none;
}

.indicator-option-item:hover {
    background: rgba(56, 189, 248, 0.12);
}

.indicator-checkbox {
    accent-color: var(--accent-blue);
    width: 13px;
    height: 13px;
    cursor: pointer;
}

.indicator-color-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}

/* Top Header Layout Selector Dropdown */
.layout-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.layout-dropdown-btn {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: 0px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.layout-dropdown-btn:hover {
    border-color: var(--accent-blue);
    background: var(--bg-card-hover);
}

.layout-icon-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-blue);
}

.dropdown-caret {
    font-size: 0.65rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.layout-dropdown-wrapper.open .dropdown-caret {
    transform: rotate(180deg);
}

.layout-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1000;
    background: #151921;
    border: 1px solid var(--border-color);
    border-radius: 0px;
    padding: 10px 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    display: none;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
}

.layout-dropdown-wrapper.open .layout-dropdown-menu {
    display: flex;
    animation: fadeInDown 0.15s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.layout-menu-header {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.layout-menu-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.layout-menu-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.layout-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 2px 0;
}

.layout-option-btn {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    border-radius: 0px;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 36px;
    height: 36px;
}

.layout-option-btn:hover {
    border-color: var(--accent-blue);
    color: var(--text-main);
    background: rgba(59, 130, 246, 0.15);
}

.layout-option-btn.active {
    background: #ffffff !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.layout-option-btn.active svg rect {
    stroke: #ffffff !important;
}

/* Settings Dropdown in Top Header */
.settings-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.settings-dropdown-btn {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 10px;
    border-radius: 0px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-dropdown-btn:hover {
    border-color: var(--accent-blue);
    background: var(--bg-card-hover);
    color: var(--accent-blue);
}

.settings-dropdown-wrapper.open .settings-dropdown-btn {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    background: var(--bg-card-hover);
}

.settings-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1000;
    background: #151921;
    border: 1px solid var(--border-color);
    border-radius: 0px;
    padding: 12px 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    display: none;
    flex-direction: column;
    gap: 12px;
    min-width: 250px;
}

.settings-dropdown-wrapper.open .settings-dropdown-menu {
    display: flex;
    animation: fadeInDown 0.15s ease-out;
}

.settings-menu-header {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
}

.settings-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-section-title {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.settings-label {
    font-size: 0.8rem;
    color: var(--text-main);
    font-weight: 500;
}

.settings-divider {
    height: 1px;
    background: var(--border-color);
}

.color-picker-box {
    display: flex;
    align-items: center;
}

.color-input {
    -webkit-appearance: none;
    appearance: none;
    border: 1px solid var(--border-color);
    width: 32px;
    height: 32px;
    border-radius: 0px;
    cursor: pointer;
    background: transparent;
    padding: 2px;
    transition: border-color 0.2s;
}

.color-input:hover {
    border-color: var(--accent-blue);
}

.color-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-input::-webkit-color-swatch {
    border: none;
    border-radius: 0px;
}

/* Header Fullscreen Button */
.header-fullscreen-btn {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 10px;
    border-radius: 0px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 34px;
    width: 36px;
}

.header-fullscreen-btn:hover {
    border-color: var(--accent-blue);
    background: var(--bg-card-hover);
    color: var(--accent-blue);
}

.header-fullscreen-btn.active {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}

/* Multi-Chart Layout Grid Modes */
.multi-chart-grid {
    display: grid;
    flex: 1;
    height: 100%;
    min-height: 0;
    gap: 4px;
    width: 100%;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.multi-chart-grid.mode-1 {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}

.multi-chart-grid.mode-1 #ceChartPane,
.multi-chart-grid.mode-1 #peChartPane,
.multi-chart-grid.mode-1 #chartSplitter1,
.multi-chart-grid.mode-1 #chartSplitter2 {
    display: none !important;
}

.multi-chart-grid.mode-2-v,
.multi-chart-grid.mode-2 {
    grid-template-columns: var(--grid-col-1, 1fr) 4px var(--grid-col-2, 1fr);
    grid-template-rows: 1fr;
    gap: 0px;
}

.multi-chart-grid.mode-2-v #spotChartPane,
.multi-chart-grid.mode-2 #spotChartPane {
    display: flex !important;
    grid-column: 1 / 2;
}

.multi-chart-grid.mode-2-v #chartSplitter1,
.multi-chart-grid.mode-2 #chartSplitter1 {
    display: flex !important;
    grid-column: 2 / 3;
}

.multi-chart-grid.mode-2-v #ceChartPane,
.multi-chart-grid.mode-2 #ceChartPane {
    display: flex !important;
    grid-column: 3 / 4;
}

.multi-chart-grid.mode-2-v #peChartPane,
.multi-chart-grid.mode-2 #peChartPane,
.multi-chart-grid.mode-2-v #chartSplitter2,
.multi-chart-grid.mode-2 #chartSplitter2 {
    display: none !important;
}

.multi-chart-grid.mode-2-h {
    grid-template-columns: 1fr;
    grid-template-rows: var(--grid-row-1, 1fr) 4px var(--grid-row-2, 1fr);
    gap: 0px;
}

.multi-chart-grid.mode-2-h #spotChartPane {
    display: flex !important;
    grid-row: 1 / 2;
}

.multi-chart-grid.mode-2-h #chartSplitter1 {
    display: flex !important;
    grid-row: 2 / 3;
    cursor: row-resize;
    height: 4px;
    width: 100%;
}

.multi-chart-grid.mode-2-h #ceChartPane {
    display: flex !important;
    grid-row: 3 / 4;
}

.multi-chart-grid.mode-2-h #peChartPane,
.multi-chart-grid.mode-2-h #chartSplitter2 {
    display: none !important;
}

.multi-chart-grid.mode-3-v,
.multi-chart-grid.mode-3 {
    grid-template-columns: var(--grid-col-1, 1fr) 4px var(--grid-col-2, 1fr) 4px var(--grid-col-3, 1fr);
    grid-template-rows: 1fr;
    gap: 0px;
}

.multi-chart-grid.mode-3-v #spotChartPane,
.multi-chart-grid.mode-3 #spotChartPane {
    display: flex !important;
    grid-column: 1 / 2;
}

.multi-chart-grid.mode-3-v #chartSplitter1,
.multi-chart-grid.mode-3 #chartSplitter1 {
    display: flex !important;
    grid-column: 2 / 3;
}

.multi-chart-grid.mode-3-v #ceChartPane,
.multi-chart-grid.mode-3 #ceChartPane {
    display: flex !important;
    grid-column: 3 / 4;
}

.multi-chart-grid.mode-3-v #chartSplitter2,
.multi-chart-grid.mode-3 #chartSplitter2 {
    display: flex !important;
    grid-column: 4 / 5;
}

.multi-chart-grid.mode-3-v #peChartPane,
.multi-chart-grid.mode-3 #peChartPane {
    display: flex !important;
    grid-column: 5 / 6;
}

.multi-chart-grid.mode-3-h {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr 1fr;
}

.multi-chart-grid.mode-3-h #spotChartPane,
.multi-chart-grid.mode-3-h #ceChartPane,
.multi-chart-grid.mode-3-h #peChartPane {
    display: flex !important;
    grid-column: auto;
    grid-row: auto;
}

.multi-chart-grid.mode-3-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
}

.multi-chart-grid.mode-3-grid #spotChartPane {
    display: flex !important;
    grid-column: 1 / 3;
}

.multi-chart-grid.mode-3-grid #ceChartPane {
    display: flex !important;
    grid-column: 1 / 2;
}

.multi-chart-grid.mode-3-grid #peChartPane {
    display: flex !important;
    grid-column: 2 / 3;
}

.multi-chart-grid.mode-3-left {
    grid-template-columns: 1.2fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.multi-chart-grid.mode-3-left #spotChartPane {
    display: flex !important;
    grid-column: 1 / 2;
    grid-row: 1 / 3;
}

.multi-chart-grid.mode-3-left #ceChartPane {
    display: flex !important;
    grid-column: 2 / 3;
    grid-row: 1 / 2;
}

.multi-chart-grid.mode-3-left #peChartPane {
    display: flex !important;
    grid-column: 2 / 3;
    grid-row: 2 / 3;
}

.multi-chart-grid.mode-3-top {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.multi-chart-grid.mode-3-top #spotChartPane {
    display: flex !important;
    grid-column: 1 / 2;
    grid-row: 1 / 2;
}

.multi-chart-grid.mode-3-top #ceChartPane {
    display: flex !important;
    grid-column: 2 / 3;
    grid-row: 1 / 2;
}

.multi-chart-grid.mode-3-top #peChartPane {
    display: flex !important;
    grid-column: 1 / 3;
    grid-row: 2 / 3;
}

.multi-chart-grid.mode-4-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.multi-chart-grid.mode-4-grid #spotChartPane {
    display: flex !important;
    grid-column: 1 / 2;
    grid-row: 1 / 2;
}

.multi-chart-grid.mode-4-grid #ceChartPane {
    display: flex !important;
    grid-column: 2 / 3;
    grid-row: 1 / 2;
}

.multi-chart-grid.mode-4-grid #peChartPane {
    display: flex !important;
    grid-column: 1 / 3;
    grid-row: 2 / 3;
}

.multi-chart-grid.mode-3-h #chartSplitter1,
.multi-chart-grid.mode-3-h #chartSplitter2,
.multi-chart-grid.mode-3-grid #chartSplitter1,
.multi-chart-grid.mode-3-grid #chartSplitter2,
.multi-chart-grid.mode-3-left #chartSplitter1,
.multi-chart-grid.mode-3-left #chartSplitter2,
.multi-chart-grid.mode-3-top #chartSplitter1,
.multi-chart-grid.mode-3-top #chartSplitter2,
.multi-chart-grid.mode-4-grid #chartSplitter1,
.multi-chart-grid.mode-4-grid #chartSplitter2 {
    display: none !important;
}

.chart-pane {
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    border-radius: 0px;
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chart-pane.selected-chart {
    border: 1px solid var(--accent-blue) !important;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.45);
}

.chart-pane.selected-chart .pane-header {
    /* background: rgba(59, 130, 246, 0.14);
    border-bottom: 1px solid rgba(59, 130, 246, 0.3);*/
}

/* Maximized Single Chart Mode inside Chart Section Grid */
.multi-chart-grid.maximized-mode {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
}

.multi-chart-grid.maximized-mode .chart-split-handle,
.multi-chart-grid.maximized-mode #chartSplitter1,
.multi-chart-grid.maximized-mode #chartSplitter2 {
    display: none !important;
}

.multi-chart-grid.maximized-mode .chart-pane:not(.pane-maximized),
.multi-chart-grid.maximized-mode #spotChartPane:not(.pane-maximized),
.multi-chart-grid.maximized-mode #ceChartPane:not(.pane-maximized),
.multi-chart-grid.maximized-mode #peChartPane:not(.pane-maximized) {
    display: none !important;
}

.multi-chart-grid.maximized-mode .chart-pane.pane-maximized,
.multi-chart-grid.maximized-mode #spotChartPane.pane-maximized,
.multi-chart-grid.maximized-mode #ceChartPane.pane-maximized,
.multi-chart-grid.maximized-mode #peChartPane.pane-maximized {
    display: flex !important;
    flex-direction: column !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    grid-column: unset !important;
    grid-row: unset !important;
    z-index: 100 !important;
}

.pane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-input);
    padding: 6px 12px;
    padding-right: 44px;
    /* Ensure space for the fixed maximize button so content never overlaps it */
    border-bottom: 1px solid var(--border-color);
    position: relative;
    min-height: 34px;
    box-sizing: border-box;
}

.pane-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.pane-title-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex-wrap: nowrap;
    overflow: hidden;
}

.pane-header-price {
    font-size: 0.82rem;
    font-weight: 700;
    font-family: var(--font-mono);
    letter-spacing: 0.2px;
    white-space: nowrap;
    flex-shrink: 0;
}

.pane-header-price.spot-price.price-up {
    color: #10b981;
}

.pane-header-price.spot-price.price-down {
    color: #ef4444;
}

.pane-header-price.ce-price {
    color: #10b981;
}

.pane-header-price.pe-price {
    color: #ef4444;
}

.contract-badge {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
}

.ce-badge {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-green);
    border: 1px solid var(--accent-green);
}

.pe-badge {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
    border: 1px solid var(--accent-red);
}

.pane-header-actions {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 20;
}

.btn-pane-fullscreen,
.btn-pane-maximize,
.pane-action-btn {
    background: rgba(22, 27, 34, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-muted);
    width: 26px;
    height: 26px;
    padding: 0;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.btn-pane-fullscreen:hover,
.btn-pane-maximize:hover,
.pane-action-btn:hover {
    color: #ffffff;
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.22);
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.4);
}

.btn-pane-fullscreen.active,
.btn-pane-maximize.active {
    background: rgba(59, 130, 246, 0.3);
    border-color: #3b82f6;
    color: #60a5fa;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

@media (max-width: 900px) {
    .spot-oi-header-stats {
        display: none !important;
    }

    .pane-header {
        padding: 5px 8px;
        padding-right: 40px;
    }

    .pane-title {
        font-size: 0.74rem;
    }

    .pane-header-price {
        font-size: 0.76rem;
    }

    .pane-header-actions {
        right: 6px;
    }

    .btn-pane-maximize {
        width: 24px;
        height: 24px;
    }
}

.chart-container {
    width: 100%;
    height: 100%;
    min-height: 0;
    position: relative;
    flex: 1;
    transition: all 0.3s ease;
}

.dashboard-grid.logs-collapsed .chart-container {
    height: 100%;
}

.trade-boxes-canvas {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 10;
}

.oi-profile-canvas {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9;
}

/* Spot Chart OI Header Stats (Dhan Style) */
.pane-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.spot-oi-header-stats {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.04);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.oi-header-stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
}

.oi-stat-label {
    color: #94a3b8;
    font-weight: 400;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.oi-stat-val {
    font-weight: 500;
    color: #f8fafc;
    /* font-family: 'JetBrains Mono', monospace;*/
    font-size: 0.74rem;
}

.oi-stat-val.positive {
    color: #10b981;
}

.oi-stat-val.negative {
    color: #ef4444;
}

/* Floating Dhan-Style Strike OI Tooltip Card */
.oi-strike-tooltip {
    position: fixed;
    z-index: 10000;
    background: rgba(18, 24, 38, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 9px 13px;
    min-width: 215px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.75), 0 0 1px rgba(255, 255, 255, 0.2);
    font-family: 'Inter', sans-serif;
    pointer-events: auto;
    transition: opacity 0.12s ease;
}

.oi-tt-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-bottom: 5px;
    margin-bottom: 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.oi-tt-strike {
    font-size: 0.82rem;
    font-weight: 500;
    color: #f8fafc;
}

.oi-tt-expiry {
    font-size: 0.68rem;
    color: #94a3b8;
    font-weight: 500;
}

.oi-tt-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 0;
}

.oi-tt-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.oi-tt-bullet {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    display: inline-block;
}

.oi-tt-bullet.ce {
    background: #eb4d4b;
}

.oi-tt-bullet.pe {
    background: #00b894;
}

.oi-tt-label {
    font-size: 0.72rem;
    font-weight: 400;
    color: #94a3b8;
}

.oi-tt-val {
    font-size: 0.8rem;
    font-weight: 500;
    color: #f1f5f9;
    /*   font-family: 'JetBrains Mono', monospace;*/
    margin-left: 4px;
}

.oi-tt-actions {
    display: flex;
    gap: 4px;
    margin-left: 10px;
}

.oi-tt-btn {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    border: 1px solid transparent;
    font-size: 0.65rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.15s ease;
}

.oi-tt-btn.buy {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
    color: #10b981;
}

.oi-tt-btn.buy:hover {
    background: #10b981;
    color: #ffffff;
}

.oi-tt-btn.sell {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

.oi-tt-btn.sell:hover {
    background: #ef4444;
    color: #ffffff;
}

/* Individual Fullscreen Overlay */
.chart-pane.pane-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 99999 !important;
    border-radius: 0 !important;
}

.chart-pane.pane-fullscreen .chart-container {
    height: calc(100vh - 40px) !important;
}

/* Sidebar Widgets */
.trade-settings-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-form-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.setting-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.setting-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.setting-field label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 400;
}

.setting-field select,
.setting-field input {
    width: 100%;
    background: var(--bg-input);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: var(--font-sans);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.setting-field input {
    font-family: var(--font-mono);
}

.setting-field select:hover,
.setting-field select:focus,
.setting-field input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.metric-box {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.metric-label {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.metric-value {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 500;
}

.metric-value.positive {
    color: var(--accent-green);
}

.metric-value.negative {
    color: var(--accent-red);
}

.metric-value.neutral {
    color: var(--text-main);
}

.idle-badge {
    background: rgba(142, 155, 176, 0.15);
    color: var(--text-muted);
}

.long-badge {
    /* background: rgba(16, 185, 129, 0.2);
    border: 1px solid var(--accent-green);*/
    color: var(--accent-green);
}

.short-badge {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
    border: 1px solid var(--accent-red);
}

.position-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.position-details.empty-state {
    color: var(--text-muted);
    font-size: 0.82rem;
    padding: 16px 0;
    text-align: center;
}

.pos-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 5px;
}

.pos-val {
    font-family: var(--font-mono);
    font-weight: 400;
}

.btn-card-exit {
    margin-top: 6px;
    width: 100%;
    padding: 8px;
    background: var(--accent-amber);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
}

.strategy-info-body h3 {
    font-size: 0.9rem;
    color: var(--accent-blue);
    margin-bottom: 4px;
}

.strategy-info-body p {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Trades Log Table */
.log-tabs {
    display: flex;
    gap: 8px;
    align-items: center;
}

.log-tab-btn {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    cursor: pointer;
}

.log-tab-btn.active {
    background: var(--accent-blue);
    color: #fff;
    border-color: var(--accent-blue);
}

.btn-refresh {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    cursor: pointer;
}

.table-wrapper {
    overflow-x: auto;
    max-height: 236px;
    transition: max-height 0.3s ease;
}

.trades-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.trades-table th {
    background: var(--bg-input);
    color: var(--text-muted);
    font-weight: 400;
    text-align: left;
    padding: 6px 10px;
    height: 32px;
    box-sizing: border-box;
    position: sticky;
    top: 0;
    z-index: 5;
}

.trades-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    font-family: var(--font-mono);
}

.trades-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.loading-cell {
    text-align: center;
    color: var(--text-muted);
    padding: 16px !important;
}

/* Floating Clean Chart Marker Hover Tooltip */
.chart-marker-tooltip {
    position: fixed;
    display: none;
    z-index: 99999;
    pointer-events: none;
    background: rgba(15, 23, 42, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    padding: 10px 14px;
    font-family: var(--font-sans);
    font-size: 9px;
    color: #f8fafc;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.75), 0 0 15px rgba(59, 130, 246, 0.2);
    min-width: 210px;
    max-width: 280px;
}

.chart-marker-tooltip .tooltip-card {
    margin-bottom: 8px;
}

.chart-marker-tooltip .tooltip-card:last-child {
    margin-bottom: 0;
}

.chart-marker-tooltip .tooltip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 5px;
    margin-bottom: 6px;
}

.chart-marker-tooltip .tooltip-badge {
    font-size: 9px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.chart-marker-tooltip .tooltip-badge.entry {
    background: rgba(59, 130, 246, 0.25);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.5);
}

.chart-marker-tooltip .tooltip-badge.exit {
    background: rgba(239, 68, 68, 0.25);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.5);
}

.chart-marker-tooltip .tooltip-contract {
    font-weight: 400;
    color: #e2e8f0;
    font-size: 9px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart-marker-tooltip .tooltip-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    font-size: 9px;
}

.chart-marker-tooltip .tooltip-row:last-child {
    margin-bottom: 0;
}

.chart-marker-tooltip .tooltip-lbl {
    color: #94a3b8;
    font-size: 9px;
}

.chart-marker-tooltip .tooltip-val {
    font-family: var(--font-mono);
    font-weight: 400;
    color: #f8fafc;
}

.chart-marker-tooltip .tooltip-val.profit {
    color: #10b981;
}

.chart-marker-tooltip .tooltip-val.loss {
    color: #ef4444;
}

.chart-marker-tooltip .tooltip-val.blue {
    color: #60a5fa;
}

/* ==========================================================================
   Dhan Super Order: Draggable Trailing SL / TP Lines & Live Entry PnL
   ========================================================================== */

.chart-order-lines-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 30;
    overflow: hidden;
}

/* ============================================================ */
/* Segmented Compact Super Badges (Option Chart Order Lines)    */
/* ============================================================ */

/* Base container for handles (TP & SL) */
.super-badge-handle {
    position: absolute;
    right: 25%;
    left: auto;
    transform: translateY(-50%);
    pointer-events: auto;
    cursor: ns-resize;
    display: inline-flex;
    align-items: stretch;
    height: 22px;
    line-height: 22px;
    /*  font-family: var(--font-mono, 'JetBrains Mono', 'Roboto Mono', monospace);*/
    font-size: 9.5px;
    font-weight: 500;
    user-select: none;
    white-space: nowrap;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
    transition: transform 0.1s ease, box-shadow 0.15s ease;
    z-index: 35;
}

.super-badge-handle:hover {
    transform: translateY(-50%) scale(1.02);
}

.super-badge-handle.dragging {
    cursor: grabbing;
    transform: translateY(-50%) scale(1.05);
    z-index: 50;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
}

/* Base container for Entry badge */
.super-badge-entry {
    position: absolute;
    right: 25%;
    left: auto;
    transform: translateY(-50%);
    pointer-events: auto;
    display: inline-flex;
    align-items: stretch;
    height: 22px;
    line-height: 22px;
    /*font-family: var(--font-mono, 'JetBrains Mono', 'Roboto Mono', monospace);*/
    font-size: 9.5px;
    font-weight: 500;
    user-select: none;
    white-space: nowrap;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
    z-index: 34;
    border: 1px solid #1d4ed8;
}

/* Individual Badge Segments */
.badge-seg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    box-sizing: border-box;
    vertical-align: middle;
}

/* Strategy Initial Segment (A, S, M, MA) */
.badge-seg-initial {
    min-width: 26px;
    padding: 0 5px;
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-seg-initial.solid {
    color: #ffffff;
}

.badge-seg-initial.outlined {
    background: #090d16;
    border: 1px solid currentColor;
    border-right: none;
}

/* Quantity Segment on Entry (e.g. 65) */
.badge-seg-qty {
    padding: 0 7px;
    background: #2563eb;
    color: #ffffff;
    font-weight: 600;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.super-badge-entry.closed-exit {
    z-index: 36;
}

.super-badge-entry.closed-exit .badge-seg-qty {
    background: #475569;
    color: #e2e8f0;
}

/* Live PnL Segment on Entry */
.badge-seg-pnl {
    padding: 0 8px;
    background: #090d16;
    border-top: 1px solid rgba(59, 130, 246, 0.4);
    border-bottom: 1px solid rgba(59, 130, 246, 0.4);
    font-weight: 500;
}

.badge-seg-pnl.profit {
    color: #10b981;
}

.badge-seg-pnl.loss {
    color: #ef4444;
}

/* Main Pill for TP & SL */
.badge-seg-main {
    padding: 0 8px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* Default Spot-Governed State (Dashed / Outlined) */
.super-badge-handle.default-spot {
    background: #090d16;
}

.super-badge-handle.tp.default-spot .badge-seg-main {
    background: #090d16;
    color: #10b981;
    border: 1px solid #10b981;
    border-left: none;
}

.super-badge-handle.sl.default-spot .badge-seg-main {
    background: #090d16;
    color: #f59e0b;
    border: 1px solid #f59e0b;
    border-left: none;
}

/* Active Trailed State (Solid vibrant fill) */
.super-badge-handle.tp.active-trailed {
    background: #10b981;
}

.super-badge-handle.tp.active-trailed .badge-seg-main {
    background: #10b981;
    color: #ffffff;
}

.super-badge-handle.sl.active-trailed {
    background: #d97706;
}

.super-badge-handle.sl.active-trailed .badge-seg-main {
    background: #d97706;
    color: #ffffff;
}

/* Reset Button (↻) on Trailed Handles */
.badge-btn-reset {
    width: 22px;
    min-width: 22px;
    padding: 0;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 11.5px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: 0.9;
}

.badge-btn-reset:hover {
    transform: rotate(-90deg) scale(1.2);
    opacity: 1;
}

/* Exit Button (✕) on Entry Badge */
.badge-btn-close {
    width: 22px;
    min-width: 22px;
    padding: 0;
    background: #0d1524;
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #94a3b8;
    font-size: 9px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.badge-btn-close:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
}

/* Hitboxes across horizontal price line */
.order-line-hitbox {
    position: absolute;
    left: 0;
    right: 0;
    height: 18px;
    transform: translateY(-50%);
    pointer-events: auto;
    cursor: ns-resize;
    z-index: 32;
    transition: background 0.15s ease;
}

.order-line-hitbox.sl:hover {
    background: rgba(245, 158, 11, 0.12);
}

.order-line-hitbox.tp:hover {
    background: rgba(16, 185, 129, 0.12);
}

/* Floating Projected Trailing Tooltip (Follows Cursor during Drag) */
.order-line-drag-tooltip {
    position: absolute;
    transform: translate(20px, -50%);
    pointer-events: none;
    padding: 5px 10px;
    border-radius: 5px;
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    /*font-family: var(--font-mono, monospace);*/
    font-size: 9.5px;
    font-weight: 400;
    color: #ffffff;
    white-space: nowrap;
    z-index: 60;
    display: none;
}

.order-line-drag-tooltip.visible {
    display: flex;
    align-items: center;
    gap: 8px;
}

.order-line-drag-tooltip.sl {
    border-color: rgba(245, 158, 11, 0.7);
}

.order-line-drag-tooltip.tp {
    border-color: rgba(16, 185, 129, 0.7);
}

.order-line-drag-tooltip.pending {
    border-color: rgba(59, 130, 246, 0.85);
    background: rgba(9, 13, 22, 0.96);
}

/* ==========================================================================
   Pending Manual Order Chart Badge (Segmented Pill: [ MA | 65 | Buy Limit | ✕ ])
   ========================================================================== */
.pending-order-badge {
    position: absolute;
    right: 25%;
    left: auto;
    transform: translateY(-50%);
    pointer-events: auto;
    display: inline-flex;
    align-items: stretch;
    height: 22px;
    line-height: 22px;
    font-size: 10px;
    font-weight: 500;
    user-select: none;
    white-space: nowrap;
    border-radius: 4px;
    overflow: hidden;
    background: #090d16;
    border: 1px solid #1d4ed8;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
    z-index: 35;
    cursor: ns-resize;
    transition: box-shadow 0.15s ease, opacity 0.15s ease;
}

.pending-order-badge:hover {
    box-shadow: 0 4px 14px rgba(29, 78, 216, 0.45);
}

.pending-order-badge.dragging {
    cursor: grabbing !important;
    opacity: 0.95;
    z-index: 55 !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7);
}

.pending-order-hitbox {
    position: absolute;
    height: 20px;
    left: 0;
    right: 0;
    width: 100%;
    transform: translateY(-50%);
    cursor: ns-resize;
    z-index: 34;
    pointer-events: auto;
    background: transparent;
}

.pending-order-badge .badge-seg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    box-sizing: border-box;
}

.pending-order-badge .badge-seg-tag {
    background: #1d4ed8;
    color: #ffffff;
    font-weight: 700;
    min-width: 26px;
    padding: 0 6px;
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pending-order-badge .badge-seg-qty {
    background: #090d16;
    color: #3b82f6;
    font-weight: 600;
    padding: 0 8px;
    border-left: 1px solid rgba(59, 130, 246, 0.35);
    font-size: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pending-order-badge .badge-seg-type {
    background: #090d16;
    color: #3b82f6;
    font-weight: 500;
    padding: 0 10px;
    border-left: 1px solid rgba(59, 130, 246, 0.35);
    font-size: 10px;
    letter-spacing: 0.2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pending-order-badge .badge-btn-cancel {
    width: 22px;
    min-width: 22px;
    padding: 0;
    background: #090d16;
    border: none;
    border-left: 1px solid rgba(59, 130, 246, 0.35);
    color: #3b82f6;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.pending-order-badge .badge-btn-cancel:hover {
    background: #ef4444;
    color: #ffffff;
}

/* Reset Trailing Button on Active Position Card */
.btn-card-reset {
    background: rgba(59, 130, 246, 0.15);
    border: 1px dashed var(--accent-blue);
    color: var(--accent-blue);
    border-radius: 6px;
    font-size: 9px;
    font-weight: 500;
    padding: 6px 10px;
    cursor: pointer;
    margin-top: 6px;
    margin-bottom: 6px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-card-reset:hover {
    background: var(--accent-blue);
    color: #ffffff;
    border-style: solid;
}

/* Toast confirmation on Trailing SL/TP */
.sl-tp-toast {
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 8px 14px;
    background: rgba(15, 23, 42, 0.95);
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 9.5px;
    font-weight: 400;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 70;
    animation: toastSlideIn 0.25s ease-out forwards;
    border-left: 3px solid #3b82f6;
    pointer-events: none;
}

.sl-tp-toast.success {
    border-left-color: #10b981;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}



/* ============================================================ */
/* Custom Components: Accordion, Strategy Controls & Tooltip    */
/* ============================================================ */

.accordion-card {
    padding: 0 !important;
    overflow: visible;
}

.accordion-item {
    display: flex;
    flex-direction: column;
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 14px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.accordion-header:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.accordion-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.accordion-icon {
    font-size: 0.95rem;
    line-height: 1;
}

.accordion-header h2 {
    font-size: 0.8rem;
    text-transform: none;
    letter-spacing: 0.2px;
    color: var(--text-muted);
    font-weight: 500;
    margin: 0;
    transition: color 0.2s ease;
}

.accordion-header:hover h2 {
    color: var(--text-main);
}

.accordion-chevron {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-right: 1.5px solid var(--text-muted);
    border-bottom: 1.5px solid var(--text-muted);
    transform: rotate(45deg);
    transition: transform 0.25s ease, border-color 0.2s ease;
}

.accordion-item.open .accordion-chevron {
    transform: rotate(-135deg);
    border-color: var(--accent-blue);
}

.accordion-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 0;
}

.accordion-content {
    padding: 5px;
    display: block;
}

.accordion-item:not(.open) .accordion-content {
    display: none;
}

.config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.config-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.config-group.full-width {
    grid-column: span 2;
}

.label-with-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.config-group label {
    font-size: 0.74rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: 0.2px;
}

/* Info Tooltip */
.info-tooltip-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.info-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.35);
    font-size: 9px;
    font-weight: 500;
    font-family: var(--font-sans);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: all 0.2s ease;
}

.info-icon:hover,
.info-icon:focus {
    background: rgba(59, 130, 246, 0.35);
    color: #ffffff;
    border-color: #60a5fa;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    outline: none;
}

.info-tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 275px;
    background: #0f1623;
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-radius: 8px;
    padding: 12px 14px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.75), 0 0 15px rgba(59, 130, 246, 0.25);
    z-index: 999;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    transform: translateY(-4px);
}

.info-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 5px;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid rgba(59, 130, 246, 0.4);
}

.info-tooltip-wrapper:hover .info-tooltip,
.info-tooltip-wrapper:focus-within .info-tooltip,
.info-tooltip.visible {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.tooltip-title {
    font-size: 0.68rem;
    text-transform: none;
    letter-spacing: 0.2px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 5px;
}

.tooltip-strat-name {
    font-size: 0.82rem;
    font-weight: 500;
    color: #60a5fa;
    margin-bottom: 6px;
    line-height: 1.35;
}

.tooltip-strat-desc {
    font-size: 0.78rem;
    color: #cbd5e1;
    line-height: 1.45;
}

.strategy-dropdown {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 6px 10px;
    border-radius: 4px;
    font-family: var(--font-sans);
    font-size: 0.78rem;
    font-weight: 400;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.strategy-dropdown:hover {
    border-color: rgba(59, 130, 246, 0.4);
    background: rgba(255, 255, 255, 0.05);
}

.strategy-dropdown:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.strategy-dropdown option {
    background-color: #161b22;
    color: #e2e8f0;
    font-size: 0.78rem;
}


/* Badge Styles */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.long-badge {
    /*background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);*/
    color: var(--accent-green, #10b981);
}

.short-badge {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red, #ef4444);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Value Color Utilities */
.positive {
    color: var(--accent-green, #10b981) !important;
    font-weight: 400;
}

.negative {
    color: var(--accent-red, #ef4444) !important;
    font-weight: 400;
}

.neutral {
    color: var(--text-muted, #8e9bb0);
}

.charges-value {
    color: #f59e0b !important;
    font-weight: 400;
}

/* Trades Section & Card Header */
.trades-section {
    grid-column: 1 / -1;
    grid-row: 3 / 4;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #0f141c;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    position: relative;
    z-index: 100;
}

.card-header,
.trade-log-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    border-bottom: 1px solid var(--border-color);
    background: #151b26;
    flex-shrink: 0;
    height: 44px;
    box-sizing: border-box;
}

.btn-logs-toggle {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 400;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-logs-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: #60a5fa;
}

.btn-refresh {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-refresh:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Log Tabs Styling */
.log-tabs {
    display: flex;
    gap: 8px;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    padding: 3px 6px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.log-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
}

.log-tab-btn:hover {
    color: var(--text-main);
}

.log-tab-btn.active {
    background: var(--accent-blue, #3b82f6);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

/* Table Wrapper & Trades Table */
.table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    flex: 1;
    max-height: calc(var(--trades-height, 280px) - 48px);
}

.trades-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    text-align: left;
}

.trades-table th {
    background: rgba(15, 20, 28, 0.95);
    padding: 8px 12px;
    color: var(--text-muted);
    font-weight: 400;
    position: sticky;
    top: 0;
    z-index: 5;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.trades-table td {
    padding: 7px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-family: var(--font-mono);
    white-space: nowrap;
}

.trades-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.loading-cell {
    text-align: center;
    color: var(--text-muted);
    padding: 20px !important;
}

/* Draggable Resizer Bar between Multi-Chart and Bottom Panel (Dhan Style) */
.trades-resizer {
    grid-column: 1 / -1;
    height: 4px;
    background: transparent;
    cursor: row-resize;
    position: relative;
    z-index: 110;
    transition: background-color 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    margin: -4px 0;
}

.trades-resizer:hover,
.trades-resizer.is-dragging {
    background: rgba(59, 130, 246, 0.35);
}

.trades-resizer::after {
    content: '';
    width: 42px;
    height: 3px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 2px;
    transition: all 0.2s ease;
}

.trades-resizer:hover::after,
.trades-resizer.is-dragging::after {
    background: #60a5fa;
    width: 56px;
    height: 4px;
    box-shadow: 0 0 8px rgba(96, 165, 250, 0.6);
}

/* Responsive Grid with Custom Height Variable & Smooth Transitions */
.dashboard-grid {
    grid-template-rows: 1fr auto var(--trades-height, 280px) !important;
    transition: grid-template-rows 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.dashboard-grid.is-resizing {
    transition: none !important;
}

.dashboard-grid.logs-collapsed {
    grid-template-rows: 1fr auto 44px !important;
}

.dashboard-grid.logs-maximized {
    grid-template-rows: 0px 0px 1fr !important;
}

.dashboard-grid.logs-maximized .chart-section,
.dashboard-grid.logs-maximized .trades-resizer {
    display: none !important;
}

.dashboard-grid.logs-maximized .right-panel-wrapper,
.dashboard-grid.logs-maximized .fixed-vertical-bar {
    z-index: 1 !important;
    pointer-events: none;
}

.trades-section {
    transition: height 0.25s cubic-bezier(0.4, 0, 0.2, 1), max-height 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.dashboard-grid.is-resizing .trades-section,
.dashboard-grid.is-resizing .table-wrapper {
    transition: none !important;
}

.trades-section.logs-collapsed {
    height: 44px !important;
    max-height: 44px !important;
    overflow: hidden !important;
}

.trades-section.logs-collapsed .card-header {
    border-bottom: none !important;
}

.trades-section.logs-collapsed .table-wrapper {
    display: none !important;
}

.trades-section.logs-maximized {
    grid-column: 1 / -1 !important;
    grid-row: 1 / -1 !important;
    height: 100% !important;
    max-height: 100% !important;
    position: relative !important;
    z-index: 150 !important;
    background: #0f141c !important;
}

.trades-section.logs-maximized .trade-log-card-header,
.trades-section.logs-maximized .card-header {
    background: #151b26 !important;
}

.trades-section.logs-maximized .table-wrapper {
    max-height: calc(100vh - 120px) !important;
    height: 100% !important;
}

/* Dhan Platform Style Icon Action Buttons in Trade Log Header */
.dhan-icon-btn {
    background: transparent;
    border: 1px solid transparent;
    color: #94a3b8;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: all 0.15s ease;
    user-select: none;
}

.dhan-icon-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.dhan-icon-btn:active {
    transform: scale(0.92);
}

.dhan-icon-btn svg {
    display: block;
    pointer-events: none;
    stroke: currentColor;
}

/* Multi-Strategy Checklist and Controls */
.multi-strat-subtext {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
    text-transform: none;
}

.strategy-checklist-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
    width: 100%;
}

.strategy-card-item {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 8px 10px;
    transition: all 0.2s ease;
    gap: 6px;
}

.strategy-card-item:hover {
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(59, 130, 246, 0.25);
}

.strategy-card-item.is-active {
    background: rgba(59, 130, 246, 0.06);
    border-color: rgba(59, 130, 246, 0.3);
}

/* Tier 1: Header Row with Checkbox & Strategy Name */
.strat-card-tier1 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

.strat-header-label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    cursor: pointer;
    text-transform: none !important;
    font-weight: 400;
}

.strategy-toggle-cb {
    width: 15px;
    height: 15px;
    accent-color: #3b82f6;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 3px;
}

.strat-card-name {
    font-size: 0.78rem;
    font-weight: 450;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: none !important;
    letter-spacing: 0.1px;
}

/* Tier 2: Dedicated Controls & Status Row (Lot Dropdown -> Trade Count -> Live Ready -> Reset Icon) */
.strat-card-tier2 {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding-top: 5px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

/* 1. Lot Dropdown: Interactive Action - white text, clean subtle styling */
.strat-lot-wrapper {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 3px;
    padding: 2px 4px;
    transition: all 0.15s ease;
    cursor: pointer;
    flex-shrink: 0;
}

.strat-lot-wrapper:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.07);
}

.strat-lots-select {
    background: transparent;
    border: none;
    color: #f1f5f9;
    font-size: 0.72rem;
    font-family: var(--font-sans);
    font-weight: 400;
    outline: none;
    cursor: pointer;
    padding: 1px 2px;
}

.strat-lots-select option {
    background: #151921;
    color: #ffffff;
}

/* 2. Trade Count Badge: Visual Read only - smaller, regular font */
.strat-limit-badge {
    font-size: 0.67rem;
    font-weight: 400;
    font-family: var(--font-sans);
    padding: 2px 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.03);
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.07);
    white-space: nowrap;
    line-height: 1.2;
    cursor: default;
    user-select: none;
    flex-shrink: 0;
}

.strat-limit-badge.halted {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.2);
    font-weight: 450;
}

/* 3. Live Ready Badge: Visual Read only - subtle status indicator, clean font */
.strat-start-badge {
    font-size: 0.67rem;
    font-weight: 400;
    font-family: var(--font-sans);
    padding: 2px 5px;
    border-radius: 3px;
    background: rgba(16, 185, 129, 0.07);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.16);
    white-space: nowrap;
    line-height: 1.2;
    cursor: default;
    user-select: none;
    flex-shrink: 0;
}

/* 4. Capped / Uncapped Micro-Toggle Switch: pushed to right side where reset icon was */
.btn-strat-capping {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 7px;
    height: 20px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 400;
    font-family: var(--font-mono);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    line-height: 1;
    flex-shrink: 0;
    border: 1px solid transparent;
}

.btn-strat-capping .capping-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.btn-strat-capping.capped {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
    color: #34d399;
}

.btn-strat-capping.capped .capping-dot {
    background: #10b981;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.7);
}

.btn-strat-capping.capped:hover {
    background: rgba(16, 185, 129, 0.22);
    border-color: #10b981;
    transform: translateY(-1px);
}

.btn-strat-capping.uncapped {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.4);
    color: #fbbf24;
}

.btn-strat-capping.uncapped .capping-dot {
    background: #f59e0b;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.7);
}

.btn-strat-capping.uncapped:hover {
    background: rgba(245, 158, 11, 0.22);
    border-color: #f59e0b;
    transform: translateY(-1px);
}

.btn-strat-capping:active {
    transform: scale(0.95);
}

/* Strategy Badges in Trade Log Table */
.strat-name-badge {
    font-size: 0.72rem;
    font-weight: 500;
    font-family: var(--font-mono);
    padding: 2px 8px;
    border-radius: 5px;
    white-space: nowrap;
    display: inline-block;
}

.strat-badge-v5 {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.35);
}

.strat-badge-v2-enh {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.35);
}

.strat-badge-v4 {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.strat-badge-v2 {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.strat-badge-default {
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Trade Log Strategy Filter Dropdown in Table Header */
.trade-filter-box {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 10px;
}

.trade-filter-lbl {
    font-size: 0.74rem;
    font-weight: 400;
    color: var(--text-muted);
    user-select: none;
}

.trade-log-filter-select {
    background: transparent;
    border: none;
    color: #93c5fd;
    font-size: 0.76rem;
    font-weight: 400;
    outline: none;
    cursor: pointer;
}

.trade-log-filter-select option {
    background: #0f172a;
    color: #e2e8f0;
}

/* Multi-Positions List in Active Position Card */
.multi-positions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.active-pos-item {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Remove text background color from active position details */
.active-position-card .badge,
.active-position-card #positionStatusBadge,
#activePositionDetails .badge,
#activePositionDetails .long-badge,
#activePositionDetails .short-badge,
#activePositionDetails .idle-badge,
#activePositionDetails .pos-val,
#activePositionDetails .pos-lbl,
#activePositionDetails .pos-item-strat,
#activePositionDetails span,
#activePositionDetails p {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.active-position-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
}

.active-position-card .card-header h2 {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: 0.2px;
}

.active-position-card .badge,
#activePositionDetails .badge {
    font-weight: 450;
    font-size: 0.72rem;
    text-transform: none;
    letter-spacing: normal;
    display: inline-block;
}

.pos-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 3px;
}

.pos-item-strat {
    font-size: 0.76rem;
    font-weight: 500;
    color: #93c5fd;
    text-transform: none;
}

.pos-item-actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.btn-card-exit-pos {
    flex: 1;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    font-weight: 500;
    font-size: 0.76rem;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-card-exit-pos:hover {
    background: #ef4444;
    color: #ffffff;
}

.btn-card-reset-pos {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #93c5fd;
    font-weight: 400;
    font-size: 0.74rem;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-card-reset-pos:hover {
    background: #3b82f6;
    color: #ffffff;
}



/* Strategy Session Start Timestamp & Status Badges */
.strat-start-badge {
    font-size: 0.65rem;
    font-weight: 400;
    font-family: var(--font-mono);
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.3);
    white-space: nowrap;
}

.strat-start-badge.live-scan {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.25);
}

/* Total Charges value color */
.charges-value {
    color: #f59e0b !important;
}

/* Toast Notifications */
.app-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1e293b;
    color: #f8fafc;
    border: 1px solid rgba(59, 130, 246, 0.5);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    padding: 12px 18px;
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 99999;
    pointer-events: none;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.app-toast.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   3-Mode Architecture & Trading Switcher Styles
   ========================================================================== */

.mode-switcher-container {
    display: flex;
    align-items: center;
    margin-left: 0;
}

.mode-pill-group {
    display: inline-flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 3px;
    gap: 3px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.mode-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    border-radius: 16px;
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    padding: 5px 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.mode-pill-btn:hover {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.06);
}

.mode-indicator-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
    transition: transform 0.2s ease;
}

/* Active Live Money Button */
.mode-pill-btn.mode-live.active {
    background: rgba(239, 68, 68, 0.22);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.55);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.35);
}

.mode-pill-btn.mode-live.active .mode-indicator-dot {
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444;
    animation: livePulseDot 1.5s infinite;
}

@keyframes livePulseDot {
    0% {
        transform: scale(0.9);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.3);
        opacity: 1;
    }

    100% {
        transform: scale(0.9);
        opacity: 0.8;
    }
}

/* Active Paper Trading Button */
.mode-pill-btn.mode-paper.active {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.55);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
}

.mode-pill-btn.mode-paper.active .mode-indicator-dot {
    background: #f59e0b;
    box-shadow: 0 0 8px #f59e0b;
}

/* Active Backtest Sandbox Button */
.mode-pill-btn.mode-backtest.active {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.55);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.25);
}

.mode-pill-btn.mode-backtest.active .mode-indicator-dot {
    background: #3b82f6;
    box-shadow: 0 0 8px #3b82f6;
}

/* ==========================================================================
   Daily Risk & Profit Cushion Guardrail Styles
   ========================================================================== */

.circuit-breaker-banner {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.25), rgba(185, 28, 28, 0.35));
    border: 1px solid #ef4444;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 14px;
    animation: alertPulse 2s infinite ease-in-out;
}

@keyframes alertPulse {

    0%,
    100% {
        border-color: rgba(239, 68, 68, 0.7);
        box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
    }

    50% {
        border-color: #ef4444;
        box-shadow: 0 0 18px rgba(239, 68, 68, 0.5);
    }
}

.cb-banner-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 0.8rem;
    color: #fca5a5;
    letter-spacing: 0.04em;
}

.cb-reason {
    font-size: 0.76rem;
    color: #fecaca;
    margin: 6px 0 10px 0;
    line-height: 1.4;
}

.btn-cb-unlock {
    background: #ef4444;
    color: #ffffff;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.btn-cb-unlock:hover {
    background: #dc2626;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
}

.guardrail-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.guardrail-item {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    padding: 9px 11px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.guardrail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.guardrail-label {
    font-size: 0.74rem;
    font-weight: 500;
    color: #cbd5e1;
    text-transform: none;
}

.guardrail-toggle {
    cursor: pointer;
    width: 15px;
    height: 15px;
    accent-color: #3b82f6;
}

.guardrail-input-wrap {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    padding: 2px 8px;
    transition: border-color 0.2s ease;
}

.guardrail-input-wrap:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.curr-symbol {
    color: #64748b;
    font-weight: 500;
    font-size: 0.78rem;
    margin-right: 4px;
}

.guardrail-input {
    background: transparent;
    border: none;
    color: #f8fafc;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 500;
    width: 100%;
    outline: none;
    padding: 3px 0;
}

.profit-cushion-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.68rem;
    font-weight: 400;
    color: #94a3b8;
    background: rgba(0, 0, 0, 0.2);
    padding: 3px 7px;
    border-radius: 4px;
    margin-top: 2px;
}

.profit-cushion-stats strong {
    font-weight: 500;
}

.profit-positive {
    color: #34d399 !important;
}

.guardrail-hint {
    font-size: 0.67rem;
    color: #64748b;
    line-height: 1.3;
}

.guardrail-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.btn-save-guardrails {
    flex: 1;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.35);
    color: #93c5fd;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: none;
}

.btn-save-guardrails:hover {
    background: #3b82f6;
    color: #ffffff;
}

.btn-reset-paper {
    flex: 1;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fcd34d;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-reset-paper:hover {
    background: #f59e0b;
    color: #ffffff;
}

/* Mode Badges for Executed Trades Table */
.mode-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.mode-badge-live {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.mode-badge-paper {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.mode-badge-backtest {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.4);
}

/* ============================================================
   Multi-Chart Split Handles (TradingView / Dhan Style)
   ============================================================ */
.chart-split-handle {
    display: none;
    background: transparent;
    position: relative;
    z-index: 15;
    cursor: col-resize;
    user-select: none;
    -webkit-user-select: none;
    transition: background 0.15s ease;
    align-items: center;
    justify-content: center;
    width: 4px;
}

.chart-split-handle::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 1px;
    right: 1px;
    background: rgba(255, 255, 255, 0.08);
    transition: background 0.2s ease;
}

.chart-split-handle::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 28px;
    border-radius: 1px;
    background: rgba(255, 255, 255, 0.25);
    transition: background 0.2s ease, height 0.2s ease, box-shadow 0.2s ease;
    z-index: 2;
}

.chart-split-handle:hover::before,
.chart-split-handle.is-dragging::before {
    background: var(--accent-blue, #3b82f6);
}

.chart-split-handle:hover::after,
.chart-split-handle.is-dragging::after {
    background: #ffffff;
    height: 42px;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.8);
}

/* Horizontal mode split handle */
.chart-split-handle.horizontal {
    cursor: row-resize;
    width: 100%;
    height: 4px;
}

.chart-split-handle.horizontal::before {
    top: 1px;
    bottom: 1px;
    left: 0;
    right: 0;
}

.chart-split-handle.horizontal::after {
    width: 28px;
    height: 2px;
}

.chart-split-handle.horizontal:hover::after,
.chart-split-handle.horizontal.is-dragging::after {
    width: 42px;
    height: 2px;
}

/* ============================================================
   Floating Dhan-Style Chart Context Menu
   ============================================================ */
.chart-context-menu {
    position: fixed;
    z-index: 9999;
    background: rgba(18, 24, 38, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 6px;
    min-width: 210px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65), 0 0 1px rgba(255, 255, 255, 0.2);
    animation: ctxFadeIn 0.12s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: 'Inter', sans-serif;
}

@keyframes ctxFadeIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.context-menu-header {
    padding: 4px 10px 6px;
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-muted, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 4px;
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 5px;
    color: var(--text-main, #f1f5f9);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    user-select: none;
}

.context-menu-item svg {
    color: #94a3b8;
    flex-shrink: 0;
    transition: color 0.15s ease, transform 0.15s ease;
}

.context-menu-item:hover {
    background: rgba(59, 130, 246, 0.18);
    color: #ffffff;
}

.context-menu-item:hover svg {
    color: var(--accent-blue, #60a5fa);
    transform: scale(1.08);
}

.context-menu-shortcut {
    margin-left: auto;
    font-size: 0.68rem;
    color: #64748b;
    /*font-family: 'JetBrains Mono', monospace;*/
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 5px;
    border-radius: 3px;
}

.context-menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.07);
    margin: 4px 0;
}

/* ============================================================
   Dhan-Style Strike Open Interest (OI) Profile & Header Stats
   ============================================================ */
.pane-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.spot-oi-header-stats {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    background: #0a101d;
    /* border: 1px solid rgba(255, 255, 255, 0.12);*/
    border-radius: 6px;
    padding: 3px 12px;
}

.oi-header-stat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-family: var(--font-sans);
}

.oi-stat-label {
    color: #94a3b8;
    font-weight: 400;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.oi-stat-val {
    color: #f8fafc;
    font-weight: 500;
    font-family: var(--font-mono);
    font-size: 0.78rem;
}

.oi-stat-val.positive {
    color: #10b981;
}

.oi-stat-val.negative {
    color: #ef4444;
}

#spotOiToggleBtn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    font-size: 0.72rem;
    font-weight: 400;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#spotOiToggleBtn:hover {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.15);
    color: #ffffff;
}

#spotOiToggleBtn.active {
    background: rgba(59, 130, 246, 0.22);
    border-color: #3b82f6;
    color: #60a5fa;
}

.oi-btn-icon {
    font-size: 0.8rem;
}

.oi-profile-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9;
}

/* Floating Dhan Dark Glassmorphism Tooltip Card */
.oi-strike-tooltip {
    position: fixed;
    z-index: 10000;
    background: #121826;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    padding: 10px 14px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.85), 0 0 1px rgba(255, 255, 255, 0.25);
    min-width: 220px;
    pointer-events: auto;
    font-family: 'Inter', sans-serif;
}

@keyframes oiFadeIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.oi-tt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 6px;
    margin-bottom: 8px;
}

.oi-tt-strike {
    font-size: 0.82rem;
    font-weight: 500;
    color: #f1f5f9;
    /*  font-family: 'JetBrains Mono', monospace;*/
}

.oi-tt-expiry {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 500;
}

.oi-tt-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.oi-tt-row:last-child {
    margin-bottom: 0;
}

.oi-tt-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.oi-tt-bullet {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.oi-tt-bullet.ce {
    background: #eb4d4b;
}

.oi-tt-bullet.pe {
    background: #00b894;
}

.oi-tt-label {
    font-size: 0.75rem;
    font-weight: 400;
    color: #94a3b8;
}

.oi-tt-val {
    font-size: 0.82rem;
    font-weight: 500;
    /*  font-family: 'JetBrains Mono', monospace;*/
    color: #f1f5f9;
}

.oi-tt-actions {
    display: flex;
    gap: 4px;
}

.oi-tt-btn {
    width: 22px;
    height: 22px;
    border-radius: 3px;
    border: none;
    font-size: 0.7rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.oi-tt-btn.buy {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.oi-tt-btn.buy:hover {
    background: #10b981;
    color: #ffffff;
}

.oi-tt-btn.sell {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.oi-tt-btn.sell:hover {
    background: #ef4444;
    color: #ffffff;
}

/* ============================================================ */
/* Trade Log Header Customizations (Center Clock & Today's PnL) */
/* ============================================================ */
.trade-log-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    padding: 8px 14px;
}

/* Responsive label visibility helpers for trade log header */
.tab-label-short,
.label-short {
    display: none;
}

.tab-label-full,
.label-full {
    display: inline;
}

.log-header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

.log-header-center .ticker-time {
    font-size: 0.88rem;
    /*font-family: 'JetBrains Mono', monospace;*/
    font-weight: 500;
    color: var(--accent-blue, #3b82f6);
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.25);
    padding: 3px 10px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.header-today-pnl-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 400;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3px 10px;
    border-radius: 4px;
}

.today-pnl-label {
    color: var(--text-muted, #94a3b8);
}

.today-pnl-val {
    /*  font-family: 'JetBrains Mono', monospace;*/
    font-weight: 500;
}

.header-weekly-trades-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 400;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.25);
    padding: 3px 10px;
    border-radius: 4px;
}

.weekly-trades-label {
    color: var(--text-muted, #94a3b8);
}

.weekly-trades-val {
    /*font-family: 'JetBrains Mono', monospace;*/
    font-weight: 500;
    color: #60a5fa;
}

/* ============================================================ */
/* Trade Log Header - Mobile Portrait Responsive Optimization  */
/* ============================================================ */
@media (max-width: 768px) {

    .tab-label-full,
    .label-full {
        display: none !important;
    }

    .tab-label-short,
    .label-short {
        display: inline !important;
    }

    .trade-log-card-header {
        padding: 6px 8px;
        gap: 6px;
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: center;
        overflow: hidden;
    }

    /* Completely eliminate absolute positioning to prevent overlap on mobile */
    .log-header-center {
        position: static;
        transform: none;
        pointer-events: auto;
        flex-shrink: 0;
        margin: 0 2px;
    }

    .log-header-center .ticker-time {
        font-size: 0.72rem;
        padding: 2px 6px;
        border-radius: 4px;
        letter-spacing: 0;
        white-space: nowrap;
    }

    .log-tabs {
        padding: 2px 3px;
        gap: 4px;
        flex-shrink: 0;
    }

    .log-tab-btn {
        padding: 4px 8px;
        font-size: 0.74rem;
        white-space: nowrap;
        border-radius: 5px;
    }

    .log-header-actions {
        gap: 6px !important;
        flex-shrink: 0;
    }

    /* On mobile <= 768px, hide week trades to guarantee clean single-row spacing for Today's PnL & Clock */
    .header-weekly-trades-pill {
        display: none !important;
    }

    .header-today-pnl-pill {
        padding: 2px 7px;
        font-size: 0.72rem;
        gap: 4px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .today-pnl-val {
        font-size: 0.75rem;
    }

    .dhan-icon-btn {
        width: 26px;
        height: 26px;
        padding: 3px;
        flex-shrink: 0;
    }

    .dhan-icon-btn svg {
        width: 14px;
        height: 14px;
    }
}

@media (max-width: 420px) {
    .trade-log-card-header {
        padding: 4px 6px;
        gap: 4px;
    }

    .log-tab-btn {
        padding: 3px 6px;
        font-size: 0.7rem;
    }

    .log-header-center .ticker-time {
        font-size: 0.68rem;
        padding: 2px 5px;
    }

    /* On very narrow phones (<= 420px), hide "Today:" label prefix so only the colored value displays cleanly */
    .today-pnl-label {
        display: none !important;
    }

    .header-today-pnl-pill {
        padding: 2px 5px;
    }

    .today-pnl-val {
        font-size: 0.72rem;
    }

    .log-header-actions {
        gap: 4px !important;
    }

    .dhan-icon-btn {
        width: 24px;
        height: 24px;
    }

    .dhan-icon-btn svg {
        width: 13px;
        height: 13px;
    }
}

/* ============================================================ */
/* Mobile Trade Log Cards View (Approach 1 - Dhan & Zerodha)   */
/* ============================================================ */
.mobile-trades-filter-bar {
    display: none;
    gap: 8px;
    padding: 8px 10px;
    background: #0d121f;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.m-filter-group {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
}

.m-filter-label {
    font-size: 0.72rem;
    color: var(--text-muted, #94a3b8);
    font-weight: 500;
}

.m-filter-select {
    flex: 1;
    background: var(--bg-input, #131b2e);
    border: 1px solid var(--border-color, #232f48);
    color: var(--text-main, #f1f5f9);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.74rem;
    outline: none;
}

.mobile-trades-summary-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.35);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.74rem;
    font-weight: 600;
}

.m-sum-item {
    color: var(--text-muted, #94a3b8);
}

.trades-cards-container {
    display: none;
}

/* Trade Card Item */
.trade-card-item {
    background: #0f1422;
    border: 1px solid #1c2436;
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
    user-select: none;
}

.trade-card-item:hover,
.trade-card-item:active {
    border-color: rgba(59, 130, 246, 0.4);
    background: #111728;
}

/* Clean 2-Row Mobile Pro Trade Card */
.m-card-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

.m-card-top-row {
    padding-bottom: 2px;
}

.m-card-bottom-row {
    padding-top: 2px;
}

.m-card-meta-left {
    display: flex;
    align-items: center;
    gap: 7px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.m-trade-id {
    font-size: 0.82rem;
    font-weight: 700;
    color: #cbd5e1;
    flex-shrink: 0;
}

.m-mode-tag {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.m-mode-tag.paper {
    color: #f59e0b;
}

.m-mode-tag.live {
    color: #10b981;
}

.m-mode-tag.backtest {
    color: #8b5cf6;
}

.m-strat-name {
    font-size: 0.76rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.m-card-meta-right {
    flex-shrink: 0;
    text-align: right;
}

.m-card-pnl {
    font-size: 0.92rem;
    font-weight: 700;
}

.m-card-time-reason {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.m-time-text {
    font-size: 0.72rem;
    color: #94a3b8;
    white-space: nowrap;
    flex-shrink: 0;
}

.m-reason-dot-wrap {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #cbd5e1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.m-card-points-chevron {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.m-card-points {
    font-size: 0.82rem;
    font-weight: 600;
}

.trade-card-chevron {
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    padding: 2px;
}

.trade-card-item.expanded .trade-card-chevron svg {
    transform: rotate(180deg);
}

/* Accordion Expandable Details Drawer */
.trade-card-details {
    display: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 8px;
    margin-top: 2px;
}

.trade-card-item.expanded .trade-card-details {
    display: block;
}

.trade-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 14px;
}

.detail-cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.73rem;
}

.detail-cell .d-lbl {
    color: var(--text-muted, #94a3b8);
}

.detail-cell .d-val {
    color: #f1f5f9;
    font-weight: 500;
    font-family: var(--font-mono, monospace);
}

/* ------------------------------------------------------------ */
/* Modern 7-Column Pro Trade Table (Dual-Line & Fluid Grid)     */
/* ------------------------------------------------------------ */
.pro-trades-table {
    width: 100%;
    table-layout: auto;
    border-collapse: collapse;
}

.pro-trades-table th {
    padding: 10px 12px;
    font-size: 0.76rem;
    font-weight: 600;
    color: #94a3b8;
    background: #090d16;
    border-bottom: 1px solid #1c2436;
    white-space: nowrap;
    text-align: left !important;
}

.pro-trades-table th.th-filter-col {
    padding: 6px 12px !important;
    text-align: left !important;
    vertical-align: middle;
}

.pro-trades-table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
    text-align: left !important;
}

.pro-trades-table tr:hover td {
    background: rgba(255, 255, 255, 0.025);
}

.trade-dual-cell {
    display: flex;
    flex-direction: column;
    gap: 3px;
    justify-content: flex-start !important;
    align-items: flex-start !important;
    text-align: left !important;
}

.trade-dual-cell .dual-top {
    font-size: 0.82rem;
    font-weight: 400;
    color: #acbbca;
    line-height: 1.25;
    text-align: left !important;
}

.trade-dual-cell .dual-sub {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted, #94a3b8);
    line-height: 1.2;
    text-align: left !important;
}

.trade-dual-cell .dual-top.positive {
    color: #10b981 !important;
    font-weight: 400;
}

.trade-dual-cell .dual-sub.negative {
    color: #ff8989 !important;
    font-weight: 300;
}

.trade-dual-cell .mode-micro-tag {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trade-dual-cell .mode-micro-tag.paper {
    color: #f59e0b;
}

.trade-dual-cell .mode-micro-tag.live {
    color: #10b981;
}

.trade-dual-cell .mode-micro-tag.backtest {
    color: #8b5cf6;
}

.pro-strike-link {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    font-family: var(--font-mono, monospace);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    text-align: left !important;
    transition: color 0.15s ease;
}

.pro-strike-link.call {
    color: #10b981;
}

.pro-strike-link.call:hover {
    color: #34d399;
    text-decoration: underline;
}

.pro-strike-link.put {
    color: #ef4444;
}

.pro-strike-link.put:hover {
    color: #f87171;
    text-decoration: underline;
}

.strat-subtext {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left !important;
    display: inline-flex;
    align-items: center;
}

.time-range {
    color: #94a3b8;
    font-size: 0.78rem;
    text-align: left !important;
}

.reason-dot-wrap {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #cbd5e1;
    text-align: left !important;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.turnover-subtext {
    color: #64748b;
    font-size: 0.7rem;
    text-align: left !important;
}

.pnl-bold {
    font-size: 0.92rem;
    font-weight: 700;
    text-align: left !important;
}

/* Fluid Single-Line Flow on Ultra-Wide Monitors (> 1440px) */
@media (min-width: 1441px) {
    .trade-dual-cell {
        flex-direction: row;
        align-items: baseline !important;
        justify-content: flex-start !important;
        text-align: left !important;
        gap: 8px;
    }

    .trade-dual-cell .dual-sub {
        opacity: 0.85;
        text-align: left !important;
    }
}

/* Responsive Trigger for Mobile Viewports */
@media (max-width: 768px) {
    .dashboard-grid {
        gap: 2px;
    }

    .trades-section {
        margin-bottom: env(safe-area-inset-bottom, 0px);
    }

    .trades-section.logs-collapsed {
        height: 42px !important;
        max-height: 42px !important;
    }

    .dashboard-grid.logs-collapsed {
        grid-template-rows: 1fr auto 42px !important;
    }

    .trades-section.logs-maximized .table-wrapper {
        max-height: calc(var(--app-height, 100dvh) - 90px) !important;
    }

    #executedTradesTable {
        display: none !important;
    }

    .mobile-trades-filter-bar {
        display: flex;
    }

    .mobile-trades-summary-bar {
        display: flex;
    }

    .trades-cards-container {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 8px 6px;
    }
}

/* Right Panel Tab Switching & Strategy Controls Drawer         */
/* ============================================================ */
.right-tab-pane {
    width: 100%;
}

.btn-edit-strategies {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-edit-strategies:hover {
    background: #3b82f6;
    color: #ffffff;
}

.active-strategies-readonly-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.active-strat-ro-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.active-strat-ro-item:hover {
    border-color: rgba(59, 130, 246, 0.4);
}

.active-strat-ro-title {
    font-size: 0.8rem;
    font-weight: 400;
    color: #e2e8f0;
}

.active-strat-ro-badges {
    display: flex;
    align-items: center;
    gap: 6px;
}

.strat-badge {
    font-size: 0.68rem;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 3px;
    /*font-family: 'JetBrains Mono', monospace;*/
}

.badge-lot {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge-capped {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-uncapped {
    background: rgba(148, 163, 184, 0.15);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.badge-active {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-inactive {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ============================================================ */
/* Strategy Controls Drawer & Matrix Panel                      */
/* Matches Risk & Guardrails Dark Theme & Emerald Accents       */
/* ============================================================ */
.strat-controls-drawer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 2px;
}

.strat-controls-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    margin-bottom: 2px;
}

.strat-controls-drawer-header h2 {
    font-size: 0.85rem;
    font-weight: 500;
    color: #f1f5f9;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.2px;
}

.btn-back-portfolio {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #94a3b8;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.74rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-back-portfolio:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateX(-1px);
}

.drawer-card {
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.drawer-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.drawer-card-icon {
    font-size: 0.95rem;
    line-height: 1;
}

.drawer-card-header h3 {
    font-size: 0.8rem;
    font-weight: 400;
    color: #cbd5e1;
    margin: 0;
    letter-spacing: 0.2px;
}

.drawer-label {
    font-size: 0.72rem;
    font-weight: 500;
    color: #94a3b8;
    margin-bottom: 4px;
    display: block;
}

.drawer-hint {
    font-size: 0.67rem;
    color: #64748b;
    margin-top: 5px;
    display: block;
    line-height: 1.35;
}

/* Option Strike Global Dropdown */
.strategy-dropdown.option-select {
    width: 100%;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 6px;
    padding: 7px 10px;
    color: #f1f5f9;
    font-size: 0.78rem;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.strategy-dropdown.option-select:hover {
    border-color: rgba(59, 130, 246, 0.5);
    background: rgba(0, 0, 0, 0.45);
}

.strategy-dropdown.option-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.strategy-matrix-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Minimalist Strategy Row Card */
.matrix-row-card {
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.matrix-row-card:hover {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(15, 23, 42, 0.7);
}

.matrix-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.matrix-strat-title {
    font-size: 0.8rem;
    font-weight: 400;
    color: #f1f5f9;
    letter-spacing: 0.15px;
}

/* Single Environment Row (LIVE & PAPER) */
.matrix-env-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
    gap: 8px;
    transition: opacity 0.2s ease;
}

.matrix-env-row.is-disabled {
    opacity: 0.45;
}

.env-left-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    min-width: 66px;
}

.env-tag {
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    padding: 2px 5px;
    border-radius: 3px;
}

.env-tag.live {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.env-tag.paper {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

/* Minimalist Toggle Switch */
.env-switch {
    position: relative;
    display: inline-block;
    width: 26px;
    height: 14px;
    cursor: pointer;
    user-select: none;
    margin: 0;
}

.env-switch input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.env-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.env-slider::before {
    content: "";
    position: absolute;
    width: 10px;
    height: 10px;
    left: 2px;
    top: 2px;
    background-color: #94a3b8;
    border-radius: 50%;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.env-switch input:checked+.env-slider {
    background: rgba(16, 185, 129, 0.65);
}

.live-row .env-switch input:checked+.env-slider {
    background: rgba(239, 68, 68, 0.65);
}

.env-switch input:checked+.env-slider::before {
    transform: translateX(12px);
    background-color: #ffffff;
}

/* Simple thin separator line between LIVE and PAPER */
.matrix-env-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 2px 0;
    width: 100%;
}

/* Right Controls Group (Lots + Discipline) */
.env-right-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    justify-content: flex-end;
}

.env-ctrl-box {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ctrl-label {
    font-size: 0.67rem;
    color: #64748b;
    font-weight: 500;
}

.matrix-select {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 3px 6px;
    color: #f1f5f9;
    font-size: 0.72rem;
    /*  font-family: var(--font-mono, monospace);*/
    font-weight: 500;
    outline: none;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.matrix-select:hover,
.matrix-select:focus {
    border-color: rgba(59, 130, 246, 0.4);
}

.matrix-select option {
    background: #0f172a;
    color: #f1f5f9;
}

/* Discipline Cap Pill */
.cap-toggle-label {
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    margin: 0;
}

.cap-toggle-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.cap-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.15s ease;
}

.cap-pill.is-capped {
    color: #fcd34d;
    border-color: rgba(245, 158, 11, 0.25);
}

.cap-pill.is-capped:hover {
    background: rgba(245, 158, 11, 0.1);
}

.cap-pill.is-uncapped {
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.25);
}

.cap-pill.is-uncapped:hover {
    background: rgba(59, 130, 246, 0.1);
}

/* Drawer Footer Action Buttons - Matching Guardrails styling */
.drawer-action-footer {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.btn-save-controls {
    flex: 2;
    padding: 8px 14px;
    background: rgba(59, 130, 246, 0.16);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #93c5fd;
    font-size: 0.78rem;
    font-weight: 400;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-save-controls:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.35);
}

.btn-reset-controls {
    flex: 1;
    padding: 8px 12px;
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fcd34d;
    font-size: 0.78rem;
    font-weight: 400;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-reset-controls:hover {
    background: #f59e0b;
    color: #ffffff;
    border-color: #f59e0b;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.35);
}

/* ============================================================ */
/* Overall Trade P&L Historical Analytics Tab Styles           */
/* ============================================================ */
.analytics-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.analytics-filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: #94a3b8;
}

.analytics-input,
.analytics-select {
    padding: 4px 8px;
    font-size: 0.78rem;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f8fafc;
    border-radius: 4px;
    outline: none;
}

.analytics-period-toggle {
    display: flex;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    overflow: hidden;
}

.period-btn {
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 400;
    background: transparent;
    color: #94a3b8;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.period-btn.active {
    background: #2563eb;
    color: #ffffff;
}

.btn-analytics-apply {
    padding: 5px 12px;
    font-size: 0.78rem;
    font-weight: 500;
    background: rgba(37, 99, 235, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(37, 99, 235, 0.4);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-analytics-apply:hover {
    background: #2563eb;
    color: #ffffff;
}

.analytics-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.015);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.analytics-card {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.07);
    padding: 10px 12px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.a-label {
    font-size: 0.7rem;
    font-weight: 400;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.a-value {
    font-size: 1.05rem;
    font-weight: 500;
    /* font-family: 'JetBrains Mono', monospace;*/
    color: #f8fafc;
}

/* ------------------------------------------------------------ */
/* Analytics View Switcher & Performance Bar Chart              */
/* ------------------------------------------------------------ */
.analytics-view-toggle {
    display: inline-flex;
    align-items: center;
    background: #080c14;
    border: 1px solid #1c2436;
    border-radius: 6px;
    padding: 2px;
    margin-left: auto;
}

.analytics-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: transparent;
    border: none;
    border-radius: 4px;
    font-size: 0.76rem;
    font-weight: 600;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.15s ease;
}

.analytics-view-btn.active {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.analytics-view-btn:hover:not(.active) {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.05);
}

.analytics-content-panel {
    width: 100%;
}

.analytics-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #0c101a;
    border-bottom: 1px solid #1c2436;
    flex-wrap: wrap;
    gap: 10px;
}

.chart-title {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 700;
    color: #f1f5f9;
}

.chart-subtitle {
    font-size: 0.72rem;
    color: #64748b;
    margin-top: 2px;
    display: block;
}

.chart-legend {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 600;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    display: inline-block;
    margin-right: 5px;
}

.legend-dot.profit {
    background: #10b981;
}

.legend-dot.loss {
    background: #ef4444;
}

.analytics-chart-canvas-container {
    width: 100%;
    position: relative;
    background: #080c14;
    padding: 10px 0;
    overflow-x: auto;
    box-sizing: border-box;
}

.analytics-chart-scroll-wrap {
    width: 100%;
    display: block;
    overflow-x: auto;
}

.analytics-svg-chart {
    display: block;
    width: 100%;
}

.analytics-bar {
    transition: fill-opacity 0.15s ease, filter 0.15s ease;
    cursor: pointer;
}

.analytics-bar-group:hover .analytics-bar {
    fill-opacity: 1 !important;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.25));
}

.chart-empty-state {
    text-align: center;
    padding: 48px 16px;
    color: var(--text-muted, #94a3b8);
    font-size: 0.85rem;
}

/* Floating Glassmorphic Bar Tooltip */
.analytics-bar-tooltip {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
    background: rgba(15, 20, 32, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 10px 14px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.7);
    min-width: 230px;
    font-size: 0.76rem;
    color: #cbd5e1;
}

.analytics-bar-tooltip .tt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    color: #f1f5f9;
    font-size: 0.8rem;
}

.analytics-bar-tooltip .tt-badge {
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 700;
}

.analytics-bar-tooltip .tt-badge.profit-positive {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.analytics-bar-tooltip .tt-badge.negative {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.analytics-bar-tooltip .tt-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 3px 0;
    gap: 12px;
}

.analytics-bar-tooltip .tt-row.highlight {
    font-size: 0.82rem;
    font-weight: 700;
    margin: 4px 0;
}

.analytics-bar-tooltip .tt-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 6px 0;
}

/* ============================================================ */
/* Active Strategies Read-Only List (Portfolio Tab)             */
/* Matches Risk Guardrails Bottom Part Theme & Green Outline   */
/* ============================================================ */
.active-strategies-readonly-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Master Execution Switch Bar */
.active-strat-master-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 6px 10px;
    margin-bottom: 6px;
}

.active-strat-master-bar .master-bar-lbl {
    color: #cbd5e1;
    font-size: 0.76rem;
    font-weight: 400;
    letter-spacing: 0.2px;
}

.btn-master-switch {
    /* font-family: var(--font-mono, 'JetBrains Mono', monospace);*/
    font-size: 0.74rem;
    font-weight: 500;
    letter-spacing: 0.6px;
    padding: 3px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    line-height: 1.4;
    text-transform: uppercase;
    border: 1px solid transparent;
}

.btn-master-switch.is-enabled {
    background: rgba(16, 185, 129);
    border-color: rgba(16, 185, 129, 0.6);
    color: #ffffff;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
}

.btn-master-switch.is-enabled:hover {
    background: rgba(16, 185, 129);
    border-color: #10b981;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.45);
}

.btn-master-switch.is-disabled {
    background: rgba(239, 68, 68);
    border-color: rgba(239, 68, 68, 0.6);
    color: #ffffff;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.2);
}

.btn-master-switch.is-disabled:hover {
    background: rgba(239, 68, 68);
    border-color: #ef4444;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.45);
}

/* Direction Filter Bar below Master Switch */
.active-strat-direction-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 6px 10px;
    margin-bottom: 6px;
}

.active-strat-direction-bar .direction-bar-lbl {
    color: #cbd5e1;
    font-size: 0.76rem;
    font-weight: 400;
    letter-spacing: 0.2px;
}

.direction-btn-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-dir-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 3px 9px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    line-height: 1.4;
    text-transform: uppercase;
    border: 1px solid transparent;
}

.btn-dir-toggle .dir-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

/* CE Button States */
.btn-dir-toggle.ce-btn.is-active {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.55);
    color: #34d399;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
}

.btn-dir-toggle.ce-btn.is-active .dir-dot {
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
}

.btn-dir-toggle.ce-btn.is-active:hover {
    background: rgba(16, 185, 129, 0.28);
    border-color: #10b981;
}

.btn-dir-toggle.ce-btn.is-disabled {
    background: rgba(100, 116, 139, 0.14);
    border-color: rgba(100, 116, 139, 0.3);
    color: #94a3b8;
    opacity: 0.65;
}

.btn-dir-toggle.ce-btn.is-disabled .dir-dot {
    background: #64748b;
    box-shadow: none;
}

.btn-dir-toggle.ce-btn.is-disabled:hover {
    opacity: 0.9;
    border-color: rgba(100, 116, 139, 0.5);
}

/* PE Button States */
.btn-dir-toggle.pe-btn.is-active {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.55);
    color: #f87171;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.2);
}

.btn-dir-toggle.pe-btn.is-active .dir-dot {
    background: #ef4444;
    box-shadow: 0 0 6px #ef4444;
}

.btn-dir-toggle.pe-btn.is-active:hover {
    background: rgba(239, 68, 68, 0.28);
    border-color: #ef4444;
}

.btn-dir-toggle.pe-btn.is-disabled {
    background: rgba(100, 116, 139, 0.14);
    border-color: rgba(100, 116, 139, 0.3);
    color: #94a3b8;
    opacity: 0.65;
}

.btn-dir-toggle.pe-btn.is-disabled .dir-dot {
    background: #64748b;
    box-shadow: none;
}

.btn-dir-toggle.pe-btn.is-disabled:hover {
    opacity: 0.9;
    border-color: rgba(100, 116, 139, 0.5);
}

.active-strat-strike-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 7px 11px;
    margin-bottom: 2px;
}

.active-strat-strike-bar .strike-bar-lbl {
    color: #94a3b8;
    font-size: 0.74rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.active-strat-strike-bar .strike-bar-val {
    color: #8e9bb0;
    /* font-family: var(--font-mono, 'JetBrains Mono', monospace);
    
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.35);*/
    font-weight: 400;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.active-strat-items-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Active Strategy Read-Only Card with Green Outline Border */
.active-strat-readonly-item {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(16, 185, 129, 0.55);
    outline: 1px solid rgba(16, 185, 129, 0.3);
    outline-offset: -1px;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.12), inset 0 0 12px rgba(16, 185, 129, 0.03);
    border-radius: 8px;
    padding: 8px 11px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    position: relative;
}

.active-strat-readonly-item:hover {
    background: rgba(15, 23, 42, 0.82);
    border-color: rgba(16, 185, 129, 0.85);
    outline-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 0 14px rgba(16, 185, 129, 0.22), inset 0 0 14px rgba(16, 185, 129, 0.06);
    transform: translateY(-1px);
}

.strat-readonly-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.strat-readonly-title-wrap {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.strat-status-indicator.live {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    display: inline-block;
    flex-shrink: 0;
    animation: livePulseDot 2s infinite ease-in-out;
}

.strat-readonly-name {
    font-size: 0.82rem;
    font-weight: 400;
    color: #f1f5f9;
    letter-spacing: 0.15px;
}

.strat-tf-badge {
    color: #8e9bb0;
    font-size: 0.68rem;
    font-weight: 400;
    /*font-family: var(--font-mono, monospace);
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);*/
    padding: 1px 6px;
    border-radius: 4px;
    letter-spacing: 0.2px;
}

.strat-active-badge {
    /*background: rgba(16, 185, 129, 0.18) !important;
    border: 1px solid rgba(16, 185, 129, 0.45) !important;*/
    color: #34d399 !important;
    font-size: 0.68rem;
    font-weight: 500;
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.4px;
}

.strat-active-badge.paused {
    /* background: rgba(245, 158, 11, 0.16) !important;
    border: 1px solid rgba(245, 158, 11, 0.45) !important;*/
    color: #fbbf24 !important;
}

/* Strategy-Level Interactive Pause / Resume Toggle */
.btn-strat-pause-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.4px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1.3;
    user-select: none;
    z-index: 2;
}

.btn-strat-pause-toggle.is-running {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
    color: #34d399;
}

.btn-strat-pause-toggle.is-running:hover {
    background: rgba(16, 185, 129, 0.28);
    border-color: #10b981;
    color: #ffffff;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

.btn-strat-pause-toggle.is-paused {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.4);
    color: #fbbf24;
}

.btn-strat-pause-toggle.is-paused:hover {
    background: rgba(245, 158, 11, 0.28);
    border-color: #f59e0b;
    color: #ffffff;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}

.btn-strat-pause-toggle.is-disabled-global {
    background: rgba(100, 116, 139, 0.15);
    border-color: rgba(100, 116, 139, 0.3);
    color: #94a3b8;
    cursor: not-allowed;
    opacity: 0.7;
}

.strat-status-indicator.paused {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #f59e0b;
    box-shadow: 0 0 6px #f59e0b;
    display: inline-block;
    flex-shrink: 0;
}

.active-strat-readonly-item.is-paused {
    border-color: rgba(245, 158, 11, 0.35);
    outline-color: rgba(245, 158, 11, 0.15);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.08);
}

/* Direction pill in card metadata */
.strat-meta-pill.direction-pill {
    font-weight: 500;
    letter-spacing: 0.3px;
}

.strat-meta-pill.direction-pill.both {
    color: #38bdf8;
}

.strat-meta-pill.direction-pill.ce-only {
    color: #34d399;
}

.strat-meta-pill.direction-pill.pe-only {
    color: #f87171;
}

.strat-meta-pill.direction-pill.blocked {
    color: #f59e0b;
}

.strat-readonly-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.strat-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.71rem;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    border: 1px solid transparent;
}

.strat-meta-pill.lots-pill {
    color: #8e9bb0;
    /* font-family: var(--font-mono, monospace);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);*/
}

.strat-meta-pill.capped-pill {
    /*background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.28);*/
    color: #8e9bb0;
}

.strat-meta-pill.uncapped-pill {
    /* background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.28);*/
    color: #8e9bb0;
}

.strat-meta-pill.count-pill {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    /* font-family: var(--font-mono, monospace);*/
    font-weight: 500;
}

.active-strat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: rgba(15, 23, 42, 0.4);
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 18px 14px;
    gap: 6px;
    margin-top: 4px;
}

.active-strat-empty .empty-icon {
    font-size: 1.4rem;
    line-height: 1;
    margin-bottom: 2px;
    opacity: 0.8;
}

.active-strat-empty .empty-title {
    font-size: 0.8rem;
    font-weight: 400;
    color: #cbd5e1;
}

.active-strat-empty .empty-desc {
    font-size: 0.72rem;
    color: #64748b;
    margin-bottom: 6px;
}

.active-strat-empty .btn-configure-empty {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #93c5fd;
    font-size: 0.74rem;
    font-weight: 400;
    padding: 5px 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.active-strat-empty .btn-configure-empty:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #3b82f6;
}

.btn-edit-strategies {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #93c5fd;
    font-size: 0.72rem;
    font-weight: 400;
    padding: 3px 9px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-edit-strategies:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

/* ============================================================ */
/* Independent Option Chart Strike Selection & Trade Log Badges */
/* ============================================================ */
.pane-unpin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.45);
    color: #fca5a5;
    font-size: 0.68rem;
    font-weight: 500;
    padding: 2px 7px;
    border-radius: 4px;
    cursor: pointer;
    line-height: 1;
    transition: all 0.18s ease;
}

.pane-unpin-btn:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
    transform: scale(1.04);
}

/* Interactive Trade Strike Badge in Trade Log */
.btn-trade-strike {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: #f1f5f9;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.76rem;
    font-weight: 400;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    user-select: none;
}

.btn-trade-strike.call-strike {
    border-color: rgba(16, 185, 129, 0.4);
    color: #a7f3d0;
    background: rgba(16, 185, 129, 0.12);
}

.btn-trade-strike.call-strike:hover {
    background: rgba(16, 185, 129, 0.28);
    border-color: #10b981;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.45);
    transform: translateY(-1px);
}

.btn-trade-strike.put-strike {
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.12);
}

.btn-trade-strike.put-strike:hover {
    background: rgba(239, 68, 68, 0.28);
    border-color: #ef4444;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.45);
    transform: translateY(-1px);
}

.btn-trade-strike .strike-icon {
    font-size: 0.8rem;
    opacity: 0.85;
}

/* Selected Trade Row Glow */
tr.selected-trade-row {
    background: rgba(59, 130, 246, 0.14) !important;
    outline: 1px solid rgba(59, 130, 246, 0.6) !important;
    outline-offset: -1px;
}

tr.selected-trade-row td {
    color: #ffffff !important;
}

/* Pulse Animation on Target Chart Pane */
@keyframes paneGlowPulse {
    0% {
        box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.85), 0 0 20px rgba(59, 130, 246, 0.4);
    }

    50% {
        box-shadow: inset 0 0 0 3px rgba(16, 185, 129, 0.95), 0 0 24px rgba(16, 185, 129, 0.5);
    }

    100% {
        box-shadow: none;
    }
}

.chart-pane-highlight {
    animation: paneGlowPulse 1.8s ease-out forwards;
}

/* Active Position Item 'View Chart' Button */
.btn-card-view-pos {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.35);
    color: #93c5fd;
    font-size: 0.7rem;
    font-weight: 400;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-card-view-pos:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

/* ============================================================ */
/* Trade Log Exit Reason: Limited Width, Ellipsis & Tooltip     */
/* ============================================================ */
.trades-table td.reason-cell {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trade-reason-badge {
    display: inline-block;
    max-width: 130px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.74rem;
    font-weight: 400;
    line-height: 1.35;
    border: 1px solid transparent;
    cursor: help;
    transition: all 0.18s ease;
}

.trade-reason-badge:hover {
    filter: brightness(1.22);
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.15);
}

.trade-reason-open {
    color: #60a5fa !important;
    background: rgba(96, 165, 250, 0.15) !important;
    border: 1px solid rgba(96, 165, 250, 0.4) !important;
    max-width: none !important;
    cursor: default;
}

/* ==========================================================================
   Trade Log Header Filters & Table Summary Footers
   ========================================================================== */

.th-filter-col {
    padding: 6px 10px !important;
    vertical-align: middle;
    text-align: left !important;
}

.th-filter-wrapper {
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-items: flex-start;
    text-align: left !important;
}

.th-filter-label {
    display: none;
}

.th-filter-select {
    display: inline-block;
    width: auto;
    min-width: 120px;
    max-width: 200px;
    padding: 3px 6px;
    background: #0d121f;
    color: #e2e8f0;
    border: 1px solid #1e293b;
    border-radius: 4px;
    font-size: 0.74rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    text-align: left !important;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.th-filter-select:hover,
.th-filter-select:focus {
    border-color: #3b82f6;
    background: #1e293b;
    color: #ffffff;
}

.th-filter-select option {
    background: #0f172a;
    color: #f1f5f9;
    padding: 4px 8px;
}

/* ============================================================ */
/* Trade Log Strategy Multi-Select Dropdown Component           */
/* ============================================================ */
.trade-strat-multiselect-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 100%;
    max-width: 220px;
}

.trade-strat-multiselect-btn {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
    min-width: 130px;
    max-width: 220px;
    padding: 3px 8px;
    background: #0d121f;
    color: #e2e8f0;
    border: 1px solid #1e293b;
    border-radius: 4px;
    font-size: 0.74rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    text-align: left !important;
    transition: all 0.15s ease;
    user-select: none;
    box-sizing: border-box;
}

.trade-strat-multiselect-btn:hover,
.trade-strat-multiselect-btn.open {
    border-color: #3b82f6;
    background: #1e293b;
    color: #ffffff;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.25);
}

.trade-strat-multiselect-btn .multiselect-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    text-align: left;
}

.trade-strat-multiselect-btn .multiselect-arrow {
    flex-shrink: 0;
    transition: transform 0.2s ease;
    color: #94a3b8;
}

.trade-strat-multiselect-btn.open .multiselect-arrow {
    transform: rotate(180deg);
    color: #3b82f6;
}

.trade-strat-multiselect-menu {
    position: fixed;
    z-index: 10000;
    min-width: 250px;
    max-width: 320px;
    background: #0d1322;
    border: 1px solid rgba(59, 130, 246, 0.35);
    border-radius: 6px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.85), 0 0 16px rgba(59, 130, 246, 0.15);
    display: flex;
    flex-direction: column;
    padding: 6px 0;
    font-family: var(--font-sans);
    backdrop-filter: blur(8px);
    box-sizing: border-box;
    animation: fadeInDown 0.15s ease-out;
}

.multiselect-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 12px 7px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.multiselect-header-title {
    font-size: 0.70rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
}

.multiselect-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.multiselect-action-btn {
    background: transparent;
    border: none;
    color: #38bdf8;
    font-size: 0.70rem;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.multiselect-action-btn:hover {
    color: #ffffff;
    background: rgba(56, 189, 248, 0.2);
}

.multiselect-action-sep {
    color: #475569;
    font-size: 0.65rem;
}

.multiselect-list {
    display: flex;
    flex-direction: column;
    max-height: 270px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 0;
}

.multiselect-list::-webkit-scrollbar {
    width: 5px;
}

.multiselect-list::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 3px;
}

.multiselect-list::-webkit-scrollbar-thumb:hover {
    background: #3b82f6;
}

.multiselect-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    cursor: pointer;
    transition: background 0.12s ease;
    user-select: none;
    gap: 8px;
}

.multiselect-item:hover {
    background: rgba(59, 130, 246, 0.14);
}

.multiselect-item-label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    cursor: pointer;
    overflow: hidden;
}

.multiselect-checkbox {
    width: 14px;
    height: 14px;
    margin: 0;
    cursor: pointer;
    accent-color: #3b82f6;
    flex-shrink: 0;
}

.multiselect-strat-name {
    font-size: 0.75rem;
    font-weight: 500;
    color: #e2e8f0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.multiselect-active-bolt {
    color: #f59e0b;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.multiselect-manual-badge {
    display: inline-block;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    margin-right: 2px;
}

.multiselect-count-badge {
    font-size: 0.70rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: #64748b;
    flex-shrink: 0;
}

.multiselect-count-badge.has-trades {
    background: rgba(59, 130, 246, 0.18);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.multiselect-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 3px 0;
}

.trades-summary-row {
    background: rgba(15, 23, 42, 0.95);
    border-top: 2px solid rgba(255, 255, 255, 0.16);
    font-size: 0.78rem;
    color: #e2e8f0;
}

.trades-summary-row td {
    padding: 8px 12px;
    vertical-align: middle;
}

.header-filtered-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(59, 130, 246, 0.14);
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 400;
    animation: fadeIn 0.2s ease-in-out;
}

.header-filtered-pill .filtered-pnl-label {
    color: #93c5fd;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.header-filtered-pill .filtered-pnl-val {
    font-family: var(--font-mono);
    font-weight: 500;
}

.header-filtered-pill .filtered-pnl-val.profit-positive {
    color: #10b981;
}

.header-filtered-pill .filtered-pnl-val.negative {
    color: #ef4444;
}

.header-filtered-pill .filtered-pnl-val.neutral {
    color: #94a3b8;
}

/* ==========================================================================
   Dhan & TradingView Style Drawing Tools & Object Tree System
   ========================================================================== */


/* ==========================================================================
   Dhan & TradingView Style Left Vertical Drawing Toolbar
   ========================================================================== */
.left-drawing-toolbar {
    width: 44px;
    min-width: 44px;
    height: 100%;
    background: #131722;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 0;
    z-index: 35;
    position: relative;
    user-select: none;
    box-sizing: border-box;
    transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.22s cubic-bezier(0.4, 0, 0.2, 1), transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), padding 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.left-drawing-toolbar.collapsed {
    width: 0 !important;
    min-width: 0 !important;
    padding: 0 !important;
    border-right: none !important;
    transform: translateX(-100%);
    pointer-events: none;
    overflow: hidden;
}

.dt-tools-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
}

.dt-tools-group::-webkit-scrollbar {
    display: none;
}

.dt-tool-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #787b86;
    cursor: pointer;
    position: relative;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.dt-tool-btn svg {
    pointer-events: none;
    transition: stroke 0.15s ease;
    stroke-width: 1.4;
}

.dt-tool-btn svg path,
.dt-tool-btn svg line,
.dt-tool-btn svg circle,
.dt-tool-btn svg rect,
.dt-tool-btn svg polyline,
.dt-tool-btn svg polygon {
    stroke-width: 1.4 !important;
}

.dt-tool-btn:hover {
    color: #d1d4dc;
    background: rgba(255, 255, 255, 0.08);
}

.dt-tool-btn.active {
    color: #ffffff;
    background: #2a2e39;
}

.dt-tool-btn.active svg {
    stroke: #ffffff;
}

.dt-tool-btn.locked {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
}

.dt-tool-btn.hidden-mode {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
}

/* Tooltip on hover (TradingView / Dhan Style) */
.dt-tool-tooltip {
    position: absolute;
    left: 42px;
    top: 50%;
    transform: translateY(-50%);
    background: #1e222d;
    color: #d1d4dc;
    border: 1px solid #363c4e;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.dt-tool-btn:hover .dt-tool-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Collapse button attached to toolbar right border */
.btn-toggle-drawing-toolbar {
    position: absolute;
    right: -10px;
    bottom: 70px;
    width: 14px;
    height: 30px;
    background: #1e222d;
    border: 1px solid #363c4e;
    border-left: none;
    border-radius: 0 6px 6px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #787b86;
    padding: 0;
    z-index: 45;
    transition: all 0.15s ease;
}

.btn-toggle-drawing-toolbar:hover {
    background: #2a2e39;
    color: #ffffff;
    width: 16px;
}

/* Expand button visible when collapsed (Dhan & TV Style white pill) */
.btn-expand-drawing-toolbar {
    position: absolute;
    left: 0;
    bottom: 70px;
    width: 16px;
    height: 34px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-left: none;
    border-radius: 0 8px 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #111827;
    padding: 0;
    z-index: 45;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.35);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-expand-drawing-toolbar:hover {
    background: #f3f4f6;
    color: #000000;
    width: 18px;
    box-shadow: 3px 3px 12px rgba(0, 0, 0, 0.5);
}

/* 1. Multi-Chart Overlay Drawing Canvases */
.drawing-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 25;
}

.drawing-canvas.active-tool {
    pointer-events: auto !important;
    cursor: crosshair !important;
}

/* 2. Drawing Tools Drawer Tab in Right Sidebar */
.drawing-target-badge {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #60a5fa;
    font-size: 0.68rem;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.drawing-tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.drawing-tool-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    /*  padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);*/
    color: #787b86;
    font-size: 0.76rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.18s ease;
    text-align: left;
}

.drawing-tool-btn:hover {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.35);
    color: #ffffff;
    transform: translateY(-1px);
}

.drawing-tool-btn.active {
    background: rgba(59, 130, 246, 0.22);
    border-color: #3b82f6;
    color: #ffffff;
    /*box-shadow: 0 0 10px rgba(59, 130, 246, 0.25);*/
    font-weight: 500;
}

.drawing-tool-btn .dt-svg {
    flex-shrink: 0;
    color: inherit;
}

/* 3. Style Properties Section */
.drawing-style-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.drawing-style-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.style-prop-label {
    font-size: 0.74rem;
    color: #94a3b8;
    font-weight: 400;
}

.drawing-color-palette {
    display: flex;
    align-items: center;
    gap: 6px;
}

.color-swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
    outline: none;
}

.color-swatch:hover {
    transform: scale(1.15);
}

.color-swatch.active {
    border-color: #ffffff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
    transform: scale(1.2);
}

.custom-color-label {
    position: relative;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.custom-color-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.custom-color-indicator {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.drawing-pill-group {
    display: inline-flex;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 4px;
    padding: 2px;
    gap: 2px;
}

.style-pill {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s;
}

.style-pill:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.05);
}

.style-pill.active {
    background: rgba(59, 130, 246, 0.35);
    color: #93c5fd;
    font-weight: 500;
}

/* 4. Object Tree & Active Drawings Manager */
.btn-clear-drawings {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-clear-drawings:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
    color: #ffffff;
}

.drawings-object-tree-list {
    max-height: 280px;
    overflow-y: auto;
}

.object-tree-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.15s;
    cursor: pointer;
}

.object-tree-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.object-tree-item.selected {
    background: rgba(59, 130, 246, 0.15);
    border-left: 2px solid #3b82f6;
}

.obj-tree-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.obj-tree-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.obj-tree-title {
    font-size: 0.74rem;
    color: #cbd5e1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.obj-tree-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.obj-action-btn {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 0.8rem;
    padding: 2px 4px;
    border-radius: 3px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.15s, background 0.15s;
}

.obj-action-btn:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.08);
}

.obj-action-btn.btn-del:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
}

.obj-action-btn.active-lock {
    color: #f59e0b;
}

.object-tree-empty {
    padding: 16px;
    text-align: center;
    color: #64748b;
    font-size: 0.74rem;
    font-style: italic;
}

/* 5. Dhan-Style Floating Toolbar on Selected Drawing */
.drawing-floating-toolbar {
    position: fixed;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 1px rgba(255, 255, 255, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px 6px;
    user-select: none;
    animation: dftFadeIn 0.15s ease-out;
}

@keyframes dftFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dft-drag-handle {
    cursor: grab;
    color: #64748b;
    font-size: 0.8rem;
    padding: 0 4px;
    letter-spacing: -1px;
}

.dft-drag-handle:active {
    cursor: grabbing;
}

.dft-popover-wrapper {
    position: relative;
    display: inline-flex;
}

.dft-tool-btn {
    background: transparent;
    border: none;
    color: #cbd5e1;
    padding: 4px 7px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: background 0.15s, color 0.15s;
    outline: none;
}

.dft-tool-btn svg {
    pointer-events: none;
    stroke-width: 1.4;
}

.dft-tool-btn svg path,
.dft-tool-btn svg line,
.dft-tool-btn svg circle,
.dft-tool-btn svg rect,
.dft-tool-btn svg polyline,
.dft-tool-btn svg polygon {
    stroke-width: 1.4 !important;
}

.dft-tool-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.dft-color-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.dft-divider {
    width: 1px;
    height: 16px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 3px;
}

.dft-delete-btn:hover {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #ef4444 !important;
}

/* Dhan-Style Floating Toolbar Popovers */
.dft-popover-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    background: #1e222d;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 6px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.88), 0 0 1px rgba(255, 255, 255, 0.35);
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 4px;
    z-index: 2500;
}

.dft-popover-dropdown.open {
    display: flex !important;
}

.dft-popover-dropdown.open-upwards {
    top: auto;
    bottom: calc(100% + 5px);
}

/* 1. Dhan Color Picker Popover (10x8 Matrix + Opacity) */
.dft-dhan-color-popup {
    min-width: 256px;
    padding: 10px 10px 12px 10px;
    background: #1e222d;
}

.dft-dhan-palette-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.dft-dhan-swatch {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.25);
    cursor: pointer;
    outline: none;
    padding: 0;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    box-sizing: border-box;
}

.dft-dhan-swatch:hover {
    transform: scale(1.15);
    z-index: 2;
    border-color: rgba(255, 255, 255, 0.6);
}

.dft-dhan-swatch.active {
    box-shadow: 0 0 0 2px #ffffff !important;
    z-index: 3;
    border-color: #000000;
}

.dft-palette-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 6px 0 8px 0;
}

.dft-palette-add-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    position: relative;
}

.dft-add-color-btn {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 4px;
    color: #e2e8f0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.dft-add-color-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.35);
}

.custom-color-input-hidden {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

/* Opacity Section (Dhan Style) */
.dft-opacity-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dft-opacity-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dft-opacity-title {
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 500;
}

.dft-opacity-control-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dft-opacity-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, transparent, #3b82f6);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.dft-opacity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #0f172a;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: transform 0.1s;
}

.dft-opacity-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.dft-opacity-badge {
    min-width: 44px;
    padding: 3px 6px;
    background: #131722;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    font-size: 0.72rem;
    color: #f8fafc;
    text-align: center;
    font-weight: 600;
}

/* 2. Dhan Thickness Dropdown (Screenshot 2) */
.dft-thickness-popup {
    min-width: 95px;
    padding: 4px;
    background: #1e222d;
}

.dft-thick-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 6px 10px;
    border: none;
    background: transparent;
    color: #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
    gap: 10px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.12s ease;
    text-align: left;
}

.dft-thick-item:hover {
    background: #2a2e39;
    color: #ffffff;
}

.dft-thick-item.active {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    font-weight: 600;
}

.dft-line-sample-wrap {
    width: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
}

.dft-line-sample {
    width: 100%;
    background: currentColor;
    border-radius: 1px;
    display: block;
}

.dft-thick-txt {
    flex: 1;
}

/* 3. Dhan Line Style Dropdown (Screenshot 3) */
.dft-style-popup {
    min-width: 135px;
    padding: 4px;
    background: #1e222d;
}

.dft-style-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 6px 10px;
    border: none;
    background: transparent;
    color: #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
    gap: 10px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.12s ease;
    text-align: left;
}

.dft-style-item:hover {
    background: #2a2e39;
    color: #ffffff;
}

.dft-style-item.active {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    font-weight: 600;
}

.dft-line-style-sample {
    width: 24px;
    height: 0;
    display: inline-block;
}

.dft-line-style-sample.solid {
    border-top: 1.5px solid currentColor;
}

.dft-line-style-sample.dashed {
    border-top: 1.5px dashed currentColor;
}

.dft-line-style-sample.dotted {
    border-top: 2px dotted currentColor;
}

.dft-tool-btn svg {
    pointer-events: none;
}

.dft-tool-btn.active-dropdown {
    background: #2a2e39 !important;
    color: #ffffff !important;
}

.dft-btn-with-bar {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 3px 6px;
    min-width: 28px;
    position: relative;
}

.dft-indicator-bar {
    width: 14px;
    height: 3px;
    border-radius: 1.5px;
    display: block;
    background: #3b82f6;
    transition: background 0.15s ease;
    pointer-events: none;
}

.dft-t-icon {
    font-family: inherit;
    font-weight: 700;
    font-size: 0.85rem;
    line-height: 1;
    color: inherit;
    pointer-events: none;
}

/* 4. Text Label & Color Popover (Dhan Style) */
.dft-text-popup {
    min-width: 236px;
    padding: 10px;
    background: #1e222d;
}

.dft-popup-title {
    font-size: 0.72rem;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dft-text-input {
    width: 100%;
    box-sizing: border-box;
    background: #131722;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 0.8rem;
    color: #ffffff;
    outline: none;
    transition: border-color 0.15s ease;
}

.dft-text-input:focus {
    border-color: #3b82f6;
}

.dft-popup-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.dft-popup-lbl {
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 500;
}

.dft-palette-mini {
    display: flex;
    align-items: center;
    gap: 5px;
}

.dft-text-swatch {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.3);
    cursor: pointer;
    padding: 0;
    outline: none;
    transition: transform 0.1s, box-shadow 0.1s;
}

.dft-text-swatch:hover {
    transform: scale(1.15);
}

.dft-text-swatch.active {
    box-shadow: 0 0 0 2px #ffffff !important;
}

.dft-custom-color-input {
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.dft-popup-select {
    background: #131722;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 0.75rem;
    outline: none;
}

.dft-popup-apply-btn {
    width: 100%;
    margin-top: 8px;
    background: #2563eb;
    border: none;
    border-radius: 4px;
    padding: 6px;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.dft-popup-apply-btn:hover {
    background: #1d4ed8;
}

.dft-style-txt {
    flex: 1;
}

/* Right Drawer Clear All Action Bar */
.drawer-actions-card {
    margin-top: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 23, 42, 0.4);
    border-radius: 8px;
    padding: 10px;
}

.drawer-clear-action-wrap {
    display: flex;
    width: 100%;
}

.btn-clear-all-drawings-primary {
    width: 100%;
    padding: 8px 12px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 6px;
    color: #f87171;
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.btn-clear-all-drawings-primary:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #ffffff;
    border-color: #ef4444;
}

.btn-clear-all-drawings-primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #64748b;
}

/* ==========================================================================
   6. Dhan & TradingView Style Drawing Settings Modal Dialog
   ========================================================================== */
.drawing-settings-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2100;
    background: rgba(0, 0, 0, 0.82);
    display: flex;
    align-items: center;
    justify-content: center;
}

.drawing-settings-modal-card {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    width: 460px;
    max-width: 95vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75), 0 0 1px rgba(255, 255, 255, 0.25);
    overflow: hidden;
}

.dsm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.dsm-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dsm-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #f8fafc;
    margin: 0;
}

.dsm-close-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 4px;
    padding: 2px 6px;
    transition: all 0.15s;
}

.dsm-close-btn:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.08);
}

/* Tabs Bar */
.dsm-tabs-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px 0 14px;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dsm-tab-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 8px 14px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
}

.dsm-tab-btn:hover {
    color: #cbd5e1;
}

.dsm-tab-btn.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
    font-weight: 600;
}

/* Tab Panes */
.dsm-tab-content {
    display: none;
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.dsm-tab-content.active {
    display: block;
}

.dsm-section-header {
    font-size: 0.76rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.dsm-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 14px 0 12px 0;
}

.dsm-form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.dsm-form-row:last-child {
    margin-bottom: 0;
}

.dsm-label {
    font-size: 0.78rem;
    color: #cbd5e1;
    font-weight: 400;
    flex-shrink: 0;
}

.dsm-control-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dsm-color-picker {
    width: 24px;
    height: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.dsm-select,
.dsm-text-input,
.dsm-num-input {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: #f8fafc;
    font-size: 0.75rem;
    padding: 4px 8px;
    outline: none;
    transition: border-color 0.15s;
}

.dsm-text-input {
    flex: 1;
}

.dsm-num-input {
    width: 140px;
    text-align: right;
}

.dsm-select:focus,
.dsm-text-input:focus,
.dsm-num-input:focus {
    border-color: #3b82f6;
}

.dsm-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.76rem;
    color: #cbd5e1;
    cursor: pointer;
    user-select: none;
}

.dsm-checkbox-label input[type="checkbox"] {
    accent-color: #3b82f6;
    cursor: pointer;
}

.dsm-range {
    width: 80px;
    accent-color: #3b82f6;
    cursor: pointer;
}

.dsm-val-badge {
    font-size: 0.7rem;
    color: #94a3b8;
    min-width: 30px;
    text-align: right;
}

/* Fibonacci Multi-Level Table */
.dsm-fib-levels-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 14px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    padding: 10px;
    max-height: 210px;
    overflow-y: auto;
}

.dsm-fib-level-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 3px 4px;
    border-radius: 4px;
    transition: background 0.12s;
}

.dsm-fib-level-row:hover {
    background: rgba(255, 255, 255, 0.04);
}

.dsm-fib-ratio-label {
    font-size: 0.76rem;
    color: #e2e8f0;
    font-family: monospace;
    font-weight: 500;
}

/* Modal Footer */
.dsm-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.25);
}

.dsm-footer-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dsm-btn {
    border: none;
    border-radius: 4px;
    font-size: 0.76rem;
    font-weight: 500;
    padding: 6px 14px;
    cursor: pointer;
    transition: all 0.15s;
}

.dsm-btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
}

.dsm-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
}

.dsm-btn-primary {
    background: #2563eb;
    color: #ffffff;
}

.dsm-btn-primary:hover {
    background: #1d4ed8;
}



/* ============================================================
   App Secret Key Header Button & Security Modal Styles
   ============================================================ */
.auth-header-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    background: rgba(30, 34, 45, 0.85);
    border: 1px solid #2a2e39;
    border-radius: 6px;
    color: #e0e3eb;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.auth-header-btn:hover {
    background: #2a2e39;
    border-color: #3b82f6;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.2);
}

.auth-header-btn.authenticated {
    border-color: rgba(16, 185, 129, 0.6);
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

.auth-header-btn.authenticated:hover {
    background: rgba(16, 185, 129, 0.22);
    border-color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.35);
}

.auth-header-btn.locked {
    border-color: rgba(239, 68, 68, 0.6);
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    animation: authPulseAlert 2s infinite ease-in-out;
}

@keyframes authPulseAlert {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    50% {
        box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
    }
}

.auth-header-btn.open-dev {
    border-color: rgba(59, 130, 246, 0.4);
    background: rgba(59, 130, 246, 0.08);
    color: #60a5fa;
}

.auth-btn-icon {
    font-size: 0.95rem;
    display: inline-block;
}

.auth-btn-label {
    letter-spacing: 0.2px;
}

/* Access & Security Tab Badges Card */
.access-badges-card {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 14px;
    background: #0d131f;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    margin-bottom: 12px;
}

.access-badges-card .auth-header-btn {
    font-size: 0.78rem;
    padding: 6px 14px;
}

.access-badges-card .status-indicator {
    font-size: 0.74rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    letter-spacing: 0.3px;
    line-height: 1;
}

.access-badges-card .status-indicator.online {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.access-badges-card .status-indicator.offline {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Modal Overlay Backdrop */
.auth-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    padding: 16px;
}

.auth-modal-card {
    background: #131722;
    border: 1px solid #2a2e39;
    border-radius: 10px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@keyframes authScaleUp {
    from {
        transform: scale(0.94);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.auth-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #171b26;
    border-bottom: 1px solid #2a2e39;
}

.auth-modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-modal-icon {
    font-size: 1.4rem;
}

.auth-modal-title {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 700;
    color: #f1f5f9;
}

.auth-modal-subtitle {
    font-size: 0.72rem;
    color: #94a3b8;
    display: block;
    margin-top: 1px;
}

.auth-modal-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.15s;
}

.auth-modal-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.auth-modal-body {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-modal-desc {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.45;
    color: #94a3b8;
}

.auth-modal-desc strong {
    color: #f8fafc;
}

.auth-modal-desc code {
    background: #1e222d;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    color: #38bdf8;
    font-size: 0.76rem;
    border: 1px solid #2a2e39;
}

.auth-status-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    background: #1e222d;
    border: 1px solid #2a2e39;
    font-size: 0.78rem;
    color: #cbd5e1;
}

.auth-banner-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
    flex-shrink: 0;
}

.auth-status-banner.status-secured {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.auth-status-banner.status-secured .auth-banner-dot {
    background: #ef4444;
    box-shadow: 0 0 6px #ef4444;
}

.auth-status-banner.status-auth {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: #86efac;
}

.auth-status-banner.status-auth .auth-banner-dot {
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
}

.auth-status-banner.status-open {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

.auth-status-banner.status-open .auth-banner-dot {
    background: #3b82f6;
    box-shadow: 0 0 6px #3b82f6;
}

.auth-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-text-input {
    width: 100%;
    padding: 9px 36px 9px 12px;
    background: #0b0e14;
    border: 1px solid #2a2e39;
    border-radius: 6px;
    color: #ffffff;
    font-size: 0.86rem;
    font-family: inherit;
    outline: none;
    transition: all 0.15s ease;
}

.auth-text-input:focus {
    border-color: #2962ff;
    box-shadow: 0 0 0 2px rgba(41, 98, 255, 0.25);
}

.auth-eye-btn {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 4px;
    color: #94a3b8;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.auth-eye-btn:hover {
    opacity: 1;
}

.auth-hint {
    font-size: 0.69rem;
    color: #64748b;
}

.auth-result-alert {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    line-height: 1.4;
    display: none;
}

.auth-result-alert.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid #10b981;
    color: #86efac;
    display: block;
}

.auth-result-alert.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid #ef4444;
    color: #fca5a5;
    display: block;
}

.auth-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: #171b26;
    border-top: 1px solid #2a2e39;
}

.auth-footer-right {
    display: flex;
    gap: 8px;
}

.auth-btn {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.auth-btn-primary {
    background: #2962ff;
    color: #ffffff;
    border-color: #2962ff;
}

.auth-btn-primary:hover {
    background: #1e4bd8;
    border-color: #1e4bd8;
    box-shadow: 0 0 8px rgba(41, 98, 255, 0.4);
}

.auth-btn-secondary {
    background: #2a2e39;
    color: #cbd5e1;
    border-color: #363c4e;
}

.auth-btn-secondary:hover {
    background: #363c4e;
    color: #ffffff;
}

.auth-btn-danger {
    background: transparent;
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.auth-btn-danger:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
}

/* ==========================================================================
   ADVANCED TECHNICAL INDICATORS & RSI SUB-PANE SYSTEM (DHAN / TRADINGVIEW STYLE)
   ========================================================================== */

/* Chart Pane Flex Layout for Main Chart & RSI Sub-pane */
.chart-pane {
    display: flex !important;
    flex-direction: column !important;
    position: relative;
    overflow: hidden;
    height: 100%;
    min-height: 0;
}

.chart-pane .chart-container {
    flex: 1 1 auto;
    position: relative;
    min-height: 120px;
}

/* RSI Sub-Pane at Bottom of Chart */
.rsi-subpane {
    height: 115px;
    min-height: 60px;
    max-height: 380px;
    display: flex;
    flex-direction: column;
    background: #11141c;
    position: relative;
    flex-shrink: 0;
    z-index: 10;
    user-select: none;
}

/* Draggable Resize Handle on Top Boundary */
.rsi-drag-handle {
    height: 7px;
    width: 100%;
    cursor: row-resize;
    position: relative;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    margin-top: -3px;
    touch-action: none;
}

.rsi-drag-line {
    position: absolute;
    left: 0;
    right: 0;
    top: 3px;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    transition: background 0.18s ease, box-shadow 0.18s ease, height 0.18s ease;
}

.rsi-drag-grip {
    position: relative;
    width: 28px;
    height: 4px;
    border-radius: 2px;
    background: rgba(148, 163, 184, 0.3);
    opacity: 0;
    transform: scaleX(0.7);
    transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease;
    z-index: 2;
}

.rsi-drag-handle:hover .rsi-drag-line,
.rsi-drag-handle.dragging .rsi-drag-line {
    background: #2962ff;
    box-shadow: 0 0 8px rgba(41, 98, 255, 0.7);
    height: 2px;
}

.rsi-drag-handle:hover .rsi-drag-grip,
.rsi-drag-handle.dragging .rsi-drag-grip {
    opacity: 1;
    transform: scaleX(1);
    background: #2962ff;
}

/* RSI Sub-Chart Container & Background Shaded Band */
.rsi-chart-container {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    background: #11141c;
}

/* Shaded Region Between 70 and 30 (Image 1 Style) */
.rsi-shaded-band {
    position: absolute;
    left: 0;
    right: 55px;
    /* Leave space for price scale */
    pointer-events: none;
    z-index: 1;
    background: rgba(130, 80, 223, 0.07);
    border-top: 1px dashed rgba(130, 80, 223, 0.3);
    border-bottom: 1px dashed rgba(130, 80, 223, 0.3);
    display: none;
}

/* Floating Overlay Legend & Action Pill on Hover (Image 1 & 2 Style) */
.rsi-floating-legend {
    position: absolute;
    top: 6px;
    left: 8px;
    z-index: 20;
    pointer-events: auto;
    user-select: none;
    font-family: Roboto, -apple-system, BlinkMacSystemFont, "Trebuchet MS", sans-serif;
}

/* Idle State: Clean RSI 14  38.63 (Image 1) */
.rsi-legend-idle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    padding: 2px 4px;
    border-radius: 4px;
    transition: opacity 0.12s ease;
}

.rsi-legend-title {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: 0.3px;
}

.rsi-legend-len {
    font-size: 11px;
    font-weight: 500;
    color: #94a3b8;
    font-family: var(--font-mono, monospace);
}

.rsi-legend-val {
    font-size: 11px;
    font-weight: 700;
    color: #8250df;
    font-family: var(--font-mono, monospace);
    margin-left: 2px;
}

/* Hover Action Pill: Matches Image 2 Exactly */
.rsi-legend-pill {
    display: none;
    align-items: center;
    gap: 4px;
    background: #131722;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    padding: 2px 6px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: rsiFadeIn 0.12s ease;
}

@keyframes rsiFadeIn {
    from {
        opacity: 0;
        transform: translateY(-2px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rsi-floating-legend:hover .rsi-legend-idle {
    display: none;
}

.rsi-floating-legend:hover .rsi-legend-pill {
    display: inline-flex;
}

.rsi-legend-title-hover {
    position: relative;
    font-size: 11px;
    font-weight: 600;
    color: #cbd5e1;
    padding: 1px 4px;
    border-radius: 3px;
    cursor: default;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* "Length" Tooltip on Hover over RSI title */
.rsi-tooltip-bubble {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #2a2e39;
    color: #f1f5f9;
    font-size: 10px;
    font-weight: 500;
    padding: 2px 7px;
    border-radius: 3px;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    z-index: 100;
}

.rsi-tooltip-bubble::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -4px;
    border-width: 4px;
    border-style: solid;
    border-color: #2a2e39 transparent transparent transparent;
}

.rsi-legend-title-hover:hover .rsi-tooltip-bubble {
    display: block;
}

/* Action Buttons inside Pill */
.rsi-pill-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.rsi-pill-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.rsi-pill-btn.btn-rsi-trash:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.rsi-pill-btn svg {
    pointer-events: none;
}

/* More Options Dropdown */
.rsi-more-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: #1e222d;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 4px;
    padding: 4px 0;
    min-width: 120px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
    z-index: 60;
}

.rsi-more-item {
    padding: 6px 12px;
    font-size: 11px;
    color: #cbd5e1;
    cursor: pointer;
    transition: background 0.12s ease;
}

.rsi-more-item:hover {
    background: #2962ff;
    color: #ffffff;
}

/* ==========================================================================
   DHAN-STYLE ON-CHART EXPANDABLE INDICATORS TRAY (BELOW CHART HEADING)
   ========================================================================== */
.chart-indicators-tray {
    position: absolute;
    top: 6px;
    left: 8px;
    z-index: 25;
    pointer-events: auto;
    font-family: -apple-system, BlinkMacSystemFont, "Trebuchet MS", Roboto, Ubuntu, sans-serif;
    user-select: none;
    line-height: 1.4;
}

/* Collapsed Toggle Button: [ ∨  7 ] (Image 1) */
.dhan-tray-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(18, 22, 31, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 4px;
    padding: 2px 6px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: all 0.15s ease;
}

.dhan-tray-toggle-btn:hover {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(255, 255, 255, 0.28);
    color: #f1f5f9;
}

.dhan-tray-chevron {
    flex-shrink: 0;
    opacity: 0.85;
}

.dhan-tray-count {
    font-weight: 600;
    font-size: 11px;
    font-family: inherit;
}

/* Expanded List Container (Image 2) */
.dhan-tray-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: transparent;
    padding: 2px 0;
}

.dhan-tray-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 11px;
    color: #cbd5e1;
    white-space: nowrap;
    transition: background 0.15s;
    cursor: default;
    height: 20px;
    box-sizing: border-box;
}

.dhan-tray-item:hover {
    background: rgba(255, 255, 255, 0.07);
}

.dhan-tray-item.is-hidden {
    opacity: 0.52;
}

.dhan-tray-item-main {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dhan-tray-item-title {
    font-weight: 400;
    color: #cbd5e1;
    cursor: pointer;
}

.dhan-tray-item.is-hidden .dhan-tray-item-title {
    color: #94a3b8;
}

.dhan-tray-item-val {
    font-weight: 600;
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
    font-size: 11px;
}

/* Static Slashed Eye shown when item is hidden and not hovered (Image 2) */
.dhan-tray-static-off {
    display: inline-flex;
    align-items: center;
    color: #64748b;
    margin-left: 2px;
}

.dhan-tray-static-off svg {
    opacity: 0.85;
}

/* Action buttons on hover (hide/show, setting, delete) */
.dhan-tray-item-actions {
    display: none;
    align-items: center;
    gap: 2px;
    margin-left: 2px;
}

.dhan-tray-item:hover .dhan-tray-item-actions {
    display: inline-flex;
}

.dhan-tray-item:hover .dhan-tray-static-off {
    display: none;
}

.dhan-tray-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    padding: 0;
    background: transparent;
    border: none;
    color: #94a3b8;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.dhan-tray-action-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.dhan-tray-action-btn.btn-tray-delete:hover {
    color: #ef4444;
}

/* Collapse button [ ⌃ ] at bottom of expanded list (Image 2) */
.dhan-tray-collapse-row {
    margin-top: 2px;
    padding-left: 1px;
}

.dhan-tray-collapse-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 18px;
    padding: 0;
    background: rgba(18, 22, 31, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 4px;
    color: #94a3b8;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: all 0.15s ease;
}

.dhan-tray-collapse-btn:hover {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(255, 255, 255, 0.28);
    color: #ffffff;
}

/* Indicators Sidebar Manager */
.indicator-manager-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 6px 0;
}

.indicator-target-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
}

.indicator-target-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
}

.indicator-target-pills {
    display: flex;
    gap: 4px;
}

.ind-target-pill {
    padding: 3px 9px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ind-target-pill:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #f1f5f9;
}

.ind-target-pill.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #ffffff;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.35);
}

/* Add Indicator Button & Menu */
.indicator-add-bar,
.indicator-add-bar-panel {
    position: relative;
    width: 100%;
}

.indicator-add-dropdown {
    width: 100%;
    position: relative;
}

.btn-add-indicator,
.btn-add-indicator-panel {
    width: 100%;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(37, 99, 235, 0.08);
    border: 1.5px dashed #2563eb;
    border-radius: 6px;
    color: #3b82f6;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-add-indicator:hover,
.btn-add-indicator-panel:hover {
    background: rgba(37, 99, 235, 0.16);
    border-color: #60a5fa;
    color: #60a5fa;
    box-shadow: 0 0 12px rgba(37, 99, 235, 0.25);
}

.add-ind-plus {
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
}

.add-ind-caret {
    font-size: 10px;
    margin-left: 2px;
    opacity: 0.85;
}

.ind-chevron-down {
    font-size: 9px;
    margin-left: 2px;
    opacity: 0.8;
}

/* Panel Sections & Accordion Card */
.panel-accordion-section {
    margin-bottom: 8px !important;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: transparent !important;
}

.panel-accordion-section .accordion-header {
    padding: 10px 12px;
}

.panel-accordion-section .accordion-header h2 {
    /*ont-size: 13px;
   color: #cbd5e1; */
    font-weight: 500;
    margin: 0;
}

.panel-accordion-section .accordion-content {
    padding: 2px 10px 10px 10px;
}

/* Panel Setting Rows (Dark Rounded Cards) */
.panel-rows-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.panel-setting-row {
    background: #161d2d;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.panel-setting-row:hover {
    background: #1a2236;
    border-color: rgba(255, 255, 255, 0.1);
}

/* Panel Setting Row with Sub-Filter (Trade Boxes Strategy Filter) */
.panel-setting-row.has-filter {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.panel-setting-header-line,
.panel-setting-row.has-filter .panel-setting-header-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.panel-setting-filter-subrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    transition: opacity 0.2s ease, filter 0.2s ease;
    width: 100%;
}

.panel-setting-filter-subrow.disabled {
    opacity: 0.45;
    pointer-events: none;
    filter: grayscale(0.6);
}

.panel-filter-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.74rem;
    color: #94a3b8;
    font-weight: 500;
    letter-spacing: 0.2px;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.panel-filter-label svg {
    color: #38bdf8;
    flex-shrink: 0;
}

.panel-filter-select-wrapper {
    flex: 1;
    max-width: 175px;
    position: relative;
}

.panel-setting-select {
    width: 100%;
    background: #0d1322;
    color: #f1f5f9;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.73rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.panel-setting-select:hover {
    border-color: rgba(56, 189, 248, 0.5);
    background: #111a2e;
}

.panel-setting-select:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.panel-setting-select option {
    background: #0d1322;
    color: #f1f5f9;
    padding: 6px 10px;
}

.panel-setting-label {
    /*font-size: 12.5px;*/
    font-weight: 400;
    color: #929eac;
}

/* iOS-Style Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #334155;
    border-radius: 20px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-switch input:checked+.toggle-slider {
    background-color: #2563eb;
}

.toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(18px);
}

/* Candle Color Swatches */
.color-swatch-picker {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.color-input-hidden {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    display: inline-block;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.color-swatch-picker:hover .color-swatch {
    transform: scale(1.08);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

/* Layout Selector Card Grid */
.layout-selector-card {
    background: #161d2d;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.layout-grid-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.layout-grid-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    /*border: 1px solid rgba(255, 255, 255, 0.08);*/
    border-radius: 4px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.18s ease;
    padding: 0;
    flex-shrink: 0;
}

.layout-grid-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
    color: #e2e8f0;
}

.layout-grid-btn.active {
    background: #2563eb !important;
    border-color: #3b82f6 !important;
    color: #ffffff !important;
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.45);
}

.layout-grid-btn svg {
    pointer-events: none;
    stroke-width: 1;
}

.layout-grid-btn svg rect,
.layout-grid-btn svg line,
.layout-grid-btn svg path,
.layout-grid-btn svg circle,
.layout-grid-btn svg polygon,
.layout-grid-btn svg polyline {
    stroke-width: 1 !important;
}

.indicator-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #181d29;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65);
    z-index: 100;
    overflow: hidden;
    padding: 4px;
}

.ind-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.12s ease;
}

.ind-menu-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.ind-menu-color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ind-menu-text {
    display: flex;
    flex-direction: column;
}

.ind-menu-title {
    font-size: 11px;
    font-weight: 600;
    color: #f1f5f9;
}

.ind-menu-sub {
    font-size: 9.5px;
    color: #94a3b8;
}

/* Section Headers */
.indicator-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 2px;
}

.indicator-section-title {
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #94a3b8;
    text-transform: uppercase;
}

.indicator-count-badge {
    font-size: 9.5px;
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    padding: 1px 6px;
    border-radius: 10px;
    font-family: var(--font-mono, monospace);
}

/* Dynamic Active List Rows */
.indicators-active-list,
.indicators-overlay-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.indicator-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    transition: all 0.15s ease;
}

.indicator-item-row:hover {
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(255, 255, 255, 0.1);
}

.indicator-item-row.is-disabled {
    opacity: 0.45;
}

.ind-info-col {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}

.ind-color-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ind-text-col {
    display: flex;
    align-items: baseline;
    gap: 6px;
    overflow: hidden;
}

.ind-badge-type {
    font-size: 11px;
    font-weight: 600;
    color: #f1f5f9;
}

.ind-params-text {
    font-size: 10px;
    color: #94a3b8;
    font-family: var(--font-mono, monospace);
}

.ind-actions-group {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

.ind-action-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #94a3b8;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.15s ease;
}

.ind-action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f1f5f9;
}

.ind-action-btn.btn-ind-delete:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
}

/* ==========================================================================
   DHAN / TRADINGVIEW STYLE INDICATOR SETTINGS MODAL
   ========================================================================== */
.dhan-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 8, 15, 0.86);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dhan-modal-dialog {
    background: #181d29;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    width: 420px;
    max-width: 92vw;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dhan-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.15);
}

.dhan-modal-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dhan-modal-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    background: rgba(59, 130, 246, 0.18);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dhan-modal-title {
    font-size: 13px;
    font-weight: 600;
    color: #f8fafc;
    margin: 0;
}

.dhan-modal-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    transition: color 0.15s ease;
}

.dhan-modal-close:hover {
    color: #ef4444;
}

.dhan-modal-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0 16px;
    background: rgba(0, 0, 0, 0.08);
}

.dhan-tab-btn {
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.dhan-tab-btn:hover {
    color: #e2e8f0;
}

.dhan-tab-btn.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
    font-weight: 600;
}

.dhan-modal-body {
    padding: 16px 20px;
    max-height: 380px;
    overflow-y: auto;
}

.dhan-tab-pane {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dhan-form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.dhan-form-label {
    font-size: 12px;
    color: #cbd5e1;
    font-weight: 400;
}

.dhan-input,
.dhan-select {
    background: #0f131a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    color: #f1f5f9;
    padding: 6px 10px;
    font-size: 12px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s ease;
}

.dhan-input:focus,
.dhan-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.35);
}

.dhan-number-input {
    width: 80px;
    text-align: right;
    font-family: var(--font-mono, monospace);
}

.dhan-color-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dhan-color-box {
    width: 32px;
    height: 26px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    cursor: pointer;
    overflow: hidden;
    position: relative;
    padding: 0;
    background: transparent;
}

.dhan-color-input {
    width: 150%;
    height: 150%;
    transform: translate(-20%, -20%);
    cursor: pointer;
    border: none;
    background: none;
}

.dhan-thickness-select {
    width: 65px;
    font-size: 11px;
}

.dhan-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.15);
}

.dhan-footer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dhan-btn-secondary,
.dhan-btn-cancel {
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 500;
    cursor: pointer;
    background: #232936;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    transition: all 0.15s ease;
}

.dhan-btn-secondary:hover,
.dhan-btn-cancel:hover {
    background: #2f3747;
    color: #ffffff;
}

.dhan-btn-apply {
    padding: 7px 18px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    background: #2563eb;
    border: 1px solid #1d4ed8;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.4);
    transition: all 0.15s ease;
}

.dhan-btn-apply:hover {
    background: #1d4ed8;
    box-shadow: 0 0 14px rgba(37, 99, 235, 0.6);
}

/* TradingView Style RSI Settings Modal Rows */
.tv-style-group {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding-bottom: 4px;
}

.tv-style-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 28px;
}

.tv-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #cbd5e1;
    cursor: pointer;
    user-select: none;
}

.tv-checkbox-label input[type="checkbox"] {
    accent-color: #2563eb;
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.tv-control-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tv-thickness-select {
    width: 58px;
    padding: 4px 6px;
    font-size: 11px;
}

.tv-style-select {
    width: 82px;
    padding: 4px 6px;
    font-size: 11px;
}

.tv-num-input {
    width: 55px;
    padding: 4px 6px;
    font-size: 11.5px;
    text-align: right;
    font-family: var(--font-mono, monospace);
}

.tv-section-header {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: #64748b;
    margin-top: 8px;
    margin-bottom: 2px;
    text-transform: uppercase;
}

.tv-checker-box {
    background: repeating-conic-gradient(#1e222d 0% 25%, #2a2e39 0% 50%) 50% / 8px 8px;
}

/* ============================================================ */
/* Strategy Controls Tab & New Design (Matches User Mockup)     */
/* ============================================================ */

.strat-controls-drawer {
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    height: 100%;
    box-sizing: border-box;
    overflow-y: auto;
    color: #e2e8f0;
}

/* Active Option Strike Box */
.strat-top-strike-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #0d121f;
    border: 1px solid #1e2638;
    border-radius: 8px;
    padding: 12px 14px;
}

.strat-top-strike-label {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: 0.2px;
}

.strat-select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.strat-strike-select,
.strat-dropdown-select,
.strat-form-select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background: #141a29;
    border: 1px solid #263147;
    border-radius: 6px;
    padding: 8px 30px 8px 12px;
    color: #f1f5f9;
    font-size: 10px;
    font-weight: 300;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.strat-strike-select:hover,
.strat-form-select:hover {
    border-color: #3b82f6;
    background: #182033;
}

.strat-strike-select:focus,
.strat-form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.strat-select-arrow {
    position: absolute;
    right: 10px;
    pointer-events: none;
    color: #94a3b8;
}

.strat-top-strike-hint {
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
}

/* Strategy Section Groups */
.strat-section-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.strat-group-title {
    font-size: 11px;
    font-weight: 400;
    color: #7F899C;
    letter-spacing: 0.3px;
    padding: 0 2px;
}

.strat-card-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.strat-empty-hint {
    padding: 16px;
    text-align: center;
    font-size: 12px;
    color: #64748b;
    background: rgba(15, 23, 42, 0.4);
    border: 1px dashed #1e293b;
    border-radius: 6px;
}

/* Strategy List Item Card */
.strat-item-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #0f1422;
    border: 1px solid #1e2638;
    border-radius: 8px;
    padding: 10px 14px;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.strat-item-card:hover {
    background: #141b2e;
    border-color: #2a364f;
}

.strat-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.strat-item-name {
    font-size: 12px;
    font-weight: 300;
    color: #f8fafc;
    min-width: 90px;
}

.strat-item-badges {
    display: flex;
    align-items: center;
    gap: 6px;
}

.strat-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 7px;
    font-size: 8px;
    font-weight: 300;
    border-radius: 4px;
    user-select: none;
    letter-spacing: 0.2px;
}

/* Live Badge */
.strat-badge.live.active {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.7);
    color: #ef4444;
}

.strat-badge.live.inactive {
    background: rgba(71, 85, 105, 0.2);
    border: 1px solid rgba(71, 85, 105, 0.35);
    color: #64748b;
    opacity: 0.6;
}

/* Paper Badge */
.strat-badge.paper.active {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.7);
    color: #10b981;
}

.strat-badge.paper.inactive {
    background: rgba(71, 85, 105, 0.2);
    border: 1px solid rgba(71, 85, 105, 0.35);
    color: #64748b;
    opacity: 0.6;
}

/* Timeframe Badge */
.strat-badge.timeframe {
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: #94a3b8;
    font-family: var(--font-mono, monospace);
    font-size: 10px;
}

/* Right Action Buttons (Clone, Settings, Delete) */
.strat-item-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.strat-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.strat-action-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.strat-action-btn.delete:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
}

/* ============================================================ */
/* Strategy Modals System (Clone, Delete, Configuration)        */
/* ============================================================ */

.strat-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 8, 15, 0.86);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.strat-modal-dialog {
    background: #0a0e1a;
    border: 1px solid #1f273b;
    border-radius: 12px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: 92vh;
    box-sizing: border-box;
    overflow: hidden;
    color: #f1f5f9;
}

.strat-modal-dialog.strat-modal-xs {
    max-width: 380px;
}

.strat-modal-dialog.strat-modal-sm {
    max-width: 440px;
}

.strat-modal-dialog.strat-modal-lg {
    max-width: 740px;
}

.strat-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #192033;
    background: #0c111e;
}

.strat-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14.5px;
    font-weight: 600;
    color: #f8fafc;
}

.strat-modal-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.strat-modal-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.strat-modal-body {
    padding: 18px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-sizing: border-box;
}

.strat-config-body {
    gap: 16px;
}

.strat-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-top: 1px solid #192033;
    background: #0c111e;
    gap: 12px;
}

.strat-modal-footer-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Modal Buttons */
.strat-btn {
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    user-select: none;
    outline: none;
}

.strat-btn-primary {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.strat-btn-primary:hover {
    background: #1d4ed8;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.5);
}

.strat-btn-secondary {
    background: #1e2638;
    border-color: #2b364e;
    color: #cbd5e1;
}

.strat-btn-secondary:hover {
    background: #28334b;
    color: #ffffff;
}

.strat-btn-danger {
    background: #ef4444;
    color: #ffffff;
}

.strat-btn-danger:hover {
    background: #dc2626;
}

.strat-btn-reset {
    background: #151c2c;
    border: 1px solid #232e45;
    color: #94a3b8;
}

.strat-btn-reset:hover {
    background: #1d263b;
    color: #f1f5f9;
}

.strat-delete-prompt {
    font-size: 13px;
    color: #cbd5e1;
    line-height: 1.5;
    margin: 4px 0;
}

/* App Universal Themed Dialog Overlay & Card */
.app-themed-modal-overlay {
    z-index: 9999999 !important;
    background: rgba(4, 7, 14, 0.85);
}

.app-themed-dialog-card {
    max-width: 440px;
    width: 100%;
    animation: appDialogPopIn 0.16s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes appDialogPopIn {
    0% {
        opacity: 0;
        transform: scale(0.95) translateY(-6px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.app-dialog-icon {
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.app-dialog-message {
    font-size: 13.5px;
    line-height: 1.55;
    color: #cbd5e1;
    word-break: break-word;
}

.app-dialog-paragraph {
    margin-bottom: 10px;
}

.app-dialog-paragraph:last-child {
    margin-bottom: 0;
}

.app-dialog-reason-box {
    margin-top: 8px;
    padding: 10px 12px;
    background: rgba(239, 68, 68, 0.09);
    border: 1px solid rgba(239, 68, 68, 0.28);
    border-radius: 6px;
    color: #fca5a5;
    font-size: 13px;
    line-height: 1.5;
}

.app-dialog-reason-label {
    font-weight: 700;
    color: #f87171;
    margin-right: 4px;
}

.app-themed-dialog-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

/* Form Groups & Inputs */
.strat-form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
}

.strat-form-label {
    font-size: 11px;
    font-weight: 500;
    color: #94a3b8;
    letter-spacing: 0.2px;
}

.strat-form-input {
    background: #141a29;
    border: 1px solid #263147;
    border-radius: 6px;
    padding: 8px 12px;
    color: #f1f5f9;
    font-size: 12.5px;
    font-weight: 500;
    outline: none;
    box-sizing: border-box;
    width: 100%;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.strat-form-input:hover {
    border-color: #3b82f6;
}

.strat-form-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.strat-form-input.readonly {
    background: #0f1422;
    border-color: #1e2638;
    color: #cbd5e1;
    cursor: default;
}

.strat-form-select.compact {
    padding: 6px 24px 6px 8px;
    font-size: 11.5px;
}

/* Status switch group */
.strat-status-group {
    align-items: flex-start;
}

.strat-status-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 35px;
}

.strat-status-text {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    min-width: 52px;
}

.strat-status-text.active {
    color: #10b981;
}

/* Toggle Switch */
.strat-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.strat-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.strat-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #334155;
    transition: 0.2s ease;
    border-radius: 22px;
}

.strat-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: 0.2s ease;
    border-radius: 50%;
}

input:checked+.strat-slider {
    background-color: #2563eb;
}

input:checked+.strat-slider:before {
    transform: translateX(18px);
}

/* Grids in Configuration Modal */
.strat-config-grid-3 {
    display: grid;
    grid-template-columns: 2fr 2fr 1fr;
    gap: 14px;
    align-items: start;
}

.strat-config-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.strat-config-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* 3 Grouped Subcards (Trade Limit, Lunch Halt, Quarantine) */
.strat-config-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.strat-subcard {
    background: #0f1422;
    border: 1px solid #1c2436;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.strat-subcard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    border-bottom: 1px solid #171f2f;
}

.strat-subcard-title {
    font-size: 12px;
    font-weight: 600;
    color: #e2e8f0;
}

.strat-subcard-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.strat-subcard-status-text {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
}

.strat-subcard-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Entry Time Window Row */
.strat-time-window-row {
    background: #0f1422;
    border: 1px solid #1c2436;
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.strat-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.strat-checkbox-label input {
    display: none;
}

.strat-custom-checkbox {
    width: 16px;
    height: 16px;
    border: 1.5px solid #475569;
    border-radius: 3px;
    background: #141a29;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.strat-checkbox-label input:checked+.strat-custom-checkbox {
    background: #2563eb;
    border-color: #2563eb;
}

.strat-checkbox-label input:checked+.strat-custom-checkbox:after {
    content: "✓";
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
}

.strat-checkbox-text {
    font-size: 12px;
    font-weight: 600;
    color: #f1f5f9;
}

.strat-time-window-fields {
    display: flex;
    align-items: center;
    gap: 14px;
    transition: opacity 0.2s ease, filter 0.2s ease;
}

.strat-time-window-fields.disabled {
    opacity: 0.4;
    pointer-events: none;
    filter: grayscale(0.6);
}

.strat-time-field {
    display: flex;
    align-items: center;
    gap: 6px;
}

.strat-time-field-label {
    font-size: 11px;
    font-weight: 500;
    color: #94a3b8;
}

/* Strategy Identity Control (Control 7) */
.strat-identity-card {
    background: #0f1422;
    border: 1px solid #1c2436;
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.strat-identity-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.strat-identity-title {
    font-size: 12.5px;
    font-weight: 600;
    color: #f1f5f9;
}

.strat-identity-sub {
    font-size: 11px;
    color: #64748b;
}

.strat-identity-controls {
    display: grid;
    grid-template-columns: 90px 1fr 1.5fr;
    gap: 14px;
    align-items: center;
}

.strat-identity-letter-input {
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
}

.strat-identity-color-wrap {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.strat-color-picker-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.strat-color-input {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
}

.strat-color-swatches {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.strat-swatch-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    padding: 0;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.strat-swatch-dot:hover {
    transform: scale(1.2);
    border-color: #ffffff;
}

.strat-identity-preview-wrap {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.strat-pill-preview-box {
    display: flex;
    align-items: center;
    height: 36px;
    background: #080c16;
    border: 1px dashed #202b3f;
    border-radius: 6px;
    padding: 0 12px;
    overflow-x: auto;
}

.strat-pill-preview-box .super-badge-entry {
    position: static;
    transform: none;
}

/* Trailing Stop Loss & Profit Lock Card */
.strat-trailing-card {
    background: #0f1422;
    border: 1px solid #1c2436;
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.2s ease;
}

.strat-badge-guard {
    font-size: 10px;
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 600;
}

.strat-trailing-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: opacity 0.2s ease;
}

.strat-trailing-body.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.strat-trail-step-box {
    background: #080c16;
    border: 1px solid #1e293b;
    border-radius: 6px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.strat-trail-step-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.strat-step-pill {
    background: #2563eb;
    color: #ffffff;
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.strat-step-pill.step2 {
    background: #8b5cf6;
}

.strat-step-pill.step3 {
    background: #f59e0b;
}

.strat-step-name {
    font-size: 11.5px;
    font-weight: 600;
    color: #e2e8f0;
}

.strat-decay-badge {
    margin-left: auto;
    font-size: 10px;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 500;
}

.strat-trail-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.strat-trail-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

/* Responsive adjustments */
@media (max-width: 640px) {

    .strat-config-grid-3,
    .strat-config-grid-4,
    .strat-config-cards-grid,
    .strat-identity-controls {
        grid-template-columns: 1fr;
    }
}

/* =============================================================
   MANUAL TRADING & SCALPER MODE STYLES (DHAN SPEC)
   ============================================================= */

/* Manual Mode Card in Strategy Settings Tab */
.strat-manual-mode-card {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    transition: border-color 0.2s ease;
}

.strat-manual-mode-card:hover {
    border-color: #334155;
}

.strat-manual-mode-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.strat-manual-mode-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #f1f5f9;
    letter-spacing: 0.2px;
}

.strat-manual-gear-btn {
    background: transparent;
    border: 1px solid #334155;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
}

.strat-manual-gear-btn:hover {
    background: #1e293b;
    color: #38bdf8;
    border-color: #38bdf8;
    transform: rotate(30deg);
}

/* Scalper Mode Button in Overview Tab */
.active-strat-scalper-bar {
    margin: 8px 0 12px 0;
}

.btn-scalper-mode {
    width: 100%;
    height: 36px;
    background: #1e40af;
    border: 1px solid #3b82f6;
    border-radius: 6px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.3);
}

.btn-scalper-mode:hover {
    background: #2563eb;
    border-color: #60a5fa;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.5);
    transform: translateY(-1px);
}

.btn-scalper-mode:active {
    transform: translateY(0);
}

/* Floating Draggable Scalper Widget */
.floating-scalper-widget {
    position: fixed;
    bottom: 45px;
    left: calc(50% - 160px);
    width: 320px;
    background: #090d16;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85), 0 0 1px rgba(255, 255, 255, 0.3);
    z-index: 99999;
    transition: box-shadow 0.2s ease;
}

.floating-scalper-widget:hover {
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.9), 0 0 1px rgba(255, 255, 255, 0.4);
}

.scalper-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    cursor: move;
    user-select: none;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.scalper-contract-title {
    display: inline-flex;
    align-items: center;
    font-size: 13.5px;
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: 0.4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 265px;
}

.scalper-badge-opt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    padding: 2.5px 7px;
    border-radius: 4px;
    letter-spacing: 0.6px;
    margin-left: 6px;
    vertical-align: middle;
    text-transform: uppercase;
}

.scalper-badge-opt.scalper-badge-call {
    background: rgba(16, 185, 129, 0.22);
    color: #10b981;
    border: 1px solid #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.35);
}

.scalper-badge-opt.scalper-badge-put {
    background: rgba(239, 68, 68, 0.22);
    color: #ef4444;
    border: 1px solid #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.35);
}

.scalper-widget-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.15s;
}

.scalper-widget-close:hover {
    color: #ef4444;
}

.scalper-widget-body {
    display: flex;
    gap: 12px;
}

.btn-scalper-action {
    flex: 1;
    height: 42px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.btn-scalper-buy {
    background: #2563eb;
    color: #ffffff;
}

.btn-scalper-buy:hover {
    background: #1d4ed8;
    transform: translateY(-1.5px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.45);
}

.btn-scalper-buy:active {
    transform: translateY(0);
}

.btn-scalper-exit {
    background: #ef4444;
    color: #ffffff;
}

.btn-scalper-exit:hover {
    background: #dc2626;
    transform: translateY(-1.5px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.45);
}

.btn-scalper-exit:active {
    transform: translateY(0);
}

/* Chart Price Scale Circular Plus Button (Compact Dhan-style) */
.chart-price-plus-btn {
    position: fixed;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: #1e293b;
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    z-index: 10000;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    /* Strictly transition colors & scale only — NO transition on top/left to eliminate cursor lag */
    transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease, transform 0.1s ease;
    will-change: top, left;
}

.chart-price-plus-btn:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #60a5fa;
    transform: scale(1.12);
    box-shadow: 0 0 8px rgba(37, 99, 235, 0.7);
}

/* Chart Price Scale Order Menu (Strictly 2 Buy orders) */
.chart-price-order-menu {
    position: fixed;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 4px 0;
    min-width: 290px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.85), 0 0 1px rgba(255, 255, 255, 0.2);
    z-index: 10001;
    overflow: hidden;
    animation: fadeInMenu 0.12s ease-out;
}

@keyframes fadeInMenu {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.price-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #e2e8f0;
    transition: background 0.12s, color 0.12s;
    user-select: none;
}

.price-menu-item:hover {
    background: #1e293b;
    color: #38bdf8;
}

.price-menu-item .menu-item-icon {
    flex-shrink: 0;
    color: #94a3b8;
    transition: color 0.12s;
}

.price-menu-item:hover .menu-item-icon {
    color: #38bdf8;
}

.menu-item-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
