/* ── Reset & Base ─────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: system-ui, sans-serif;
  margin: 0;
  background: #fafafa;
  color: #333;
  min-height: 100vh;
}

body.dark-home {
  background: #111117;
}

/* ── Nav ──────────────────────────────────────────────── */
.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 1.5rem;
  background: #fff;
  border-bottom: 1px solid #eee;
  position: relative;
  z-index: 10;
}

.site-nav .nav-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: #333;
  text-decoration: none;
}

.site-nav .nav-links {
  display: flex;
  gap: 1rem;
  margin-left: auto;
}

.site-nav .nav-link {
  color: #666;
  font-size: 0.875rem;
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}

.site-nav .nav-link:hover {
  color: #333;
}

.site-nav .nav-link.active {
  color: #333;
  font-weight: 600;
  border-bottom-color: #333;
}

/* Dark nav for home page */
body.dark-home .site-nav {
  background: rgba(17, 17, 23, 0.85);
  border-bottom-color: rgba(60, 180, 220, 0.1);
  backdrop-filter: blur(8px);
}

body.dark-home .site-nav .nav-brand {
  color: rgba(80, 220, 240, 0.9);
}

body.dark-home .site-nav .nav-link {
  color: rgba(200, 210, 220, 0.5);
}

body.dark-home .site-nav .nav-link:hover {
  color: rgba(200, 210, 220, 0.85);
}

body.dark-home .site-nav .nav-link.active {
  color: rgba(80, 220, 240, 0.9);
  border-bottom-color: rgba(80, 220, 240, 0.5);
}

/* ── Nav dropdown ────────────────────────────────────── */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.nav-dropdown-menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 0.25rem;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  min-width: 120px;
  z-index: 20;
  display: flex;
  flex-direction: column;
}

.nav-dropdown-menu.hidden {
  display: none;
}

.nav-dropdown-item {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  color: #333;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.nav-dropdown-item:hover {
  background: #f5f5f5;
}

.nav-dropdown-item:first-child {
  border-radius: 6px 6px 0 0;
}

.nav-dropdown-item:last-child {
  border-radius: 0 0 6px 6px;
}

body.dark-home .nav-dropdown-menu {
  background: rgba(30, 30, 40, 0.95);
  border-color: rgba(60, 180, 220, 0.15);
}

body.dark-home .nav-dropdown-item {
  color: rgba(200, 210, 220, 0.85);
}

body.dark-home .nav-dropdown-item:hover {
  background: rgba(60, 180, 220, 0.1);
}

/* ── Particle canvas ─────────────────────────────────── */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

/* ── Page wrapper ─────────────────────────────────────── */
.page {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
}

.page-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 49px);
}

/* ── Card ─────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  width: 100%;
  margin-bottom: 1rem;
}

/* ── Typography ───────────────────────────────────────── */
h1 {
  font-size: 1.5rem;
  color: #333;
  margin: 0 0 1.5rem;
  text-align: center;
}

h1.hero {
  font-size: 3rem;
}

body.dark-home h1.hero {
  color: rgba(230, 240, 250, 0.9);
  text-shadow: 0 0 40px rgba(60, 180, 220, 0.2);
}

/* ── Form controls ────────────────────────────────────── */
label {
  display: block;
  font-size: 0.875rem;
  color: #555;
  margin-bottom: 0.25rem;
}

input[type="text"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 0.5rem;
  margin-bottom: 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  font-family: system-ui, sans-serif;
  background: #fff;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #333;
}

textarea {
  resize: vertical;
  min-height: 80px;
}

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
}

.btn-primary {
  background: #333;
  color: #fff;
}

.btn-primary:hover {
  background: #555;
}

.btn-primary:disabled {
  background: #999;
  cursor: not-allowed;
}

.btn-outline {
  background: #fff;
  color: #333;
  border: 1px solid #ddd;
}

.btn-outline:hover {
  background: #f5f5f5;
}

.btn-sm {
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
}

.btn-danger {
  background: #fff;
  color: #c00;
  border: 1px solid #ddd;
}

.btn-danger:hover {
  background: #fef2f2;
}

/* ── Tabs ─────────────────────────────────────────────── */
.tabs {
  display: flex;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #eee;
}

.tab {
  flex: 1;
  padding: 0.5rem;
  text-align: center;
  cursor: pointer;
  border: none;
  background: none;
  font-size: 1rem;
  color: #888;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.tab.active {
  color: #333;
  border-bottom-color: #333;
  font-weight: 600;
}

/* ── Messages ─────────────────────────────────────────── */
.message {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.875rem;
  min-height: 1.25rem;
}

.message.error {
  color: #c00;
}

.message.success {
  color: #080;
}

/* ── Utility ──────────────────────────────────────────── */
.hidden {
  display: none;
}

.w-full {
  width: 100%;
}

.text-center {
  text-align: center;
}

/* ── Login-specific ───────────────────────────────────── */
.login-card {
  max-width: 380px;
  padding: 2rem;
}

.logged-in {
  text-align: center;
}

.logged-in p {
  color: #333;
  font-size: 1rem;
  margin: 0 0 1.5rem;
}

.logged-in .username {
  font-weight: 600;
}

/* ── Tasks-specific ───────────────────────────────────── */
.section-heading {
  font-size: 1.1rem;
  color: #333;
  margin: 0 0 0.75rem;
}

.container {
  width: 100%;
  max-width: 640px;
}

.session-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}

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

.session-item:hover {
  background: #f9f9f9;
}

.session-prompt {
  font-size: 0.95rem;
  color: #333;
  margin: 0 0 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-meta {
  font-size: 0.75rem;
  color: #888;
}

.empty-state {
  text-align: center;
  color: #888;
  font-size: 0.875rem;
  padding: 1rem 0;
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.detail-header h2 {
  font-size: 1.1rem;
  color: #333;
  margin: 0;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-item {
  padding: 0.75rem;
  border: 1px solid #eee;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.task-header {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.task-title {
  flex: 1;
  font-size: 0.95rem;
  color: #333;
  margin: 0;
}

.task-title.completed {
  text-decoration: line-through;
  color: #999;
}

.task-description {
  font-size: 0.8rem;
  color: #666;
  margin: 0.25rem 0 0;
}

.task-badges {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.4rem;
  flex-wrap: wrap;
}

.badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-agent {
  background: #e8f4fd;
  color: #1a73e8;
}

.badge-user {
  background: #fef3e2;
  color: #e67e00;
}

.badge-high {
  background: #fde8e8;
  color: #c00;
}

.badge-medium {
  background: #fef3e2;
  color: #b45309;
}

.badge-low {
  background: #e8f5e9;
  color: #2e7d32;
}

.task-status-select {
  padding: 0.2rem 0.3rem;
  font-size: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  margin-bottom: 0;
}

.not-authenticated {
  text-align: center;
  color: #555;
}

.not-authenticated a {
  color: #333;
  font-weight: 600;
}
