:root {
  --primary-color: #00BFFF;
  --primary-gradient: linear-gradient(90deg, #00BFFF, #87CEFA);
  --bg-color: #F0F7FF;
  --sidebar-bg: #ffffff;
  --sidebar-color: #333;
  --hover-color: #00BFFF;
  --text-color: #333;
  --card-bg: #ffffff;
  --small-font: 0.9rem;
  --table-positive: #D4EDDA;
  --table-negative: #F8D7DA;
}

/* Reset */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', sans-serif; }
html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-color);
  background-color: var(--bg-color);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Layout */
body {
  display: flex;
  min-height: 100vh;
  background-color: var(--bg-color);
  color: var(--text-color);
}

.container, .container-fluid {
    margin: 0;
    padding: 0;
}
/* Sidebar */
.sidebar {
  width: 220px;
  background-color: var(--sidebar-bg);
  color: var(--sidebar-color);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 1rem !important;
  margin: 0 !important;
  transition: transform 0.28s ease;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: rgba(0,191,255,0.4) rgba(0,0,0,0.05); /* thumb e track */
}
/* Chrome, Edge, Safari */
.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent; /* invisibile o soft */
}

.sidebar::-webkit-scrollbar-thumb {
  background-color: rgba(0,191,255,0.4);
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0,191,255,0.7);
}

.sidebar nav, 
.sidebar ul {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}
.sidebar h2 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  text-align: center;
  color: var(--primary-color);
}
.menu-item { list-style: none; margin-bottom: 0.5rem; }
.menu-link {
  display: flex; justify-content: space-between; align-items: center;
  text-decoration: none; color: inherit; padding: 0.5rem;
  border-radius: 5px; font-size: var(--small-font);
  transition: background 0.2s, color 0.2s;
}
.menu-link:hover { background-color: var(--hover-color); color: #fff; }
/* Link selezionato nel menu */
.menu-link.active-link {
  background-color: var(--primary-color);
  color: #fff;
  font-weight: 600;
  border-left: 4px solid #007ACC;
  padding-left: 0.5rem;
}
.submenu { list-style: none; padding-left: 1rem; display: none; font-size: var(--small-font); }
.menu-item.open > .submenu { display: block; }
/* Submenu base */
.submenu {
  list-style: none;
  padding-left: 1.2rem;
  margin-top: 0.3rem;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
  border-left: 2px solid rgba(0,191,255,0.2);
}

.menu-item.open > .submenu {
  max-height: 500px; /* per effetto animato */
}

/* Link nel submenu */
.submenu .menu-link {
  font-size: var(--small-font);
  padding: 0.45rem 0.75rem;
  color: #444;
  border-radius: 5px;
  display: block;
  transition: all 0.2s ease;
}

/* Hover elegante */
.submenu .menu-link:hover {
  background-color: rgba(0,191,255,0.12);
  color: var(--primary-color);
  transform: translateX(4px);
}

/* Link attivo / selezionato */
.submenu .menu-link.active {
  background-color: rgba(0,191,255,0.2);
  color: var(--primary-color);
  font-weight: 600;
  border-left: 3px solid var(--primary-color);
  transform: translateX(3px);
}

/* Link principale quando submenu è aperto */
.menu-item.open > .menu-link {
  background: linear-gradient(90deg, rgba(0,191,255,0.15), rgba(135,206,250,0.15));
  color: var(--primary-color);
  font-weight: 600;
  border-left: 4px solid var(--primary-color);
  border-radius: 6px;
}

/* Freccia animata */
.menu-item.open > .menu-link .arrow {
  transform: rotate(90deg);
  color: var(--primary-color);
  transition: transform 0.3s ease, color 0.3s ease;
}
/* Header */
.header {
  height: 50px;
  background: var(--primary-gradient);
  border-radius: 5px;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  color: #fff;
  width: 100%;
}

.header .actions {
    margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Link base */
.header .actions a {
  position: relative;
  text-decoration: none;
  color: #fff;
  font-weight: 500;
  padding: 0.3rem 0;
  transition: color 0.3s ease;
}

/* Effetto hover con linea animata */
.header .actions a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0%;
  height: 2px;
  background-color: #fff;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.header .actions a:hover::after {
  width: 100%;
}

/* Hover colore più chiaro */
.header .actions a:hover {
  color: #e0f7ff;
}

/* Stato attivo o pagina corrente */
.header .actions a.active {
  color: #fff;
  font-weight: 600;
}

.header .actions a.active::after {
  width: 100%;
  background-color: #fff;
}

/* Hamburger button */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #fff;
  cursor: pointer;
  margin-right: 0.5rem;
  padding: 0.25rem 0.5rem;
}

