/* ============================================================
   Tempo Personal Goal Management — Main Stylesheet
   Dark mode · Glassmorphism · Purple-Blue gradient theme
   ============================================================ */

/* ---------- 1. Fonts & Reset ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

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

:root {
  --bg-base: #0d0f18;
  --bg-surface: #131625;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);

  --accent-1: #7c3aed;
  /* violet-700 */
  --accent-2: #4f46e5;
  /* indigo-700 */
  --accent-3: #06b6d4;
  /* cyan-500   */
  --gradient: linear-gradient(135deg, #7c3aed 0%, #4f46e5 50%, #06b6d4 100%);
  --gradient-2: linear-gradient(135deg, #7c3aed, #ec4899);

  --text-1: #f1f5f9;
  --text-2: #94a3b8;
  --text-3: #64748b;

  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.16);

  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-blur: blur(20px);
  --glass-border: 1px solid rgba(255, 255, 255, 0.1);

  --todo-color: #60a5fa;
  --in-progress-color: #a78bfa;
  --done-color: #34d399;
  --cancelled-color: #6b7280;
  --overdue-color: #f87171;

  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 24px rgba(124, 58, 237, 0.25);

  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-1);
  background: var(--bg-base);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 10%, rgba(124, 58, 237, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(6, 182, 212, 0.10) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 50% 50%, rgba(79, 70, 229, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ---------- 2. Glass Utility ---------- */
.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
}

/* ---------- 3. Navbar ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
  background: rgba(13, 15, 24, 0.85);
  backdrop-filter: blur(24px);
  box-shadow: 0 1px 0 var(--border), var(--shadow-sm);
}

.nav-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo-icon {
  font-size: 24px;
}

.nav-logo-name {
  font-size: 18px;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-2);
  font-weight: 500;
  font-size: 13px;
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--text-1);
  background: var(--bg-card-hover);
}

.nav-link.active {
  color: var(--text-1);
  background: rgba(124, 58, 237, 0.2);
  border: 1px solid rgba(124, 58, 237, 0.3);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Reminder bell */
.nav-reminder {
  position: relative;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: var(--radius);
  transition: var(--transition);
  user-select: none;
  display: flex;
  align-items: center;
  gap: 4px;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.nav-reminder:hover {
  background: var(--bg-card-hover);
}

.bell-icon {
  font-size: 18px;
  line-height: 1;
}

.bell-badge {
  background: #ef4444;
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-base);
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.15);
  }
}

/* ---------- Portal Dropdowns — position:fixed, outside navbar stacking context ---------- */
.dropdown-portal {
  position: fixed;
  z-index: 9999;
  border-radius: var(--radius-lg);
  padding: 8px;
  background: rgba(13, 15, 24, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
  animation: dropIn 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes dropIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#reminderDropdown {
  width: 300px;
}

#userDropdown {
  width: 220px;
}

/* Reminder dropdown content */
.rd-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  font-weight: 600;
  color: var(--text-2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.rd-count {
  background: var(--accent-1);
  color: white;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 20px;
}

.rd-empty {
  text-align: center;
  padding: 20px;
  color: var(--text-3);
  font-size: 13px;
}

.rd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-1);
  transition: var(--transition);
}

.rd-item:hover {
  background: var(--bg-card-hover);
}

.rd-item.overdue {
  border-left: 3px solid var(--overdue-color);
}

.rd-ico {
  font-size: 20px;
  flex-shrink: 0;
}

.rd-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rd-title {
  font-size: 13px;
  font-weight: 500;
}

.rd-due {
  font-size: 11px;
  color: var(--text-3);
}

/* User menu */
.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: var(--transition);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.nav-user:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.user-avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.user-avatar-sm.sm {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.nav-username {
  font-size: 13px;
  font-weight: 500;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.caret {
  font-size: 10px;
  color: var(--text-3);
  flex-shrink: 0;
}

/* User dropdown content */
.ud-header {
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.ud-header span {
  display: block;
  font-weight: 600;
  font-size: 13px;
}

.ud-header small {
  color: var(--text-3);
  font-size: 11px;
}

.ud-item {
  display: block;
  padding: 9px 12px;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-2);
  font-size: 13px;
  transition: var(--transition);
}

.ud-item:hover {
  color: var(--text-1);
  background: var(--bg-card-hover);
}

.ud-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.ud-logout {
  color: #f87171 !important;
}

.ud-logout:hover {
  background: rgba(248, 113, 113, 0.1) !important;
}

/* Mobile nav button & drawer */
.mobile-menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--border);
  font-size: 18px;
  cursor: pointer;
  color: var(--text-1);
  padding: 6px 10px;
  border-radius: var(--radius);
  line-height: 1;
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.mobile-menu-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.mobile-nav {
  display: none;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border);
  flex-direction: column;
  gap: 4px;
}

