/* styles.css */

/* --- GENEL ORTAK AYARLAR --- */
:root {
  --finapsis-bg: #000000;
  --finapsis-card: rgba(255, 255, 255, 0.03);
  --finapsis-neon: #c2f50e;
  --finapsis-red: #ff4d4d;
  --text-main: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.5);
  --border: rgba(255, 255, 255, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: #000;
  color: var(--text-main);
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* --- GLOBAL NAV BAR --- */
.global-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  column-gap: 14px;
  padding: 0 16px;
  height: 56px;
  background: linear-gradient(180deg, #0a0a0a 0%, #040404 100%);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
}

.global-nav-left,
.global-nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  align-self: center;
}

/* --- APP SHELL / SIDEBAR --- */
.app-shell {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.side-nav {
  width: 240px;
  flex: 0 0 240px;
  padding: 14px 12px;
  background: linear-gradient(180deg, rgba(10, 10, 10, 0.9), rgba(4, 4, 4, 0.98));
  border-right: 1px solid var(--border);
  overflow-y: auto;
  scrollbar-width: none;
}

.side-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 6px 12px 6px;
}

.side-brand-img {
  width: 60%;
  height: auto;
  display: block;
  filter: drop-shadow(0 0 10px rgba(194, 245, 14, 0.2));
}

.side-nav::-webkit-scrollbar {
  display: none;
}

.side-title {
  display: none;
}

.menu-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  margin: 2px 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.menu-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.menu-icon {
  width: 18px;
  text-align: center;
  color: rgba(255, 255, 255, 0.65);
}

.menu-btn.active .menu-icon {
  color: var(--finapsis-neon);
}

.menu-chevron {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  transition: transform 0.2s ease, color 0.2s ease;
}

.menu-btn.is-open .menu-chevron {
  transform: rotate(180deg);
  color: var(--finapsis-neon);
}

.menu-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.menu-btn.active {
  background: rgba(194, 245, 14, 0.08);
  border-color: rgba(194, 245, 14, 0.25);
  color: var(--finapsis-neon);
}

.submenu {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin: 0 4px;
  padding: 0 10px;
  border-radius: 10px;
  background: transparent;
  border: 0;
  transition: max-height 0.25s ease, opacity 0.2s ease, padding 0.2s ease, margin 0.2s ease, border-color 0.2s ease;
}

.submenu.is-open {
  max-height: 520px;
  opacity: 1;
  margin: 8px 4px 14px 4px;
  padding: 10px;
  border-color: transparent;
  overflow-y: auto;
}

.submenu-title {
  display: none;
}

.submenu-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.submenu-btn {
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  min-height: 36px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  padding-left: 20px;
}

.submenu-markets .submenu-btn {
  text-transform: uppercase;
  text-align: left;
  padding-left: 20px;
}

.submenu-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.submenu-btn.active {
  background: var(--finapsis-neon);
  color: #000;
  border-color: rgba(194, 245, 14, 0.4);
}

.submenu-btn.active::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 2px;
  background: #000;
  opacity: 0.6;
}

.side-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 10px 6px;
}

.app-main {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
}

.brand-img {
  height: 30px;
  width: auto;
  display: block;
  filter: drop-shadow(0 0 10px rgba(194, 245, 14, 0.2));
}

.global-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ddd;
  font-size: 12px;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.global-nav-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.global-nav-btn.icon-only {
  padding: 8px 10px;
}

/* --- ANA TAB NAVİGASYONU (Screener vs List) --- */
.app-tabs {
  display: flex;
  gap: 2px;
  background: transparent;
  border-bottom: none;
  padding: 0 6px;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  align-items: flex-end;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  align-self: stretch;
}

.app-tabs::-webkit-scrollbar {
  display: none;
}

nav.app-tabs .tab-btn {
  height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  border-bottom: 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 10px 10px 0 0;
  transition: all 0.2s;
  letter-spacing: 0.5px;
  flex: 0 0 auto;
  margin-bottom: -1px;
}

nav.app-tabs .tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

nav.app-tabs .tab-btn.active {
  background: rgba(194, 245, 14, 0.05);
  color: var(--finapsis-neon);
  border-color: rgba(194, 245, 14, 0.2);
  border-bottom: 1px solid #000;
  margin-bottom: -1px;
  z-index: 10;
}

/* --- ALT TAB NAVİGASYONU (BIST vs SP) --- */
.sub-tabs-container {
  display: flex;
  justify-content: center;
  background: #000;
  padding: 10px 0;
  flex-shrink: 0;
}

.sub-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 3px;
  gap: 2px;
}

.sub-tab-btn {
  padding: 4px 24px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.sub-tab-btn:hover {
  color: #fff;
}

.sub-tab-btn.active {
  background: var(--finapsis-neon);
  color: #000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Görünüm Konteynerleri */
.view-section {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: none;
  padding: 20px;
  box-sizing: border-box;
}

.view-section.active {
  display: flex;
  flex-direction: column;
}

/* =========================================
       SCREENER CSS
       ========================================= */
#view-screener {
  padding: 20px 20px 20px 20px;
  background: linear-gradient(to bottom, #050505, #000000);
}

#view-screener .finapsis-master {
  width: 100%;
  max-width: none;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 0;
}

#view-screener .header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

#view-screener .header-title h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  color: #e5e5e5;
}

#view-screener .header-title span {
  color: var(--finapsis-neon);
}

#view-screener .header-subtitle {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#view-screener .controls-wrapper {
  display: flex;
  gap: 12px;
  align-items: center;
}

#view-screener .control-pill {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  user-select: none;
}

#view-screener .control-pill:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

#view-screener .control-pill.active {
  border-color: var(--finapsis-neon);
  color: var(--finapsis-neon);
  background: rgba(194, 245, 14, 0.04);
}

#view-screener .divider-v {
  width: 1px;
  height: 16px;
  background: var(--border);
}

#view-screener .main-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  flex: 1;
  overflow: hidden;
}

#view-screener .glass-panel {
  background: var(--finapsis-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#view-screener .panel-header {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.01);
}

#view-screener .search-box {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
}

#view-screener .search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 11px;
  width: 100%;
  font-family: 'Inter';
  font-weight: 500;
  text-transform: uppercase;
}

#view-screener .metric-list {
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#view-screener .metric-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: grab;
  transition: border-color 0.1s;
  user-select: none;
}

#view-screener .metric-item:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
}

#view-screener .metric-item:active {
  cursor: grabbing;
}

#view-screener .metric-icon {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

#view-screener .content-area {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

#view-screener .drop-zone-container {
  background: var(--finapsis-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

#view-screener .drop-zone-target {
  flex: 1;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.1);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  align-content: flex-start;
  padding: 10px;
  gap: 8px;
  overflow-y: auto;
}

#view-screener .drop-zone-target.drag-over {
  border-color: var(--finapsis-neon);
  background: rgba(194, 245, 14, 0.02);
}

#view-screener .active-metric-tag {
  background: rgba(194, 245, 14, 0.08);
  border: 1px solid rgba(194, 245, 14, 0.2);
  color: var(--finapsis-neon);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fadeIn 0.3s ease;
}

#view-screener .remove-btn {
  cursor: pointer;
  opacity: 0.5;
}

#view-screener .remove-btn:hover {
  opacity: 1;
  color: #fff;
}

#view-screener .table-panel {
  background: var(--finapsis-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#view-screener .table-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

#view-screener table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Inter';
  table-layout: fixed;
}

#view-screener th {
  background: rgba(15, 15, 15, 0.95);
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 12px 14px;
  text-align: left;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

#view-screener td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #d4d4d4;
  font-size: 12px;
  font-weight: 500;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
}

#view-screener th:nth-child(1) {
  width: 50px;
  text-align: center;
}

#view-screener th:nth-child(2) {
  width: 220px;
}

#view-screener th:nth-child(3) {
  width: 130px;
}

#view-screener th:nth-child(4) {
  width: 150px;
}

#view-screener th:nth-child(5) {
  width: 70px;
  text-align: center;
}

#view-screener th:nth-child(6) {
  width: auto;
}

#view-screener .result-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 75px;
  padding: 4px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.01);
  margin-bottom: 4px;
}

#view-screener .result-box.good {
  border-color: rgba(194, 245, 14, 0.15);
  background: rgba(194, 245, 14, 0.03);
  color: var(--finapsis-neon);
}

#view-screener .result-box.bad {
  border-color: rgba(255, 77, 77, 0.15);
  background: rgba(255, 77, 77, 0.03);
  color: var(--finapsis-red);
}

#view-screener .res-label {
  font-size: 8px;
  opacity: 0.7;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  width: 100%;
  text-align: center;
}

#view-screener .res-val {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

#view-screener .res-avg {
  font-size: 8px;
  opacity: 0.5;
  margin-top: 1px;
}

#view-screener .score-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  margin: 0 auto;
}

#view-screener .score-badge.active {
  background: var(--finapsis-neon);
  color: #000;
}

#view-screener .score-badge.inactive {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.3);
}

/* =========================================
       COMPANIES LIST CSS
       ========================================= */
#view-companies {
  padding: 20px 20px 20px 20px;
  flex: 1;
  min-height: 0;
  gap: 20px;
}

#view-companies.active {
  display: flex;
  flex-direction: column;
}


#view-companies .table-wrapper {
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  background: #0b0b0b;
  position: relative;
}

#view-companies table {
  width: 100%;
  min-width: 2200px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

#view-companies thead th {
  font-size: 11px;
  text-transform: uppercase;
  text-align: right;
  padding: 0 10px;
  height: 50px;
  background: #111;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, .6);
  position: sticky;
  top: 0;
  z-index: 100;
  cursor: pointer;
}

#view-companies th:nth-child(1) {
  position: sticky;
  left: 0;
  z-index: 150;
  background: #111;
  text-align: left !important;
  width: 300px;
}

#view-companies td:nth-child(1) {
  position: sticky;
  left: 0;
  z-index: 110;
  background: #0b0b0b;
  text-align: left !important;
  width: 300px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

#view-companies th,
#view-companies td {
  width: 150px;
}

#view-companies thead th.active-sort {
  background: #1a2205 !important;
  color: #c2f50e !important;
  border-bottom: 2px solid #c2f50e !important;
}

#view-companies thead th.active-sort::after {
  content: attr(data-icon);
  margin-left: 6px;
  font-weight: 900;
}

#view-companies tbody tr {
  height: 56px;
}

#view-companies tbody tr:hover td {
  background: #161616 !important;
}

#view-companies tbody td {
  padding: 0 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
  font-size: 13px;
  text-align: right;
  color: #eee;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#view-companies .cl-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  background: #111;
  border-radius: 6px;
  flex-shrink: 0;
}

#view-companies .cl-name-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  overflow: hidden;
}

#view-companies .cl-name {
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}

#view-companies .cl-sub {
  font-size: 11px;
  color: #666;
}

#view-companies .cl-group {
  color: #c2f50e;
  font-weight: 700;
  margin-left: 4px;
}

#view-companies .val-up {
  color: #00ff88
}

#view-companies .val-down {
  color: #ff4444
}

/* --- COMPANIES LIGHT THEME (preview) --- */
#view-companies.theme-light {
  background: #f3f4f6;
}

#view-companies.theme-light .top-controls {
  background: #f3f4f6;
}

#view-companies.theme-light .table-wrapper {
  background: #ffffff;
  border-color: #e5e7eb;
}

#view-companies.theme-light thead th {
  background: #e9ecef;
  color: #4b5563;
  border-bottom: 1px solid #e5e7eb;
}

#view-companies.theme-light th:nth-child(1) {
  background: #e9ecef;
}

#view-companies.theme-light td:nth-child(1) {
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
}

#view-companies.theme-light tbody td {
  color: #111827;
  border-bottom: 1px solid #eef0f2;
}

#view-companies.theme-light tbody tr:hover td {
  background: #f7f7f9 !important;
}

#view-companies.theme-light thead th.active-sort {
  background: #c2f50e !important;
  color: #0b0b0b !important;
  border-bottom: 2px solid #c2f50e !important;
}

