@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  /* HSL Color System */
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Dark Mode Variables (Default) */
  --bg-gradient-start: hsl(222, 47%, 10%);
  --bg-gradient-end: hsl(224, 64%, 5%);
  --panel-bg: rgba(30, 41, 59, 0.45);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text-primary: hsl(210, 40%, 98%);
  --text-secondary: hsl(215, 20%, 75%);
  --text-muted: hsl(215, 16%, 55%);
  
  --primary: hsl(250, 85%, 65%);
  --primary-glow: rgba(139, 92, 246, 0.35);
  --border-color: rgba(255, 255, 255, 0.1);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.4);
  --glass-glow: inset 0 1px 0 rgba(255, 255, 255, 0.1);

  /* Status Colors */
  --status-todo: hsl(215, 16%, 47%);
  --status-todo-bg: rgba(100, 116, 139, 0.15);
  --status-progress: hsl(217, 91%, 60%);
  --status-progress-bg: rgba(59, 130, 246, 0.15);
  --status-review: hsl(271, 91%, 65%);
  --status-review-bg: rgba(167, 139, 250, 0.15);
  --status-done: hsl(142, 70%, 45%);
  --status-done-bg: rgba(16, 185, 129, 0.15);
  
  /* Alert States */
  --alert-overdue: hsl(346, 84%, 60%);
  --alert-overdue-bg: rgba(239, 68, 68, 0.15);
  --alert-soon: hsl(38, 92%, 55%);
  --alert-soon-bg: rgba(245, 158, 11, 0.15);
  --alert-normal: hsl(215, 20%, 75%);
  --alert-normal-bg: rgba(255, 255, 255, 0.05);

  /* Card colors for members */
  --member-glow-opacity: 0.12;
}

/* Light Mode Overrides */
[data-theme="light"] {
  --bg-gradient-start: hsl(210, 40%, 96%);
  --bg-gradient-end: hsl(210, 30%, 92%);
  --panel-bg: rgba(255, 255, 255, 0.65);
  --panel-border: rgba(15, 23, 42, 0.06);
  --text-primary: hsl(222, 47%, 12%);
  --text-secondary: hsl(215, 25%, 27%);
  --text-muted: hsl(215, 16%, 45%);
  
  --primary: hsl(250, 80%, 55%);
  --primary-glow: rgba(139, 92, 246, 0.15);
  --border-color: rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 6px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 24px rgba(15, 23, 42, 0.12);
  --glass-glow: inset 0 1px 0 rgba(255, 255, 255, 0.6);

  --status-todo-bg: rgba(100, 116, 139, 0.1);
  --status-progress-bg: rgba(59, 130, 246, 0.1);
  --status-review-bg: rgba(167, 139, 250, 0.1);
  --status-done-bg: rgba(16, 185, 129, 0.1);
  
  --alert-overdue-bg: rgba(239, 68, 68, 0.1);
  --alert-soon-bg: rgba(245, 158, 11, 0.1);
  --alert-normal-bg: rgba(15, 23, 42, 0.04);
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Header & Switcher */
header {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: var(--panel-bg);
  border-bottom: 1px solid var(--panel-border);
  box-shadow: var(--shadow-sm), var(--glass-glow);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.brand-logo {
  font-size: 1.75rem;
  font-weight: 800;
  background: linear-gradient(135deg, hsl(250, 85%, 65%), hsl(320, 85%, 60%));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-logo span {
  font-size: 1rem;
  font-weight: 500;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: var(--status-progress-bg);
  color: var(--status-progress);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.controls-section {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Role Selector Buttons */
.role-picker {
  display: flex;
  background: rgba(0, 0, 0, 0.15);
  padding: 0.25rem;
  border-radius: 30px;
  border: 1px solid var(--panel-border);
}
[data-theme="light"] .role-picker {
  background: rgba(0, 0, 0, 0.05);
}

.role-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.5rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 25px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.role-btn:hover {
  color: var(--text-primary);
}

.role-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.theme-toggle-btn:hover {
  transform: rotate(15deg) scale(1.05);
  border-color: var(--text-muted);
}

/* Main Container Layout */
main {
  flex: 1;
  padding: 2rem;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* View Sections */
.view-section {
  display: none;
  animation: fadeIn 0.4s ease-out forwards;
}

.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- MANAGER VIEW STYLE --- */
.manager-dashboard {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

/* Stats Row */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.stat-card {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow-md), var(--glass-glow);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent-color, var(--primary));
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--accent-color, var(--primary));
}
[data-theme="light"] .stat-icon {
  background: rgba(0, 0, 0, 0.03);
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Glow Effect for Overdue */
.stat-card.overdue-alert {
  --accent-color: var(--alert-overdue);
}
.stat-card.overdue-alert.pulsing {
  animation: card-pulse-red 2s infinite alternate;
}
@keyframes card-pulse-red {
  0% {
    box-shadow: var(--shadow-md), var(--glass-glow);
  }
  100% {
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.35);
    border-color: rgba(239, 68, 68, 0.3);
  }
}

/* Dashboard Bottom Grid: Progress & Members */
.dashboard-details-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .dashboard-details-grid {
    grid-template-columns: 350px 1fr;
  }
}

/* Circular Progress Card */
.progress-pie-card {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow-md), var(--glass-glow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.progress-chart-container {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 1.5rem 0;
}

.progress-ring {
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

.progress-ring-circle-bg {
  stroke: var(--border-color);
}

.progress-ring-circle {
  stroke: var(--primary);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 0 4px var(--primary-glow));
}

.progress-percentage {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.25rem;
  font-weight: 800;
}

/* Team Status Cards Container */
.team-overview-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.section-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.member-overview-card {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow-md), var(--glass-glow);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all 0.3s ease;
  position: relative;
}

.member-overview-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), 0 8px 24px rgba(0, 0, 0, 0.15);
}

.member-card-glow {
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, var(--member-color) 0%, transparent 70%);
  opacity: var(--member-glow-opacity);
  pointer-events: none;
  border-radius: 0 16px 0 0;
}

