/* ===========================
   TASKFLOW — Apple-Inspired
   Light Glassmorphism Design
   =========================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ---- CSS Variables ---- */
:root {
  --bg-primary: #f5f5f7;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.72);
  --bg-card-hover: rgba(255, 255, 255, 0.9);
  --bg-sidebar: rgba(255, 255, 255, 0.82);
  --bg-input: rgba(245, 245, 247, 0.8);

  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-muted: #aeaeb2;

  --accent-primary: #0071e3;
  --accent-primary-hover: #0077ED;
  --accent-secondary: #34c759;
  --accent-warning: #ff9f0a;
  --accent-danger: #ff3b30;
  --accent-info: #5ac8fa;
  --accent-purple: #af52de;

  --gradient-primary: linear-gradient(135deg, #0071e3 0%, #5ac8fa 100%);
  --gradient-accent: linear-gradient(135deg, #af52de 0%, #5ac8fa 100%);
  --gradient-warm: linear-gradient(135deg, #ff9f0a 0%, #ff375f 100%);

  --border-color: rgba(0, 0, 0, 0.06);
  --border-active: rgba(0, 113, 227, 0.3);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.12);
  --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.06);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --radius-full: 100px;

  --sidebar-width: 260px;
  --topbar-height: 60px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-slow: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-blur: blur(20px);
  --glass-saturate: saturate(180%);
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(0, 113, 227, 0.04) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(175, 82, 222, 0.03) 0%, transparent 60%),
    radial-gradient(ellipse at 60% 80%, rgba(52, 199, 89, 0.03) 0%, transparent 60%);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-primary-hover);
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

/* ============================
   LOGIN / REGISTER PAGE
   ============================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
  position: relative;
  overflow: hidden;
}

.auth-page::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0, 113, 227, 0.08) 0%, transparent 70%);
  top: -150px;
  right: -150px;
  border-radius: 50%;
  animation: float-gentle 8s ease-in-out infinite alternate;
}

.auth-page::after {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(175, 82, 222, 0.06) 0%, transparent 70%);
  bottom: -100px;
  left: -100px;
  border-radius: 50%;
  animation: float-gentle 8s ease-in-out 4s infinite alternate;
}

@keyframes float-gentle {
  0% {
    transform: translateY(0) scale(1);
  }

  100% {
    transform: translateY(-20px) scale(1.05);
  }
}

.auth-container {
  width: 100%;
  max-width: 400px;
  padding: 40px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: var(--glass-blur) var(--glass-saturate);
  -webkit-backdrop-filter: var(--glass-blur) var(--glass-saturate);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
  animation: slide-up 0.6s var(--transition-slow) forwards;
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-container .logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-container .logo h1 {
  font-size: 1.8rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.auth-container .logo p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 4px;
}

/* ---- Forms ---- */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: -0.1px;
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: all var(--transition-fast);
  outline: none;
}

.form-control:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
  background: #fff;
}

.form-control::placeholder {
  color: var(--text-muted);
}

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236e6e73' 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 12px center;
  padding-right: 36px;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: flex;
  gap: 14px;
}

.form-row .form-group {
  flex: 1;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  outline: none;
  white-space: nowrap;
  letter-spacing: -0.1px;
}

.btn-primary {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.25);
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 113, 227, 0.3);
}

.btn-secondary {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(0, 0, 0, 0.08);
}

.btn-danger {
  background: rgba(255, 59, 48, 0.08);
  color: var(--accent-danger);
  border: 1px solid rgba(255, 59, 48, 0.12);
}

.btn-danger:hover {
  background: rgba(255, 59, 48, 0.14);
}

.btn-success {
  background: rgba(52, 199, 89, 0.08);
  color: var(--accent-secondary);
  border: 1px solid rgba(52, 199, 89, 0.12);
}

.btn-success:hover {
  background: rgba(52, 199, 89, 0.14);
}

.btn-warning {
  background: rgba(255, 159, 10, 0.08);
  color: var(--accent-warning);
  border: 1px solid rgba(255, 159, 10, 0.12);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 0.78rem;
}

