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

:root {
  --primary: #0C66E4;
  --primary-dark: #0055CC;
  --primary-light: rgba(12, 102, 228, 0.12);
  --bg: #DDE3EA;
  --card-bg: #FFFFFF;
  --text: #111827;
  --text-light: #4B5563;
  --border: #D1D5DB;
  --danger: #DC2626;
  --success: #059669;
  --warning: #D97706;
  --shadow: 0 2px 8px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.15);
  --radius: 12px;
  --radius-sm: 8px;
  --navbar-bg: #1D2125;
  --navbar-text: #B6C2CF;
  --navbar-accent: #005C91;
}

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.hidden { display: none !important; }

/* ===== LOGIN PAGE ===== */
#login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #0B2742 0%, #0F4A7A 55%, #1D2125 100%);
}

.login-container {
  background: white;
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.login-container h1 {
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
  color: var(--text);
}

.login-container .subtitle {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 32px;
  font-size: 15px;
}

.login-logo {
  text-align: center;
  margin-bottom: 24px;
  font-size: 48px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  transition: border-color 0.2s;
  outline: none;
  font-family: inherit;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-dark); }

#login-form .btn-primary {
  width: 100%;
  padding: 12px 24px;
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 2px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover { opacity: 0.9; }

.btn-success {
  background: var(--success);
  color: white;
}

.btn-small {
  padding: 5px 12px;
  font-size: 12px;
}

.btn-xs {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
}

.login-error {
  color: var(--danger);
  text-align: center;
  font-size: 14px;
  margin-top: 12px;
  min-height: 20px;
}

/* ===== TOP NAVBAR ===== */
.navbar {
  background: var(--navbar-bg);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: none;
  border-bottom: 2px solid var(--navbar-accent);
}

.navbar-left {
  position: relative;
  display: flex;
  align-items: center;
}

.navbar-brand {
  background: none;
  border: none;
  padding: 0;
  font-size: 20px;
  font-weight: 700;
  color: #DEE4EA;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-family: inherit;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.navbar-user {
  font-size: 14px;
  color: var(--navbar-text);
}

.navbar-user strong {
  color: #FFFFFF;
}

.btn-nav {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-nav-admin {
  background: rgba(87, 157, 255, 0.18);
  color: #DEEBFF;
}
.btn-nav-admin:hover { background: rgba(87, 157, 255, 0.3); }

.btn-nav-logout {
  background: none;
  color: #C7D1DB;
  border: 1px solid #44546F;
}
.btn-nav-logout:hover { background: rgba(68, 84, 111, 0.35); color: white; }

/* ===== BOARDS PAGE ===== */
#boards-page {
  min-height: calc(100vh - 60px);
}

.boards-shell {
  display: flex;
  min-height: calc(100vh - 60px);
}

.boards-main {
  flex: 1;
  min-width: 0;
}

.collab-sidebar {
  width: 220px;
  background: #1F2937;
  border-right: 1px solid #334155;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.collab-sidebar-item {
  border: none;
  background: transparent;
  color: #CBD5E1;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.collab-sidebar-item:hover {
  background: rgba(148, 163, 184, 0.15);
}

.collab-sidebar-item.active {
  background: rgba(59, 130, 246, 0.24);
  color: #DBEAFE;
}

.boards-header {
  padding: 40px 40px 0;
  max-width: 1260px;
  margin: 0;
}

.boards-header h2 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 4px;
}

.boards-header p {
  color: var(--text-light);
  font-size: 15px;
}

.boards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding: 30px 40px;
  max-width: 1260px;
  margin: 0;
}

.board-card {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow);
  border-left: 5px solid var(--primary);
  position: relative;
}

.board-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.board-card-color {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  margin-bottom: 16px;
}

.board-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.board-card p {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 12px;
  line-height: 1.4;
}

.board-card-meta {
  font-size: 12px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 4px;
}

.board-card-new {
  border: 2px dashed var(--border);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: auto;
  padding: 14px 24px;
  background: transparent;
  box-shadow: none;
  border-left: 2px dashed var(--border);
  max-width: 200px;
}

.board-card-new:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: none;
  box-shadow: none;
}

.board-card-new .plus {
  font-size: 22px;
  color: var(--text-light);
  margin-bottom: 0;
}

.board-card-new span {
  color: var(--text-light);
  font-weight: 600;
  font-size: 14px;
}

/* ===== TODOIST SECTION ===== */
.todoist-section {
  max-width: 1260px;
  margin: 0;
  padding: 0 40px 40px;
}

#boards-page.tasks-view .todoist-section {
  padding-top: 34px;
}

.todoist-header {
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

.todoist-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.todoist-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.todoist-group-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.todoist-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.todoist-group-header .todoist-group-title {
  margin-bottom: 0;
  flex: 1;
}

.todoist-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.todoist-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-light);
  font-size: 14px;
  background: white;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
}

.todoist-team-item {
  background: white;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.todoist-team-item:hover {
  border-color: #B6C2CF;
  box-shadow: 0 1px 4px rgba(9, 30, 66, 0.08);
}

.todoist-team-item.is-overdue {
  border-left: 4px solid var(--danger);
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.12), rgba(255, 255, 255, 1) 14%);
  border-color: rgba(220, 38, 38, 0.45);
}

.todoist-team-item.completed .todoist-team-title {
  text-decoration: line-through;
  color: var(--text-light);
}

.todoist-team-check {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.todoist-team-content {
  flex: 1;
  min-width: 0;
}

.todoist-team-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.todoist-team-meta {
  margin-top: 4px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-light);
}

