:root {
  color-scheme: dark;
  --bg: #0b1120;
  --bg-alt: rgba(15, 23, 42, 0.7);
  --surface: rgba(30, 41, 59, 0.55);
  --surface-hover: rgba(51, 65, 85, 0.65);
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #38bdf8;
  --primary-glow: rgba(56, 189, 248, 0.35);
  --accent: #2dd4bf;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(56, 189, 248, 0.4);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --purple: #a855f7;
  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  --shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg);
  background-image: 
    radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(45, 212, 191, 0.1) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  width: min(1280px, calc(100% - 3rem));
  margin: 0 auto;
}

/* Typography */
h1, h2, h3, h4 {
  color: #ffffff;
  font-weight: 700;
  line-height: 1.25;
}

.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.small { font-size: 0.85rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-full);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-decoration: none;
}

.btn-sm {
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #0b1120;
  box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--primary-glow);
}

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

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-outline:hover {
  background: rgba(56, 189, 248, 0.1);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

/* Header & Navigation */
.app-header {
  background: rgba(11, 17, 32, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 1.2rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #0b1120;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 0 20px var(--primary-glow);
}

.brand-title {
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.badge-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(56, 189, 248, 0.15);
  color: var(--primary);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

/* Main Layout */
.main-content {
  padding: 2.5rem 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

/* Metrics Cards */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  backdrop-filter: blur(12px);
  transition: var(--transition);
}

.metric-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
}

.metric-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.icon-blue { background: rgba(56, 189, 248, 0.15); color: var(--primary); }
.icon-emerald { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.icon-amber { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.icon-purple { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

.metric-label { font-size: 0.85rem; color: var(--text-muted); display: block; }
.metric-value { font-size: 1.7rem; font-weight: 800; color: #ffffff; margin: 0.1rem 0; }
.metric-sub { font-size: 0.78rem; color: var(--text-muted); }

/* Progress Card */
.progress-card {
  padding: 1.2rem 1.8rem;
  margin-bottom: 1.5rem;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.progress-track {
  height: 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.6s ease;
}

/* Filter Card */
.filter-card {
  padding: 1.2rem 1.8rem;
  margin-bottom: 2rem;
}

.filter-flex {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.search-input-wrapper {
  position: relative;
  flex-grow: 1;
  min-width: 250px;
}

.search-icon {
  position: absolute;
  left: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  padding-left: 2.8rem !important;
}

.filter-controls {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.form-control {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

/* Kanban Grid */
.kanban-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.8rem;
  align-items: start;
}

.kanban-col {
  padding: 1.4rem;
  min-height: 550px;
  background: rgba(15, 23, 42, 0.6);
}

.col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
  padding-bottom: 0.8rem;
  border-bottom: 2px solid var(--border);
}

.col-todo { border-color: var(--primary); }
.col-progress { border-color: var(--warning); }
.col-done { border-color: var(--success); }

.col-count {
  font-family: 'Fira Code', monospace;
  font-size: 0.82rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
}

.col-tasks {
  display: grid;
  gap: 1rem;
}

/* Task Item Card */
.task-item {
  background: #0f172a;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.2rem;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}

.task-item:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.task-tags {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.tag-cat {
  font-family: 'Fira Code', monospace;
  font-size: 0.75rem;
  color: var(--accent);
  background: rgba(45, 212, 191, 0.1);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
}

.tag-prio {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
}

.prio-high { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.prio-medium { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.prio-low { background: rgba(56, 189, 248, 0.15); color: var(--primary); border: 1px solid rgba(56, 189, 248, 0.3); }

.task-title {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  line-height: 1.35;
}

.task-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.task-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.task-actions {
  display: flex;
  gap: 0.4rem;
}

.btn-task-act {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-task-act:hover { color: var(--primary); }
.btn-task-act.delete:hover { color: var(--danger); }

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 17, 32, 0.85);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: min(600px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: #0f172a;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  padding: 2.2rem;
  position: relative;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 1.2rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.8rem;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close:hover { color: #ffffff; }

.modal-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.8rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.2rem;
}

.modal-header-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.15);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.task-form {
  display: grid;
  gap: 1.2rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

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

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
  margin-top: 1.8rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--accent);
  color: #0b1120;
  font-weight: 700;
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(20px);
  transition: var(--transition);
  pointer-events: none;
  z-index: 2000;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 992px) {
  .kanban-grid {
    grid-template-columns: 1fr;
  }
}
