/* ============================================================
   TASKLESS · TASK MANAGER — Design System
   ============================================================ */

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,.12);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.2);
  --transition: 150ms ease;
  --sidebar-w: 240px;
  --topbar-h: 60px;
}

/* DARK THEME (default) */
[data-theme="dark"] {
  --bg: #0e0f13;
  --bg-elev: #16181f;
  --bg-elev-2: #1c1f28;
  --bg-hover: #232631;
  --border: #2a2e3a;
  --border-strong: #3a3f4d;
  --text: #e6e8ef;
  --text-muted: #9096a6;
  --text-dim: #5f6476;
  --accent: #6366f1;
  --accent-hover: #7c7ff3;
  --accent-soft: rgba(99,102,241,.15);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --komanda: #f97316;
  --prenotazioni: #06b6d4;
}

/* LIGHT THEME */
[data-theme="light"] {
  --bg: #f7f8fa;
  --bg-elev: #ffffff;
  --bg-elev-2: #ffffff;
  --bg-hover: #f0f1f5;
  --border: #e4e6ec;
  --border-strong: #c9ccd4;
  --text: #1a1d26;
  --text-muted: #5f6476;
  --text-dim: #9096a6;
  --accent: #6366f1;
  --accent-hover: #4f52d6;
  --accent-soft: rgba(99,102,241,.1);
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --info: #2563eb;
  --komanda: #ea580c;
  --prenotazioni: #0891b2;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html, body {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  height: 100%;
  overflow: hidden;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-screen {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at top, var(--accent-soft), transparent 60%), var(--bg);
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-lg);
}
.login-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.login-logo h1 { font-size: 20px; font-weight: 700; }
.login-subtitle { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 500; color: var(--text-muted); }
.login-form select,
.login-form input[type="email"],
.login-form input[type="password"] {
  padding: 10px 12px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}
.login-form input[type="email"]:focus,
.login-form input[type="password"]:focus {
  border-color: var(--accent);
}
.login-hint { font-size: 12px; color: var(--text-dim); text-align: center; margin-top: 4px; }

/* ============================================================
   LOGO MARK
   ============================================================ */
.logo-mark {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 20px;
}
.logo-mark.small { width: 28px; height: 28px; font-size: 14px; border-radius: var(--radius-sm); }

/* ============================================================
   APP LAYOUT (Grid)
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas:
    "sidebar topbar"
    "sidebar main";
  height: 100vh;
}
.app.sidebar-collapsed {
  grid-template-columns: 0 1fr;
}
.app.sidebar-collapsed .sidebar {
  width: 0;
  overflow: hidden;
  border-right: none;
  transition: width 200ms ease;
}
.sidebar { transition: width 200ms ease; }

.sidebar {
  grid-area: sidebar;
  background: var(--bg-elev);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.sidebar-header {
  padding: 18px 20px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand { font-weight: 700; font-size: 15px; }

.sidebar-nav { flex: 1; padding: 12px 8px; }
.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  padding: 14px 12px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  width: 100%;
  text-align: left;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.nav-item .nav-icon { width: 16px; text-align: center; font-size: 14px; }
.nav-item .nav-count {
  margin-left: auto;
  font-size: 11px;
  background: var(--bg-elev-2);
  padding: 1px 8px;
  border-radius: 10px;
  color: var(--text-muted);
}

.sidebar-footer { padding: 16px; border-top: 1px solid var(--border); }
.sidebar-footer > * + * { margin-top: 14px; }
.company-filter label,
.theme-toggle-group > label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  display: block;
  margin-bottom: 6px;
}
.company-filter select {
  width: 100%;
  padding: 7px 10px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
}

/* Theme switch (night/day) */
.theme-switch {
  display: flex;
  gap: 2px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
}
.theme-btn {
  flex: 1;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 4px;
  transition: background var(--transition), color var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.theme-btn:hover { color: var(--text); }
[data-theme="dark"] .theme-btn[data-theme="dark"],
[data-theme="light"] .theme-btn[data-theme="light"] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  grid-area: topbar;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  gap: 16px;
}
.topbar-left { display: flex; align-items: center; gap: 12px; flex: 1; max-width: 600px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.search-wrapper { flex: 1; position: relative; }
.search-wrapper input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239096a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><path d='m21 21-4.3-4.3'/></svg>");
  background-repeat: no-repeat;
  background-position: 12px center;
}
.search-wrapper input:focus { outline: none; border-color: var(--accent); }

.icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
  position: relative;
  font-size: 16px;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }

.notif-badge {
  position: absolute;
  top: 6px; right: 6px;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 600;
  min-width: 16px; height: 16px;
  border-radius: 8px;
  padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
}