.btn-lg {
  padding: 13px 28px;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* ============================
   LAYOUT: SIDEBAR + MAIN
   ============================ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-width);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: var(--glass-blur) var(--glass-saturate);
  -webkit-backdrop-filter: var(--glass-blur) var(--glass-saturate);
  border-right: 1px solid var(--border-color);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal);
}

.sidebar-header {
  padding: 20px 22px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
  font-size: 1.25rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.sidebar-header span {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

.sidebar-nav {
  flex: 1;
  padding: 14px 10px;
  overflow-y: auto;
}

.nav-section {
  margin-bottom: 20px;
}

.nav-section-title {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0 12px;
  margin-bottom: 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  margin-bottom: 1px;
}

.nav-link:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
}

.nav-link.active {
  background: rgba(0, 113, 227, 0.08);
  color: var(--accent-primary);
  font-weight: 600;
}

.nav-link .nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
}

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border-color);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: #fff;
  flex-shrink: 0;
}

.user-info .user-details {
  flex: 1;
  min-width: 0;
}

.user-info .user-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-info .user-role {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ---- Main Content ---- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

/* ---- Top Bar ---- */
.topbar {
  height: var(--topbar-height);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: var(--glass-blur) var(--glass-saturate);
  -webkit-backdrop-filter: var(--glass-blur) var(--glass-saturate);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.2px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-content {
  padding: 24px 28px;
}

/* ============================
   STAT CARDS
   ============================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px) var(--glass-saturate);
  -webkit-backdrop-filter: blur(16px) var(--glass-saturate);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-md);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-xs);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card .stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 12px;
}

.stat-card .stat-icon.purple {
  background: rgba(175, 82, 222, 0.1);
  color: var(--accent-purple);
}

.stat-card .stat-icon.green {
  background: rgba(52, 199, 89, 0.1);
  color: var(--accent-secondary);
}

.stat-card .stat-icon.orange {
  background: rgba(255, 159, 10, 0.1);
  color: var(--accent-warning);
}

.stat-card .stat-icon.blue {
  background: rgba(0, 113, 227, 0.08);
  color: var(--accent-primary);
}

.stat-card .stat-icon.red {
  background: rgba(255, 59, 48, 0.08);
  color: var(--accent-danger);
}

.stat-value {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 2px;
  letter-spacing: -0.5px;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ============================
   TABLES
   ============================ */
.table-container {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px) var(--glass-saturate);
  -webkit-backdrop-filter: blur(16px) var(--glass-saturate);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.table-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  padding: 10px 20px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: rgba(0, 0, 0, 0.015);
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 12px 20px;
  font-size: 0.88rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr {
  transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
  background: rgba(0, 113, 227, 0.02);
}

/* ============================
   BADGES / TAGS
   ============================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1px;
}

.badge-todo {
  background: rgba(174, 174, 178, 0.12);
  color: #8e8e93;
}

.badge-in_progress,
.badge-in-progress {
  background: rgba(0, 113, 227, 0.08);
  color: var(--accent-primary);
}

.badge-in_review,
.badge-in-review {
  background: rgba(255, 159, 10, 0.1);
  color: #c97e00;
}

.badge-done {
  background: rgba(52, 199, 89, 0.1);
  color: #248a3d;
}

.badge-active {
  background: rgba(52, 199, 89, 0.1);
  color: #248a3d;
}

.badge-archived,
.badge-inactive {
  background: rgba(174, 174, 178, 0.12);
  color: #8e8e93;
}

.badge-low {
  background: rgba(52, 199, 89, 0.1);
  color: #248a3d;
}

.badge-medium {
  background: rgba(0, 113, 227, 0.08);
  color: var(--accent-primary);
}

.badge-high {
  background: rgba(255, 159, 10, 0.1);
  color: #c97e00;
}

.badge-critical {
  background: rgba(255, 59, 48, 0.08);
  color: var(--accent-danger);
}

.badge-admin {
  background: rgba(175, 82, 222, 0.08);
  color: var(--accent-purple);
}

.badge-user {
  background: rgba(0, 113, 227, 0.08);
  color: var(--accent-primary);
}

/* ============================
   KANBAN BOARD
   ============================ */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  min-height: 500px;
}

.kanban-column {
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(14px) var(--glass-saturate);
  -webkit-backdrop-filter: blur(14px) var(--glass-saturate);
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  min-height: 400px;
}

.kanban-column-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kanban-column-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kanban-column-title .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.kanban-column-title .dot.gray {
  background: #aeaeb2;
}

.kanban-column-title .dot.blue {
  background: var(--accent-primary);
}

.kanban-column-title .dot.yellow {
  background: var(--accent-warning);
}

.kanban-column-title .dot.green {
  background: var(--accent-secondary);
}

.kanban-count {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.04);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.kanban-cards {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kanban-cards.drag-over {
  background: rgba(0, 113, 227, 0.03);
  border: 2px dashed rgba(0, 113, 227, 0.2);
  border-radius: var(--radius-sm);
}

.kanban-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: grab;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-xs);
}