.announcement-item {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.announcement-item.new {
  background: #FFF7D6;
  border-color: #E2B203;
}

.announcement-read-check {
  width: 22px;
  height: 22px;
  border: 2px solid #C9B458;
  border-radius: 999px;
  background: #FFFBEA;
  color: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}

.announcement-read-check:hover {
  border-color: #B38600;
  background: #FFF1B8;
}

.announcement-item-main {
  min-width: 0;
  flex: 1;
}

.announcement-item-message {
  font-size: 14px;
  color: var(--text);
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.announcement-item-meta {
  margin-top: 5px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--text-light);
  font-size: 12px;
}

.announcement-delete {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 16px;
  border-radius: 4px;
  padding: 2px 6px;
  flex-shrink: 0;
}

.announcement-delete:hover {
  background: rgba(220, 38, 38, 0.09);
  color: var(--danger);
}

.admin-announcement-status {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-announcement-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}

.admin-announcement-pill.read {
  background: rgba(22, 163, 74, 0.15);
  color: #166534;
}

.admin-announcement-pill.unread {
  background: rgba(220, 38, 38, 0.12);
  color: #991B1B;
}

.todoist-task {
  background: white;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
  overflow: hidden;
  transition: all 0.2s;
}

.todoist-task.completed {
  opacity: 0.6;
  border-left-color: var(--success);
}

.todoist-task.priority-alta {
  border-left-color: var(--danger);
}

.todoist-task.priority-media {
  border-left-color: var(--warning);
}

.todoist-task.priority-baixa {
  border-left-color: var(--success);
}

.todoist-task.is-overdue {
  border-left-color: var(--danger);
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.12), rgba(255, 255, 255, 1) 13%);
  box-shadow: 0 2px 8px rgba(153, 27, 27, 0.2);
}

.todoist-task-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.15s;
}

.todoist-task-header:hover {
  background: rgba(0,0,0,0.02);
}

.todoist-task-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  background: white;
}

.todoist-task-check:hover {
  border-color: var(--success);
  background: rgba(5, 150, 105, 0.08);
}

.todoist-task-check.checked {
  background: var(--success);
  border-color: var(--success);
  color: white;
  font-size: 12px;
}

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

.todoist-task-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.todoist-task.completed .todoist-task-title {
  text-decoration: line-through;
  color: var(--text-light);
}

.todoist-task-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-light);
  flex-wrap: wrap;
}

.todoist-recurring-pill {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #0E7490;
  background: rgba(14, 116, 144, 0.12);
}

.todoist-recurring-pill-icon {
  min-width: 24px;
  padding: 2px 6px;
  text-align: center;
}

.todoist-overdue-reason-block {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #F5C5C5;
  background: #FFF5F5;
  border-radius: 8px;
}

.todoist-overdue-reason-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #991B1B;
  margin-bottom: 6px;
}

.todoist-overdue-reason-input {
  width: 100%;
  min-height: 64px;
  resize: vertical;
  border: 1px solid #E8A7A7;
  border-radius: 6px;
  background: white;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  padding: 8px 10px;
  outline: none;
}

.todoist-overdue-reason-input:focus {
  border-color: #DC2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.12);
}

.todoist-overdue-reason-actions {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.todoist-overdue-reason-save {
  border: 1px solid #D4DCE6;
  background: white;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.todoist-overdue-reason-save:hover {
  background: #EEF2F7;
  border-color: #BBC6D3;
}

.todoist-overdue-reason-ok {
  font-size: 12px;
  font-weight: 600;
  color: #166534;
}

.todoist-overdue-reason-status {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(22, 163, 74, 0.28);
  background: rgba(22, 163, 74, 0.09);
  border-radius: 8px;
}

.todoist-overdue-reason-text {
  margin-top: 6px;
  color: #0F172A;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.todoist-task-priority {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.priority-badge-alta {
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger);
}

.priority-badge-media {
  background: rgba(217, 119, 6, 0.1);
  color: var(--warning);
}

.priority-badge-baixa {
  background: rgba(5, 150, 105, 0.1);
  color: var(--success);
}

.todoist-task-body {
  padding: 0 16px 14px 50px;
  display: none;
}

.todoist-task-body.open {
  display: block;
}

.todoist-task-description {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.5;
  margin-bottom: 12px;
  padding: 10px;
  background: var(--bg);
  border-radius: 6px;
  white-space: pre-wrap;
}

.todoist-subtask {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px;
  border-radius: 6px;
  transition: background 0.15s;
}

.todoist-subtask:hover {
  background: var(--bg);
}

.todoist-subtask input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.todoist-subtask-info {
  flex: 1;
}

.todoist-subtask-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.4;
}

.todoist-subtask-text.checked {
  text-decoration: line-through;
  color: var(--text-light);
}

.todoist-subtask-desc {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
  line-height: 1.4;
}

/* ===== KANBAN BOARD ===== */
#kanban-page {
  height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
}

.kanban-header {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  border-bottom: 1px solid var(--border);
}

.kanban-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.kanban-header h2 {
  font-size: 20px;
  font-weight: 700;
}

.btn-back {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-light);
  font-family: inherit;
  transition: all 0.2s;
}
.btn-back:hover { background: var(--bg); }

.kanban-board {
  display: flex;
  gap: 18px;
  padding: 20px;
  overflow-x: auto;
  flex: 1;
  align-items: flex-start;
  cursor: grab;
  overscroll-behavior-x: contain;
  background: linear-gradient(180deg, #CED8E3 0%, #C3CFDD 100%);
  border-top: 1px solid #B5C2D2;
}

.kanban-board.panning {
  cursor: grabbing;
}

.kanban-board.panning,
.kanban-board.panning * {
  user-select: none !important;
  -webkit-user-select: none !important;
}

.kanban-column {
  background: #D6DFEA;
  border-radius: var(--radius);
  min-width: 290px;
  max-width: 290px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 160px);
  border: 1px solid #B7C5D4;
  position: relative;
  transition: box-shadow 0.15s, transform 0.15s;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
}

.kanban-column.column-dragging {
  opacity: 0.8;
  transform: scale(0.985);
  box-shadow: 0 10px 24px rgba(0,0,0,0.16);
}

.column-header {
  padding: 14px 16px;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #CBD6E3;
  background: #EEF3F8;
  border-radius: var(--radius) var(--radius) 0 0;
}

.column-header[draggable="true"] {
  cursor: grab;
}

.column-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.column-header-left span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.column-actions {
  display: flex;
  gap: 4px;
}

.column-actions button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.2s;
}
.column-actions button:hover { background: var(--border); }