.user-menu {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 8px 4px 4px;
  border-radius: var(--radius-sm);
}
.user-menu:hover { background: var(--bg-hover); }
.user-name { font-size: 13px; font-weight: 500; }

.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}
.avatar.sm { width: 22px; height: 22px; font-size: 9px; }
.avatar.lg { width: 36px; height: 36px; font-size: 13px; }

/* ============================================================
   MAIN VIEW
   ============================================================ */
.view-container {
  grid-area: main;
  overflow-y: auto;
  padding: 24px 32px;
}
.view-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.view-header h2 { font-size: 22px; font-weight: 700; }
.view-header .view-subtitle { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

.view-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.tab-group {
  display: inline-flex;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}
.tab-btn {
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { background: var(--accent-soft); color: var(--accent); }
.tab-count {
  background: var(--bg-elev-2);
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.tab-btn.active .tab-count { background: var(--accent); color: white; }

/* ============================================================
   MEMBERS MULTISELECT
   ============================================================ */
.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding: 10px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.member-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.member-check:hover { border-color: var(--border-strong); }
.member-check.selected, .member-check:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.member-check input { cursor: pointer; accent-color: var(--accent); }
.member-info { flex: 1; min-width: 0; }
.member-name { font-size: 13px; font-weight: 500; }
.member-role { font-size: 11px; color: var(--text-muted); }
.toolbar-select, .toolbar-input {
  padding: 6px 10px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 13px;
  transition: background var(--transition), transform var(--transition);
  display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg-elev); border: 1px solid var(--border); color: var(--text); }
.btn-secondary:hover { background: var(--bg-hover); }
.btn-danger { background: var(--danger); color: white; }
.btn-ghost { color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn-sm { padding: 6px 10px; font-size: 12px; }

/* ============================================================
   CARDS & LISTS
   ============================================================ */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}

/* ============================================================
   TASK CARDS (used in Kanban and My Tasks)
   ============================================================ */
.task-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition);
  display: flex; flex-direction: column; gap: 8px;
}
.task-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.task-card.dragging { opacity: 0.5; }

.task-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.task-title { font-weight: 500; font-size: 13px; line-height: 1.4; }
.task-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-muted); flex-wrap: wrap; }
.task-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-dim); }

/* BADGES */
.badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  display: inline-flex; align-items: center; gap: 4px;
}
.badge-priority-low { background: rgba(148,163,184,.15); color: #94a3b8; }
.badge-priority-medium { background: rgba(59,130,246,.15); color: var(--info); }
.badge-priority-high { background: rgba(245,158,11,.15); color: var(--warning); }
.badge-priority-urgent { background: rgba(239,68,68,.15); color: var(--danger); }

.badge-status-backlog { background: rgba(148,163,184,.15); color: #94a3b8; }
.badge-status-todo { background: rgba(99,102,241,.15); color: var(--accent); }
.badge-status-in_progress { background: rgba(245,158,11,.15); color: var(--warning); }
.badge-status-review { background: rgba(6,182,212,.15); color: #06b6d4; }
.badge-status-done { background: rgba(34,197,94,.15); color: var(--success); }
.badge-blocked { background: rgba(239,68,68,.15); color: var(--danger); }

.badge-type { background: var(--bg-elev-2); color: var(--text-muted); border: 1px solid var(--border); }

.badge-company-komanda { background: rgba(249,115,22,.15); color: var(--komanda); }
.badge-company-prenotazioni { background: rgba(6,182,212,.15); color: var(--prenotazioni); }
.badge-company-both { background: rgba(139,92,246,.15); color: #a78bfa; }

/* ============================================================
   KANBAN BOARD
   ============================================================ */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(260px, 1fr));
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 20px;
}
.kanban-column {
  background: var(--bg-elev);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--topbar-h) - 140px);
}
.kanban-column-header {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.kanban-column-header h4 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); }
.kanban-column-count { font-size: 11px; color: var(--text-dim); background: var(--bg-elev-2); padding: 2px 8px; border-radius: 10px; }
.kanban-column-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  flex: 1;
  min-height: 100px;
}
.kanban-column-body.drop-target { background: var(--accent-soft); }

/* ============================================================
   LIST VIEW / TABLE
   ============================================================ */