.kanban-card:active {
  cursor: grabbing;
}

.kanban-card:hover {
  border-color: var(--border-active);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.kanban-card.dragging {
  opacity: 0.4;
  transform: rotate(2deg);
}

.kanban-card-title {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 8px;
  cursor: pointer;
  letter-spacing: -0.1px;
}

.kanban-card-title:hover {
  color: var(--accent-primary);
}

.kanban-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.kanban-card-meta span {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 3px;
}

.kanban-card--child {
  border-left: 3px solid var(--accent-primary);
}

.kanban-card-parent {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 6px;
  font-style: italic;
}

.kanban-card-children {
  margin-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding-top: 6px;
}

.kanban-card-children-toggle {
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  padding: 2px 0;
}

.kanban-card-children-toggle:hover {
  color: var(--accent-primary);
}

.kanban-card-children-list {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kanban-children-group {
  margin-bottom: 4px;
}

.kanban-children-group-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 4px 4px 2px;
  margin-top: 2px;
}

.kanban-child-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px 3px 16px;
  font-size: 0.75rem;
  cursor: grab;
  border-radius: 4px;
  transition: background var(--transition-fast);
}

.kanban-child-item:hover {
  background: rgba(0, 0, 0, 0.03);
}

.kanban-child-item.dragging {
  opacity: 0.4;
}

.kanban-child-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.kanban-child-dot.todo {
  background: #aeaeb2;
}

.kanban-child-dot.in_progress {
  background: var(--accent-primary);
}

.kanban-child-dot.in_review {
  background: var(--accent-warning);
}

.kanban-child-dot.done {
  background: var(--accent-secondary);
}

.kanban-child-title {
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  cursor: pointer;
}

.kanban-child-title:hover {
  color: var(--accent-primary);
}

.kanban-child-title.done {
  text-decoration: line-through;
  color: var(--text-muted);
}

.kanban-child-status {
  font-size: 0.65rem;
  color: var(--text-muted);
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 600;
}

.view-toggle {
  display: inline-flex;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.view-toggle-btn {
  padding: 5px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.view-toggle-btn:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.03);
}

.view-toggle-btn.active {
  background: var(--accent-primary);
  color: #fff;
}

/* ============================
   MODALS
   ============================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(30px) var(--glass-saturate);
  -webkit-backdrop-filter: blur(30px) var(--glass-saturate);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 540px;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.96);
  transition: transform var(--transition-normal);
  box-shadow: var(--shadow-lg);
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.modal-close {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.1rem;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: rgba(255, 59, 48, 0.08);
  color: var(--accent-danger);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ============================
   TOAST NOTIFICATIONS
   ============================ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 260px;
  max-width: 380px;
  box-shadow: var(--shadow-md);
  animation: toast-in 0.3s ease forwards;
  backdrop-filter: blur(20px) var(--glass-saturate);
  -webkit-backdrop-filter: blur(20px) var(--glass-saturate);
}

.toast.toast-out {
  animation: toast-out 0.3s ease forwards;
}

.toast-success {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(52, 199, 89, 0.2);
  color: #248a3d;
}

.toast-error {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 59, 48, 0.2);
  color: var(--accent-danger);
}

.toast-info {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 113, 227, 0.15);
  color: var(--accent-primary);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(50px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(50px);
  }
}

/* ============================
   FILTER BAR
   ============================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px) var(--glass-saturate);
  -webkit-backdrop-filter: blur(14px) var(--glass-saturate);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-md);
  margin-bottom: 18px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-xs);
}

.filter-bar .form-control {
  max-width: 200px;
}

.filter-bar label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-right: -4px;
}

/* ============================
   TASK DETAIL
   ============================ */
