/* ── SynaPro — dark theme ────────────────────────────────────── */

/* ── Variables ── */
:root {
  --bg:         #050b17;
  --bg2:        #060d1b;
  --bg3:        #0e1628;
  --border:     #1a2540;

  --purple:     #a78bfa;
  --cyan:       #22d3ee;
  --accent:     linear-gradient(135deg, #7c3aed, #22d3ee);

  --green:      #4ade80;
  --red:        #f87171;
  --amber:      #fbbf24;

  --text:       #f1f5f9;
  --text2:      #94a3b8;
  --text3:      #64748b;
  --text-muted: #64748b;

  --purple-bg:  #19173f;
  --purple-bd:  #4c3a9e;
  --green-bg:   #052e16;
  --green-bd:   #166534;
  --red-bg:     #2d0d0d;
  --red-bd:     #7f1d1d;

  --radius:    8px;
  --radius-lg: 12px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
               "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

a       { color: var(--purple); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── App layout ── */
.app-shell  { display: flex; height: 100vh; overflow: hidden; }
.sidebar    { width: 210px; flex-shrink: 0; background: var(--bg2);
              border-right: 1px solid var(--border);
              display: flex; flex-direction: column;
              height: 100vh; overflow-y: auto; overflow-x: hidden; }
.main-area  { flex: 1; min-width: 0; display: flex; flex-direction: column;
              height: 100vh; overflow: hidden; }
.topbar     { background: var(--bg2); border-bottom: 1px solid var(--border);
              padding: 11px 24px; display: flex; align-items: center;
              justify-content: space-between; gap: 12px; flex-shrink: 0; }
.content    { padding: 24px; flex: 1; overflow-y: auto; }

/* ── Sidebar logo ── */
.sidebar-logo      { padding: 16px; border-bottom: 1px solid var(--border); }
.sidebar-logo-link { display: flex; flex-direction: row; align-items: center;
                     gap: 10px; text-decoration: none; }
.sidebar-logo-img  { height: 38px; width: auto; flex-shrink: 0;
                     filter: drop-shadow(0 0 10px rgba(167,139,250,0.45)); }
.sidebar-brand     { font-size: 18px; font-weight: 800; color: #fff;
                     letter-spacing: -0.3px; line-height: 1; }
.sidebar-brand .highlight {
  background: linear-gradient(135deg, #a78bfa, #22d3ee);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* ── Sidebar nav ── */
.sidebar-nav     { flex: 1; padding: 8px 0; }
.sidebar-section { font-size: 10px; color: var(--text3); padding: 14px 16px 4px;
                   text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.sidebar-item    { display: flex; align-items: center; gap: 10px;
                   padding: 8px 16px; font-size: 13px; color: var(--text2);
                   cursor: pointer; text-decoration: none; transition: all .15s;
                   border-left: 3px solid transparent; }
.sidebar-item:hover  { background: rgba(167,139,250,0.06); color: var(--text);
                       text-decoration: none; border-left-color: var(--border); }
.sidebar-item.active { background: rgba(167,139,250,0.12); color: var(--purple);
                       border-left-color: var(--purple); font-weight: 500; }
.sidebar-item svg    { flex-shrink: 0; opacity: .7; }
.sidebar-item.active svg { opacity: 1; }

/* ── Sidebar footer ── */
.sidebar-footer    { padding: 10px 12px 14px; border-top: 1px solid var(--border); }
.sidebar-made-with { font-size: 10px; color: var(--text3); text-align: center;
                     margin-bottom: 10px; }
.user-card  { display: flex; align-items: center; gap: 10px;
              padding: 10px; background: var(--bg3);
              border-radius: var(--radius); border: 1px solid var(--border); }
.user-info  { min-width: 0; }
.avatar     { width: 34px; height: 34px; border-radius: 50%;
              background: linear-gradient(135deg, var(--purple-bg), #1e1065);
              border: 1.5px solid var(--purple-bd);
              display: flex; align-items: center; justify-content: center;
              font-size: 12px; color: var(--purple); font-weight: 700; flex-shrink: 0; }
.user-name  { font-size: 12px; font-weight: 600; color: var(--text);
              white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role  { font-size: 10px; color: var(--text3); }

/* ── Topbar ── */
.topbar-title { font-size: 15px; font-weight: 600; color: var(--text); }
.topbar-left  { display: flex; align-items: center; gap: 8px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.breadcrumb   { font-size: 13px; color: var(--text3); }
.breadcrumb a { color: var(--text3); transition: color .15s; }
.breadcrumb a:hover { color: var(--text2); text-decoration: none; }
.sep          { color: var(--border); font-size: 16px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--bg3); border: 0.5px solid var(--border);
  color: var(--text); padding: 5px 14px; border-radius: var(--radius);
  cursor: pointer; font-size: 12px; font-family: inherit;
  text-decoration: none; transition: background .15s;
}
.btn:hover         { background: var(--border); text-decoration: none; }
.btn-primary       { background: linear-gradient(135deg, #a78bfa 0%, #22d3ee 100%);
                     border: none; color: #0b0e14; font-weight: 700;
                     box-shadow: 0 4px 15px rgba(34,211,238,0.2); }
.btn-primary:hover { filter: brightness(1.1);
                     box-shadow: 0 6px 20px rgba(34,211,238,0.4);
                     transform: translateY(-1px); }
.btn-danger        { color: var(--red); border-color: var(--red-bd); }
.btn-danger:hover  { background: var(--red-bg); }
.btn-sm            { padding: 3px 10px; font-size: 11px; }

/* ── Cards ── */
.card        { background: var(--bg2); border: 1px solid var(--border);
               border-radius: var(--radius-lg); padding: 16px; }
.card + .card { margin-top: 10px; }
.card-title  { font-size: 11px; color: var(--text3); font-weight: 500;
               text-transform: uppercase; letter-spacing: .04em; margin-bottom: 12px; }

/* ── Stat boxes ── */
.stat-grid   { display: grid; gap: 12px; margin-bottom: 20px; }
.stat-grid-4 { grid-template-columns: repeat(4, 1fr); }
.stat-grid-5 { grid-template-columns: repeat(5, 1fr); }
.stat-box    { background: var(--bg2); border: 1px solid var(--border);
               border-radius: var(--radius-lg); padding: 16px 18px;
               position: relative; overflow: hidden; }
.stat-box::before { content: ""; position: absolute; inset: 0;
                    background: linear-gradient(135deg, rgba(167,139,250,0.04), transparent);
                    pointer-events: none; }
.stat-label  { font-size: 11px; color: var(--text3); margin-bottom: 6px;
               text-transform: uppercase; letter-spacing: .05em; font-weight: 500; }
.stat-value  { font-size: 26px; font-weight: 700; line-height: 1.1; letter-spacing: -0.5px; }
.stat-sub    { font-size: 11px; color: var(--text3); margin-top: 4px; }
.stat-sparkline { position: absolute; bottom: 0; right: 0; width: 80px; height: 40px; opacity: 0.45; }
.green { color: var(--green); }
.red   { color: var(--red); }
.amber { color: var(--amber); }

/* ── Badges ── */
.badge         { display: inline-block; padding: 2px 9px; border-radius: 20px;
                 font-size: 11px; font-weight: 500; }
.badge-win     { background: rgba(34,211,238,0.1); color: var(--cyan);
                 border: 1px solid rgba(34,211,238,0.3); }
.badge-loss    { background: rgba(248,113,113,0.1); color: var(--red);
                 border: 1px solid rgba(248,113,113,0.3); }
.badge-be      { background: #1c1917; color: #a8a29e; border: 0.5px solid #44403c; }
.badge-shared  { background: var(--green-bg); color: var(--green);
                 border: 0.5px solid var(--green-bd); }
.badge-private { background: var(--bg3); color: var(--text3);
                 border: 0.5px solid var(--border); }
.badge-admin   { background: var(--purple-bg); color: var(--purple);
                 border: 0.5px solid var(--purple-bd); }

/* ── Pills ── */
.pill        { display: inline-flex; align-items: center; background: var(--bg3);
               border: 0.5px solid var(--border); border-radius: 5px;
               padding: 2px 8px; font-size: 11px; color: var(--text2); }
.pill-purple { background: var(--purple-bg); border-color: var(--purple-bd); color: var(--purple); }
.pill-green  { background: var(--green-bg);  border-color: var(--green-bd);  color: var(--green); }
.pill-red    { background: var(--red-bg);    border-color: var(--red-bd);    color: var(--red); }

/* ── Forms ── */
.form-group   { margin-bottom: 12px; }
.form-label   { display: block; font-size: 11px; color: var(--text3); margin-bottom: 4px; }
.form-control {
  width: 100%; background: rgba(15,17,23,0.8);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 7px 10px; color: var(--text);
  font-size: 13px; font-family: inherit; transition: all 0.25s ease;
}
.form-control:focus   { outline: none; border-color: var(--purple);
                        box-shadow: 0 0 0 3px rgba(167,139,250,0.2);
                        background: rgba(15,17,23,1); }
select.form-control   { color: var(--text2); }
textarea.form-control { resize: vertical; min-height: 70px; }

/* ── Radio / YN buttons ── */
.radio-group { display: flex; gap: 4px; flex-wrap: wrap; }
.radio-opt, .yn-btn {
  background: var(--bg); border: 0.5px solid var(--border);
  border-radius: 5px; padding: 3px 11px; font-size: 12px;
  cursor: pointer; color: var(--text3); transition: all .15s; user-select: none;
}
.radio-opt:hover, .yn-btn:hover { border-color: var(--purple-bd); color: var(--text); }
.radio-opt.active    { background: var(--purple-bg); border-color: var(--purple-bd); color: var(--purple); }
.yn-btn.yes          { background: rgba(34,211,238,0.1); color: var(--cyan);
                       border: 1px solid rgba(34,211,238,0.3); }
.yn-btn.no           { background: rgba(248,113,113,0.1); color: var(--red);
                       border: 1px solid rgba(248,113,113,0.3); }
.yn-btn.long-active,  .btn.long-active  { background: var(--green-bg);
                                          border-color: var(--green-bd); color: var(--green); }
.yn-btn.short-active, .btn.short-active { background: var(--red-bg);
                                          border-color: var(--red-bd);  color: var(--red); }

/* ── Trade table ── */
.trade-table      { width: 100%; border-collapse: collapse; }
.trade-table th   { font-size: 11px; color: var(--text3); font-weight: 600;
                    padding: 8px 10px; border-bottom: 1px solid var(--border);
                    text-align: left; text-transform: uppercase; letter-spacing: .04em; }
.trade-table td   { padding: 11px 10px; border-bottom: 1px solid var(--bg3);
                    font-size: 13px; vertical-align: middle; }
.trade-table tbody tr:hover td { background: rgba(167,139,250,0.04); }
.trade-table tr:last-child td  { border-bottom: none; }
.trade-table a    { color: var(--text); text-decoration: none; }

/* ── Field row (dettaglio trade) ── */
.field-row          { display: flex; justify-content: space-between; align-items: center;
                      padding: 5px 0; border-bottom: 0.5px solid var(--bg3); font-size: 12px; }
.field-row:last-child { border-bottom: none; }
.field-key          { color: var(--text3); }
.field-val          { color: var(--text); font-weight: 500; }
.field-val.ok       { color: var(--green); }
.field-val.no       { color: var(--text3); }

/* ── Screenshot area ── */
.screenshot-tabs  { display: flex; gap: 2px; background: var(--bg);
                    border-radius: var(--radius); padding: 3px; margin-bottom: 10px; }
.scr-tab          { padding: 5px 12px; border-radius: 5px; cursor: pointer;
                    font-size: 12px; color: var(--text3); transition: all .15s; }
.scr-tab.active   { background: var(--bg3); color: var(--text); }
.screenshot-frame { background: var(--bg3); border: 0.5px solid var(--border);
                    border-radius: var(--radius); min-height: 200px;
                    display: flex; align-items: center; justify-content: center; }
.screenshot-frame img { max-width: 100%; border-radius: var(--radius); display: block; }
.drop-zone        { border: 0.5px dashed var(--border); border-radius: var(--radius);
                    padding: 14px; text-align: center; cursor: pointer;
                    color: var(--text3); font-size: 12px; transition: border-color .15s; }
.drop-zone:hover  { border-color: var(--purple-bd); color: var(--text2); }
.drop-zone.loaded { border-color: var(--green-bd); border-style: solid; }
.url-row          { display: flex; gap: 6px; margin-top: 6px; }
.url-row .form-control { flex: 1; }

/* ── Insight ── */
.insight        { background: var(--bg3); border-radius: var(--radius); padding: 10px 14px;
                  margin-bottom: 6px; border-left: 2px solid var(--purple); }
.insight.warn   { border-left-color: var(--amber); }
.insight.danger { border-left-color: var(--red); }
.insight-label  { font-size: 11px; color: var(--purple); margin-bottom: 2px; }
.insight.warn   .insight-label { color: var(--amber); }
.insight.danger .insight-label { color: var(--red); }
.insight-val    { font-size: 13px; color: var(--text); }

/* ── Flash messages ── */
.flash-list           { list-style: none; padding: 0 20px; margin-top: 10px; }
.flash-item           { padding: 8px 14px; border-radius: var(--radius);
                        margin-bottom: 6px; font-size: 13px; border: 0.5px solid; }
.flash-item.success   { background: var(--green-bg); color: var(--green); border-color: var(--green-bd); }
.flash-item.danger    { background: var(--red-bg);   color: var(--red);   border-color: var(--red-bd); }
.flash-item.info      { background: var(--bg3); color: var(--text2); border-color: var(--border); }
.flash-item.warning   { background: #1c1507; color: var(--amber); border-color: #78350f; }
.flash-list-container { margin-bottom: 12px; }

/* ── Utilities ── */
.grid-2     { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3     { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.mt-10      { margin-top: 10px; }
.mt-16      { margin-top: 16px; }
.mb-10      { margin-bottom: 10px; }
.divider    { border: none; border-top: 0.5px solid var(--border); margin: 12px 0; }
.text-muted { color: var(--text3); }
.text-sm    { font-size: 12px; }
.w-100      { width: 100%; }
.tag-list   { display: flex; flex-wrap: wrap; gap: 5px; }

/* ── Rich text output (Quill) ── */
.squad-rich-text ul,
.squad-rich-text ol { padding-left: 1.4em; }
.squad-rich-text li { margin-bottom: 2px; }


/* ── Charts (Chart.js) ── */
.chart-wrap        { position: relative; }
.chart-legend      { display: flex; gap: 16px; margin-top: 10px; flex-wrap: wrap; }
.chart-legend-item { display: flex; align-items: center; gap: 6px;
                     font-size: 12px; color: var(--text2); }
.chart-legend-dot  { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ── Donut chart container ── */
.donut-wrap   { display: flex; align-items: center; gap: 24px; }
.donut-canvas { width: 120px !important; height: 120px !important; flex-shrink: 0; }
.donut-legend { display: flex; flex-direction: column; gap: 8px; }
.donut-row    { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.donut-dot    { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.donut-label  { color: var(--text3); min-width: 36px; }
.donut-val    { color: var(--text); font-weight: 600; }
.donut-pct    { color: var(--text3); font-size: 11px; }

/* ── Performance chart ── */
.perf-chart-wrap { height: 200px; position: relative; }

/* ════════════════════════════════════════════════════════════════
   SCROLLBAR — global custom style (webkit + firefox)
   ════════════════════════════════════════════════════════════════ */
::-webkit-scrollbar               { width: 5px; height: 5px; }
::-webkit-scrollbar-track         { background: transparent; }
::-webkit-scrollbar-thumb         { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover   { background: var(--purple-bd); }
::-webkit-scrollbar-corner        { background: transparent; }
/* Firefox */
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }

/* ════════════════════════════════════════════════════════════════
   CUSTOM SELECT — .jselect  (shared across all pages)
   ════════════════════════════════════════════════════════════════ */
.jselect {
  appearance: none;
  background: var(--bg3)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2364748b'/%3E%3C/svg%3E")
    no-repeat right 10px center;
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text2); font-size: 12px; font-family: inherit;
  padding: 5px 28px 5px 10px; cursor: pointer; transition: border-color .15s;
  min-width: 130px;
}
.jselect:hover { border-color: rgba(167,139,250,0.4); }
.jselect:focus { outline: none; border-color: var(--purple); }
.jselect-sm    { min-width: auto; }

/* ════════════════════════════════════════════════════════════════
   JOURNAL TABLE — shared toolbar/tab/separator/footer components
   ════════════════════════════════════════════════════════════════ */
.jtable-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  padding: 14px 20px 12px;
  flex-shrink: 0;
}
.jtable-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Tab pills */
.jtabs { display: flex; }
.jtab {
  background: none; border: none; border-bottom: 2px solid transparent;
  padding: 6px 16px; font-size: 13px; color: var(--text3);
  cursor: pointer; font-family: inherit; transition: all .15s; white-space: nowrap;
}
.jtab:hover  { color: var(--text); }
.jtab.active { color: var(--purple); border-bottom-color: var(--purple); font-weight: 600; }

/* Separator */
.jtable-sep { height: 1px; background: var(--border); margin: 0; flex-shrink: 0; }

/* Pagination footer */
.jtable-footer {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  padding: 12px 20px 16px;
  flex-shrink: 0;
}
.jpage-info {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text3);
}
.jpagination { display: flex; align-items: center; gap: 4px; }
.jpage-btn {
  min-width: 30px; height: 28px; padding: 0 8px;
  background: var(--bg3); border: 0.5px solid var(--border);
  border-radius: var(--radius); color: var(--text2); font-size: 12px;
  cursor: pointer; font-family: inherit; transition: all .15s;
  display: inline-flex; align-items: center; justify-content: center;
}
.jpage-btn:hover:not(:disabled) { border-color: rgba(167,139,250,0.4); color: var(--text); }
.jpage-btn.active {
  background: var(--purple-bg); border-color: var(--purple-bd);
  color: var(--purple); font-weight: 600;
}
.jpage-btn:disabled { opacity: .35; cursor: not-allowed; }

/* ════════════════════════════════════════════════════════════════
   PAGE: journals/index
   ════════════════════════════════════════════════════════════════ */
/* Topbar: nascondi border-bottom su questa pagina */
.page-journals-index .topbar { border-bottom: none; }

/* .content: contenitore fisso, scroll solo sulla tabella */
.page-journals-index .content {
  overflow-y: hidden;
  display: flex;
  flex-direction: column;
  padding: 4px 24px 0;
  gap: 14px;
}

/* Page heading */
.page-heading       { flex-shrink: 0; }
.page-heading-title { font-size: 24px; font-weight: 700; color: var(--text); letter-spacing: -0.4px; margin: 0 0 4px; }
.page-heading-sub   { font-size: 13px; color: var(--text3); margin: 0; }
.topbar .breadcrumb { font-size: 13px; color: var(--text3); font-weight: 400; }

/* KPI Bar */
.kpi-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 0;
  flex-shrink: 0;
}
.kpi-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px 14px;
  position: relative; overflow: hidden;
}
.kpi-card::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(167,139,250,0.04), transparent);
  pointer-events: none;
}
.kpi-label {
  font-size: 11px; color: var(--text3); text-transform: uppercase;
  letter-spacing: .06em; font-weight: 600; margin-bottom: 10px;
}
.kpi-value { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; line-height: 1.1; color: var(--text); }
.kpi-delta { font-size: 11px; margin-top: 6px; font-weight: 500; }
.kpi-delta-pos     { color: var(--green); }
.kpi-delta-neg     { color: var(--red); }
.kpi-delta-neutral { color: var(--text3); }
.kpi-sparkline-wrap {
  position: absolute; bottom: 0; right: 0;
  width: 90px; height: 46px; opacity: 0.45;
}
.kpi-sparkline-wrap canvas { width: 90px !important; height: 46px !important; }

/* Table card — flex:1 per occupare spazio residuo */
.jtable-card {
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* Scrollable table area */
.jtable-scroll {
  overflow-x: auto;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding: 0 12px;
}

/* Table */
.jtable { width: 100%; border-collapse: separate; border-spacing: 0 3px; font-size: 13px; }

.jtable thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--bg2);
  padding: 10px 12px 8px;
  text-align: left; font-size: 11px; font-weight: 600;
  color: var(--text3); text-transform: uppercase; letter-spacing: .04em;
  white-space: nowrap; border-bottom: none;
}
.jtable thead th.tar { text-align: right; }

.jtable tbody .jrow td {
  padding: 10px 12px; vertical-align: middle;
  background: var(--bg3);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.jtable tbody .jrow td:first-child { border-left: 1px solid var(--border); border-radius: var(--radius) 0 0 var(--radius); }
.jtable tbody .jrow td:last-child  { border-right: 1px solid var(--border); border-radius: 0 var(--radius) var(--radius) 0; }
.jtable tbody .jrow:hover td { background: var(--bg2); border-color: rgba(167,139,250,0.3); }
.jtable tbody .jrow.hidden { display: none; }

.jrow-empty { text-align: center; padding: 40px !important; color: var(--text3); font-size: 13px; }

/* Cell utilities */
.tar      { text-align: right; }
.fw6      { font-weight: 600; }
.tcell-sm { font-size: 13px; }
.tcell-xs { font-size: 12px; color: var(--text2); }

/* Row name cell */
.jrow-name-cell { display: flex; align-items: center; gap: 10px; text-decoration: none !important; color: inherit; }
.jrow-name-cell:hover { text-decoration: none !important; }
.jrow-icon {
  width: 38px; height: 38px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--purple-bg), #1a1040);
  border: 1px solid var(--purple-bd);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: var(--purple); letter-spacing: -.3px;
}
.jrow-name { font-size: 13px; font-weight: 600; color: var(--text); }
.jrow-sub  { font-size: 11px; color: var(--text3); }
.jrow-template-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--purple); margin-right: 5px; vertical-align: middle;
}

/* Bottom grid (charts row) */
.jbottom-grid { display: grid; grid-template-columns: 1fr 300px; gap: 14px; flex-shrink: 0; }
.jchart-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
}
.jchart-title { font-size: 13px; font-weight: 600; color: var(--text); }

/* Donut center label (index variant) */
.donut-center-label {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; color: var(--text);
  line-height: 1.2; pointer-events: none; text-align: center;
}
.donut-center-label span { font-size: 11px; color: var(--text3); font-weight: 400; }

/* Section title */
.section-title {
  font-size: 13px; font-weight: 600; color: var(--text2);
  text-transform: uppercase; letter-spacing: .05em;
}

/* No underline: sidebar, topbar, table rows */
.sidebar-logo-link,
.sidebar-logo-link:hover,
.sidebar-item,
.sidebar-item:hover,
.jrow-name-cell,
.jrow-name-cell:hover,
.btn,
.btn:hover { text-decoration: none !important; }

/* ════════════════════════════════════════════════════════════════
   PAGE: journals/detail
   ════════════════════════════════════════════════════════════════ */

/* Header */
.jd-header {
  display: flex; align-items: flex-start; gap: 18px; margin-bottom: 22px;
  padding: 20px; background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.jd-header-avatar {
  width: 64px; height: 64px; border-radius: 14px; flex-shrink: 0;
  background: linear-gradient(135deg, #3b1fa3, #0e7490);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(167,139,250,0.25);
}
.jd-initials     { font-size: 22px; font-weight: 800; color: #fff; letter-spacing: -0.5px; }
.jd-header-body  { flex: 1; min-width: 0; }
.jd-header-top   { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.jd-title        { font-size: 22px; font-weight: 700; color: var(--text); letter-spacing: -0.3px; }
.jd-template-badge {
  background: var(--purple-bg); border: 0.5px solid var(--purple-bd);
  color: var(--purple); font-size: 11px; padding: 2px 10px; border-radius: 20px; font-weight: 500;
}
.jd-header-meta  { font-size: 12px; color: var(--text3); margin-top: 4px; display: flex; gap: 6px; }
.jd-meta-sep     { color: var(--border); }
.jd-description  { font-size: 13px; color: var(--text2); margin-top: 8px; line-height: 1.6; }

/* KPI Cards */
.jd-kpi-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px;
}
.jd-kpi-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px 18px; position: relative; overflow: hidden;
}
.jd-kpi-card::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(167,139,250,0.04), transparent);
  pointer-events: none;
}
.jd-kpi-label { font-size: 11px; color: var(--text3); text-transform: uppercase;
                 letter-spacing: .05em; font-weight: 500; margin-bottom: 6px; }
.jd-kpi-value { font-size: 28px; font-weight: 700; line-height: 1.1; letter-spacing: -0.5px; }
.jd-kpi-delta { font-size: 11px; color: var(--text3); margin-top: 5px; }
.delta-pos    { color: var(--green) !important; }
.delta-neg    { color: var(--red) !important; }
.jd-sparkline { position: absolute; bottom: 0; right: 0; width: 90px; height: 42px; opacity: .4; }

/* Main layout 2 colonne */
.jd-main-layout {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 14px;
  align-items: stretch;
}
/* La colonna sinistra diventa flex column e prende tutta l'altezza della griglia */
.jd-left-col  { min-width: 0; display: flex; flex-direction: column; gap: 14px; height: 100%; }
.jd-right-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; width: 240px; flex-shrink: 0; }
.jd-side-card { padding: 14px 16px; }

/* La card trade cresce a riempire tutta la colonna sinistra disponibile */
.jd-trade-card {
  padding: 0 !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* Area scrollabile: cresce per riempire la card, fa apparire la scrollbar solo quando serve */
.jd-trade-list-scroll {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

/* Trade rows */
.jd-trade-list { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; }
.jd-trade-row {
  display: grid;
  grid-template-columns: 130px 80px 80px 1fr 90px 1fr 60px;
  align-items: center; gap: 10px;
  background: var(--bg3); border: 1px solid var(--border); border-radius: 10px;
  padding: 11px 14px; cursor: pointer; transition: all .15s; position: relative;
}
.jd-trade-row.has-tp2 {
  grid-template-columns: 130px 80px 80px 1fr 90px 90px 1fr 60px;
}
.jd-trade-row:hover {
  border-color: rgba(167,139,250,0.35); background: rgba(167,139,250,0.05);
  transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.jd-tr-date      { min-width: 0; }
.jd-tr-date-main { font-size: 13px; font-weight: 600; color: var(--text); }
.jd-tr-cell      { font-size: 13px; }

/* RR bar */
.jd-rr-bar-wrap { display: flex; flex-direction: column; gap: 3px; }
.jd-rr-val      { font-size: 12px; color: var(--text2); }
.jd-rr-bar      { height: 3px; background: var(--border); border-radius: 2px; width: 100%; }
.jd-rr-fill     { height: 100%; border-radius: 2px; }
.rr-win         { background: var(--green); }
.rr-loss        { background: var(--red); }

/* Score badge */
.jd-score-badge {
  display: inline-block; background: var(--purple-bg); border: 0.5px solid var(--purple-bd);
  color: var(--purple); font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 6px;
}

/* Thumbnail hover */
.jd-thumb-hover {
  display: none; position: absolute; right: calc(100% + 8px); top: 50%;
  transform: translateY(-50%); background: var(--bg2); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px; z-index: 100;
  box-shadow: 0 8px 32px rgba(0,0,0,.6); pointer-events: none; width: max-content;
}
.jd-trade-row:hover .jd-thumb-hover { display: block; }

/* Perf metrics */
.jd-perf-metrics {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px;
  border-top: 0.5px solid var(--border); padding-top: 14px;
}
.jd-perf-metric-label { font-size: 10px; color: var(--text3); text-transform: uppercase;
                         letter-spacing: .04em; margin-bottom: 4px; }
.jd-perf-metric-val   { font-size: 16px; font-weight: 700; }

/* Donut center (detail variant) */
.jd-donut-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; pointer-events: none;
}
.jd-donut-n   { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1; }
.jd-donut-lbl { font-size: 10px; color: var(--text3); }

/* Side panel */
.jd-side-value  { font-size: 15px; font-weight: 600; color: var(--text); }
.jd-stat-rows   { display: flex; flex-direction: column; }
.jd-stat-row    { display: flex; justify-content: space-between; align-items: center;
                   padding: 6px 0; border-bottom: 0.5px solid var(--bg3); font-size: 12px; }
.jd-stat-row:last-child { border-bottom: none; }
.jd-stat-k      { color: var(--text3); }
.jd-stat-v      { color: var(--text); font-weight: 600; }
.jd-notes-text  { font-size: 12px; color: var(--text2); line-height: 1.6; }
.jd-notes-empty { font-size: 12px; color: var(--text3); font-style: italic; }
.jd-notes-edit-link {
  display: inline-block; margin-top: 10px; font-size: 11px; color: var(--purple);
  text-decoration: none; opacity: .8;
}
.jd-notes-edit-link:hover { opacity: 1; text-decoration: underline; }

/* Column headers inside trade table */
.jd-trade-header {
  display: grid;
  grid-template-columns: 130px 80px 80px 1fr 90px 1fr 60px;
  gap: 10px; padding: 8px 14px;
  font-size: 10px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text3);
  flex-shrink: 0;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
.jd-trade-header.has-tp2 {
  grid-template-columns: 130px 80px 80px 1fr 90px 90px 1fr 60px;
}

/* Empty state — grafici non ancora disponibili */
.jcharts-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 28px 24px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); color: var(--text3);
  text-align: center; flex-shrink: 0;
}
.jcharts-empty svg        { opacity: 0.35; color: var(--text3); }
.jcharts-empty-title      { font-size: 13px; font-weight: 600; color: var(--text2); }
.jcharts-empty-sub        { font-size: 12px; color: var(--text3); max-width: 420px; line-height: 1.6; }

/* Responsive */
@media (max-width: 860px) {
  .jd-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Auth pages (login, register, reset) ─────────────────────── */
/* Layout a due colonne su sfondo WebP                             */

body.auth-body {
  background: #050b17;
  overflow: hidden;
}

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  background: url('../img/bg_network.webp') center center / cover no-repeat;
  position: relative;
}

/* Overlay scuro leggero sull'intera pagina */
.auth-page::before {
  content: "";
  position: absolute; inset: 0;
  background: rgba(8, 10, 18, 0.25);
  z-index: 0;
}

/* ── Colonna sinistra ── */
.auth-left {
  flex: 1;
  position: relative; z-index: 1;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 44px 52px 36px;
  min-width: 0;
}

/* Logo: icona sopra, testo sotto */
.auth-logo-section  { margin-bottom: 0; }
.logo-wrapper       { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.auth-logo-img      { height: 64px; width: auto;
                      filter: drop-shadow(0 0 16px rgba(167,139,250,0.55)); }
.logo-brand         { font-size: 34px; font-weight: 700; letter-spacing: -0.5px;
                      color: #ffffff; line-height: 1; }
.logo-brand .highlight {
  background: linear-gradient(135deg, #a78bfa, #22d3ee);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* Hero spostato più in alto */
.auth-hero          { flex: 1; display: flex; flex-direction: column;
                      justify-content: flex-start; padding: 28px 0 0; }
.auth-headline      { font-size: 30px; font-weight: 800; color: #fff;
                      line-height: 1.2; letter-spacing: -0.3px; }
/* "Together." più grande e su riga propria */
.auth-headline-accent {
  display: block;
  font-size: 40px; font-weight: 800;
  line-height: 1.35; margin-top: 0;
  background: linear-gradient(90deg, #a78bfa, #22d3ee);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
/* Tagline leggermente più grande */
.auth-tagline       { font-size: 15px; color: rgba(255,255,255,0.78);
                      line-height: 1.65; margin-top: 14px; max-width: 400px; }

/* Feature icons — staccate dalla privacy con margin-bottom */
.auth-features      { display: flex; gap: 40px; align-items: flex-start;
                      margin-bottom: 44px; }
.auth-feat          { display: flex; flex-direction: column; align-items: center;
                      gap: 12px; text-align: center; max-width: 140px; }
/* Immagini icona reali — cerchio viola scuro via CSS */
.auth-feat-img      { width: 72px; height: 72px; object-fit: cover; display: block;
                      border-radius: 50%;
                      border: 2px solid var(--purple-bg);
                      box-shadow: 0 0 10px rgba(124,58,237,0.3); }
.auth-feat-icon     { width: 65px; height: 65px; border-radius: 50%;
                      border: 1.5px solid rgba(167,139,250,0.25);
                      background: rgba(10, 14, 30, 0.85);
                      display: flex; align-items: center; justify-content: center;
                      flex-shrink: 0; }
.auth-feat-title    { font-size: 13px; font-weight: 700; color: #e2e8f0; }
.auth-feat-desc     { font-size: 12px; color: rgba(255,255,255,0.55); line-height: 1.5; }

/* Privacy note */
.auth-privacy       { display: flex; align-items: center; gap: 7px;
                      font-size: 11px; color: rgba(255,255,255,0.35); margin-top: 0; }

/* ── Colonna destra: card — più margine dal bordo destro ── */
.auth-right {
  width: 460px; min-width: 420px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 1;
  padding: 32px 48px 32px 24px;
}

.auth-card {
  width: 100%;
  background: rgba(13, 18, 35, 0.82);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(167,139,250,0.18);
  border-radius: 18px;
  padding: 44px 40px 36px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
}

/* Titolo e sottotitolo form */
.auth-form-title    { font-size: 24px; font-weight: 800; color: #fff; margin-bottom: 6px; }
.auth-form-title .highlight {
  background: linear-gradient(135deg, #a78bfa, #22d3ee);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.auth-form-sub      { font-size: 13px; color: rgba(255,255,255,0.45); margin-bottom: 32px; }

/* Input con icona */
.input-icon-wrap    { position: relative; display: flex; align-items: center; }
.input-icon         { position: absolute; left: 13px; pointer-events: none; flex-shrink: 0; }
.form-control-icon  { padding-left: 40px !important; }
.form-control-icon-right { padding-right: 42px !important; }
.input-eye          { position: absolute; right: 12px; background: none; border: none;
                      cursor: pointer; padding: 0; display: flex; align-items: center;
                      color: rgba(255,255,255,0.3); }
.input-eye:hover svg ellipse,
.input-eye:hover svg circle { stroke: var(--purple); }

/* Override form-control per auth card */
.auth-card .form-control {
  background: rgba(8, 11, 22, 0.8);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 9px;
  padding: 13px 14px;
  font-size: 14px;
  color: var(--text);
}
.auth-card .form-control:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(167,139,250,0.15);
  background: rgba(8, 11, 22, 1);
}
.auth-card .form-label {
  font-size: 13px; color: rgba(255,255,255,0.6); margin-bottom: 7px;
}

/* Divisore oppure */
.auth-divider       { display: flex; align-items: center; gap: 12px;
                      margin: 20px 0 16px; }
.auth-divider hr    { flex: 1; border: none; border-top: 1px solid rgba(255,255,255,0.08); }
.auth-divider span  { font-size: 12px; color: rgba(255,255,255,0.25); }

/* Footer links */
.auth-footer-links  { text-align: center; margin-top: 20px;
                      font-size: 13px; color: rgba(255,255,255,0.35); }
.auth-footer-links a { color: var(--purple); }

/* btn-primary override per auth (gradient sinistra→destra, non diagonale) */
.auth-card .btn-primary {
  background: linear-gradient(90deg, #7c3aed 0%, #22d3ee 100%);
  color: #fff;
  font-weight: 700;
  border-radius: 9px;
}

/* Flash messages dentro auth-card */
.auth-card .flash-list-container { margin-bottom: 16px; }

/* Card-content-title (backward compat con altre pagine auth) */
.card-content-title { font-size: 16px; font-weight: 500; margin-bottom: 20px; }
.card-subtitle      { font-size: 13px; color: var(--text3); margin-bottom: 20px; }

/* ── Responsive: sotto 768px torna a layout verticale centrato ── */
@media (max-width: 768px) {
  body.auth-body { overflow: auto; }
  .auth-page     { flex-direction: column; align-items: center; min-height: 100vh; }
  .auth-left     { display: none; }
  .auth-right    { width: 100%; min-width: 0; padding: 24px 16px; align-items: flex-start; }
  .auth-card     { padding: 32px 24px; }
}
