/* ═══════════════════════════════════════════════════
   SWiiT Task Manager — style.css
   Stellenbosch Women in Information Technology

   EXACT BRAND COLOURS (sampled from official logo):
   ─────────────────────────────────────────────────
   Main text (SW, T)  : #4E265A  (deep plum-purple)
   ii letter body     : #D9A0C1  (pink-mauve)
   ii DOTS — MAROON   : #4E2B31  (dark maroon — BRAND CRITICAL)
   Background         : #FAFAFA  (off-white)
═══════════════════════════════════════════════════ */

/* ── Design Tokens ───────────────────────────────── */
:root {
  /* Layout */
  --sidebar-w: 256px;
  --radius:    10px;
  --radius-sm: 6px;
  --radius-xs: 4px;

  /* ══ EXACT SWiiT SAMPLED COLOURS ══════════════════ */
  --brand-plum:   #4E265A;   /* S, W, T — primary brand colour    */
  --brand-plum-d: #381848;   /* darker plum for hover/sidebar     */
  --brand-pink:   #D9A0C1;   /* ii letter body — pink-mauve        */
  --brand-maroon: #4E2B31;   /* ii DOTS — ALWAYS MAROON (critical) */
  --brand-maroon-light: #7A4048; /* lighter maroon for accents     */

  /* Derived palette */
  --pink-light:   #F6EDF4;
  --pink-xlight:  #FBF6FA;
  --blush:        #E8C4DA;

  /* Surfaces */
  --bg:       #FAF7FC;
  --card-bg:  #FFFFFF;

  /* Sidebar */
  --s-bg:          #260636;   /* very deep plum */
  --s-text:        #C0A4D4;
  --s-hover:       rgba(255,255,255,0.055);
  --s-active-bg:   rgba(78,43,49,0.30);   /* maroon-tinted active state */
  --s-active:      #E8C4DA;
  --s-border:      rgba(255,255,255,0.07);

  /* Text */
  --text-1:  #26063C;
  --text-2:  #6B4488;
  --text-3:  #A880BC;

  /* Borders */
  --border:   #EAE0F4;
  --border-2: #D4C0E4;

  /* Priority (brand-harmonious) */
  --high:      #C02848;
  --high-bg:   #FDEDF2;
  --medium:    #6840A0;
  --medium-bg: #EEE8F8;
  --low:       #2E9E88;
  --low-bg:    #E2F5F1;

  /* Status */
  --todo-c:  #6A5898;  --todo-bg:   #F2EEFB;
  --prog-c:  #A03878;  --prog-bg:   #FAEcF5;
  --done-c:  #2E9E88;  --done-bg:   #E2F5F1;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(78,38,90,.05);
  --shadow-sm: 0 1px 4px rgba(78,38,90,.08), 0 1px 2px rgba(78,38,90,.04);
  --shadow-md: 0 4px 16px rgba(78,38,90,.11), 0 2px 4px rgba(78,38,90,.05);
  --shadow-lg: 0 24px 48px rgba(38,6,54,.18), 0 8px 16px rgba(38,6,54,.08);

  /* Typography */
  --font-d: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-b: 'DM Sans', system-ui, -apple-system, sans-serif;

  /* Motion */
  --t:      0.18s ease;
  --t-slow: 0.28s ease;
}

/* ── Reset ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-b);
  background: var(--bg);
  color: var(--text-1);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font-family: var(--font-b); cursor: pointer; }
input, textarea, select { font-family: var(--font-b); }
a { text-decoration: none; }

/* ══════════════════════════════════════════════════
   SWiiT BRAND WORDMARK
   SW and T → brand-plum
   ii stems  → brand-pink
   ii DOTS   → brand-maroon  ← BRAND CRITICAL, always
══════════════════════════════════════════════════ */
.logo-text {
  font-family: var(--font-d);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.8px;
  display: inline-flex;
  align-items: baseline;
  gap: 0;
}

