/* ═══════════════════════════════════════
   ProjectBoard — Monday.com Light Theme
   ═══════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f6f7fb;
  --white: #ffffff;
  --surface: #ffffff;
  --surface-hover: #f5f6f8;
  --surface-active: #e6e9ef;
  --border: #e6e9ef;
  --border-strong: #d0d4e4;
  --text: #323338;
  --text-dim: #676879;
  --text-muted: #9699a6;
  --text-light: #c5c7d0;
  --primary: #0073ea;
  --primary-hover: #0060c2;
  --primary-light: #cce5ff;
  --danger: #e44258;
  --success: #00c875;
  --warning: #fdab3d;
  --stuck: #e44258;
  --working: #fdab3d;
  --done: #00c875;
  --not-started: #c4c4c4;
  --pri-high: #401694;
  --pri-medium: #5559df;
  --pri-low: #579bfc;
  --pri-critical: #333333;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --radius: 8px;
}

html { font-size: 14px; }
body {
  font-family: 'Figtree', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ════ LOGIN ════ */
.login-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px; background: var(--bg);
}
.login-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 12px; padding: 40px; width: 100%; max-width: 400px;
  box-shadow: var(--shadow-md);
}
.login-logo {
  width: 48px; height: 48px; background: var(--primary);
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 22px; color: #fff; margin: 0 auto 20px;
}
.login-card h2 { text-align: center; font-size: 1.5rem; font-weight: 700; margin-bottom: 4px; }
.login-card .subtitle { text-align: center; color: var(--text-muted); font-size: 0.9rem; margin-bottom: 24px; }

.form-group { margin-bottom: 14px; }
.form-group label {
  display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-dim);
  margin-bottom: 5px;
}
.form-input, .form-select {
  width: 100%; padding: 9px 12px; background: var(--white);
  border: 1px solid var(--border-strong); border-radius: 6px;
  color: var(--text); font-family: inherit; font-size: 0.92rem;
  transition: border-color 0.15s;
}
.form-input:focus, .form-select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0,115,234,0.15);
}
.form-input::placeholder { color: var(--text-light); }
.form-select { appearance: none; cursor: pointer; }

.login-btn {
  width: 100%; padding: 11px; background: var(--primary); color: #fff;
  border: none; border-radius: 6px; font-family: inherit;
  font-size: 0.95rem; font-weight: 600; cursor: pointer; margin-top: 6px;
  transition: background 0.15s;
}
.login-btn:hover { background: var(--primary-hover); }
.login-error { color: var(--danger); font-size: 0.85rem; text-align: center; margin-top: 10px; }
.login-demo { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.login-demo p { font-size: 0.78rem; color: var(--text-muted); text-align: center; margin-bottom: 8px; font-weight: 600; }

/* ════ APP SHELL ════ */
.app { display: none; }
.app.visible { display: block; }
.layout { display: flex; min-height: 100vh; }

/* ════ SIDEBAR ════ */
.sidebar {
  width: 250px; background: #292f4c; color: #fff;
  display: flex; flex-direction: column; flex-shrink: 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-header {
  padding: 14px 16px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo {
  width: 28px; height: 28px; background: var(--primary); border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #fff; flex-shrink: 0;
}
.sidebar-brand { font-weight: 700; font-size: 0.92rem; }

.sidebar-nav { padding: 8px; flex: 1; }
.nav-section-label {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: rgba(255,255,255,0.35);
  padding: 14px 10px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: 4px; color: rgba(255,255,255,0.7); font-size: 0.88rem;
  font-weight: 500; cursor: pointer; transition: all 0.1s;
}
.nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.8; }
.nav-item .nav-badge {
  margin-left: auto; background: var(--danger); color: #fff;
  font-size: 0.65rem; font-weight: 700; padding: 1px 6px; border-radius: 10px;
}
.sidebar-user {
  padding: 10px 14px; border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 0.82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 0.7rem; color: rgba(255,255,255,0.5); text-transform: capitalize; }
.sidebar-logout {
  background: none; border: none; color: rgba(255,255,255,0.4); cursor: pointer;
  padding: 4px; border-radius: 4px; transition: color 0.15s; text-decoration: none;
}
.sidebar-logout:hover { color: var(--danger); }
.sidebar-logout svg { width: 16px; height: 16px; }

/* ════ MAIN ════ */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--white); }

/* ════ TOPBAR ════ */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 24px; border-bottom: 1px solid var(--border);
  background: var(--white);
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.topbar h1 { font-size: 1.2rem; font-weight: 700; color: var(--text); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ════ TOOLBAR ════ */
.toolbar {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 24px; border-bottom: 1px solid var(--border);
  background: var(--white); flex-wrap: wrap;
}
.toolbar-search {
  display: flex; align-items: center; gap: 5px;
  border: 1px solid var(--border); border-radius: 4px;
  padding: 5px 10px; min-width: 180px; background: var(--white);
}
.toolbar-search input {
  background: none; border: none; outline: none;
  color: var(--text); font-family: inherit; font-size: 0.85rem; width: 100%;
}
.toolbar-search input::placeholder { color: var(--text-light); }
.toolbar-search svg { color: var(--text-muted); flex-shrink: 0; }

/* ════ BUTTONS ════ */
.btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 4px;
  border: 1px solid var(--border); background: var(--white);
  color: var(--text-dim); font-family: inherit; font-size: 0.82rem;
  font-weight: 500; cursor: pointer; transition: all 0.12s; white-space: nowrap;
}
.btn:hover { background: var(--surface-hover); color: var(--text); border-color: var(--border-strong); }
.btn-primary {
  background: var(--primary); color: #fff; border-color: var(--primary);
  font-weight: 600; border-radius: 4px;
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm { padding: 4px 8px; font-size: 0.78rem; }
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }

.toolbar-right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.view-tabs { display: flex; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.view-tab {
  padding: 5px 12px; background: var(--white); color: var(--text-muted);
  font-size: 0.78rem; font-weight: 500; cursor: pointer;
  border: none; font-family: inherit; transition: all 0.12s;
}
.view-tab:not(:last-child) { border-right: 1px solid var(--border); }
.view-tab.active { background: var(--primary); color: #fff; }
.view-tab:hover:not(.active) { background: var(--surface-hover); }

/* ════ BOARD ════ */
.board { padding: 0 24px 24px; flex: 1; overflow-x: auto; }
.page { display: none; }
.page.active { display: flex; flex-direction: column; flex: 1; }
.page-header { padding: 20px 24px 0; margin-bottom: 16px; }
.page-header h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 2px; }
.page-header p { color: var(--text-muted); font-size: 0.85rem; }

/* ════ GROUP ════ */
.group { margin-bottom: 16px; }
.group-header {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 0; cursor: pointer; user-select: none;
}
.group-chevron {
  width: 18px; height: 18px; transition: transform 0.2s;
  flex-shrink: 0;
}
.group.collapsed .group-chevron { transform: rotate(-90deg); }
.group-title {
  font-size: 1.05rem; font-weight: 700; cursor: text;
  padding: 2px 4px; border-radius: 4px;
}
.group-title:focus { outline: none; background: var(--surface-hover); }
.group-count { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; margin-left: 4px; }

/* ════ TABLE ════ */
.table-wrapper {
  border-radius: 6px; overflow: hidden;
  border: 1px solid var(--border); background: var(--white);
}
.group.collapsed .table-wrapper { display: none; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
thead th {
  padding: 6px 10px; font-size: 0.75rem; font-weight: 600;
  color: var(--text-dim); text-align: left;
  border-bottom: 1px solid var(--border);
  background: var(--white); white-space: nowrap;
}
th.col-check { width: 36px; text-align: center; }
th.col-item { width: 25%; min-width: 180px; }
th.col-owner { width: 75px; }
th.col-status { width: 120px; text-align: center; }
th.col-date { width: 90px; text-align: center; }
th.col-priority { width: 100px; text-align: center; }
th.col-timeline { width: 120px; text-align: center; }
th.col-notes { width: 130px; }
th.col-files { width: 70px; text-align: center; }
th.col-add { width: 36px; text-align: center; }

tbody tr {
  border-bottom: 1px solid var(--border); transition: background 0.08s;
  position: relative;
}
tbody tr:hover { background: #f5f6f8; }
tbody tr:last-child { border-bottom: none; }
tbody td { padding: 0 10px; height: 36px; vertical-align: middle; font-size: 0.85rem; }

/* Group color left border on first cell */
td.td-check { position: relative; }
td.td-check::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px;
}

/* Checkbox */
.row-check {
  width: 15px; height: 15px; border-radius: 3px;
  border: 1.5px solid var(--text-light); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto; transition: all 0.12s;
}
.row-check:hover { border-color: var(--primary); }
.row-check.checked { background: var(--primary); border-color: var(--primary); }
.row-check.checked::after { content: '✓'; color: #fff; font-size: 9px; font-weight: 700; }

/* Item name cell */
.item-cell { display: flex; align-items: center; gap: 4px; }
.item-name {
  font-weight: 500; cursor: pointer; padding: 2px 4px; border-radius: 3px;
  flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text);
}
.item-name:hover { color: var(--primary); }
.item-name:focus {
  outline: none; background: var(--primary-light); color: var(--text);
  white-space: normal; overflow: visible;
}
.item-icons {
  display: flex; gap: 2px; opacity: 0; transition: opacity 0.12s; flex-shrink: 0;
}
tr:hover .item-icons { opacity: 1; }
.item-icon {
  width: 22px; height: 22px; border-radius: 4px; border: none;
  background: none; color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.1s;
}
.item-icon:hover { background: var(--surface-active); color: var(--text); }
.item-icon svg { width: 14px; height: 14px; }

/* Owner */
.owner-cell { display: flex; align-items: center; justify-content: center; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 600; color: #fff;
  cursor: pointer; border: 2px solid var(--white);
  margin-left: -6px; transition: transform 0.12s; flex-shrink: 0;
}
.avatar:first-child { margin-left: 0; }
.avatar:hover { transform: scale(1.12); z-index: 2; }
.avatar-add {
  background: var(--white); color: var(--text-light); font-size: 14px;
  border: 2px dashed var(--border-strong); width: 28px; height: 28px;
}
.avatar-add:hover { border-color: var(--primary); color: var(--primary); }

/* Status badge */
.status-badge {
  display: block; padding: 5px 2px; border-radius: 0;
  font-size: 0.78rem; font-weight: 600; cursor: pointer;
  text-align: center; color: #fff; transition: opacity 0.12s;
  min-height: 36px; line-height: 26px;
}
.status-badge:hover { opacity: 0.88; }

/* Priority badge */
.priority-badge {
  display: block; padding: 5px 2px; border-radius: 0;
  font-size: 0.78rem; font-weight: 600; cursor: pointer;
  text-align: center; color: #fff; transition: opacity 0.12s;
  min-height: 36px; line-height: 26px;
}
.priority-badge:hover { opacity: 0.88; }

/* Due date */
td.td-date { text-align: center; font-size: 0.82rem; color: var(--text-dim); cursor: pointer; }
td.td-date:hover { color: var(--primary); }
.date-display { display: flex; align-items: center; justify-content: center; gap: 4px; }
.date-overdue { color: var(--danger); }
.date-icon { width: 14px; height: 14px; flex-shrink: 0; }
.date-input-hidden {
  position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}

/* Timeline */
.timeline-badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 3px 10px; border-radius: 3px; font-size: 0.75rem;
  font-weight: 600; color: #fff; cursor: pointer;
  white-space: nowrap; min-height: 24px;
}
.timeline-badge:hover { opacity: 0.85; }
.timeline-empty { color: var(--text-light); font-size: 0.8rem; cursor: pointer; }
.timeline-empty:hover { color: var(--primary); }

/* Notes */
.notes-cell {
  font-size: 0.82rem; color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 130px; cursor: text; padding: 2px 4px; border-radius: 3px;
}
.notes-cell:focus { outline: none; background: var(--primary-light); color: var(--text); white-space: normal; overflow: visible; }

/* Files */
.files-cell { display: flex; align-items: center; justify-content: center; gap: 2px; }
.file-badge {
  width: 22px; height: 22px; border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6rem; font-weight: 700; color: #fff; cursor: pointer;
}

/* Add column */
.add-col-btn {
  background: none; border: none; color: var(--text-light); cursor: pointer;
  font-size: 16px; padding: 4px; border-radius: 4px; transition: all 0.12s;
}
.add-col-btn:hover { background: var(--surface-hover); color: var(--text-dim); }

/* Row actions (3-dot menu) */
.row-menu-btn {
  position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; border-radius: 4px; border: none;
  background: none; color: var(--text-light); cursor: pointer;
  display: none; align-items: center; justify-content: center; z-index: 5;
  font-size: 14px;
}
tr:hover .row-menu-btn { display: flex; }
.row-menu-btn:hover { background: var(--surface-active); color: var(--text); }

/* Add row */
.add-row td { padding: 4px 10px; }
.add-row:hover { background: transparent !important; }
.add-item-btn {
  display: flex; align-items: center; gap: 5px;
  background: none; border: none; color: var(--text-muted);
  font-family: inherit; font-size: 0.82rem; cursor: pointer;
  padding: 4px 0; transition: color 0.12s;
}
.add-item-btn:hover { color: var(--primary); }
.add-item-btn svg { width: 13px; height: 13px; }

/* Summary row */
.summary-row td {
  padding: 5px 10px; font-size: 0.75rem; background: var(--surface-hover);
  height: 28px;
}
.summary-statuses { display: flex; gap: 1px; height: 20px; border-radius: 0; overflow: hidden; }
.summary-statuses span { height: 100%; min-width: 4px; }

/* Add group */
.add-group-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 14px; margin: 4px 24px 30px;
  background: none; border: 1px dashed var(--border-strong);
  border-radius: 6px; color: var(--text-muted);
  font-family: inherit; font-size: 0.84rem; font-weight: 500;
  cursor: pointer; transition: all 0.12s;
}
.add-group-btn:hover { border-color: var(--primary); color: var(--primary); background: rgba(0,115,234,0.03); }