.column-menu-trigger {
  width: 28px;
  height: 28px;
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.column-menu-trigger.active {
  background: rgba(9,30,66,0.1);
  color: var(--text);
}

.column-menu {
  position: absolute;
  top: 52px;
  right: 10px;
  z-index: 35;
  width: 250px;
  background: #22272B;
  color: #DDE4EA;
  border: 1px solid #39424A;
  border-radius: 12px;
  box-shadow: 0 14px 28px rgba(0,0,0,0.35);
  overflow: hidden;
}

.column-menu-title {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #9FB0C1;
  border-bottom: 1px solid #39424A;
}

.column-menu-item {
  width: 100%;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 14px;
  font-family: inherit;
  text-align: left;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s;
}

.column-menu-item:hover {
  background: #2D333B;
}

.column-menu-item.with-arrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.column-menu-item.with-arrow span {
  font-size: 16px;
  opacity: 0.85;
}

.column-menu-item.disabled,
.column-menu-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.column-menu-item.danger {
  border-top: 1px solid #39424A;
  color: #FCA5A5;
}

.column-menu-item.remove-color {
  border-top: 1px solid #39424A;
  color: #C7D2DE;
}

.column-color-palette {
  padding: 10px 12px 12px;
  border-top: 1px solid #39424A;
}

.column-color-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.column-color-option {
  width: 100%;
  height: 28px;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  cursor: pointer;
}

.column-color-option.selected {
  border-color: white;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.18);
}

.column-cards {
  padding: 12px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 60px;
  background: rgba(148, 163, 184, 0.15);
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.column-cards.drag-over {
  background: rgba(96, 165, 250, 0.16);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.32);
}

.kanban-column.has-custom-color {
  border-color: var(--column-theme-border);
}

.kanban-column.has-custom-color .column-header {
  background: var(--column-theme-bg);
  border-bottom-color: var(--column-theme-border);
}

.kanban-column.has-custom-color .column-header-left span {
  color: var(--column-theme-text);
}

.kanban-column.has-custom-color .column-menu-trigger {
  color: var(--column-theme-muted-text);
}

.kanban-column.has-custom-color .column-menu-trigger:hover {
  background: rgba(255,255,255,0.12);
  color: var(--column-theme-text);
}

.kanban-column.has-custom-color .column-cards {
  background: var(--column-theme-body);
}

.kanban-column.has-custom-color .column-cards.drag-over {
  background: var(--column-theme-body-hover);
}

.kanban-card {
  background: white;
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: grab;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.06);
  transition: box-shadow 0.15s, border-color 0.15s, background 0.15s, transform 0.15s, opacity 0.12s;
  border: 1px solid #D7E1EE;
  position: relative;
  overflow: visible;
}

.kanban-card.kanban-card-done {
  background: #F7F8F9;
  border-color: #D0D4DC;
}

.kanban-card.kanban-card-overdue:not(.kanban-card-done) {
  border-color: rgba(220, 38, 38, 0.45);
  border-left: 4px solid #DC2626;
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.14), #FFFFFF 16%);
}

.kanban-card:hover {
  box-shadow: var(--shadow);
  border-color: #A8C3EA;
  background: linear-gradient(180deg, #FFFFFF 0%, #F7FAFF 100%);
  transform: translateY(-1px);
}

.kanban-card.dragging {
  opacity: 0.35;
  transform: rotate(1deg) scale(0.98);
}

.card-drop-placeholder {
  border: 2px dashed #7EA6E7;
  border-radius: var(--radius-sm);
  background: rgba(96, 165, 250, 0.14);
  min-height: 84px;
}

.kanban-card-color-bar {
  height: 4px;
  border-radius: 2px;
  margin-bottom: 10px;
}

.kanban-card-label {
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  min-height: 22px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
  max-width: calc(100% - 56px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban-card-hover-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  gap: 4px;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.15s, transform 0.15s;
  z-index: 3;
}

.kanban-card:hover .kanban-card-hover-actions {
  opacity: 1;
  transform: translateY(0);
}

.kanban-card-hover-btn {
  width: 24px;
  height: 24px;
  border: 1px solid #D0D7E2;
  border-radius: 6px;
  background: rgba(248, 250, 252, 0.95);
  color: #334155;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.kanban-card-hover-btn:hover {
  border-color: #90A8CC;
  background: #EAF1FF;
  color: #1E3A8A;
}

.kanban-card-title-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding-right: 56px;
}

.kanban-card-complete {
  width: 22px;
  height: 22px;
  border: 2px solid #A7AFBC;
  border-radius: 999px;
  background: white;
  color: transparent;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  flex-shrink: 0;
  transition: all 0.15s;
}

.kanban-card-complete:hover {
  border-color: #5BAA4D;
}

.kanban-card-complete.checked {
  border-color: #5BAA4D;
  background: #8BC34A;
  color: #0F2A04;
}

.kanban-card-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.kanban-card-title.completed {
  color: #5E6C84;
  text-decoration: line-through;
}

.kanban-card p {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.4;
  margin-bottom: 8px;
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 28px;
  margin-top: 8px;
}

.kanban-card-footer-spacer {
  flex: 1;
}

.kanban-card-member-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  position: relative;
  flex-shrink: 0;
  margin-left: auto;
}

.kanban-card-member-avatar-ring {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid #B9C5DA;
  background: #F8FAFC;
}

.kanban-card-member-avatar-core {
  position: absolute;
  inset: 2px;
  border-radius: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 700;
}

.card-quick-menu {
  position: fixed;
  width: min(240px, calc(100vw - 24px));
  background: #1F2937;
  border: 1px solid #334155;
  border-radius: 10px;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.42);
  padding: 6px;
  z-index: 2200;
}

.card-quick-menu-item {
  width: 100%;
  border: none;
  background: transparent;
  color: #E2E8F0;
  text-align: left;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}

.card-quick-menu-item:hover,
.card-quick-menu-item.active {
  background: #334155;
  color: #F8FAFC;
}

.card-quick-menu-item.danger {
  color: #FCA5A5;
}

.card-quick-menu-item.danger:hover {
  background: rgba(220, 38, 38, 0.2);
  color: #FECACA;
}

.card-quick-popover {
  position: fixed;
  width: min(340px, calc(100vw - 24px));
  background: #1F2937;
  border: 1px solid #334155;
  border-radius: 12px;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.48);
  padding: 12px;
  z-index: 2210;
}