/* SW and T: brand plum/white on dark sidebar */
.lw-sw,
.lw-t  { color: #ffffff; }

/* The "ii" wrapper */
.lw-ii {
  display: inline-flex;
  align-items: flex-end;
  gap: 1px;
  position: relative;
}

/*
  Each "i" stem: pink-mauve body, but the dot (::before)
  is ALWAYS maroon — the brand-critical identity feature.
  We use font-size tricks: shrink the real letter,
  then draw a positioned maroon circle above it as the dot.
*/
.lw-i-stem {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  position: relative;

  /* The stem of the "i" in pink */
  color: var(--brand-pink);
  font-family: var(--font-d);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  /* We need to see the stem but override the dot — achieved via
     text-decoration: none + manual dot drawn with ::before */
}

/* MAROON DOT — drawn as a positioned pseudo-element above each stem.
   This dot is ALWAYS maroon (#4E2B31) — non-negotiable brand rule.   */
.lw-i-stem::before {
  content: '';
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand-maroon);   /* #4E2B31 — brand maroon, always */
  position: absolute;
  top: -5px;            /* float above the stem's cap-height */
  left: 50%;
  transform: translateX(-50%);
  flex-shrink: 0;
}

/* On dark sidebar the maroon is quite close to sidebar bg,
   brighten slightly for legibility while staying maroon-family */
.sidebar .lw-i-stem::before {
  background: var(--brand-maroon-light);  /* #7A4048 — still maroon */
  width: 5.5px;
  height: 5.5px;
  top: -6px;
}

/* Larger topbar SWiiT brand title */
.brand-title {
  font-family: var(--font-d);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.2px;
  display: inline-flex;
  align-items: baseline;
  gap: 0;
}
.brand-title .lw-sw,
.brand-title .lw-t  { color: var(--brand-plum); }
.brand-title .lw-i-stem { color: var(--brand-pink); font-size: 24px; }
.brand-title .lw-i-stem::before {
  width: 6px;
  height: 6px;
  top: -6px;
  background: var(--brand-maroon);
}

/* ── Sidebar ─────────────────────────────────────── */
.sidebar {
  position: fixed;
  inset-block: 0;
  left: 0;
  width: var(--sidebar-w);
  background: var(--s-bg);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--t-slow);
  overflow-y: auto;
  overflow-x: hidden;
}

/* Soft radial highlight matching the butterfly wing-glow */
.sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 15%, rgba(217,160,193,0.08) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 85%, rgba(78,43,49,0.12) 0%, transparent 45%);
  pointer-events: none;
  z-index: 0;
}
.sidebar > * { position: relative; z-index: 1; }

/* ── Logo header ─────────────────────────────────── */
.sidebar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--s-border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* The actual SWiiT butterfly image */
.logo-butterfly {
  width: 48px;
  height: auto;
  flex-shrink: 0;
  /* Lift it slightly to optically align with wordmark */
  margin-bottom: 2px;
  filter: drop-shadow(0 2px 6px rgba(217,160,193,0.30));
}

.logo-wordmark {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.logo-tagline {
  font-size: 9px;
  color: rgba(255,255,255,0.26);
  font-weight: 500;
  letter-spacing: 0.5px;
  white-space: nowrap;
  padding-left: 1px;
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--s-text);
  font-size: 17px;
  padding: 4px 6px;
  border-radius: var(--radius-xs);
  line-height: 1;
  margin-top: 2px;
  transition: color var(--t);
}
.sidebar-toggle:hover { color: #fff; }

/* ── Nav ─────────────────────────────────────────── */
.sidebar-nav {
  flex: 1;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--s-text);
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--t);
  white-space: nowrap;
}
.nav-item:hover { background: var(--s-hover); color: #f0e8f8; }
.nav-item.active {
  background: var(--s-active-bg);
  color: var(--blush);
  /* Left border in maroon — ties nav active state to brand dots */
  border-left: 3px solid var(--brand-maroon-light);
  padding-left: 9px;
}

.nav-icon {
  font-size: 15px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  color: rgba(192,164,212,0.55);
  transition: color var(--t);
}
.nav-item:hover .nav-icon { color: var(--blush); }
.nav-item.active .nav-icon { color: var(--brand-maroon-light); }

.nav-badge {
  margin-left: auto;
  background: var(--brand-maroon);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
  animation: pop 0.2s ease;
}
.nav-badge:empty { display: none; }

@keyframes pop {
  0%   { transform: scale(0.6); }
  70%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}

.sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 0 10px;
}