.task-detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.detail-section {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px) var(--glass-saturate);
  -webkit-backdrop-filter: blur(16px) var(--glass-saturate);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-md);
  margin-bottom: 18px;
  box-shadow: var(--shadow-xs);
}

.detail-section-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.detail-section-header h3 {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.detail-section-body {
  padding: 18px;
}

.subtask-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.subtask-item:last-child {
  border-bottom: none;
}

.subtask-hours-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 9px;
  background: rgba(0, 113, 227, 0.06);
  border: 1px solid rgba(0, 113, 227, 0.12);
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.subtask-hours-badge:hover {
  background: rgba(0, 113, 227, 0.1);
  border-color: rgba(0, 113, 227, 0.25);
}

.subtask-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.12);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.subtask-checkbox.checked {
  background: var(--accent-secondary);
  border-color: var(--accent-secondary);
}

.subtask-checkbox.checked::after {
  content: '✓';
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
}

.subtask-title {
  flex: 1;
  font-size: 0.88rem;
}

.subtask-title.done {
  text-decoration: line-through;
  color: var(--text-muted);
}

.time-log-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.time-log-item:last-child {
  border-bottom: none;
}

.time-log-hours {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-primary);
  min-width: 48px;
}

.time-log-desc {
  flex: 1;
  margin: 0 14px;
  font-size: 0.88rem;
}

.time-log-date {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ============================
   INFO SIDEBAR (Task Detail)
   ============================ */
.info-field {
  margin-bottom: 16px;
}

.info-field-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 4px;
}

.info-field-value {
  font-size: 0.88rem;
  color: var(--text-primary);
}

/* ============================
   EMPTY STATES
   ============================ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-state p {
  font-size: 0.92rem;
  margin-bottom: 16px;
}

/* ============================
   PAGE HEADER
   ============================ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.page-header h2 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.page-header p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-top: 1px;
}

/* ============================
   ALERT / MESSAGES
   ============================ */
.alert {
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-error {
  background: rgba(255, 59, 48, 0.06);
  border: 1px solid rgba(255, 59, 48, 0.12);
  color: var(--accent-danger);
}

.alert-success {
  background: rgba(52, 199, 89, 0.06);
  border: 1px solid rgba(52, 199, 89, 0.12);
  color: #248a3d;
}

/* ============================
   LOADING
   ============================ */
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(0, 0, 0, 0.06);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
}

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 1024px) {
  .kanban-board {
    grid-template-columns: repeat(2, 1fr);
  }

  .task-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .kanban-board {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .page-content {
    padding: 18px 14px;
  }

  .topbar {
    padding: 0 14px;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-bar .form-control {
    max-width: 100%;
  }
}

/* ============================
   ANIMATIONS & UTILITIES
   ============================ */
.fade-in {
  animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.actions-cell {
  display: flex;
  align-items: center;
  gap: 4px;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.mt-2 {
  margin-top: 12px;
}

.mt-4 {
  margin-top: 24px;
}

.mb-2 {
  margin-bottom: 12px;
}

.mb-4 {
  margin-bottom: 24px;
}

.gap-2 {
  gap: 10px;
}

.d-flex {
  display: flex;
}

.align-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.flex-wrap {
  flex-wrap: wrap;
}

.w-100 {
  width: 100%;
}

.cursor-pointer {
  cursor: pointer;
}

/* Multi-select tag pills */
.tag-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 11px;
  background: rgba(0, 113, 227, 0.06);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  color: var(--accent-primary);
  font-weight: 500;
}

.tag-pill .remove-tag {
  cursor: pointer;
  font-size: 0.85rem;
  opacity: 0.6;
  transition: opacity var(--transition-fast);
}

.tag-pill .remove-tag:hover {
  opacity: 1;
}

/* Report summary cards */
.report-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.report-stat {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
  box-shadow: var(--shadow-xs);
}

.report-stat .value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent-primary);
  letter-spacing: -0.3px;
}

.report-stat .label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
  font-weight: 500;
}