.mobile-nav.open {
  display: flex;
}

.mobile-nav-link {
  padding: 12px 14px;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-nav-link:hover {
  color: var(--text-1);
  background: var(--bg-card-hover);
}

.mobile-nav-link.logout {
  color: #f87171;
}

.mobile-nav-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

.mobile-nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
}

.mobile-nav-userinfo {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mobile-nav-userinfo span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
}

.mobile-nav-userinfo small {
  font-size: 11px;
  color: var(--text-3);
}

.navbar-spacer {
  height: 64px;
}

/* ---------- 4. Page Layout ---------- */
.page-wrapper {
  max-width: 1440px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  position: relative;
  z-index: 1;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -0.5px;
}

.page-subtitle {
  color: var(--text-3);
  font-size: 14px;
  margin-top: 2px;
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

/* ---------- 5. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
  font-family: inherit;
  line-height: 1;
}

.btn-primary {
  background: var(--gradient);
  color: white;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.5);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-1);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--border-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--bg-card-hover);
  color: var(--text-1);
}

.btn-danger {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.25);
}

.btn-full {
  width: 100%;
  justify-content: center;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-arrow {
  font-size: 18px;
  transition: transform var(--transition);
}

.btn:hover .btn-arrow {
  transform: translateX(4px);
}

.mt-8 {
  margin-top: 8px;
}

/* ---------- 6. Form Elements ---------- */
input,
select,
textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-1);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 14px;
  transition: var(--transition);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
  background: rgba(255, 255, 255, 0.07);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-3);
}

select option {
  background: #1e1b4b;
  color: var(--text-1);
}

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

input[type="range"] {
  padding: 0;
  height: 6px;
  accent-color: var(--accent-1);
  cursor: pointer;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2364748b'%3E%3Cpath d='M5.5 8l4.5 4.5 4.5-4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap input {
  padding-left: 40px;
}

.input-wrap .toggle-pw {
  padding-left: 0;
  padding-right: 0;
}

.input-icon {
  position: absolute;
  left: 12px;
  font-size: 16px;
  z-index: 1;
  pointer-events: none;
}

.toggle-pw {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-3);
  padding: 4px;
}

.toggle-pw:hover {
  color: var(--text-1);
}

.input-lg {
  font-size: 16px;
  padding: 12px 16px;
}

.req {
  color: #f87171;
}

.form-hint {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 12px;
}

.range-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.range-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-3);
  min-width: 36px;
}

/* ---------- 7. Auth pages ---------- */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.auth-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.auth-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: blobFloat 8s ease-in-out infinite alternate;
}

.blob-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #7c3aed, transparent);
  top: -100px;
  left: -100px;
}

.blob-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #4f46e5, transparent);
  top: 40%;
  right: -80px;
  animation-delay: -3s;
}

.blob-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, #06b6d4, transparent);
  bottom: -50px;
  left: 40%;
  animation-delay: -6s;
}

@keyframes blobFloat {
  from {
    transform: translate(0, 0) scale(1);
  }

  to {
    transform: translate(30px, 20px) scale(1.05);
  }
}

.auth-container {
  position: relative;
  z-index: 1;
  padding: 20px;
  width: 100%;
  display: flex;
  justify-content: center;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  padding: 40px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}

.logo-icon {
  font-size: 48px;
  margin-bottom: 8px;
  filter: drop-shadow(0 4px 12px rgba(124, 58, 237, 0.5));
}

.logo-name {
  font-size: 28px;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-tagline {
  color: var(--text-3);
  font-size: 13px;
  margin-top: 4px;
}

.auth-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text-1);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-switch {
  text-align: center;
  margin-top: 20px;
  color: var(--text-3);
  font-size: 13px;
}