/* ── User panel ──────────────────────────────────── */
.sidebar-user {
  padding: 14px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,0.20);
  font-weight: 600;
}

.user-select {
  width: 100%;
  padding: 8px 28px 8px 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: var(--radius-sm);
  color: #e4d4f4;
  font-size: 13px;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23C0A4D4' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color var(--t);
  cursor: pointer;
}
.user-select:focus { border-color: var(--brand-maroon-light); }
.user-select option { background: #3a0a5a; color: #e4d4f4; }

.add-member-btn {
  background: transparent;
  border: 1px dashed rgba(217,160,193,0.22);
  color: rgba(217,160,193,0.45);
  border-radius: var(--radius-sm);
  padding: 7px;
  font-size: 12px;
  font-weight: 500;
  transition: all var(--t);
  text-align: center;
}
.add-member-btn:hover {
  border-color: var(--brand-maroon-light);
  color: var(--blush);
  background: rgba(78,43,49,0.18);
}

.sidebar-footer {
  padding: 12px 16px 20px;
  font-size: 10px;
  color: rgba(255,255,255,0.13);
  line-height: 1.6;
  letter-spacing: 0.3px;
  font-weight: 500;
  text-transform: uppercase;
  border-top: 1px solid rgba(255,255,255,0.04);
}

/* ── Mobile overlay ──────────────────────────────── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(38,6,54,0.60);
  backdrop-filter: blur(3px);
  z-index: 99;
}
.overlay.open { display: block; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Main area ───────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 36px 48px;
}

/* ── Topbar ──────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 0 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 26px;
  gap: 16px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  padding: 4px 6px;
  color: var(--text-1);
  border-radius: var(--radius-xs);
  line-height: 1;
  flex-shrink: 0;
  transition: background var(--t);
}
.menu-btn:hover { background: var(--pink-light); }

/* The main page title — plain text, overridden by .brand-title when set */
.page-title {
  font-family: var(--font-d);
  font-size: 24px;
  font-weight: 700;
  color: var(--brand-plum);
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: baseline;
  gap: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.keyboard-hint {
  font-size: 11px;
  color: var(--text-3);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 3px 8px;
  font-weight: 500;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

/* ── Buttons ─────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, var(--brand-plum) 0%, var(--brand-plum-d) 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 20px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  transition: all var(--t);
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(78,38,90,0.28);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #612A70 0%, var(--brand-plum) 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(78,38,90,0.38);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 9px 20px;
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--t);
}
.btn-secondary:hover { background: var(--pink-xlight); color: var(--brand-plum); border-color: var(--blush); }

.btn-danger {
  background: var(--high);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 20px;
  font-size: 13.5px;
  font-weight: 700;
  transition: all var(--t);
}
.btn-danger:hover { background: #A01E38; box-shadow: 0 4px 12px rgba(192,40,72,0.35); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: 12.5px;
  font-weight: 600;
  transition: all var(--t);
  white-space: nowrap;
}
.btn-ghost:hover { background: var(--high-bg); color: var(--high); border-color: #F0B0C0; }

/* ── Stat cards ──────────────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 26px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px 22px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--t), transform var(--t);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

/* Top bar — uses maroon as base accent, matches dot identity */
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-maroon) 0%, var(--brand-pink) 100%);
}
.stat-card.completed::before { background: linear-gradient(90deg, var(--low) 0%, #78C8B8 100%); }
.stat-card.pending::before   { background: linear-gradient(90deg, var(--brand-plum) 0%, var(--brand-pink) 100%); }
.stat-card.danger::before    { background: linear-gradient(90deg, var(--high) 0%, var(--brand-maroon-light) 100%); }

.stat-card::after {
  content: attr(data-icon);
  position: absolute;
  right: 14px; bottom: 8px;
  font-size: 30px;
  opacity: 0.06;
  line-height: 1;
  pointer-events: none;
}

.stat-number {
  font-family: var(--font-d);
  font-size: 30px;
  font-weight: 700;
  color: var(--brand-plum);
  line-height: 1;
  margin-bottom: 5px;
}
.stat-card.danger .stat-number { color: var(--high); }

.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--text-3);
}

