html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background-color: #121212;
  color: #e0e0e0;
  overflow-x: hidden;
}

/* Main Layout */
#main-content {
    transition: margin-left 0.3s ease;
}

/* Sidebar Styling */
.sidebar {
    width: 280px; /* Default expanded width */
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    scrollbar-width: none;
    -ms-overflow-style: none;
    transition: width 0.3s ease;
}
.sidebar::-webkit-scrollbar {
    width: 0;
    height: 0;
}

/* Collapsed State */
.sidebar.collapsed {
    width: 80px;
}

body.sidebar-collapsed #main-content {
    margin-left: 80px;
}

/* Mobile Offcanvas Overrides */
@media (max-width: 767.98px) {
    .sidebar {
        position: fixed;
        height: 100%;
        z-index: 1045;
        width: 280px;
        margin-left: -280px;
        transition: margin-left 0.3s ease;
    }
    .sidebar.show {
        margin-left: 0;
    }
    #main-content {
        margin-left: 0 !important;
    }
    .sidebar.collapsed {
        margin-left: -280px;
    }
    body.sidebar-collapsed #main-content {
        margin-left: 0 !important;
    }
}

.sidebar-heading {
  color: #888;
  font-size: 0.9rem;
  text-transform: uppercase;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  padding-left: 15px;
}
 .sidebar-logo-svg {
    filter: drop-shadow(0 0 5px rgba(0, 191, 165, 0.4));
    transition: transform 0.3s ease;
  }

  .logo-wrapper:hover .sidebar-logo-svg {
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px rgba(0, 191, 165, 0.7));
  }

  .algo-line {
    animation: dashScroll 2s linear infinite;
  }

  @keyframes dashScroll {
    from { stroke-dashoffset: 20; }
    to { stroke-dashoffset: 0; }
  }

  /* Styling for Nav Pills */
  .sidebar .nav-link {
    color: #8b949e;
    font-size: 0.9rem;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
  }

  .sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
  }

  .sidebar .nav-link.active {
    background: rgba(0, 191, 165, 0.15) !important;
    color: #00bfa5 !important;
    font-weight: 600;
  }

/* Collapsed Sidebar Content */
.sidebar.collapsed .sidebar-brand-text,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .punchline,
.sidebar.collapsed .small,
.sidebar.collapsed hr,
.sidebar.collapsed .d-flex.align-items-center.text-white.mb-2.px-3 > span {
    display: none;
    opacity: 0;
}
.sidebar.collapsed .nav-link {
    text-align: center;
    justify-content: center;
}
.sidebar.collapsed .nav-link i {
    margin-right: 0 !important;
    font-size: 1.2rem;
}
.sidebar.collapsed .logo-wrapper {
    margin-right: 0 !important;
}
.sidebar.collapsed .d-flex.align-items-center.text-white.mb-2.px-3 {
    justify-content: center;
}
.sidebar.collapsed .fa-sign-out-alt {
    margin-right: 0 !important;
}

/* Toggle Button */
#sidebar-toggle {
    background-color: transparent;
    border: none;
    color: #8b949e;
    transition: color 0.3s ease, transform 0.3s ease;
}
#sidebar-toggle:hover {
    color: #00bfa5;
}
#sidebar-toggle i {
    transition: transform 0.3s ease;
}
#sidebar-toggle i.rotated {
    transform: rotate(-90deg);
}

/* Other styles from original file */
.bullish { background: green; color: white; }
.bearish { background: red; color: white; }
.neutral { background: grey; color: white; }

.overlay {
  position: fixed;
  width: 100%;
  height: 100%;
  z-index: 1000;
  top: 40%;
  left: 0;
  opacity: 0.5;
}

.btn-teal {
    background-color: #00bfa5;
    border: none;
    color: white;
    font-weight: 600;
}
.btn-teal:hover {
    background-color: #009688;
    color: white;
}

.ui-datepicker {
  background: #1e1e1e !important;
  border: 1px solid #333 !important;
  color: #e0e0e0 !important;
  padding: 0.5rem;
}
.ui-datepicker-header {
  background: #2c2c2c !important;
  border-bottom: 1px solid #444 !important;
  color: #e0e0e0 !important;
}
.ui-datepicker td a {
  background: #1e1e1e !important;
  color: #e0e0e0 !important;
  border: none !important;
  padding: 0.4rem;
}
.ui-datepicker td a:hover {
  background: #00b894 !important;
  color: #fff !important;
}
.ui-datepicker .ui-state-active {
  background: #00b894 !important;
  color: #fff !important;
}

.card {
    border: 1px solid #333;
    border-radius: 12px;
}