#view-companies.theme-light .cl-search-input {
  background: #ffffff;
  border: 1px solid #d7dbe0;
  color: #111827;
}

#view-companies.theme-light .cl-search-input:focus {
  border-color: #98b800;
  background: #ffffff;
}

#view-companies.theme-light .cl-search-icon {
  color: #9aa1a9;
}


#view-companies.theme-light .cl-badge {
  background: #f7f7f9;
  border-color: #e2e6ea;
  color: #2b2f36;
}

#view-companies.theme-light .cl-badge:hover {
  background: #ffffff;
  border-color: #cdd3da;
  color: #111827;
}

#view-companies.theme-light .cl-badge.active,
#view-companies.theme-light .cl-badge.market-badge {
  background: #c2f50e;
  border-color: #c2f50e;
  color: #0b0b0b;
}

#view-companies.theme-light .cl-badge.active:hover,
#view-companies.theme-light .cl-badge.market-badge:hover {
  background: #d5ff2f;
}

#view-companies.theme-light .cl-popup-menu {
  background: #ffffff;
  border-color: #e5e7eb;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
}

#view-companies.theme-light .sc-sector-title,
#view-companies.theme-light .sc-sector-clear {
  color: #111827;
}

#view-companies.theme-light .cl-popup-search {
  border-bottom: 1px solid #e5e7eb;
}

#view-companies.theme-light .cl-popup-input {
  background: #f5f6f8;
  border: 1px solid #d7dbe0;
  color: #111827;
}

#view-companies.theme-light .cl-popup-item {
  color: #1f2937;
}

#view-companies.theme-light .cl-popup-item:hover {
  background: #f3f4f6;
}

#view-companies.theme-light .val-up {
  color: #22bb33;
}

#view-companies.theme-light .val-down {
  color: #e23d3d;
}

#view-companies.theme-light .cl-popup-item.selected {
  background: #c2f50e;
  color: #0b0b0b;
  border-color: #c2f50e;
}

#view-companies.theme-light .cl-logo {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
}

#view-companies.theme-light .cl-name {
  color: #0b0b0b;
}

#view-companies.theme-light .cl-sub {
  color: #6b7280;
}

#view-companies.theme-light #cl-count {
  color: #6b7280 !important;
}

#view-companies.theme-light .cl-group {
  color: #0b0b0b;
  background: #c2f50e;
  border-radius: 6px;
  padding: 2px 6px;
}

#view-companies.theme-light .fp-menu-btn {
  background: #ffffff;
  border-color: #d7dbe0;
  color: #111827;
}

#view-companies.theme-light .fp-menu-btn:hover {
  background: #f3f4f6;
}

#view-companies.theme-light #fpRowMenu {
  background: #ffffff;
  border-color: #e5e7eb;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.18);
}

#view-companies.theme-light .fpMenuHead {
  border-bottom: 1px solid #e5e7eb;
}

#view-companies.theme-light .fpMenuTitle {
  color: #6b7280;
}

#view-companies.theme-light .fpMenuTicker {
  color: #0b0b0b;
  background: #c2f50e;
  padding: 2px 6px;
  border-radius: 6px;
}

#view-companies.theme-light .fpMenuItem {
  color: #111827;
  border-bottom: 1px solid #eef0f2;
}

#view-companies.theme-light .fpMenuItem:hover {
  background: #f3f4f6;
}

#view-companies.theme-light .fpMenuIcon {
  opacity: 0.7;
}

#view-companies.theme-light .fpMenuClose {
  background: #f3f4f6;
  border-color: #e5e7eb;
  color: #111827;
}

#view-companies.theme-light .fpMenuClose:hover {
  background: #e9ecef;
}

/* --- GLOBAL LIGHT (Companies only) --- */
body.companies-light .global-nav {
  background: linear-gradient(180deg, #f7f8fa 0%, #eef1f4 100%);
  border-bottom: 1px solid #e5e7eb;
}

body.companies-light .global-nav-btn {
  background: #ffffff;
  border-color: #d7dbe0;
  color: #111827;
}

body.companies-light .global-nav-btn:hover {
  border-color: #c2f50e;
  color: #0b0b0b;
}

body.companies-light .brand-img {
  filter: none;
}

body.companies-light nav.app-tabs .tab-btn {
  background: #ffffff;
  color: #4b5563;
  border-color: #e5e7eb;
}

body.companies-light nav.app-tabs .tab-btn:hover {
  color: #111827;
}

body.companies-light nav.app-tabs .tab-btn.active {
  background: #c2f50e;
  color: #0b0b0b;
  border-color: #c2f50e;
}

body.companies-light #fpRowMenu {
  background: #ffffff;
  border-color: #e5e7eb;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.18);
}

body.companies-light .fpMenuHead {
  border-bottom: 1px solid #e5e7eb;
}

body.companies-light .fpMenuTitle {
  color: #6b7280;
}

body.companies-light .fpMenuItem {
  color: #111827;
  border-bottom: 1px solid #eef0f2;
}

body.companies-light .fpMenuItem:hover {
  background: #f3f4f6;
}

body.companies-light .fpMenuClose {
  background: #f3f4f6;
  border-color: #e5e7eb;
  color: #111827;
}

#view-companies.theme-light .cl-badge-area {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  min-height: 40px;
}

#filterOverlay {
  display: none;
  position: absolute;
  top: 180px;
  right: 35px;
  z-index: 10000;
}

.filter-card {
  background: #0f0f0f;
  border: 1px solid #222;
  width: 440px;
  padding: 24px;
  border-radius: 20px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.7);
}

.f-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 15px;
}

.f-row label {
  display: block;
  font-size: 11px;
  color: #555;
  margin-bottom: 8px;
  text-transform: uppercase;
  font-weight: 700;
}

.f-row input,
.f-row select {
  width: 100%;
  background: #161616;
  border: 1px solid #222;
  color: #fff;
  padding: 10px;
  border-radius: 10px;
  outline: none;
  box-sizing: border-box;
}

.pct-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.pct-input-wrapper::after {
  content: "%";
  position: absolute;
  right: 12px;
  color: #c2f50e;
  font-size: 11px;
  font-weight: bold;
}

#preloader {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(194, 245, 14, .1);
  border-top: 3px solid #c2f50e;
  border-radius: 50%;
  animation: spin 1s linear infinite
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(3px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* MOBİL DÜZENLEMELER */
@media screen and (max-width: 768px) {
  #view-companies .table-wrapper {
    height: auto;
    overflow: visible;
  }

  #view-companies table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: auto !important;
    display: block !important;
  }

  #view-companies thead {
    display: none !important;
  }

  #view-companies tbody,
  #view-companies tr {
    display: block !important;
    width: 100% !important;
  }

  #view-companies tbody tr {
    margin-bottom: 20px;
    background: #0f0f0f;
    border-radius: 16px;
    border: 1px solid #222;
    padding: 15px;
    height: auto !important;
    box-sizing: border-box;
  }

  #view-companies tbody td {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    width: 100% !important;
    padding: 12px 0 !important;
    position: static !important;
    background: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    height: auto !important;
    white-space: normal !important;
  }

  #view-companies tbody td:first-child {
    border-bottom: 2px solid #c2f50e !important;
    margin-bottom: 10px;
    padding-bottom: 15px !important;
    justify-content: flex-start !important;
  }

  #view-companies tbody td:not(:first-child)::before {
    content: attr(data-label);
    font-weight: 600;
    color: #555;
    font-size: 11px;
    text-transform: uppercase;
    margin-right: 10px;
  }

  #filterOverlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 99999 !important;
    background: #000 !important;
  }

  .filter-card {
    width: 100% !important;
    height: 100% !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    padding: 20px !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
    border: none !important;
  }

  .f-grid {
    grid-template-columns: 1fr !important;
    gap: 15px !important;
  }

  .f-row input {
    height: 45px !important;
    font-size: 16px !important;
  }
}


/* =========================================
       PORTFOLYO (İZOLE)
       ========================================= */
/* TEMEL CSS */
#view-portfolio {
  --primary: #c2f50e;
  --bg: #000000;
  --panel-bg: #0d0d0d;
  --item-bg: #161616;
  --border: #2a2a2a;
  --text-main: #ffffff;
  --text-muted: #888888;
  --danger: #ff4d4d;
  --success: #00e676;
}

#view-portfolio * {
  box-sizing: border-box;
}

#view-portfolio {
  margin: 0;
  background: var(--bg);
  color: var(--text-main);
  font-family: 'Inter', sans-serif;
  height: 100%;
  width: 100%;
  overflow: hidden;
  padding: 0px;
}

#view-portfolio #app {
  display: flex;
  height: 100%;
  width: 100%;
}

#view-portfolio .left-panel {
  width: 380px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: var(--panel-bg);
  flex-shrink: 0;
}

#view-portfolio .right-panel {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
  background: #050505;
  position: relative;
}

#view-portfolio ::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

#view-portfolio ::-webkit-scrollbar-track {
  background: var(--bg);
}

#view-portfolio ::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 3px;
}

/* LEFT PANEL */
#view-portfolio .header-bar {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#view-portfolio .search-box {
  margin: 15px 20px 10px 20px;
  position: relative;
}

#view-portfolio .search-box input {
  width: 100%;
  background: var(--item-bg);
  border: 1px solid var(--border);
  padding: 12px 44px 12px 40px;
  color: #fff;
  border-radius: 10px;
  font-size: 13px;
  outline: none;
  transition: 0.2s;
}

#view-portfolio .search-box input:focus {
  border-color: var(--primary);
}

#view-portfolio .search-icon {
  position: absolute;
  left: 14px;
  top: 14px;
  color: #666;
  font-size: 12px;
}

#view-portfolio .category-menu {
  display: flex;
  gap: 8px;
  padding: 0 20px 15px 20px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}

#view-portfolio .cat-item {
  padding: 6px 14px;
  border-radius: 20px;
  background: #1a1a1a;
  color: #888;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: 0.2s;
  border: 1px solid transparent;
}

#view-portfolio .cat-item.active {
  background: rgba(194, 245, 14, 0.1);
  color: var(--primary);
  border-color: var(--primary);
}

#view-portfolio .market-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 10px;
  margin-top: 5px;
}

#view-portfolio .market-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #1a1a1a;
  cursor: pointer;
  transition: 0.2s;
  border-radius: 10px;
  margin-bottom: 2px;
}

/* ✅ Portföy listesi: fiyat ile menü arasında boşluk */
#view-portfolio .market-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  /* boşluk burada */
  margin-left: 12px;
  /* fiyat bloğundan biraz ayrışsın */
}

#view-portfolio .market-actions .price-box {
  text-align: right;
  min-width: 110px;
  /* fiyat alanı sabit olsun, menü yapışmasın */
}

#view-portfolio .market-item:hover {
  background: #1f1f1f;
}

#view-portfolio .ticker-logo {
  width: 36px;
  height: 36px;
  background: #fff;
  border-radius: 8px;
  padding: 2px;
  object-fit: contain;
  margin-right: 12px;
}

#view-portfolio .ticker-symbol {
  font-weight: 700;
  font-size: 15px;
  display: block;
  color: #fff;
}

#view-portfolio .ticker-name {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

#view-portfolio .price-val {
  font-weight: 600;
  font-size: 15px;
  display: block;
  text-align: right;
}

#view-portfolio .price-change {
  font-size: 11px;
  margin-top: 2px;
  display: block;
  font-weight: 500;
  text-align: right;
}

/* DASHBOARD */
#view-portfolio .dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 25px;
}

#view-portfolio .portfolio-select {
  background: #1a1a1a;
  color: #fff;
  border: 1px solid var(--border);
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  cursor: pointer;
  min-width: 200px;
}

#view-portfolio .stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

#view-portfolio .stat-card {
  background: var(--item-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 25px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

#view-portfolio .stat-card.primary {
  border-color: var(--primary);
  background: rgba(194, 245, 14, 0.05);
}

#view-portfolio .stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  font-weight: 600;
}

#view-portfolio .stat-val {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
}

#view-portfolio .stat-sub {
  font-size: 12px;
  margin-top: 6px;
}

