/* ═══════════════════════════════════════════════════════════════
   Ancillary DashBoard — Dark Glassmorphism Design System
   Modern Thai Team Task Management UI
═══════════════════════════════════════════════════════════════ */

/* ─── CSS Variables ──────────────────────────────────────────── */
:root {
  /* Background Layers */
  --bg-base:    #06091280;
  --bg-surface: #0d152620;
  --bg-card:    rgba(255,255,255,0.035);
  --bg-card-hover: rgba(255,255,255,0.06);
  --bg-input:   rgba(255,255,255,0.05);

  /* Borders */
  --border:       rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.18);
  --border-focus: rgba(99,102,241,0.6);

  /* Brand Palette */
  --primary:       #6366f1;
  --primary-light: #818cf8;
  --primary-dark:  #4f46e5;
  --secondary:     #8b5cf6;
  --accent:        #06b6d4;

  /* Semantic Colors */
  --success: #10b981;
  --warning: #f59e0b;
  --danger:  #ef4444;
  --info:    #3b82f6;
  --orange:  #fb923c;

  /* Text Scale */
  --text-1: #f0f4ff;
  --text-2: #94a3b8;
  --text-3: #4b5773;
  --text-4: #2d3856;

  /* Spacing */
  --sp-xs: 4px; --sp-sm: 8px; --sp-md: 12px;
  --sp-lg: 16px; --sp-xl: 24px; --sp-2xl: 32px;

  /* Radius */
  --r-sm: 8px;  --r-md: 12px; --r-lg: 16px;
  --r-xl: 20px; --r-2xl: 28px; --r-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 4px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 20px rgba(0,0,0,0.5);
  --shadow-lg:  0 12px 48px rgba(0,0,0,0.6);
  --shadow-xl:  0 24px 80px rgba(0,0,0,0.7);
  --glow-primary: 0 0 24px rgba(99,102,241,0.35);
  --glow-danger:  0 0 24px rgba(239,68,68,0.3);

  /* Transitions */
  --t-fast: 0.15s ease;
  --t:      0.22s ease;
  --t-slow: 0.4s cubic-bezier(0.4,0,0.2,1);

  /* Typography */
  --font: 'Inter','Sarabun',-apple-system,BlinkMacSystemFont,sans-serif;

  /* Navbar Height */
  --navbar-h: 60px;
}

/* ─── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: #060912;
  color: var(--text-1);
  min-height: 100svh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Ambient background gradients */
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 10% 10%,  rgba(99,102,241,.09) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 90% 85%,  rgba(139,92,246,.07) 0%, transparent 55%),
    radial-gradient(ellipse 40% 40% at 55% 40%,  rgba(6,182,212,.04)  0%, transparent 45%);
  pointer-events: none;
  z-index: 0;
}

#app { position: relative; z-index: 1; min-height: 100svh; }

