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

:root {
  /* Surfaces */
  --bg: #F4F0FA;
  --bg-deep: #EDE7F6;
  --card: #FFFFFF;
  --card-hover: #FBFAFE;
  --subtle: #F8F6FC;
  --border: rgba(20, 16, 31, 0.07);
  --border-strong: rgba(20, 16, 31, 0.14);

  /* Text */
  --text: #15101F;
  --text-secondary: #6B6577;
  --text-tertiary: #9C95AD;

  /* Accent */
  --accent: #6E5BC9;
  --accent-soft: #E8E2FA;
  --accent-deep: #5443A3;

  /* Priorities */
  --high-bg: #FFE0EC;
  --high-fg: #B8395E;
  --high-dot: #E27A99;
  --med-bg:  #E8E2FA;
  --med-fg:  #5443A3;
  --med-dot: #8B7DD0;
  --low-bg:  #DCEFE0;
  --low-fg:  #2D7A4D;
  --low-dot: #6FBC8A;

  /* States */
  --state-todo: #9C95AD;
  --state-progress: #6E5BC9;
  --state-review: #C99A3A;
  --state-done: #6FBC8A;

  /* Effects */
  --radius: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(20, 16, 31, 0.04);
  --shadow:    0 2px 6px rgba(20, 16, 31, 0.04), 0 1px 2px rgba(20, 16, 31, 0.04);
  --shadow-md: 0 8px 24px -4px rgba(85, 67, 163, 0.10), 0 4px 8px -4px rgba(20, 16, 31, 0.04);
  --shadow-lg: 0 20px 50px -10px rgba(85, 67, 163, 0.18), 0 8px 16px -8px rgba(20, 16, 31, 0.06);
}

html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

.app { display: flex; min-height: 100vh; }

/* ============== SIDEBAR ============================== */
.sidebar {
  width: 248px;
  flex-shrink: 0;
  background: white;
  border-right: 1px solid var(--border);
  position: fixed;
  height: 100vh;
  left: 0; top: 0;
  display: flex; flex-direction: column;
  padding: 22px 14px 18px;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; }

/* Project switcher (replaces .brand) */
.project-switcher {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 11px;
  text-align: left;
  margin-bottom: 18px;
  width: 100%;
  cursor: pointer;
  transition: all 0.12s ease;
  font-family: inherit;
}
.project-switcher:hover { background: var(--subtle); border-color: var(--border); }
.project-switcher .brand-text { flex: 1; min-width: 0; }
.project-switcher .brand-name {
  font-size: 13.5px; font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.project-switcher .brand-sub { font-size: 10.5px; color: var(--text-secondary); font-weight: 500; }
.project-switcher .proj-chev { width: 14px; height: 14px; color: var(--text-tertiary); flex-shrink: 0; }
.project-switcher:hover .proj-chev { color: var(--text-secondary); }

.project-menu {
  position: absolute;
  top: 70px; left: 14px;
  width: 220px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 60;
  padding: 6px;
}
.project-menu[hidden] { display: none; }
.project-menu-head {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-tertiary); font-weight: 600;
  padding: 6px 10px 4px;
}
.project-menu-list { display: flex; flex-direction: column; gap: 1px; margin-bottom: 4px; max-height: 240px; overflow-y: auto; }
.project-menu-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 8px;
  border: none; background: transparent;
  font: inherit; font-size: 13px; color: var(--text);
  width: 100%; text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
}
.project-menu-item:hover { background: var(--subtle); }
.project-menu-item.active { background: var(--accent-soft); font-weight: 600; color: var(--accent-deep); }
.project-menu-item .pname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-menu-item .pcount { font-size: 11px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.project-menu-item.active .pcount { color: var(--accent); }
.project-menu-item .pcheck { width: 14px; height: 14px; color: var(--accent); flex-shrink: 0; }

.project-menu-foot {
  border-top: 1px solid var(--border);
  padding-top: 4px;
  display: flex; flex-direction: column; gap: 1px;
}
.project-menu-foot button {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 8px;
  border: none; background: transparent;
  font: inherit; font-size: 13px; color: var(--accent-deep);
  width: 100%; text-align: left;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.12s ease;
}
.project-menu-foot button:hover { background: var(--accent-soft); }
.project-menu-foot button i { width: 13px; height: 13px; }

/* Undo/Redo */
#undo-btn:disabled, #redo-btn:disabled { opacity: 0.35; cursor: not-allowed; }
#undo-btn:not(:disabled):hover, #redo-btn:not(:disabled):hover { background: var(--accent-soft); border-color: var(--accent); }
#undo-btn:not(:disabled):hover i, #redo-btn:not(:disabled):hover i { color: var(--accent-deep); }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px;
  background: linear-gradient(135deg, var(--accent) 0%, #8B7DD0 100%);
  display: grid; place-items: center;
  color: white; font-weight: 700; font-size: 17px;
  box-shadow: 0 6px 14px -4px rgba(110, 91, 201, 0.45);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: -0.015em; }
.brand-sub { font-size: 11px; color: var(--text-secondary); font-weight: 500; }

.search-mini {
  position: relative;
  margin-bottom: 18px;
}
.search-mini input {
  width: 100%;
  padding: 8px 56px 8px 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--subtle);
  font-size: 12.5px;
  outline: none;
  transition: all 0.15s ease;
}
.search-mini input::placeholder { color: var(--text-tertiary); }
.search-mini input:focus { border-color: var(--accent); background: white; box-shadow: 0 0 0 3px rgba(110, 91, 201, 0.12); }
.search-mini i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--text-tertiary); pointer-events: none; }
.search-mini kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-family: inherit; font-size: 10px; font-weight: 500;
  padding: 2px 6px; border-radius: 5px;
  border: 1px solid var(--border); color: var(--text-tertiary);
  background: white;
}
.search-mini .search-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px;
  border: none; background: var(--border-strong);
  color: white;
  border-radius: 50%;
  display: grid; place-items: center;
  cursor: pointer;
  transition: background 0.12s ease;
}
.search-mini .search-clear:hover { background: var(--text-secondary); }
.search-mini .search-clear i { width: 11px; height: 11px; color: white; position: static; transform: none; pointer-events: none; }
.search-mini.has-query input { padding-right: 36px; }

.nav { flex: 1; display: flex; flex-direction: column; gap: 1px; overflow-y: auto; padding-right: 2px; }
.nav::-webkit-scrollbar { width: 4px; }
.nav::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }

.nav-section {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-tertiary); margin: 14px 12px 6px; font-weight: 600;
}

