 .profit {
    color: #2fa72f; /* green */
    font-weight: 600;
}

.loss {
    color: #dc2626; /* red */
    font-weight: 600;
}

.neutral {
    color: #6b7280; /* gray */
}


:root{
  --bg:#f4f6fa;
  --card:#ffffff;
  --text:#1f2937;
  --accent:#4f46e5;
}
body.dark{
  --bg:#0f172a;
  --card:#1e293b;
  --text:#e5e7eb;
}
*{box-sizing:border-box;}
body{
  margin:0;
  font-family:system-ui,Segoe UI;
  background:var(--bg);
  color:var(--text);
}

/* Sidebar */
.sidebar{
  width:240px;
  background:var(--card);
  height:100vh;
  position:fixed;
  top:0; left:0;
  padding:14px;
  transition:width .3s, transform .3s;
  z-index:1002;
}
body.sb-collapsed .sidebar{
  width:70px;
}
.sidebar a{
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px;
  margin-bottom:6px;
  text-decoration:none;
  color:inherit;
  border-radius:10px;
  transition:.3s;
}
.sidebar a span{
  transition:opacity .3s;
}
body.sb-collapsed .sidebar a span{
  opacity:0;
  pointer-events:none;
}
.sidebar a.active,
.sidebar a:hover{
  background:var(--accent);
  color:#fff;
}

/* Overlay for mobile */
.overlay{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.45);
  z-index:1001;
}

/* Main content */
.main{
  margin-left:240px;
  padding:20px;
  transition:.3s;
}
body.sb-collapsed .main{
  margin-left:70px;
}

/* Topbar */
.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:18px;
  gap:10px;
}
button{
  border:0;
  background:var(--card);
  color:inherit;
  padding:8px 12px;
  border-radius:8px;
  cursor:pointer;
  box-shadow:0 2px 6px rgba(0,0,0,.1);
}

/* Search form */
.search-form{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:16px;
}
.search-form input,
.search-form select{
  padding:10px 14px;
  border-radius:8px;
  border:1px solid #ccc;
  box-shadow:0 2px 6px rgba(0,0,0,.05);
}
.search-form button{
  padding:10px 16px;
  border-radius:8px;
  border:none;
  background-color:#2563eb;
  color:#fff;
  cursor:pointer;
  box-shadow:0 2px 6px rgba(0,0,0,.1);
}
body.dark .search-form input,
body.dark .search-form select{
  background:#1e293b;
  color:#e5e7eb;
  border:1px solid #374151;
}
body.dark .search-form select option{
  background:#1e293b;
  color:#e5e7eb;
}

/* Table */
.table-wrap{
  overflow-x:auto;
  border-radius:12px;
  background:var(--card);
  box-shadow:0 10px 30px rgba(0,0,0,.08);
}
table{
  width:100%;
  min-width:800px;
  border-collapse:collapse;
}
thead{
  background:linear-gradient(90deg,var(--accent),#6366f1);
  color:#fff;
}
th,td{
   padding: 2px 2px;
  text-align:center;
  white-space:nowrap;
}
tbody tr{
  border-bottom:1px solid rgba(0,0,0,.08);
}
tbody tr:nth-child(even){background:rgba(0,0,0,.03);}
body.dark tbody tr:nth-child(even){background:rgba(255,255,255,.05);}
tbody tr:hover{background:rgba(99,102,241,.12);}
body.dark tbody tr:hover{background:rgba(99,102,241,.25);}

/* Pagination */
.pagination-wrap{
  display:flex;
  justify-content:flex-end;
  margin-top:16px;
}
.pagination{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
}
.pagination a{
  padding:6px 12px;
  border-radius:8px;
  border:1px solid rgba(0,0,0,.2);
  background:var(--card);
  text-decoration:none;
  color:var(--text);
  transition:.2s;
}
.pagination a:hover{background:var(--accent);color:#fff;border-color:var(--accent);}
.pagination a.active{background:var(--accent);color:#fff;border-color:var(--accent);}
.pagination .dots{padding:6px 10px;color:rgba(0,0,0,.5);}
body.dark .pagination a{border-color:rgba(255,255,255,.2);}
body.dark .pagination .dots{color:rgba(255,255,255,.5);}

/* Mobile */
@media(max-width:768px){
  .sidebar{
    transform:translateX(-100%);
    width:240px;
    box-shadow:2px 0 15px rgba(0,0,0,.3);
  }
  .sidebar.show{
    transform:translateX(0);
  }
  .overlay.show{
    display:block;
  }
  .main{
    margin-left:0 !important;
  }
  table{font-size:13px;}
}

#user-suggestions {
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    width: 100%;
    display: none;
    font-family: inherit;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
#user-suggestions div {
    padding: 8px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}
#user-suggestions div:hover,
#user-suggestions div.selected {
    background-color: #007cba;
    color: white;
}
.darkable ~ #user-suggestions {
    background: #333;
    color: white;
    border-color: #555;
}
.darkable ~ #user-suggestions div {
    border-bottom-color: #444;
}

/* Table Sorting Styles */
th {
    position: relative;
    user-select: none;
}
th a { 
  color: inherit; text-decoration: none; display: block; padding: 8px; 
}
.sort-indicator {
    opacity: 0.5;
    font-size: 0.8em;
    margin-left: 4px;
    transition: opacity 0.2s;
}
th:hover .sort-indicator {
    opacity: 1;
}
.sort-asc { opacity: 1; }
.sort-desc { opacity: 1; }
.profit { color: #17ad17; font-weight: bold; }
.loss { color: red; font-weight: bold; }
.neutral { color: #666; }