/* Main content */
.main { flex: 1; padding: 1rem; min-width: 0; }
.card {
  all: unset;
  display: block;
  background-color: var(--card-bg);
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  margin-bottom: 1rem;
  color: var(--text-color);
  font-family: 'Inter', sans-serif;
}

.card-section-title {
    font-weight:600;
    margin-bottom:1rem;
    color:#444;
}

/* Tables */
.table-positive { background-color: var(--table-positive); }
.table-negative { background-color: var(--table-negative); }
.arrow { font-size: 0.7rem; transition: transform 0.2s; }
.menu-item.open > .menu-link .arrow { transform: rotate(90deg); }

/* Overlay for mobile */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 900;
  opacity: 0;
  transition: opacity 0.28s ease;
}

/* Desktop behavior */
@media (min-width: 769px) {
  .sidebar { position: relative; transform: translateX(0); }
  .overlay { display: none !important; }
}

/* Mobile behavior */
@media (max-width: 768px) {
  body { flex-direction: column; }

  /* hide sidebar by default (off-canvas) */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    min-height: auto;
    height: 100vh;
    transform: translateX(-100%);
    z-index: 1000;
    box-shadow: 2px 0 8px rgba(0,0,0,0.18);
  }
  .sidebar.active { transform: translateX(0); }
  .sidebar::-webkit-scrollbar {
    width: 2px;
  }
  .sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(0,191,255,0.3);
  }

  .menu-toggle { display: block; }

  /* overlay visible when active via class on body */
  .overlay { display: block; pointer-events: none; }
  .overlay.visible { pointer-events: auto; opacity: 1; }
  
  /* Make header items align */
  .header { justify-content: flex-start; gap: 0.5rem; }
  .header .actions { margin-left: auto; }
}

/* Prevent body scroll when sidebar open (class added by JS) */
.body-no-scroll { overflow: hidden; }




/* Sidebar destra */
.doc-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1050;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Chrome, Edge, Safari */
.doc-sidebar::-webkit-scrollbar {
  width: 4px;
}

.doc-sidebar::-webkit-scrollbar-track {
  background: transparent; /* invisibile o soft */
}

.doc-sidebar::-webkit-scrollbar-thumb {
  background-color: rgba(0,191,255,0.4);
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.doc-sidebar::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0,191,255,0.7);
}

.doc-overlay.active {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

.doc-sidebar {
  position: fixed;
  top: 0;
  right: -100%;
  height: 100%;
  max-width: 500px;
  width: 80%;
  background-color: var(--sidebar-bg);
  color: var(--sidebar-color);
  z-index: 1100;
  padding: 1rem;
  box-shadow: -2px 0 8px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,191,255,0.4) rgba(0,0,0,0.05);
}

@media (max-width: 768px) {
    .doc-sidebar { width: 80%; }
    .doc-sidebar::-webkit-scrollbar { width: 2px; }
    .doc-sidebar::-webkit-scrollbar-thumb { background-color: rgba(0,191,255,0.3); }
}
@media(min-width: 769px) and (max-width: 1200px) {
    .doc-sidebar { width: 60%; }
}
@media(min-width: 1201px) {
    .doc-sidebar { width: 50%; }
}

.doc-sidebar.active { right: 0; }

.doc-sidebar .close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--primary-color);
  cursor: pointer;
  align-self: flex-start;
}

.doc-sidebar h2 {
  color: var(--primary-color);
  text-align: center;
  margin-bottom: 1rem;
}

.doc-sidebar h3 {
  color: var(--primary-color);
  text-align: center;
  margin-bottom: 1rem;
}








.modal-dialog.modal-dialog-top {
    margin: 1.5rem auto 0 auto;
    max-width: 90%;
}