.task-table {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  border-collapse: separate;
  border-spacing: 0;
}
.task-table th, .task-table td {
  padding: 10px 14px;
  text-align: left;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.task-table th {
  background: var(--bg-elev-2);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.task-table tbody tr { cursor: pointer; transition: background var(--transition); }
.task-table tbody tr:hover { background: var(--bg-hover); }
.task-table tbody tr:last-child td { border-bottom: none; }

/* ============================================================
   MY TASKS (grouped by status)
   ============================================================ */
.mytasks-group { margin-bottom: 28px; }
.mytasks-group-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.mytasks-group-count { background: var(--bg-elev-2); padding: 2px 8px; border-radius: 10px; font-size: 11px; color: var(--text); }
.mytasks-group-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 6px; }

/* ============================================================
   DASHBOARD
   ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}
.kpi-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.kpi-value { font-size: 28px; font-weight: 700; }
.kpi-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.kpi-value.danger { color: var(--danger); }
.kpi-value.warning { color: var(--warning); }
.kpi-value.success { color: var(--success); }

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 1100px) { .dashboard-grid { grid-template-columns: 1fr; } }

.dashboard-panel { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px; }
.dashboard-panel h3 { font-size: 14px; font-weight: 600; margin-bottom: 14px; }

.workload-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.workload-row:last-child { border-bottom: none; }
.workload-bar { flex: 1; height: 6px; background: var(--bg-elev-2); border-radius: 3px; overflow: hidden; position: relative; }
.workload-bar-fill { height: 100%; background: var(--accent); transition: width var(--transition); }
.workload-bar-fill.overloaded { background: var(--danger); }
.workload-count { font-size: 12px; color: var(--text-muted); min-width: 30px; text-align: right; }

/* ============================================================
   USERS VIEW
   ============================================================ */
.users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.user-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-card-info { flex: 1; min-width: 0; }
.user-card-name { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.user-card-role { font-size: 12px; color: var(--text-muted); }

/* ============================================================
   MODALS
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 150ms ease;
}
.modal {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  animation: slideUp 200ms ease;
}
.modal.modal-sm { max-width: 480px; }
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-header h3 { font-size: 15px; font-weight: 600; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
}

/* ============================================================
   TASK DETAIL (inside modal)
   ============================================================ */
.task-detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}
@media (max-width: 800px) { .task-detail-grid { grid-template-columns: 1fr; } }

.task-detail-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
}
.task-detail-title:focus { outline: 2px solid var(--accent); border-radius: var(--radius-sm); padding: 4px; }

.task-detail-desc {
  width: 100%;
  min-height: 100px;
  padding: 10px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  resize: vertical;
  font-size: 13px;
  line-height: 1.5;
}

.detail-field { margin-bottom: 14px; }
.detail-field label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}
.detail-field select, .detail-field input[type="date"], .detail-field input[type="text"], .detail-field input[type="number"] {
  width: 100%;
  padding: 7px 10px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
}

.comments-section { margin-top: 20px; }
.comments-section h4 { font-size: 13px; margin-bottom: 10px; color: var(--text-muted); }
.comment {
  display: flex; gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.comment-content { flex: 1; }
.comment-author { font-size: 12px; font-weight: 600; }
.comment-date { font-size: 11px; color: var(--text-dim); margin-left: 6px; }
.comment-text { font-size: 13px; margin-top: 4px; line-height: 1.5; white-space: pre-wrap; }
.comment-form { margin-top: 12px; display: flex; gap: 8px; }
.comment-form textarea {
  flex: 1;
  min-height: 60px;
  padding: 8px 10px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  resize: vertical;
  font-size: 13px;
}

.activity-log { margin-top: 12px; font-size: 12px; color: var(--text-muted); }
.activity-log-item { padding: 6px 0; border-bottom: 1px dashed var(--border); }
.activity-log-item:last-child { border-bottom: none; }

/* ============================================================
   TOAST
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 2000;
}
.toast {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  box-shadow: var(--shadow-md);
  min-width: 260px;
  max-width: 360px;
  font-size: 13px;
  animation: slideInRight 200ms ease;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

/* ============================================================
   NOTIFICATIONS PANEL
   ============================================================ */
.notif-panel {
  position: absolute;
  top: calc(var(--topbar-h) + 4px);
  right: 20px;
  width: 360px;
  max-height: 500px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 500;
  overflow: hidden;
  display: flex; flex-direction: column;
}
.notif-panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 600;
  font-size: 14px;
}
.notif-panel-body { overflow-y: auto; flex: 1; }
.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}
.notif-item:hover { background: var(--bg-hover); }
.notif-item.unread { background: var(--accent-soft); }
.notif-item-msg { font-size: 13px; margin-bottom: 4px; }
.notif-item-date { font-size: 11px; color: var(--text-dim); }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ============================================================
   UTILITIES
   ============================================================ */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.text-sm { font-size: 12px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 800px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-areas: "topbar" "main";
  }
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    height: 100vh;
    width: 240px;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 200ms ease;
  }
  .app.sidebar-open .sidebar { transform: translateX(0); }
  .view-container { padding: 16px; }
  .user-name { display: none; }
  .kanban-board { grid-template-columns: repeat(4, 260px); }
}

/* Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }
