:root{
  --blue:#0b5ed7;
  --dark:#084298;
  --soft:#eaf2ff;
  --white:#fff;
  --bg:#f5f7fb;
  --text:#1f2937;
  --muted:#6b7280;
  --green:#15803d;
  --red:#dc2626;
  --border:#dbe4f0;
}

*{
  box-sizing:border-box;
}

html,body{
  margin:0;
  padding:0;
  width:100%;
  max-width:100%;
  overflow-x:hidden;
  font-family:Arial,Helvetica,sans-serif;
  background:var(--bg);
  color:var(--text);
}

.layout{
  display:flex;
  min-height:100vh;
  width:100%;
  max-width:100%;
}

.sidebar{
  width:250px;
  background:var(--white);
  border-right:1px solid var(--border);
  padding:18px;
  position:fixed;
  top:0;
  left:0;
  bottom:0;
  overflow-y:auto;
}

.logo{
  display:flex;
  gap:10px;
  align-items:center;
  margin-bottom:25px;
}

.mark{
  min-width:48px;
  width:48px;
  height:48px;
  border-radius:13px;
  background:var(--blue);
  color:white;
  font-weight:800;
  display:flex;
  align-items:center;
  justify-content:center;
}

.logo strong{
  display:block;
  line-height:1.2;
}

.logo span{
  font-size:12px;
  color:var(--muted);
}

.nav a{
  display:block;
  padding:12px 14px;
  border-radius:10px;
  text-decoration:none;
  color:var(--text);
  margin-bottom:7px;
  font-size:14px;
}

.nav a.active,
.nav a:hover{
  background:var(--soft);
  color:var(--dark);
  font-weight:700;
}

.main{
  margin-left:250px;
  width:calc(100% - 250px);
  min-width:0;
}

.top{
  background:var(--white);
  border-bottom:1px solid var(--border);
  padding:16px 24px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  position:sticky;
  top:0;
  z-index:5;
  width:100%;
}

.top h1{
  font-size:22px;
  margin:0;
  line-height:1.25;
}

.content{
  padding:24px;
  width:100%;
  max-width:100%;
}

.cards{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:18px;
  margin-bottom:18px;
}

.card{
  background:var(--white);
  border:1px solid var(--border);
  border-radius:16px;
  padding:18px;
  box-shadow:0 6px 16px rgba(15,23,42,.04);
  min-width:0;
  max-width:100%;
}

.card span{
  font-size:13px;
  color:var(--muted);
}

.card h2{
  margin:9px 0 0;
  font-size:25px;
  line-height:1.2;
  overflow-wrap:anywhere;
}

.card h2 small{
  font-size:13px;
  display:block;
  margin-top:4px;
}

.profit{
  color:var(--green);
  font-weight:700;
}

.loss{
  color:var(--red);
  font-weight:700;
}

.grid{
  display:grid;
  grid-template-columns:minmax(0,1.15fr) minmax(0,.85fr);
  gap:18px;
  width:100%;
}

.title{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-bottom:12px;
}

.title h3{
  margin:0;
  font-size:18px;
}

.btn{
  background:var(--blue);
  color:#fff;
  border:0;
  border-radius:9px;
  padding:10px 13px;
  text-decoration:none;
  font-size:13px;
  display:inline-block;
}

.table-responsive{
  width:100%;
  max-width:100%;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}

table{
  width:100%;
  border-collapse:collapse;
  font-size:14px;
  min-width:720px;
}

th,td{
  padding:12px 8px;
  border-bottom:1px solid var(--border);
  text-align:left;
  vertical-align:top;
}

th{
  font-size:12px;
  color:var(--muted);
  text-transform:uppercase;
  white-space:nowrap;
}

td{
  overflow-wrap:anywhere;
}

.pill{
  background:var(--soft);
  color:var(--dark);
  border-radius:20px;
  padding:5px 9px;
  font-weight:700;
  font-size:12px;
  white-space:nowrap;
}

.muted{
  color:var(--muted);
  font-size:12px;
}

.menu{
  display:none;
}

/* Tablet */
@media(max-width:900px){
  .sidebar{
    display:none;
  }

  .main{
    margin-left:0;
    width:100%;
  }

  .menu{
    display:inline;
  }

  .cards{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .grid{
    grid-template-columns:1fr;
  }
}

/* Mobile */
@media(max-width:560px){
  .top{
    padding:12px;
  }

  .top h1{
    font-size:17px;
  }

  .top span:last-child{
    font-size:13px;
  }

  .content{
    padding:12px;
  }

  .cards{
    grid-template-columns:1fr;
    gap:12px;
  }

  .card{
    padding:14px;
    border-radius:14px;
  }

  .card h2{
    font-size:20px;
  }

  .title{
    align-items:flex-start;
    flex-direction:column;
  }

  table{
    min-width:760px;
    font-size:12px;
  }

  th,td{
    padding:10px 8px;
  }
}


/* Mobile menu toggle fix */
.menu-btn{
  display:none;
  background:var(--blue);
  color:#fff;
  border:0;
  border-radius:8px;
  padding:7px 10px;
  font-size:18px;
  line-height:1;
  cursor:pointer;
  margin-right:8px;
}

.sidebar-overlay{
  display:none;
}

@media(max-width:900px){
  .menu-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
  }

  .sidebar{
    display:block;
    transform:translateX(-105%);
    transition:transform .25s ease;
    z-index:1000;
    box-shadow:8px 0 30px rgba(15,23,42,.15);
  }

  body.sidebar-open .sidebar{
    transform:translateX(0);
  }

  body.sidebar-open .sidebar-overlay{
    display:block;
    position:fixed;
    inset:0;
    background:rgba(15,23,42,.42);
    z-index:999;
  }
}

@media(max-width:560px){
  .sidebar{
    width:82%;
    max-width:310px;
  }
}
