* {
  box-sizing: border-box;
}

body {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  padding: 2rem;
  margin: 0 auto;
  background: #f9f9f9;
}

.main-layout,
.header-area {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
}

.main-layout {
  display: flex;
  gap: 3rem;
  margin-top: 2rem;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
}

.content-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.header-area {
  margin-bottom: 2rem;
  padding-left: calc(240px + 3rem);
}

@media (max-width: 768px) {
  .main-layout {
    flex-direction: column;
    gap: 2rem;
  }
  .sidebar {
    width: 100%;
  }
  .header-area {
    padding-left: 0;
  }
}

.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-item {
  margin-bottom: 0.5rem;
}

.nav-link {
  display: block;
  padding: 0.75rem 1rem;
  color: #555;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s;
  font-weight: 500;
  font-size: 0.9rem;
}

.nav-link:hover {
  background: #f0f0f0;
  color: #1a73e8;
}

.nav-link.active {
  color: #1a73e8;
  font-weight: 600;
  border-left: 3px solid #1a73e8;
  border-radius: 0;
  padding-left: calc(1rem - 3px);
}

h1.page-subtitle {
  color: #666;
  margin-bottom: 0.25rem;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.05rem;
  margin-top: 0;
}

.page-title {
  font-size: 2.5rem;
  font-weight: bold;
  color: #333;
  margin-bottom: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.subtitle {
  font-size: 0.75rem;
  color: #888;
  margin-bottom: 2rem;
  font-family: monospace;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
}

section {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #555;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-sizing: border-box;
  font-size: 1rem;
}

.form-group input:disabled {
  background: #f0f0f0;
  color: #888;
}

button {
  padding: 0.75rem 1.5rem;
  background: #1a73e8;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
}

button:hover {
  background: #1557b0;
}

button.secondary-btn {
  background: #fff;
  color: #1a73e8;
  border: 1px solid #1a73e8;
}

button.secondary-btn:hover {
  background: #f8f9fa;
}

button:disabled {
  background: #ccc;
  cursor: not-allowed;
}

#toast {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  padding: 1rem;
  background: #333;
  color: white;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 10000;
}

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  color: #1a73e8;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

.remove-btn {
  background: transparent;
  color: #d93025;
  border: 1px solid #d93025;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

.remove-btn:hover {
  background: #fce8e6;
}

.remove-btn:disabled {
  background: #fafafa;
  border-color: #eee;
  color: #999;
  cursor: not-allowed;
}

.btn-link {
  display: inline-block;
  padding: 0.75rem 1rem;
  background: white;
  color: #1a73e8;
  border: 1px solid #1a73e8;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  transition: background 0.2s;
}

.btn-link:hover {
  background: #f8f9fa;
}

.remove-image-btn {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #bdc1c6;
  color: white;
  border: 2px solid white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  font-weight: bold;
  font-size: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: background-color 0.2s;
  z-index: 10;
}

.remove-image-btn:hover {
  background: #ea4335;
}

/* Profile specific */
.avatar-section {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.avatar-large {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.account-avatar-large {
  width: 100px;
  height: 100px;
  border-radius: 8px;
  object-fit: cover;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.credential-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border: 1px solid #eee;
  border-radius: 8px;
  margin-bottom: 0.75rem;
}

.credential-item.active {
  border-color: #1a73e8;
  background-color: #e8f0fe;
}

.current-badge {
  font-size: 0.75rem;
  background: #1a73e8;
  color: white;
  padding: 0.125rem 0.375rem;
  border-radius: 0.75rem;
  margin-left: 0.5rem;
  font-weight: normal;
}

.credential-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.provider-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.twitch-icon {
  color: #9146ff;
}

.link-account-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  border: 1px solid #ddd;
  color: #333;
  transition: background 0.2s;
}

.link-account-btn.google:hover {
  background: #f8f9fa;
}

.link-account-btn.twitch {
  background: #9146ff;
  color: white;
  border-color: #9146ff;
}

.link-account-btn.twitch .twitch-icon {
  color: white;
}

.link-account-btn.twitch:hover {
  background: #7d2ee6;
}

/* Accounts specific */
.member-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #eee;
}

.member-item:last-child {
  border-bottom: none;
}

.member-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.member-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #f1f3f4;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5f6368;
}

.member-avatar svg {
  width: 20px;
  height: 20px;
}

.member-details {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.member-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.member-role {
  width: 80px;
  display: flex;
  justify-content: center;
}

.role-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 1rem;
  background: #f1f3f4;
  color: #5f6368;
  font-weight: 500;
}

.role-badge.admin {
  background: #e8f0fe;
  color: #1a73e8;
}

.role-select {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: 1px solid #ddd;
  font-size: 0.85rem;
  background: #fff;
}

.role-select:disabled {
  background: #f1f3f4;
  color: #5f6368;
  border-color: transparent;
  appearance: none;
  -webkit-appearance: none;
  cursor: default;
}

.id-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 25ch;
}

.copy-btn {
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: #1a73e8;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s;
}

.copy-btn:hover {
  background: #f0f0f0;
}

.copy-btn svg {
  width: 14px;
  height: 14px;
}
