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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #1a1a2e;
  color: #eee;
  min-height: 100vh;
}

/* Login page */
.login-container {
  max-width: 400px;
  margin: 100px auto;
  padding: 40px;
  background: #16213e;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.login-container h1 {
  text-align: center;
  color: #e94560;
  font-size: 2rem;
  margin-bottom: 5px;
}

.login-container h2 {
  text-align: center;
  color: #888;
  font-size: 1rem;
  font-weight: normal;
  margin-bottom: 30px;
}

.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.tab {
  flex: 1;
  padding: 12px;
  background: #0f3460;
  border: none;
  color: #888;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
}

.tab.active {
  background: #e94560;
  color: white;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  color: #aaa;
  font-size: 0.9rem;
}

.form-group input {
  padding: 12px;
  border: 2px solid #0f3460;
  border-radius: 8px;
  background: #1a1a2e;
  color: #eee;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: #e94560;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  background: #0f3460;
  color: #eee;
}

.btn.primary {
  background: #e94560;
  color: white;
}

.btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.error-message {
  color: #ff6b6b;
  font-size: 0.9rem;
  min-height: 20px;
}

/* Main app */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: #16213e;
  border-bottom: 1px solid #0f3460;
}

header h1 {
  font-size: 1.3rem;
  color: #e94560;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

#currentUser {
  color: #888;
}

main {
  display: grid;
  grid-template-columns: 220px 1fr 280px;
  min-height: calc(100vh - 60px);
}

.sidebar, .sidebar-right {
  padding: 20px;
  background: #16213e;
  border-right: 1px solid #0f3460;
}

.sidebar-right {
  border-right: none;
  border-left: 1px solid #0f3460;
}

.sidebar h3, .sidebar-right h3 {
  color: #e94560;
  font-size: 0.9rem;
  margin-bottom: 10px;
  margin-top: 20px;
}

.sidebar h3:first-child {
  margin-top: 0;
}

#categoryNav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.category-btn {
  padding: 10px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #aaa;
  text-align: left;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.category-btn:hover {
  background: #0f3460;
  color: #eee;
}

.category-btn.active {
  background: #e94560;
  color: white;
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #aaa;
  font-size: 0.9rem;
  cursor: pointer;
}

.filter-options input[type="radio"] {
  accent-color: #e94560;
}

#compareUsers {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#compareUsers select {
  padding: 8px;
  border: 2px solid #0f3460;
  border-radius: 6px;
  background: #1a1a2e;
  color: #eee;
  font-size: 0.85rem;
}

.content {
  padding: 20px;
  overflow-y: auto;
}

.view-toggle {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.view-btn {
  padding: 10px 20px;
  border: 2px solid #0f3460;
  border-radius: 8px;
  background: transparent;
  color: #aaa;
  cursor: pointer;
  transition: all 0.2s;
}

.view-btn.active {
  border-color: #e94560;
  color: #e94560;
}

.stats {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
  color: #aaa;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: #0f3460;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #e94560, #ff6b6b);
  border-radius: 4px;
  transition: width 0.3s;
}

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

.blueprint-category {
  grid-column: 1 / -1;
  margin-top: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e94560;
  color: #e94560;
  font-size: 1.1rem;
}

.blueprint-category:first-child {
  margin-top: 0;
}

.blueprint-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  background: #16213e;
  border-radius: 8px;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.blueprint-item:hover {
  border-color: #0f3460;
}

.blueprint-item.owned {
  border-color: #4ecca3;
  background: rgba(78, 204, 163, 0.1);
}

.blueprint-checkbox {
  width: 24px;
  height: 24px;
  accent-color: #4ecca3;
  cursor: pointer;
}

.blueprint-name {
  flex: 1;
  font-size: 0.95rem;
}

.blueprint-tier {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: bold;
}

.tier-1 { background: #3d5a80; }
.tier-2 { background: #7b2cbf; }
.tier-3 { background: #e94560; }

.blueprint-mark-btn {
  padding: 6px 10px;
  border: none;
  border-radius: 4px;
  background: #0f3460;
  color: #aaa;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.blueprint-mark-btn:hover {
  background: #e94560;
  color: white;
}

/* Compare view */
.compare-grid {
  width: 100%;
}

.compare-header {
  display: grid;
  gap: 10px;
  padding: 15px;
  background: #16213e;
  border-radius: 8px 8px 0 0;
  font-weight: bold;
  position: sticky;
  top: 0;
}

.compare-row {
  display: grid;
  gap: 10px;
  padding: 12px 15px;
  background: #1a1a2e;
  border-bottom: 1px solid #0f3460;
  align-items: center;
}

.compare-row:hover {
  background: #16213e;
}

.compare-row.missing-highlight {
  background: rgba(233, 69, 96, 0.15);
}

.compare-check {
  text-align: center;
  font-size: 1.2rem;
}

.compare-check.has {
  color: #4ecca3;
}

.compare-check.missing {
  color: #666;
}

.compare-mark-btn {
  padding: 4px 8px;
  border: none;
  border-radius: 4px;
  background: #e94560;
  color: white;
  cursor: pointer;
  font-size: 0.75rem;
}

/* Marks sidebar */
.marks-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.mark-item {
  padding: 10px;
  background: #0f3460;
  border-radius: 6px;
  font-size: 0.85rem;
}

.mark-item .blueprint-name {
  color: #4ecca3;
  font-weight: bold;
}

.mark-item .user-name {
  color: #888;
}

.no-marks {
  color: #666;
  font-size: 0.85rem;
  font-style: italic;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #16213e;
  padding: 30px;
  border-radius: 12px;
  min-width: 300px;
}

.modal-content h3 {
  margin-bottom: 15px;
  color: #e94560;
}

.modal-content p {
  margin-bottom: 15px;
  color: #aaa;
}

.modal-content select {
  width: 100%;
  padding: 10px;
  border: 2px solid #0f3460;
  border-radius: 6px;
  background: #1a1a2e;
  color: #eee;
  margin-bottom: 20px;
}

.modal-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Responsive */
@media (max-width: 1200px) {
  main {
    grid-template-columns: 200px 1fr;
  }

  .sidebar-right {
    display: none;
  }
}

@media (max-width: 768px) {
  main {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .blueprint-grid {
    grid-template-columns: 1fr;
  }
}

/* Blueprint/Default badges */
.bp-badge {
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: bold;
  background: #e94560;
  color: white;
}

.default-badge {
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: bold;
  background: #3d5a80;
  color: #aaa;
}

.bp-badge-sm {
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: bold;
  background: #e94560;
  color: white;
  margin-left: 5px;
}

.default-item {
  opacity: 0.85;
}

.default-item .blueprint-name {
  color: #999;
}