/* ── Filters ─────────────────────────────────────── */
.filters {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.search-wrap { position: relative; flex: 1; min-width: 200px; }
.search-icon {
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  font-size: 17px;
  color: var(--text-3);
  pointer-events: none;
  line-height: 1;
}
.filter-search {
  width: 100%;
  padding: 9px 12px 9px 34px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  background: var(--card-bg);
  color: var(--text-1);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.filter-search:focus {
  border-color: var(--brand-maroon);
  box-shadow: 0 0 0 3px rgba(78,43,49,0.10);
}
.filter-search::placeholder { color: var(--text-3); }

.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }

.filter-select {
  padding: 9px 30px 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--card-bg);
  color: var(--text-1);
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23A880BC' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
  transition: border-color var(--t);
}
.filter-select:focus { border-color: var(--brand-maroon); }
.filter-select.active {
  border-color: var(--brand-maroon);
  background-color: var(--pink-xlight);
  font-weight: 600;
  color: var(--brand-plum);
}

/* ── Task Board ──────────────────────────────────── */
.board { display: flex; flex-direction: column; gap: 8px; }

.section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  color: var(--text-3);
  margin: 10px 0 4px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Task Card ───────────────────────────────────── */
.task-card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--t), border-color var(--t), transform var(--t);
  animation: cardIn 0.22s ease both;
}
.task-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--brand-pink);
  transform: translateY(-1px);
}
.task-card.is-done { opacity: 0.58; }
.task-card.is-done .task-title { text-decoration: line-through; color: var(--text-3); }

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