.card-quick-popover .trello-picker {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
}

.card-quick-popover .trello-picker-title {
  color: #CBD5E1;
  border-bottom-color: #334155;
}

.card-quick-popover .trello-picker-search {
  background: #111827;
  border-color: #475569;
  color: #F8FAFC;
}

.card-quick-popover .trello-picker-search:focus {
  border-color: #60A5FA;
}

.card-quick-popover .trello-picker-list {
  max-height: 240px;
}

.card-quick-popover .trello-member-item:hover,
.card-quick-popover .trello-label-item:hover {
  background: #334155;
}

.card-quick-popover .trello-member-item.selected,
.card-quick-popover .trello-label-item.selected {
  background: #1E3A5F;
}

.card-quick-popover .trello-member-name,
.card-quick-popover .trello-cal-month-label,
.card-quick-popover .trello-cal-day,
.card-quick-popover .trello-cal-dow {
  color: #E2E8F0;
}

.card-quick-popover .trello-cal-day.empty {
  color: #64748B;
}

.card-quick-popover .trello-cal-nav-btn {
  border-color: #475569;
  color: #E2E8F0;
}

.card-quick-popover .trello-cal-nav-btn:hover {
  background: #334155;
}

.card-quick-popover .trello-picker-secondary {
  background: #374151;
  color: #E5E7EB;
}

.card-quick-popover .trello-picker-secondary:hover {
  background: #4B5563;
}

.card-quick-popover .trello-picker-actions .btn-cancel {
  background: #374151;
  color: #E5E7EB;
}

.card-quick-popover .trello-picker-actions .btn-cancel.danger {
  color: #FCA5A5;
}

.card-quick-empty {
  color: #94A3B8;
}

.column-add-card {
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.26);
  background: rgba(255, 255, 255, 0.34);
  border-radius: 0 0 var(--radius) var(--radius);
}

.add-card-btn {
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  color: #334155;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  border: none;
  background: rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  transition: all 0.15s;
  font-family: inherit;
}

.add-card-btn:hover {
  background: rgba(37, 99, 235, 0.14);
  color: #1D4ED8;
}

.add-card-btn.hidden {
  display: none;
}

.add-card-inline {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.add-card-inline-input {
  width: 100%;
  min-height: 86px;
  border: 1px solid #8FB4E8;
  border-radius: 10px;
  padding: 10px 12px;
  resize: vertical;
  font-size: 15px;
  line-height: 1.35;
  font-family: inherit;
  background: #FFFFFF;
  color: #111827;
}

.add-card-inline-input:focus {
  outline: none;
  border-color: #3B82F6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.add-card-inline-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.add-card-inline-cancel {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #475569;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}

.add-card-inline-cancel:hover {
  background: rgba(148, 163, 184, 0.22);
  color: #0F172A;
}

.kanban-column.has-custom-color .column-add-card {
  background: var(--column-theme-body);
  border-top-color: var(--column-theme-border);
}

.kanban-column.has-custom-color .add-card-btn {
  background: rgba(255, 255, 255, 0.14);
  color: var(--column-theme-text);
}

.kanban-column.has-custom-color .add-card-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.kanban-column.has-custom-color .add-card-inline-input {
  background: rgba(15, 23, 42, 0.34);
  color: #F8FAFC;
  border-color: rgba(255, 255, 255, 0.25);
}

.kanban-column.has-custom-color .add-card-inline-input::placeholder {
  color: rgba(241, 245, 249, 0.78);
}

.kanban-column.has-custom-color .add-card-inline-cancel {
  color: var(--column-theme-muted-text);
}

.add-column-btn {
  min-width: 290px;
  padding: 20px;
  background: rgba(255,255,255,0.5);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  transition: all 0.2s;
}
.add-column-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ===== ADMIN PAGE ===== */
#admin-page {
  min-height: calc(100vh - 60px);
}

.admin-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 30px 40px;
}

.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: white;
  border-radius: var(--radius-sm);
  padding: 3px;
  box-shadow: var(--shadow);
}

.admin-tab {
  padding: 9px 14px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  color: var(--text-light);
  transition: all 0.2s;
  font-family: inherit;
}
.admin-tab.active {
  background: var(--primary);
  color: white;
}

.admin-section {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.admin-section h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-section h3 .btn {
  width: auto;
  min-width: 126px;
  padding: 6px 12px;
  border-radius: 9px;
  font-size: 12px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  text-align: left;
  padding: 12px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-light);
  border-bottom: 2px solid var(--border);
}

.admin-table td {
  padding: 12px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.badge {
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}
.badge-admin { background: rgba(67,56,202,0.1); color: var(--primary); }
.badge-member { background: rgba(5,150,105,0.1); color: var(--success); }

/* ===== ADMIN TASKS ===== */
.admin-tasks-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.admin-filter-select {
  padding: 8px 14px;
  border: 2px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  background: white;
  cursor: pointer;
}

.admin-filter-select:focus {
  border-color: var(--primary);
}

.admin-tasks-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-overdue-section {
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.admin-overdue-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.admin-task-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--primary);
  transition: all 0.15s;
  cursor: pointer;
}

.admin-task-item:hover {
  background: #DDE0E7;
}

.admin-task-item.priority-alta { border-left-color: var(--danger); }
.admin-task-item.priority-media { border-left-color: var(--warning); }
.admin-task-item.priority-baixa { border-left-color: var(--success); }
.admin-task-item.task-completed { opacity: 0.6; }
.admin-task-item.task-overdue { border-left-color: var(--danger); }
.admin-task-item.task-overdue {
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.1), var(--bg) 12%);
  border-color: rgba(220, 38, 38, 0.32);
}

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

.admin-task-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.admin-task-item.task-completed .admin-task-title {
  text-decoration: line-through;
}

.admin-task-details {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-light);
}

.admin-task-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.admin-task-actions button {
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.15s;
}