.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 12px; border-radius: 9px;
  color: var(--text-secondary); font-weight: 500; font-size: 13px;
  cursor: pointer; transition: all 0.12s ease;
  position: relative;
}
.nav-item:hover { background: var(--subtle); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-deep); font-weight: 600; }
.nav-item.active i { color: var(--accent); }
.nav-item i { width: 16px; height: 16px; color: var(--text-tertiary); flex-shrink: 0; }
.nav-item.active i { color: var(--accent); }
.nav-item span:not(.nav-count):not(.dot-badge) { flex: 1; }
.nav-count {
  font-size: 11px; font-weight: 600; color: var(--text-tertiary);
  background: var(--bg-deep); padding: 2px 7px; border-radius: 6px;
  font-variant-numeric: tabular-nums;
}
.nav-item.active .nav-count { background: white; color: var(--accent); }
.dot-badge { width: 6px; height: 6px; border-radius: 50%; background: var(--high-dot); }

.bloco-list { display: flex; flex-direction: column; gap: 1px; }
.bloco-item {
  display: flex; align-items: center; gap: 11px;
  padding: 7px 12px; border-radius: 9px;
  color: var(--text-secondary); font-weight: 500; font-size: 13px;
  cursor: pointer; transition: all 0.12s ease;
}
.bloco-item:hover { background: var(--subtle); color: var(--text); }
.bloco-item.active { background: var(--subtle); color: var(--text); font-weight: 600; }
.bloco-dot { width: 8px; height: 8px; border-radius: 3px; flex-shrink: 0; }
.bloco-item span:first-of-type { flex: 1; }
.bloco-count { font-size: 11px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }

.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 8px;
  border-top: 1px solid var(--border);
  margin-top: 12px;
}
.user-meta { flex: 1; min-width: 0; line-height: 1.15; }
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11.5px; color: var(--text-secondary); }

/* Avatars ---------------------------------------------------- */
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  color: white; font-weight: 600; font-size: 11px;
  flex-shrink: 0;
  background: var(--accent);
}
.avatar.avatar-sm { width: 22px; height: 22px; font-size: 10px; }
.avatar.avatar-md { width: 32px; height: 32px; font-size: 12px; }
.avatar.avatar-lg { width: 40px; height: 40px; font-size: 14px; }

/* ============== MAIN / TOPBAR ======================== */
.main { flex: 1; margin-left: 248px; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 64px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
}

.bcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary); }
.bcrumb-item.active { color: var(--text); font-weight: 600; }
.bcrumb i { width: 12px; height: 12px; opacity: 0.5; }
.bcrumb-project {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: 13px; font-weight: 600;
  color: var(--text);
  background: transparent; border: 1px solid transparent;
  border-radius: 8px;
  padding: 4px 8px;
  cursor: pointer;
  transition: all 0.12s ease;
  max-width: 280px;
}
.bcrumb-project:hover { background: var(--subtle); border-color: var(--border); }
.bcrumb-project span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 240px;
}
.bcrumb-chev { width: 13px; height: 13px; opacity: 0.6; flex-shrink: 0; }

.topbar-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }

.view-toggle {
  display: flex; gap: 2px; padding: 3px;
  background: var(--subtle); border: 1px solid var(--border);
  border-radius: 10px;
}
.view-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 7px;
  border: none; background: transparent;
  font-size: 12.5px; font-weight: 500; color: var(--text-secondary);
  transition: all 0.15s ease;
}
.view-btn:hover { color: var(--text); }
.view-btn.active { background: white; color: var(--text); box-shadow: var(--shadow-sm); font-weight: 600; }
.view-btn i { width: 13px; height: 13px; }

.topbar-divider { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px;
  border-radius: 10px; border: 1px solid transparent;
  background: transparent;
  transition: all 0.15s ease;
}
.icon-btn:hover { background: var(--subtle); border-color: var(--border); }
.icon-btn i { width: 16px; height: 16px; color: var(--text-secondary); }
.icon-btn.ghost { border: none; background: transparent; }
.icon-btn.ghost:hover { background: var(--subtle); }

/* Buttons --------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: white;
  font-size: 13px; font-weight: 500; color: var(--text);
  transition: all 0.15s ease;
}
.btn:hover { background: var(--subtle); }
.btn i { width: 14px; height: 14px; }
.btn.btn-primary {
  background: var(--accent); color: white; border-color: var(--accent);
  box-shadow: 0 4px 12px -4px rgba(110, 91, 201, 0.45);
}
.btn.btn-primary:hover { background: var(--accent-deep); }
.btn.ghost { border-color: transparent; color: var(--text-secondary); }
.btn.ghost:hover { background: var(--subtle); color: var(--text); border-color: var(--border); }

/* ============== CONTENT LAYOUT ======================= */
.content {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 460px;
  gap: 0;
  min-height: 0;
}

/* ============== TASKS AREA ============================ */
.tasks-area { padding: 28px 28px 48px; overflow-y: auto; }

.tasks-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.tasks-title { font-size: 24px; font-weight: 700; letter-spacing: -0.025em; }
.tasks-sub { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

.filters {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 999px;
  border: 1px solid var(--border); background: white;
  font-size: 12.5px; font-weight: 500; color: var(--text-secondary);
  transition: all 0.15s ease;
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.active { background: var(--text); color: white; border-color: var(--text); }
.chip.ghost { border: none; background: transparent; }
.chip.ghost:hover { background: var(--subtle); border: 1px solid var(--border); }
.chip i { width: 13px; height: 13px; }
.filters-spacer { flex: 1; }

/* Project filter dropdown chip */
.chip-dropdown { position: relative; display: inline-block; }
.chip-dropdown .chip { cursor: pointer; }
.chip-dropdown .chip-chev { width: 13px; height: 13px; opacity: 0.7; }
.chip-dropdown .dropdown-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 220px; max-width: 320px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
  padding: 6px;
  z-index: 100;
  max-height: 320px; overflow-y: auto;
}
.chip-dropdown .dropdown-item {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; border-radius: 8px; border: none; background: transparent;
  text-align: left; font-size: 13px; color: var(--text); cursor: pointer;
  transition: background 0.12s ease;
}
.chip-dropdown .dropdown-item:hover { background: var(--subtle); }
.chip-dropdown .dropdown-item.active { background: var(--subtle); font-weight: 600; }
.chip-dropdown .dropdown-count {
  font-size: 11px; color: var(--text-tertiary); font-weight: 500;
  padding: 1px 7px; border-radius: 999px; background: var(--subtle);
}
.chip-dropdown .dropdown-item.active .dropdown-count { background: white; }

/* Empty state when filters yield 0 tasks */
.filters-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px;
  padding: 56px 24px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  background: white;
  color: var(--text-secondary);
  text-align: center;
}
.filters-empty i { width: 28px; height: 28px; color: var(--text-tertiary); }
.filters-empty-title { font-size: 15px; font-weight: 600; color: var(--text); }
.filters-empty-sub { font-size: 13px; color: var(--text-secondary); max-width: 380px; }
.filters-empty .btn { margin-top: 4px; }