/* Priority bar — brand maroon on high, plum on medium, teal on low */
.task-pri-bar {
  width: 3px;
  border-radius: 4px;
  align-self: stretch;
  flex-shrink: 0;
  min-height: 44px;
}
.pri-high   { background: linear-gradient(180deg, var(--brand-maroon) 0%, var(--high) 100%); }
.pri-medium { background: linear-gradient(180deg, var(--brand-plum) 0%, var(--brand-pink) 100%); }
.pri-low    { background: linear-gradient(180deg, var(--low) 0%, #78C8B8 100%); }

.task-body { flex: 1; min-width: 0; }

.task-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.4;
  margin-bottom: 4px;
  word-break: break-word;
}

.task-desc {
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.55;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.badge-high    { background: var(--high-bg);    color: var(--brand-maroon); }
.badge-medium  { background: var(--medium-bg);  color: var(--medium); }
.badge-low     { background: var(--low-bg);     color: var(--low); }
.badge-todo    { background: var(--todo-bg);    color: var(--todo-c); }
.badge-inprogress { background: var(--prog-bg); color: var(--prog-c); }
.badge-done    { background: var(--done-bg);    color: var(--done-c); }

/* Assignee chip */
.assignee-chip { display: inline-flex; align-items: center; gap: 5px; }
.av {
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.av-name { font-size: 12px; font-weight: 500; color: var(--text-2); }

.task-due { font-size: 11.5px; color: var(--text-3); display: inline-flex; align-items: center; gap: 3px; font-weight: 500; }
.task-due.is-overdue { color: var(--brand-maroon); font-weight: 700; }

/* ── Card Actions ────────────────────────────────── */
.task-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--t);
}
.task-card:hover .task-actions,
.task-card:focus-within .task-actions { opacity: 1; }

.act-btn {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  font-size: 14px;
  color: var(--text-3);
  transition: all var(--t);
  line-height: 1;
}
.act-btn:hover          { background: var(--bg);         color: var(--text-1); }
.act-btn.act-done:hover { background: var(--low-bg);     color: var(--low); }
.act-btn.act-undo:hover { background: var(--pink-light); color: var(--brand-plum); }
.act-btn.act-del:hover  { background: var(--high-bg);    color: var(--brand-maroon); }

/* ── Empty State ─────────────────────────────────── */
.empty-state { text-align: center; padding: 64px 24px 80px; }
.empty-butterfly {
  width: 100px;
  height: auto;
  margin-bottom: 18px;
  opacity: 0.35;
  display: block;
  margin-inline: auto;
}
.empty-title {
  font-family: var(--font-d);
  font-size: 19px;
  font-weight: 700;
  color: var(--brand-plum);
  margin-bottom: 7px;
}
.empty-sub { font-size: 13.5px; color: var(--text-3); }

/* ── Modal ───────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(38,6,54,0.65);
  backdrop-filter: blur(6px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--card-bg);
  border-radius: 14px;
  width: 100%;
  max-width: 540px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.22s cubic-bezier(0.34,1.3,0.64,1) forwards;
  max-height: 92vh;
  overflow-y: auto;
  border: 1px solid var(--border);
}
.modal-sm { max-width: 380px; }

/* Brand gradient top strip — plum → pink → maroon (right) */
.modal::before {
  content: '';
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-plum) 0%, var(--brand-pink) 60%, var(--brand-maroon) 100%);
  border-radius: 14px 14px 0 0;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.93) translateY(14px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 0; }
.modal-title {
  font-family: var(--font-d);
  font-size: 19px;
  font-weight: 700;
  color: var(--brand-plum);
}
.modal-close {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none;
  font-size: 16px; color: var(--text-3);
  border-radius: 50%;
  transition: all var(--t);
}
.modal-close:hover { background: var(--pink-light); color: var(--brand-plum); }

.modal-body { padding: 18px 22px; display: flex; flex-direction: column; gap: 16px; }
.modal-footer { padding: 0 22px 22px; display: flex; justify-content: flex-end; gap: 10px; }

/* ── Form elements ───────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.form-group label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--brand-plum);
}
.required { color: var(--brand-maroon); margin-left: 2px; }

.form-group input[type="text"],
.form-group input[type="date"],
.form-group textarea,
.form-group select {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-1);
  background: var(--pink-xlight);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
  resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--brand-maroon);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(78,43,49,0.10);
}
.form-group input.is-error,
.form-group select.is-error {
  border-color: var(--high);
  box-shadow: 0 0 0 3px rgba(192,40,72,0.10);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-3); }

.assign-combo { display: flex; flex-direction: column; gap: 5px; }
.assign-or { font-size: 11px; color: var(--text-3); text-align: center; padding: 2px 0; font-weight: 500; }

/* Priority toggle */
.priority-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.priority-btn {
  padding: 8px 6px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  border: 2px solid var(--border);
  background: var(--pink-xlight);
  color: var(--text-3);
  transition: all var(--t);
}
.priority-btn:hover { border-color: var(--border-2); color: var(--text-2); }
.priority-btn[data-priority="low"].active    { background: var(--low-bg);    border-color: var(--low);         color: var(--low); }
.priority-btn[data-priority="medium"].active { background: var(--medium-bg); border-color: var(--brand-plum);  color: var(--brand-plum); }
.priority-btn[data-priority="high"].active   { background: var(--high-bg);   border-color: var(--brand-maroon);color: var(--brand-maroon); }

