:root {
  --bg-dark: #0a0c10;
  --bg-card: rgba(18, 22, 32, 0.85);
  --bg-card-hover: rgba(26, 32, 46, 0.95);
  --bg-column: rgba(13, 17, 26, 0.65);
  --bg-input: rgba(22, 27, 39, 0.9);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(168, 85, 247, 0.6);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-sub: #6b7280;

  --accent-primary: #8b5cf6;
  --accent-primary-hover: #7c3aed;
  --accent-glow: rgba(139, 92, 246, 0.25);
  --accent-cyan: #06b6d4;
  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --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-glow: 0 0 25px rgba(139, 92, 246, 0.35);

  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Ambient Background Glow */
.glow-orb {
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.15;
}
.glow-orb-1 {
  top: -100px;
  left: -100px;
  background: radial-gradient(circle, #8b5cf6, #3b82f6);
}
.glow-orb-2 {
  bottom: 50px;
  right: -100px;
  background: radial-gradient(circle, #ec4899, #8b5cf6);
}

.app-container {
  position: relative;
  z-index: 1;
  max-width: 1560px;
  margin: 0 auto;
  padding: 0 24px 40px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-badge {
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 1px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 16px var(--accent-glow);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-item {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.divider-v {
  width: 1px;
  height: 24px;
  background: var(--border-color);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.85rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), #6366f1);
  color: #fff;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-primary-hover), #4f46e5);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border-color: var(--border-color);
  backdrop-filter: blur(10px);
}

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

.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  color: #ff6b81;
  border-color: rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
  background: rgba(244, 63, 94, 0.3);
}

.btn-link {
  background: none;
  border: none;
  color: #c084fc;
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}

.btn-link:hover {
  color: #e9d5ff;
}

/* Hero Section */
.hero-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  padding: 40px 0 24px;
  flex-wrap: wrap;
}

.hero-content {
  max-width: 600px;
}

.tag-pill {
  display: inline-block;
  background: rgba(139, 92, 246, 0.15);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.3);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.hero-section h1 {
  font-size: 2.3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #fff 40%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.stats-grid {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  min-width: 120px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}

.stat-card.highlight {
  border-color: rgba(139, 92, 246, 0.4);
  background: rgba(139, 92, 246, 0.08);
}

.stat-num {
  font-size: 1.7rem;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-mono);
}

.stat-card.highlight .stat-num {
  color: #c084fc;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-top: 4px;
}

/* Toolbar */
.board-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  flex: 1;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 260px;
  flex: 1;
  max-width: 360px;
}

.search-icon {
  position: absolute;
  left: 12px;
  font-size: 0.9rem;
  pointer-events: none;
  opacity: 0.6;
}

.search-box input {
  width: 100%;
  padding: 10px 36px 10px 38px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: all 0.2s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 12px var(--accent-glow);
}

.btn-clear {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-sub);
  cursor: pointer;
  font-size: 0.85rem;
}

.btn-clear:hover {
  color: #fff;
}

.filter-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-chip:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.filter-chip.active {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
  box-shadow: 0 0 12px var(--accent-glow);
}

/* Admin Banner */
.admin-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.35);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.admin-banner-text {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: #a855f7;
  border-radius: 50%;
  box-shadow: 0 0 8px #a855f7;
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

/* Kanban Board Grid */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  align-items: flex-start;
  flex: 1;
  min-height: 480px;
}

@media (max-width: 1100px) {
  .kanban-board {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .kanban-board {
    grid-template-columns: 1fr;
  }
}

/* Columns */
.kanban-col {
  background: var(--bg-column);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  min-height: 400px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, background-color 0.2s;
}

.kanban-col.drag-over {
  border-color: var(--accent-primary);
  background: rgba(139, 92, 246, 0.08);
}

.col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-color);
}

.col-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.col-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.col-title {
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}

.col-count {
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--text-muted);
}

.col-tasks-list {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 150px;
}

/* Task Cards */
.task-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.task-card.draggable {
  cursor: grab;
}

.task-card.draggable:active {
  cursor: grabbing;
}

.task-card.dragging {
  opacity: 0.4;
  transform: scale(0.96);
  border-color: var(--accent-primary);
}

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

.card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.badge-cat {
  background: rgba(255, 255, 255, 0.07);
  color: #cbd5e1;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-priority {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.priority-high {
  background: rgba(244, 63, 94, 0.15);
  color: #f43f5e;
}
.priority-medium {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}
.priority-low {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.card-admin-actions {
  display: flex;
  gap: 4px;
}

.btn-card-icon {
  background: none;
  border: none;
  color: var(--text-sub);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 0.85rem;
  transition: color 0.15s, background 0.15s;
}

.btn-card-icon:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.card-title {
  font-weight: 600;
  font-size: 0.96rem;
  line-height: 1.4;
  color: #fff;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  white-space: pre-line;
  word-break: break-word;
}

.card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.78rem;
  color: var(--text-sub);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-author {
  color: var(--text-muted);
}

/* Upvote Button */
.btn-vote {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--font-mono);
}

.btn-vote:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.4);
  color: #c084fc;
  transform: scale(1.05);
}

.btn-vote.voted {
  background: rgba(139, 92, 246, 0.25);
  border-color: var(--accent-primary);
  color: #d8b4fe;
}

.empty-col-placeholder {
  text-align: center;
  padding: 30px 10px;
  color: var(--text-sub);
  font-size: 0.85rem;
  font-style: italic;
}

/* Loading & Empty States */
.board-loading {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 60px 0;
  color: var(--text-muted);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

.modal-backdrop.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: #121620;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  padding: 28px;
  width: 100%;
  max-width: 540px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(139, 92, 246, 0.15);
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-card.modal-sm {
  max-width: 400px;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
}

.btn-close:hover {
  color: #fff;
}

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

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

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 12px var(--accent-glow);
}

.modal-info {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.error-msg {
  color: #ff6b81;
  font-size: 0.85rem;
  margin-bottom: 14px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.modal-actions.space-between {
  justify-content: space-between;
}

.actions-right {
  display: flex;
  gap: 12px;
}

/* Toast System */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #1a202c;
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.success {
  border-color: rgba(16, 185, 129, 0.4);
  background: #0f241d;
}

.toast.error {
  border-color: rgba(244, 63, 94, 0.4);
  background: #281119;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Footer */
.app-footer {
  margin-top: auto;
  padding: 30px 0 10px;
  border-top: 1px solid var(--border-color);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-sub);
  flex-wrap: wrap;
  gap: 12px;
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: #fff;
}

.hidden {
  display: none !important;
}