/* Task sections + cards ------------------------------------ */
.tasks-list { display: flex; flex-direction: column; gap: 28px; }

.section { display: flex; flex-direction: column; gap: 8px; }
.section-head {
  display: flex; align-items: center; gap: 10px;
  padding: 0 4px 6px;
}
.section-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.section-dot.todo { background: var(--state-todo); }
.section-dot.progress { background: var(--state-progress); }
.section-dot.review { background: var(--state-review); }
.section-dot.done { background: var(--state-done); }
.section-title { font-size: 13px; font-weight: 600; letter-spacing: -0.005em; }
.section-count {
  font-size: 11px; font-weight: 600; color: var(--text-tertiary);
  background: var(--bg-deep); padding: 2px 8px; border-radius: 6px;
  font-variant-numeric: tabular-nums;
}
.section-spacer { flex: 1; }
.section-add {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 8px; border-radius: 6px;
  background: transparent; border: none;
  color: var(--text-tertiary); font-size: 12px; font-weight: 500;
  transition: all 0.15s ease;
}
.section-add:hover { background: var(--subtle); color: var(--text); }
.section-add i { width: 12px; height: 12px; }

.task-card {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.task-card:hover { background: var(--card-hover); border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.task-card.selected { border-color: var(--accent); background: white; box-shadow: 0 0 0 3px rgba(110, 91, 201, 0.10), var(--shadow-sm); }

.task-priority-dot { width: 10px; height: 10px; border-radius: 50%; }

.task-body { min-width: 0; }
.task-title-line {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 4px;
}
.task-title-text {
  font-size: 13.5px; font-weight: 500; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1; min-width: 0;
}
.task-card.completed .task-title-text { color: var(--text-secondary); text-decoration: line-through; }
.task-id {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px; color: var(--text-tertiary);
  font-weight: 600;
  flex-shrink: 0;
}
.task-meta-line {
  display: flex; align-items: center; gap: 12px;
  font-size: 11.5px; color: var(--text-tertiary);
  flex-wrap: wrap;
}
.task-meta-item { display: inline-flex; align-items: center; gap: 4px; }
.task-meta-item i { width: 11px; height: 11px; }

.bloco-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 6px;
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.02em;
}
.bloco-pill .bloco-pill-dot { width: 6px; height: 6px; border-radius: 50%; }

.task-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.priority-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.02em;
}
.priority-pill .priority-dot { width: 6px; height: 6px; border-radius: 50%; }
.priority-pill.high {   background: var(--high-bg); color: var(--high-fg); }
.priority-pill.medium { background: var(--med-bg);  color: var(--med-fg);  }
.priority-pill.low {    background: var(--low-bg);  color: var(--low-fg);  }
.priority-pill.high   .priority-dot { background: var(--high-dot); }
.priority-pill.medium .priority-dot { background: var(--med-dot);  }
.priority-pill.low    .priority-dot { background: var(--low-dot);  }

/* ============== DETAIL PANEL ========================= */
.detail-panel {
  background: white;
  border-left: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.detail-empty {
  flex: 1;
  display: grid; place-items: center;
  padding: 32px;
  text-align: center;
  color: var(--text-secondary);
}
.detail-empty i { width: 32px; height: 32px; opacity: 0.3; margin-bottom: 12px; }

.detail-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(10px);
  z-index: 5;
}
.detail-head-left { display: flex; align-items: center; gap: 10px; }
.detail-head-right { display: flex; gap: 4px; }

.detail-content { padding: 22px 24px 36px; display: flex; flex-direction: column; gap: 22px; }
.detail-title { font-size: 22px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.25; }

.meta-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12px;
}
.meta-row .meta-item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 8px;
  background: var(--subtle); border: 1px solid var(--border);
  color: var(--text-secondary); font-weight: 500;
}
.meta-row .meta-item i { width: 12px; height: 12px; }
.meta-row .owner-chip { padding: 4px 10px 4px 4px; }

/* Time tracker */
.time-tracker {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--accent-soft) 0%, #F4EFFA 100%);
  border: 1px solid rgba(110, 91, 201, 0.2);
  border-radius: 14px;
  transition: all 0.2s ease;
}
.time-tracker.running {
  background: linear-gradient(135deg, var(--low-bg) 0%, #E5F2EA 100%);
  border-color: rgba(34, 197, 94, 0.28);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.06);
}
.time-tracker .play-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent); color: white;
  border: none;
  display: grid; place-items: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px -4px rgba(110, 91, 201, 0.5);
  transition: all 0.15s ease;
}
.time-tracker .play-btn:hover { background: var(--accent-deep); transform: scale(1.05); }
.time-tracker .play-btn:active { transform: scale(0.95); }
.time-tracker .play-btn i { width: 18px; height: 18px; }
.time-tracker.running .play-btn {
  background: var(--low-fg);
  box-shadow: 0 4px 12px -4px rgba(45, 122, 77, 0.5);
}
.time-tracker.running .play-btn:hover { background: #1F5C39; }
.time-tracker-info { flex: 1; min-width: 0; }
.time-tracker-info .label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--accent-deep); font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
}
.time-tracker.running .label { color: var(--low-fg); }
.time-tracker.running .label::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--low-fg);
  animation: pulse-dot 1.4s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.8); }
}
.time-tracker-info .value {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 22px; font-weight: 600; color: var(--text);
  letter-spacing: -0.01em; line-height: 1.1; margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.time-tracker.running .value { color: var(--low-fg); }
.time-tracker-info .sub { font-size: 11.5px; color: var(--text-secondary); margin-top: 2px; }
.time-tracker .reset-btn { color: var(--text-tertiary); }
.time-tracker .reset-btn:hover { color: var(--high-fg); background: rgba(184, 57, 94, 0.08); }

/* Drag and drop ------------------------------------------ */
.task-card[draggable="true"],
.kanban-card[draggable="true"],
.cal-task[draggable="true"] { cursor: grab; }
.task-card[draggable="true"]:active,
.kanban-card[draggable="true"]:active,
.cal-task[draggable="true"]:active { cursor: grabbing; }
.task-card.dragging,
.kanban-card.dragging,
.cal-task.dragging {
  opacity: 0.35;
  cursor: grabbing;
}

.section.drag-over {
  outline: 2px dashed var(--accent);
  outline-offset: 4px;
  border-radius: 12px;
}
.kanban-col.drag-over {
  background: var(--accent-soft);
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
}
.calendar-day.drop-target {
  background: var(--accent-soft) !important;
  z-index: 1;
}
.calendar-day.drop-target::after {
  content: ""; position: absolute; inset: 0;
  border: 2px dashed var(--accent);
  pointer-events: none;
}

/* Detail sections */
.detail-section h4 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-tertiary); font-weight: 600;
  margin-bottom: 10px;
}
.detail-section .section-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.detail-section .section-progress {
  font-size: 11px; font-weight: 500; color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.detail-desc { font-size: 13.5px; color: var(--text); line-height: 1.6; }

/* Subtasks */
.subtasks { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.subtask {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  font-size: 13px; color: var(--text);
  cursor: pointer;
  transition: background 0.12s ease;
}
.subtask:hover { background: var(--subtle); }
.subtask input[type="checkbox"] {
  appearance: none;
  width: 16px; height: 16px; border-radius: 5px;
  border: 1.5px solid var(--border-strong); background: white;
  flex-shrink: 0; margin-top: 1px; cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
}
.subtask input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
.subtask input[type="checkbox"]:checked::after {
  content: ""; position: absolute; left: 4px; top: 1px;
  width: 5px; height: 9px; border: 2px solid white; border-top: 0; border-left: 0;
  transform: rotate(45deg);
}
.subtask span { flex: 1; line-height: 1.45; }
.subtask.done span { color: var(--text-tertiary); text-decoration: line-through; }

/* Attachments */
.attachments { display: flex; flex-direction: column; gap: 8px; }
.attachment {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--subtle); border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer; transition: all 0.15s ease;
}
.attachment:hover { background: var(--card-hover); border-color: var(--border-strong); }
.attachment-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: white; border: 1px solid var(--border);
  display: grid; place-items: center;
  color: var(--text-secondary);
}
.attachment-icon i { width: 14px; height: 14px; }
.attachment-info { flex: 1; min-width: 0; }
.attachment-name { font-size: 13px; font-weight: 500; }
.attachment-meta { font-size: 11px; color: var(--text-tertiary); }
.attachment-action { color: var(--text-tertiary); }
.attachment-action i { width: 14px; height: 14px; }

