/* ═══════════════════════════════════════════════════════════════
   MilkyLabs Workspace — Love Shake design system
   ═══════════════════════════════════════════════════════════════ */

:root {
  --font-display: 'Fredoka', 'Segoe UI', sans-serif;
  --font-body: 'Manrope', 'Segoe UI', sans-serif;
  --ws-radius: 1.25rem;
  --ws-radius-lg: 1.5rem;
  --ws-glow: rgba(244, 114, 182, 0.35);
}

/* ── Ambient background grid ───────────────────────────────────── */
.ws-grid-bg {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* ── Panels & cards (wiki ls-* parity) ─────────────────────────── */
.ws-panel {
  background: rgba(22, 18, 28, 0.88);
  border: 1px solid var(--border-light);
  border-radius: var(--ws-radius-lg);
  backdrop-filter: blur(12px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 18px 40px rgba(0, 0, 0, 0.35);
}

.ws-card {
  background: linear-gradient(160deg, rgba(36, 28, 46, 0.95), rgba(22, 18, 28, 0.98));
  border: 1px solid var(--border-light);
  border-radius: var(--ws-radius);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 12px 32px rgba(0, 0, 0, 0.28);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.ws-card:hover {
  border-color: rgba(244, 114, 182, 0.45);
}

.ws-card-interactive:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 18px 40px rgba(0, 0, 0, 0.38),
    0 0 24px var(--ws-glow);
}

/* ── Global component polish ───────────────────────────────────── */
.btn {
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transform: scale(0);
  animation: btn-ripple 0.55s ease-out forwards;
  pointer-events: none;
  z-index: 0;
}

@keyframes btn-ripple {
  to {
    transform: scale(1);
    opacity: 0;
  }
}

.btn > *:not(.ripple) {
  position: relative;
  z-index: 1;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #fb7185 0%, #f472b6 45%, #c084fc 100%);
  box-shadow: 0 8px 24px rgba(244, 114, 182, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 12px 32px rgba(244, 114, 182, 0.45);
  filter: brightness(1.05);
}

.btn-primary:active {
  transform: translateY(0) !important;
  filter: brightness(0.98);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-ghost:hover {
  border-color: rgba(244, 114, 182, 0.45);
  background: rgba(244, 114, 182, 0.08);
  color: var(--text-0);
}

.btn-icon {
  border-radius: 12px;
}

.input,
textarea.input,
select.input {
  border-radius: 1rem;
  background: rgba(12, 10, 15, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.input:focus {
  border-color: rgba(244, 114, 182, 0.65);
  box-shadow: 0 0 0 3px rgba(244, 114, 182, 0.18);
}

.input::placeholder { color: rgba(196, 181, 200, 0.5); }

.card {
  background: linear-gradient(160deg, rgba(36, 28, 46, 0.92), rgba(22, 18, 28, 0.96));
  border: 1px solid var(--border-light);
  border-radius: var(--ws-radius);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

.card:hover {
  transform: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

/* ── Shell ─────────────────────────────────────────────────────── */
.topbar {
  background: rgba(12, 10, 15, 0.72);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.topbar-search-btn {
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  min-width: 220px;
  transition: all 0.2s ease !important;
}

.topbar-search-btn:hover {
  border-color: rgba(244, 114, 182, 0.5) !important;
  background: rgba(244, 114, 182, 0.08) !important;
  color: var(--text-0) !important;
}

.topbar-user-btn {
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.topbar-user-btn:hover {
  border-color: rgba(244, 114, 182, 0.4) !important;
  background: rgba(244, 114, 182, 0.08) !important;
}

#user-menu,
#status-picker,
.notif-dropdown {
  background: rgba(22, 18, 28, 0.96) !important;
  border: 1px solid var(--border-light) !important;
  border-radius: var(--ws-radius) !important;
  backdrop-filter: blur(16px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45) !important;
}

.sidebar {
  background: rgba(12, 10, 15, 0.55);
  backdrop-filter: blur(14px);
}

.sidebar-link {
  border-radius: 12px;
  margin: 2px 10px;
  border-left: none;
  padding: 10px 14px;
}

.sidebar-link:hover {
  background: rgba(244, 114, 182, 0.08);
  color: var(--text-0);
}

.sidebar-link.active {
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.18), rgba(192, 132, 252, 0.12));
  border: 1px solid rgba(244, 114, 182, 0.35);
  color: #f9a8d4;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(244, 114, 182, 0.12);
}

.sidebar-user {
  margin: 8px 10px 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--ws-radius);
  background: rgba(255, 255, 255, 0.03);
}

.main-content {
  animation: ws-rise-in 0.5s ease both;
}

@keyframes ws-rise-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Search overlay */
.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(12, 10, 15, 0.75);
  backdrop-filter: blur(8px);
  z-index: 800;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
}

.search-overlay.open { display: flex; }

.search-modal {
  width: min(600px, 92vw);
  overflow: hidden;
}

.search-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

#search-results a:hover { background: rgba(244, 114, 182, 0.08); }

#search-overlay > div {
  background: rgba(22, 18, 28, 0.97) !important;
  border: 1px solid var(--border-light) !important;
  border-radius: var(--ws-radius-lg) !important;
  backdrop-filter: blur(20px);
}

/* ── Page chrome ───────────────────────────────────────────────── */
.ws-page {
  padding: 28px 32px 40px;
  max-width: 1440px;
  margin: 0 auto;
}

.ws-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.ws-page-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-0);
  line-height: 1.2;
}

.ws-page-sub {
  font-size: 0.85rem;
  color: var(--text-3);
  margin-top: 4px;
}

.ws-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-3);
}

.ws-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid rgba(244, 114, 182, 0.35);
  background: rgba(244, 114, 182, 0.12);
  color: #f9a8d4;
}

