/* ── App shell ─────────────────────────────── */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar (desktop) ─────────────────────── */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px 0;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 0 16px 16px;
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.sidebar-project {
  padding: 4px 16px 12px;
  font-size: 12px;
  color: var(--text2);
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.sidebar-nav { flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: var(--text2);
  cursor: pointer;
  border-radius: 0;
  transition: background var(--transition), color var(--transition);
  user-select: none;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: var(--accent-dim); color: var(--accent); }
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text2);
}

/* ── Main content ──────────────────────────── */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--bg);
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-title { font-size: 20px; font-weight: 600; }

/* ── Tabs ──────────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.tab-btn {
  padding: 8px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text2);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 14px;
  transition: color var(--transition), border-color var(--transition);
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Filter bar ────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* ── Table ─────────────────────────────────── */
.table-wrapper { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text2);
  border-bottom: 1px solid var(--border);
  font-weight: 500;
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  cursor: pointer;
}
tbody tr:hover { background: var(--surface2); }
tbody td { padding: 10px 12px; }

/* ── Cards (lobby) ─────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-dim);
}
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.card-desc  { font-size: 13px; color: var(--text2); }

/* ── Mobile ────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { display: none; }

  .app-shell { flex-direction: column; }

  .main-content { padding: 16px; padding-bottom: 80px; }

  .bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 100;
  }

  .bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    color: var(--text3);
    font-size: 11px;
    cursor: pointer;
    transition: color var(--transition);
  }
  .bottom-nav-item.active { color: var(--accent); }
  .bottom-nav-item svg { width: 20px; height: 20px; margin-bottom: 2px; }
}

@media (min-width: 769px) {
  .bottom-nav { display: none; }
}

/* ── Login page ────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.login-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 380px;
}

.login-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 4px;
}
.login-subtitle { font-size: 13px; color: var(--text2); margin-bottom: 28px; }