/* Resources / dependencies */
.link-list { display: flex; flex-direction: column; gap: 6px; }
.link-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 8px;
  background: var(--subtle); border: 1px solid var(--border);
  font-size: 12.5px; color: var(--text); line-height: 1.45;
  transition: all 0.15s ease;
}
.link-item:hover { border-color: var(--border-strong); background: var(--card-hover); }
.link-item i { width: 13px; height: 13px; color: var(--text-tertiary); flex-shrink: 0; }

/* Tabs */
.tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
  margin-top: 4px;
}
.tab {
  padding: 10px 14px;
  font-size: 12.5px; font-weight: 500;
  color: var(--text-secondary);
  border: none; background: transparent;
  position: relative;
  transition: color 0.15s ease;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); font-weight: 600; }
.tab.active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px;
  height: 2px; background: var(--accent); border-radius: 2px;
}
.tab-count {
  display: inline-block; margin-left: 5px;
  font-size: 10.5px; font-weight: 600;
  background: var(--bg-deep); color: var(--text-secondary);
  padding: 1px 6px; border-radius: 5px;
}
.tab.active .tab-count { background: var(--accent-soft); color: var(--accent-deep); }

.tab-panel { padding-top: 14px; }

/* Comments */
.comment-input {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--subtle);
  margin-bottom: 14px;
  transition: all 0.15s ease;
}
.comment-input:focus-within { border-color: var(--accent); background: white; }
.comment-input input {
  flex: 1; border: none; background: transparent; outline: none;
  font-size: 13px;
}
.comment-input button {
  border: none; background: var(--accent); color: white;
  padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 600;
}
.comment-input button:disabled { opacity: 0.4; cursor: not-allowed; }

.comments { display: flex; flex-direction: column; gap: 14px; }
.comment {
  display: flex; gap: 10px; align-items: flex-start;
}
.comment-body { flex: 1; min-width: 0; }
.comment-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; margin-bottom: 3px;
}
.comment-author { font-weight: 600; color: var(--text); }
.comment-when { color: var(--text-tertiary); font-size: 11.5px; }
.comment-text { font-size: 13px; color: var(--text); line-height: 1.5; }

/* Activity */
.activity-list { display: flex; flex-direction: column; gap: 10px; }
.activity-item {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 12.5px; color: var(--text-secondary);
}
.activity-item .avatar { width: 22px; height: 22px; font-size: 10px; }
.activity-item strong { color: var(--text); font-weight: 600; }

/* Empty placeholder */
.empty {
  text-align: center; padding: 28px;
  color: var(--text-tertiary); font-size: 12.5px;
}

/* ============== CALENDAR VIEW ======================== */
.calendar-view { display: flex; flex-direction: column; gap: 14px; }

.calendar-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 4px; gap: 12px; flex-wrap: wrap;
}
.calendar-nav { display: flex; align-items: center; gap: 6px; }
.calendar-nav .icon-btn { width: 32px; height: 32px; border: 1px solid var(--border); background: white; }
.calendar-title {
  font-size: 17px; font-weight: 600;
  min-width: 160px; text-align: center;
  text-transform: capitalize;
  letter-spacing: -0.01em;
  margin: 0 4px;
}
.calendar-meta {
  font-size: 12px; color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.calendar-nav .btn { padding: 6px 12px; font-size: 12.5px; }
.calendar-nav .btn i { width: 12px; height: 12px; }

.calendar-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 14px 14px 0 0;
  overflow: hidden;
}
.calendar-weekdays > div {
  background: var(--subtle);
  padding: 9px 12px;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-secondary); font-weight: 600;
}