.admin-task-edit-btn {
  background: #EEF2F7;
  border-color: #D4DCE6;
  color: var(--text);
}
.admin-task-edit-btn:hover { background: #E1E8F0; }

.admin-task-delete-btn {
  background: #FDECEC;
  border-color: #F5C5C5;
  color: var(--danger);
}
.admin-task-delete-btn:hover { background: #F9DCDC; }

.admin-overdue-reason {
  margin-top: 8px;
  font-size: 12px;
  color: #166534;
  background: rgba(22, 163, 74, 0.09);
  border: 1px solid rgba(22, 163, 74, 0.2);
  border-radius: 6px;
  padding: 6px 8px;
}

.admin-overdue-reason.missing {
  color: #991B1B;
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.25);
}

.weekday-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.weekday-checklist label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text);
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: white;
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.2s;
  max-height: 90vh;
  overflow-y: auto;
}

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

.modal h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* ===== BOARD MEMBERS MANAGEMENT ===== */
.members-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.member-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.member-item-info {
  display: flex;
  flex-direction: column;
}

.member-item-name {
  font-weight: 600;
  font-size: 14px;
}

.member-item-email {
  font-size: 12px;
  color: var(--text-light);
}

/* ===== COLOR PICKER ===== */
.color-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.color-option {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.2s;
}
.color-option:hover { transform: scale(1.1); }
.color-option.selected { border-color: var(--text); }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}
.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
}
.empty-state h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--text);
}
.empty-state p {
  font-size: 14px;
}

/* ===== CARD DETAIL POPUP (Trello style) ===== */
.card-detail-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  overflow-y: auto;
  padding: 40px 20px;
  animation: fadeIn 0.2s;
}

.card-detail {
  background: var(--bg);
  border-radius: var(--radius);
  width: min(1260px, calc(100vw - 48px));
  max-width: 1260px;
  margin: 0 auto;
  position: relative;
  animation: slideUp 0.25s;
  min-height: min(780px, calc(100vh - 80px));
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
}

.card-detail-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0,0,0,0.06);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  transition: all 0.2s;
  z-index: 2;
}
.card-detail-close:hover {
  background: rgba(0,0,0,0.12);
  color: var(--text);
}

.card-detail-color-top {
  height: 6px;
  border-radius: var(--radius) var(--radius) 0 0;
}

.card-detail-header {
  padding: 24px 24px 0;
}

.card-detail-header-icon {
  font-size: 20px;
  margin-right: 8px;
  color: var(--text-light);
}

.card-detail-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  padding-right: 40px;
  word-break: break-word;
}

.card-detail-title-input {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  border: 2px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  width: 100%;
  font-family: inherit;
  outline: none;
  background: white;
}

.card-detail-subtitle {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 20px;
}
.card-detail-subtitle strong {
  text-decoration: underline;
}

.card-detail-body {
  display: flex;
  gap: 16px;
  padding: 0 24px 24px;
  flex: 1;
  min-height: 0;
}

.card-detail-main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding-right: 0;
}

.card-detail-sidebar {
  width: 310px;
  flex-shrink: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.card-detail-sidebar h4 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-light);
  margin-bottom: 8px;
  margin-top: 0;
}

.card-detail-sidebar-section {
  margin-bottom: 16px;
}

.card-detail-sidebar-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: rgba(0,0,0,0.06);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: all 0.15s;
  font-family: inherit;
  margin-bottom: 6px;
  text-align: left;
}
.card-detail-sidebar-btn:hover {
  background: rgba(0,0,0,0.12);
}
.card-detail-sidebar-btn.danger {
  color: var(--danger);
}
.card-detail-sidebar-btn.danger:hover {
  background: rgba(220,38,38,0.1);
}

.card-detail-section {
  margin-bottom: 20px;
}

.card-detail-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.card-detail-action-stack {
  position: relative;
}

.card-detail-inline-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #F8FAFC;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 12px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.card-detail-inline-btn:hover {
  background: #EEF2FF;
  border-color: #B6C3F5;
}

.card-detail-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.card-detail-section-header h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.card-detail-info-row {
  display: flex;
  gap: 24px;
  margin-bottom: 20px;
}

.card-detail-info-row .card-detail-section {
  margin-bottom: 0;
}

.card-detail-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-light);
  margin-bottom: 6px;
}

.card-detail-label-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-detail-assignee-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-light);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

.card-detail-assignee-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.card-detail-due-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
}
.card-detail-due-badge.overdue {
  background: rgba(220,38,38,0.1);
  border-color: var(--danger);
  color: var(--danger);
}
.card-detail-due-badge.soon {
  background: rgba(217,119,6,0.1);
  border-color: var(--warning);
  color: #92400E;
}

.card-detail-description-content {
  background: white;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  min-height: 180px;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: all 0.15s;
  white-space: pre-wrap;
  word-break: break-word;
}
.card-detail-description-content:hover {
  background: rgba(0,0,0,0.02);
}
.card-detail-description-content.empty {
  color: var(--text-light);
  font-style: italic;
}

.card-detail-description-edit {
  width: 100%;
  min-height: 120px;
  padding: 12px;
  border: 2px solid var(--primary);
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.6;
  font-family: inherit;
  resize: vertical;
  outline: none;
}

.card-detail-description-edit.rich {
  min-height: 420px;
  max-height: 58vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 22px 28px;
  border: 1px solid #2E3440;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  background: #1F2530;
  color: #F4F7FB;
  line-height: 1.62;
}

.card-detail-description-edit.rich:focus {
  border-color: #2563EB;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.card-detail-description-edit.rich::-webkit-scrollbar {
  width: 10px;
}

.card-detail-description-edit.rich::-webkit-scrollbar-track {
  background: #1F2530;
  border-radius: 10px;
}

.card-detail-description-edit.rich::-webkit-scrollbar-thumb {
  background: #4B5563;
  border-radius: 10px;
}

.card-detail-description-edit.rich::-webkit-scrollbar-thumb:hover {
  background: #64748B;
}

.card-detail-description-edit.rich a {
  color: #60A5FA;
}

.card-detail-description-edit.rich img {
  max-width: 100%;
  border-radius: 6px;
}

.card-detail-description-edit.rich > *:first-child {
  margin-top: 0;
}

.card-detail-description-edit.rich p,
.card-detail-description-edit.rich ul,
.card-detail-description-edit.rich ol,
.card-detail-description-edit.rich blockquote,
.card-detail-description-edit.rich pre {
  margin: 0 0 12px;
}

