/* shared/css/app.css */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f5f4;
  color: #1c1c1a;
}

@media (prefers-color-scheme: dark) {
  body { background: #1a1a18; color: #e8e6e0; }
}

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid #e5e4df;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  gap: 1.5rem;
}

@media (prefers-color-scheme: dark) {
  .sidebar { background: #242422; border-color: #3a3a37; }
}

.sidebar-brand {
  font-size: 1.125rem;
  font-weight: 700;
  padding: 0 0.5rem;
  color: #1c1c1a;
}

@media (prefers-color-scheme: dark) {
  .sidebar-brand { color: #e8e6e0; }
}

/* User card */
.sidebar-user {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: #f5f5f4;
  border-radius: 12px;
  text-align: center;
  min-height: 120px;
}

@media (prefers-color-scheme: dark) {
  .sidebar-user { background: #2e2e2b; }
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 700;
  font-size: 1.25rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.user-name {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1c1c1a;
}

.user-email {
  display: block;
  font-size: 0.75rem;
  color: #9ca3a0;
  word-break: break-all;
}

@media (prefers-color-scheme: dark) {
  .user-name { color: #e8e6e0; }
}

/* Skeleton loading */
.avatar-skeleton, .user-info-skeleton {
  background: #e5e4df;
  border-radius: 4px;
  animation: pulse 1.5s ease-in-out infinite;
}

.avatar-skeleton { width: 48px; height: 48px; border-radius: 50%; }
.user-info-skeleton { width: 80%; height: 40px; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

/* Role badges */
.badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.role-member { background: #f5f5f4; color: #6b6b67; border: 1px solid #e5e4df; }
.role-admin  { background: #eff6ff; color: #1d4ed8; }
.role-owner  { background: #fffbeb; color: #92400e; }

@media (prefers-color-scheme: dark) {
  .role-member { background: #2e2e2b; color: #a8a7a2; border-color: #3a3a37; }
  .role-admin  { background: #1e3a5f; color: #93c5fd; }
  .role-owner  { background: #3d2a00; color: #fcd34d; }
}

/* Nav */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.nav-item {
  padding: 0.625rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.9rem;
  color: #6b6b67;
  transition: background 0.1s, color 0.1s;
}

.nav-item:hover, .nav-item--active {
  background: #f5f5f4;
  color: #1c1c1a;
}

@media (prefers-color-scheme: dark) {
  .nav-item { color: #9ca3a0; }
  .nav-item:hover, .nav-item--active { background: #2e2e2b; color: #e8e6e0; }
}

/* Logout */
.logout-btn {
  width: 100%;
  padding: 0.625rem;
  background: none;
  border: 1px solid #e5e4df;
  border-radius: 8px;
  font-size: 0.875rem;
  color: #6b6b67;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.1s;
}

.logout-btn:hover {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fca5a5;
}

@media (prefers-color-scheme: dark) {
  .logout-btn { border-color: #3a3a37; color: #9ca3a0; }
  .logout-btn:hover { background: #2d1515; color: #fca5a5; border-color: #7f1d1d; }
}

/* ── Main content ─────────────────────────────────────────── */
.app-main {
  flex: 1;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 760px;
}

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.page-header p { font-size: 0.9rem; color: #6b6b67; }

/* Coming soon card */
.coming-soon-card {
  background: #fff;
  border: 1px solid #e5e4df;
  border-radius: 16px;
  padding: 3rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

@media (prefers-color-scheme: dark) {
  .coming-soon-card { background: #242422; border-color: #3a3a37; }
}

.cs-icon { color: #9ca3a0; }

.coming-soon-card h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

.coming-soon-card > p {
  font-size: 0.9rem;
  color: #6b6b67;
  line-height: 1.6;
}

/* Role display */
.role-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 1.25rem 2rem;
  border-radius: 12px;
  width: 100%;
  max-width: 320px;
  margin-top: 0.5rem;
}

.role-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
}

.role-name { font-size: 1.5rem; font-weight: 700; }
.role-desc { font-size: 0.8rem; text-align: center; opacity: 0.8; line-height: 1.4; }

/* Info grid */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.info-card {
  background: #fff;
  border: 1px solid #e5e4df;
  border-radius: 10px;
  padding: 0.875rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

@media (prefers-color-scheme: dark) {
  .info-card { background: #242422; border-color: #3a3a37; }
}

.info-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9ca3a0;
}

.info-value {
  font-size: 0.8rem;
  font-family: 'SF Mono', 'Fira Code', monospace;
  word-break: break-all;
}

/* Mobile */
@media (max-width: 640px) {
  .app-layout { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid #e5e4df; }
}
