:root {
  --bg: #0b1020;
  --panel: #0f152c;
  --text: #e9edf1;
  --muted: #9aa3b2;
  --primary: #4f8cff;
  --primary-600: #3a74e6;
  --danger: #ff6b6b;
  --border: #1e2748;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }

body.center {
  display: grid; place-items: center;
  background: radial-gradient(1000px 500px at 10% 10%, #121a36, #0b1020);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Inter, "Helvetica Neue", Arial;
}

/* Card (no fixed max width; table scroll handled by inner wrapper) */
.card {
  width: 100%;
  max-width: none;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}

/* Dedicated horizontal scroll wrapper for wide tables */
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Make tables expand to show all columns, but at least fill the card */
.card table,
.table-scroll > table {
  border-collapse: collapse;
  width: max-content;   /* expands with number of columns */
  min-width: 100%;      /* never smaller than container */
}

h1 { margin: 0 0 16px; font-size: 24px; }
label { display: block; margin: 12px 0 6px; font-weight: 600; }

input[type="email"], input[type="password"] {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: #0c1330; color: var(--text); outline: none;
}
input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,140,255,.15); }

.primary {
  width: 100%; margin-top: 16px; padding: 12px 14px; border-radius: 10px; border: none;
  background: linear-gradient(180deg, var(--primary), var(--primary-600)); color: white; font-weight: 700; cursor: pointer;
}
.primary:hover { filter: brightness(1.05); }

.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.remember { color: var(--muted); font-size: 14px; }
.link { color: var(--primary); text-decoration: none; font-size: 14px; }
.link:hover { text-decoration: underline; }
.error { color: var(--danger); min-height: 20px; margin-top: 10px; font-size: 14px; }
.muted { color: var(--muted); margin-top: 14px; font-size: 12px; text-align: center; }

body.app { background: #0b1020; color: var(--text); }
.app-header {
  display: flex; align-items: center; gap: 16px; padding: 14px 18px;
  border-bottom: 1px solid var(--border); background: #0d1430;
}
.brand { font-weight: 800; letter-spacing: .3px; }
.spacer { flex: 1; }
.user { color: var(--muted); margin-right: 8px; }
.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); padding: 8px 12px; border-radius: 10px; cursor: pointer; }
.ghost:hover { border-color: var(--primary); color: var(--primary); }

/* Content now full-width; avoid constraining wide tables */
.content { max-width: none; width: 100%; margin: 32px auto; padding: 0 18px; }

/* Tabs */
.tabs { display: flex; gap: 8px; margin-left: 18px; }
.tab { color: var(--muted); text-decoration: none; padding: 8px 10px; border-radius: 8px; }
.tab.active, .tab:hover { color: var(--text); background: rgba(255,255,255,0.05); }

/* Table */
.table-wrapper { /* legacy wrapper; keep non-restrictive */
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0e1534;
}

.cute-table {
  border-collapse: collapse;
  width: max-content;   /* show all columns */
  min-width: 100%;      /* at least fill container */
}

.cute-table thead th {
  position: sticky; top: 0; background: #0d1430; z-index: 1; border-bottom: 1px solid var(--border);
  text-align: left; padding: 10px 12px; font-size: 13px; color: var(--muted);
}
.cute-table tbody td, .cute-table tfoot th, .cute-table tfoot td {
  padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.04); font-size: 14px;
}
.cute-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.num { text-align: center !important; white-space: nowrap; }
.right { text-align: right; }
.positive { color: #2dd4bf; }
.negative { color: #ff6b6b; }

.view.hidden { display: none; }

/* Defenses against flex/grid clipping wide content */
main.content, .view, .row, .table-wrapper, .card { min-width: 0; overflow: visible; }

/* Keep numeric formats but center these specific columns */
.num-center { text-align: center !important; }

/* ---------- Responsive Navbar ---------- */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Active (X) animation */
.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -4px);
}

/* Hide nav on mobile */
@media (max-width: 768px) {
  .tabs {
    display: none;
    flex-direction: column;
    background: #0d1430;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    border-top: 1px solid var(--border);
    padding: 10px 0;
  }

  .tabs.show {
    display: flex;
  }

  .hamburger {
    display: flex;
  }

  .spacer {
    display: none;
  }

  .app-header {
    justify-content: space-between;
    position: relative;
  }
}