/* ── Dashboard ─────────────────────────────────────────────────── */
.db-wrap {
  padding: 28px 32px 40px;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 1440px;
  margin: 0 auto;
}

.db-greeting {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px 28px;
  background: linear-gradient(135deg, rgba(36, 28, 46, 0.9), rgba(22, 18, 28, 0.95));
  border: 1px solid var(--border-light);
  border-radius: var(--ws-radius-lg);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  position: relative;
  overflow: hidden;
}

.db-greeting::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -5%;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(244, 114, 182, 0.15), transparent 70%);
  pointer-events: none;
}

.db-greeting-avatar { flex-shrink: 0; position: relative; z-index: 1; }

.db-greeting-name {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--text-0);
  line-height: 1.2;
  position: relative;
  z-index: 1;
}

.db-greeting-sub {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 4px;
  font-family: 'JetBrains Mono', monospace;
  position: relative;
  z-index: 1;
}

.db-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.db-stat-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(36, 28, 46, 0.9), rgba(22, 18, 28, 0.95));
  border: 1px solid var(--border-light);
  border-radius: var(--ws-radius);
  padding: 20px 22px 16px;
  text-decoration: none;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.db-stat-card:hover {
  border-color: var(--c);
  transform: translateY(-3px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35), 0 0 20px color-mix(in srgb, var(--c) 25%, transparent);
}

.db-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--c);
  opacity: 0.85;
  border-radius: var(--ws-radius) var(--ws-radius) 0 0;
}

.db-stat-icon { color: var(--c); margin-bottom: 8px; opacity: 0.9; }

.db-stat-val {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 600;
  line-height: 1;
  color: var(--text-0);
}

.db-stat-lbl {
  font-size: 11px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.db-stat-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: var(--w, 0%);
  background: var(--c);
  opacity: 0.3;
  border-radius: 0 2px 0 0;
  transition: width 0.6s ease;
}

.db-alert {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: rgba(192, 132, 252, 0.1);
  border: 1px solid rgba(192, 132, 252, 0.3);
  border-radius: var(--ws-radius);
  padding: 14px 20px;
}

.db-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 300px 260px;
  gap: 18px;
  align-items: start;
}