.card-detail-description-edit.rich ul,
.card-detail-description-edit.rich ol {
  padding-left: 22px;
}

.card-detail-description-edit.rich hr {
  border: none;
  border-top: 1px solid #3A4558;
  margin: 16px 0;
}

.card-detail-rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #2E3440;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  background: #111827;
  position: relative;
}

.card-rich-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.card-rich-group-menu {
  position: relative;
}

.card-rich-sep {
  width: 1px;
  height: 28px;
  background: #334155;
  opacity: 0.9;
}

.card-rich-caret {
  font-size: 11px;
  opacity: 0.86;
}

.card-rich-select {
  min-width: 132px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid #334155;
  background: #1E293B;
  color: #E5E7EB;
  font-size: 13px;
  padding: 0 8px;
  font-weight: 600;
}

.card-rich-btn {
  height: 32px;
  border: 1px solid #334155;
  border-radius: 6px;
  background: #1E293B;
  color: #E5E7EB;
  font-size: 13px;
  font-weight: 700;
  padding: 0 10px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.card-rich-btn:hover {
  background: #0F3B72;
  border-color: #2563EB;
  color: #F8FAFC;
}

.card-rich-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  background: #1E293B;
  border: 1px solid #334155;
  border-radius: 8px;
  box-shadow: 0 14px 28px rgba(2, 6, 23, 0.4);
  padding: 6px;
  z-index: 12;
}

.card-rich-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: #E2E8F0;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}

.card-rich-menu-item:hover {
  background: rgba(59, 130, 246, 0.22);
}

.card-detail-description-content.rich {
  white-space: normal;
}

.card-detail-description-content.rich h1,
.card-detail-description-content.rich h2,
.card-detail-description-content.rich h3,
.card-detail-description-content.rich h4,
.card-detail-description-content.rich h5,
.card-detail-description-content.rich h6 {
  line-height: 1.25;
  margin: 14px 0 8px;
}

.card-detail-description-content.rich h1 { font-size: 30px; }
.card-detail-description-content.rich h2 { font-size: 26px; }
.card-detail-description-content.rich h3 { font-size: 22px; }
.card-detail-description-content.rich h4 { font-size: 19px; }
.card-detail-description-content.rich h5 { font-size: 17px; }
.card-detail-description-content.rich h6 { font-size: 15px; }

.card-detail-description-content.rich p,
.card-detail-description-content.rich ul,
.card-detail-description-content.rich ol,
.card-detail-description-content.rich blockquote {
  margin: 10px 0;
}

.card-detail-description-content.rich ul,
.card-detail-description-content.rich ol {
  padding-left: 20px;
}

.card-detail-description-content.rich blockquote {
  border-left: 4px solid #B6C2CF;
  padding: 6px 12px;
  background: #F1F5F9;
  border-radius: 4px;
}

.card-detail-description-content.rich img {
  display: block;
  max-width: 100%;
  border-radius: 8px;
  margin: 12px 0;
  border: 1px solid #D0D7E2;
}

.card-detail-description-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.inline-link {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}

.inline-link:hover {
  color: var(--primary-dark);
}

/* ===== CHECKLIST ===== */
.checklist-section {
  margin-bottom: 16px;
}

.checklist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.checklist-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checklist-header h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.checklist-delete-btn {
  padding: 4px 12px;
  border: none;
  background: rgba(0,0,0,0.06);
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  font-family: inherit;
  transition: all 0.15s;
}
.checklist-delete-btn:hover {
  background: rgba(220,38,38,0.1);
  color: var(--danger);
}

.checklist-progress {
  margin-bottom: 10px;
}

.checklist-progress-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.checklist-progress-percent {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  min-width: 32px;
}

.checklist-progress-bar {
  flex: 1;
  height: 8px;
  background: rgba(0,0,0,0.08);
  border-radius: 4px;
  overflow: hidden;
}

.checklist-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.3s, background 0.3s;
}
.checklist-progress-fill.complete {
  background: var(--success);
}

.checklist-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  transition: background 0.15s;
}
.checklist-item:hover {
  background: rgba(0,0,0,0.03);
}

.checklist-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.checklist-item-text {
  flex: 1;
  font-size: 14px;
  color: var(--text);
  line-height: 1.4;
  word-break: break-word;
}
.checklist-item-text.checked {
  text-decoration: line-through;
  color: var(--text-light);
}

.checklist-item-delete {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
  opacity: 0;
  transition: all 0.15s;
}
.checklist-item:hover .checklist-item-delete {
  opacity: 1;
}
.checklist-item-delete:hover {
  background: rgba(220,38,38,0.1);
  color: var(--danger);
}

.checklist-add-item {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  padding-left: 28px;
}

.checklist-add-item input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.checklist-add-item input:focus {
  border-color: var(--primary);
}

.checklist-add-item button {
  padding: 8px 14px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  transition: background 0.15s;
  white-space: nowrap;
}
.checklist-add-item button:hover {
  background: var(--primary-dark);
}

/* Inline dropdown for sidebar actions */
.card-detail-inline-dropdown {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
}

.card-detail-dropdown-host {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: min(360px, 84vw);
  z-index: 30;
}

.card-detail-action-stack:last-child > .card-detail-dropdown-host {
  left: auto;
  right: 0;
}

.card-detail-dropdown-host > .card-detail-inline-dropdown {
  width: 100%;
  margin: 0;
}

.card-detail-inline-dropdown label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 6px;
}

.card-detail-inline-dropdown input,
.card-detail-inline-dropdown select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}

.card-detail-inline-dropdown input:focus,
.card-detail-inline-dropdown select:focus {
  border-color: var(--primary);
}

.card-detail-inline-dropdown .color-options {
  margin-top: 4px;
}

.card-detail-inline-dropdown .color-option {
  width: 28px;
  height: 28px;
}

.card-detail-inline-dropdown .dropdown-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.card-detail-inline-dropdown .dropdown-actions button {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.card-detail-inline-dropdown .dropdown-actions .btn-save {
  background: var(--primary);
  color: white;
}

.card-detail-inline-dropdown .dropdown-actions .btn-cancel {
  background: rgba(0,0,0,0.06);
  color: var(--text);
}

.trello-label-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  border-radius: 6px;
  cursor: pointer;
}

