:root {
  --mon-sidebar: #1c1f3b;
  --mon-sidebar-hover: #2a2e52;
  --mon-sidebar-active: #3b3f6e;
  --mon-sidebar-text: #c3c6d4;
  --mon-sidebar-label: #7b7f9e;
  --mon-bg: #f5f6f8;
  --mon-surface: #ffffff;
  --mon-border: #e6e9ef;
  --mon-text: #323338;
  --mon-muted: #676879;
  --mon-primary: #0073ea;
  --mon-primary-dark: #0060c0;
  --mon-danger: #e2445c;
  --mon-shadow: 0 2px 8px rgba(0,0,0,0.08);

  /* Status colours (Monday-style) */
  --s-todo: #c4c4c4;
  --s-progress: #009aff;
  --s-waiting: #ffcb00;
  --s-blocked: #e2445c;
  --s-done: #00c875;

  /* Group accent colours */
  --g-blue: #579bfc;
  --g-red: #ff7575;
  --g-orange: #fdab3d;
  --g-green: #00c875;
}

/* ─── RESET ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Roboto', Arial, Helvetica, sans-serif;
  font-size: 14px;
  color: var(--mon-text);
  background: var(--mon-sidebar);
  height: 100vh;
  overflow: hidden;
}

a { color: var(--mon-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── FRAME ──────────────────────────────────────── */
.tb-frame {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* ─── SIDEBAR ────────────────────────────────────── */
.tb-sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--mon-sidebar);
  color: var(--mon-sidebar-text);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
}

.tb-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px 16px 14px;
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.tb-brand::before {
  content: '⬡';
  font-size: 22px;
  color: #e2445c;
  line-height: 1;
}

.tb-brand:hover { text-decoration: none; color: #fff; }

.tb-sidebar-section {
  padding: 4px 8px;
  flex: 1;
}

.tb-sidebar-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--mon-sidebar-label);
  padding: 8px 10px 4px;
  letter-spacing: 0.06em;
}

/* top-level nav links */
.tb-sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--mon-sidebar-text);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s;
  margin-bottom: 2px;
}

.tb-sidebar-nav-link:hover { background: var(--mon-sidebar-hover); color: #fff; text-decoration: none; }
.tb-sidebar-nav-link.is-active { background: var(--mon-sidebar-active); color: #fff; font-weight: 600; }
.tb-sidebar-nav-link .icon { font-size: 15px; opacity: 0.8; }

/* workspace groups in sidebar */
.tb-workspace-nav { border-top: 1px solid rgba(255,255,255,0.07); padding-top: 8px; margin-top: 4px; }
.tb-workspace-nav:first-child { border-top: 0; padding-top: 0; }

.tb-workspace-nav header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px;
  margin-bottom: 3px;
}

.tb-workspace-nav header span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--mon-sidebar-label);
  letter-spacing: 0.05em;
}

.tb-workspace-nav header small {
  background: rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 1px 6px;
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  font-weight: 700;
}

.tb-workspace-nav nav { display: grid; gap: 1px; }

.tb-workspace-nav a {
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 5px;
  color: var(--mon-sidebar-text);
  padding: 7px 10px 7px 18px;
  font-size: 13px;
  text-decoration: none;
  transition: background 0.15s;
  position: relative;
}

.tb-workspace-nav a::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
}

.tb-workspace-nav a:hover { background: var(--mon-sidebar-hover); color: #fff; text-decoration: none; }
.tb-workspace-nav a.is-active { background: var(--mon-sidebar-active); color: #fff; }
.tb-workspace-nav a.is-active::before { background: #fff; }
.tb-sidebar-board-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-sidebar-pm { width: 18px; height: 18px; border-radius: 50%; font-size: 8px; font-weight: 700; color: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; margin-left: auto; opacity: .9; }

.tb-sidebar-empty {
  display: block;
  font-size: 12px;
  color: var(--mon-sidebar-label);
  padding: 4px 18px;
  font-style: italic;
}

.tb-sidebar-footer {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.07);
}

.tb-sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--mon-sidebar-label);
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 5px;
  text-decoration: none;
}

.tb-sidebar-footer a:hover { background: var(--mon-sidebar-hover); color: var(--mon-sidebar-text); text-decoration: none; }

/* ─── CONTENT AREA ───────────────────────────────── */
.tb-content-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--mon-bg);
  overflow: hidden;
}

/* ─── TOPBAR ─────────────────────────────────────── */
.tb-topbar {
  background: var(--mon-surface);
  border-bottom: 1px solid var(--mon-border);
  padding: 0 24px;
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.tb-topbar-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--mon-text);
}

.tb-topbar-workspace {
  font-size: 12px;
  font-weight: 500;
  color: var(--mon-muted);
  display: block;
  line-height: 1;
  margin-bottom: 2px;
}

.tb-topbar-spacer { flex: 1; }
.tb-topbar-newboard { margin-right: 8px; font-size: 13px; padding: 5px 12px; white-space: nowrap; }

.tb-topbar-user {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--mon-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  cursor: default;
}

/* ─── MAIN SHELL ─────────────────────────────────── */
.tb-shell {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ─── BOARD VIEW HEADER (tabs + new button) ──────── */
.tb-board-view-header {
  background: var(--mon-surface);
  border-bottom: 1px solid var(--mon-border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  min-height: 48px;
}

.tb-view-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 14px 14px;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  color: var(--mon-muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s;
  white-space: nowrap;
}

.tb-view-tab:hover { color: var(--mon-text); text-decoration: none; }
.tb-view-tab.is-active { color: var(--mon-primary); border-bottom-color: var(--mon-primary); font-weight: 600; }

/* ─── BOARD TOOLBAR ──────────────────────────────── */
.tb-board-toolbar {
  background: var(--mon-surface);
  padding: 8px 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--mon-border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.tb-btn-new {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 16px;
  border-radius: 6px;
  background: var(--mon-primary);
  color: #fff;
  font: 600 13px inherit;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.tb-btn-new:hover { background: var(--mon-primary-dark); }

.tb-toolbar-divider {
  width: 1px;
  height: 22px;
  background: var(--mon-border);
  margin: 0 2px;
  flex-shrink: 0;
}

.tb-toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  border-radius: 5px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--mon-muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.tb-toolbar-btn:hover {
  background: var(--mon-bg);
  border-color: var(--mon-border);
  color: var(--mon-text);
}

.tb-toolbar-search {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border-radius: 5px;
  border: 1px solid var(--mon-border);
  background: #fff;
}

.tb-toolbar-search input {
  border: none;
  outline: none;
  font: inherit;
  font-size: 13px;
  width: 130px;
  color: var(--mon-text);
  background: transparent;
  min-height: auto;
  padding: 0;
}

.tb-toolbar-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tb-toolbar-select {
  height: 30px;
  border: 1px solid var(--mon-border);
  border-radius: 5px;
  background: #fff;
  color: var(--mon-muted);
  font: inherit;
  font-size: 12px;
  padding: 0 8px;
  cursor: pointer;
  min-height: auto;
  width: auto;
}

/* ─── METRICS BAR ────────────────────────────────── */
.tb-metrics {
  display: flex;
  gap: 10px;
  padding: 12px 24px;
  flex-wrap: wrap;
  background: var(--mon-bg);
  flex-shrink: 0;
}

.tb-metrics article {
  border: 1px solid var(--mon-border);
  border-radius: 8px;
  background: #fff;
  padding: 10px 16px;
  min-width: 90px;
  text-align: center;
}

.tb-metrics strong {
  display: block;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 2px;
  color: var(--mon-text);
}

.tb-metrics span {
  color: var(--mon-muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ─── GROUPED TABLE (Monday-style) ───────────────── */
.tb-board-content {
  padding: 16px 0 40px;
}

.tb-group-section {
  margin: 0 24px 28px;
}

.tb-group-header-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0 8px;
  cursor: default;
  user-select: none;
}

.tb-group-color-dot {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  flex-shrink: 0;
}

.tb-group-section[data-color="blue"]   .tb-group-color-dot { background: var(--g-blue); }
.tb-group-section[data-color="red"]    .tb-group-color-dot { background: var(--g-red); }
.tb-group-section[data-color="orange"] .tb-group-color-dot { background: var(--g-orange); }
.tb-group-section[data-color="green"]  .tb-group-color-dot { background: var(--g-green); }

.tb-group-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--mon-text);
}

.tb-group-section[data-color="blue"]   .tb-group-name { color: var(--g-blue); }
.tb-group-section[data-color="red"]    .tb-group-name { color: var(--g-red); }
.tb-group-section[data-color="orange"] .tb-group-name { color: var(--g-orange); }
.tb-group-section[data-color="green"]  .tb-group-name { color: var(--g-green); }

.tb-group-count {
  background: var(--mon-bg);
  border: 1px solid var(--mon-border);
  border-radius: 20px;
  padding: 2px 9px;
  font-size: 12px;
  color: var(--mon-muted);
  font-weight: 600;
}

/* Grid table */
.tb-grid-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--mon-border);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.tb-group-section[data-color="blue"]   .tb-grid-table { border-top: 3px solid var(--g-blue); }
.tb-group-section[data-color="red"]    .tb-grid-table { border-top: 3px solid var(--g-red); }
.tb-group-section[data-color="orange"] .tb-grid-table { border-top: 3px solid var(--g-orange); }
.tb-group-section[data-color="green"]  .tb-grid-table { border-top: 3px solid var(--g-green); }

.tb-grid-table thead th {
  background: #fafbfc;
  border-bottom: 1px solid var(--mon-border);
  border-right: 1px solid var(--mon-border);
  padding: 7px 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--mon-muted);
  text-align: left;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tb-grid-table thead th:last-child { border-right: none; }

.tb-grid-table tbody tr {
  border-bottom: 1px solid var(--mon-border);
  transition: background 0.1s;
}

.tb-grid-table tbody tr:last-child { border-bottom: none; }
.tb-grid-table tbody tr:hover { background: #f8f9fb; }
.tb-grid-table tbody tr.is-archived { opacity: 0.65; }

.tb-grid-table td {
  border-right: 1px solid var(--mon-border);
  padding: 0;
  vertical-align: middle;
  height: 42px;
}

.tb-grid-table td:last-child { border-right: none; }

/* Checkbox column */
.tb-col-check { width: 38px; text-align: center; padding: 0 8px !important; }
.tb-col-check input[type=checkbox] {
  width: 14px; height: 14px; min-height: auto;
  cursor: pointer; accent-color: var(--mon-primary);
}

/* Task name column */
.tb-col-task { min-width: 280px; padding: 8px 12px !important; }

.tb-task-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--mon-text);
  text-decoration: none;
  display: block;
  line-height: 1.3;
}

.tb-task-name:hover { color: var(--mon-primary); text-decoration: underline; }

.tb-task-meta { font-size: 12px; color: var(--mon-muted); margin-top: 2px; }

/* Status column */
.tb-col-status { width: 130px; padding: 0 !important; }

.tb-status-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 42px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  user-select: none;
  letter-spacing: 0.02em;
}