.auth-switch a {
  color: var(--accent-3);
  text-decoration: none;
  font-weight: 500;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* ---------- 8. Alerts ---------- */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 20px;
  animation: slideInDown 0.3s ease;
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-error {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: #fca5a5;
}

.alert-success {
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: #6ee7b7;
}

.alert-warning {
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: #fde68a;
}

/* ---------- 9. Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.priority {
  text-transform: uppercase;
}

.badge-low {
  background: rgba(52, 211, 153, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.badge-medium {
  background: rgba(251, 191, 36, 0.15);
  color: #fde68a;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.badge-high {
  background: rgba(251, 146, 60, 0.15);
  color: #fdba74;
  border: 1px solid rgba(251, 146, 60, 0.3);
}

.badge-urgent {
  background: rgba(248, 113, 113, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(248, 113, 113, 0.3);
  animation: pulse 2s infinite;
}

.badge-soon {
  background: rgba(251, 191, 36, 0.15);
  color: #fde68a;
  border: 1px solid rgba(251, 191, 36, 0.3);
  font-size: 10px;
  padding: 2px 7px;
}

.badge-overdue {
  background: rgba(248, 113, 113, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(248, 113, 113, 0.3);
  font-size: 10px;
  padding: 2px 7px;
}

/* ---------- 10. Stats bar (Goals list) ---------- */
.stats-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.stat-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-2);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.stat-chip:hover {
  border-color: var(--border-hover);
  color: var(--text-1);
  background: var(--bg-card-hover);
}

.stat-chip.active {
  background: rgba(124, 58, 237, 0.2);
  border-color: rgba(124, 58, 237, 0.4);
  color: var(--text-1);
}

.stat-chip strong {
  font-weight: 700;
}

.stat-chip.overdue {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.3);
}

/* ---------- 11. Filters bar ---------- */
.filters-bar {
  display: flex;
  gap: 12px;
  padding: 16px;
  margin-bottom: 24px;
  border-radius: var(--radius-lg);
  flex-wrap: wrap;
  align-items: center;
}

.filter-group {
  flex: 1;
  min-width: 160px;
}

.filter-input {
  background: rgba(255, 255, 255, 0.05);
}

.filter-select {
  background: rgba(255, 255, 255, 0.05);
}

/* ---------- 12. Goals Grid ---------- */
.goals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.goal-card {
  padding: 20px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.goal-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--gradient);
  opacity: 0;
  transition: opacity var(--transition);
}

.goal-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(124, 58, 237, 0.3);
  border-color: rgba(124, 58, 237, 0.3);
}

.goal-card.urgent {
  border-left: 3px solid #f87171;
}

.goal-card.high {
  border-left: 3px solid #fb923c;
}

.goal-card.overdue {
  border-left: 3px solid #ef4444 !important;
  background: rgba(248, 113, 113, 0.05);
}

.goal-card.done {
  opacity: 0.7;
}

.goal-card.cancelled {
  opacity: 0.5;
}

.goal-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.goal-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 8px;
  line-height: 1.4;
}

.goal-desc {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 12px;
  line-height: 1.5;
}

.progress-bar-wrap {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
  margin-bottom: 12px;
}

.progress-bar {
  height: 100%;
  background: var(--gradient);
  border-radius: 3px;
  transition: width var(--transition-slow);
}

.progress-label {
  position: absolute;
  right: 0;
  top: -18px;
  font-size: 11px;
  color: var(--text-3);
}

.goal-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.goal-card-actions {
  display: flex;
  gap: 4px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  opacity: 0;
  transition: var(--transition);
}

.goal-card:hover .goal-card-actions {
  opacity: 1;
}

.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  background: color-mix(in srgb, var(--cat-color) 15%, transparent);
  color: var(--cat-color);
  border: 1px solid color-mix(in srgb, var(--cat-color) 30%, transparent);
}

.category-badge.lg {
  font-size: 13px;
  padding: 4px 12px;
}

.due-date {
  font-size: 12px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 4px;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
}

.status-dot.sm {
  font-size: 10px;
  padding: 2px 8px;
}

.status-todo {
  background: rgba(96, 165, 250, 0.15);
  color: var(--todo-color);
  border: 1px solid rgba(96, 165, 250, 0.3);
}