.calendar-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 14px 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.calendar-day {
  background: white;
  aspect-ratio: 1 / 1;
  min-height: 90px;
  padding: 8px 10px 10px;
  display: flex; flex-direction: column; gap: 5px;
  position: relative;
  overflow: hidden;
}
.calendar-day.outside { background: var(--subtle); opacity: 0.55; }
.calendar-day.outside .day-num { color: var(--text-tertiary); }
.calendar-day.today { background: var(--accent-soft); }
.calendar-day.expanded { aspect-ratio: auto; overflow: visible; }
.calendar-day.weekend { background: #FBFAFC; }
.calendar-day.weekend.outside { background: var(--subtle); }
.calendar-day.weekend.today { background: var(--accent-soft); }
.calendar-day .day-tasks { overflow: hidden; min-width: 0; }

@media (max-width: 768px) {
  .calendar-day { aspect-ratio: auto; min-height: 100px; }
}

.day-num {
  font-size: 12.5px; font-weight: 600;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  display: flex; align-items: center; gap: 6px;
}
.calendar-day.today .day-num { color: var(--accent-deep); font-weight: 700; }
.today-badge {
  font-size: 9px; font-weight: 700;
  background: var(--accent); color: white;
  padding: 1px 6px; border-radius: 5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.day-tasks { display: flex; flex-direction: column; gap: 3px; min-width: 0; }

.cal-task {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 7px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 11px; font-weight: 500;
  cursor: pointer;
  text-align: left;
  width: 100%;
  min-width: 0;
  transition: all 0.15s ease;
}
.cal-task:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.cal-task.selected { box-shadow: 0 0 0 2px rgba(110, 91, 201, 0.32); }
.cal-task-dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.cal-task-text {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1; min-width: 0;
}

.cal-more {
  font-size: 10.5px; color: var(--text-secondary);
  background: transparent; border: none;
  padding: 2px 7px;
  border-radius: 5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
  align-self: flex-start;
}
.cal-more:hover { background: var(--subtle); color: var(--text); }

/* ============== KANBAN VIEW ========================== */
.kanban-view {
  display: grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.kanban-col {
  background: var(--bg-deep);
  border-radius: 14px;
  padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 200px;
}
.kanban-col-head {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 6px 8px;
}
.kanban-col-head .section-title { font-size: 12.5px; }
.kanban-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex; flex-direction: column; gap: 8px;
}
.kanban-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.kanban-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(110, 91, 201, 0.15); }
.kanban-card-title { font-size: 13px; font-weight: 500; line-height: 1.35; }
.kanban-card-foot {
  display: flex; align-items: center; gap: 8px; justify-content: space-between;
  font-size: 11px; color: var(--text-tertiary);
}

/* ============== EDITABLE FIELDS ====================== */
.edit-input,
.edit-textarea {
  font-family: inherit; color: inherit;
  background: transparent; border: 1px solid transparent;
  border-radius: 8px;
  outline: none;
  width: 100%;
  padding: 5px 9px; margin: -5px -9px;
  transition: all 0.12s ease;
}
.edit-input:hover, .edit-textarea:hover { background: var(--subtle); }
.edit-input:focus, .edit-textarea:focus {
  background: white; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(110, 91, 201, 0.10);
}
.edit-textarea { resize: none; line-height: 1.55; min-height: 50px; }

.edit-title {
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.025em; line-height: 1.25;
  padding: 6px 10px; margin: -6px -10px;
}

.edit-desc {
  font-size: 13.5px; line-height: 1.6;
  min-height: 180px;
  max-height: 320px;
  overflow-y: scroll;
  resize: vertical;
}
/* Always-visible scrollbar inside the description textarea */
.edit-desc::-webkit-scrollbar { width: 10px; }
.edit-desc::-webkit-scrollbar-track {
  background: var(--subtle);
  border-radius: 0 8px 8px 0;
}
.edit-desc::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 6px;
  border: 2px solid var(--subtle);
}
.edit-desc::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }
/* Firefox always-show */
.edit-desc { scrollbar-width: thin; scrollbar-color: var(--border-strong) var(--subtle); }

.edit-effort {
  font-size: 12px; font-weight: 500; color: var(--text-secondary);
  display: inline-block; width: auto; min-width: 80px;
  padding: 2px 6px; margin: 0;
}

.edit-notes {
  font-size: 13.5px; line-height: 1.55; font-style: italic;
  background: var(--accent-soft);
  border-radius: 12px; padding: 12px 14px;
  border: 1px solid transparent;
  width: 100%;
}
.edit-notes:hover { background: #E0D9F8; }
.edit-notes:focus { background: white; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(110, 91, 201, 0.10); }

/* Meta selects (state, priority, bloco, assignee) */
.meta-select {
  appearance: none; -webkit-appearance: none;
  font-family: inherit;
  background: var(--subtle) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%236B6577' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>") no-repeat right 8px center;
  background-size: 10px;
  border: 1px solid var(--border);
  padding: 5px 24px 5px 10px;
  border-radius: 8px;
  font-size: 12px; font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  outline: none;
  transition: all 0.12s ease;
}
.meta-select:hover { background-color: white; border-color: var(--border-strong); color: var(--text); }
.meta-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(110, 91, 201, 0.12); }

.meta-select.priority-high   { background-color: var(--high-bg); color: var(--high-fg); border-color: transparent; }
.meta-select.priority-medium { background-color: var(--med-bg);  color: var(--med-fg);  border-color: transparent; }
.meta-select.priority-low    { background-color: var(--low-bg);  color: var(--low-fg);  border-color: transparent; }

.meta-input[type="date"] {
  appearance: none; -webkit-appearance: none;
  font-family: inherit;
  background: var(--subtle);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px; font-weight: 500;
  color: var(--text-secondary);
  outline: none;
  transition: all 0.12s ease;
}
.meta-input[type="date"]:hover { background: white; color: var(--text); }
.meta-input[type="date"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(110, 91, 201, 0.12); }

/* Editable subtasks */
.subtask-edit { flex: 1; }
.subtask .subtask-text-input {
  font-family: inherit; font-size: 13px; color: inherit;
  border: 1px solid transparent; background: transparent;
  border-radius: 6px; outline: none;
  padding: 3px 6px; margin: -3px -6px;
  width: 100%;
}
.subtask .subtask-text-input:hover { background: var(--subtle); }
.subtask .subtask-text-input:focus { background: white; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(110, 91, 201, 0.12); }
.subtask.done .subtask-text-input { color: var(--text-tertiary); text-decoration: line-through; }

.subtask-remove {
  opacity: 0;
  background: transparent; border: none;
  color: var(--text-tertiary);
  padding: 4px;
  border-radius: 6px;
  transition: all 0.12s ease;
  flex-shrink: 0;
}
.subtask:hover .subtask-remove { opacity: 1; }
.subtask-remove:hover { background: var(--high-bg); color: var(--high-fg); }
.subtask-remove i { width: 12px; height: 12px; }

.subtask-add {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  background: transparent;
  border: 1px dashed var(--border-strong);
  margin-top: 4px;
}
.subtask-add input {
  flex: 1;
  border: none; background: transparent;
  font-size: 13px; outline: none;
  color: inherit;
}
.subtask-add i { width: 14px; height: 14px; color: var(--text-tertiary); }