#view-portfolio .charts-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
  margin-bottom: 30px;
  height: 320px;
}

#view-portfolio .chart-box {
  background: var(--item-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

#view-portfolio .chart-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 15px;
  flex-shrink: 0;
}

#view-portfolio .chart-wrapper {
  flex: 1;
  position: relative;
  min-height: 0;
  width: 100%;
}

/* UPDATED TABLES (Horizontal Scroll & No Wrap) */
#view-portfolio .asset-table-wrap {
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--item-bg);
  margin-bottom: 30px;
  overflow-x: auto;
}

#view-portfolio .asset-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 800px;
}

#view-portfolio .asset-table th {
  text-align: left;
  padding: 15px 20px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.02);
  white-space: nowrap;
}

#view-portfolio .asset-table td {
  padding: 18px 20px;
  border-bottom: 1px solid #222;
  color: #eee;
  white-space: nowrap;
}

#view-portfolio .asset-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
}

#view-portfolio .table-ticker {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

/* Varlık adı + tarihçe ikonu */
#view-portfolio .asset-id {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

#view-portfolio .asset-ticker {
  font-weight: 800;
  font-size: 13px;
  color: #fff;
}

#view-portfolio .asset-name {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 3px;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#view-portfolio .pf-hist-btn {
  margin-left: auto;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: #c2f50e;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

#view-portfolio .pf-hist-btn:hover {
  background: rgba(194, 245, 14, 0.10);
  border-color: rgba(194, 245, 14, 0.35);
}

/* Tarihçe modal */
#view-portfolio .hist-modal {
  width: 620px;
  max-width: 92vw;
  background: #111;
  border-radius: 24px;
  padding: 18px 18px 16px 18px;
  border: 1px solid #333;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

#view-portfolio .hist-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}

#view-portfolio .hist-title {
  font-weight: 900;
  font-size: 16px;
  color: #fff;
  margin: 0;
}

#view-portfolio .hist-sub {
  font-size: 11px;
  color: #777;
  margin-top: 4px;
}

#view-portfolio .hist-close {
  cursor: pointer;
  color: #777;
  font-size: 18px;
  padding: 6px 8px;
}

#view-portfolio .hist-body {
  background: #000;
  border: 1px solid #222;
  border-radius: 16px;
  padding: 12px;
}

#view-portfolio #pfHistCanvas {
  width: 100%;
  height: 260px;
}

#view-portfolio .hist-loading {
  color: #777;
  font-size: 12px;
  padding: 10px 2px;
}


#view-portfolio .tab-header {
  display: flex;
  gap: 20px;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

#view-portfolio .tab-btn {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  padding: 5px 10px;
  transition: 0.2s;
  position: relative;
}

#view-portfolio .tab-btn.active {
  color: #fff;
}

#view-portfolio .tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -11px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary);
}

#view-portfolio .center-card {
  max-width: 420px;
  width: 100%;
  margin: 80px auto;
  background: var(--item-bg);
  padding: 40px;
  border-radius: 24px;
  border: 1px solid var(--border);
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.4s ease-out;
}

#view-portfolio .form-input {
  width: 100%;
  background: #000;
  border: 1px solid #333;
  padding: 15px;
  border-radius: 10px;
  color: #fff;
  margin-bottom: 15px;
  outline: none;
  transition: 0.2s;
}

#view-portfolio .form-input:focus {
  border-color: var(--primary);
}

#view-portfolio .text-green {
  color: var(--success);
}

#view-portfolio .text-red {
  color: var(--danger);
}

#view-portfolio .btn {
  padding: 14px 20px;
  border-radius: 10px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: 0.2s;
  font-size: 14px;
}

#view-portfolio .btn-primary {
  background: var(--primary);
  color: #000;
}

#view-portfolio .btn-primary:hover {
  background: #d4ff33;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(194, 245, 14, 0.15);
}

#view-portfolio .btn-primary:disabled {
  background: #333;
  color: #666;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
  opacity: 0.7;
}

#view-portfolio .btn-google {
  background: #fff;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 15px;
  width: 100%;
}

#view-portfolio .modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s;
}

#view-portfolio .trade-modal {
  background: #111;
  width: 380px;
  border-radius: 24px;
  padding: 30px;
  border: 1px solid #333;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

#view-portfolio .trade-tab-btn {
  flex: 1;
  text-align: center;
  padding: 10px;
  cursor: pointer;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  transition: 0.2s;
}

#view-portfolio .trade-tab-btn.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

#view-portfolio .loader-wrap {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #666;
}

#view-portfolio .spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(194, 245, 14, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 15px;
}

#view-portfolio .settings-wrap {
  position: relative;
}

#view-portfolio .settings-btn {
  width: auto;
  min-width: auto;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#view-portfolio .settings-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 220px;
  background: #111;
  border: 1px solid #333;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  display: none;
  z-index: 9999;
}

#view-portfolio .settings-menu.show {
  display: block;
}

#view-portfolio .settings-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

#view-portfolio .settings-item:last-child {
  border-bottom: none;
}

#view-portfolio .settings-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

#view-portfolio .settings-item.danger {
  color: #ff8080;
}

/* Portfolio sector filter button */
#view-portfolio .pf-filter-btn {
  position: absolute;
  right: 10px;
  top: 9px;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

#view-portfolio .pf-filter-btn:hover {
  border-color: rgba(194, 245, 14, 0.35);
  background: rgba(194, 245, 14, 0.10);
  color: #c2f50e;
}

#view-portfolio .pf-filter-btn.active {
  border-color: rgba(194, 245, 14, 0.55);
  background: rgba(194, 245, 14, 0.12);
  color: #c2f50e;
}

#view-portfolio .pf-filter-btn.disabled {
  opacity: .35;
  pointer-events: none;
}

/* Portfolio popup: keep placement, inherit global popup look */
#view-portfolio .pf-sector-popup {
  position: absolute;
  right: 0;
  left: auto;
  top: 46px;
  z-index: 10000;
}

#view-portfolio .pf-sector-close {
  color: #777;
  cursor: pointer;
  font-size: 14px;
}




@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1000px) {
  #view-portfolio #app {
    flex-direction: column;
    overflow-y: auto;
  }

  #view-portfolio .left-panel {
    width: 100%;
    height: 400px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  #view-portfolio .stats-row {
    grid-template-columns: 1fr 1fr;
  }

  #view-portfolio .charts-grid {
    grid-template-columns: 1fr;
    height: auto;
  }

  #view-portfolio .chart-box {
    height: 300px;
  }
}

/* =========================================
   SEKTORLER (İZOLE) - CompaniesList gibi tam yükseklik
   ========================================= */
/* =======================================================
   ✅ SEKTÖRLER TABLOSU (FIXED & ALIGNED)
   ======================================================= */

#view-sectors {
  background: #000;
  padding: 20px 20px 20px 20px;
  overflow: hidden;
}

/* =========================
   TOOLS VIEW
   ========================= */
#view-tools {
  padding: 20px;
  background: #000;
  overflow: hidden;
}

#view-tools.active {
  display: flex;
  flex-direction: column;
}

#view-tools .tools-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  min-height: 0;
}

#view-tools .tools-header {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#view-tools .tools-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

#view-tools .tools-badge {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ddd;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

#view-tools .tools-badge:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

#view-tools .tools-badge.active {
  background: rgba(194, 245, 14, 0.10);
  border-color: rgba(194, 245, 14, 0.35);
  color: #c2f50e;
}

#view-tools .tools-content {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  min-height: 0;
  overflow-y: auto;
  position: relative;
  flex: 1;
}

#view-tools .tools-empty {
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  font-weight: 600;
  padding: 20px;
}

#view-tools .tools-stage {
  min-height: 0;
}

#view-tools .tools-error {
  color: #ff4d4d;
  font-size: 13px;
  font-weight: 700;
  padding: 20px;
}

#view-sectors .sec-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Tablo Kapsayıcısı */
#view-sectors .table-wrapper {
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  background: #0b0b0b;
  position: relative;
}

/* Tablo Temel Ayarları - Sütun Genişliklerini KİLİTLE */
#view-sectors table {
  table-layout: fixed !important;
  width: 100%;
  min-width: 2400px;
  border-collapse: separate;
  border-spacing: 0;
}

/* --- TÜM HÜCRELER (TH ve TD) --- */
#view-sectors th,
#view-sectors td {
  box-sizing: border-box !important;
  padding: 0 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  height: 50px;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
  font-size: 13px;
  color: #eee;
}

/* --- 1. SÜTUN (İSİM ALANI) AYARLARI --- */
/* Hem başlık hem satır için sabit genişlik ve sticky */
#view-sectors th:first-child,
#view-sectors td:first-child {
  position: sticky;
  left: 0;
  z-index: 100;
  width: 360px !important;
  /* Genişlik KİLİTLİ */
  min-width: 360px !important;
  max-width: 360px !important;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  background: #0b0b0b;
  /* Arkadan yazı geçmesin diye opak */
  padding: 0 !important;
  /* Padding'i içindeki div halledecek */
}

/* Header (Başlık) Özel Ayarları */
#view-sectors thead th {
  background: #111;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: rgba(255, 255, 255, .6);
  position: sticky;
  top: 0;
  z-index: 200;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer !important;
}

#view-sectors th:first-child {
  z-index: 300 !important;
  background: #111;
  display: table-cell !important;
  /* ✅ flex KALDIR */
  padding: 0 10px !important;
  /* padding'i inner alacak */
  text-align: left !important;

}

#view-sectors .sec-th-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 50px;
  padding: 0 10px;
  box-sizing: border-box;
  justify-content: flex-start;

}

/* --- İÇERİK HİZALAMA KUTUSU (JS ile eklediğimiz div) --- */
/* Bu div sayesinde TD'nin genişliği bozulmadan içerik sağa kayar */
.sec-cell-inner {
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  padding-right: 10px;
  box-sizing: border-box;
}

/* --- GİRİNTİLER (TREE VIEW INDENTATION) --- */
/* Girintiyi TD'ye değil, içindeki DIV'e veriyoruz */

/* Level 1: Ana Sektör */
tr.sec-row-level-1 td:first-child {
  background: #0b0b0b;
}

tr.sec-row-level-1 .sec-cell-inner {
  padding-left: 10px;
  font-weight: 700;
  color: #fff;
}

/* Level 2: Alt Sektör */
tr.sec-row-level-2 td:first-child {
  background: #141414;
}

tr.sec-row-level-2 .sec-cell-inner {
  padding-left: 45px;
  /* Girinti */
  font-weight: 600;
  color: #fff;
}

/* Level 3: Şirket */
tr.sec-row-level-3 td:first-child {
  background: #1a1a1a;
}

tr.sec-row-level-3 .sec-cell-inner {
  padding-left: 80px;
  /* Daha fazla girinti */
  color: #aaa;
  font-size: 12px;
}

/* --- DİĞER SÜTUNLAR (VERİ ALANLARI) --- */
#view-sectors th:not(:first-child),
#view-sectors td:not(:first-child) {
  width: 140px !important;
  /* Sabit genişlik */
  min-width: 140px !important;
  max-width: 140px !important;
  text-align: right;
}

/* --- GÖRSEL EFEKTLER --- */
/* Hover Efektleri */
tr.sec-row-level-1:hover td {
  background: #161616 !important;
}

tr.sec-row-level-2:hover td {
  background: #1f1f1f !important;
}

tr.sec-row-level-3:hover td {
  background: #252525 !important;
}

/* Sort İkonu */
#view-sectors th.active-sort {
  background: #1a2205 !important;
  color: #c2f50e !important;
  border-bottom: 2px solid #c2f50e !important;
}

#view-sectors th.active-sort::after {
  content: attr(data-icon);
  margin-left: 5px;
  font-weight: bold;
}

/* Renk Sınıfları */
#view-sectors .pos {
  color: #00ff88;
}

#view-sectors .neg {
  color: #ff4444;
}

#view-sectors .muted {
  color: rgba(255, 255, 255, .4);
}

/* Logo ve Sayaç */
.sec-comp-logo {
  margin-right: 8px;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  object-fit: contain;
  background: #fff;
}