/* ─── View Transitions ───────────────────────────────────────── */
.view-enter { animation: viewFadeIn 0.35s ease both; }
@keyframes viewFadeIn {
  from { opacity: 0; transform: translateY(14px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

/* ─── Typography ─────────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.25; letter-spacing: -0.015em; }
p  { color: var(--text-2); }
a  { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font-family: var(--font); }
button { cursor: pointer; }

.gradient-text {
  background: linear-gradient(135deg, var(--primary-light), var(--secondary), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Layout ─────────────────────────────────────────────────── */
.app-layout { display: flex; flex-direction: column; min-height: 100svh; }

.app-main {
  flex: 1;
  padding: 1.5rem 2rem;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ═══════════════════════════════════════════════════════════════
   NAVBAR
═══════════════════════════════════════════════════════════════ */
.navbar {
  height: var(--navbar-h);
  display: flex; align-items: center;
  padding: 0 2rem;
  gap: 1rem;
  background: rgba(6,9,18,0.75);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 200;
}

.navbar-brand {
  display: flex; align-items: center; gap: 0.6rem;
  cursor: pointer; flex-shrink: 0; user-select: none;
  transition: opacity var(--t);
}
.navbar-brand:hover { opacity: 0.8; }

.brand-logo-img {
  height: 32px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1) drop-shadow(0 0 8px rgba(99, 102, 241, 0.3));
  flex-shrink: 0;
  transition: opacity var(--t), filter var(--t);
}
.navbar-brand:hover .brand-logo-img {
  filter: brightness(0) invert(1) drop-shadow(0 0 12px rgba(139, 92, 246, 0.6));
  opacity: 0.9;
}

.brand-name {
  font-size: 1.15rem; font-weight: 900;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--text-1) 40%, var(--primary-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.navbar-center { flex: 1; display: flex; justify-content: center; }

.navbar-pill {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 0.3rem 1rem;
  font-size: 0.82rem; font-weight: 500; color: var(--text-2);
}

.navbar-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 0.375rem;
  padding: 0.5rem 1.1rem;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-size: 0.875rem; font-weight: 500;
  cursor: pointer;
  transition: all var(--t);
  white-space: nowrap; line-height: 1.4;
  user-select: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  box-shadow: 0 0 18px rgba(99,102,241,.22);
}
.btn-primary:hover {
  box-shadow: 0 0 28px rgba(99,102,241,.4);
  transform: translateY(-1px);
  filter: brightness(1.08);
}
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: var(--bg-card);
  color: var(--text-2);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg-card-hover); color: var(--text-1); border-color: var(--border-hover); }

.btn-danger {
  background: rgba(239,68,68,.14);
  color: var(--danger);
  border-color: rgba(239,68,68,.28);
}
.btn-danger:hover { background: rgba(239,68,68,.22); border-color: rgba(239,68,68,.45); }

.btn-danger-ghost {
  background: none;
  color: var(--text-3);
  border: none;
  padding: 0.4rem 0.7rem;
  font-size: 0.82rem;
}
.btn-danger-ghost:hover { color: var(--danger); }

.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.8rem; }
.btn-xs { padding: 0.2rem 0.55rem; font-size: 0.74rem; border-radius: 6px; }

.btn-icon {
  background: none; border: none;
  color: var(--text-2);
  padding: 0.4rem;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t);
}
.btn-icon:hover { background: var(--bg-card-hover); color: var(--text-1); }

.btn-icon-round {
  width: 30px; height: 30px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 0.9rem;
  color: var(--text-2);
  transition: all var(--t); flex-shrink: 0;
}
.btn-icon-round:hover { background: var(--bg-card-hover); color: var(--text-1); border-color: var(--border-hover); }

/* ═══════════════════════════════════════════════════════════════
   GLASS CARD
═══════════════════════════════════════════════════════════════ */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.125rem 1.5rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem; flex-wrap: wrap;
}

.card-title {
  font-size: 0.95rem; font-weight: 700; color: var(--text-1);
}

.card-subtitle {
  font-size: 0.75rem; color: var(--text-3); font-weight: 400; margin-top: 1px;
}

.card-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