/* Editable list (resources / dependencies) */
.link-list .link-item {
  position: relative;
  padding-right: 36px;
}
.link-list .link-item input {
  flex: 1;
  border: none; background: transparent;
  font-family: inherit; font-size: 12.5px; color: inherit;
  outline: none;
  padding: 3px 4px;
}
.link-list .link-item:hover input { background: white; border-radius: 5px; }
.link-list .link-item input:focus { background: white; box-shadow: 0 0 0 2px rgba(110, 91, 201, 0.12); border-radius: 5px; }
.link-remove {
  position: absolute; right: 8px;
  background: transparent; border: none;
  color: var(--text-tertiary);
  padding: 3px;
  border-radius: 5px;
  opacity: 0;
  transition: all 0.12s ease;
}
.link-list .link-item:hover .link-remove { opacity: 1; }
.link-remove:hover { background: var(--high-bg); color: var(--high-fg); }
.link-remove i { width: 12px; height: 12px; }
.link-list .link-add {
  border: 1px dashed var(--border-strong);
  background: transparent;
}

/* Detail action bar */
.detail-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding-top: 12px; margin-top: 8px;
  border-top: 1px solid var(--border);
}
.btn.danger { color: var(--high-fg); }
.btn.danger:hover { background: var(--high-bg); border-color: var(--high-fg); }

/* ============== MODAL ================================ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(20, 16, 31, 0.45);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: white; border-radius: 18px;
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 600px;
  max-height: calc(100vh - 40px);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.modal-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}
.modal-head h3 { font-size: 17px; font-weight: 700; letter-spacing: -0.015em; }
.modal-sub { font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; line-height: 1.5; }
.modal-body { padding: 18px 22px; overflow-y: auto; flex: 1; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: var(--subtle);
}
.modal-body textarea {
  width: 100%;
  min-height: 220px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px; line-height: 1.5;
  border: 1px solid var(--border);
  background: var(--subtle);
  border-radius: 10px;
  padding: 12px 14px;
  outline: none;
  resize: vertical;
  color: var(--text);
}
.modal-body textarea:focus { border-color: var(--accent); background: white; box-shadow: 0 0 0 3px rgba(110, 91, 201, 0.12); }
.import-preview {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--subtle);
  border: 1px solid var(--border);
  font-size: 12.5px;
}
.import-preview .hint { color: var(--text-tertiary); }
.import-preview.valid { background: var(--low-bg); border-color: rgba(45, 122, 77, 0.2); color: var(--low-fg); }
.import-preview.error { background: var(--high-bg); border-color: rgba(184, 57, 94, 0.2); color: var(--high-fg); }
.import-preview ul { margin: 6px 0 0 16px; }
.import-preview li { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11.5px; line-height: 1.6; }

/* ============== SETTINGS MODAL ======================= */
.modal.modal-large { max-width: 760px; height: 580px; }
.settings-body { display: grid; grid-template-columns: 200px 1fr; flex: 1; min-height: 0; }
.settings-nav {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 10px;
  border-right: 1px solid var(--border);
  background: var(--subtle);
}
.settings-tab {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border: none; background: transparent;
  font: inherit; font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  transition: all 0.12s ease;
}
.settings-tab:hover { background: white; color: var(--text); }
.settings-tab.active { background: white; color: var(--accent-deep); font-weight: 600; box-shadow: var(--shadow-sm); }
.settings-tab i { width: 15px; height: 15px; }

.settings-content { padding: 22px 24px; overflow-y: auto; }
.settings-content h4 { font-size: 15px; font-weight: 600; letter-spacing: -0.005em; margin-bottom: 4px; }
.settings-hint { font-size: 12.5px; color: var(--text-secondary); margin-bottom: 16px; line-height: 1.5; }

.settings-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.settings-row {
  display: grid; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--subtle); border: 1px solid var(--border);
  border-radius: 12px;
  transition: background 0.12s ease;
}
.settings-row:hover { background: white; border-color: var(--border-strong); }
.settings-row.bloco-row { grid-template-columns: 28px 36px 1fr 80px auto; }
.settings-row.member-row { grid-template-columns: 36px 1fr 1fr 80px auto; }

.settings-row .settings-key {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px; font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
}
.settings-row input[type="text"] {
  border: 1px solid transparent; background: transparent;
  font: inherit; font-size: 13px; color: inherit;
  padding: 5px 8px; border-radius: 6px; outline: none;
  width: 100%;
  transition: all 0.12s ease;
}
.settings-row input[type="text"]:focus {
  background: white; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(110, 91, 201, 0.10);
}
.settings-row input[type="color"] {
  appearance: none; -webkit-appearance: none;
  width: 36px; height: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  padding: 0;
  overflow: hidden;
}
.settings-row input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
.settings-row input[type="color"]::-webkit-color-swatch { border: none; border-radius: 5px; }
.settings-row .task-count {
  font-size: 11px; font-weight: 500; color: var(--text-tertiary);
  text-align: center;
}
.settings-row .icon-btn:hover { background: var(--high-bg); color: var(--high-fg); }
.settings-row .icon-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.settings-section + .settings-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }

.settings-data-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--subtle); border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 10px;
}
.settings-data-card .info { flex: 1; min-width: 0; }
.settings-data-card .title { font-size: 13.5px; font-weight: 600; }
.settings-data-card .desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; line-height: 1.45; }

.storage-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin-bottom: 12px;
}
.storage-stat {
  background: var(--subtle); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px;
}
.storage-stat .stat-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-secondary); font-weight: 600; }
.storage-stat .stat-value {
  font-size: 18px; font-weight: 700; letter-spacing: -0.015em;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

/* ============== FILE ATTACHMENTS ===================== */
.attachments-area { display: flex; flex-direction: column; gap: 10px; }
.attachments-empty {
  text-align: center; padding: 24px;
  color: var(--text-tertiary); font-size: 12.5px;
  border: 1px dashed var(--border-strong); border-radius: 12px;
}
.attachments-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 0;
}
.attachments-hint { font-size: 11.5px; color: var(--text-tertiary); }
.attachment .download-btn,
.attachment .remove-btn {
  width: 28px; height: 28px; border-radius: 7px;
  display: grid; place-items: center;
  background: transparent; border: 1px solid transparent;
  color: var(--text-secondary);
  transition: all 0.12s ease;
  cursor: pointer;
}
.attachment .download-btn:hover { background: var(--accent-soft); color: var(--accent-deep); border-color: var(--accent); }
.attachment .remove-btn:hover { background: var(--high-bg); color: var(--high-fg); border-color: var(--high-fg); }
.attachment .remove-btn i,
.attachment .download-btn i { width: 13px; height: 13px; }

.attachment-thumb {
  width: 32px; height: 32px; border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
}

/* ============== ANALYTICS PAGE ======================== */
.analytics-view { display: flex; flex-direction: column; gap: 20px; }