.comp-count {
  margin-left: auto;
  font-size: 10px;
  opacity: 0.5;
  font-weight: 400;
}

.sec-caret {
  width: 20px;
  text-align: center;
  margin-right: 5px;
  color: #666;
  transition: 0.2s;
}

.sec-expanded .sec-caret {
  transform: rotate(90deg);
  color: #c2f50e;
}

#view-sectors td[colspan] {
  position: static !important;
  width: auto !important;
  max-width: none !important;
  text-align: center !important;
  background: transparent !important;
  border: none !important;
}

/* Sektörler > Şirket satırı aksiyon ikonu sağa dayansın */
#view-sectors .sec-cell-inner .sec-row-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#view-sectors .sec-cell-inner .fp-menu-btn {
  flex: 0 0 auto;
}


/* --- MOBİL UYUM (CARD VIEW) --- */
@media screen and (max-width: 768px) {
  #view-sectors .table-wrapper {
    flex: none;
    min-height: 0;
    overflow: visible;
  }

  #view-sectors table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: auto !important;
    display: block !important;
  }

  #view-sectors thead {
    display: none !important;
  }

  #view-sectors tbody,
  #view-sectors tr {
    display: block !important;
    width: 100% !important;
  }

  #view-sectors tbody tr {
    margin-bottom: 20px;
    background: #0f0f0f;
    border-radius: 16px;
    border: 1px solid #222;
    padding: 15px;
    height: auto !important;
  }

  #view-sectors tbody td {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    width: 100% !important;
    padding: 12px 0 !important;
    position: static !important;
    background: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    height: auto !important;
    white-space: normal !important;
    text-align: right !important;
    border-right: none !important;
  }

  #view-sectors tbody td:first-child {
    border-bottom: 2px solid #c2f50e !important;
    margin-bottom: 10px;
    padding-bottom: 15px !important;
    justify-content: flex-start !important;
    width: 100% !important;
    max-width: none !important;
  }

  /* Mobilde .sec-cell-inner padding'ini sıfırla veya azalt */
  .sec-cell-inner {
    padding-left: 0 !important;
  }

  tr.sec-row-level-2 .sec-cell-inner {
    padding-left: 20px !important;
  }

  tr.sec-row-level-3 .sec-cell-inner {
    padding-left: 40px !important;
  }

  #view-sectors tbody td:not(:first-child)::before {
    content: attr(data-label);
    font-weight: 600;
    color: #555;
    font-size: 11px;
    text-transform: uppercase;
    margin-right: 10px;
    text-align: left;
  }
}



/* =========================================
       KARŞILAŞTIRMA (İZOLE)
       ========================================= */
@keyframes cmpSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes cmpFadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#view-compare {
  --primary: #c2f50e;
  --bg: #050505;
  --card-bg: #0f0f0f;
  --border: rgba(255, 255, 255, 0.12);
  --text-muted: rgba(255, 255, 255, 0.5);
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: #000;
  padding: 0;
  box-sizing: border-box;


}

/* ✅ DÜZELTME: Fontu kapsayıcıya ver, yıldıza değil. */
#view-compare {
  font-family: 'Inter', sans-serif;
  /* Diğer ayarlar */
  height: 100%;
  width: 100%;
  background: #000;
  padding: 20px 20px 20px 20px;
  overflow: hidden;
}

/* Yıldız sadece box-sizing yapsın, fontu ellemesin */
#view-compare * {
  box-sizing: border-box;
}

#view-compare .cmp-main-container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  position: relative;
  background: var(--bg);
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#view-compare .cmp-search-section {
  background: #0a0a0a;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}

#view-compare .cmp-search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

#view-compare i.cmp-search-icon {
  position: absolute;
  left: 16px;
  color: var(--text-muted);
  font-size: 14px;
}

#view-compare #cmpSearch {
  width: 100%;
  background: #111;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 14px 16px 14px 44px;
  border-radius: 12px;
  outline: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

#view-compare #cmpSearch:focus {
  border-color: var(--primary);
  background: rgba(194, 245, 14, 0.05);
  box-shadow: 0 0 0 1px rgba(194, 245, 14, 0.2);
}

#view-compare .cmp-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #161616;
  border: 1px solid var(--border);
  border-radius: 12px;
  max-height: 280px;
  overflow-y: auto;
  display: none;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
  z-index: 9999;
}

#view-compare .cmp-result-item {
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.15s;
}

#view-compare .cmp-result-item:hover {
  background: rgba(194, 245, 14, 0.1);
}

#view-compare .cmp-result-item img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 4px;
  background: #fff;
  padding: 2px;
}

#view-compare .cmp-result-item span {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

#view-compare .cmp-badge-area {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
  min-height: 32px;
}

#view-compare .cmp-badge {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: cmpFadeIn 0.3s ease;
}

#view-compare .cmp-badge i {
  cursor: pointer;
  color: rgba(255, 255, 255, 0.5);
  transition: color 0.2s;
}

#view-compare .cmp-badge i:hover {
  color: #ff4d4d;
}

#view-compare .cmp-table-wrapper {
  width: 100%;
  background: var(--bg);
  overflow: auto;
  padding-bottom: 20px;
  flex: 1;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
}

#view-compare table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 900px;
}

#view-compare th,
#view-compare td {
  padding: 16px 12px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: middle;
  color: #e0e0e0;
}

#view-compare tr:hover td {
  background-color: rgba(255, 255, 255, 0.03);
}

#view-compare th:first-child,
#view-compare td:first-child {
  position: sticky;
  left: 0;
  z-index: 20;
  background: var(--bg);
  border-right: 1px solid var(--border);
  text-align: left !important;
  width: 220px;
  min-width: 220px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
}

#view-compare thead th {
  background: var(--card-bg);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  height: 70px;
  position: sticky;
  top: 0;
}

#view-compare thead th:first-child {
  z-index: 30;
  background: var(--card-bg);
}

#view-compare .cmp-flag-head {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
  padding: 2px;
  display: block;
  margin: 0 auto 8px auto;
}

#view-compare .cmp-country-title {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
}

#view-compare .cmp-mobile-meta {
  display: none;
}

#view-compare .cell-green {
  background-color: rgba(194, 245, 14, 0.15) !important;
  color: #c2f50e !important;
  font-weight: 700;
}

#view-compare .cell-yellow {
  background-color: rgba(255, 235, 59, 0.08) !important;
  color: #ffeb3b !important;
}

#view-compare .cell-orange {
  background-color: rgba(255, 152, 0, 0.08) !important;
  color: #ff9800 !important;
}

#view-compare .cell-red {
  background-color: rgba(255, 77, 77, 0.1) !important;
  color: #ff4d4d !important;
}

#view-compare .val-highlight {
  color: #fff;
  font-weight: 700;
}

#view-compare .muted {
  opacity: 0.3;
}

@media (max-width: 768px) {
  #view-compare table {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: auto;
    padding: 15px;
  }

  #view-compare thead {
    display: none;
  }

  #view-compare tbody {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  #view-compare tr {
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
  }

  #view-compare td:first-child {
    position: static;
    width: 100%;
    border-right: none;
    background: rgba(255, 255, 255, 0.03);
    padding: 14px 16px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
  }

  #view-compare td:not(:first-child) {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    text-align: right;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 14px;
    background: transparent !important;
  }

  #view-compare tr td:last-child {
    border-bottom: none;
  }

  #view-compare .cell-green {
    border-left: 3px solid #c2f50e;
    color: #c2f50e !important;
  }

  #view-compare .cell-red {
    border-left: 3px solid #ff4d4d;
    color: #ff4d4d !important;
  }

  #view-compare .cell-yellow {
    border-left: 3px solid #ffeb3b;
    color: #ffeb3b !important;
  }

  #view-compare .cell-orange {
    border-left: 3px solid #ff9800;
    color: #ff9800 !important;
  }

  #view-compare .cmp-mobile-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
  }

  #view-compare .cmp-mobile-meta img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    background: #fff;
    border-radius: 4px;
    padding: 1px;
  }
}

/* Add-to-Portfolio mini icon (Screener/List/Compare) */
.fp-add-btn {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(194, 245, 14, 0.10);
  border: 1px solid rgba(194, 245, 14, 0.25);
  color: #c2f50e;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

/* Menu button (replaces +) */
.fp-menu-btn {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.fp-menu-btn:hover {
  background: rgba(255, 255, 255, 0.10);
  transform: translateY(-1px);
}

.fp-menu-btn i {
  font-size: 12px;
  line-height: 1;
}

/* Row action menu modal */
#fpRowMenuOverlay {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 999999;
  background: transparent;
  /* ✅ artık karartma yok */
  backdrop-filter: none;
  /* ✅ blur yok */
}

#fpRowMenu {
  position: fixed;
  /* ✅ konumlandıracağız */
  width: 260px;
  background: #0f0f0f;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.75);
}

.fpMenuHead {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fpMenuTitle {
  font-weight: 900;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}

.fpMenuTicker {
  font-weight: 900;
  color: #c2f50e;
}

.fpMenuItem {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.fpMenuItem:last-child {
  border-bottom: none;
}

.fpMenuItem:hover {
  background: rgba(255, 255, 255, 0.05);
}

.fpMenuItem.disabled {
  opacity: .35;
  cursor: not-allowed;
  pointer-events: none;
}

.fpMenuIcon {
  width: 18px;
  text-align: center;
  opacity: .85;
}

.fpMenuClose {
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.fpMenuClose:hover {
  background: rgba(255, 255, 255, 0.10);
}

.fp-add-btn:hover {
  background: rgba(194, 245, 14, 0.18);
  transform: translateY(-1px);
}

.fp-add-btn i {
  font-size: 12px;
  line-height: 1;
}

/* Compare badge buttons */
#view-compare .cmp-badge .cmp-xbtn {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  font-weight: 900;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}

#view-compare .cmp-badge .cmp-xbtn:hover {
  color: #ff4d4d;
  border-color: rgba(255, 77, 77, 0.35);
}

#view-compare .cmp-badge .cmp-addbtn {
  margin-left: 2px;
}



/* =========================================
       DETAIL (comdetail) - SCOPED
       ========================================= */
#view-detail {
  --neon: #c2f50e;
  --bg: #000;
  --border: rgba(255, 255, 255, .08);
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: 20px 20px 20px 20px;
  background:
    radial-gradient(1200px 700px at 25% -10%, rgba(194, 245, 14, .12), transparent 60%),
    radial-gradient(900px 500px at 90% 10%, rgba(255, 216, 77, .06), transparent 55%),
    var(--bg);
}

#view-detail * {
  box-sizing: border-box;
}

#view-detail .wrap {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
}

#view-detail .fin-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, .01));
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

#view-detail #cardFinancials {
  overflow: visible;
}

#view-detail #financialTableWrap {
  overflow-x: auto;
  overflow-y: visible;
}

#view-detail #financialTableWrap {
  max-height: 720px;
  overflow-y: auto;
}

#view-detail .similar-logo {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  object-fit: contain;
  background: #0a0a0a;
  border: 1px solid rgba(255,255,255,0.08);
}

#view-detail .similar-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

#view-detail .similar-row.current td {
  color: #c2f50e;
  font-weight: 900;
}

#view-detail .similar-row {
  cursor: pointer;
}
#view-detail .similar-row:hover td {
  background: #141614;
}

#view-detail .fin-row:hover td {
  background: #141614;
}

#view-detail .card-head {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}

#view-detail #sideStack .card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

#view-detail .val-up {
  color: #00ff88;
}
#view-detail .val-down {
  color: #ff4444;
}

#view-detail .tab-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

#view-detail .tab-scroll::-webkit-scrollbar {
  display: none;
}

#view-detail .tab-btn {
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
  color: #9b9b9b;
  background: transparent;
  border-radius: 10px;
  padding: 8px 12px;
  transition: all .18s ease;
  border: 1px solid rgba(255, 255, 255, 0);
  outline: none;
  cursor: pointer;

}

#view-detail .tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, .05);
}

#view-detail .tab-btn.active {
  background: var(--neon);
  color: #000;
  font-weight: 900;
}

#view-detail .fin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
}