/* ═══════════════════════════════════════════════════════════════
   FORMS
═══════════════════════════════════════════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: 0.35rem; }

.form-label {
  font-size: 0.8rem; font-weight: 600; color: var(--text-2);
  letter-spacing: 0.025em;
}
.required { color: var(--danger); margin-left: 2px; }

.form-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-1);
  padding: 0.575rem 0.875rem;
  font-size: 0.875rem;
  transition: all var(--t);
  width: 100%; outline: none;
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
  background: rgba(255,255,255,.07);
}
.form-input:hover:not(:focus) { border-color: var(--border-hover); }
.form-input::placeholder { color: var(--text-3); }
.form-input:invalid { border-color: rgba(239,68,68,.5); }

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

.form-select {
  appearance: none; cursor: pointer;
  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='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 2rem;
}
.form-select option { background: #0d1526; color: var(--text-1); }

.form-select-sm {
  background: var(--bg-card);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%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;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-2);
  padding: 0.32rem 1.7rem 0.32rem 0.65rem;
  font-size: 0.78rem; font-family: var(--font);
  cursor: pointer; appearance: none; outline: none;
  transition: all var(--t);
}
.form-select-sm:focus { border-color: var(--primary); color: var(--text-1); }
.form-select-sm option { background: #0d1526; color: var(--text-1); }

.form-color {
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  background: none;
  padding: 3px;
  overflow: hidden; flex-shrink: 0;
}
.form-color::-webkit-color-swatch-wrapper { padding: 0; }
.form-color::-webkit-color-swatch { border: none; border-radius: 4px; }

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

/* ═══════════════════════════════════════════════════════════════
   AVATARS
═══════════════════════════════════════════════════════════════ */
.avatar {
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; letter-spacing: -0.01em;
  border: 2px solid; flex-shrink: 0; user-select: none;
}
.avatar-xl { width: 60px; height: 60px; font-size: 1.25rem; }
.avatar-lg { width: 48px; height: 48px; font-size: 1rem; }
.avatar-md { width: 38px; height: 38px; font-size: 0.825rem; border-width: 1.5px; }
.avatar-sm { width: 30px; height: 30px; font-size: 0.72rem; border-width: 1.5px; }
.avatar-xs { width: 26px; height: 26px; font-size: 0.65rem; border-width: 1px; }

/* ═══════════════════════════════════════════════════════════════
   BADGES & TAGS
═══════════════════════════════════════════════════════════════ */
.priority-badge {
  display: inline-flex; align-items: center; gap: 0.22rem;
  padding: 0.18rem 0.6rem;
  border-radius: var(--r-full);
  font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.02em; border: 1px solid;
  white-space: nowrap; flex-shrink: 0;
}
.priority-high   { background: rgba(239,68,68,.14);  color: #ef4444; border-color: rgba(239,68,68,.28); }
.priority-medium { background: rgba(245,158,11,.14); color: #f59e0b; border-color: rgba(245,158,11,.28); }
.priority-low    { background: rgba(16,185,129,.14); color: #10b981; border-color: rgba(16,185,129,.28); }

.status-badge {
  display: inline-flex; align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: var(--r-full);
  font-size: 0.72rem; font-weight: 600;
  border: 1px solid; white-space: nowrap;
}

.overdue-badge {
  display: inline-flex; align-items: center; gap: 0.2rem;
  background: rgba(239,68,68,.14);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,.28);
  padding: 0.14rem 0.5rem;
  border-radius: var(--r-full);
  font-size: 0.68rem; font-weight: 700;
  animation: pulse-danger 2s infinite;
}

@keyframes pulse-danger {
  0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
  50%      { box-shadow: 0 0 0 3px rgba(239,68,68,.18); }
}

.deadline-overdue { color: var(--danger) !important; font-weight: 600; }
.deadline-today   { color: var(--warning) !important; font-weight: 600; }
.deadline-soon    { color: var(--orange) !important; }
.deadline-ok      { color: var(--text-3); }

.deadline-pip {
  display: inline-block;
  font-size: 0.65rem; font-weight: 700;
  padding: 0.08rem 0.38rem;
  border-radius: 4px; margin-left: 2px;
}
.deadline-pip.deadline-overdue { background: rgba(239,68,68,.2); color: var(--danger); }
.deadline-pip.deadline-today   { background: rgba(245,158,11,.2); color: var(--warning); }
.deadline-pip.deadline-soon    { background: rgba(251,146,60,.2); color: var(--orange); }

/* ═══════════════════════════════════════════════════════════════
   LANDING VIEW
═══════════════════════════════════════════════════════════════ */
.landing {
  min-height: 100svh;
  display: flex; flex-direction: column;
  position: relative; overflow: hidden;
}

/* Floating orbs */
.landing-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  animation: orbReveal 1.5s ease forwards;
}
.landing-orb-1 {
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(99,102,241,.18), transparent 70%);
  top: -300px; left: -200px;
  animation-delay: 0s;
  animation: orbReveal 1.5s ease forwards, float1 10s ease-in-out 1.5s infinite;
}
.landing-orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(139,92,246,.14), transparent 70%);
  bottom: -150px; right: -100px;
  animation: orbReveal 1.5s ease 0.3s forwards, float2 12s ease-in-out 1.8s infinite;
}
.landing-orb-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(6,182,212,.12), transparent 70%);
  top: 40%; left: 50%;
  animation: orbReveal 1.5s ease 0.6s forwards, float3 8s ease-in-out 2.1s infinite;
}