#scrollToTopBtn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 30px;
    z-index: 9999;
    border: none;
    outline: none;
    background-color: #00bfa5;
    color: white;
    cursor: pointer;
    padding: 15px;
    border-radius: 50%;
    font-size: 18px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s, transform 0.3s;
}
#scrollToTopBtn:hover {
    background-color: #009688;
    transform: scale(1.1);
}
@media (max-width: 767.98px) {
    #scrollToTopBtn {
        bottom: 15px;
        right: 15px;
        padding: 10px;
        font-size: 14px;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

.punchline {
    color: #8b949e;
    font-size: 11px;
    letter-spacing: 3px;
    font-weight: 500;
    text-transform: uppercase;
    margin-top: -10px;
    margin-bottom: 25px;
    opacity: 0.8;
}

.btn-warm {
  background-color: #e67e22;
  color: #fff;
  border: none;
}
.btn-warm:hover {
  background-color: #d35400;
  color: #fff;
}

.bg-warm {
  background-color: #f39c12;
  color: #fff;
}

.badge.rounded-pill {
  font-size: 0.9rem;
  font-weight: 500;
}

section {
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.sub-card {
    background: #161b22 !important;
    border: 1px solid #30363d !important;
    border-radius: 8px !important;
    overflow: hidden;
}

.sub-header {
    background: rgba(255, 255, 255, 0.03) !important;
    border-bottom: 1px solid #30363d !important;
    padding: 0.5rem 1rem !important;
    transition: background 0.3s ease;
}

.sub-header:hover {
    background: rgba(0, 191, 165, 0.05) !important;
}

.sub-header button {
    font-weight: 600 !important;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: #f0f6fc !important;
    text-decoration: none !important;
    width: 100%;
    text-align: left;
}

.border-accent-teal { border-left: 4px solid #00bfa5 !important; }
.border-accent-blue { border-left: 4px solid #58a6ff !important; }
.border-accent-purple { border-left: 4px solid #bc8cff !important; }
.border-accent-orange { border-left: 4px solid #ffa657 !important; }

.badge-sub {
    background: rgba(48, 54, 61, 0.5) !important;
    border: 1px solid #444c56 !important;
    color: #c9d1d9 !important;
    font-weight: 500;
}

.btn-teal-outline {
    color: #00bfa5;
    border: 1px solid rgba(0, 191, 165, 0.5);
    background: transparent;
    transition: all 0.3s ease;
}

.btn-teal-outline:hover {
    background: rgba(0, 191, 165, 0.1);
    color: #00f0d1;
    box-shadow: 0 0 10px rgba(0, 191, 165, 0.2);
}

.brand-footer {
    font-size: 10px;
    letter-spacing: 2px;
    color: #444c56;
    text-transform: uppercase;
    margin-top: 15px;
    margin-bottom: 0;
}

.btn-sync-header {
    background-color: transparent;
    color: #00bfa5;
    border: 1px solid #00bfa5;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.btn-sync-header:hover {
    background-color: rgba(0, 191, 165, 0.1);
    color: #00f0d1;
    box-shadow: 0 0 10px rgba(0, 191, 165, 0.2);
}

.fas, .fa {
    display: inline-block;
    opacity: 1 !important;
    visibility: visible !important;
}

.text-teal {
    color: #00bfa5 !important;
    text-shadow: 0 0 5px rgba(0, 191, 165, 0.3);
}

.console-input:focus {
    background-color: #0d1117 !important;
    border-color: #00bfa5 !important;
    box-shadow: 0 0 0 3px rgba(0, 191, 165, 0.15) !important;
    outline: none;
}

.console-input::placeholder {
    color: #484f58;
}

.console-input {
    background-color: #0d1117 !important;
    border: 1px solid #444c56 !important;
    color: #f0f6fc !important;
    border-radius: 6px;
    padding: 10px 12px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.95rem;
}

.console-tab {
    color: #8b949e !important;
    background: transparent !important;
    border: none !important;
    border-bottom: 2px solid transparent !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    padding: 10px 25px !important;
    transition: all 0.3s ease;
}

.console-tab:hover {
    color: #f0f6fc !important;
}

.console-tab.active {
    color: #00bfa5 !important;
    border-bottom: 2px solid #00bfa5 !important;
}

.tab-pane {
    transition: opacity 0.15s linear;
}

.table-dark-console {
    width: 100%;
    border-collapse: separate !important;
    border-spacing: 0 12px !important;
    background-color: transparent !important;
    table-layout: fixed;
}

.table-dark-console thead th {
    color: #8b949e !important;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    border: none !important;
    padding: 10px 15px;
}

.table-dark-console tbody tr {
    background-color: #161b22 !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
}

.table-dark-console tbody tr:hover {
    background-color: #1c2128 !important;
    transform: scale(1.005);
}

.table-dark-console td {
    color: #f0f6fc !important;
    padding: 16px 15px !important;
    border-top: 1px solid #30363d !important;
    border-bottom: 1px solid #30363d !important;
    background-clip: padding-box;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-dark-console td:first-child {
    border-left: 1px solid #30363d !important;
    border-top-left-radius: 10px !important;
    border-bottom-left-radius: 10px !important;
}

.table-dark-console td:last-child {
    border-right: 1px solid #30363d !important;
    border-top-right-radius: 10px !important;
    border-bottom-right-radius: 10px !important;
}

#livePositionsTable, #tradeLogsTable {
    background-color: transparent !important;
    color: #f0f6fc !important;
}

#livePositionsTable tr, #tradeLogsTable tr {
    background-color: #161b22 !important;
    color: #f0f6fc !important;
}

#livePositionsTable td, #tradeLogsTable td {
    background-color: #161b22 !important;
    color: #f0f6fc !important;
    border-color: #30363d !important;
}

#livePositionsTable td.text-success, #tradeLogsTable td.text-success {
    color: #28a745 !important;
}

#livePositionsTable td.text-danger, #tradeLogsTable td.text-danger {
    color: #dc3545 !important;
}

.table-hover > tbody > tr:hover > * {
    color: #fff !important;
    background-color: #1c2128 !important;
}

#livePositionsTable th:nth-child(1) { width: 20%; }
#livePositionsTable th:nth-child(2) { width: 20%; }
#livePositionsTable th:nth-child(3) { width: 10%; }
#livePositionsTable th:nth-child(4) { width: 10%; }
#livePositionsTable th:nth-child(5) { width: 15%; }
#livePositionsTable th:nth-child(6) { width: 15%; }
#livePositionsTable th:nth-child(7) { width: 10%; }

#tradeLogsTable th:nth-child(1) { width: 15%; }
#tradeLogsTable th:nth-child(2) { width: 15%; }
#tradeLogsTable th:nth-child(3) { width: 20%; }
#tradeLogsTable th:nth-child(4) { width: 10%; }
#tradeLogsTable th:nth-child(5) { width: 10%; }
#tradeLogsTable th:nth-child(6) { width: 15%; }
#tradeLogsTable th:nth-child(7) { width: 15%; }

.table-responsive::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}
.table-responsive::-webkit-scrollbar-track {
    background: #0d1117;
}
.table-responsive::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 3px;
}
.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #00bfa5;
}