#view-detail .fin-table thead th {
  text-align: right;
  color: #7d7d7d;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 900;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  background: #0f0f0f;
  position: sticky;
  top: 0;
  z-index: 3;
}

#view-detail .fin-table thead th:first-child {
  text-align: left;
  left: 0;
  z-index: 5;
  background: #0f0f0f;
}

#view-detail .fin-table tbody td {
  text-align: right;
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

#view-detail .fin-table tbody td:first-child {
  text-align: left;
  color: #e5e5e5;
  font-weight: 800;
  position: sticky;
  left: 0;
  background: #0c0c0c;
  z-index: 4;
  box-shadow: 8px 0 12px rgba(0,0,0,0.6);
}

#view-detail .range-container {
  position: relative;
  height: 44px;
  display: flex;
  align-items: center;
}

#view-detail .range-track {
  width: 100%;
  height: 10px;
  background: #1f1f1f;
  border-radius: 999px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .06);
}

#view-detail .range-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(194, 245, 14, .25) 0%, rgba(194, 245, 14, 1) 100%);
  border-radius: 999px;
  position: absolute;
  left: 0;
  top: 0;
}

#view-detail .range-thumb {
  width: 20px;
  height: 20px;
  background: #fff;
  border: 4px solid #000;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  box-shadow: 0 0 0 6px rgba(194, 245, 14, .10), 0 10px 25px rgba(0, 0, 0, .45);
}

#view-detail .range-label-float {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: #111;
  padding: 3px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .12);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  color: #fff;
}

#view-detail .metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.18s ease;
}

#view-detail .metric-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

#view-detail .metric-row:last-child {
  border-bottom: none;
}

#view-detail .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  border: 1px solid rgba(255, 255, 255, .10);
  color: #d7d7d7;
  background: rgba(255, 255, 255, .04);
  text-transform: uppercase;
  letter-spacing: .06em;
}

#view-detail .badge.neon {
  background: rgba(194, 245, 14, .18);
  border-color: rgba(194, 245, 14, .35);
  color: var(--neon);
}

#view-detail .news-item {
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.18s ease;
  cursor: pointer;
  text-decoration: none;
  display: block;
}

#view-detail .news-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

#view-detail .news-item:last-child {
  border-bottom: none;
}

#view-detail #priceChart {
  width: 100%;
  min-height: 280px;
}

/* Snapshot (Genel Bilgiler) */
#view-detail .snapshot-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

#view-detail .snapshot-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .03);
  border-radius: 12px;
}

#view-detail .snapshot-row .k {
  color: #8b8b8b;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}

#view-detail .snapshot-row .v {
  color: #fff;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

/* Mini Bars */
#view-detail .mini-legend {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 8px 0 10px 0;
  color: rgba(255, 255, 255, .60);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

#view-detail .mini-leg-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

#view-detail .mini-legend .dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .14);
  display: inline-block;
}

#view-detail .mini-legend .dot.rev {
  background: rgba(194, 245, 14, .65);
}

#view-detail .mini-legend .dot.prof {
  background: rgba(0, 230, 118, .70);
}

#view-detail .mini-bars-wrap {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  height: 140px;
  padding: 10px 8px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .02);
  border-radius: 12px;
}

#view-detail .mini-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

#view-detail .mini-bars-stack {
  width: 100%;
  height: 96px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
}

#view-detail .mini-bar {
  width: 10px;
  border-radius: 8px 8px 3px 3px;
  background: rgba(194, 245, 14, .65);
  box-shadow: 0 10px 24px rgba(194, 245, 14, .12);
}

#view-detail .mini-bar.profit {
  background: rgba(0, 230, 118, .70);
  box-shadow: 0 10px 24px rgba(0, 230, 118, .10);
}

#view-detail .mini-bar.profit.neg {
  background: rgba(255, 77, 77, .75);
  box-shadow: 0 10px 24px rgba(255, 77, 77, .10);
}

#view-detail .mini-label {
  font-size: 10px;
  font-weight: 900;
  color: rgba(255, 255, 255, .55);
  letter-spacing: .04em;
}


#view-detail .search-wrap {
  position: relative;
}

#view-detail .search-input {
  width: 320px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  padding: 10px 12px;
  color: #fff;
  font-weight: 900;
  outline: none;
}

#view-detail .search-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
  font-weight: 800;
}

#view-detail .search-input:focus {
  border-color: rgba(194, 245, 14, .55);
  box-shadow: 0 0 0 4px rgba(194, 245, 14, .12);
}

#view-detail .search-btn {
  background: var(--neon);
  color: #000;
  font-weight: 900;
  border-radius: 12px;
  padding: 10px 12px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

#view-detail .search-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

#view-detail .search-dd {
  position: absolute;
  top: 44px;
  right: 0;
  width: 420px;
  max-width: calc(100vw - 36px);
  background: rgba(15, 15, 15, .98);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, .55);
  overflow: hidden;
  display: none;
  z-index: 50;
}

#view-detail .dd-item {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

#view-detail .dd-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

#view-detail .dd-item:last-child {
  border-bottom: none;
}

#view-detail .dd-left {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#view-detail .dd-title {
  font-weight: 900;
  color: #fff;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#view-detail .dd-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

#view-detail .dd-right {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

#view-detail .dd-ticker {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-weight: 900;
  color: var(--neon);
  font-size: 12px;
}

/* Detail loading overlay */
#view-detail .wrap {
  position: relative;
}

/* overlay'in wrap içinde oturması için */

#detailLoadingOverlay.detail-loading-overlay {
  position: absolute;
  inset: 0;
  display: none;
  /* JS açacak */
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  z-index: 9999;
  border-radius: 18px;
}

/* =========================================
   DIYAGRAMLAR (İZOLE)
   ========================================= */
#view-diagrams {
  padding: 20px 20px 20px 20px;
  background: #050505;
  overflow: hidden;
}

#view-diagrams .dg-container {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;

}

#view-diagrams .dg-header-tools {
  display: flex;
  gap: 12px;
  background: #111;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid #222;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

#view-diagrams .dg-header-tools select {
  background: #1a1a1a;
  color: #c2f50e;
  border: 1px solid #333;
  padding: 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  flex: 1;
  outline: none;
  cursor: pointer;
  transition: all .2s;
}

#view-diagrams .dg-header-tools select:hover {
  border-color: #c2f50e;
  background: #222;
}

#view-diagrams .dg-main-layout {
  display: flex;
  gap: 20px;
  flex: 1;
  min-height: 0;
}

#view-diagrams .dg-chart-container {
  flex: 0 0 70%;
  position: relative;
  background: #0a0a0a;
  border: 1px solid #1f1f1f;
  border-radius: 20px;
  padding: 15px;
  min-height: 520px;
}

#view-diagrams .dg-sidebar-panel {
  flex: 1;
  background: #111;
  border: 1px solid #222;
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  overflow: auto;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
  min-height: 0;
}

#view-diagrams .dg-sidebar-panel h4 {
  margin: 0 0 15px 0;
  color: #c2f50e;
  font-size: 16px;
  text-transform: uppercase;
  border-bottom: 1px solid #333;
  padding-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

#view-diagrams #interp-content {
  color: #bbb;
  font-size: 14px;
  line-height: 1.7;
}

@media (max-width: 900px) {
  #view-diagrams .dg-main-layout {
    flex-direction: column;
  }

  #view-diagrams .dg-chart-container {
    flex: none;
    min-height: 420px;
  }
}

/* --- COMPANIES FILTER (PORTFOLIO STYLE CLONE) --- */
#view-companies .cl-filter-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
}

#view-companies .cl-filter-btn:hover {
  border-color: rgba(194, 245, 14, 0.35);
  background: rgba(194, 245, 14, 0.10);
  color: #c2f50e;
}

#view-companies .cl-filter-btn.active {
  border-color: rgba(194, 245, 14, 0.55);
  background: rgba(194, 245, 14, 0.12);
  color: #c2f50e;
}

/* POPUP */
#view-companies .cl-sector-popup {
  position: absolute;
  right: 0;
  top: 46px;
  width: 260px;
  background: linear-gradient(to bottom, #141414, #0b0b0b);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.65);
  z-index: 9999;
  overflow: hidden;
  display: none;
  /* JS ile açılacak */
}

#view-companies .cl-sector-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

#view-companies .cl-sector-title {
  font-weight: 900;
  font-size: 12px;
  color: #fff;
}

#view-companies .cl-sector-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

#view-companies .cl-sector-clear {
  font-size: 11px;
  font-weight: 800;
  color: #c2f50e;
  background: transparent;
  border: 0;
  cursor: pointer;
}

#view-companies .cl-sector-close {
  color: #777;
  cursor: pointer;
  font-size: 14px;
}

#view-companies .cl-sector-list {
  max-height: 280px;
  overflow: auto;
  padding: 8px;
}

#view-companies .cl-sector-item {
  padding: 10px;
  border-radius: 12px;
  cursor: pointer;
  color: #ddd;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}

#view-companies .cl-sector-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

#view-companies .cl-sector-item.active {
  background: rgba(194, 245, 14, 0.12);
  border-color: rgba(194, 245, 14, 0.35);
  color: #c2f50e;
}

/* --- GRUP SEÇİM BUTONLARI (YENİ) --- */
.group-toggle-row {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 10px;
  /* Popup içinde alt boşluk */
}

.group-toggle-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: #888;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.group-toggle-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.group-toggle-btn.active {
  background: #c2f50e;
  color: #000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* --- SCREENER SECTOR FILTER (PORTFOLIO STYLE) --- */
#view-screener .sc-filter-btn {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-right: 8px;
  /* Sağdaki butonlarla mesafe */
}

#view-screener .sc-filter-btn:hover {
  border-color: rgba(194, 245, 14, 0.35);
  background: rgba(194, 245, 14, 0.10);
  color: #c2f50e;
}

#view-screener .sc-filter-btn.active {
  border-color: rgba(194, 245, 14, 0.55);
  background: rgba(194, 245, 14, 0.12);
  color: #c2f50e;
}

/* sc-sector-popup artık global badge sisteminde tanımlı */

/* --- SECTORS SEARCH BAR --- */
#view-sectors .sec-controls {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

#view-sectors .sec-search-box {
  flex: 1;
  position: relative;
}

#view-sectors .sec-search-input {
  width: 100%;
  background: #111;
  border: 1px solid #333;
  color: #fff;
  padding: 12px 15px 12px 38px;
  /* İkon payı */
  border-radius: 10px;
  font-size: 13px;
  outline: none;
  font-weight: 600;
}

#view-sectors .sec-search-input:focus {
  border-color: #c2f50e;
}

#view-sectors .sec-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  font-size: 12px;
}

/* --- GÖSTERGELER (INDICATORS) CSS --- */
#view-indicators {
  padding: 20px;
  background: #000;
  overflow-y: auto;
  /* Sayfa kaydırma */
}

#view-indicators .wrap {
  padding: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  gap: 20px;
}


#view-indicators .table-wrapper {
  width: 100%;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  background: #0b0b0b;
}

#view-indicators table {
  width: 100%;
  min-width: 1150px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

#view-indicators table.ind-table th,
#view-indicators table.ind-table td {
  width: 14%;
}

#view-indicators table.ind-table th:first-child,
#view-indicators table.ind-table td:first-child {
  width: 30%;
}

#view-indicators thead th {
  position: sticky;
  top: 0;
  z-index: 500;

  /* ✅ Sticky bug fix */
  background: transparent !important;

  color: rgba(255, 255, 255, .6);
  font-size: 11px;
  text-transform: uppercase;
  text-align: right;
  padding: 16px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);

  isolation: isolate;
}

#view-indicators thead th::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #1a1a1a;
  box-shadow: 0 1px 0 #1a1a1a, 0 -1px 0 #1a1a1a;
  z-index: -1;
}


#view-indicators thead th:first-child {
  left: 0;
  z-index: 600;
  text-align: left;
}

#view-indicators thead th:first-child::before {
  box-shadow: 0 1px 0 #1a1a1a, 0 -1px 0 #1a1a1a, 1px 0 0 #1a1a1a;
}