.member-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.member-avatar-lg {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--member-color);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.member-card-info h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.member-card-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Card Progress Meter */
.member-progress-container {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.progress-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.progress-track {
  height: 8px;
  background: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--member-color), var(--primary));
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.member-tasks-preview {
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 110px;
  overflow-y: auto;
}

.member-task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
}
[data-theme="light"] .member-task-item {
  background: rgba(0, 0, 0, 0.02);
}

.member-task-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
  color: var(--text-secondary);
}

.member-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
}

/* Master Tasks Table section */
.master-tasks-section {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow-md), var(--glass-glow);
}

.master-header-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .master-header-controls {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.search-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  flex: 1;
  max-width: 600px;
}

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

.search-input-wrapper input {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--panel-border);
  padding: 0.6rem 1rem 0.6rem 2.25rem;
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.3s ease;
}
[data-theme="light"] .search-input-wrapper input {
  background: rgba(255, 255, 255, 0.6);
}

.search-input-wrapper input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow);
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
}

.filter-select {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--panel-border);
  padding: 0.6rem 1.5rem 0.6rem 0.75rem;
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
  min-width: 130px;
}
[data-theme="light"] .filter-select {
  background: rgba(255, 255, 255, 0.6);
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgba(15,23,42,0.5)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.filter-select:focus {
  border-color: var(--primary);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px var(--primary-glow);
}

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

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

/* Responsive Table */
.table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

th {
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-primary);
  font-weight: 600;
  padding: 1rem;
  border-bottom: 2px solid var(--border-color);
}
[data-theme="light"] th {
  background: rgba(0, 0, 0, 0.03);
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.015);
}
[data-theme="light"] tr:hover td {
  background: rgba(0, 0, 0, 0.01);
}

/* Status & User Pill Badges */
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.status-pill.todo {
  background: var(--status-todo-bg);
  color: var(--status-todo);
}
.status-pill.in_progress {
  background: var(--status-progress-bg);
  color: var(--status-progress);
}
.status-pill.review {
  background: var(--status-review-bg);
  color: var(--status-review);
}
.status-pill.done {
  background: var(--status-done-bg);
  color: var(--status-done);
}

.member-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  font-weight: 500;
  border: 1px solid var(--panel-border);
}
[data-theme="light"] .member-pill {
  background: rgba(0, 0, 0, 0.03);
}

.member-avatar-sm {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--member-color);
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