@keyframes orbReveal { from { opacity: 0; } to { opacity: 1; } }
@keyframes float1 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(30px,25px); } }
@keyframes float2 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-25px,-20px); } }
@keyframes float3 { 0%,100% { transform: translate(-50%,-50%); } 50% { transform: translate(calc(-50% + 20px), calc(-50% + 15px)); } }

.landing-header {
  padding: 1.5rem 2rem;
  display: flex; align-items: center; justify-content: space-between;
  position: relative; z-index: 2;
}

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

.landing-logo-img-lg {
  height: 48px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1) drop-shadow(0 0 16px rgba(99, 102, 241, 0.4));
  flex-shrink: 0;
  transition: transform var(--t);
}
.landing-logo:hover .landing-logo-img-lg {
  transform: scale(1.04);
}

.landing-logo-text {
  font-size: 1.6rem; font-weight: 900;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #f0f4ff 40%, var(--primary-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.landing-main {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 2rem;
  gap: 2rem;
  position: relative; z-index: 2;
}

.landing-hero { text-align: center; }

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: rgba(99,102,241,.12);
  border: 1px solid rgba(99,102,241,.3);
  color: var(--primary-light);
  border-radius: var(--r-full);
  padding: 0.3rem 1rem;
  font-size: 0.8rem; font-weight: 600;
  margin-bottom: 1.25rem;
  letter-spacing: 0.04em;
  animation: eyebrowPop 0.6s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes eyebrowPop {
  from { opacity: 0; transform: scale(0.8) translateY(-8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.hero-title {
  font-size: clamp(2.4rem, 5.5vw, 3.75rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 0.875rem;
  animation: heroTitle 0.7s ease 0.15s both;
}

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

.hero-sub {
  font-size: 1rem; color: var(--text-2);
  animation: heroTitle 0.7s ease 0.25s both;
}

/* Role Selector */
.role-selector {
  width: 100%; max-width: 680px;
  display: flex; flex-direction: column; gap: 1.25rem;
  animation: heroTitle 0.7s ease 0.3s both;
}

.role-card {
  display: flex; align-items: center; gap: 1.25rem;
  padding: 1.375rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  position: relative; overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.role-card::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(99,102,241,.07), rgba(139,92,246,.05));
  opacity: 0; transition: opacity 0.3s ease;
}
.role-card:hover::after { opacity: 1; }
.role-card:hover {
  border-color: rgba(99,102,241,.4);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,.4), var(--glow-primary);
}
.role-card:active { transform: translateY(-1px); }

.role-icon-wrap {
  width: 58px; height: 58px;
  background: rgba(99,102,241,.12);
  border: 1px solid rgba(99,102,241,.22);
  border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.75rem;
  flex-shrink: 0;
  position: relative; z-index: 1;
  transition: transform 0.3s ease;
}
.role-card:hover .role-icon-wrap { transform: scale(1.08); }

.role-info { flex: 1; position: relative; z-index: 1; }
.role-card-title { font-size: 1.05rem; font-weight: 700; color: var(--text-1); margin-bottom: 0.25rem; }
.role-card-desc  { font-size: 0.82rem; color: var(--text-2); line-height: 1.4; }

.role-arrow {
  color: var(--text-3);
  transition: all 0.25s ease;
  font-size: 1.25rem;
  position: relative; z-index: 1;
}
.role-card:hover .role-arrow { color: var(--primary-light); transform: translateX(5px); }

.role-divider {
  display: flex; align-items: center; gap: 1rem;
  color: var(--text-3); font-size: 0.82rem;
}
.role-divider::before, .role-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* Members Grid */
.members-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 1.375rem 1.5rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.members-section-label {
  font-size: 0.72rem; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
  gap: 0.75rem;
}

.member-select-card {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  padding: 1rem 0.75rem;
  background: rgba(255,255,255,.025);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  text-align: center; user-select: none;
}
.member-select-card:hover {
  background: rgba(255,255,255,.055);
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.member-select-card:active { transform: translateY(-1px); }
.member-select-card:hover .avatar { transform: scale(1.1); }
.member-select-card .avatar { transition: transform 0.25s ease; }

.member-select-name { font-size: 0.78rem; font-weight: 600; color: var(--text-1); line-height: 1.3; }
.member-select-count { font-size: 0.68rem; color: var(--text-3); }

.landing-footer-hint {
  font-size: 0.76rem; color: var(--text-3);
  text-align: center; display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  animation: heroTitle 0.7s ease 0.5s both;
}

/* ═══════════════════════════════════════════════════════════════
   MANAGER DASHBOARD
═══════════════════════════════════════════════════════════════ */

/* Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  transition: all var(--t);
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; inset: 0;
  opacity: 0; transition: opacity 0.3s;
}
.stat-card:hover { transform: translateY(-2px); border-color: var(--border-hover); }

.stat-icon-wrap {
  width: 50px; height: 50px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0;
}

.stat-info { display: flex; flex-direction: column; gap: 0.1rem; }
.stat-label { font-size: 0.75rem; font-weight: 500; color: var(--text-2); }
.stat-value { font-size: 2.1rem; font-weight: 900; letter-spacing: -0.04em; line-height: 1; color: var(--text-1); }
.stat-sub   { font-size: 0.72rem; color: var(--text-3); margin-top: 1px; }

/* Dashboard Charts Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.25rem;
}

/* Donut Chart */
.donut-wrap {
  display: flex; flex-direction: column; align-items: center;
  padding: 1.25rem 1.5rem;
  gap: 1rem;
}

.donut-canvas-wrap {
  position: relative;
  width: 180px; height: 180px;
  flex-shrink: 0;
}

#donut-chart { display: block; }

.donut-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none;
}

.donut-total { font-size: 2rem; font-weight: 900; letter-spacing: -0.04em; color: var(--text-1); line-height: 1; }
.donut-label { font-size: 0.7rem; color: var(--text-3); margin-top: 3px; }

.donut-legend {
  display: flex; flex-direction: column; gap: 0.5rem;
  width: 100%;
}

.legend-row {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.78rem; cursor: default;
}
.legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%; flex-shrink: 0;
}
.legend-name { flex: 1; color: var(--text-2); }
.legend-count { font-weight: 700; color: var(--text-1); }
.legend-pct { font-size: 0.7rem; color: var(--text-3); min-width: 30px; text-align: right; }

/* Workload bars */
.workload-wrap { padding: 1.25rem 1.5rem; display: flex; flex-direction: column; gap: 0.875rem; }

.workload-row { display: flex; align-items: center; gap: 0.875rem; }

.workload-member {
  display: flex; align-items: center; gap: 0.5rem;
  min-width: 155px;
}
.workload-member-name  { font-size: 0.8rem; font-weight: 500; flex: 1; }
.workload-member-count { font-size: 0.72rem; color: var(--text-3); white-space: nowrap; }

.workload-track {
  flex: 1; height: 7px;
  background: rgba(255,255,255,.06);
  border-radius: var(--r-full); overflow: hidden;
}

.workload-fill {
  height: 100%; border-radius: var(--r-full);
  transition: width 0.9s cubic-bezier(0.34,1.56,0.64,1);
  width: 0;
}

.workload-pct { font-size: 0.72rem; color: var(--text-3); min-width: 32px; text-align: right; }

/* Filter group */
.filter-bar {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
}

/* Data Table */
.table-wrap { overflow-x: auto; }

.data-table {
  width: 100%; border-collapse: collapse; font-size: 0.84rem;
}
.data-table thead th {
  padding: 0.75rem 1.25rem;
  text-align: left;
  font-size: 0.7rem; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.07em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,.038);
  transition: background var(--t-fast);
  cursor: pointer;
}
.data-table tbody tr:hover { background: rgba(255,255,255,.028); }
.data-table tbody tr.row-overdue td:first-child {
  border-left: 2px solid var(--danger);
  padding-left: calc(1.25rem - 2px);
}
.data-table td {
  padding: 0.825rem 1.25rem;
  vertical-align: middle;
}
.data-table tbody tr:last-child { border-bottom: none; }