#view-indicators tbody td:first-child {
  position: sticky;
  left: 0;
  z-index: 90;
  background: #0b0b0b;
  text-align: left;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

#view-indicators tbody td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  text-align: right;
  font-size: 14px;
  vertical-align: middle;
  white-space: nowrap;
}


/* Renkler ve Linkler */
#view-indicators .pos {
  color: #c2f50e;
}

#view-indicators .neg {
  color: #ff5a5a;
}

#view-indicators .muted {
  color: rgba(255, 255, 255, 0.45);
}

#view-indicators .company-link {
  text-decoration: none;
  color: inherit;
}

#view-indicators .company-link:hover .company-name {
  color: #c2f50e;
}

#view-indicators .small-label {
  font-size: 11px;
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.3);
  font-weight: normal;
}

/* İkonlar */
/* Grup Satırı Stilleri */
#view-indicators .group-row {
  background: rgba(255, 255, 255, 0.05) !important;
  cursor: pointer;
}

#view-indicators .group-row td {
  padding: 12px 15px !important;
  font-weight: 800;
  color: var(--finapsis-neon);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 1px;
}

#view-indicators .group-caret {
  transition: transform 0.2s;
  margin-right: 10px;
}

#view-indicators .group-row.collapsed .group-caret {
  transform: rotate(-90deg);
}

#view-indicators .indicator-icon {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 12px;
  text-align: center;
  transition: all 0.2s;
}

#view-indicators .icon-up {
  color: #c2f50e;
  border-color: rgba(194, 245, 14, 0.3);
  background: rgba(194, 245, 14, 0.05);
}

#view-indicators .icon-down {
  color: #ff5a5a;
  border-color: rgba(255, 90, 90, 0.3);
  background: rgba(255, 90, 90, 0.05);
}

#view-indicators .company-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

#view-indicators .company-name {
  font-weight: 600;
  font-size: 14px;
  color: #eee;
  transition: 0.2s;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.25;
  max-height: 2.6em;
}

#view-indicators .date-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 2px;
}

/* Mobil */
@media screen and (max-width: 768px) {
  #view-indicators .table-wrapper {
    border: none !important;
  }

  #view-indicators table {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  #view-indicators thead {
    display: none !important;
  }

  #view-indicators tbody {
    display: block !important;
    width: 100% !important;
  }

  #view-indicators tbody tr {
    display: block !important;
    margin-bottom: 20px;
    background: #0f0f0f;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 15px;
  }

  #view-indicators tbody td {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    width: 100% !important;
    padding: 10px 0 !important;
    position: static !important;
    background: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    white-space: normal !important;
  }

  #view-indicators tbody td:first-child {
    border-bottom: 2px solid #c2f50e !important;
    margin-bottom: 10px;
    padding-bottom: 15px !important;
    justify-content: flex-start !important;
  }

  #view-indicators tbody td:last-child {
    border-bottom: none !important;
  }

  #view-indicators tbody td:nth-child(2)::before {
    content: "Son Değer";
  }

  #view-indicators tbody td:nth-child(3)::before {
    content: "Önceki";
  }

  #view-indicators tbody td:nth-child(4)::before {
    content: "Değişim (Önceki)";
  }

  #view-indicators tbody td:nth-child(5)::before {
    content: "Değişim (YTD)";
  }

  #view-indicators tbody td:nth-child(6)::before {
    content: "Değişim (12 Ay)";
  }

  #view-indicators tbody td:not(:first-child)::before {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    font-weight: 500;
    margin-right: 15px;
  }
}

/* --- CALENDAR LIST VIEW CSS (FIXED) --- */
#view-calendar-list {
  padding: 20px;
  /* ✅ diğerleriyle aynı: full width hissi */
  background: #000;
  overflow-y: auto;
}

#view-calendar-list .wrap {
  width: 100%;
  padding: 0;
  margin: 0;
  max-width: none;
  box-sizing: border-box;
}


#view-calendar-list .table-wrapper {
  width: 100%;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  background: #0b0b0b;
}


/* Tablo Ayarları */
/* --- CALENDAR LIST TABLO STİLLERİ (DÜZELTİLDİ) --- */
#view-calendar-list table {
  width: 100%;
  min-width: 1100px;
  border-collapse: separate;
  /* Sticky için şart */
  border-spacing: 0;
}

/* HEADER HÜCRELERİ */
#view-calendar-list thead th {
  position: sticky;
  top: 0;
  z-index: 500;

  /* ✅ Sticky bug fix: gerçek zemin ::before ile çizilecek */
  background: transparent !important;

  color: rgba(255, 255, 255, .6);
  font-size: 11px;
  text-transform: uppercase;
  text-align: right;
  padding: 16px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);

  /* ✅ boyama hatalarını keser */
  isolation: isolate;
}

#view-calendar-list thead th::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #1a1a1a;
  box-shadow: 0 1px 0 #1a1a1a, 0 -1px 0 #1a1a1a;
  z-index: -1;
}


#view-calendar-list thead th:first-child {
  left: 0;
  z-index: 600;
  text-align: left;
  border-right: 1px solid rgba(255, 255, 255, 0.10);
}

#view-calendar-list thead th:first-child::before {
  box-shadow: 0 1px 0 #1a1a1a, 0 -1px 0 #1a1a1a, 1px 0 0 #1a1a1a;
}


/* SOL SÜTUN (Sadece sola sticky) */
#view-calendar-list tbody td:first-child {
  position: sticky;
  left: 0;
  z-index: 90;
  background-color: #0b0b0b !important;
  /* Arka plan şart */
  text-align: left;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

/* DİĞER HÜCRELER */
#view-calendar-list tbody td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  text-align: right;
  font-size: 14px;
  vertical-align: middle;
  white-space: nowrap;
}


#view-calendar-list tbody td:first-child {
  position: sticky;
  left: 0;
  z-index: 90;
  background: #0b0b0b;
  text-align: left;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

#view-calendar-list tbody td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  text-align: right;
  font-size: 14px;
  vertical-align: middle;
  white-space: nowrap;
}

#view-calendar-list .pos {
  color: #c2f50e;
}

#view-calendar-list .muted {
  color: rgba(255, 255, 255, 0.45);
}

#view-calendar-list .company-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

#view-calendar-list .data-name {
  font-weight: 600;
  font-size: 14px;
  color: #eee;
}

#view-calendar-list .date-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 2px;
}

#view-calendar-list .flag-img {
  width: 22px;
  border-radius: 2px;
}

/* Bildirim Butonu */
#view-calendar-list .notify-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: 0.2s;
  color: rgba(255, 255, 255, 0.3);
}

#view-calendar-list .notify-btn:hover:not(:disabled) {
  background: rgba(194, 245, 14, 0.1);
  color: #c2f50e;
}

#view-calendar-list .notify-btn:disabled {
  cursor: not-allowed;
  opacity: 0.2;
}

/* --- CALENDAR LIST FILTER TOOLBAR --- */
#view-calendar-list .cal-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px;
  background: #111;
  border: 1px solid #222;
  border-radius: 12px;
}

#view-calendar-list .cal-filter-group {
  display: flex;
  gap: 4px;
  align-items: center;
  border-right: 1px solid #333;
  padding-right: 12px;
}

#view-calendar-list .cal-filter-group:last-child {
  border-right: none;
}

/* Zaman Hapları (Pills) */
#view-calendar-list .cal-pill {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #888;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: 0.2s;
  white-space: nowrap;
}

#view-calendar-list .cal-pill:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

#view-calendar-list .cal-pill.active {
  background: rgba(194, 245, 14, 0.15);
  color: #c2f50e;
  border-color: rgba(194, 245, 14, 0.3);
}

/* İkon Butonları (Flag & Bolt) */
#view-calendar-list .cal-icon-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid #333;
  background: #1a1a1a;
  cursor: pointer;
  opacity: 0.6;
  transition: 0.2s;
}

#view-calendar-list .cal-icon-btn img {
  width: 18px;
  border-radius: 2px;
}

#view-calendar-list .cal-icon-btn svg {
  width: 14px;
  fill: #888;
}

#view-calendar-list .cal-icon-btn:hover {
  opacity: 1;
  border-color: #555;
}

#view-calendar-list .cal-icon-btn.active {
  opacity: 1;
  border-color: #c2f50e;
  background: rgba(194, 245, 14, 0.05);
  box-shadow: 0 0 10px rgba(194, 245, 14, 0.1);
}

#view-calendar-list .cal-icon-btn.active svg {
  fill: #c2f50e;
}

/* YENİ: Yıldırım Derecelendirme Barı */
#view-calendar-list .cal-impact-rating {
  display: flex;
  align-items: center;
  gap: 2px;
  background: #1a1a1a;
  border: 1px solid #333;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}

#view-calendar-list .cal-impact-item {
  width: 14px;
  height: 14px;
  fill: #444;
  transition: 0.2s;
}

#view-calendar-list .cal-impact-item:hover {
  fill: #666;
}

/* Aktiflik Durumları */
#view-calendar-list .cal-impact-rating[data-level="1"] .cal-impact-item:nth-child(1) {
  fill: #c2f50e;
}

#view-calendar-list .cal-impact-rating[data-level="2"] .cal-impact-item:nth-child(1),
#view-calendar-list .cal-impact-rating[data-level="2"] .cal-impact-item:nth-child(2) {
  fill: #c2f50e;
}

#view-calendar-list .cal-impact-rating[data-level="3"] .cal-impact-item:nth-child(-n+3) {
  fill: #c2f50e;
}


/* Search Box (En sağa itmek için margin-left auto) */
#view-calendar-list .cal-search-wrap {
  margin-left: auto;
  position: relative;
  width: auto;
  flex: 1 1 auto;
}

#view-calendar-list .cal-search-input {
  width: 100%;
  background: #000;
  border: 1px solid #333;
  color: #fff;
  padding: 8px 10px 8px 34px;
  border-radius: 8px;
  font-size: 12px;
  outline: none;
}

#view-calendar-list .cal-search-input:focus {
  border-color: #c2f50e;
}

#view-calendar-list .cal-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  font-size: 12px;
}

@media (max-width: 1000px) {
  #view-calendar-list .cal-filter-bar {
    gap: 10px;
  }

  #view-calendar-list .cal-filter-group {
    border-right: none;
    flex-wrap: wrap;
  }

  #view-calendar-list .cal-search-wrap {
    width: 100%;
    margin-left: 0;
    order: -1;
    margin-bottom: 5px;
  }
}

/* MODAL (Global Overlay) */
#calListModalOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#calListModalContent {
  background: #161616;
  width: 90%;
  max-width: 400px;
  padding: 24px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#calListModalContent .modal-title {
  font-size: 18px;
  margin-bottom: 16px;
  font-weight: 600;
  color: #fff;
}

#calListModalContent .input-group {
  margin-bottom: 12px;
}

#calListModalContent .input-group label {
  display: block;
  font-size: 12px;
  color: #aaa;
  margin-bottom: 6px;
}

#calListModalContent .input-group input {
  width: 100%;
  background: #222;
  border: 1px solid #333;
  padding: 10px;
  border-radius: 8px;
  color: #fff;
  box-sizing: border-box;
  outline: none;
}

#calListModalContent .check-group {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: #aaa;
  margin-top: 10px;
  line-height: 1.4;
}

#calListModalContent .check-group input {
  margin-top: 3px;
}

#calListModalContent .submit-btn {
  width: 100%;
  background: #c2f50e;
  color: #000;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-weight: 700;
  margin-top: 20px;
  cursor: pointer;
  opacity: 0.5;
  transition: 0.3s;
}

#calListModalContent .submit-btn:not(:disabled) {
  opacity: 1;
}

