/* General reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  body {
    font-family: Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.4;
  }
  
  :root {
    --bg: #f7f9fc;
    --text: #222;
    --card-bg: #fff;
    --primary: #4a90e2;
    --sidebar-bg: #fff;
    --border: #ddd;
  }
  
  body.dark {
    --bg: #181818;
    --text: #f5f5f5;
    --card-bg: #222;
    --primary: #50c878;
    --sidebar-bg: #202020;
    --border: #444;
  }
  
  /* Layout */
  .app {
    display: flex;
    min-height: 100vh;
  }
  
  .sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    padding: 20px;
    display: flex;
    flex-direction: column;
  }
  
  .sidebar .brand {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
  }
  
  .brand .logo {
    font-size: 30px;
    margin-right: 10px;
  }
  
  .nav ul {
    list-style: none;
  }
  
  .nav li {
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
  }
  
  .nav li.active,
  .nav li:hover {
    background: var(--primary);
    color: #fff;
  }
  
  .sidebar-footer {
    margin-top: auto;
    font-size: 12px;
    color: #888;
  }
  
  .main {
    flex: 1;
    display: flex;
    flex-direction: column;
  }
  
  .topbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    align-items: center;
  }
  
  .topbar .left {
    display: flex;
    align-items: center;
  }
  
  .burger {
    font-size: 22px;
    margin-right: 15px;
    display: none;
    background: none;
    border: none;
  }
  
  .topbar .right {
    display: flex;
    align-items: center;
  }
  
  .icon-btn {
    font-size: 18px;
    margin-right: 15px;
    background: none;
    border: none;
    cursor: pointer;
  }
  
  .profile {
    display: flex;
    align-items: center;
  }
  
  .avatar {
    border-radius: 50%;
    margin-right: 10px;
  }
  
  .logout {
    margin-left: 10px;
    background: var(--primary);
    border: none;
    color: #fff;
    padding: 5px 12px;
    border-radius: 5px;
    cursor: pointer;
  }
  
  /* Cards */
  .cards {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(200px,1fr));
    gap: 20px;
    margin: 20px;
  }
  
  .card {
    background: var(--card-bg);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid var(--border);
  }
  
  .card-title {
    font-size: 14px;
    color: #888;
  }
  
  .card-value {
    font-size: 22px;
    font-weight: bold;
    margin-top: 5px;
  }
  
  .card-sub {
    font-size: 12px;
    color: #777;
  }
  
  /* Panels */
  .panel {
    display: flex;
    gap: 20px;
    margin: 20px;
    flex-wrap: wrap;
  }
  
  .panel-left,
  .panel-right {
    flex: 1;
    background: var(--card-bg);
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 10px;
  }
  
  .actions {
    display: flex;
    gap: 10px;
  }
  
  .action {
    padding: 8px 15px;
    border: 1px solid var(--primary);
    background: var(--card-bg);
    cursor: pointer;
    border-radius: 5px;
  }
  
  .action.primary {
    background: var(--primary);
    color: #fff;
  }
  
  /* Transactions */
  .transactions {
    margin: 20px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 15px;
  }

  /*Error Message*/
  .tx-error {
    margin-top: 10px;
    font-weight: bold;
    text-align: center;
  }
  
  .table-wrap {
    max-height: 300px;   /* fixed height */
    overflow-y: auto;    /* scrollable body */
  }
  
  table {
    width: 100%;
    border-collapse: collapse;
  }
  
  thead {
    background: var(--primary);
    color: #fff;
  }
  
  th, td {
    padding: 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
  }
  
  tbody tr:hover {
    background: rgba(0,0,0,0.05);
  }
  
  /* Overlay for mobile */
  .overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9;
  }
  
  /* Responsive */
  @media (max-width: 768px) {
    .burger {
      display: block;
    }
  
    .sidebar {
      position: fixed;
      top: 0; left: -250px;
      height: 100%;
      z-index: 10;
      transition: left 0.3s;
    }
  
    .sidebar.open {
      left: 0;
    }
  
    .overlay.show {
      display: block;
    }
  }
  