.task-cell-name { font-weight: 600; color: var(--text-1); }
.task-cell-desc { font-size: 0.72rem; color: var(--text-3); margin-top: 2px; }

.member-cell { display: flex; align-items: center; gap: 0.5rem; }

.deadline-cell {
  display: flex; flex-direction: column; gap: 2px; font-size: 0.78rem;
}

.table-actions { display: flex; gap: 0.25rem; }

.empty-state {
  text-align: center; padding: 3.5rem 1rem;
  color: var(--text-3); font-size: 0.9rem;
}
.empty-state-icon { font-size: 2.5rem; margin-bottom: 0.75rem; opacity: 0.5; }

/* ═══════════════════════════════════════════════════════════════
   KANBAN BOARD
═══════════════════════════════════════════════════════════════ */
.kanban-layout {
  display: flex; flex-direction: column;
  height: 100svh; overflow: hidden;
}

.kanban-top {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(6,9,18,.6);
  backdrop-filter: blur(16px);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-shrink: 0;
}

.kanban-member-info {
  display: flex; align-items: center; gap: 0.875rem;
}

.kanban-member-name  { font-size: 1.2rem; font-weight: 800; letter-spacing: -0.025em; }
.kanban-member-stats { font-size: 0.78rem; color: var(--text-2); display: flex; gap: 0.5rem; flex-wrap: wrap; }
.kanban-stat-dot { color: var(--text-3); }