.modal-content {
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    background-color: var(--card-bg);
    color: var(--text-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.modal-header {
    border-bottom: 1px solid rgba(0,0,0,0.1);
    background: var(--primary-gradient);
    color: #fff;
    align-items: center;
}

.modal-header .modal-title {
    color: #fff;
    font-weight: 600;
}

.modal-header .btn-close {
    filter: invert(1);
}

.modal-footer {
    border-top: 1px solid rgba(0,0,0,0.1);
}

.modal-footer .btn-primary {
    background-color: var(--primary-color);
    border: none;
}

.modal-footer .btn-primary:hover {
    background-color: #0099e6;
}

.modal-footer .btn-secondary {
    background-color: #f0f0f0;
    color: #333;
}

.modal-footer .btn-secondary:hover {
    background-color: #e0e0e0;
}

@media (max-width: 768px) {
    .modal-dialog.modal-dialog-top {
        max-width: clamp(300px, 95%, 600px);
        margin-top: 1rem;
    }
}
@media (min-width: 769px) and (max-width: 1200px) {
    .modal-dialog.modal-dialog-top {
        max-width: clamp(400px, 90%, 600px);
    }
}
@media (min-width: 1201px) {
    .modal-dialog.modal-dialog-top {
        max-width: clamp(400px, 70%, 600px);
    }
}


.dropdown-item-selectable:hover {
    background-color: rgba(13, 110, 253, 0.08);
  }

  .dropdown-item-selectable.active-row {
    background-color: rgba(13, 110, 253, 0.15);
    font-weight: 600;
  }

  .dropdown-item-selectable img {
    object-fit: contain;
  }

  .check-icon {
    font-size: 1rem;
  }
  
  /* Chrome, Edge, Safari */
.custom-scroll::-webkit-scrollbar {
  width: 2px;
}

.custom-scroll::-webkit-scrollbar-track {
  background: transparent; /* invisibile o soft */
}

.custom-scroll::-webkit-scrollbar-thumb {
  background-color: rgba(0,191,255,0.4);
  border-radius: 2px;
  transition: background-color 0.3s ease;
}

.custom-scroll::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0,191,255,0.7);
}

.custom-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(0,191,255,0.4) rgba(0,0,0,0.05);
}

@media (max-width: 768px) {
    .custom-scroll::-webkit-scrollbar { width: 2px; }
    .custom-scroll::-webkit-scrollbar-thumb { background-color: rgba(0,191,255,0.3); }
}

@media (max-width: 768px) {
  .dropdown-menu  {
    font-size: 0.85rem;
  }
}


#fundingTable th, #fundingTable td {
    text-align: center !important;
    vertical-align: middle !important;
}

/* Scroll X se la tabella � pi� larga del contenitore */
.table-responsive {
    overflow-x: auto;
}

/* Mantieni larghezza minima per le colonne simbolo e max spread */
#fundingTable th:first-child,
#fundingTable td:first-child {
    min-width: 100px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    vertical-align: middle;
}
#fundingTable th:nth-child(2),
#fundingTable td:nth-child(2) {
    min-width: 80px;
}
#fundingTable_wrapper .dataTables_paginate {
    display: flex !important;
    justify-content: flex-start !important;
    margin-top: 10px; /* opzionale */
}

.symbol-icon {
    position: relative;
    width: 20px;
    height: 20px;
    display: inline-block;
}
.symbol-icon .base {
    width: 20px;
    height: 20px;
    position: absolute;
    top: 0;
    left: 0;
}
.symbol-icon .quote {
    width: 10px;
    height: 10px;
    position: absolute;
    bottom: 0;
    right: 0;
}


.auth-wrapper {
  min-height: 50vh;
  display:flex;
  justify-content:center;
  align-items:center;
  padding:2rem;
}

.profile-card {
  flex:1;
  min-width:300px;
  background:var(--card-bg);
  border-radius:12px;
  padding:1rem;
  box-shadow:0 6px 20px rgba(0,0,0,0.08);
}

.card-row {
  display:flex;
  gap:0.5rem;
  margin-bottom:1rem;
}

.card-row button {
  flex:1;
}

.auth-card-lg {
  width:100%;
  max-width:900px;
  display:flex;
  background:var(--card-bg);
  border-radius:18px;
  overflow:hidden;
  box-shadow:0 12px 40px rgba(0,0,0,0.10);
}

.auth-left {
  flex:1;
  padding:2.2rem;
}

.auth-right {
  flex:1;
  background:linear-gradient(135deg, #007bff 0%, #00bfff 100%);
  padding:2rem;
  display:flex;
  justify-content:center;
  align-items:center;
}

.auth-right img {
  width:70%;
  max-width:300px;
  opacity:0.95;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.25));
}