.db-card {
  background: linear-gradient(160deg, rgba(36, 28, 46, 0.92), rgba(22, 18, 28, 0.96));
  border: 1px solid var(--border-light);
  border-radius: var(--ws-radius);
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

.db-card-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.db-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-0);
}

.db-card-link {
  font-size: 11px;
  color: var(--text-3);
  text-decoration: none;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  transition: all 0.15s;
  font-weight: 600;
}

.db-card-link:hover {
  color: var(--accent);
  border-color: rgba(244, 114, 182, 0.45);
  background: rgba(244, 114, 182, 0.1);
}

.db-task-list { padding: 6px 0; }

.db-task-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
  border-left: 3px solid transparent;
}

.db-task-row:hover {
  background: rgba(244, 114, 182, 0.06);
  border-left-color: var(--accent);
}

.db-task-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.db-task-info { flex: 1; min-width: 0; }

.db-task-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-0);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.db-task-meta { font-size: 11px; color: var(--text-3); margin-top: 2px; }

.db-deadline-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.db-deadline-row:last-of-type { border-bottom: none; }
.db-deadline-row:hover { background: rgba(244, 114, 182, 0.06); }

.db-deadline-date { width: 40px; text-align: center; flex-shrink: 0; }

.db-deadline-day {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1;
}

.db-deadline-mon {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
}

.db-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 36px 20px;
  color: var(--text-3);
  gap: 10px;
  font-size: 13px;
}

.db-quick-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  color: var(--text-1);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 500;
  transition: all 0.18s ease;
}

.db-quick-btn:hover {
  background: rgba(244, 114, 182, 0.1);
  border-color: rgba(244, 114, 182, 0.45);
  color: #f9a8d4;
  transform: translateY(-1px);
}

.db-presence-card { overflow: hidden; }

.db-presence-count {
  font-size: 11px;
  color: var(--mint);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.db-presence-list {
  padding: 8px 0;
  max-height: 480px;
  overflow-y: auto;
}

.db-presence-section {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 6px 16px 4px;
}

.db-presence-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
  border-radius: 10px;
  margin: 0 6px;
}

.db-presence-row:hover { background: rgba(244, 114, 182, 0.08); }

.db-presence-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid var(--bg-2);
}

.db-presence-info { flex: 1; min-width: 0; }

.db-presence-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.db-presence-status {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 1px;
}

.ws-role-pill {
  font-size: 9.5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

/* ── Tasks page ────────────────────────────────────────────────── */
.tasks-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px 32px 40px;
  max-width: 1320px;
  margin: 0 auto;
  min-height: calc(100vh - var(--topbar-h));
  box-sizing: border-box;
}

.tasks-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  flex-wrap: wrap;
}

.tasks-page-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-0);
  margin: 0;
}

.tasks-page-sub {
  font-size: 13px;
  color: var(--text-3);
  margin: 4px 0 0;
}

.tasks-page-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tasks-toolbar {
  padding: 16px 20px !important;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tasks-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tasks-search-wrap {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  height: 40px;
  border-radius: 999px;
  background: rgba(12, 10, 15, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: border-color 0.2s;
}

.tasks-search-wrap:focus-within {
  border-color: rgba(244, 114, 182, 0.55);
  box-shadow: 0 0 0 3px rgba(244, 114, 182, 0.12);
}

.tasks-search-wrap svg {
  width: 16px;
  height: 16px;
  color: var(--text-3);
  flex-shrink: 0;
}

.tasks-search-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-0);
  font-family: var(--font-body);
  font-size: 13.5px;
  outline: none;
}

.tasks-search-input::placeholder { color: var(--text-3); }

.tasks-chip-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  font-family: var(--font-body);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.tasks-chip-btn:hover,
.tasks-chip-btn.active {
  border-color: rgba(244, 114, 182, 0.5);
  background: rgba(244, 114, 182, 0.12);
  color: #f9a8d4;
}

.tasks-chip-clear { color: var(--text-3); }

