:root {
  --bg: #f5f5f5;
  --card-bg: #fff;
  --sidebar-bg: #fff;
  --text: #1a1a1a;
  --text-muted: #666;
  --border: #e0e0e0;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --radius: 6px;
  --sidebar-width: 220px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

/* Login page */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 360px;
}

.login-logo {
  height: 2rem;
  margin-bottom: 1.5rem;
}

.login-card input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

.login-card button {
  width: 100%;
  padding: 0.5rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  cursor: pointer;
}

.login-card button:hover { background: var(--primary-hover); }
.login-card button:disabled { opacity: 0.6; cursor: not-allowed; }

.error {
  color: #dc2626;
  font-size: 0.8125rem;
  margin-top: 0.5rem;
}

/* App layout — sidebar + main */
#app {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
#sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0;
  flex-shrink: 0;
}

.sidebar-logo {
  display: block;
  padding: 0 1.25rem 1.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.sidebar-logo img {
  height: 1.75rem;
}

#product-nav {
  display: flex;
  flex-direction: column;
}

.nav-item {
  display: block;
  padding: 0.5rem 1.25rem;
  font-size: 0.8125rem;
  color: var(--text);
  text-decoration: none;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: var(--bg);
}

.nav-item.active {
  border-left-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

/* Main content */
main {
  flex: 1;
  padding: 2rem;
  max-width: 900px;
}

.loading, .select-prompt {
  color: var(--text-muted);
}

/* Product cards */
.product-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.product-card h2 {
  font-size: 1.125rem;
  margin-bottom: 1rem;
}

.channel-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.tab {
  padding: 0.375rem 0.75rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 0.8125rem;
  color: var(--text-muted);
  cursor: pointer;
  text-transform: capitalize;
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.version-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.version-badge {
  font-size: 0.8125rem;
  font-weight: 600;
  background: #f0f0f0;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius);
}

.version-select {
  font-size: 0.8125rem;
  padding: 0.125rem 0.375rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.download-btn {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
}

.download-btn:hover {
  background: #f8fafc;
  border-color: var(--primary);
}