/* ════ SELECTION BAR ════ */
.selection-bar {
  position: fixed; bottom: 20px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--primary); border-radius: 8px;
  padding: 8px 18px; display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-lg); z-index: 200;
  transition: transform 0.2s ease; white-space: nowrap; color: #fff;
}
.selection-bar.show { transform: translateX(-50%) translateY(0); }
.selection-bar span { font-weight: 600; font-size: 0.84rem; }
.selection-bar .btn { background: rgba(255,255,255,0.2); border: none; color: #fff; padding: 5px 10px; font-size: 0.76rem; }
.selection-bar .btn:hover { background: rgba(255,255,255,0.3); }

/* ════ DROPDOWN ════ */
.dropdown-overlay { position: fixed; top:0;left:0; width:100vw;height:100vh; z-index:999; display:none; }
.dropdown-overlay.show { display: block; }
.dropdown-menu {
  position: fixed; background: var(--white);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 6px; min-width: 160px; z-index: 1000;
  box-shadow: var(--shadow-lg); display: none;
  animation: dropIn 0.12s ease; max-height: 360px; overflow-y: auto;
}
.dropdown-menu.show { display: block; }
@keyframes dropIn { from { opacity:0; transform:translateY(-3px); } to { opacity:1; transform:translateY(0); } }
.dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 4px; cursor: pointer;
  font-size: 0.84rem; font-weight: 500; transition: background 0.08s; color: var(--text);
}
.dropdown-item:hover { background: var(--surface-hover); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: rgba(228,66,88,0.06); }
.dropdown-color { width: 100%; padding: 5px 0; border-radius: 3px; text-align: center; color: #fff; font-weight: 600; font-size: 0.82rem; }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }
.dropdown-label { padding: 5px 10px; font-size: 0.7rem; color: var(--text-muted); font-weight: 600; }

/* Context menu */
.context-menu {
  position: fixed; background: var(--white);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 6px; min-width: 200px; z-index: 1100;
  box-shadow: var(--shadow-lg); display: none; animation: dropIn 0.12s ease;
}
.context-menu.show { display: block; }
.ctx-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 4px; cursor: pointer;
  font-size: 0.85rem; color: var(--text); transition: background 0.08s;
}
.ctx-item:hover { background: var(--surface-hover); }
.ctx-item.danger { color: var(--danger); }
.ctx-item.danger:hover { background: rgba(228,66,88,0.06); }
.ctx-item svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--text-muted); }
.ctx-item.danger svg { color: var(--danger); }
.ctx-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ════ ITEM DETAIL PANEL ════ */
.detail-overlay {
  display: none; position: fixed; top: 0; right: 0;
  width: 420px; height: 100vh; background: var(--white);
  border-left: 1px solid var(--border); z-index: 300;
  box-shadow: -4px 0 24px rgba(0,0,0,0.08);
  flex-direction: column; animation: slideIn 0.2s ease;
}
.detail-overlay.show { display: flex; }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