@media (max-width: 768px) {
  #view-calendar-list .table-wrapper {
    border: none !important;
  }

  #view-calendar-list table {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  #view-calendar-list thead {
    display: none !important;
  }

  #view-calendar-list tbody {
    display: block !important;
    width: 100% !important;
  }

  #view-calendar-list tbody tr {
    display: block !important;
    margin-bottom: 20px;
    background: #0f0f0f;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 15px;
  }

  #view-calendar-list tbody td {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    width: 100% !important;
    padding: 10px 0 !important;
    position: static !important;
    background: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    white-space: normal !important;
  }

  #view-calendar-list tbody td:first-child {
    border-bottom: 2px solid #c2f50e !important;
    margin-bottom: 10px;
    padding-bottom: 15px !important;
    justify-content: flex-start !important;
  }

  #view-calendar-list tbody td:last-child {
    border-bottom: none !important;
  }

  #view-calendar-list tbody td:nth-child(2)::before {
    content: "Etki";
    color: #777;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
  }

  #view-calendar-list tbody td:nth-child(3)::before {
    content: "Beklenen";
    color: #777;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
  }

  #view-calendar-list tbody td:nth-child(4)::before {
    content: "Gerçekleşen";
    color: #777;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
  }

  #view-calendar-list tbody td:nth-child(5)::before {
    content: "Önceki";
    color: #777;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
  }

  #view-calendar-list tbody td:nth-child(6)::before {
    content: "Hatırlat";
    color: #777;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
  }
}

/* =========================================================
   FINAL STICKY FIX (TAKVİM + GÖSTERGELER) - DOKUNMA
   ========================================================= */

/* 1) Scroll artık wrapper'da olacak (parent scroll bug'ını bitirir) */
#view-calendar-list.active,
#view-indicators.active {
  /* ❗ display YOK: tab sistemi zaten active olunca display:flex yapıyor */
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
  /* ✅ parent scroll kapalı kalsın */
}


#view-calendar-list.active .wrap,
#view-indicators.active .wrap {
  flex: 1 !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}


/* ✅ Asıl scroll container */
#view-calendar-list .table-wrapper,
#view-indicators .table-wrapper {
  flex: 1 !important;
  min-height: 0 !important;
  overflow: auto !important;
  /* ✅ scroll burada */
  position: relative !important;
  background: #0b0b0b !important;

  /* ✅ Chrome sticky repaint bug azaltır */
  contain: paint !important;
  -webkit-overflow-scrolling: touch;
}

/* 2) Eski ::before "hack"lerini tamamen devre dışı bırak (çakışmayı bitirir) */
#view-calendar-list thead th::before,
#view-indicators thead th::before {
  content: none !important;
}

/* 3) Sticky header'ı tek ve opak hale getir */
#view-calendar-list thead th,
#view-indicators thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 2000 !important;

  /* ✅ Opak zemin */
  background-color: #1a1a1a !important;
  background-clip: padding-box !important;

  /* ✅ repaint/stacking iyileştirme */
  transform: translateZ(0) !important;
  will-change: transform !important;
  backface-visibility: hidden !important;

  /* satır sızıntısı olmasın */
  box-shadow: 0 1px 0 #1a1a1a !important;
}

/* Sol-üst header hücresi (hem top hem left sticky) */
#view-calendar-list thead th:first-child,
#view-indicators thead th:first-child {
  left: 0 !important;
  z-index: 2100 !important;
  text-align: left !important;
  box-shadow: 0 1px 0 #1a1a1a, 1px 0 0 #1a1a1a !important;
}

/* Sol sütun (tbody) sticky */
#view-calendar-list tbody td:first-child,
#view-indicators tbody td:first-child {
  position: sticky !important;
  left: 0 !important;
  z-index: 1500 !important;
  background: #0b0b0b !important;
}

/* =========================================
       ✅ GLOBAL BADGE & POPUP SYSTEM
       Tüm sayfalar için standart badge/popup
       ========================================= */

/* --- BADGE AREA (Container) --- */
.sc-badge-area,
.cl-badge-area {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  position: relative;
  z-index: 50;
  min-height: 40px;
}

/* --- BADGE (Temel) --- */
.sc-badge,
.cl-badge,
.ind-badge {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ddd;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
  position: relative;
  white-space: nowrap;
}

.sc-badge:hover,
.cl-badge:hover,
.ind-badge:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Borsa (BIST/NYSE) Badge */
.sc-badge.market-badge,
.cl-badge.market-badge {
  background: rgba(194, 245, 14, 0.1);
  border-color: rgba(194, 245, 14, 0.3);
  color: #c2f50e;
}

.sc-badge.market-badge:hover,
.cl-badge.market-badge:hover {
  background: rgba(194, 245, 14, 0.2);
  box-shadow: 0 4px 15px rgba(194, 245, 14, 0.15);
}

/* Seçili / Aktif Badge */
.sc-badge.active,
.cl-badge.active,
.ind-badge.active {
  background: rgba(194, 245, 14, 0.10);
  border-color: rgba(194, 245, 14, 0.35);
  color: #c2f50e;
}

.sc-badge.active:hover,
.cl-badge.active:hover,
.ind-badge.active:hover {
  background: rgba(194, 245, 14, 0.16);
  border-color: rgba(194, 245, 14, 0.45);
  color: #c2f50e;
}

/* Devre Dışı Badge */
.sc-badge.disabled,
.cl-badge.disabled {
  opacity: 0.4;
  pointer-events: none;
  filter: grayscale(1);
}

/* Sıfırla Butonu */
.sc-badge.reset-btn,
.cl-badge.reset-btn {
  background: rgba(255, 77, 77, 0.1);
  border-color: rgba(255, 77, 77, 0.3);
  color: #ff4d4d;
  margin-left: auto;
}

.sc-badge.reset-btn:hover,
.cl-badge.reset-btn:hover {
  background: rgba(255, 77, 77, 0.2);
}

/* Badge içindeki Kapatma (X) butonu */
.sc-badge-close {
  padding: 4px;
  margin-right: -6px;
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.5);
  transition: 0.2s;
}

.sc-badge-close:hover {
  background: rgba(255, 77, 77, 0.2);
  color: #ff4d4d;
}

/* --- POPUP (Ortak Stil: sc-sector-popup, cl-popup-menu, sc-market-popup, pf-sector-popup) --- */
.sc-sector-popup,
.cl-popup-menu,
.sc-market-popup,
.pf-sector-popup {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 260px;
  background: linear-gradient(to bottom, #141414, #0b0b0b);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.65);
  z-index: 10000;
  display: none;
  overflow: hidden;
}

/* Popup Başlık */
.sc-sector-head,
.pf-sector-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.sc-sector-title,
.pf-sector-title {
  font-weight: 900;
  font-size: 12px;
  color: #fff;
}

.sc-sector-actions,
.pf-sector-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sc-sector-clear,
.pf-sector-clear {
  font-size: 11px;
  font-weight: 800;
  color: #c2f50e;
  background: transparent;
  border: 0;
  cursor: pointer;
}

/* Popup Arama */
.cl-popup-search {
  padding: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cl-popup-input {
  width: 100%;
  background: #1a1a1a;
  border: 1px solid #333;
  color: #fff;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  outline: none;
}

/* Popup Liste */
.sc-sector-list,
.cl-popup-list,
.pf-sector-list {
  max-height: 280px;
  overflow-y: auto;
  padding: 8px;
}

/* Popup Item */
.sc-sector-item,
.cl-popup-item,
.pf-sector-item {
  padding: 10px;
  border-radius: 12px;
  cursor: pointer;
  color: #ddd;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.sc-sector-item:hover,
.cl-popup-item:hover,
.pf-sector-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.sc-sector-item.active,
.cl-popup-item.selected,
.pf-sector-item.active {
  background: rgba(194, 245, 14, 0.12);
  border-color: rgba(194, 245, 14, 0.35);
  color: #c2f50e;
}

/* --- COMPANIES LIST TOOLBAR (YENİ) --- */
#view-companies .top-controls {
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  z-index: 2000;
  background: #000;
  margin-bottom: 0;
}

.cl-control-bar {
  display: flex;
  gap: 15px;
  align-items: center;
}


/* Arama Kutusu */
.cl-search-wrap {
  position: relative;
  flex: 1;
  max-width: none;
  /* Kısıtlamayı kaldır */
}

.cl-search-input {
  width: 100%;
  background: #111;
  border: 1px solid #333;
  color: #fff;
  padding: 12px 10px 10px 36px;
  border-radius: 10px;
  font-size: 13px;
  outline: none;
  transition: 0.2s;
}

.cl-search-input:focus {
  border-color: #c2f50e;
  background: #161616;
}

.cl-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  font-size: 12px;
}

#view-companies .cl-search-input {
  height: 40px;
  padding: 0 10px 0 36px;
}

#view-companies .cl-badge {
  height: 40px;
  padding-top: 0;
  padding-bottom: 0;
}

/* cl-badge-area ek override (flex shrink) */
.cl-badge-area {
  flex: 0 0 auto;
}

/* Input number spinner gizle */
#clPopup_filter input[type=number]::-webkit-outer-spin-button,
#clPopup_filter input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* --- SECTORS TREE VIEW --- */
/* Seviye 1: Sektör (Ana Satır) */
tr.sec-row-level-1 td {
  background: #0b0b0b;
  font-weight: 700;
  border-bottom: 2px solid rgba(255, 255, 255, 0.08);
}

tr.sec-row-level-1:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Seviye 2: Alt Sektör (Industry) */
tr.sec-row-level-2 td {
  background: #111;
  color: #ddd;
}

tr.sec-row-level-2 td:first-child {
  padding-left: 40px !important;
  /* Girinti */
  position: sticky;
  left: 0;
  z-index: 110;
  background: #111;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

/* Seviye 3: Şirket */
tr.sec-row-level-3 td {
  background: #161616;
  color: #aaa;
  font-size: 12px;
}

tr.sec-row-level-3 td:first-child {
  padding-left: 70px !important;
  /* Daha fazla girinti */
  position: sticky;
  left: 0;
  z-index: 110;
  background: #161616;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

/* Caret İkonu */
.sec-caret {
  display: inline-block;
  width: 16px;
  text-align: center;
  margin-right: 8px;
  transition: transform 0.2s;
  cursor: pointer;
  color: #666;
}

.sec-caret:hover {
  color: #fff;
}

/* Açık Durumda Caret Dönüşü */
.sec-expanded .sec-caret {
  transform: rotate(90deg);
  color: #c2f50e;
}

/* Şirket Logosu */
.sec-comp-logo {
  width: 18px;
  height: 18px;
  object-fit: contain;
  background: #fff;
  border-radius: 4px;
  padding: 1px;
  margin-right: 8px;
  vertical-align: middle;
}

/* Mobil Uyum */
@media (max-width: 768px) {
  .cl-control-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .cl-search-wrap {
    max-width: 100%;
  }

  .cl-badge-area,
  .sc-badge-area {
    overflow-x: auto;
    padding-bottom: 5px;
  }
}

/* --- SECTORS TOOLBAR (TEK SATIR) --- */
.sec-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  position: sticky;
  /* Tablo kayarken üstte sabit kalsın */
  top: 0;
  z-index: 2000;
  background: #000;
}

/* Arama Kutuları */
.sec-search-box {
  flex: 1;
  /* Kalan alanı eşit paylaşsınlar */
  position: relative;
}

.sec-search-input {
  width: 100%;
  background: #111;
  border: 1px solid #333;
  color: #fff;
  padding: 10px 10px 10px 34px;
  border-radius: 10px;
  font-size: 13px;
  outline: none;
  font-weight: 600;
  transition: 0.2s;
}

.sec-search-input:focus {
  border-color: #c2f50e;
  background: #161616;
}

.sec-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  font-size: 12px;
}

/* Mobil Uyum: Mobilde alt alta geçsinler */
@media (max-width: 900px) {
  .sec-toolbar {
    flex-direction: column;
    align-items: stretch;
    position: static;
    /* Mobilde çok yer kaplamasın */
  }

  #secBadgeArea {
    justify-content: center;
    margin-bottom: 5px !important;
  }
}

/* ind-badge artık global badge sisteminde tanımlı */

/* ============================
   NEWS TAB (news.html) - SCROLL FIXED
============================ */

/* --- ANA VIEW SCROLL AYARI (KRİTİK DÜZELTME) --- */
#view-news {
  overflow-y: auto !important;
  /* Dikey scrollu zorla aç */
  -webkit-overflow-scrolling: touch;
  /* Mobilde akıcı kaydırma */
  height: 100% !important;
  /* Tam yükseklik */
  display: none;
  /* Pasifken gizle */
  background: #000;
}