.analytics-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.analytics-kpi {
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
}
.analytics-kpi .kpi-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-secondary); font-weight: 600;
}
.analytics-kpi .kpi-value {
  font-size: 24px; font-weight: 700; letter-spacing: -0.025em;
  margin-top: 6px; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.analytics-kpi .kpi-sub {
  font-size: 11.5px; color: var(--text-secondary); margin-top: 4px;
}
.analytics-kpi .kpi-icon {
  width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center;
  margin-bottom: 8px;
}

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

.analytics-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
}
.analytics-card h3 {
  font-size: 14px; font-weight: 600; letter-spacing: -0.005em;
  margin-bottom: 4px;
}
.analytics-card .card-sub {
  font-size: 12px; color: var(--text-secondary); margin-bottom: 14px;
}

/* CSS bar list */
.bar-list { display: flex; flex-direction: column; gap: 12px; }
.bar-row {
  display: grid; grid-template-columns: 130px 1fr 90px;
  align-items: center; gap: 12px;
  font-size: 12.5px;
}
.bar-label {
  display: flex; align-items: center; gap: 8px;
  font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bar-label .lbl-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.bar-track {
  background: var(--subtle);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  position: relative;
}
.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.4s cubic-bezier(.25,.8,.25,1);
}
.bar-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600; color: var(--text);
}
.bar-value .bar-pct { color: var(--text-tertiary); font-weight: 500; margin-left: 4px; font-size: 11px; }

/* Top tasks list */
.top-tasks { display: flex; flex-direction: column; gap: 10px; }
.top-task {
  display: grid; grid-template-columns: 30px 1fr auto auto; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: var(--subtle); border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.12s ease;
}
.top-task:hover { background: white; border-color: var(--border-strong); }
.top-task .rank {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px; color: var(--text-tertiary); font-weight: 700;
  text-align: center;
}
.top-task .title { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-task .time { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ============== MEETING MODAL ======================== */
.meeting-tabs {
  display: flex; gap: 4px; padding: 4px;
  background: var(--subtle); border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 18px;
  width: fit-content;
}
.meeting-tab {
  padding: 7px 14px; border-radius: 7px;
  border: none; background: transparent;
  font: inherit; font-size: 12.5px; font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all 0.15s ease;
}
.meeting-tab:hover { color: var(--text); }
.meeting-tab.active { background: white; color: var(--text); box-shadow: var(--shadow-sm); font-weight: 600; }
.meeting-tab i { width: 13px; height: 13px; }

.recorder {
  display: flex; flex-direction: column; gap: 14px;
}
.recorder-controls {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--subtle);
  border: 1px solid var(--border);
}
.recorder-controls.recording {
  background: linear-gradient(135deg, rgba(184, 57, 94, 0.06) 0%, rgba(255, 224, 236, 0.4) 100%);
  border-color: rgba(184, 57, 94, 0.2);
}
.rec-btn {
  width: 48px; height: 48px; border-radius: 50%;
  border: none;
  background: var(--high-fg); color: white;
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 14px -4px rgba(184, 57, 94, 0.5);
  transition: all 0.15s ease;
}
.rec-btn:hover { transform: scale(1.05); }
.rec-btn:active { transform: scale(0.95); }
.rec-btn i { width: 20px; height: 20px; }
.rec-btn.idle { background: var(--accent); box-shadow: 0 4px 14px -4px rgba(110, 91, 201, 0.5); }
.rec-btn.idle:hover { background: var(--accent-deep); }

.rec-info { flex: 1; min-width: 0; }
.rec-status {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-secondary); font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
}
.recorder-controls.recording .rec-status { color: var(--high-fg); }
.recorder-controls.recording .rec-status::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--high-fg);
  animation: pulse-dot 1.4s ease-in-out infinite;
}
.rec-time {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 22px; font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.rec-hint { font-size: 11.5px; color: var(--text-secondary); margin-top: 2px; }

.transcript-area {
  border: 1px solid var(--border); background: white;
  border-radius: 12px;
  padding: 14px 16px;
  min-height: 200px; max-height: 320px;
  overflow-y: auto;
  font-size: 13px; line-height: 1.55;
}
.transcript-area:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(110, 91, 201, 0.10); }
.transcript-area .interim { color: var(--text-tertiary); font-style: italic; }
.transcript-area:empty::before {
  content: "A transcrição vai aparecer aqui em tempo real…";
  color: var(--text-tertiary);
  font-style: italic;
}

.transcript-paste {
  display: flex; flex-direction: column; gap: 10px;
}
.transcript-paste textarea {
  width: 100%; min-height: 220px;
  padding: 12px 14px;
  border: 1px solid var(--border); background: var(--subtle);
  border-radius: 12px;
  font: inherit; font-size: 13px; line-height: 1.55;
  outline: none; resize: vertical;
  color: var(--text);
}
.transcript-paste textarea:focus { border-color: var(--accent); background: white; box-shadow: 0 0 0 3px rgba(110, 91, 201, 0.10); }
.transcript-paste-actions { display: flex; gap: 10px; align-items: center; }
.transcript-paste .hint { font-size: 11.5px; color: var(--text-tertiary); }

.meeting-status-card {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid rgba(110, 91, 201, 0.2);
  margin-bottom: 14px;
}
.meeting-status-card .icon-bg {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: white;
  flex-shrink: 0;
}
.meeting-status-card .title { font-size: 13.5px; font-weight: 600; color: var(--accent-deep); }
.meeting-status-card .text { font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; line-height: 1.5; }

.meeting-loading {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 60px 20px;
  text-align: center;
}
.meeting-loading .spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin-animation 0.8s linear infinite;
}
@keyframes spin-animation { to { transform: rotate(360deg); } }
.meeting-loading .label { font-size: 14px; font-weight: 500; }
.meeting-loading .sub { font-size: 12px; color: var(--text-secondary); }

.meeting-error {
  padding: 14px 16px; border-radius: 12px;
  background: var(--high-bg); color: var(--high-fg);
  border: 1px solid rgba(184, 57, 94, 0.2);
  font-size: 12.5px; line-height: 1.5;
}

/* Review UI */
.review-summary {
  padding: 14px 16px; border-radius: 12px;
  background: var(--subtle); border: 1px solid var(--border);
  font-size: 13px; line-height: 1.55;
  margin-bottom: 18px;
  display: flex; gap: 12px; align-items: flex-start;
}
.review-summary i { width: 16px; height: 16px; color: var(--accent); flex-shrink: 0; margin-top: 2px; }