.field-error { display: none; font-size: 11.5px; color: var(--high); font-weight: 500; }
.field-error.visible { display: block; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-5px); }
  40%       { transform: translateX(5px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}
.shake { animation: shake 0.35s ease; }

.delete-message { font-size: 14px; color: var(--text-2); line-height: 1.55; padding: 4px 0; }
.delete-message span { font-weight: 600; color: var(--brand-plum); }

/* ── Toast ───────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px; right: 28px;
  background: var(--brand-plum);
  color: #f4e8ff;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  max-width: 280px;
  /* Maroon left border echoes the dot identity */
  border-left: 3px solid var(--brand-maroon);
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 960px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .keyboard-hint { display: none; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sidebar-toggle { display: flex; }
  .menu-btn { display: flex; }
  .main { margin-left: 0; padding: 0 16px 48px; }
  .task-actions { opacity: 1; }
  .topbar { position: static; }
  .page-title { font-size: 20px; }
  .brand-title .lw-i-stem { font-size: 20px; }
}
@media (max-width: 600px) {
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 16px 14px; }
  .stat-number { font-size: 26px; }
  .filters { flex-direction: column; align-items: stretch; }
  .search-wrap { min-width: unset; }
  .filter-chips { flex-wrap: wrap; }
  .filter-select { flex: 1; min-width: 0; }
  .form-row { grid-template-columns: 1fr; gap: 14px; }
  .modal { border-radius: 12px 12px 0 0; }
  .modal-overlay { align-items: flex-end; padding: 0; }
}


/* ── Sidebar user block ──────────────────────────── */
.user-info {
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.user-details { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.user-name {
  font-size: 13px;
  font-weight: 600;
  color: #e4d4f4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--pink);
  font-weight: 700;
}
.logout-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.35);
  border-radius: var(--radius-sm);
  padding: 7px;
  font-size: 12px;
  font-family: var(--font-b);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t);
  text-align: center;
  width: 100%;
}
.logout-btn:hover { border-color: var(--high); color: #F09090; background: rgba(200,48,90,.08); }

/* ── Loading overlay ─────────────────────────────── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(250,247,252,0.75);
  backdrop-filter: blur(3px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}
.loading-overlay.hidden { display: none; }
.spinner {
  width: 38px;
  height: 38px;
  border: 3px solid var(--border);
  border-top-color: var(--pink);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Members panel ───────────────────────────────── */
.members-panel {
  padding: 0 36px 48px;
}
.members-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.members-header h2 {
  font-family: var(--font-d);
  font-size: 20px;
  font-weight: 700;
  color: var(--plum);
}
.btn-sm { padding: 7px 14px; font-size: 12.5px; }

.member-card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-xs);
  animation: cardIn 0.2s ease both;
}
.member-card:hover { box-shadow: var(--shadow-md); border-color: var(--blush); }
.member-av {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800;
  color: #fff; flex-shrink: 0;
  text-transform: uppercase;
}
.member-info { flex: 1; min-width: 0; }
.member-name  { font-size: 14px; font-weight: 600; color: var(--text-1); }
.member-email { font-size: 12px; color: var(--text-3); }
.member-role-badge {
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px;
  padding: 3px 9px; border-radius: 20px;
}
.member-role-badge.admin  { background: var(--medium-bg); color: var(--medium); }
.member-role-badge.member { background: var(--pink-xlight); color: var(--pink); }
.member-actions { display: flex; gap: 4px; }

/* ── Field error (shown) ─────────────────────────── */
.field-error[style*="block"] { display: block !important; }

/* ── Scrollbar ───────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--brand-pink); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand-maroon-light); }

/* ── Focus ───────────────────────────────────────── */
:focus-visible { outline: 2px solid var(--brand-maroon); outline-offset: 2px; }
