:root {
  --bg: #0f1115;
  --surface: #161a22;
  --border: #2a2f3a;
  --text: #e6edf3;
  --text-muted: #9aa4b2;
  --accent: #2f81f7;
  --accent-hover: #4a9fff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
}

/* Auth Gate */
.auth-gate {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 1000;
}

.auth-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem;
  text-align: center;
  max-width: 360px;
  width: 90%;
}

.auth-modal h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.auth-modal > p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

#auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#auth-form input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: var(--text);
  font-size: 1rem;
}

#auth-form input:focus {
  outline: none;
  border-color: var(--accent);
}

#auth-form button {
  background: var(--accent);
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: white;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

#auth-form button:hover {
  background: var(--accent-hover);
}

.error {
  color: #e5534b;
  font-size: 0.875rem;
  margin-top: 1rem;
}

/* Main Content */
.main-content {
  min-height: 100vh;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
}

header h1 {
  font-size: 1.25rem;
}

.logout-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.logout-btn:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

main {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.apps-section {
  margin-bottom: 3rem;
}

.apps-section h2 {
  font-size: 1rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.app-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
  position: relative;
}

.app-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.app-icon {
  width: 48px;
  height: 48px;
  background: var(--bg);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: var(--accent);
}

.app-card h3 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.app-card p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.external-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Hidden utility */
[hidden] {
  display: none !important;
}