.tb-status-cell.s-todo     { background: var(--s-todo); color: #555; }
.tb-status-cell.s-progress { background: var(--s-progress); }
.tb-status-cell.s-waiting  { background: var(--s-waiting); color: #4a3900; }
.tb-status-cell.s-blocked  { background: var(--s-blocked); }
.tb-status-cell.s-done     { background: var(--s-done); }
.tb-status-cell.s-empty    { background: transparent; color: var(--mon-muted); font-size: 18px; }

/* Person / Date / Note columns */
.tb-col-person { width: 130px; padding: 0 12px !important; font-size: 13px; color: var(--mon-text); }
.tb-col-due    { width: 110px; padding: 0 12px !important; font-size: 12px; color: var(--mon-muted); white-space: nowrap; }
.tb-col-note   { padding: 0 12px !important; max-width: 240px; }

.tb-note-text {
  font-size: 13px;
  color: var(--mon-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
  display: block;
}

/* Actions column */
.tb-col-actions { width: 1px; padding: 0 8px !important; white-space: nowrap; }

.tb-row-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.12s;
}

.tb-grid-table tbody tr:hover .tb-row-actions { opacity: 1; }

.tb-action-btn {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 8px;
  border-radius: 4px;
  border: 1px solid var(--mon-border);
  background: #fff;
  color: var(--mon-muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.tb-action-btn:hover { background: var(--mon-bg); color: var(--mon-text); }
.tb-action-btn.danger { color: var(--mon-danger); border-color: #fad0d6; }
.tb-action-btn.danger:hover { background: #fff0f2; }

/* Add task row */
.tb-add-task-row td { padding: 8px 12px !important; height: auto !important; }

.tb-add-task-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: var(--mon-muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}

.tb-add-task-btn:hover { color: var(--mon-primary); }

/* Subtasks inline (in table cell) */
.tb-inline-subtasks {
  border: 1px solid var(--mon-border);
  border-radius: 6px;
  background: #f8f9fb;
  margin-top: 6px;
}

.tb-inline-subtasks summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--mon-text);
}

.tb-inline-subtasks summary::-webkit-details-marker { display: none; }

.tb-inline-subtasks summary strong {
  background: #e8f0fe;
  color: var(--mon-primary);
  border-radius: 20px;
  font-size: 11px;
  padding: 2px 6px;
}

.tb-inline-subtasks[open] summary { border-bottom: 1px solid var(--mon-border); }

.tb-inline-subtask-form {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr auto auto;
  gap: 6px;
  align-items: end;
  padding: 8px 10px;
}

.tb-kanban-card .tb-inline-subtask-form { grid-template-columns: 1fr; }

.tb-inline-subtask-form input,
.tb-inline-subtask-form select {
  min-height: 28px;
  padding: 3px 6px;
  font-size: 12px;
}

/* ─── FLASH ALERTS ───────────────────────────────── */
.tb-alert {
  margin: 12px 24px;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
}

.tb-alert.success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.tb-alert.error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* ─── DIALOGS ────────────────────────────────────── */
.tb-dialog {
  width: min(660px, calc(100vw - 32px));
  border: 1px solid var(--mon-border);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
  padding: 24px;
}

.tb-dialog::backdrop { background: rgba(0,0,0,0.42); }

.tb-dialog h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 18px;
  color: var(--mon-text);
}

/* ─── FORMS ──────────────────────────────────────── */
.tb-form { display: grid; gap: 14px; }

.tb-form label {
  display: grid;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--mon-text);
}

input, select, textarea {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--mon-border);
  border-radius: 6px;
  color: var(--mon-text);
  font: inherit;
  font-size: 14px;
  padding: 7px 10px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--mon-primary);
  box-shadow: 0 0 0 3px rgba(0,115,234,0.12);
}

textarea { min-height: 80px; resize: vertical; }

.tb-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.tb-dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px solid var(--mon-border);
}

/* ─── BUTTONS ────────────────────────────────────── */
.tb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 6px;
  border: 1px solid var(--mon-border);
  background: #fff;
  color: var(--mon-text);
  font: 500 14px inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.tb-btn:hover { background: var(--mon-bg); border-color: #c8cdd8; }

.tb-btn.primary {
  background: var(--mon-primary);
  border-color: var(--mon-primary);
  color: #fff;
}

.tb-btn.primary:hover { background: var(--mon-primary-dark); border-color: var(--mon-primary-dark); }

.tb-btn.danger  { color: var(--mon-danger); border-color: #fad0d6; }
.tb-btn.danger:hover { background: #fff0f2; }

.tb-btn.small { min-height: 30px; padding: 0 10px; font-size: 13px; }

/* ─── KANBAN ─────────────────────────────────────── */
.tb-kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: 12px;
  padding: 20px 24px;
  overflow-x: auto;
}

.tb-kanban-column {
  display: flex;
  flex-direction: column;
  min-height: 420px;
  border-radius: 8px;
  background: #f0f2f5;
  border: 1px solid var(--mon-border);
}

.tb-kanban-column header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-bottom: 1px solid var(--mon-border);
}

.tb-kanban-column h2 { font-size: 14px; font-weight: 700; margin: 0; }

.tb-kanban-column header span {
  background: #fff;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: var(--mon-muted);
  padding: 3px 8px;
}

.tb-kanban-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 320px;
  padding: 10px;
}