.status-in_progress {
  background: rgba(167, 139, 250, 0.15);
  color: var(--in-progress-color);
  border: 1px solid rgba(167, 139, 250, 0.3);
}

.status-done {
  background: rgba(52, 211, 153, 0.15);
  color: var(--done-color);
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.status-cancelled {
  background: rgba(107, 114, 128, 0.15);
  color: var(--cancelled-color);
  border: 1px solid rgba(107, 114, 128, 0.3);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 14px;
  transition: var(--transition);
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  color: var(--text-2);
}

.icon-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-1);
  border-color: var(--border-hover);
}

.icon-btn.danger:hover {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.3);
}

.overdue-text {
  color: var(--overdue-color) !important;
}

.soon-text {
  color: #fde68a !important;
}

/* ---------- 13. Empty state ---------- */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-3);
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 20px;
  color: var(--text-2);
  margin-bottom: 8px;
}

.empty-state p {
  margin-bottom: 24px;
}

/* ---------- 14. Pagination ---------- */
.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 32px;
}

.page-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-2);
  border: 1px solid var(--border);
  font-size: 13px;
  transition: var(--transition);
}

.page-btn:hover {
  border-color: var(--accent-1);
  color: var(--text-1);
}

.page-btn.active {
  background: var(--gradient);
  color: white;
  border-color: transparent;
}

/* ---------- 15. Goal Form ---------- */
.goal-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}

.form-col-main,
.form-col-side {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-card {
  padding: 24px;
}

.form-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.sticky-card {
  position: sticky;
  top: 84px;
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
}

/* Checklist */
.checklist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.drag-handle {
  color: var(--text-3);
  cursor: grab;
  font-size: 16px;
  user-select: none;
}

.checklist-input {
  flex: 1;
}

/* Custom fields */
.custom-field-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.4fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.cf-name,
.cf-value {
  font-size: 13px;
}

.cf-type {
  font-size: 12px;
  padding: 8px 10px;
}

/* Tags */
.tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: rgba(124, 58, 237, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 20px;
  font-size: 12px;
}

/* ---------- 16. Goal Detail ---------- */
.goal-detail-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.goal-detail-header {
  padding: 28px;
}

.goal-detail-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.goal-detail-title {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 12px;
}

.goal-detail-desc {
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 16px;
}

.goal-detail-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* Quick status */
.quick-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.qs-label {
  font-size: 13px;
  color: var(--text-3);
  font-weight: 500;
}

.qs-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.qs-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-1);
  background: var(--bg-card-hover);
}

.qs-btn.active.status-todo {
  background: rgba(96, 165, 250, 0.15);
  color: var(--todo-color);
  border-color: rgba(96, 165, 250, 0.4);
}

.qs-btn.active.status-in_progress {
  background: rgba(167, 139, 250, 0.15);
  color: var(--in-progress-color);
  border-color: rgba(167, 139, 250, 0.4);
}

.qs-btn.active.status-done {
  background: rgba(52, 211, 153, 0.15);
  color: var(--done-color);
  border-color: rgba(52, 211, 153, 0.4);
}

.qs-btn.active.status-cancelled {
  background: rgba(107, 114, 128, 0.15);
  color: var(--cancelled-color);
  border-color: rgba(107, 114, 128, 0.4);
}

/* Progress detail */
.progress-detail-wrap {
  margin-top: 16px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 8px;
}

.progress-bar-lg {
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient);
  border-radius: 5px;
  transition: width 0.5s ease;
}

/* Dates row */
.dates-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  padding: 0;
  overflow: hidden;
}

.date-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
}

.date-icon {
  font-size: 24px;
}

.date-item small {
  color: var(--text-3);
  font-size: 12px;
  display: block;
}

.date-item strong {
  font-size: 14px;
  font-weight: 600;
  display: block;
  margin-top: 2px;
}

/* Section cards */
.section-card {
  padding: 24px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
}

/* Checklist view */
.checklist-view {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.checklist-progress-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 12px;
}

.mini-progress {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.mini-progress>div {
  height: 100%;
  background: var(--gradient);
  border-radius: 2px;
}

.checklist-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}

.checklist-row:hover {
  background: var(--bg-card-hover);
}

.checklist-row input[type="checkbox"] {
  display: none;
}