.view-toggle {
  display: flex;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
}

.view-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  border: none;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.15s;
  text-decoration: none;
  border-right: 1px solid var(--border-light);
}

.view-btn:last-child { border-right: none; }
.view-btn:hover { background: rgba(244, 114, 182, 0.08); color: var(--text-0); }
.view-btn.active { background: rgba(244, 114, 182, 0.18); color: #f9a8d4; }
.view-btn svg { width: 14px; height: 14px; }

.tasks-select {
  padding: 8px 32px 8px 14px;
  background-color: rgba(12, 10, 15, 0.65);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  color: var(--text-1);
  font-size: 12.5px;
  font-family: var(--font-body);
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%238b7a94' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.tasks-select:focus { border-color: var(--accent); }
.filter-active { border-color: var(--accent) !important; color: var(--accent) !important; }

.status-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.status-tabs::-webkit-scrollbar { display: none; }

.status-tab {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  color: var(--text-3);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.15s;
  font-family: var(--font-body);
}

.status-tab:hover { border-color: var(--text-2); color: var(--text-1); }
.status-tab.active-all { background: rgba(255,255,255,0.08); border-color: var(--border-light); color: var(--text-1); }
.status-tab.active-open { background: var(--sky-dim); border-color: var(--sky); color: var(--sky); }
.status-tab.active-in_progress { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.status-tab.active-review { background: rgba(192,132,252,0.14); border-color: var(--purple); color: var(--purple); }
.status-tab.active-returned { background: var(--rose-dim); border-color: var(--rose); color: var(--rose); }
.status-tab.active-closed { background: var(--mint-dim); border-color: var(--mint); color: var(--mint); }

.status-tab-count {
  font-size: 10px;
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 7px;
  border-radius: 999px;
}

/* Grouped list */
.tasks-grouped-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tasks-section { overflow: hidden; }

.tasks-section-hdr {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.tasks-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-0);
}

.tasks-section-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--section-c, var(--accent));
  box-shadow: 0 0 10px color-mix(in srgb, var(--section-c, var(--accent)) 50%, transparent);
}

.tasks-section-count {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-3);
  font-family: var(--font-body);
}

.tasks-section-body { padding: 6px 0; }

.tasks-row {
  display: grid;
  grid-template-columns: 4px 1fr 180px 120px auto;
  gap: 16px;
  align-items: center;
  padding: 12px 20px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.15s;
}

.tasks-row:last-child { border-bottom: none; }
.tasks-row:hover { background: rgba(244, 114, 182, 0.06); }

.tasks-row-priority {
  width: 4px;
  height: 36px;
  border-radius: 4px;
  align-self: center;
}

.tasks-row-main { min-width: 0; }

.tasks-row-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-0);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tasks-row-tags {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tasks-row-assignee {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-2);
  min-width: 0;
}

.tasks-row-assignee span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tasks-row-muted { font-size: 12px; color: var(--text-3); }

.task-deadline-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  color: var(--text-2);
}

.task-deadline-chip.overdue {
  background: var(--red-dim);
  border-color: rgba(251, 113, 133, 0.4);
  color: var(--red);
}

.task-deadline-chip.soon {
  background: var(--accent-dim);
  border-color: rgba(244, 114, 182, 0.4);
  color: var(--accent);
}

.tasks-section-empty,
.tasks-empty-state {
  padding: 28px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}

.tasks-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 48px 24px;
}

.tasks-empty-state svg { opacity: 0.25; }

.tasks-empty-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-2);
}

.tasks-empty-state a { color: var(--accent); }

/* Kanban */
.kanban-wrap {
  flex: 1;
  overflow: auto;
  padding-bottom: 8px;
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  align-items: start;
}

.kanban-col {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 280px);
  overflow: hidden;
  padding: 0 !important;
}

.kanban-col-bar {
  height: 3px;
  flex-shrink: 0;
  border-radius: var(--ws-radius) var(--ws-radius) 0 0;
}

.kanban-col-hdr {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.kanban-col-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
}