.trello-label-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.trello-label-item.selected {
  background: rgba(67, 56, 202, 0.1);
}

.trello-label-toggle {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid #CBD5E1;
  color: #0F172A;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.trello-label-toggle.checked {
  background: #2563EB;
  border-color: #2563EB;
  color: white;
}

.trello-label-chip {
  flex: 1;
  min-height: 24px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trello-label-edit-btn {
  border: none;
  background: transparent;
  color: var(--text-light);
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
}

.trello-label-edit-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--text);
}

.trello-picker-secondary {
  margin-top: 8px;
  width: 100%;
  border: none;
  border-radius: 6px;
  background: rgba(0,0,0,0.06);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 10px;
  cursor: pointer;
}

.trello-picker-secondary:hover {
  background: rgba(0,0,0,0.12);
}

.trello-field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  margin: 8px 0 6px;
}

.trello-label-preview {
  border-radius: 6px;
  min-height: 32px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

.trello-label-color-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.trello-label-color-swatch {
  height: 28px;
  border-radius: 6px;
  border: 2px solid transparent;
  color: #F8FAFC;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.trello-label-color-swatch.selected {
  border-color: #0F172A;
}

.trello-picker-actions .btn-cancel.danger {
  color: var(--danger);
}

/* Card indicators on kanban board */
.kanban-card-indicators {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.kanban-card-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-light);
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
}

.kanban-card-indicator.due {
  font-weight: 700;
  border-radius: 6px;
  padding: 4px 8px;
  gap: 6px;
}

.kanban-card-indicator.due .due-clock {
  font-size: 12px;
  line-height: 1;
}

.kanban-card-indicator.due-future {
  background: #D0D4DC;
  color: #1D2125;
}

.kanban-card-indicator.due-soon {
  background: #9FCA56;
  color: #1F2A12;
}

.kanban-card-indicator.due-today {
  background: #E2B203;
  color: #422800;
}

.kanban-card-indicator.due-overdue {
  background: #AE2E24;
  color: #FFEBE6;
}

.kanban-card-indicator.icon-only {
  width: 22px;
  height: 20px;
  justify-content: center;
  padding: 0;
  font-size: 13px;
}

/* ===== AUTOMATION MODAL ===== */
.automation-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.automation-item {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 14px;
  border-left: 4px solid var(--primary);
}

.automation-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.automation-item-rule {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.automation-item-rule span {
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.automation-item-checklist {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 4px;
}

.automation-item-items {
  font-size: 12px;
  color: var(--text-light);
  padding-left: 16px;
}

.automation-item-items li {
  margin-bottom: 2px;
}

/* ===== SUBTASK MANAGEMENT (in modal) ===== */
.subtask-manage-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.subtask-manage-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: 6px;
}

.subtask-manage-item-text {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
}

.subtask-manage-item-desc {
  font-size: 11px;
  color: var(--text-light);
}

.subtask-manage-item button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
}

.subtask-manage-item button:hover {
  color: var(--danger);
  background: rgba(220,38,38,0.08);
}

/* ===== TASK DETAIL POPUP (Todoist style) ===== */
.task-detail-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s;
  padding: 20px;
}

.task-detail {
  background: white;
  border-radius: var(--radius);
  max-width: 860px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.25s;
  overflow: hidden;
}

.task-detail-top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px 0;
}

.task-detail-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  background: white;
}

.task-detail-check:hover {
  border-color: var(--success);
  background: rgba(5, 150, 105, 0.08);
}

.task-detail-check.checked {
  background: var(--success);
  border-color: var(--success);
  color: white;
  font-size: 13px;
}

.task-detail-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
  word-break: break-word;
  line-height: 1.3;
}

.task-detail-title.completed {
  text-decoration: line-through;
  color: var(--text-light);
}

.task-detail-close {
  background: none;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  transition: all 0.2s;
  flex-shrink: 0;
}
.task-detail-close:hover {
  background: var(--bg);
  color: var(--text);
}

.task-detail-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.task-detail-main {
  flex: 1;
  padding: 16px 24px 24px;
  overflow-y: auto;
  min-width: 0;
}

.task-detail-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg);
  padding: 20px;
  border-left: 1px solid var(--border);
  overflow-y: auto;
}

/* Subtasks inside task detail */
.task-detail-subtasks {
  margin-top: 8px;
}

.task-detail-subtask {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

.task-detail-subtask:last-child {
  border-bottom: none;
}

.task-detail-subtask:hover {
  background: var(--bg);
}

.task-detail-subtask input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.task-detail-subtask-info {
  flex: 1;
  min-width: 0;
}

.task-detail-subtask-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
}

.task-detail-subtask-text.checked {
  text-decoration: line-through;
  color: var(--text-light);
}

.task-detail-subtask-desc {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
  line-height: 1.4;
}

/* Description area in task detail */
.task-detail-desc-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.task-detail-desc-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.task-detail-desc-content {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  padding: 12px;
  background: var(--bg);
  border-radius: 8px;
  white-space: pre-wrap;
  word-break: break-word;
}

.task-detail-desc-editable {
  width: 100%;
  min-height: 96px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  font-family: inherit;
  resize: vertical;
  background: #fff;
  outline: none;
}

.task-detail-desc-editable:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(12, 102, 228, 0.12);
}

.task-detail-desc-hint {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 6px;
}

.task-detail-desc-empty {
  font-size: 14px;
  color: var(--text-light);
  font-style: italic;
  padding: 12px;
}

/* Sidebar items */
.task-detail-sidebar-group {
  margin-bottom: 20px;
}

.task-detail-sidebar-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-light);
  margin-bottom: 6px;
}

.task-detail-sidebar-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-detail-sidebar-value .priority-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.priority-pill.priority-alta {
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger);
}

.priority-pill.priority-media {
  background: rgba(217, 119, 6, 0.1);
  color: var(--warning);
}

.priority-pill.priority-baixa {
  background: rgba(5, 150, 105, 0.1);
  color: var(--success);
}

.task-detail-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text);
}

.task-detail-date-badge.overdue {
  background: rgba(220,38,38,0.1);
  border-color: var(--danger);
  color: var(--danger);
}