.review-section { margin-bottom: 22px; }
.review-section h4 {
  font-size: 12.5px; font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.review-section h4 .pill {
  font-size: 11px; padding: 2px 8px; border-radius: 6px;
  font-weight: 600;
  background: var(--accent-soft); color: var(--accent-deep);
}

.review-list { display: flex; flex-direction: column; gap: 10px; }

.review-item {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 12px;
  padding: 14px 16px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.15s ease;
}
.review-item:hover { border-color: var(--border-strong); }
.review-item.unchecked { opacity: 0.55; background: var(--subtle); }

.review-checkbox {
  appearance: none;
  width: 18px; height: 18px; border-radius: 5px;
  border: 1.5px solid var(--border-strong);
  cursor: pointer; margin-top: 2px;
  position: relative;
  transition: all 0.15s ease;
}
.review-checkbox:checked { background: var(--accent); border-color: var(--accent); }
.review-checkbox:checked::after {
  content: ""; position: absolute; left: 5px; top: 2px;
  width: 5px; height: 9px; border: 2px solid white; border-top: 0; border-left: 0;
  transform: rotate(45deg);
}

.review-body { min-width: 0; display: flex; flex-direction: column; gap: 8px; }

.review-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.review-title-input {
  flex: 1; min-width: 200px;
  font: inherit; font-size: 14px; font-weight: 600;
  color: var(--text);
  background: transparent; border: 1px solid transparent;
  padding: 4px 8px; margin: -4px -8px;
  border-radius: 6px; outline: none;
  transition: all 0.12s ease;
}
.review-title-input:hover { background: var(--subtle); }
.review-title-input:focus { background: white; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(110, 91, 201, 0.12); }

.review-meta-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.review-reasoning {
  font-size: 11.5px; color: var(--text-tertiary);
  line-height: 1.45;
  display: flex; gap: 6px; align-items: flex-start;
  font-style: italic;
}
.review-reasoning i { width: 11px; height: 11px; flex-shrink: 0; margin-top: 2px; }

.review-edit-line {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  font-size: 12px;
  background: var(--subtle); padding: 6px 10px; border-radius: 8px;
}
.review-edit-line .from { color: var(--text-tertiary); text-decoration: line-through; }
.review-edit-line .to { color: var(--accent-deep); font-weight: 600; }
.review-edit-line .arrow { color: var(--text-tertiary); }
.review-edit-line .field { color: var(--text-secondary); font-weight: 500; }

.review-actions { display: flex; gap: 6px; align-items: flex-start; }

/* Settings AI tab */
.api-key-card { display: flex; flex-direction: column; gap: 8px; }
.api-key-row {
  display: flex; gap: 8px; align-items: center;
}
.api-key-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border); background: var(--subtle);
  border-radius: 10px;
  font: inherit; font-size: 13px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  outline: none;
  transition: all 0.15s ease;
}
.api-key-input:focus { border-color: var(--accent); background: white; box-shadow: 0 0 0 3px rgba(110, 91, 201, 0.12); }
.api-key-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 500;
  padding: 4px 10px; border-radius: 999px;
}
.api-key-status.set { background: var(--low-bg); color: var(--low-fg); }
.api-key-status.unset { background: var(--high-bg); color: var(--high-fg); }
.api-key-status .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ============== TOAST ================================ */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--text); color: white;
  padding: 12px 18px; border-radius: 12px;
  font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast i { width: 16px; height: 16px; color: var(--state-done); }

/* ============== RESPONSIVE =========================== */
@media (max-width: 1280px) {
  .content { grid-template-columns: minmax(0, 1fr) 400px; }
}

@media (max-width: 1100px) {
  .content { grid-template-columns: 1fr; }
  .detail-panel {
    position: fixed; right: 0; top: 64px; bottom: 0;
    width: 100%; max-width: 480px;
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 30;
  }
  .detail-panel.open { transform: translateX(0); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%); transition: transform 0.2s ease;
    z-index: 60;
  }
  .sidebar.open { transform: translateX(0); }
  .menu-btn { display: inline-flex !important; }
  .sidebar-backdrop {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 50;
    animation: fadeIn 0.18s ease;
  }
  .main { margin-left: 0; }
  .topbar { padding: 0 12px; gap: 6px; }
  .tasks-area { padding: 20px 16px 40px; }
  .view-toggle .view-btn span { display: none; }
  .bcrumb-item:not(.active) { display: none; }
}

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

/* Hamburger button — only visible on mobile (made visible inside the media query) */
.menu-btn {
  display: none;
  align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  flex-shrink: 0;
}
.menu-btn:hover { background: var(--subtle); }
.menu-btn i { width: 18px; height: 18px; }
.sidebar-backdrop { display: block; }
.sidebar-backdrop[hidden] { display: none; }

/* Import target project selector at the top of the import modal */
.import-target-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--subtle);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 13px;
}
.import-target-row label { font-weight: 600; color: var(--text); }
.import-target-row select {
  padding: 6px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: white;
  font-size: 13px; color: var(--text);
}
.import-target-hint { font-size: 11.5px; color: var(--text-tertiary); flex: 1; min-width: 200px; }

/* ============== AUTH OVERLAY ============================ */
.auth-overlay {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, #F4F0FF 0%, #FFFFFF 60%, #E8F4FF 100%);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 24px;
}
.auth-overlay[hidden] { display: none; }
.auth-card {
  width: 100%; max-width: 380px;
  background: white;
  border-radius: 18px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.10), 0 4px 12px rgba(0, 0, 0, 0.04);
  padding: 32px 28px;
  text-align: center;
}
.auth-brand {
  font-weight: 700; font-size: 14px; letter-spacing: 0.5px;
  color: var(--accent-deep, #5B5FEF);
  margin-bottom: 28px;
  text-transform: uppercase;
}
.auth-state { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.auth-state[hidden] { display: none; }
.auth-state h2 {
  font-size: 21px; font-weight: 700; letter-spacing: -0.02em;
  color: var(--text);
  margin: 0;
}
.auth-muted { font-size: 13.5px; color: var(--text-secondary); line-height: 1.5; margin: 0; }
.auth-muted strong { color: var(--text); font-weight: 600; }
.auth-icon { width: 36px; height: 36px; }
.auth-icon.ok { color: #2D7A4D; }
.auth-icon.err { color: #B8395E; }

.auth-spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent-deep, #5B5FEF);
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }

#auth-form {
  display: flex; flex-direction: column; gap: 10px;
  width: 100%;
  margin-top: 4px;
}
#auth-form input[type="email"] {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  background: white;
  color: var(--text);
}
#auth-form input[type="email"]:focus {
  outline: none;
  border-color: var(--accent-deep, #5B5FEF);
  box-shadow: 0 0 0 3px rgba(91, 95, 239, 0.12);
}
#auth-form .btn { padding: 12px; font-size: 14px; }

#auth-try-again { margin-top: 6px; }

@media (max-width: 480px) {
  .auth-card { padding: 28px 20px; max-width: 100%; }
  .auth-state h2 { font-size: 19px; }
}