.kanban-top-right { display: flex; align-items: center; gap: 0.5rem; }

.kanban-board-wrap {
  flex: 1;
  display: flex; gap: 0.875rem;
  overflow-x: auto; overflow-y: hidden;
  padding: 1.125rem 1.5rem;
  align-items: flex-start;
}
.kanban-board-wrap::-webkit-scrollbar { height: 5px; }
.kanban-board-wrap::-webkit-scrollbar-track { background: rgba(255,255,255,.03); border-radius: 3px; }
.kanban-board-wrap::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 3px; }
.kanban-board-wrap::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.22); }

/* Column */
.kb-column {
  width: 285px; min-width: 285px;
  background: rgba(255,255,255,.025);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  display: flex; flex-direction: column;
  max-height: 100%;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.kb-column.drag-over {
  border-color: rgba(99,102,241,.5);
  background: rgba(99,102,241,.05);
  box-shadow: 0 0 0 2px rgba(99,102,241,.18), var(--glow-primary);
}

.kb-col-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  border-top: 3px solid transparent;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  flex-shrink: 0;
}

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

.kb-col-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.kb-col-title { font-size: 0.85rem; font-weight: 700; }
.kb-col-count {
  padding: 0.1rem 0.5rem;
  border-radius: var(--r-full);
  font-size: 0.7rem; font-weight: 800;
}