.task-detail-date-badge.soon {
  background: rgba(217,119,6,0.1);
  border-color: var(--warning);
  color: #92400E;
}

.task-detail-date-badge.today {
  background: rgba(67,56,202,0.1);
  border-color: var(--primary);
  color: var(--primary);
}

.task-detail-assignee-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg);
  padding: 4px 14px 4px 4px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.task-detail-assignee-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.task-detail-progress-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.task-detail-progress-bar {
  height: 6px;
  background: rgba(0,0,0,0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
}

.task-detail-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.3s;
}

.task-detail-progress-fill.complete {
  background: var(--success);
}

.task-detail-progress-text {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

@media (max-width: 768px) {
  .task-detail-layout { flex-direction: column; }
  .task-detail-sidebar { width: 100%; border-left: none; border-top: 1px solid var(--border); }
  .task-detail { max-height: 90vh; }
}

/* ===== RESPONSIVE ===== */
/* ===== TRELLO-STYLE PICKERS ===== */
.trello-picker {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
}

.trello-picker-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-light);
  margin-bottom: 10px;
  text-align: center;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.trello-picker-search {
  width: 100%;
  padding: 8px 10px;
  border: 2px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  margin-bottom: 8px;
}
.trello-picker-search:focus {
  border-color: var(--primary);
}

.trello-picker-list {
  max-height: 200px;
  overflow-y: auto;
}

.trello-member-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.trello-member-item:hover {
  background: var(--bg);
}
.trello-member-item.selected {
  background: rgba(67, 56, 202, 0.06);
}

.trello-member-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.trello-member-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}

.trello-member-check {
  color: var(--primary);
  font-size: 16px;
  font-weight: 700;
}

/* Trello Calendar */
.trello-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.trello-cal-nav-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 18px;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.trello-cal-nav-btn:hover {
  background: var(--bg);
}

.trello-cal-month-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.trello-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.trello-cal-dow {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-light);
  padding: 4px 0;
}

.trello-cal-day {
  text-align: center;
  padding: 6px 0;
  font-size: 13px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text);
}
.trello-cal-day:hover:not(.empty) {
  background: var(--primary-light);
}
.trello-cal-day.empty {
  cursor: default;
}
.trello-cal-day.selected {
  background: var(--primary);
  color: white;
  font-weight: 700;
}
.trello-cal-day.today:not(.selected) {
  background: rgba(67, 56, 202, 0.1);
  color: var(--primary);
  font-weight: 600;
}

.trello-picker-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.trello-picker-actions button {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.trello-picker-actions .btn-save {
  background: var(--primary);
  color: white;
}
.trello-picker-actions .btn-save:hover {
  background: var(--primary-dark);
}
.trello-picker-actions .btn-cancel {
  background: rgba(0,0,0,0.06);
  color: var(--text);
}

/* ===== INLINE EDIT FORMS (Todoist-style) ===== */
.task-edit-inline {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.task-edit-inline input[type="text"],
.task-edit-inline textarea {
  width: 100%;
  border: none;
  outline: none;
  font-family: inherit;
  resize: none;
  background: transparent;
}

.task-edit-inline input[type="text"] {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  padding: 4px 0;
}

.task-edit-inline textarea {
  font-size: 14px;
  color: var(--text-light);
  padding: 4px 0;
  min-height: 32px;
  line-height: 1.5;
}

.task-edit-inline textarea::placeholder {
  color: var(--text-light);
  font-style: italic;
}

.task-edit-inline-sep {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

.task-edit-inline-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.task-edit-inline-actions button {
  padding: 6px 16px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.task-edit-inline-actions .btn-edit-cancel {
  background: rgba(0,0,0,0.06);
  color: var(--text);
}
.task-edit-inline-actions .btn-edit-cancel:hover {
  background: rgba(0,0,0,0.12);
}

.task-edit-inline-actions .btn-edit-save {
  background: var(--primary);
  color: white;
}
.task-edit-inline-actions .btn-edit-save:hover {
  background: var(--primary-dark);
}

/* Clickable title/subtask hints for admin */
.task-detail-title.editable {
  cursor: pointer;
  transition: color 0.15s;
}
.task-detail-title.editable:hover {
  color: var(--primary);
}

.task-detail-subtask-info.editable {
  cursor: pointer;
  border-radius: 6px;
  padding: 2px 4px;
  margin: -2px -4px;
  transition: background 0.15s;
}
.task-detail-subtask-info.editable:hover {
  background: rgba(67, 56, 202, 0.04);
}

/* Multiple assignees in task detail */
.task-detail-assignees-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

/* Assignee checklist in modals */
.assignee-checklist {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px;
}

.assignee-check-item {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  font-weight: 400 !important;
  font-size: 14px !important;
  margin-bottom: 0 !important;
}
.assignee-check-item:hover {
  background: var(--bg);
}

.assignee-check-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.assignee-check-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.assignee-check-item span {
  font-size: 14px;
  font-weight: 500;
}

@media (max-width: 768px) {
  .boards-shell { flex-direction: column; }
  .collab-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #334155;
    padding: 10px 12px;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }
  .collab-sidebar-item { font-size: 14px; padding: 8px 10px; }
  .boards-grid { padding: 20px; grid-template-columns: 1fr; }
  .boards-header { padding: 24px 20px 0; }
  .login-container { margin: 20px; padding: 32px 24px; }
  .admin-container { padding: 20px; }
  .kanban-board { padding: 12px; }
  .kanban-column { min-width: 260px; max-width: 260px; }
  .navbar { padding: 0 16px; }
  .card-detail-body { flex-direction: column; }
  .card-detail-sidebar { width: 100%; }
  .card-detail-overlay { padding: 20px 10px; }
  .card-detail-info-row { flex-direction: column; gap: 12px; }
  .card-detail-quick-actions { flex-direction: column; }
  .card-detail-dropdown-host {
    position: static;
    width: 100%;
    margin-top: 6px;
  }
  .card-detail-dropdown-host > .card-detail-inline-dropdown {
    margin-top: 0;
  }
  .todoist-section { padding: 0 20px 20px; }
  .admin-tasks-filters { flex-direction: column; }
}