.detail-header {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.detail-close {
  width: 28px; height: 28px; border-radius: 4px; border: none;
  background: none; color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; transition: all 0.1s;
}
.detail-close:hover { background: var(--surface-hover); color: var(--text); }
.detail-title { font-size: 1.15rem; font-weight: 700; flex: 1; }
.detail-user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; color: #fff;
}

.detail-tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--border);
  padding: 0 20px;
}
.detail-tab {
  padding: 10px 14px; font-size: 0.85rem; font-weight: 500;
  color: var(--text-muted); cursor: pointer; border: none;
  background: none; font-family: inherit; position: relative;
  transition: color 0.12s;
}
.detail-tab:hover { color: var(--text); }
.detail-tab.active { color: var(--primary); }
.detail-tab.active::after {
  content: ''; position: absolute; bottom: -1px; left: 0; right: 0;
  height: 2px; background: var(--primary); border-radius: 2px 2px 0 0;
}

.detail-body { flex: 1; overflow-y: auto; padding: 16px 20px; }

/* Updates tab */
.update-input-wrap {
  border: 1px solid var(--border); border-radius: 8px;
  margin-bottom: 16px; overflow: hidden;
}
.update-toolbar {
  display: flex; align-items: center; gap: 2px;
  padding: 6px 8px; border-bottom: 1px solid var(--border);
  background: var(--surface-hover);
}
.update-toolbar button {
  width: 26px; height: 26px; border: none; background: none;
  color: var(--text-muted); cursor: pointer; border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; transition: all 0.1s;
}
.update-toolbar button:hover { background: var(--surface-active); color: var(--text); }
.update-textarea {
  width: 100%; min-height: 80px; border: none; outline: none;
  padding: 10px 12px; font-family: inherit; font-size: 0.88rem;
  color: var(--text); resize: vertical;
}
.update-textarea::placeholder { color: var(--text-light); }
.update-actions {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border-top: 1px solid var(--border);
}
.update-actions-left { display: flex; gap: 4px; }
.update-actions-left button {
  width: 28px; height: 28px; border: none; background: none;
  color: var(--text-muted); cursor: pointer; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
}
.update-actions-left button:hover { background: var(--surface-hover); }
.update-send {
  padding: 6px 16px; background: var(--primary); color: #fff;
  border: none; border-radius: 4px; font-family: inherit;
  font-size: 0.82rem; font-weight: 600; cursor: pointer;
  transition: background 0.12s;
}
.update-send:hover { background: var(--primary-hover); }