.checklist-check {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 6px;
  border: 2px solid var(--border-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-size: 12px;
}

.checklist-row.done .checklist-check {
  background: var(--done-color);
  border-color: var(--done-color);
}

.checklist-row.done .checklist-check::after {
  content: '✓';
  color: white;
}

.checklist-text {
  flex: 1;
  font-size: 14px;
  transition: var(--transition);
}

.checklist-row.done .checklist-text {
  text-decoration: line-through;
  color: var(--text-3);
}

/* Custom fields view */
.custom-fields-view {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cf-view-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  align-items: start;
}

.cf-view-row:last-child {
  border-bottom: none;
}

.cf-view-name {
  color: var(--text-3);
  font-weight: 500;
}

.cf-view-value {
  color: var(--text-1);
  word-break: break-word;
}

.cf-view-value a {
  color: var(--accent-3);
  text-decoration: none;
}

.cf-view-value a:hover {
  text-decoration: underline;
}

/* Activity log */
.activity-log {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.act-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
}

.act-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.act-user {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
}

.act-action {
  font-size: 13px;
  color: var(--text-2);
}

.act-time {
  font-size: 11px;
  color: var(--text-3);
}

/* ---------- 17. Kanban Board ---------- */
.kanban-wrapper {
  max-width: 100%;
}

.kanban-filter {
  display: flex;
  gap: 8px;
  align-items: center;
}

.filter-input.sm,
.filter-select.sm {
  font-size: 13px;
  padding: 8px 12px;
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(260px, 1fr));
  gap: 16px;
  align-items: start;
  min-height: calc(100vh - 200px);
}

.kanban-col {
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  /* KHÔNG dùng overflow:hidden — sẽ phá vỡ position:sticky của header */
  min-height: 200px;
  display: flex;
  flex-direction: column;
}

.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  /* Sticky trong từng cột — cần .kanban-col KHÔNG có overflow:hidden */
  position: sticky;
  top: 64px;
  background: rgba(13, 15, 24, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 5;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  flex-shrink: 0;
}

.kanban-col-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

.kanban-count {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}

.kanban-add-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-3);
  font-size: 18px;
  transition: var(--transition);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
}

.kanban-add-btn:hover {
  background: rgba(124, 58, 237, 0.2);
  color: var(--text-1);
  border-color: rgba(124, 58, 237, 0.4);
}

.col-todo .kanban-col-header {
  border-top: 3px solid var(--todo-color);
}

.col-inprogress .kanban-col-header {
  border-top: 3px solid var(--in-progress-color);
}

.col-done .kanban-col-header {
  border-top: 3px solid var(--done-color);
}

.col-cancelled .kanban-col-header {
  border-top: 3px solid var(--cancelled-color);
}

.kanban-cards {
  padding: 12px;
  min-height: 120px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kanban-cards.drag-over {
  background: rgba(124, 58, 237, 0.08);
  border-radius: var(--radius);
  outline: 2px dashed rgba(124, 58, 237, 0.4);
}

/* Kanban card */
.kanban-card {
  padding: 14px;
  border-radius: var(--radius);
  cursor: grab;
  transition: var(--transition);
  position: relative;
}

.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(124, 58, 237, 0.3);
}

.kanban-card.sortable-chosen {
  opacity: 0.8;
  transform: rotate(1deg);
}

.kanban-card.sortable-ghost {
  opacity: 0.3;
}

.kanban-card.urgent {
  border-left: 3px solid #f87171;
}

.kanban-card.high {
  border-left: 3px solid #fb923c;
}

.kanban-card.overdue {
  background: rgba(248, 113, 113, 0.06);
}

.kc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.kc-cat {
  font-size: 11px;
  color: var(--cat-color);
  font-weight: 500;
}

.kc-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 6px;
}

.kc-title a {
  text-decoration: none;
  color: var(--text-1);
}

.kc-title a:hover {
  color: #c4b5fd;
}

.kc-desc {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 8px;
  line-height: 1.4;
}

.kc-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.kc-progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.kc-progress-bar>div,
.kc-progress-bar {
  position: relative;
}

.kc-progress {
  position: relative;
}

.kc-progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

[class*="col-"] .kanban-card .kc-progress-bar>* {
  position: absolute;
  height: 100%;
  background: var(--gradient);
  border-radius: 2px;
}