.kanban-col-count {
  font-size: 11px;
  color: var(--text-3);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 700;
}

.kanban-cards {
  overflow-y: auto;
  flex: 1;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-card {
  padding: 14px !important;
  text-decoration: none;
  display: block;
  position: relative;
  transition: all 0.2s ease !important;
}

.priority-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 14px 0 0 14px;
}

.task-card-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-0);
  margin-bottom: 10px;
  line-height: 1.4;
  padding-left: 8px;
}

.task-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-left: 8px;
}

.task-card-assignee {
  font-size: 11px;
  color: var(--text-2);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban-empty {
  text-align: center;
  padding: 24px 12px;
  color: var(--text-3);
  font-size: 12px;
  opacity: 0.7;
}

/* ── Calendar page ─────────────────────────────────────────────── */
.cal-page {
  padding: 24px 32px 40px;
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: calc(100vh - var(--topbar-h));
  box-sizing: border-box;
}

.cal-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  flex-wrap: wrap;
}

.cal-page-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-0);
  margin: 0;
}

.cal-page-sub {
  font-size: 13px;
  color: var(--text-3);
  margin: 4px 0 0;
}

.cal-page-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cal-split {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 18px;
  align-items: start;
}

.cal-agenda { padding: 0; overflow: hidden; }

.cal-agenda-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}

.cal-agenda-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-0);
  margin: 0;
}

.cal-agenda-list {
  max-height: calc(100vh - 320px);
  overflow-y: auto;
  padding: 8px 12px 16px;
}

.cal-agenda-loading,
.cal-agenda-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}

.cal-agenda-day {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 14px 10px 6px;
  font-family: var(--font-display);
}

.cal-agenda-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  margin-bottom: 4px;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
  transition: all 0.15s;
}

.cal-agenda-item:hover {
  background: rgba(244, 114, 182, 0.08);
  border-color: rgba(244, 114, 182, 0.2);
}

.cal-agenda-item.mine { border-left: 3px solid var(--purple); }
.cal-agenda-item.other { border-left: 3px solid var(--text-3); }
.cal-agenda-item.overdue { border-left: 3px solid var(--red); }

.cal-agenda-date {
  width: 44px;
  text-align: center;
  flex-shrink: 0;
}

.cal-agenda-date-num {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1;
  color: var(--text-0);
}

.cal-agenda-date-mon {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin-top: 2px;
}

.cal-agenda-info { flex: 1; min-width: 0; }

.cal-agenda-item-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-0);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-agenda-item-meta {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 2px;
}

.cal-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
}

.cal-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-2);
}

.cal-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.cal-legend-dot.mine { background: var(--purple); }
.cal-legend-dot.other { background: #8b7a94; }
.cal-legend-dot.overdue { background: var(--red); }

.cal-mini { padding: 0; overflow: hidden; }

.cal-mini-hdr {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-0);
}

.cal-mini-grid { padding: 8px 10px 14px; }

.cal-full { padding: 0; overflow: hidden; }

.cal-full-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.cal-full-views { display: flex; gap: 6px; flex-wrap: wrap; }

.cal-full #calendar-full { padding: 12px 16px 20px; }

.cal-overdue-banner {
  background: var(--red-dim);
  border: 1px solid rgba(251, 113, 133, 0.35);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--red);
  text-align: center;
}

/* FullCalendar wiki theme */
.fc {
  --fc-border-color: var(--border) !important;
  --fc-page-bg-color: transparent !important;
  --fc-neutral-bg-color: rgba(22, 18, 28, 0.5) !important;
  --fc-today-bg-color: rgba(244, 114, 182, 0.1) !important;
}

.fc .fc-toolbar-title {
  font-family: var(--font-display) !important;
  font-size: 1.1rem !important;
  font-weight: 600 !important;
  color: var(--text-0) !important;
}

.fc .fc-button {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid var(--border-light) !important;
  color: var(--text-1) !important;
  font-family: var(--font-body) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  border-radius: 999px !important;
  padding: 6px 14px !important;
  box-shadow: none !important;
}

