*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.app {
  display: flex;
  min-height: 100vh;
  background: #f3f4f6;
  color: #111827;
}

.app.dark {
  background: #020617;
  color: #e5e7eb;
}

.app.dark .card {
  background: #020617;
  border-color: #1f2937;
}

.app.dark .sidebar {
  background: #020617;
  border-color: #1f2937;
}

.sidebar {
  width: 220px;
  border-right: 1px solid #e5e7eb;
  padding: 1rem;
  background: #ffffff;
}

.sidebar-logo {
  font-weight: 700;
  margin-bottom: 1rem;
}

#room-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-btn {
  padding: 0.5rem 0.75rem;
  background: none;
  border: none;
  text-align: left;
  border-radius: 0.5rem;
  cursor: pointer;
}

.sidebar-btn:hover {
  background: rgba(15, 118, 110, 0.08);
}

.sidebar-btn.active {
  background: #0f766e;
  color: white;
}

.main {
  flex: 1;
  padding: 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.topbar-right {
  display: flex;
  gap: 0.5rem;
}

.btn-primary,
.btn-outline,
.btn-ghost,
.btn-small {
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: #0f766e;
  color: white;
}

.btn-outline {
  background: transparent;
  border: 1px solid #0f766e;
  color: #0f766e;
}

.btn-ghost {
  background: transparent;
}

.btn-small {
  background: #e5e7eb;
  margin-right: 0.25rem;
}

.room-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.card {
  background: white;
  border-radius: 1rem;
  padding: 1rem;
  border: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-title {
  font-weight: 600;
}

.badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #e5e7eb;
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0.25rem 0;
}

.muted {
  color: #6b7280;
}

.scenes {
  margin-top: 1rem;
}

.scene-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.scene-chip {
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  padding: 0.3rem 0.8rem;
  font-size: 0.85rem;
  background: white;
  cursor: pointer;
}

.scene-chip:hover {
  border-color: #0f766e;
}

/* ===========================
   Mobile / Small screen tweaks
   =========================== */
@media (max-width: 768px) {
  .app {
    flex-direction: column;        /* stack sidebar above main */
    min-height: 100vh;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.75rem;
  }

  #room-list {
    flex-direction: row;           /* rooms in a row */
    gap: 0.5rem;
    overflow-x: auto;              /* horizontal scroll if many rooms */
    padding-bottom: 0.25rem;
  }

  .sidebar-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .main {
    padding: 1rem;
  }

  .grid {
    grid-template-columns: 1fr;    /* single column cards */
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar-right {
    width: 100%;
    justify-content: flex-start;
  }

  .room-header {
    flex-direction: column;
    align-items: flex-start;
  }
}


/* ===========================
   Auth / Login page
   =========================== */

.auth-body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(circle at top, #e0f2fe 0, #f3f4f6 35%, #e5e7eb 100%);
  min-height: 100vh;
}

.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: 1.25rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
  padding: 2rem 2rem 1.75rem;
}

.auth-logo {
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #0f172a;
}

.auth-title {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
  color: #111827;
}

.auth-subtitle {
  margin: 0 0 1.5rem;
  font-size: 0.9rem;
  color: #6b7280;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.auth-field label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #374151;
}

.auth-field input {
  border-radius: 0.75rem;
  border: 1px solid #d1d5db;
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.auth-field input:focus {
  border-color: #0f766e;
  box-shadow: 0 0 0 1px rgba(15, 118, 110, 0.2);
}

.auth-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.auth-remember {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #4b5563;
}

.auth-remember input {
  width: 14px;
  height: 14px;
}

.auth-link {
  color: #0f766e;
  text-decoration: none;
  font-weight: 500;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-submit {
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.6rem 0.9rem;
  font-size: 0.95rem;
}

.auth-bottom-text {
  margin-top: 1.25rem;
  font-size: 0.8rem;
  text-align: center;
  color: #6b7280;
}

/* Mobile tweaks */
@media (max-width: 480px) {
  .auth-card {
    padding: 1.5rem 1.25rem 1.25rem;
  }

  .auth-title {
    font-size: 1.35rem;
  }
}