.kc-progress span {
  font-size: 10px;
  color: var(--text-3);
}

.kc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kc-due {
  font-size: 11px;
  color: var(--text-3);
}

.kc-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: var(--transition);
}

.kanban-card:hover .kc-actions {
  opacity: 1;
}

.kc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 12px;
  text-decoration: none;
  color: var(--text-3);
  transition: var(--transition);
}

.kc-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-1);
}

.priority-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.priority-dot.priority-urgent,
.priority-urgent .priority-dot {
  background: #f87171;
}

.priority-dot.priority-high,
.priority-high .priority-dot {
  background: #fb923c;
}

.priority-dot.priority-medium,
.priority-medium .priority-dot {
  background: #fbbf24;
}

.priority-dot.priority-low,
.priority-low .priority-dot {
  background: #34d399;
}

/* ---------- 18. Dashboard ---------- */
.dash-greeting {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.greeting-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: white;
  box-shadow: var(--shadow-glow);
  flex-shrink: 0;
}

.greeting-title {
  font-size: 24px;
  font-weight: 800;
}

.greeting-sub {
  color: var(--text-3);
  font-size: 13px;
  margin-top: 2px;
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.kpi-card {
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.kpi-val {
  font-size: 36px;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 4px;
}

.kpi-label {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
}

.kpi-rate .kpi-val {
  font-size: 28px;
}

.kpi-overdue.has-overdue .kpi-val {
  -webkit-text-fill-color: #f87171 !important;
  background: none;
}

/* Progress ring */
.kpi-progress-ring {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 48px;
  height: 48px;
  opacity: 0.3;
}

.ring-svg {
  transform: rotate(-90deg);
}

.ring-bg,
.ring-fill {
  fill: none;
  stroke-width: 3;
}

.ring-bg {
  stroke: rgba(255, 255, 255, 0.1);
}

.ring-fill {
  stroke: url(#grad);
  stroke-linecap: round;
  transition: stroke-dasharray 1s ease;
}

/* Dash grid */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  align-items: start;
}

.dash-charts {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dash-right {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

/* Chart cards */
.chart-card {
  padding: 24px;
}

.chart-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
}

.chart-wrap {
  position: relative;
  height: 200px;
}

/* Category stats */
.category-stat-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cat-stat-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cat-stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.cat-stat-name {
  font-size: 13px;
  font-weight: 500;
  min-width: 90px;
}

.cat-stat-bar-wrap {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.cat-stat-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 1s ease;
}

.cat-stat-nums {
  font-size: 12px;
  color: var(--text-3);
  min-width: 40px;
  text-align: right;
}

/* Reminder card */
.reminder-card {
  padding: 20px;
}

.reminder-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.reminder-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-1);
  transition: var(--transition);
}

.reminder-item:hover {
  background: var(--bg-card-hover);
}

.reminder-item.overdue {
  border-left: 3px solid var(--overdue-color);
}

.reminder-cat {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.reminder-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.reminder-title {
  font-size: 13px;
  font-weight: 500;
}

.reminder-due {
  font-size: 11px;
  color: var(--text-3);
}

/* Priority list */
.priority-card {
  padding: 20px;
}

.priority-list {
  display: flex;
  flex-direction: column;
}

.priority-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text-1);
  transition: var(--transition);
}

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

.priority-item:hover {
  background: var(--bg-card-hover);
  border-radius: var(--radius);
  padding-left: 10px;
  padding-right: 10px;
}

.priority-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.priority-title {
  font-size: 13px;
  font-weight: 500;
}

.priority-meta {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: var(--text-3);
}

.mini-progress-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}

.mini-progress-bar>div {
  height: 100%;
  background: var(--gradient);
}

/* Quick actions */
.quick-actions {
  padding: 20px;
}

.qa-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.qa-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 10px;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-2);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 500;
  transition: var(--transition);
  text-align: center;
}

.qa-btn span:first-child {
  font-size: 22px;
}

.qa-btn:hover {
  border-color: rgba(124, 58, 237, 0.4);
  color: var(--text-1);
  background: rgba(124, 58, 237, 0.1);
}

.empty-mini {
  text-align: center;
  padding: 20px;
  color: var(--text-3);
  font-size: 13px;
}

/* ---------- 19. Responsive ---------- */

