:root {
  --primary: #0d6efd;
  --primary-dark: #0b5ed7;
  --page: #f6f7fb;
  --card-bg: #ffffff;
  --radius: 16px;
  --transition: 0.25s ease;
}

/* Reset & base */
* { box-sizing: border-box; }
html { height: 100%; }
body {
  min-height: 100svh;
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* When showing login, center the card */
body:has(#loginCard:not([style*="display: none"])) {
  display: grid;
  place-items: center;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Login Card ---------- */
.card {
  width: 100%;
  max-width: 420px;
  padding: 32px 28px 36px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.08);
  text-align: center;
  animation: fade-in 0.45s ease both;
}

.logo {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--primary);
}

.subtitle {
  font-size: 0.95rem;
  color: #6b7280;
  margin-bottom: 24px;
}

.field { position: relative; margin-bottom: 14px; }

.field input {
  width: 100%;
  padding: 14px 44px 14px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.field input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.12);
}

.toggle-password {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1rem;
  color: #9ca3af;
  padding: 2px 6px;
  border-radius: 8px;
}
.toggle-password:hover { color: var(--primary); }

.btn {
  width: 100%;
  padding: 14px;
  margin-top: 6px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background var(--transition), transform 0.05s ease;
}
.btn:hover, .btn:focus-visible { background: var(--primary-dark); }
.btn:active { transform: translateY(1px); }

#message {
  margin-top: 14px;
  font-size: 0.93rem;
  font-weight: 500;
  min-height: 1.2em;
}
.error { color: #d52731; }
.success { color: #269f53; }

/* ---------- Logout button ---------- */
.logout-icon {
  position: fixed;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  padding: 0;
  border: none;
  border-radius: 9999px;
  display: grid;
  place-items: center;
  background: #fff;
  color: #ef4444;
  border: 1px solid #fecaca;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.08);
  transition: background var(--transition), transform 0.05s ease, color var(--transition);
  z-index: 1000;
}
.logout-icon i { font-size: 15px; line-height: 1; }
.logout-icon:hover { background: #fef2f2; color: #dc2626; }
.logout-icon:active { transform: translateY(1px); }

/* ============================================================
   NEW DASHBOARD DESIGN
   ============================================================ */
.app-shell {
  width: 100%;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  animation: fade-in 0.45s ease both;
}

/* Top brand bar */
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  padding: 16px 28px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #e5e7eb;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #0d6efd, #6366f1);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong {
  font-size: 1rem;
  font-weight: 800;
  color: #1e293b;
}
.brand-text small {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 2px;
}

/* Main content */
.app-main {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 24px 60px;
}

/* Welcome banner */
.welcome-banner {
  text-align: left;
  margin-bottom: 28px;
  padding: 28px 32px;
  background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 50%, #fdf2f8 100%);
  border-radius: 20px;
  border: 1px solid rgba(99, 102, 241, 0.15);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.04);
}
.welcome-banner h2 {
  margin: 0 0 6px;
  font-size: 1.5rem;
  font-weight: 800;
  color: #1e293b;
  letter-spacing: -0.3px;
}
.welcome-banner p {
  margin: 0;
  font-size: 0.95rem;
  color: #64748b;
}

/* Task grid */
.task-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

@media (max-width: 720px) {
  .task-grid { grid-template-columns: 1fr; }
  .welcome-banner { padding: 22px 22px; }
  .welcome-banner h2 { font-size: 1.3rem; }
  .app-main { padding: 24px 16px 48px; }
  .app-topbar { padding: 14px 18px; }
}

/* Task card */
.task-card {
  position: relative;
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 22px 24px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.04);
  transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.2s ease;
  overflow: hidden;
}

.task-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-from), var(--accent-to));
  opacity: 0.95;
}

.task-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(16, 24, 40, 0.10);
  border-color: transparent;
}

.task-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-from), var(--accent-to));
  box-shadow: 0 6px 16px var(--accent-shadow);
}

.task-text { min-width: 0; }
.task-text h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #1e293b;
  letter-spacing: -0.2px;
}
.task-text p {
  margin: 0;
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.4;
}

.task-arrow {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.95rem;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.task-card:hover .task-arrow {
  background: linear-gradient(135deg, var(--accent-from), var(--accent-to));
  color: #fff;
  transform: translateX(3px);
}

/* Color variants */
.task-red {
  --accent-from: #ef4444;
  --accent-to: #dc2626;
  --accent-shadow: rgba(239, 68, 68, 0.30);
}
.task-orange {
  --accent-from: #f59e0b;
  --accent-to: #d97706;
  --accent-shadow: rgba(245, 158, 11, 0.30);
}
.task-purple {
  --accent-from: #8b5cf6;
  --accent-to: #6366f1;
  --accent-shadow: rgba(139, 92, 246, 0.30);
}
.task-green {
  --accent-from: #10b981;
  --accent-to: #059669;
  --accent-shadow: rgba(16, 185, 129, 0.30);
}

/* Footer */
.app-footer {
  margin-top: 36px;
  text-align: center;
  color: #94a3b8;
  font-size: 0.78rem;
}

/* Backwards-compat: keep old .app-nav hidden if it exists */
.app-nav { display: none !important; }