.updates-list { }
.update-item {
  display: flex; gap: 10px; padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.update-item:last-child { border-bottom: none; }
.update-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 700; color: #fff;
}
.update-content { flex: 1; min-width: 0; }
.update-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.update-author { font-weight: 600; font-size: 0.85rem; }
.update-time { font-size: 0.75rem; color: var(--text-muted); }
.update-body { font-size: 0.88rem; color: var(--text-dim); line-height: 1.5; }

.empty-state {
  text-align: center; padding: 40px 20px; color: var(--text-muted);
}
.empty-state p { font-size: 0.88rem; margin-top: 8px; }
.empty-state .empty-title { font-size: 1rem; font-weight: 600; color: var(--text-dim); }

/* ════ MODALS ════ */
.modal-overlay {
  position: fixed; top:0;left:0; width:100vw; height:100vh;
  background: rgba(0,0,0,0.3); z-index: 500;
  display: none; align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 12px; padding: 28px; width: 100%; max-width: 440px;
  box-shadow: var(--shadow-lg);
}
.modal h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 18px; }
.modal .form-group { margin-bottom: 12px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }

/* ════ USERS GRID ════ */
.users-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px; padding: 0 24px 30px;
}
.user-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px; display: flex; align-items: center; gap: 12px;
  transition: border-color 0.12s;
}
.user-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.user-card-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem; color: #fff; flex-shrink: 0;
}
.user-card-info { flex: 1; min-width: 0; }
.user-card-name { font-weight: 600; font-size: 0.88rem; margin-bottom: 1px; }
.user-card-email { color: var(--text-muted); font-size: 0.75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card-role {
  padding: 2px 8px; border-radius: 12px;
  font-size: 0.7rem; font-weight: 600; text-transform: capitalize; white-space: nowrap;
}
.role-super_admin { background: #fde8eb; color: var(--danger); }
.role-admin { background: #e5f0ff; color: var(--primary); }
.role-staff { background: #e5f6ee; color: var(--success); }
.user-card-actions { display: flex; gap: 2px; }
.user-card-actions button {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: 5px; border-radius: 4px; transition: all 0.12s;
}
.user-card-actions button:hover { color: var(--text); background: var(--surface-hover); }

/* ════ ACTIVITY ════ */
.activity-list { padding: 0 24px 30px; }
.activity-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.activity-text { font-size: 0.85rem; color: var(--text-dim); line-height: 1.4; }
.activity-time { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

/* ════ SETTINGS ════ */
.settings-section { padding: 0 24px 24px; }
.settings-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 8px; padding: 18px; margin-bottom: 12px;
}
.settings-card h4 { font-size: 0.92rem; font-weight: 600; margin-bottom: 10px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.settings-row:last-child { border-bottom: none; }
.settings-row label { font-size: 0.85rem; color: var(--text-dim); }
.toggle {
  width: 36px; height: 20px; background: var(--surface-active);
  border-radius: 10px; position: relative; cursor: pointer; transition: background 0.2s;
}
.toggle.on { background: var(--primary); }
.toggle::after {
  content: ''; position: absolute; width: 14px; height: 14px;
  border-radius: 50%; background: #fff; top: 3px; left: 3px;
  transition: transform 0.2s; box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.toggle.on::after { transform: translateX(16px); }

/* ════ RESPONSIVE ════ */
@media (max-width: 1100px) {
  .detail-overlay { width: 360px; }
}
@media (max-width: 900px) {
  .sidebar { display: none; }
  .detail-overlay { width: 100%; }
  th.col-timeline, td.td-timeline, th.col-notes, td.td-notes, th.col-files, td.td-files { display: none; }
}
@media (max-width: 700px) {
  th.col-priority, td.td-priority, th.col-owner, td.td-owner { display: none; }
  .toolbar { padding: 8px 12px; }
  .board { padding: 0 12px 24px; }
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