.brand {
  font-weight:700;
  font-size:1.4rem;
  color:var(--primary-color);
}

.auth-left .text-muted {
  color:#6f7a85 !important;
}

.form-floating .form-control:focus {
  box-shadow: 0 0 0 0.125rem rgba(0,191,255,0.25);
  border-color:var(--primary-color);
}

.btn-primary {
  background:var(--primary-gradient);
  border:none;
}

.btn-secondary {
  background:#6f7a85;
  border:none;
  color:#fff;
}

.btn-danger {
  background:#dc3545;
  border:none;
}
@media (max-width: 991.98px) {
    .btn-text { display: none; }
}
@media (min-width: 992px) {
    .btn-text { display: inline; }
}
.form-grid { gap:1rem; }
.form-note { font-size:0.9rem; color:#6c757d; }


/* Responsive */
@media (max-width: 768px) {
  .auth-card-lg {
    flex-direction:column;
  }
  .auth-right {
    padding:1.5rem 1rem;
  }
  .auth-right img {
    width:45%;
  }
}


/* SLIDER */
.range-wrap {
  position: relative;
  width: 100%;
  padding: 1.5em 0;
  max-width: 400px;
}

.range-wrap::before {
  content: "";
  background: linear-gradient(to right, #0145b8, #00e5e0, #00f25e);
  width: 100%;
  height: 8px;
  display: block;
  position: absolute;
  border-radius: 4px;
  top: 50%;
  transform: translateY(-50%);
  transition: height 100ms ease;
}

.range-wrap:hover::before {
  height: 10px;
}

.range {
  width: 100%;
  cursor: pointer;
  opacity: 0;
}

.bubble {
  background: white;
  border: 3px solid #cbd2da;
  position: absolute;
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: transparent;
  display: grid;
  place-items: center;
  font-weight: bold;
  transition: color 100ms ease, transform 100ms ease;
  user-select: none;
}

.range-wrap:hover .bubble,
.range-wrap:focus .bubble {
  color: black;
  transform: translateY(-50%) scale(1.5);
  padding: 0.1em;
}

/* SCROLl TABS */
.card-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.card-tabs::-webkit-scrollbar {
    display: none;
}

.card-tabs .nav-item {
    flex: 0 0 auto;
}

/* VOTING STARS */
.star {
    cursor: pointer;
    transition: color 0.2s;
    font-size: 1rem;
}

.star-hover {
    color: orange !important;
}

.nowrap-cell {
    white-space: nowrap;
}

/* Stile per carousel */
.carousel .carousel-control-prev,
.carousel .carousel-control-next {
    width: 50px;
    height: 50px;
    background-color: rgba(0, 0, 0, 0.5) !important;
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.9;
    transition: all 0.3s ease;
    border: 2px solid white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.carousel .carousel-control-prev {
    left: -15px;
}

.carousel .carousel-control-next {
    right: -15px;
}

.carousel .carousel-control-prev:hover,
.carousel .carousel-control-next:hover {
    background-color: rgba(0, 0, 0, 0.7) !important;
    opacity: 1;
    transform: translateY(-50%);
}

.carousel .carousel-control-prev-icon,
.carousel .carousel-control-next-icon {
    background-size: 70%;
    filter: brightness(0) invert(1);
}

.carousel .carousel-indicators {
    bottom: -20px;
    margin-bottom: 0;
}

.carousel .carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 8px;
    background-color: rgba(0, 0, 0, 0.5);
    border: 2px solid transparent;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.carousel .carousel-indicators button.active {
    background-color: rgba(0, 0, 0, 0.7);
    border: 1px solid #000;
    opacity: 1;
}

.carousel .carousel-indicators button:not(.active):hover {
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 1;
}

@media (max-width: 768px) {
    .carousel .carousel-control-prev {
        left: 10px;
    }

    .carousel .carousel-control-next {
        right: 10px;
    }

    .carousel .carousel-control-prev,
    .carousel .carousel-control-next {
        width: 40px;
        height: 40px;
    }

    .carousel .carousel-indicators {
        bottom: -40px;
    }
}

/* DEBUG - Forza la visibilità */
.carousel-control-prev,
.carousel-control-next {
    background-color: red !important; /* Per debug */
    opacity: 1 !important;
    z-index: 9999 !important;
}


.carousel-indicators {
    z-index: 100;
}