.text-orange { color: #ff8c00 !important; }
.border-accent-orange { border: 1px solid #ff8c0055 !important; border-left: 4px solid #ff8c00 !important; }
.btn-outline-orange {
    color: #ff8c00;
    border-color: #ff8c00;
    transition: 0.3s;
}
.btn-outline-orange:hover {
    background-color: #ff8c00;
    color: #161b22;
}
.btn-orange {
    background-color: #ff8c00;
    color: #161b22;
    font-weight: bold;
}

#dataLoaderLog {
    background-color: #0d1117;
    max-height: 150px;
    overflow-y: auto;
}

.accordion-button::after {
    filter: invert(1);
}

.accordion-button:not(.collapsed) {
    background-color: #1c2128 !important;
    color: #00bfa5 !important;
    box-shadow: none !important;
}

.bg-black-2 { background-color: #0d1117; }

#chartContainer {
    height: 100%;
    display: flex;
    flex-direction: column;
}

#chartContainer > div {
    flex-grow: 1;
}

.btn-outline-teal {
    color: #00bfa5 !important;
    border-color: #00bfa5 !important;
}

.btn-outline-teal:hover {
    color: #fff !important;
    background-color: #00bfa5 !important;
    border-color: #00bfa5 !important;
}

#brokerTabs .nav-link {
    color: #8b949e;
    background-color: transparent;
    border: none;
    transition: all 0.3s ease;
}

#brokerTabs .nav-link:hover {
    color: #fff;
}

#brokerTabs .nav-link.active {
    color: #000;
    background-color: #00bfa5;
    font-weight: bold;
}

.card.broker-card {
    box-shadow: 0 0 15px rgba(0, 191, 165, 0.1);
}

.signal-table-console {
    font-family: 'Monaco', 'Consolas', monospace;
}

.signal-row-buy {
    background-color: rgba(38, 166, 154, 0.1) !important;
    border-left: 3px solid #26a69a;
}

.signal-row-sell {
    background-color: rgba(239, 83, 80, 0.1) !important;
    border-left: 3px solid #ef5350;
}

.signal-row-exit {
    background-color: rgba(255, 152, 0, 0.1) !important;
    border-left: 3px solid #ff9800;
}