.tb-kanban-column.is-drop-target {
  border-color: var(--mon-primary);
  box-shadow: inset 0 0 0 2px rgba(0,115,234,0.2);
}

.tb-kanban-card {
  border: 1px solid var(--mon-border);
  border-radius: 6px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.tb-kanban-card.is-archived { opacity: 0.65; }
.tb-kanban-card.is-dragging { opacity: 0.4; }

.tb-kanban-card-head {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 8px;
  margin-bottom: 8px;
}

.tb-drag-handle {
  width: 24px;
  height: 24px;
  border: 1px solid var(--mon-border);
  border-radius: 4px;
  background: #f8f9fb;
  color: var(--mon-muted);
  cursor: grab;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tb-drag-handle:active { cursor: grabbing; }

.tb-kanban-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--mon-text);
  text-decoration: none;
  line-height: 1.35;
  display: block;
}

.tb-kanban-title:hover { color: var(--mon-primary); }

.tb-kanban-card p {
  font-size: 12px;
  color: var(--mon-muted);
  margin: 0 0 8px;
  line-height: 1.4;
}

.tb-kanban-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 12px;
}

.tb-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 4px 8px;
}

.status.is-todo     { background: #ededed; color: #666; }
.status.is-progress { background: #e0f0ff; color: #0060c0; }
.status.is-waiting  { background: #fff8d6; color: #7a5a00; }
.status.is-blocked  { background: #ffe0e4; color: #c0002e; }
.status.is-done     { background: #dcfae6; color: #167a44; }

.priority.is-low    { background: #dcfae6; color: #167a44; }
.priority.is-normal { background: #f0f2f5; color: #676879; }
.priority.is-high   { background: #fff4e0; color: #b05400; }
.priority.is-urgent { background: #ffe0e4; color: #c0002e; }

.tb-kanban-meta > span:not(.tb-pill) {
  background: #f0f2f5;
  border-radius: 20px;
  padding: 3px 7px;
}

.tb-quick-form {
  display: grid;
  grid-template-columns: minmax(90px,120px) minmax(100px,1fr) auto;
  gap: 6px;
  margin-top: 8px;
}

.tb-quick-form.inline {
  grid-template-columns: minmax(90px,110px) minmax(100px,1fr) auto;
  min-width: 0;
  margin-top: 0;
}

.tb-quick-form select,
.tb-quick-form input {
  min-height: 28px;
  padding: 4px 7px;
  font-size: 12px;
}

.tb-kanban-empty {
  border: 1px dashed var(--mon-border);
  border-radius: 6px;
  color: var(--mon-muted);
  padding: 16px;
  text-align: center;
  font-size: 13px;
}

.tb-card-actions, .tb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.tb-card-actions.compact { margin-top: 8px; }

.tb-kanban-status-form { display: none; }

/* ─── INDEX PAGE ─────────────────────────────────── */
.tb-index-content {
  padding: 24px;
}

.tb-pagehead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.tb-pagehead h1 { font-size: 22px; font-weight: 700; }
.tb-pagehead p  { font-size: 13px; color: var(--mon-muted); margin-top: 4px; }
.tb-page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.tb-workspace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px,1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.tb-workspace-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--mon-border);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.tb-workspace-card h2 { font-size: 14px; font-weight: 700; margin-bottom: 3px; }
.tb-workspace-card p  { font-size: 12px; color: var(--mon-muted); }

.tb-workspace-card strong {
  min-width: 30px;
  min-height: 28px;
  border-radius: 20px;
  background: #e8f0fe;
  color: var(--mon-primary);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tb-board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px,1fr));
  gap: 12px;
}

.tb-card {
  border: 1px solid var(--mon-border);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  transition: box-shadow 0.15s;
}

.tb-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.09); }
.tb-card h2 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.tb-card p  { font-size: 13px; color: var(--mon-muted); margin-bottom: 10px; line-height: 1.45; }

.tb-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.tb-card-head span { font-size: 12px; color: var(--mon-muted); }

.tb-card-kicker {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--mon-primary);
  letter-spacing: 0.05em;
  margin-bottom: 5px;
}

/* ─── TASK DETAIL PAGE ───────────────────────────── */
.tb-detail-content { padding: 24px; }

.tb-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--mon-muted);
  font-size: 13px;
  text-decoration: none;
  margin-bottom: 14px;
}

.tb-back:hover { color: var(--mon-primary); text-decoration: none; }

.tb-detail-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 16px;
}

.tb-panel {
  border: 1px solid var(--mon-border);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.tb-panel + .tb-panel { margin-top: 14px; }
.tb-panel h2 { font-size: 16px; font-weight: 700; margin-bottom: 14px; }

.tb-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.tb-panel-head span { font-size: 13px; color: var(--mon-muted); }

.tb-meta {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 8px;
  font-size: 13px;
}

.tb-meta dt { color: var(--mon-muted); font-weight: 600; }
.tb-meta dd { margin: 0; }

.tb-comments { display: grid; gap: 10px; }

.tb-comments article {
  border: 1px solid var(--mon-border);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13px;
}

.tb-comments time { font-size: 12px; color: var(--mon-muted); display: block; margin-top: 4px; }

.tb-checklist { display: grid; gap: 6px; }

.tb-checklist article {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--mon-border);
  border-radius: 6px;
  background: #fff;
  padding: 8px 10px;
  font-size: 13px;
}

.tb-checklist article.is-done span { text-decoration: line-through; color: var(--mon-muted); }

.tb-check {
  width: 24px;
  height: 24px;
  border: 1px solid var(--mon-border);
  border-radius: 50%;
  background: #fff;
  color: var(--s-done);
  cursor: pointer;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.tb-checklist article.is-done .tb-check { background: #dcfae6; border-color: var(--s-done); }

.tb-subtask-list { display: grid; gap: 8px; }

.tb-subtask-list article {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--mon-border);
  border-radius: 6px;
  background: #fff;
  padding: 10px;
}

.tb-subtask-list article.is-done { background: #f6fef9; }

.tb-subtask-form, .tb-subtask-create {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 0.9fr auto;
  gap: 8px;
  align-items: end;
}

.tb-subtask-form label, .tb-subtask-create label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--mon-muted);
}

.tb-subtask-form input, .tb-subtask-form select,
.tb-subtask-create input, .tb-subtask-create select {
  min-height: 30px;
  padding: 4px 7px;
  font-size: 12px;
}

.tb-inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
}

.tb-empty {
  color: var(--mon-muted);
  text-align: center;
  padding: 12px;
  font-size: 13px;
}

/* ─── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 960px) {
  .tb-frame { flex-direction: column; height: auto; overflow: auto; }
  .tb-sidebar { width: 100%; min-width: 0; max-height: none; flex-direction: row; flex-wrap: wrap; overflow: visible; }
  .tb-sidebar-section { flex: 1; }
  .tb-content-area { overflow: visible; }
  .tb-shell { overflow: visible; }
  .tb-detail-grid { grid-template-columns: 1fr; }
  .tb-form-grid { grid-template-columns: 1fr; }
  .tb-subtask-form, .tb-subtask-create { grid-template-columns: 1fr; }
  .tb-kanban { grid-template-columns: repeat(5, minmax(200px, 80vw)); }
  .tb-inline-subtask-form { grid-template-columns: 1fr 1fr; }
  .tb-group-section { margin: 0 12px 20px; }
  .tb-metrics { padding: 8px 12px; }
  body { height: auto; overflow: auto; }
}

@media (max-width: 560px) {
  .tb-quick-form, .tb-quick-form.inline { grid-template-columns: 1fr; }
  .tb-actions, .tb-card-actions { flex-direction: column; align-items: stretch; }
}

/* ===================================================================
   Taskboard Monday-like — app interattiva (Slice ricostruzione)
   =================================================================== */
