:root {
  --bg: #f5f5f7;
  --bg-alt: #ffffff;
  --border: #e0e0e5;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.08);
  --text: #111827;
  --text-soft: #6b7280;
  --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.15);
  --radius: 18px;
  --transition: 0.18s ease;
}

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

html,
body {
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #e5edff 0, #f5f5f7 40%, #f5f5f7 100%);
  color: var(--text);
  display: flex;
}

/* GENERIC HIDDEN CLASS */
.hidden {
  display: none;
}

/* PASSWORD OVERLAY */

#auth-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, #1f2937 0, #020617 55%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.auth-card {
  background: rgba(15, 23, 42, 0.95);
  border-radius: 24px;
  padding: 32px 28px;
  max-width: 360px;
  width: 100%;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.85);
  color: #e5e7eb;
  backdrop-filter: blur(18px);
}

.auth-card h1 {
  font-size: 1.6rem;
  margin-bottom: 6px;
}

.auth-card p {
  font-size: 0.9rem;
  margin-bottom: 18px;
  color: #9ca3af;
}

#auth-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid #4b5563;
  background: #020617;
  color: #e5e7eb;
  margin-bottom: 12px;
  outline: none;
}

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

#auth-button {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 10px 12px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.75);
}

#auth-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 40px rgba(37, 99, 235, 0.9);
}

#auth-error {
  color: #fca5a5;
  font-size: 0.8rem;
  min-height: 18px;
}

/* LAYOUT */

#app {
  display: flex;
  flex: 1;
  height: 100%;
}

.sidebar {
  width: 260px;
  background: rgba(15, 23, 42, 0.97);
  color: #e5e7eb;
  display: flex;
  flex-direction: column;
  padding: 20px 18px;
  box-shadow: 18px 0 40px rgba(15, 23, 42, 0.7);
}

.sidebar-header h2 {
  font-size: 1.25rem;
}

.subtitle {
  font-size: 0.8rem;
  color: #9ca3af;
}

.nav {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  border: none;
  background: transparent;
  color: #d1d5db;
  text-align: left;
  padding: 8px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background var(--transition), color var(--transition),
    transform var(--transition);
}

.nav-item:hover {
  background: rgba(55, 65, 81, 0.85);
  transform: translateX(2px);
}

.nav-item.active {
  background: linear-gradient(90deg, #2563eb, #4f46e5);
  color: #ffffff;
}

.sidebar-footer {
  margin-top: auto;
  font-size: 0.8rem;
  color: #9ca3af;
  padding-top: 16px;
  border-top: 1px solid rgba(55, 65, 81, 0.8);
}

.main {
  flex: 1;
  padding: 20px 22px;
  overflow-y: auto;
}

.section {
  display: none;
  animation: fadeIn 0.2s ease-in-out;
}

.section.active {
  display: block;
}

.section > h1 {
  font-size: 1.4rem;
  margin-bottom: 16px;
}

/* GRID & CARDS */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.card {
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 14px 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.card h2 {
  font-size: 1rem;
  margin-bottom: 10px;
}

.link-list {
  list-style: none;
}

.link-list li + li {
  margin-top: 6px;
}

.link-list a {
  text-decoration: none;
  color: var(--accent);
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  transition: background var(--transition), transform var(--transition),
    box-shadow var(--transition);
}

.link-list a:hover {
  background: rgba(37, 99, 235, 0.18);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

textarea {
  width: 100%;
  min-height: 100px;
  resize: vertical;
  padding: 8px 9px;
  border-radius: 12px;
  border: 1px solid var(--border);
  outline: none;
  background: #f9fafb;
}

textarea:focus {
  border-color: var(--accent);
  background: #ffffff;
}

.task-list {
  list-style: none;
}

.task-list li {
  margin-bottom: 5px;
}

.editable {
  cursor: text;
}

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  #app {
    flex-direction: column;
  }

  .main {
    padding: 16px;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