/* --- Tablet landscape (≤1400px) --- */
@media (max-width: 1400px) {
  .kanban-board {
    grid-template-columns: repeat(4, minmax(220px, 1fr));
    gap: 12px;
  }
}

/* --- Tablet (≤1100px) --- */
@media (max-width: 1100px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .sticky-card {
    position: static;
  }

  .dash-grid {
    grid-template-columns: 1fr;
  }

  .dash-right {
    position: static;
    max-height: none;
  }

  /* Kanban: horizontal scroll with fixed-width columns */
  .kanban-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
  }

  .kanban-board {
    grid-template-columns: repeat(4, 280px);
    min-width: 1160px;
    gap: 12px;
  }

  /* Prevent sticky header inside horizontally scrolled container */
  .kanban-col-header {
    position: static;
  }
}

/* --- Mobile (≤768px) --- */
@media (max-width: 768px) {

  /* Navbar */
  .nav-links {
    display: none;
  }

  .mobile-menu-btn {
    display: block;
  }

  .nav-username {
    display: none;
  }

  .nav-inner {
    gap: 12px;
    padding: 0 16px;
  }

  /* Page */
  .page-wrapper {
    padding: 16px 12px 48px;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .page-title {
    font-size: 22px;
  }

  .header-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .header-actions .btn {
    flex: 1;
    justify-content: center;
  }

  /* Kanban mobile: single column scroll */
  .kanban-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
  }

  .kanban-board {
    grid-template-columns: repeat(4, 85vw);
    min-width: unset;
    gap: 10px;
  }

  .kanban-col-header {
    position: static;
  }

  /* Goals grid */
  .goals-grid {
    grid-template-columns: 1fr;
  }

  /* KPI */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .kpi-val {
    font-size: 28px;
  }

  /* Forms */
  .form-row {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  /* Custom fields — stack vertically */
  .custom-field-row {
    grid-template-columns: 1fr 1fr;
  }

  .custom-field-row .cf-name {
    grid-column: 1 / -1;
  }

  .custom-field-row .cf-type {
    grid-column: span 1;
  }

  .custom-field-row .cf-value {
    grid-column: span 1;
  }

  .custom-field-row .icon-btn {
    grid-column: 1 / -1;
    justify-self: end;
  }

  /* Auth */
  .auth-card {
    padding: 24px 16px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  /* Dates row */
  .dates-row {
    grid-template-columns: 1fr 1fr;
  }

  /* Filters */
  .filters-bar {
    flex-direction: column;
    padding: 12px;
  }

  .filter-group {
    width: 100%;
    min-width: unset;
  }

  .stats-bar {
    gap: 6px;
  }

  .stat-chip {
    font-size: 12px;
    padding: 6px 10px;
  }

  /* Kanban filter */
  .kanban-filter {
    flex-wrap: wrap;
    width: 100%;
  }

  .kanban-filter .filter-input.sm,
  .kanban-filter .filter-select.sm {
    flex: 1;
    min-width: 100px;
  }

  /* Goal detail */
  .goal-detail-actions {
    flex-wrap: wrap;
  }

  .quick-status {
    flex-wrap: wrap;
    gap: 6px;
  }

  .qs-btn {
    font-size: 11px;
    padding: 6px 10px;
  }

  /* Dashboard */
  .dash-greeting {
    gap: 12px;
  }

  .greeting-title {
    font-size: 18px;
  }

  .greeting-avatar {
    width: 44px;
    height: 44px;
    font-size: 16px;
  }

  /* Reminder & user dropdown */
  .reminder-dropdown {
    width: 280px;
    right: -60px;
  }

  .user-dropdown {
    width: 200px;
  }
}

/* --- Small mobile (≤480px) --- */
@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .kpi-card {
    padding: 14px;
  }

  .kpi-val {
    font-size: 24px;
  }

  .kpi-icon {
    font-size: 22px;
  }

  .auth-card {
    padding: 20px 14px;
  }

  .auth-logo .logo-icon {
    font-size: 36px;
  }

  .logo-name {
    font-size: 22px;
  }

  .page-title {
    font-size: 20px;
  }

  .kanban-board {
    grid-template-columns: repeat(4, 80vw);
  }

  .btn {
    padding: 9px 14px;
    font-size: 13px;
  }
}