/* Empty states */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* --- KANBAN BOARD VIEW STYLE --- */
.kanban-view-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
  .kanban-view-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.member-details-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.kanban-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (min-width: 640px) {
  .kanban-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .kanban-container {
    grid-template-columns: repeat(4, 1fr);
  }
}

.kanban-column {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: var(--shadow-sm), var(--glass-glow);
  display: flex;
  flex-direction: column;
  max-height: 700px;
  transition: background 0.3s ease, border-color 0.3s ease;
  position: relative;
}

.kanban-column.drag-over {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
}
[data-theme="light"] .kanban-column.drag-over {
  background: rgba(0, 0, 0, 0.03);
}

.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.column-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1rem;
}

.column-title::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--col-color);
  box-shadow: 0 0 8px var(--col-color);
}

.column-todo { --col-color: var(--status-todo); }
.column-progress { --col-color: var(--status-progress); }
.column-review { --col-color: var(--status-review); }
.column-done { --col-color: var(--status-done); }

.column-count {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.2rem 0.5rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}
[data-theme="light"] .column-count {
  background: rgba(0, 0, 0, 0.05);
}

/* Kanban Cards Stack */
.cards-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  min-height: 250px;
  padding-bottom: 1rem;
}

/* Task Card Style */
.task-card {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  cursor: grab;
  position: relative;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-left: 4px solid var(--member-color, var(--primary));
  user-select: none;
}
[data-theme="light"] .task-card {
  background: rgba(255, 255, 255, 0.45);
}

.task-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-color);
  background: rgba(255, 255, 255, 0.04);
}
[data-theme="light"] .task-card:hover {
  background: rgba(255, 255, 255, 0.8);
}

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

.task-card.dragging {
  opacity: 0.35;
  transform: scale(0.95);
  box-shadow: none;
}

.card-title {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
  color: var(--text-primary);
}

.card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.25rem;
}

/* Deadline Badges */
.deadline-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
}

.deadline-badge.overdue {
  background: var(--alert-overdue-bg);
  color: var(--alert-overdue);
  border: 1px solid rgba(239, 68, 68, 0.2);
  animation: pulse-red 2s infinite alternate;
}
@keyframes pulse-red {
  0% { opacity: 0.85; }
  100% { opacity: 1; box-shadow: 0 0 6px rgba(239, 68, 68, 0.2); }
}

.deadline-badge.due-soon {
  background: var(--alert-soon-bg);
  color: var(--alert-soon);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.deadline-badge.normal {
  background: var(--alert-normal-bg);
  color: var(--alert-normal);
}

.btn-add-card-col {
  background: transparent;
  border: 1px dashed var(--border-color);
  color: var(--text-muted);
  width: 100%;
  padding: 0.6rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  transition: all 0.2s ease;
}

.btn-add-card-col:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
}

/* --- MODAL DIALOG STYLE --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 15, 30, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.modal-container {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  width: 90%;
  max-width: 550px;
  box-shadow: var(--shadow-lg), var(--glass-glow);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.modal-overlay.active .modal-container {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-body {
  padding: 1.5rem;
  max-height: 70vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Form layouts */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

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

.form-input, .form-textarea, .form-select {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--panel-border);
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  width: 100%;
  transition: all 0.3s ease;
}
[data-theme="light"] .form-input, 
[data-theme="light"] .form-textarea, 
[data-theme="light"] .form-select {
  background: rgba(255, 255, 255, 0.7);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow);
}

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

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

@media (min-width: 480px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
}

.modal-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--panel-border);
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}
[data-theme="light"] .btn-secondary {
  background: rgba(0, 0, 0, 0.04);
}

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

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--alert-overdue);
  border: 1px solid rgba(239, 68, 68, 0.2);
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-danger:hover {
  background: var(--alert-overdue);
  color: white;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.25);
}

/* Comments section inside detail view */
.comments-section {
  border-top: 1px solid var(--border-color);
  padding-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 150px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.comment-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
[data-theme="light"] .comment-item {
  background: rgba(0, 0, 0, 0.015);
}

.comment-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
}

.comment-author {
  color: var(--primary);
}

.comment-date {
  color: var(--text-muted);
}

.comment-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.comment-input-row {
  display: flex;
  gap: 0.5rem;
}

.comment-input-row input {
  flex: 1;
}

/* Footer info */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--panel-border);
  margin-top: auto;
}