/* Tab navigation */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 18px;
  gap: 0;
}

.tab-btn {
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.02);
}

.tab-btn.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
  font-weight: 600;
}

/* ============================
   AI CHAT INTERFACE
   ============================ */
.ai-layout {
  display: flex;
  gap: 16px;
  height: calc(100vh - var(--topbar-height) - 120px);
  min-height: 400px;
}

.ai-chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px) var(--glass-saturate);
  -webkit-backdrop-filter: blur(16px) var(--glass-saturate);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ai-message {
  display: flex;
  gap: 10px;
  max-width: 85%;
  animation: fadeIn 0.3s ease;
}

.ai-message.ai-user {
  flex-direction: row-reverse;
  align-self: flex-end;
}

.ai-message.ai-bot {
  align-self: flex-start;
}

.ai-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.04);
}

.ai-bubble {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  line-height: 1.6;
  word-wrap: break-word;
}

.ai-message.ai-user .ai-bubble {
  background: var(--accent-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.ai-message.ai-bot .ai-bubble {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-bottom-left-radius: 4px;
}

.ai-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 14px 18px;
}

.dot-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: dotPulse 1.4s infinite ease-in-out;
}

.dot-pulse:nth-child(2) {
  animation-delay: 0.2s;
}

.dot-pulse:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes dotPulse {

  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.4;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.ai-input-area {
  border-top: 1px solid var(--border-color);
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.5);
}

.ai-task-selector {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.ai-task-selector select {
  flex: 1;
  font-size: 0.82rem;
  padding: 7px 14px;
}

.ai-quick-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.ai-input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.ai-input-row textarea {
  flex: 1;
  border-radius: var(--radius-full);
  padding: 10px 18px;
  resize: none;
  max-height: 120px;
  min-height: 42px;
}

.ai-input-row .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================
   FLOATING AI CHAT BUTTON + BOX
   ============================ */
.ai-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gradient-primary);
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 113, 227, 0.35);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ai-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(0, 113, 227, 0.45);
}

.ai-fab.active {
  background: rgba(0, 0, 0, 0.6);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.ai-chatbox {
  position: fixed;
  bottom: 96px;
  right: 28px;
  width: 380px;
  max-height: 520px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
  z-index: 998;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  overflow: hidden;
}

.ai-chatbox.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.ai-chatbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.6);
}

.ai-chatbox-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.ai-chatbox-close:hover {
  background: rgba(255, 59, 48, 0.1);
  color: var(--accent-danger);
}

.ai-chatbox-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 360px;
  min-height: 200px;
}

.ai-chatbox-messages .ai-message {
  max-width: 88%;
}

.ai-chatbox-messages .ai-bubble {
  font-size: 0.82rem;
  padding: 10px 13px;
  line-height: 1.5;
}

.ai-chatbox-input {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.5);
  align-items: flex-end;
}

.ai-chatbox-input textarea {
  flex: 1;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 8px 14px;
  font-family: inherit;
  font-size: 0.82rem;
  resize: none;
  max-height: 80px;
  min-height: 36px;
  outline: none;
  background: var(--bg-input);
  color: var(--text-primary);
  transition: border-color var(--transition-fast);
}

.ai-chatbox-input textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.1);
}

.ai-chatbox-input button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--accent-primary);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.ai-chatbox-input button:hover {
  background: var(--accent-primary-hover);
}

.ai-chatbox-input button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}