#view-news.active {
  display: block !important;
  /* Aktifken göster (Flex yerine Block scroll için daha güvenli) */
}

#view-news .wrap {
  padding-bottom: 60px;
  /* En altta içerik kesilmesin diye boşluk */
  min-height: 101%;
  /* Scroll tetiklemek için minik pay */
}

/* --- Sentiment (Duygu Durumu) Etiketleri --- */
.tag-sentiment {
  font-weight: 800 !important;
  letter-spacing: 0.5px;
  border: 1px solid transparent;
}

.sentiment-olumlu {
  background-color: rgba(34, 197, 94, 0.15) !important;
  color: #4ade80 !important;
  border-color: rgba(34, 197, 94, 0.3) !important;
}

.sentiment-olumlu:hover {
  background-color: rgba(34, 197, 94, 0.25) !important;
}

.sentiment-olumsuz {
  background-color: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}

.sentiment-olumsuz:hover {
  background-color: rgba(239, 68, 68, 0.25) !important;
}

.sentiment-notr {
  background-color: rgba(148, 163, 184, 0.15) !important;
  color: #94a3b8 !important;
  border-color: rgba(148, 163, 184, 0.3) !important;
}

/* --- Container Ayarları --- */
#finapsis-news-widget {
  --finapsis-bg: #050505;
  --finapsis-card-bg: rgba(255, 255, 255, 0.03);
  --finapsis-border: rgba(255, 255, 255, 0.12);
  --finapsis-neon: #c2f50e;
  --finapsis-text-main: #ffffff;
  --finapsis-text-sub: rgba(255, 255, 255, 0.5);
  --finapsis-tag-bg: rgba(255, 255, 255, 0.05);
  --finapsis-tag-hover: rgba(194, 245, 14, 0.15);
  font-family: 'Inter', sans-serif;
  width: 100%;
  max-width: none;
  background: var(--finapsis-bg);
  padding: 0;
  border-radius: 0;
  border: none;
  box-sizing: border-box;
  position: relative;
  min-height: 500px;
  margin: 0;
}

/* --- Header & Search --- */
#finapsis-news-widget .widget-header {
  display: flex;
  align-items: center;
  gap: 15px;
}

#finapsis-news-widget .search-container {
  flex-grow: 1;
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  min-width: 0;
  border-radius: 12px;
  padding: 0 12px;
  height: 38px;
  transition: all 0.2s;
}

#finapsis-news-widget .search-container:focus-within {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--finapsis-neon);
  box-shadow: 0 0 0 2px rgba(194, 245, 14, 0.1);
}

#finapsis-news-widget #news-search-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-family: 'Inter';
  font-size: 13px;
  font-weight: 600;
  margin-left: 8px;
}

#finapsis-news-widget #news-search-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

/* --- Layout Grid --- */
#finapsis-news-widget .widget-layout {
  display: block;
}

/* Desktop Layout (>= 1200px) */
@media (min-width: 1200px) {
  #filter-modal-overlay {
    height: 100%;
    display: flex !important;
  }

  #filter-modal-overlay .modal-card {
    height: 100%;
    display: flex;
    flex-direction: column;
  }

  #filter-modal-overlay .modal-body {
    flex: 1;
    overflow-y: auto;
  }

  #finapsis-news-widget .widget-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 24px;
    align-items: start;
  }

  #finapsis-news-widget .mobile-filter-trigger {
    display: none !important;
    position: static;
    order: 2;
  }

  #finapsis-news-widget .modal-wrapper {
    display: block !important;
    position: sticky;
    top: 0;
    align-self: start;
    background: transparent !important;
    backdrop-filter: none !important;
    z-index: 1 !important;
    padding: 0 !important;
    height: auto !important;
  }

  #finapsis-news-widget .modal-card {
    width: 100% !important;
    max-width: none !important;
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid var(--finapsis-border) !important;
    box-shadow: none !important;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 120px);
    padding: 8px;
  }

  #finapsis-news-widget .modal-close {
    display: none !important;
  }

  #finapsis-news-widget .modal-footer {
    display: flex;
    gap: 8px;
    align-items: center;
    position: sticky;
    bottom: 0;
    background: rgba(8, 8, 8, 0.95);
    backdrop-filter: blur(6px);
  }
}

/* Mobile Layout (< 1200px) */
@media (max-width: 1199px) {
  #finapsis-news-widget .modal-wrapper {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    z-index: 10000;
    padding: 0;
  }

  #finapsis-news-widget .modal-card {
    max-height: calc(100vh - 80px);
    position: absolute;
    display: flex;
    max-width: 320px;
    flex-direction: column;
  }

  #finapsis-news-widget .modal-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* --- İkon Buton --- */
#finapsis-news-widget .icon-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  position: relative;
}

#finapsis-news-widget .icon-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--finapsis-neon);
  border-color: var(--finapsis-neon);
}

#finapsis-news-widget .filter-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 10px;
  height: 10px;
  background: var(--finapsis-neon);
  border-radius: 50%;
  border: 2px solid #000;
}

/* --- Pagination --- */
#finapsis-news-widget .page-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
}

#finapsis-news-widget .page-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--finapsis-neon);
  color: var(--finapsis-neon);
}

#finapsis-news-widget .page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  border-color: transparent;
}

/* --- Modal Elements --- */
#finapsis-news-widget .modal-header {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#finapsis-news-widget .modal-header h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.5px;
}

#finapsis-news-widget .modal-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
}

#finapsis-news-widget .modal-body {
  padding: 16px;
  overflow-y: auto;
}

#finapsis-news-widget .filter-group {
  margin-bottom: 20px;
}

#finapsis-news-widget .filter-group label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 4px;
}

#finapsis-news-widget .modal-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* --- Multi Select --- */
#finapsis-news-widget .ms-select {
  position: relative;
  width: 100%;
}

#finapsis-news-widget .ms-control {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 6px 8px;
}

#finapsis-news-widget .ms-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

#finapsis-news-widget .ms-placeholder {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
}

#finapsis-news-widget .ms-tag {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 10px;
  border-radius: 6px;
  padding: 4px 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#finapsis-news-widget .ms-tag-remove {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-size: 10px;
}

#finapsis-news-widget .ms-input {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  font-size: 10px;
  outline: none;
  width: 1px;
}

#finapsis-news-widget .ms-toggle {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-size: 12px;
}

#finapsis-news-widget .ms-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #0d0f11;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 8px;
  z-index: 20;
  max-height: 240px;
  overflow: hidden;
}

#finapsis-news-widget .ms-select.open .ms-dropdown {
  display: block;
}

#finapsis-news-widget .ms-search {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 6px 8px;
  color: #fff;
  font-size: 10px;
  margin-bottom: 8px;
  outline: none;
}

#finapsis-news-widget .ms-options {
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#finapsis-news-widget .ms-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  font-size: 10px;
  color: rgba(255, 255, 255, 0.9);
}

#finapsis-news-widget .ms-option:hover {
  background: rgba(255, 255, 255, 0.12);
}

#finapsis-news-widget .ms-option.selected {
  background: var(--finapsis-neon);
  color: #000;
  font-weight: 800;
}

#finapsis-news-widget .ms-check {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: transparent;
}

#finapsis-news-widget .ms-option.selected .ms-check {
  background: #000;
  border-color: #000;
}

#finapsis-news-widget .modal-chip {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.08);
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  user-select: none;
}

#finapsis-news-widget .modal-chip:hover {
  background: rgba(255, 255, 255, 0.15);
}

#finapsis-news-widget .modal-chip.selected {
  background: var(--finapsis-neon);
  color: #000;
  font-weight: 800;
  box-shadow: 0 0 8px rgba(194, 245, 14, 0.3);
}

#finapsis-news-widget .modal-footer {
  padding: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: auto;
}

#finapsis-news-widget #modal-apply-btn {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: none;
  background: #fff;
  color: #000;
  font-weight: 900;
  font-size: 11px;
  cursor: pointer;
}

#finapsis-news-widget #modal-apply-btn:hover {
  background: var(--finapsis-neon);
}

/* --- Share Modal --- */
#finapsis-news-widget .share-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#finapsis-news-widget .share-overlay[style*="display: block"] {
  display: flex !important;
}

#finapsis-news-widget .share-card {
  width: 100%;
  max-width: 320px;
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
}

#finapsis-news-widget .share-body {
  padding: 20px;
}

#finapsis-news-widget .share-preview-text {
  font-size: 12px;
  color: #ccc;
  margin-bottom: 20px;
  line-height: 1.4;
  background: rgba(255, 255, 255, 0.05);
  padding: 10px;
  border-radius: 8px;
  border-left: 3px solid var(--finapsis-neon);
}

#finapsis-news-widget .share-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

#finapsis-news-widget .share-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

#finapsis-news-widget .share-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

#finapsis-news-widget .share-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #000;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}

#finapsis-news-widget .share-item span {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
}

/* --- Haber Kart --- */
#finapsis-news-widget .news-card {
  display: flex;
  gap: 14px;
  padding: 14px;
  background: var(--finapsis-card-bg);
  border: 1px solid var(--finapsis-border);
  border-radius: 16px;
  transition: all 0.2s ease;
  position: relative;
}

#finapsis-news-widget .news-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.25);
}

#finapsis-news-widget .news-img-wrapper {
  flex-shrink: 0;
  width: 70px;
  height: 70px;
  border-radius: 10px;
  overflow: hidden;
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
}

#finapsis-news-widget .news-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
  transition: opacity 0.2s;
}

#finapsis-news-widget .news-card:hover .news-img {
  opacity: 1;
}

#finapsis-news-widget .fallback-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(194, 245, 14, 0.1) 0%, rgba(0, 0, 0, 1) 100%);
  color: var(--finapsis-neon);
  font-weight: 900;
  font-size: 20px;
}

#finapsis-news-widget .news-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

#finapsis-news-widget .news-meta-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

#finapsis-news-widget .news-source {
  font-size: 9px;
  font-weight: 800;
  color: var(--finapsis-neon);
  text-transform: uppercase;
  background: rgba(194, 245, 14, 0.1);
  padding: 2px 5px;
  border-radius: 4px;
}

#finapsis-news-widget .news-time {
  font-size: 9px;
  font-weight: 500;
  color: var(--finapsis-text-sub);
}

#finapsis-news-widget .news-share-btn {
  margin-left: auto;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  padding: 2px;
  transition: color 0.2s;
  display: flex;
  align-items: center;
}

#finapsis-news-widget .news-share-btn:hover {
  color: #fff;
}

#finapsis-news-widget .news-title-link {
  text-decoration: none;
  color: var(--finapsis-text-main);
  display: block;
}

#finapsis-news-widget .news-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 6px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s;
}

#finapsis-news-widget .news-title-link:hover .news-title {
  color: var(--finapsis-neon);
}

#finapsis-news-widget .news-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
}

#finapsis-news-widget .clickable-tag {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  background: var(--finapsis-tag-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  user-select: none;
}

#finapsis-news-widget .clickable-tag:hover {
  color: #fff;
  background: var(--finapsis-tag-hover);
  border-color: var(--finapsis-neon);
}

/* Active Filter Chips */
#finapsis-news-widget .filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(194, 245, 14, 0.15);
  border: 1px solid rgba(194, 245, 14, 0.3);
  color: #fff;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
}

#finapsis-news-widget .filter-chip-remove {
  cursor: pointer;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 50%;
  font-size: 9px;
  color: var(--finapsis-neon);
  transition: background 0.2s;
}

#finapsis-news-widget .filter-chip-remove:hover {
  background: #000;
}

@media (max-width: 600px) {
  #finapsis-news-widget .widget-header {
    flex-wrap: nowrap;
    position: relative;
  }

  #finapsis-news-widget .search-container {
    flex: 1;
    width: auto;
    min-width: 0;
    order: 1;
  }

  #finapsis-news-widget .mobile-filter-trigger {
    position: static;
    order: 2;
  }
}