.kb-col-cards {
  flex: 1; overflow-y: auto;
  padding: 0.75rem;
  display: flex; flex-direction: column;
  gap: 0.6rem;
}
.kb-col-cards::-webkit-scrollbar { width: 3px; }
.kb-col-cards::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

/* Drop zone */
.kb-dropzone {
  border: 2px dashed rgba(255,255,255,.1);
  border-radius: var(--r-md);
  padding: 0.875rem;
  text-align: center;
  font-size: 0.76rem; color: var(--text-3);
  min-height: 52px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: all var(--t);
}
.kb-dropzone.visible {
  opacity: 1; pointer-events: auto;
  border-color: rgba(99,102,241,.3);
  color: var(--primary-light);
}

/* Task Card */
.task-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0.875rem;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4,0,0.2,1);
  position: relative; overflow: hidden;
  user-select: none;
}

.task-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.task-card:active { transform: translateY(0); }

.task-card.card-dragging {
  opacity: 0.45;
  transform: rotate(1.5deg) scale(1.02);
  cursor: grabbing;
  box-shadow: var(--shadow-xl);
  z-index: 10;
}

.task-card.card-overdue { border-color: rgba(239,68,68,.28); }

/* Priority top bar */
.card-priority-stripe {
  position: absolute; top: 0; left: 0; right: 0;
  height: 2.5px; opacity: 0.8;
}

/* Priority glow effects */
.pglow-high   { box-shadow: 0 0 0 1px rgba(239,68,68,.15) inset,   0 0 18px rgba(239,68,68,.07);  }
.pglow-medium { box-shadow: 0 0 0 1px rgba(245,158,11,.12) inset; }
.pglow-low    { box-shadow: 0 0 0 1px rgba(16,185,129,.12) inset; }

.pglow-high:hover   { box-shadow: 0 0 0 1px rgba(239,68,68,.35) inset,   0 8px 24px rgba(239,68,68,.12);  }
.pglow-medium:hover { box-shadow: 0 0 0 1px rgba(245,158,11,.3) inset,  0 8px 24px rgba(245,158,11,.08); }
.pglow-low:hover    { box-shadow: 0 0 0 1px rgba(16,185,129,.28) inset, 0 8px 24px rgba(16,185,129,.07); }

.card-top-row {
  display: flex; align-items: center; gap: 0.4rem;
  margin-bottom: 0.45rem; flex-wrap: wrap;
}

.card-title {
  font-size: 0.85rem; font-weight: 700;
  color: var(--text-1); line-height: 1.4;
  margin-bottom: 0.3rem;
}

.card-desc {
  font-size: 0.75rem; color: var(--text-3); line-height: 1.5;
  margin-bottom: 0.5rem;
}

.card-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 0.5rem; padding-top: 0.5rem;
  border-top: 1px solid rgba(255,255,255,.05);
}

.card-deadline-info {
  display: flex; align-items: center; gap: 0.3rem;
  font-size: 0.72rem; color: var(--text-3);
}

.card-drag-handle {
  color: var(--text-3); font-size: 1.1rem;
  cursor: grab; opacity: 0; transition: opacity var(--t);
  letter-spacing: -0.12em; line-height: 1;
}
.task-card:hover .card-drag-handle { opacity: 1; }

