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

/* --- CSS Variables & Design System --- */
:root {
  --font-primary: 'Inter', 'Kanit', sans-serif;
  
  /* Color Palette - Premium Dark Theme */
  --bg-primary: #0b0c16;
  --bg-secondary: #121426;
  --glass-bg: rgba(20, 22, 45, 0.55);
  --glass-bg-hover: rgba(30, 33, 65, 0.7);
  --glass-border: rgba(255, 255, 255, 0.07);
  --glass-border-glow: rgba(99, 102, 241, 0.3);
  
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  /* Accent Colors */
  --color-primary: #6366f1; /* Indigo */
  --color-primary-glow: rgba(99, 102, 241, 0.15);
  --color-accent: #00f2fe; /* Cyan */
  
  /* Status Colors */
  --status-todo: #8b5cf6;       /* Violet */
  --status-inprogress: #f59e0b; /* Amber */
  --status-inreview: #ec4899;   /* Pink */
  --status-done: #10b981;       /* Emerald */
  
  /* Alert Colors */
  --alert-danger: #ef4444;      /* Red (Overdue) */
  --alert-warning: #f97316;     /* Orange (Due Today) */
  --alert-info: #06b6d4;        /* Cyan (Future) */

  /* UI Spacing & Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Light Theme Variables (Optional Toggle capability) */
[data-theme="light"] {
  --bg-primary: #f0f2f5;
  --bg-secondary: #ffffff;
  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-bg-hover: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-border-glow: rgba(99, 102, 241, 0.2);
  --text-primary: #1f2937;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --color-primary: #4f46e5;
  --color-primary-glow: rgba(79, 70, 229, 0.1);
  --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.08);
}

/* --- Reset & Base Styles --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(0, 242, 254, 0.08) 0%, transparent 45%);
  background-attachment: fixed;
  transition: background-color 0.5s ease;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* --- Layout Structure --- */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 0 2rem;
  max-width: 1600px;
  margin: 0 auto;
}

/* Header & Glass Nav */
header {
  margin-top: 1.5rem;
  margin-bottom: 2rem;
  padding: 1.25rem 2rem;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

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

.logo-section svg {
  fill: var(--color-accent);
  filter: drop-shadow(0 0 8px rgba(0, 242, 254, 0.5));
}

.logo-section h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #ffffff, var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

/* Dropdown Switcher */
.role-switcher-container {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.switcher-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.custom-select {
  appearance: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.5rem 2.25rem 0.5rem 1rem;
  font-family: var(--font-primary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23ffffff'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
}

[data-theme="light"] .custom-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%231f2937'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
}

.custom-select:hover, .custom-select:focus {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-glow);
}

/* IconButton & Theme Toggle */
.btn-icon {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-accent);
  border-color: var(--color-accent);
}

/* Glass Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), #4f46e5);
  color: #ffffff;
  border: none;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.4);
  transition: var(--transition);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 rgba(99, 102, 241, 0.6);
  filter: brightness(1.1);
}

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}

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

/* --- View Sections (Boss/Member Toggle) --- */
.view-section {
  display: none;
  animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

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

/* --- BOSS VIEW DESIGN --- */
.boss-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.view-title {
  font-size: 1.5rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.view-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 24px;
  background: var(--color-accent);
  border-radius: 2px;
}

/* Dashboard Summary Cards Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.summary-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.summary-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--color-primary);
  opacity: 0.5;
}

.summary-card:hover {
  transform: translateY(-5px);
  border-color: var(--glass-border-glow);
  box-shadow: 0 12px 40px 0 rgba(99, 102, 241, 0.15);
}

.summary-info h3 {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.summary-info .count {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.summary-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

/* Card Themes colors */
.card-total::after { background: var(--color-primary); }
.card-total .summary-icon { background: rgba(99, 102, 241, 0.15); color: var(--color-primary); }

.card-todo::after { background: var(--status-todo); }
.card-todo .summary-icon { background: rgba(139, 92, 246, 0.15); color: var(--status-todo); }

.card-progress::after { background: var(--status-inprogress); }
.card-progress .summary-icon { background: rgba(245, 158, 11, 0.15); color: var(--status-inprogress); }

.card-review::after { background: var(--status-inreview); }
.card-review .summary-icon { background: rgba(236, 72, 153, 0.15); color: var(--status-inreview); }

.card-done::after { background: var(--status-done); }
.card-done .summary-icon { background: rgba(16, 185, 129, 0.15); color: var(--status-done); }

.card-overdue::after { background: var(--alert-danger); }
.card-overdue .summary-icon { 
  background: rgba(239, 68, 68, 0.15); 
  color: var(--alert-danger);
  animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Visual Dashboard Charts Section */
.boss-details-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 1024px) {
  .boss-details-row {
    grid-template-columns: 1fr;
  }
}

.details-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.details-card h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.75rem;
}

/* User Progress Stats */
.team-progress-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.user-progress-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.user-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