.fc .fc-button:hover {
  background: rgba(244, 114, 182, 0.12) !important;
  border-color: rgba(244, 114, 182, 0.4) !important;
}

.fc .fc-button-active {
  background: linear-gradient(135deg, #fb7185, #c084fc) !important;
  color: #fff !important;
  border-color: transparent !important;
}

.fc .fc-col-header-cell {
  background: rgba(22, 18, 28, 0.6) !important;
}

.fc .fc-col-header-cell-cushion {
  color: var(--text-3) !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  text-decoration: none !important;
}

.fc .fc-daygrid-day {
  background: rgba(12, 10, 15, 0.4) !important;
}

.fc .fc-daygrid-day:hover {
  background: rgba(244, 114, 182, 0.06) !important;
}

.fc .fc-daygrid-day-number {
  color: var(--text-2) !important;
  text-decoration: none !important;
  font-size: 12px !important;
  padding: 6px !important;
}

.fc .fc-day-today {
  background: rgba(244, 114, 182, 0.12) !important;
}

.fc .fc-day-today .fc-daygrid-day-number {
  color: var(--accent) !important;
  font-weight: 700 !important;
}

.fc .fc-event {
  border-radius: 8px !important;
  font-size: 11px !important;
  border: none !important;
  padding: 2px 6px !important;
  font-weight: 600 !important;
}

.fc .fc-list-day-cushion { background: rgba(22, 18, 28, 0.8) !important; }
.fc .fc-list-day-text, .fc .fc-list-day-side-text { color: var(--text-2) !important; }
.fc .fc-list-event td { background: transparent !important; border-color: var(--border) !important; }
.fc .fc-list-event:hover td { background: rgba(244, 114, 182, 0.08) !important; }
.fc .fc-list-event-title a { color: var(--text-0) !important; text-decoration: none !important; }

@media (max-width: 960px) {
  .tasks-page { padding: 16px; }
  .tasks-row {
    grid-template-columns: 4px 1fr auto;
    gap: 10px;
  }
  .tasks-row-assignee,
  .tasks-row-deadline { display: none; }
  .status-tabs { display: none; }
  .cal-split { grid-template-columns: 1fr; }
  .cal-agenda-list { max-height: none; }
  .cal-mini-grid .fc { font-size: 11px; }
}

@media (max-width: 600px) {
  .kanban-board { grid-template-columns: 1fr; }
  .tasks-filter-row .tasks-select { width: 100%; }
  .tasks-page-head { flex-direction: column; align-items: stretch; }
  .tasks-page-head-actions { justify-content: space-between; }
}

/* ── Auth pages ────────────────────────────────────────────────── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow: auto;
  padding: 24px;
}

.auth-page .auth-wrap { width: min(420px, 100%); }

.auth-page .logo-mark-lg {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, #fb7185, #f472b6, #c084fc);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  color: #0c0a0f;
  box-shadow: 0 12px 36px rgba(244, 114, 182, 0.4);
}

.auth-page .auth-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  background: linear-gradient(135deg, #f9a8d4, #f472b6, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-page .auth-box {
  background: rgba(22, 18, 28, 0.92);
  border: 1px solid var(--border-light);
  border-radius: var(--ws-radius-lg);
  padding: 32px;
  backdrop-filter: blur(16px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.auth-page .auth-box h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-0);
  margin-bottom: 24px;
}

/* ── Status badges ─────────────────────────────────────────────── */
.status-badge {
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 10px;
}

/* ── Flash messages ────────────────────────────────────────────── */
.flash-container {
  position: fixed;
  top: calc(var(--topbar-h) + 12px);
  right: 20px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flash {
  border-radius: 14px;
  backdrop-filter: blur(12px);
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  animation: ws-rise-in 0.35s ease both;
}

/* ── Notifications page ──────────────────────────────────────────── */
.notif-page-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 32px 60px;
}

.notif-page-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text-0);
}