/* ═══════════════════════════════════════════════════════════════
   MODALS
═══════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  animation: overlayIn 0.2s ease;
}
.modal-overlay.hidden { display: none; }

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

.modal {
  background: #0d1526;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--r-xl);
  width: 100%; max-width: 540px;
  max-height: 92svh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modalSlideIn 0.28s cubic-bezier(0.34,1.56,0.64,1);
}
.modal-sm { max-width: 420px; }

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

.modal::-webkit-scrollbar { width: 4px; }
.modal::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

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

.modal-badge {
  display: inline-block;
  background: rgba(99,102,241,.14); color: var(--primary-light);
  border-radius: var(--r-full); padding: 0.12rem 0.65rem;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em;
  margin-bottom: 0.3rem;
}

.modal-title { font-size: 1.1rem; font-weight: 800; }

.modal-hint { font-size: 0.78rem; color: var(--text-3); margin-bottom: 0.875rem; }

.modal-body {
  padding: 1.25rem 1.5rem;
  display: flex; flex-direction: column; gap: 0.875rem;
}

.modal-footer {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 0.6rem; padding: 0.875rem 1.5rem;
  border-top: 1px solid var(--border);
}

/* Delete modal special styles */
.delete-icon-wrap {
  display: flex; justify-content: center;
  padding: 1rem 0 0.5rem;
  opacity: 0.8;
}
.delete-confirm-text { text-align: center; font-size: 0.95rem; font-weight: 600; color: var(--text-1); }
.delete-confirm-sub  { text-align: center; font-size: 0.82rem; color: var(--text-3); margin-top: 0.25rem; }

/* ═══════════════════════════════════════════════════════════════
   MANAGE LISTS (Column/Member modals)
═══════════════════════════════════════════════════════════════ */
.manage-list {
  display: flex; flex-direction: column; gap: 0.45rem;
  max-height: 260px; overflow-y: auto;
  margin-bottom: 0.25rem;
}
.manage-list::-webkit-scrollbar { width: 3px; }
.manage-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

.manage-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0.875rem;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  transition: background var(--t);
}
.manage-item:hover { background: rgba(255,255,255,.055); }
.manage-item-color { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.manage-item-name  { flex: 1; font-size: 0.85rem; color: var(--text-1); }

.add-item-row {
  display: flex; align-items: center; gap: 0.5rem;
  margin-top: 0.875rem;
}

/* ═══════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
═══════════════════════════════════════════════════════════════ */
#toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  display: flex; flex-direction: column; gap: 0.5rem;
  z-index: 1000; pointer-events: none;
}

.toast {
  background: #1a2440;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0.75rem 1.125rem;
  font-size: 0.84rem; font-weight: 500; color: var(--text-1);
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 0.6rem;
  animation: toastIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
  pointer-events: auto;
  max-width: 320px;
}

.toast.toast-success { border-left: 3px solid var(--success); }
.toast.toast-error   { border-left: 3px solid var(--danger);  }
.toast.toast-info    { border-left: 3px solid var(--primary); }
.toast.toast-out     { animation: toastOut 0.25s ease forwards; }

@keyframes toastIn  { from { opacity: 0; transform: translateX(20px) scale(0.95); } to { opacity: 1; transform: translateX(0) scale(1); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(20px); } }

/* ═══════════════════════════════════════════════════════════════
   SCROLLBAR (global)
═══════════════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,.02); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.18); }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
  .stats-row    { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .app-main { padding: 1rem; }
  .kanban-board-wrap { padding: 0.875rem 1rem; }
  .kanban-top { padding: 0.875rem 1rem; }
  .navbar { padding: 0 1.25rem; }
}

@media (max-width: 640px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .form-row  { grid-template-columns: 1fr; }
  .members-grid { grid-template-columns: repeat(auto-fill, minmax(100px,1fr)); }
  .hero-title { font-size: 2.1rem; }
  .landing-header { padding: 1.25rem; }
  .landing-main { padding: 1.25rem; gap: 1.5rem; }
  .role-card { padding: 1.125rem; }
  .kanban-board-wrap { flex-direction: column; overflow-y: auto; overflow-x: hidden; height: auto; }
  .kb-column { width: 100%; min-width: auto; }
  .kanban-layout { height: auto; overflow: visible; }
}

@media (max-width: 400px) {
  .stats-row { grid-template-columns: 1fr; }
  .stat-value { font-size: 1.6rem; }
}