.user-name {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-avatar-tag {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.user-stats-percent {
  color: var(--text-secondary);
  font-weight: 500;
}

.progress-bar-container {
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1s ease-out;
}

.progress-done { background: var(--status-done); }
.progress-review { background: var(--status-inreview); }
.progress-inprogress { background: var(--status-inprogress); }
.progress-todo { background: var(--status-todo); }

.user-mini-legend {
  display: flex;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.legend-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 3px;
}

/* Boss Master Tasks Table */
.master-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-sm);
}

.boss-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.boss-table th {
  padding: 1rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 2px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.01);
}

.boss-table td {
  padding: 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.boss-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Member Badges in Table */
.assignee-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.6rem;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid var(--glass-border);
}

.assignee-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
}

/* Status Pill in Table */
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

.pill-todo { background: rgba(139, 92, 246, 0.15); color: #c4b5fd; border: 1px solid rgba(139, 92, 246, 0.3); }
.pill-inprogress { background: rgba(245, 158, 11, 0.15); color: #fde047; border: 1px solid rgba(245, 158, 11, 0.3); }
.pill-inreview { background: rgba(236, 72, 153, 0.15); color: #fbcfe8; border: 1px solid rgba(236, 72, 153, 0.3); }
.pill-done { background: rgba(16, 185, 129, 0.15); color: #a7f3d0; border: 1px solid rgba(16, 185, 129, 0.3); }

/* Deadline Status tags */
.deadline-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.deadline-overdue {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.2);
  animation: shake 0.5s ease-in-out;
}

.deadline-today {
  background: rgba(249, 115, 22, 0.15);
  color: #fed7aa;
  border: 1px solid rgba(249, 115, 22, 0.2);
}

.deadline-normal {
  color: var(--text-secondary);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

/* Action buttons in Table/Cards */
.action-buttons-group {
  display: flex;
  gap: 0.5rem;
}

.btn-table-action {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: var(--transition);
}

.btn-table-action:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-approve {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.2);
  color: #a7f3d0;
}
.btn-approve:hover {
  background: rgba(16, 185, 129, 0.25);
  border-color: var(--status-done);
}

.btn-reject {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}
.btn-reject:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: var(--alert-danger);
}

/* --- KANBAN BOARD DESIGN --- */
.kanban-board-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.kanban-layout {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  align-items: start;
  margin-bottom: 2rem;
}

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

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

/* Kanban Columns */
.kanban-column {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1rem;
  min-height: 600px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.kanban-column.drag-over {
  background: rgba(99, 102, 241, 0.08);
  border-color: var(--color-primary);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.04);
  margin-bottom: 0.5rem;
}

.column-title-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.column-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.col-todo .column-dot { background: var(--status-todo); box-shadow: 0 0 8px var(--status-todo); }
.col-inprogress .column-dot { background: var(--status-inprogress); box-shadow: 0 0 8px var(--status-inprogress); }
.col-inreview .column-dot { background: var(--status-inreview); box-shadow: 0 0 8px var(--status-inreview); }
.col-done .column-dot { background: var(--status-done); box-shadow: 0 0 8px var(--status-done); }

.column-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.column-counter {
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.2rem 0.5rem;
  border-radius: 10px;
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
}

/* Kanban Cards Stack */
.cards-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex-grow: 1;
  min-height: 480px;
  overflow-y: auto;
  padding: 0.25rem 0.1rem;
}

/* Kanban Card */
.task-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 1rem;
  cursor: grab;
  position: relative;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.2s, background-color 0.2s;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.task-card:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

.task-card.dragging {
  opacity: 0.4;
  transform: scale(0.95) rotate(-2deg);
  border: 1px dashed var(--color-primary);
  box-shadow: none;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.card-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 0.5rem;
  word-wrap: break-word;
}

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

.card-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  padding-top: 0.6rem;
  margin-top: 0.25rem;
  color: var(--text-muted);
}

.card-dates {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.card-date-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.card-actions {
  display: flex;
  gap: 0.25rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

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

.btn-card-action {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-card-action:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.btn-card-delete:hover {
  color: var(--alert-danger);
  background: rgba(239, 68, 68, 0.1);
}

/* Empty State Styling inside columns */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  border: 1px dashed rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
  margin: auto 0;
}

.empty-state svg {
  margin-bottom: 0.5rem;
  fill: var(--text-muted);
  opacity: 0.5;
}

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

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

.modal-content {
  background: var(--glass-bg);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  padding: 2rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

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

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

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

/* Modal Form Fields */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.65rem 0.9rem;
  font-family: var(--font-primary);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--color-primary);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 3px var(--color-primary-glow);
}

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

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

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

/* --- TOAST SYSTEM --- */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: rgba(18, 20, 38, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  padding: 0.9rem 1.5rem;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow);
  transform: translateY(100px);
  opacity: 0;
  animation: slideInUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  position: relative;
  overflow: hidden;
  border-left: 4px solid var(--color-primary);
}

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

.toast.toast-success { border-left-color: var(--status-done); }
.toast.toast-error { border-left-color: var(--alert-danger); }
.toast.toast-warning { border-left-color: var(--alert-warning); }

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