.tba { padding: 8px 4px 80px; font-size: 14px; color: #323338; }
.tba-loading { padding: 40px; color: #676879; }
.tba-toolbar { display: flex; gap: 8px; margin: 4px 0 16px; }
.tba-btn, .tba-btn-primary {
  border: 1px solid #c3c6d4; background: #fff; color: #323338;
  border-radius: 6px; padding: 7px 14px; font-size: 14px; cursor: pointer; font-weight: 500;
}
.tba-btn:hover { background: #f5f6f8; }
.tba-btn-primary { background: #0073ea; color: #fff; border-color: #0073ea; width: 100%; margin-top: 8px; }
.tba-btn-primary:hover { background: #0060c0; }

/* Gruppo */
.tba-group { margin-bottom: 22px; }
.tba-group-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.tba-caret { border: none; background: none; cursor: pointer; font-size: 13px; color: #676879; padding: 2px 4px; }
.tba-group-dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.tba-group-name { font-weight: 700; font-size: 15px; cursor: text; }
.tba-group-name-input { font-weight: 700; font-size: 15px; border: 1px solid #0073ea; border-radius: 4px; padding: 2px 6px; }
.tba-group-count { color: #676879; font-size: 13px; }
.tba-group-menu, .tba-th-menu { border: none; background: none; cursor: pointer; color: #676879; font-size: 16px; padding: 0 6px; border-radius: 4px; }
.tba-group-menu:hover, .tba-th-menu:hover { background: #e6e9ef; }

/* Tabella */
.tba-table { border-left: 4px solid var(--g-color, #579bfc); border-radius: 0 6px 6px 0; overflow: visible; }
.tba-row { display: flex; align-items: stretch; border-bottom: 1px solid #e6e9ef; background: #fff; }
.tba-head-row { background: #fff; border-bottom: 1px solid #e6e9ef; }
.tba-task-row:hover { background: #f5f6f8; }
.tba-cell {
  border-right: 1px solid #e6e9ef; padding: 0; min-height: 38px;
  display: flex; align-items: center; justify-content: center; position: relative;
  box-sizing: border-box; overflow: hidden;
}
.tba-cell-title { flex: 1 1 320px; min-width: 280px; justify-content: flex-start; padding: 0 10px; gap: 8px; }
.tba-th { font-weight: 600; color: #676879; font-size: 13px; background: #fff; }
.tba-th-col { justify-content: center; gap: 4px; }
.tba-th-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tba-addcol-cell { flex: 0 0 44px; width: 44px; min-width: 44px; }
.tba-addcol-btn { border: none; background: none; cursor: pointer; color: #676879; font-size: 18px; width: 100%; height: 100%; }
.tba-addcol-btn:hover { background: #e6e9ef; }

/* Cella titolo */
.tba-title-text { cursor: text; flex: 1; padding: 8px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tba-open { font-size: 11px; color: #0073ea; text-decoration: none; opacity: 0; }
.tba-task-row:hover .tba-open { opacity: 1; }
.tba-task-del { border: none; background: none; color: #c4c4c4; cursor: pointer; font-size: 18px; opacity: 0; }
.tba-task-row:hover .tba-task-del { opacity: 1; }
.tba-subtask-row:hover .tba-task-del { opacity: 1; }
.tba-task-del:hover { color: #e2445c; }

/* Input inline */
.tba-inline-input, .tba-add-input {
  width: 100%; height: 100%; border: 2px solid #0073ea; box-sizing: border-box;
  padding: 0 8px; font-size: 14px; outline: none;
}
.tba-add-input { border: none; color: #676879; background: transparent; }
.tba-add-input:focus { border: 2px solid #0073ea; }

/* Chip stato/priorità */
.tba-chip {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 500; cursor: pointer; padding: 0 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tba-chip:not(.has-color) { color: #676879; background: #f5f6f8; }
.tba-celltext { cursor: pointer; padding: 0 8px; width: 100%; text-align: center; color: #323338; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tba-cell-checkbox input { cursor: pointer; width: 16px; height: 16px; }

/* Popover */
.tba-pop {
  position: absolute; z-index: 9999; background: #fff; border: 1px solid #d0d4e4;
  border-radius: 8px; box-shadow: 0 8px 28px rgba(0,0,0,.18); padding: 8px; min-width: 200px;
}
.tba-labelpicker { display: flex; flex-direction: column; gap: 6px; }
.tba-label-opt {
  border: none; border-radius: 4px; color: #fff; padding: 8px 10px; cursor: pointer;
  font-size: 13px; font-weight: 500; text-align: center;
}
.tba-label-opt.is-clear { background: #f5f6f8; color: #676879; }
.tba-pop-sep { height: 1px; background: #e6e9ef; margin: 6px 0; }
.tba-pop-action { border: none; background: none; cursor: pointer; color: #323338; padding: 8px 10px; text-align: left; border-radius: 4px; font-size: 13px; width: 100%; }
.tba-pop-action:hover { background: #f5f6f8; }

/* Editor etichette */
.tba-labeleditor { display: flex; flex-direction: column; gap: 6px; min-width: 240px; }
.tba-le-row { display: flex; align-items: center; gap: 6px; }
.tba-le-swatch { width: 28px; height: 28px; border-radius: 4px; border: none; cursor: pointer; flex: 0 0 28px; }
.tba-le-input { flex: 1; border: 1px solid #d0d4e4; border-radius: 4px; padding: 6px 8px; font-size: 13px; }
.tba-le-del { border: none; background: none; color: #c4c4c4; cursor: pointer; font-size: 18px; }
.tba-le-del:hover { color: #e2445c; }

/* Palette colori */
.tba-palette { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.tba-swatch { width: 26px; height: 26px; border-radius: 4px; border: none; cursor: pointer; }
.tba-swatch:hover { transform: scale(1.1); }

/* Menu */
.tba-menu { display: flex; flex-direction: column; min-width: 200px; }
.tba-menu-item { border: none; background: none; text-align: left; padding: 9px 12px; cursor: pointer; font-size: 13px; border-radius: 4px; color: #323338; }
.tba-menu-item:hover { background: #f5f6f8; }
.tba-menu-item.is-danger { color: #e2445c; }
.tba-addcol .tba-menu-item { display: block; }

/* Drag & drop (Fase 4) */
.tba-drag-handle { cursor: grab; color: #c4c4c4; font-size: 14px; opacity: 0; user-select: none; }
.tba-task-row:hover .tba-drag-handle { opacity: 1; }
.tba-task-row.tba-dragging { opacity: .45; }
.tba-task-row.tba-drop-before { box-shadow: inset 0 3px 0 0 #0073ea; }
.tba-task-row.tba-drop-after { box-shadow: inset 0 -3px 0 0 #0073ea; }

/* Sottoattività (sotto elementi) */
.tba-sub-caret { border: none; background: none; cursor: pointer; color: #676879; font-size: 12px; padding: 0 2px; }
.tba-sub-caret:hover { color: #0073ea; }
.tba-sub-bar { display: inline-flex; width: 52px; height: 8px; border-radius: 4px; overflow: hidden; flex-shrink: 0; vertical-align: middle; margin: 0 6px; gap: 1px; }
.tba-sub-bar-seg { min-width: 3px; }
.tba-subindent { padding-left: 10px !important; }
.tba-subhead-row { background: #fafbfc; }
.tba-subhead-row .tba-th { font-size: 12px; color: #9aadbd; }
.tba-subtask-row { background: #fafbfc; }
.tba-subtask-row:hover { background: #f1f3f7; }
.tba-subadd-row { background: #fafbfc; }
.tba-subcell {
  border-right: 1px solid #e6e9ef; min-height: 34px; display: flex; align-items: center;
  justify-content: center; box-sizing: border-box; overflow: hidden; position: relative;
}
.tba-subcol-st { flex: 0 0 140px; width: 140px; }
.tba-subcol-pr { flex: 0 0 130px; width: 130px; }
.tba-subcol-as { flex: 0 0 150px; width: 150px; }
.tba-subcol-du { flex: 0 0 130px; width: 130px; }

/* Toolbar filtri/ricerca/ordinamento */
.tba-toolbar { flex-wrap: wrap; align-items: center; }
.tba-search, .tba-filter, .tba-filter-text {
  border: 1px solid #c3c6d4; border-radius: 6px; padding: 7px 10px; font-size: 13px; background: #fff; color: #323338;
}
.tba-search { min-width: 200px; }
.tba-filter-text { width: 140px; }
.tba-filter { cursor: pointer; }

/* Grip riordino gruppo */
.tba-group-grip { cursor: grab; color: #c4c4c4; font-size: 13px; user-select: none; }
.tba-group-grip:hover { color: #0073ea; }
.tba-group-head.tba-grp-drop { outline: 2px dashed #0073ea; outline-offset: 2px; border-radius: 6px; }
.tba-th-col[draggable="true"] { cursor: grab; }
.tba-th-col.tba-col-drop { box-shadow: inset 3px 0 0 0 #0073ea; }
.tba-col-resize { position: absolute; right: -3px; top: 0; bottom: 0; width: 6px; cursor: col-resize; z-index: 6; background: transparent; }
.tba-col-resize:hover, .tba-col-resize:active { background: rgba(0,115,234,.30); border-radius: 3px; }

/* Riga riepilogo */
.tba-sum-row { background: #fafbfc; border-top: 2px solid #e6e9ef; font-size: 12px; color: #676879; }
.tba-sum-title { font-weight: 600; color: #9aadbd; }
.tba-sum-cell { justify-content: center; padding: 0 6px; }
.tba-distbar { display: flex; width: 100%; height: 18px; border-radius: 9px; overflow: hidden; gap: 1px; }
.tba-dist-seg { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 10px; min-width: 14px; }
.tba-dist-empty { color: #c4c4c4; }

/* Selezione righe */
.tba-rowsel { width: 15px; height: 15px; cursor: pointer; opacity: .35; }
.tba-task-row:hover .tba-rowsel, .tba-rowsel:checked { opacity: 1; }
.tba-selbar {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: #323338; color: #fff; border-radius: 10px; padding: 10px 16px;
  display: flex; align-items: center; gap: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.3); z-index: 9998;
}
.tba-selbar-count { font-weight: 600; font-size: 14px; }
.tba-selbar-move { border: none; border-radius: 6px; padding: 6px 10px; font-size: 13px; cursor: pointer; }
.tba-selbar-del { background: #e2445c; color: #fff; border: none; border-radius: 6px; padding: 7px 12px; cursor: pointer; font-size: 13px; }
.tba-selbar-del:hover { background: #c63a4f; }
.tba-selbar-clear { background: transparent; color: #c4c4c4; border: 1px solid #5a5b66; border-radius: 6px; padding: 7px 12px; cursor: pointer; font-size: 13px; }
.tba-selbar-clear:hover { color: #fff; }

/* =====================================================================
   RIFINITURA TEMA MONDAY (override finale, massima precedenza)
   ===================================================================== */
:root {
  --mon-sidebar: #ffffff;
  --mon-sidebar-hover: #f0f2f5;
  --mon-sidebar-active: #e6f2ff;
  --mon-sidebar-text: #50515f;
  --mon-sidebar-label: #9699a6;
  --mon-bg: #ffffff;
}
body { background: #ffffff; }

/* Sidebar chiara */
.tb-sidebar { border-right: 1px solid var(--mon-border); }
.tb-brand { color: #1c1f3b; border-bottom-color: var(--mon-border); }
.tb-brand:hover { color: #1c1f3b; }
.tb-sidebar-nav-link:hover { background: var(--mon-sidebar-hover); color: var(--mon-text); }
.tb-sidebar-nav-link.is-active { background: var(--mon-sidebar-active); color: var(--mon-primary); }
.tb-workspace-nav { border-top-color: var(--mon-border); }
.tb-workspace-nav header small { background: #eceef3; color: #9699a6; }
.tb-workspace-nav a::before { background: #c3c6d4; }
.tb-workspace-nav a:hover { background: var(--mon-sidebar-hover); color: var(--mon-text); }
.tb-workspace-nav a.is-active { background: var(--mon-sidebar-active); color: var(--mon-primary); font-weight: 600; }
.tb-workspace-nav a.is-active::before { background: var(--mon-primary); }
.tb-sidebar-footer { border-top-color: var(--mon-border); }

/* Topbar */
.tb-topbar { background: #fff; border-bottom: 1px solid var(--mon-border); }
.tb-topbar-title { font-size: 22px; font-weight: 700; color: var(--mon-text); }
.tb-content-area { background: #fff; }

/* Board area scrollabile */
.tba { padding: 16px 20px 100px; overflow-x: auto; }

/* Toolbar compatta (annulla il width:100% globale solo nella toolbar) */
.tba-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 18px; }
.tba-toolbar input, .tba-toolbar select { width: auto; }
.tba-search { width: 240px; }
.tba-filter { min-width: 130px; }
.tba-filter-text { width: 150px; }
.tba-btn { font-weight: 500; }

/* Gruppi: intestazione più marcata */
.tba-group { margin-bottom: 26px; }
.tba-group-head { padding: 2px 2px 6px; gap: 7px; }
.tba-group-name { font-size: 16px; font-weight: 700; }
.tba-group-count { font-size: 13px; color: #9699a6; }

/* Tabella: bordo, ombra leggera, angoli */
.tba-table {
  border: 1px solid var(--mon-border);
  border-left: 4px solid var(--g-color, #579bfc);
  border-radius: 0 8px 8px 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  background: #fff; overflow: hidden;
}
.tba-row { border-bottom: 1px solid #eceef3; }
.tba-row:last-child { border-bottom: none; }
.tba-cell { min-height: 36px; border-right: 1px solid #eceef3; }
.tba-head-row { background: #fff; }
.tba-th { font-weight: 600; color: #9699a6; font-size: 13px; }
.tba-task-row:hover { background: #f7f9fc; }

/* Chip stato/priorità: testo leggibile, peso */
.tba-chip { font-weight: 500; letter-spacing: .1px; }

/* Riga di riepilogo più discreta */
.tba-sum-row { background: #fcfcfd; }
.tba-sum-title { color: #b0b3c0; font-weight: 600; font-size: 12px; }

/* Aggiungi attività */
.tba-add-input { color: #9699a6; }
.tba-add-input::placeholder { color: #9699a6; }

/* Maniglie e azioni visibili su hover, più pulite */
.tba-drag-handle, .tba-sub-caret { color: #c3c6d4; }

/* ===== Pannello dettaglio task ===== */
.tba-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 10000;
  display: flex; justify-content: flex-end;
}
.tba-panel {
  width: 560px; max-width: 92vw; height: 100%; background: #fff;
  box-shadow: -8px 0 28px rgba(0,0,0,.18); display: flex; flex-direction: column;
  animation: tbaSlideIn .18s ease-out;
}
@keyframes tbaSlideIn { from { transform: translateX(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.tba-panel-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--mon-border); }
.tba-panel-title { flex: 1; border: 1px solid transparent; border-radius: 6px; font-size: 19px; font-weight: 700; padding: 6px 8px; color: #323338; }
.tba-panel-title:hover, .tba-panel-title:focus { border-color: var(--mon-border); outline: none; }
.tba-panel-close { border: none; background: none; font-size: 26px; line-height: 1; color: #676879; cursor: pointer; padding: 0 6px; }
.tba-panel-close:hover { color: #e2445c; }
.tba-panel-body { padding: 16px 18px 40px; overflow-y: auto; }
.tba-panel-section { margin-bottom: 22px; }
.tba-panel-h { font-size: 12px; font-weight: 700; text-transform: uppercase; color: #9699a6; letter-spacing: .05em; margin-bottom: 10px; }
.tba-field { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.tba-field-label { width: 130px; flex: 0 0 130px; color: #676879; font-size: 13px; }
.tba-field-cell { border: 1px solid var(--mon-border) !important; border-radius: 6px; min-height: 34px; height: 34px; overflow: hidden; }
.tba-panel-desc { width: 100%; min-height: 90px; border: 1px solid var(--mon-border); border-radius: 6px; padding: 8px 10px; font: inherit; resize: vertical; }
.tba-psub { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid #f0f1f3; }
.tba-psub-name { font-size: 14px; }
.tba-psub-add { border: 1px solid var(--mon-border) !important; border-radius: 6px; padding: 7px 10px; margin-top: 8px; }
.tba-cmlist { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.tba-cm { background: #f5f6f8; border-radius: 8px; padding: 8px 10px; }
.tba-cm-body { font-size: 14px; color: #323338; white-space: pre-wrap; }
.tba-cm-meta { font-size: 11px; color: #9699a6; margin-top: 4px; }
.tba-cm-input { width: 100%; min-height: 60px; border: 1px solid var(--mon-border); border-radius: 6px; padding: 8px 10px; font: inherit; resize: vertical; margin-bottom: 8px; }

/* ===== Menu azioni riga + open ===== */
.tba-open { border: none; background: none; cursor: pointer; font-size: 11px; color: var(--mon-primary); opacity: 0; padding: 2px 4px; }
.tba-task-row:hover .tba-open { opacity: 1; }
.tba-task-menu { border: none; background: none; cursor: pointer; color: #9699a6; font-size: 16px; opacity: 0; padding: 0 4px; border-radius: 4px; }
.tba-task-row:hover .tba-task-menu { opacity: 1; }
.tba-task-menu:hover { background: #e6e9ef; }

/* Righe archiviate */
.tba-archived { opacity: .55; }
.tba-archived .tba-title-text { text-decoration: line-through; }

/* Toggle archiviati */
.tba-arc-toggle { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: #676879; cursor: pointer; }
.tba-arc-toggle input { width: auto; }

/* ===== Toast ===== */
.tba-toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: #323338; color: #fff; border-radius: 8px; padding: 10px 14px;
  display: flex; align-items: center; gap: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.3); z-index: 10001; font-size: 14px;
}
.tba-toast-btn { background: transparent; border: 1px solid #5a5b66; color: #fff; border-radius: 6px; padding: 5px 10px; cursor: pointer; font-size: 13px; }
.tba-toast-btn:hover { background: #45464f; }

/* ===== Date evidenza ===== */
.tba-date-overdue .tba-celltext { color: #e2445c; font-weight: 600; }
.tba-date-today .tba-celltext { color: #0073ea; font-weight: 600; }

/* ===== Persone / assegnatari ===== */
.tba-people { display: flex; align-items: center; gap: 7px; width: 100%; padding: 0 10px; }
.tba-people-empty { color: #c4c4c4; margin: auto; }
.tba-avatar { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 700; flex: 0 0 26px; }
.tba-people-name { font-size: 13px; color: #323338; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tba-peoplepicker { display: flex; flex-direction: column; gap: 4px; min-width: 200px; }
.tba-people-list { max-height: 200px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.tba-people-opt { display: flex; align-items: center; gap: 8px; border: none; background: none; cursor: pointer; padding: 6px 8px; border-radius: 6px; font-size: 13px; text-align: left; width: 100%; }
.tba-people-opt:hover { background: #f5f6f8; }
.tba-people-add { border: 1px solid var(--mon-border); border-radius: 6px; padding: 7px 9px; font-size: 13px; }

/* I miei task: sezione per board */
.tb-mine-board-section { margin-bottom: 28px; }
.tb-mine-board-name { font-size: 13px; font-weight: 700; color: #676879; padding: 8px 16px 4px; letter-spacing: .02em; text-transform: uppercase; }
.tb-mine-board-name a { color: inherit; text-decoration: none; }
.tb-mine-board-name a:hover { color: #0073ea; text-decoration: underline; }

/* =====================================================================
   POLISH ESTETICO 2 (override finale)
   ===================================================================== */
body, .tba, .tb-topbar, input, select, textarea, button {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Canvas leggermente grigio: le schede bianche risaltano */
.tb-content-area { background: #f6f7fb; }
.tba { background: #f6f7fb; padding: 22px 26px 110px; }

/* Topbar più pulita */
.tb-topbar { height: 60px; padding: 0 26px; }
.tb-topbar-title { font-size: 20px; font-weight: 700; letter-spacing: -.2px; }
.tb-topbar-user { width: 34px; height: 34px; font-size: 13px; }

/* Toolbar: controlli di altezza uniforme, look pulito */
.tba-toolbar { gap: 8px; margin-bottom: 18px; align-items: center; }
.tba-btn { height: 36px; border-radius: 8px; border: 1px solid #d7dae6; padding: 0 14px; font-weight: 600; color: #323338; }
.tba-btn:hover { background: #f1f2f6; }
.tba-search, .tba-filter, .tba-filter-text {
  height: 36px; border: 1px solid #d7dae6; border-radius: 8px; background: #fff; font-size: 13px; color: #323338;
}
.tba-search { width: 240px; padding-left: 12px; }
.tba-arc-toggle { height: 36px; padding: 0 8px; }

/* Gruppo: testata */
.tba-group { margin-bottom: 26px; }
.tba-group-head { padding: 2px 2px 9px; gap: 8px; }
.tba-group-dot { width: 13px; height: 13px; border-radius: 4px; }
.tba-group-name { font-size: 15.5px; font-weight: 700; letter-spacing: -.1px; }
.tba-group-count { font-size: 12.5px; color: #9aa0b0; }

/* Tabella come scheda: angoli arrotondati su tutti i lati, ombra morbida */
.tba-table {
  background: #fff;
  border: 1px solid #e3e6ef;
  border-left: 6px solid var(--g-color, #579bfc);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(20,30,80,.06);
}

/* Griglia leggera: separatori orizzontali tenui, verticali quasi invisibili */
.tba-row { border-bottom: 1px solid #eef0f5; }
.tba-row:last-child { border-bottom: none; }
.tba-cell { border-right: 1px solid #f1f3f8; min-height: 42px; font-size: 13px; }
.tba-cell-title { border-right: 1px solid #eef0f5; padding-left: 10px; }

/* Header colonne: fascia grigio chiaro */
.tba-head-row { background: #fafbfd; }
.tba-head-row .tba-cell { min-height: 38px; }
.tba-th { color: #9aa0b0; font-weight: 600; font-size: 12.5px; }

/* Titolo task */
.tba-title-text { font-weight: 500; color: #1f2747; }

/* Chip stato/priorità: pieni, testo nitido */
.tba-chip { height: 100%; font-weight: 500; font-size: 13px; }
.tba-chip.has-color { color: #fff; }

/* Riga "Aggiungi attività" */
.tba-addrow .tba-cell-title { border-right: none; }
.tba-add-input { height: 40px; font-size: 13px; }

/* Riepilogo */
.tba-sum-row { background: #fbfcfe; border-top: 1px solid #eef0f5; }
.tba-sum-cell { border-right: 1px solid #f1f3f8; }
.tba-sum-title { color: #aab0c0; }
.tba-distbar { height: 20px; border-radius: 10px; }

/* Avatar un filo più piccoli e centrati */
.tba-avatar { width: 24px; height: 24px; font-size: 10.5px; }

/* Pulsanti aggiungi colonna / menu più discreti */
.tba-th-menu, .tba-group-menu { opacity: 0; }
.tba-group-head:hover .tba-group-menu, .tba-th-col:hover .tba-th-menu { opacity: 1; }
.tba-addcol-cell { border-right: none; }

/* =====================================================================
   POLISH ESTETICO 3 — header board, tab, pulsante primario, chip
   ===================================================================== */
/* Banner "stai modificando un template" */
.tba-template-banner { background: #fff4e0; border: 1px solid #f0c060; border-radius: 8px; padding: 10px 18px; font-size: 13px; color: #7a4f00; margin-bottom: 16px; }
.tba-template-banner a { color: #0073ea; font-weight: 600; }

.tba-tabs { display: flex; gap: 2px; border-bottom: 1px solid #e3e6ef; margin: 0 0 16px; }
.tba-tab { display: flex; align-items: center; gap: 7px; padding: 9px 14px; font-size: 14px; font-weight: 600; color: #676879; border-bottom: 2px solid transparent; cursor: pointer; margin-bottom: -1px; }
.tba-tab.is-active { color: #1f2747; border-bottom-color: #0073ea; }
.tba-tab-ico { font-size: 13px; color: #0073ea; }

.tba-btn-newitem { height: 36px; border: none; background: #0073ea; color: #fff; border-radius: 8px; padding: 0 16px; font-weight: 600; font-size: 14px; cursor: pointer; }
.tba-btn-newitem:hover { background: #0060c0; }

/* Cella stato/priorità vuota: grigio chiarissimo, senza trattino */
.tba-chip.is-empty { background: #eceff3; color: transparent; }
.tba-chip.has-color:hover { filter: brightness(0.95); }

/* Tipografia di rifinitura */
.tba-title-text { font-size: 13.5px; }
.tba-group-name { letter-spacing: -.2px; }
.tba-th { letter-spacing: .02em; text-transform: none; }

/* =====================================================================
   VISTA KANBAN
   ===================================================================== */
.tba-kanban { display: flex; gap: 14px; align-items: flex-start; padding-bottom: 20px; }
.tba-kcol { background: #f1f3f8; border-radius: 10px; width: 280px; flex: 0 0 280px; padding: 8px; min-height: 120px; }
.tba-kcol.tba-kcol-drop { outline: 2px dashed #0073ea; outline-offset: -2px; }
.tba-kcol-head { display: flex; align-items: center; gap: 8px; padding: 6px 8px 10px; font-weight: 700; font-size: 14px; color: #1f2747; }
.tba-kcol-dot { width: 12px; height: 12px; border-radius: 4px; }
.tba-kcol-title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tba-kcol-count { background: #fff; color: #676879; border-radius: 10px; font-size: 12px; padding: 1px 8px; font-weight: 700; }
.tba-klist { display: flex; flex-direction: column; gap: 8px; min-height: 40px; }
.tba-kcard { background: #fff; border-radius: 8px; border-left: 4px solid var(--g-color, #579bfc); box-shadow: 0 1px 3px rgba(20,30,80,.08); padding: 10px 12px; cursor: grab; }
.tba-kcard.tba-dragging { opacity: .5; }
.tba-kcard-title { font-size: 14px; font-weight: 600; color: #1f2747; margin-bottom: 8px; cursor: pointer; }
.tba-kcard-meta { display: flex; align-items: center; gap: 8px; }
.tba-kcard-chip { font-size: 11px; font-weight: 600; border-radius: 4px; padding: 2px 8px; background: #eceff3; color: #676879; }
.tba-kcard-due { font-size: 12px; color: #676879; }

/* =====================================================================
   VISTA GANTT
   ===================================================================== */
.tba-gantt { position: relative; padding-bottom: 24px; }
.tba-gantt-empty { color: #9699a6; padding: 30px; }
/* Header: sticky top, sopra il body scrollabile (NON dentro .tba-gantt-body) */
.tba-gantt-header { display: flex; position: sticky; top: 0; background: #f6f7fb; z-index: 4; border-bottom: 1px solid #e3e6ef; }
.tba-gantt-hspacer { position: relative; flex: 0 0 auto; width: var(--glw, 220px); background: #f6f7fb; border-right: 1px solid #e3e6ef; box-sizing: border-box; }
.tba-gantt-resize { position: absolute; right: -3px; top: 0; bottom: 0; width: 6px; cursor: col-resize; z-index: 6; background: transparent; }
.tba-gantt-resize:hover, .tba-gantt-resize:active { background: rgba(0,115,234,.30); border-radius: 3px; }
.tba-gantt-axis-wrap { flex: 1; overflow: hidden; min-width: 0; }
.tba-gantt-axis { display: flex; will-change: transform; }
.tba-gantt-tick { flex: 0 0 auto; height: 30px; font-size: 9px; color: #9699a6; border-left: 1px solid #f0f1f5; box-sizing: border-box; padding-top: 5px; text-align: center; }
.tba-gantt-tick.tba-gantt-week { border-left: 1px solid #cdd0da; font-weight: 600; color: #5a5d6e; }
.tba-gantt-tick.tba-gantt-today { background: rgba(0,115,234,.10); border-left: 1px solid #0073ea; color: #0073ea; font-weight: 700; }
.tba-gantt-tick.tba-gantt-weekend { background: #f5f3f9; color: #bbb; }
.tba-gantt-tick.tba-gantt-weekend.tba-gantt-today { background: rgba(0,115,234,.10); color: #0073ea; }
.tba-gantt-weekend-strip { position: absolute; top: 0; bottom: 0; background: rgba(200,195,220,.13); pointer-events: none; z-index: 0; }
/* Body: unico contenitore con scroll orizzontale */
.tba-gantt-body { overflow-x: auto; }
.tba-gantt-body-inner { /* width settato via JS */ }
/* Group row: flex row (stessa struttura delle task row) */
.tba-gantt-grouprow { display: flex; align-items: stretch; min-height: 32px; background: #eef1f7; margin-top: 8px; }
.tba-gantt-grouplbl { font-weight: 700 !important; font-size: 12px; background: #eef1f7 !important; border-left: 3px solid #579bfc; cursor: default !important; text-transform: uppercase; letter-spacing: .04em; color: #5a5d6e !important; }
.tba-gantt-grouplbl:hover { color: #5a5d6e !important; }
/* Task row: altezza auto per testo a capo */
.tba-gantt-row { display: flex; align-items: stretch; min-height: 36px; border-bottom: 1px solid #f0f1f5; }
/* Label: larghezza da CSS variable, testo va a capo */
.tba-gantt-label { width: var(--glw, 220px); flex: 0 0 auto; font-size: 13px; color: #1f2747; word-break: break-word; padding: 7px 10px 7px 12px; cursor: pointer; position: sticky; left: 0; background: #f6f7fb; z-index: 2; display: flex; align-items: flex-start; border-right: 1px solid #e3e6ef; box-sizing: border-box; }
.tba-gantt-label:hover { color: #0073ea; }
.tba-gantt-track { position: relative; flex: 0 0 auto; min-height: 36px; }
.tba-gantt-bar { position: absolute; top: 6px; height: 20px; border-radius: 6px; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.15); z-index: 1; }
.tba-gantt-bar:hover { filter: brightness(.95); }

/* =====================================================================
   PANNELLO ATTIVITÀ — tab + aggiornamenti (stile Monday)
   ===================================================================== */
.tba-ptabs { display: flex; gap: 6px; padding: 0 18px; border-bottom: 1px solid var(--mon-border); flex: 0 0 auto; }
.tba-ptab { padding: 12px 10px; font-size: 14px; font-weight: 600; color: #676879; border-bottom: 2px solid transparent; cursor: pointer; margin-bottom: -1px; }
.tba-ptab:hover { color: #323338; }
.tba-ptab.is-active { color: #0073ea; border-bottom-color: #0073ea; }

.tba-upd-composer { border: 1px solid var(--mon-border); border-radius: 10px; padding: 10px 12px; margin-bottom: 18px; box-shadow: 0 1px 3px rgba(20,30,80,.06); }
.tba-upd-input { width: 100%; min-height: 72px; border: none; resize: vertical; font: inherit; font-size: 14px; outline: none; color: #323338; }
.tba-upd-bar { display: flex; justify-content: flex-end; margin-top: 8px; }
.tba-upd-btn { height: 34px; }
.tba-upd-feed { display: flex; flex-direction: column; gap: 12px; }
.tba-upd-empty { text-align: center; padding: 34px 10px; }
.tba-upd-empty-t { font-weight: 700; color: #5a5b66; margin-bottom: 4px; font-size: 15px; }
.tba-upd-empty-s { color: #9699a6; font-size: 13px; }
.tba-upd-card { border: 1px solid var(--mon-border); border-radius: 10px; padding: 10px 12px; }
.tba-upd-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.tba-upd-author { font-weight: 600; font-size: 13px; color: #323338; }
.tba-upd-date { font-size: 11px; color: #9699a6; margin-left: auto; }
.tba-upd-body { font-size: 14px; color: #323338; white-space: pre-wrap; line-height: 1.45; }

.tba-log-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid #eef0f5; font-size: 13px; }
.tba-log-k { color: #676879; }
.tba-log-v { color: #323338; font-weight: 600; }

/* =====================================================================
   CONTRASTO MIGLIORATO (override finale)
   ===================================================================== */
.tba-th { color: #5e6072; font-weight: 600; }
.tba-group-count { color: #676879; }
.tba-group-name { color: inherit; }
.tba-celltext { color: #1d2440; }
.tba-people-name { color: #1d2440; }
.tba-row { border-bottom-color: #e7e9f0; }
.tba-cell { border-right-color: #e7e9f0; }
.tba-cell-title { border-right-color: #e7e9f0; }
.tba-title-text { color: #1d2440; }
.tba-sum-title { color: #5e6072; }
.tba-chip.has-color { color: #fff; font-weight: 600; text-shadow: 0 1px 1px rgba(0,0,0,.12); }
.tba-add-input::placeholder, .tba-search::placeholder { color: #8a8fa3; }

/* =====================================================================
   ITERAZIONE 2 — Kanban per gruppi, composer, registro, contrasto
   ===================================================================== */
/* Kanban a swimlane per gruppo */
.tba-kanban-wrap { display: flex; flex-direction: column; gap: 24px; }
.tba-kgroup-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.tba-kgroup-name { font-weight: 700; font-size: 15px; letter-spacing: -.2px; }
.tba-kanban { display: flex; gap: 14px; align-items: flex-start; overflow-x: auto; padding-bottom: 6px; }

/* Composer aggiornamenti: toolbar */
.tba-upd-tools { display: flex; gap: 5px; margin-top: 8px; }
.tba-upd-tool { width: 30px; height: 30px; border: none; background: #f1f3f8; border-radius: 7px; cursor: pointer; color: #5a5d6e; font-size: 14px; font-weight: 700; }
.tba-upd-tool:hover { background: #e3e6ef; color: #1d2026; }

/* Registro attività (log reale) */
.tba-actrow { display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px solid #eef0f5; }
.tba-act-av { flex: 0 0 26px; }
.tba-act-main { flex: 1; }
.tba-act-txt { font-size: 14px; color: #1d2026; }
.tba-act-field { color: #5a5d6e; font-weight: 600; }
.tba-act-from { background: #eceff3; border-radius: 5px; padding: 2px 7px; font-size: 12px; color: #5a5d6e; }
.tba-act-to { background: #d6f5e3; border-radius: 5px; padding: 2px 7px; font-size: 12px; color: #0b7a44; font-weight: 600; }
.tba-act-arrow { color: #9699a6; }
.tba-act-date { font-size: 11px; color: #9699a6; margin-top: 4px; }

/* Gantt: banda gruppo netta */
/* Gantt: linea verticale "oggi" */
.tba-gantt-today-line { position: absolute; top: 0; bottom: 0; width: 2px; background: #0073ea; opacity: .55; pointer-events: none; z-index: 1; }

/* Workspace card: footer con azioni */
.tb-workspace-card-foot { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.tb-workspace-card-foot form { margin: 0; }
.tb-workspace-card.is-archived { opacity: .7; }
.tb-archived-section { margin-top: 24px; }
.tb-archived-section summary { cursor: pointer; font-weight: 600; color: #5a5d6e; padding: 8px 0; user-select: none; }
.tb-workspace-grid-archived { margin-top: 12px; }

/* Toolbar: pulsante template */
.tba-btn-template { font-size: 12px; padding: 4px 10px; }
.tba-owner-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px solid #e3e6ef; border-radius: 14px; background: #fff; color: #1f2747; font-size: 13px; cursor: pointer; transition: border-color .15s, background .15s; }
.tba-owner-chip:hover { border-color: #579bfc; background: #f0f5ff; }
.tba-owner-avatar { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; color: #fff; flex-shrink: 0; }
.tba-owner-placeholder { color: #9699a6; }
.tba-menu-label { font-size: 11px; font-weight: 700; color: #9699a6; text-transform: uppercase; letter-spacing: .05em; padding: 4px 12px 2px; }

/* Pagina utenti */
.tb-users-content { padding: 24px; max-width: 900px; }
.tb-users-list { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
.tb-user-card { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid #e3e6ef; border-radius: 8px; padding: 12px 16px; }
.tb-user-avatar { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; color: #fff; flex-shrink: 0; }
.tb-user-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.tb-user-info strong { font-size: 14px; color: #1d2026; }
.tb-user-info span { font-size: 12px; color: #9699a6; }
.tb-user-actions { display: flex; gap: 8px; }
.tb-btn-sm { font-size: 12px; padding: 4px 10px; }
.tb-empty-msg { color: #9699a6; padding: 32px 0; }
.tb-color-palette { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tb-color-swatch-wrap input[type=radio] { display: none; }
.tb-color-swatch { display: block; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; border: 3px solid transparent; transition: border-color .15s; }
.tb-color-swatch-wrap input[type=radio]:checked + .tb-color-swatch { border-color: #1f2747; }
.tb-color-swatch:hover { opacity: .85; }
.tb-sidebar-footer a { display: block; padding: 4px 0; font-size: 12px; }

/* =====================================================================
   CONTRASTO 2 (override finale, più marcato come Monday)
   ===================================================================== */
:root { --mon-text: #1d2026; --mon-muted: #5a5d6e; --mon-border: #dfe2ea; }
body { color: #1d2026; }
.tba-celltext, .tba-title-text, .tba-people-name, .tba-cell-title { color: #16181f; }
.tba-th { color: #5a5d6e; font-weight: 600; }
.tba-group-count { color: #5a5d6e; }
.tba-row { border-bottom-color: #e3e6ef; }
.tba-cell, .tba-cell-title { border-right-color: #e3e6ef; }
.tba-table { border-color: #dadee8; }
.tba-tab { color: #5a5d6e; }
.tba-tab.is-active { color: #16181f; }
.tba-btn { color: #1d2026; border-color: #cfd3e0; }
.tba-search, .tba-filter, .tba-filter-text { color: #1d2026; border-color: #cfd3e0; }
.tba-chip.has-color { color: #fff; font-weight: 600; text-shadow: 0 1px 1px rgba(0,0,0,.18); }
.tba-sidebar { border-right-color: #e3e6ef; }

/* =====================================================================
   AUTH — login page
   ===================================================================== */
body.tb-login-page { background: #f5f6fa; display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.tb-login-box { background: #fff; border: 1px solid #dfe2ea; border-radius: 12px; padding: 40px 44px; width: 100%; max-width: 400px; box-shadow: 0 4px 24px rgba(0,0,0,.07); }
.tb-login-logo { font-size: 22px; font-weight: 800; color: #0073ea; letter-spacing: -.5px; margin-bottom: 24px; }
.tb-login-box h1 { font-size: 20px; font-weight: 700; color: #1d2026; margin: 0 0 4px; }
.tb-login-sub { font-size: 13px; color: #9699a6; margin: 0 0 20px; }
.tb-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: #5a5d6e; margin-bottom: 14px; }
.tb-form input, .tb-form select, .tb-form textarea { padding: 8px 10px; border: 1px solid #dfe2ea; border-radius: 6px; font-size: 14px; color: #1d2026; outline: none; }
.tb-form input:focus, .tb-form select:focus { border-color: #0073ea; box-shadow: 0 0 0 2px #0073ea1a; }

/* Topbar: logout button */
.tb-topbar-logout { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; color: #9699a6; font-size: 16px; text-decoration: none; border-radius: 50%; margin-left: 4px; transition: background .15s; }
.tb-topbar-logout:hover { background: #f0f0f4; color: #e2445c; }

/* User page: role badge */
.tb-role-badge { display: inline-block; padding: 1px 7px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.tb-role-admin { background: #e8f5e9; color: #037f4c; }
.tb-role-user { background: #f0f1f5; color: #5a5d6e; }
.tb-user-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tb-user-meta code { font-size: 12px; background: #f0f1f5; border-radius: 4px; padding: 1px 5px; }

/* Board card: archived state */
.tb-card.is-archived { opacity: .7; }
.tb-card.is-archived .tb-card-head h2 { color: #9699a6; }