.notif-filter-btn {
  font-family: var(--font-body) !important;
  border-radius: 999px !important;
}

.notif-card {
  background: linear-gradient(160deg, rgba(36, 28, 46, 0.92), rgba(22, 18, 28, 0.96)) !important;
  border: 1px solid var(--border-light) !important;
  border-radius: var(--ws-radius) !important;
}

.notif-item.unread {
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.08) 0%, transparent 80%) !important;
}

.notif-group-label {
  font-family: var(--font-display) !important;
}

.notif-empty-title {
  font-family: var(--font-display) !important;
}

.notif-badge {
  font-family: var(--font-display) !important;
  border-radius: 999px !important;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 1280px) {
  .db-grid { grid-template-columns: 1fr 1fr 280px; }
  .db-presence-card { grid-column: 1 / -1; }
}

@media (max-width: 1000px) {
  .db-stats { grid-template-columns: repeat(2, 1fr); }
  .db-grid { grid-template-columns: 1fr 1fr; }
  .ws-page, .db-wrap { padding: 20px 18px 32px; }
}

@media (max-width: 700px) {
  .db-grid { grid-template-columns: 1fr; }
  .topbar-search-btn { min-width: 0; flex: 1; }
  .topbar-username { display: none !important; }
}

@media (max-width: 480px) {
  .db-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .db-stat-val { font-size: 1.8rem; }
  .db-greeting { padding: 18px; flex-wrap: wrap; }
  .db-greeting-name { font-size: 1.2rem; }
}

/* ── Mobile polish (global) ─────────────────────────────────────── */
@media (max-width: 900px) {
  .page-wrap { padding: 12px 14px 28px !important; max-width: 100% !important; }
  .topbar-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 42vw;
  }
  .flash-container {
    left: 12px;
    right: 12px;
    top: calc(var(--topbar-h) + 8px);
  }
  .flash { width: 100%; box-sizing: border-box; }
  .notif-page-wrap { padding: 16px 14px 40px; }
  .ws-page { padding: 14px 12px 32px !important; }
  .card-header { flex-wrap: wrap; gap: 8px; }
  .status-actions-card .btn { width: 100%; justify-content: center; }
  .task-detail-layout h1 { font-size: 1.15rem !important; line-height: 1.35 !important; }
  .task-detail-layout .card > div[style*="justify-content:space-between"] {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .task-detail-layout .card > div[style*="justify-content:space-between"] > div:last-child {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .task-detail-layout .card > div[style*="justify-content:space-between"] .btn { flex: 1; min-width: 0; }
  .comment-form textarea,
  .comment-form .btn { width: 100%; }
  .tasks-filter-row { flex-direction: column; align-items: stretch; }
  .tasks-filter-row > * { width: 100% !important; }
  .tasks-view-toggle { width: 100%; justify-content: center; }
  .tasks-status-pills { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .cal-page-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .cal-expand-btn { width: 100%; justify-content: center; }
}

@media (max-width: 600px) {
  body { padding-bottom: env(safe-area-inset-bottom, 0); }
  .page-wrap { padding: 10px 10px 24px !important; }
  .wf-steps-wrap { margin-bottom: 14px !important; }
  .wf-step { min-width: max-content; }
  .tasks-page { padding: 10px !important; }
  .tasks-page-head-actions .btn { flex: 1; }
  .kanban-board {
    display: flex !important;
    overflow-x: auto;
    gap: 12px;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }
  .kanban-col { min-width: 260px; flex-shrink: 0; }
  .auth-page .auth-box { padding: 22px 18px; }
  .modal-overlay .modal { margin: 0; }
  .topbar { padding-right: 8px !important; }
  .btn, .btn-icon { min-height: 40px; min-width: 40px; }
  .btn-sm { min-height: 36px; }
}

@media (max-width: 400px) {
  .topbar-title { max-width: 28vw; font-size: 11px !important; }
  .db-stats { grid-template-columns: 1fr; }
  .tasks-row-meta { display: none; }
}
